Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 54715 Details for
Bug 164679
[StatusHandling] StatusManager - remove use of 1.4 API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Removes use of 1.4 API
patchStatusM.txt (text/plain), 3.30 KB, created by
Szymon Brandys
on 2006-11-29 10:21:41 EST
(
hide
)
Description:
Removes use of 1.4 API
Filename:
MIME Type:
Creator:
Szymon Brandys
Created:
2006-11-29 10:21:41 EST
Size:
3.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/statushandling/StatusManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandling/StatusManager.java,v >retrieving revision 1.2 >diff -u -r1.2 StatusManager.java >--- Eclipse UI/org/eclipse/ui/statushandling/StatusManager.java 14 Nov 2006 13:33:20 -0000 1.2 >+++ Eclipse UI/org/eclipse/ui/statushandling/StatusManager.java 29 Nov 2006 15:19:05 -0000 >@@ -293,34 +293,48 @@ > * the handler to add > */ > public void addHandler(AbstractStatusHandler handler) { >- add(this.map, getPattern(handler), handler); >+ add(this.map, getPrefix(handler), handler); > } > >- private void add(Map map, String pattern, AbstractStatusHandler handler) { >- if (pattern == null) { >+ /* >+ * Recursively searches the tree for the best place for the handler >+ */ >+ private void add(Map map, String prefix, AbstractStatusHandler handler) { >+ if (prefix == null) { > if (map.get(ASTERISK) == null) { > map.put(ASTERISK, new ArrayList()); > } > > ((List) map.get(ASTERISK)).add(handler); > } else { >+ int delimIndex = prefix.indexOf("."); //$NON-NLS-1$ > >- String s[] = pattern.split("\\.|$", 2); //$NON-NLS-1$ >+ String pre = null; >+ String post = null; > >- if (map.get(s[0]) == null) { >- map.put(s[0], new HashMap()); >+ if (delimIndex != -1) { >+ pre = prefix.substring(0, delimIndex); >+ >+ if (delimIndex < prefix.length() - 1) { >+ post = prefix.substring(delimIndex + 1); >+ } >+ } else { >+ pre = prefix; > } > >- add((Map) map.get(s[0]), >- (s[1].equals("") ? null : s[1]), handler); //$NON-NLS-1$ >+ if (map.get(pre) == null) { >+ map.put(pre, new HashMap()); >+ } >+ >+ add((Map) map.get(pre), post, handler); > } > } > >- private String getPattern(AbstractStatusHandler handler) { >- Object pattern = handler.getParam("pattern"); //$NON-NLS-1$ >+ private String getPrefix(AbstractStatusHandler handler) { >+ Object prefix = handler.getParam("prefix"); //$NON-NLS-1$ > >- if (pattern != null) { >- return (String) pattern; >+ if (prefix != null) { >+ return (String) prefix; > } > > return null; >@@ -337,18 +351,35 @@ > return get(pluginId, this.map); > } > >+ /* >+ * Recursively searches the prefix tree for the most specific handler >+ * for the given pluginId. >+ */ > private List get(String pluginId, Map map) { > if (pluginId == null) { > return getAsteriskList(map); > } > >- String s[] = pluginId.split("\\.|$", 2); //$NON-NLS-1$ >+ int delimIndex = pluginId.indexOf("."); //$NON-NLS-1$ >+ >+ String pre = null; >+ String post = null; >+ >+ if (delimIndex != -1) { >+ pre = pluginId.substring(0, delimIndex); >+ >+ if (delimIndex < pluginId.length() - 1) { >+ post = pluginId.substring(delimIndex + 1); >+ } >+ } else { >+ pre = pluginId; >+ } > >- if (map.get(s[0]) == null) { >+ if (map.get(pre) == null) { > return getAsteriskList(map); > } > >- return get((s[1].equals("") ? null : s[1]), (Map) map.get(s[0])); //$NON-NLS-1$ >+ return get(post, (Map) map.get(pre)); > } > > private List getAsteriskList(Map map) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 164679
:
54715
|
54721