Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-04-30 18:57:34 -0400
committerAndre Weinand2004-04-30 18:57:34 -0400
commit9b2209c67e6d877e41d106b0adbb6a46d388d8e6 (patch)
treeddaf4bfa9e9b394a9b0e03cca89c4b8b0ae35d09 /bundles/org.eclipse.compare/compare
parent0f1171daa9e7e2a7d0b1e8e1e33612ed3eb0b135 (diff)
downloadeclipse.platform.team-9b2209c67e6d877e41d106b0adbb6a46d388d8e6.tar.gz
eclipse.platform.team-9b2209c67e6d877e41d106b0adbb6a46d388d8e6.tar.xz
eclipse.platform.team-9b2209c67e6d877e41d106b0adbb6a46d388d8e6.zip
fixed #59273v20040503
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java57
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java10
2 files changed, 48 insertions, 19 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index 26c08241e..ece05fb69 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -69,7 +69,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
void register(IConfigurationElement element, Object data) {
String id= element.getAttribute(ID_ATTRIBUTE);
- if (id != null) {
+ if (id != null) {
if (fIdMap == null)
fIdMap= new HashMap();
fIdMap.put(id, data);
@@ -269,12 +269,13 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
IConfigurationElement[] elements= registry.getConfigurationElementsFor(PLUGIN_ID, STREAM_MERGER_EXTENSION_POINT);
for (int i= 0; i < elements.length; i++) {
IConfigurationElement element= elements[i];
- String name= element.getName();
- if (CONTENT_TYPE_BINDING.equals(name)) {
- fStreamMergers.createBinding(element, STREAM_MERGER_ID_ATTRIBUTE);
- } else if (STREAM_MERGER.equals(name)) {
+ if (STREAM_MERGER.equals(element.getName()))
fStreamMergers.register(element, new StreamMergerDescriptor(element));
- }
+ }
+ for (int i= 0; i < elements.length; i++) {
+ IConfigurationElement element= elements[i];
+ if (CONTENT_TYPE_BINDING.equals(element.getName()))
+ fStreamMergers.createBinding(element, STREAM_MERGER_ID_ATTRIBUTE);
}
// collect all IStructureCreators
@@ -282,48 +283,68 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
for (int i= 0; i < elements.length; i++) {
IConfigurationElement element= elements[i];
String name= element.getName();
- if (CONTENT_TYPE_BINDING.equals(name)) {
- fStructureCreators.createBinding(element, STRUCTURE_CREATOR_ID_ATTRIBUTE);
- } else /* if (STRUCTURE_CREATOR.equals(name))*/ {
+ if (!CONTENT_TYPE_BINDING.equals(name)) {
+ if (!STRUCTURE_CREATOR.equals(name))
+ logErrorMessage(Utilities.getFormattedString("CompareUIPlugin.unexpectedTag", name, STRUCTURE_CREATOR)); //$NON-NLS-1$
fStructureCreators.register(element, new StructureCreatorDescriptor(element));
}
}
+ for (int i= 0; i < elements.length; i++) {
+ IConfigurationElement element= elements[i];
+ if (CONTENT_TYPE_BINDING.equals(element.getName()))
+ fStructureCreators.createBinding(element, STRUCTURE_CREATOR_ID_ATTRIBUTE);
+ }
// collect all viewers which define the structure mergeviewer extension point
elements= registry.getConfigurationElementsFor(PLUGIN_ID, STRUCTURE_MERGE_VIEWER_EXTENSION_POINT);
for (int i= 0; i < elements.length; i++) {
IConfigurationElement element= elements[i];
String name= element.getName();
- if (CONTENT_TYPE_BINDING.equals(name)) {
- fStructureMergeViewers.createBinding(element, STRUCTURE_MERGE_VIEWER_ID_ATTRIBUTE);
- } else if (VIEWER_TAG.equals(name)) {
+ if (!CONTENT_TYPE_BINDING.equals(name)) {
+ if (!VIEWER_TAG.equals(name))
+ logErrorMessage(Utilities.getFormattedString("CompareUIPlugin.unexpectedTag", name, VIEWER_TAG)); //$NON-NLS-1$
fStructureMergeViewers.register(element, new ViewerDescriptor(element));
}
}
+ for (int i= 0; i < elements.length; i++) {
+ IConfigurationElement element= elements[i];
+ if (CONTENT_TYPE_BINDING.equals(element.getName()))
+ fStructureMergeViewers.createBinding(element, STRUCTURE_MERGE_VIEWER_ID_ATTRIBUTE);
+ }
// collect all viewers which define the content mergeviewer extension point
elements= registry.getConfigurationElementsFor(PLUGIN_ID, CONTENT_MERGE_VIEWER_EXTENSION_POINT);
for (int i= 0; i < elements.length; i++) {
IConfigurationElement element= elements[i];
String name= element.getName();
- if (CONTENT_TYPE_BINDING.equals(name)) {
- fContentMergeViewers.createBinding(element, CONTENT_MERGE_VIEWER_ID_ATTRIBUTE);
- } else if (VIEWER_TAG.equals(name)) {
+ if (!CONTENT_TYPE_BINDING.equals(name)) {
+ if (!VIEWER_TAG.equals(name))
+ logErrorMessage(Utilities.getFormattedString("CompareUIPlugin.unexpectedTag", name, VIEWER_TAG)); //$NON-NLS-1$
fContentMergeViewers.register(element, new ViewerDescriptor(element));
}
}
+ for (int i= 0; i < elements.length; i++) {
+ IConfigurationElement element= elements[i];
+ if (CONTENT_TYPE_BINDING.equals(element.getName()))
+ fContentMergeViewers.createBinding(element, CONTENT_MERGE_VIEWER_ID_ATTRIBUTE);
+ }
// collect all viewers which define the content viewer extension point
elements= registry.getConfigurationElementsFor(PLUGIN_ID, CONTENT_VIEWER_EXTENSION_POINT);
for (int i= 0; i < elements.length; i++) {
IConfigurationElement element= elements[i];
String name= element.getName();
- if (CONTENT_TYPE_BINDING.equals(name)) {
- fContentViewers.createBinding(element, CONTENT_VIEWER_ID_ATTRIBUTE);
- } else if (VIEWER_TAG.equals(name)) {
+ if (!CONTENT_TYPE_BINDING.equals(name)) {
+ if (!VIEWER_TAG.equals(name))
+ logErrorMessage(Utilities.getFormattedString("CompareUIPlugin.unexpectedTag", name, VIEWER_TAG)); //$NON-NLS-1$
fContentViewers.register(element, new ViewerDescriptor(element));
}
}
+ for (int i= 0; i < elements.length; i++) {
+ IConfigurationElement element= elements[i];
+ if (CONTENT_TYPE_BINDING.equals(element.getName()))
+ fContentViewers.createBinding(element, CONTENT_VIEWER_ID_ATTRIBUTE);
+ }
}
public static IWorkbench getActiveWorkbench() {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 99089d379..5d3a5a1b6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -295,13 +295,21 @@ public class Utilities {
}
public static String getFormattedString(String key, String arg) {
- try{
+ try {
return MessageFormat.format(CompareUI.getResourceBundle().getString(key), new String[] { arg });
} catch (MissingResourceException e) {
return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
}
}
+ public static String getFormattedString(String key, String arg0, String arg1) {
+ try {
+ return MessageFormat.format(CompareUI.getResourceBundle().getString(key), new String[] { arg0, arg1 });
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+
public static String getString(ResourceBundle bundle, String key) {
return getString(bundle, key, key);
}

Back to the top