https://bugs.eclipse.org/bugs/show_bug.cgi?id=77405
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/plugin.xml b/deprecated/examples/org.eclipse.uml2.examples.ui/plugin.xml
index dd00b5a..9c90e57 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/plugin.xml
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/plugin.xml
@@ -12,7 +12,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: plugin.xml,v 1.15 2005/04/14 17:32:07 khussey Exp $
+ * $Id: plugin.xml,v 1.16 2005/06/02 14:29:46 khussey Exp $
*/
-->
@@ -21,7 +21,7 @@
version="1.1.0"
name="%pluginName"
provider-name="%providerName"
- class="org.eclipse.uml2.examples.ui.ExamplesUIPlugin">
+ class="org.eclipse.uml2.examples.ui.ExamplesUIPlugin$Implementation">
<requires>
<import plugin="org.eclipse.uml2.examples" export="true"/>
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/ExamplesUIPlugin.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/ExamplesUIPlugin.java
index 589dc7b..1af0686 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/ExamplesUIPlugin.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/ExamplesUIPlugin.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,79 +8,71 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ExamplesUIPlugin.java,v 1.3 2005/03/15 18:54:23 khussey Exp $
+ * $Id: ExamplesUIPlugin.java,v 1.4 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-
import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
/**
- *
+ * This is the central singleton for the UML2 examples UI plugin.
*/
public class ExamplesUIPlugin
- extends EMFPlugin.EclipsePlugin {
+ extends EMFPlugin {
- //The shared instance.
- private static ExamplesUIPlugin plugin;
-
- //Resource bundle.
- private ResourceBundle resourceBundle;
+ public static final String copyright = "Copyright (c) IBM Corporation and others."; //$NON-NLS-1$
/**
- * The constructor.
+ * Keep track of the singleton.
+ */
+ public static final ExamplesUIPlugin INSTANCE = new ExamplesUIPlugin();
+
+ /**
+ * Keep track of the singleton.
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
*/
public ExamplesUIPlugin() {
- super();
-
- plugin = this;
-
- try {
- resourceBundle = ResourceBundle
- .getBundle("org.eclipse.uml2.examples.ui.ExamplesUIPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
+ super(new ResourceLocator[]{});
}
/**
- * Returns the shared instance.
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
*/
- public static ExamplesUIPlugin getDefault() {
+ public ResourceLocator getPluginResourceLocator() {
return plugin;
}
/**
- * Returns the workspace instance.
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
*/
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
+ public static Implementation getPlugin() {
+ return plugin;
}
/**
- * Returns the string from the plugin's resource bundle, or 'key' if not
- * found.
+ * The actual implementation of the Eclipse <b>Plugin</b>.
*/
- public static String getResourceString(String key) {
- ResourceBundle bundle = ExamplesUIPlugin.getDefault()
- .getResourceBundle();
+ public static class Implementation
+ extends EclipsePlugin {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
+ /**
+ * Creates an instance.
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
}
}
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
}
\ No newline at end of file
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyProfileAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyProfileAction.java
index 02127de..e10d821 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyProfileAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyProfileAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ApplyProfileAction.java,v 1.8 2005/05/18 16:43:51 khussey Exp $
+ * $Id: ApplyProfileAction.java,v 1.9 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -123,13 +123,13 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_ApplyProfileActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ApplyProfileActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(), package_,
- UML2Package.eINSTANCE.getProfile(), Collections.EMPTY_LIST,
- label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ package_, UML2Package.eINSTANCE.getProfile(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyStereotypeAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyStereotypeAction.java
index e91da42..b056079 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyStereotypeAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ApplyStereotypeAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ApplyStereotypeAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: ApplyStereotypeAction.java,v 1.4 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -32,10 +32,10 @@
import org.eclipse.uml2.examples.ui.ExamplesUIPlugin;
/**
- *
+ *
*/
public class ApplyStereotypeAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public ApplyStereotypeAction() {
super();
@@ -91,13 +91,13 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_ApplyStereotypeActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ApplyStereotypeActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(), element,
- UML2Package.eINSTANCE.getElement(), Collections.EMPTY_LIST,
- label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ element, UML2Package.eINSTANCE.getElement(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertFromEcoreAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertFromEcoreAction.java
index aa052d3..b854ff8 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertFromEcoreAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertFromEcoreAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ConvertFromEcoreAction.java,v 1.1 2005/04/06 19:59:55 khussey Exp $
+ * $Id: ConvertFromEcoreAction.java,v 1.2 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -63,9 +63,9 @@
* @see org.eclipse.uml2.examples.ui.actions.UML2CommandAction#getAdapterFactory()
*/
protected AdapterFactory getAdapterFactory() {
- return null == editorPart
- ? null
- : ((EcoreEditor) editorPart).getAdapterFactory();
+ return workbenchPart instanceof EcoreEditor
+ ? ((EcoreEditor) workbenchPart).getAdapterFactory()
+ : null;
}
/*
@@ -102,11 +102,11 @@
final Map options = new HashMap();
OptionsDialog optionsDialog = new Ecore2UML2ConverterOptionsDialog(
- shell, ExamplesUIPlugin.getDefault().getString(
- "_UI_ConvertFromEcoreActionCommand_label",
+ shell, ExamplesUIPlugin.INSTANCE.getString(
+ "_UI_ConvertFromEcoreActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(ePackage)}),
- ExamplesUIPlugin.getDefault().getString(
- "_UI_OptionsDialog_message"), options);
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_OptionsDialog_message"), options); //$NON-NLS-1$
if (Window.OK == optionsDialog.open()) {
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
@@ -119,7 +119,7 @@
final BasicDiagnostic diagnostics = new BasicDiagnostic(
UML2Validator.DIAGNOSTIC_SOURCE, 0,
EcorePlugin.INSTANCE.getString(
- "_UI_DiagnosticRoot_diagnostic",
+ "_UI_DiagnosticRoot_diagnostic", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(ePackage)}),
new Object[]{ePackage});
@@ -128,9 +128,8 @@
context.put(UML2Util.QualifiedTextProvider.class,
qualifiedTextProvider);
- progressMonitor.beginTask(ExamplesUIPlugin
- .getDefault().getString(
- "_UI_ConvertingFromEcore_message",
+ progressMonitor.beginTask(ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ConvertingFromEcore_message", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(ePackage)}),
IProgressMonitor.UNKNOWN);
@@ -165,15 +164,15 @@
try {
((Resource) i.next()).save(null);
} catch (Exception e) {
- ExamplesUIPlugin.getDefault().log(e);
+ ExamplesUIPlugin.INSTANCE.log(e);
}
}
handleDiagnostic(progressMonitor.isCanceled()
? Diagnostic.CANCEL_INSTANCE
- : diagnostics, ExamplesUIPlugin.getDefault()
+ : diagnostics, ExamplesUIPlugin.INSTANCE
.getString(
- "_UI_ConvertFromEcoreActionCommand_label",
+ "_UI_ConvertFromEcoreActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(
ePackage)}));
@@ -192,7 +191,7 @@
new ProgressMonitorDialog(shell).run(false, true,
runnableWithProgress);
} catch (Exception exception) {
- ExamplesUIPlugin.getDefault().log(exception);
+ ExamplesUIPlugin.INSTANCE.log(exception);
}
}
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToEcoreAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToEcoreAction.java
index bd4a36d..e8d38af 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToEcoreAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToEcoreAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ConvertToEcoreAction.java,v 1.6 2005/04/06 19:59:55 khussey Exp $
+ * $Id: ConvertToEcoreAction.java,v 1.7 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -92,11 +92,11 @@
final Map options = new HashMap();
OptionsDialog optionsDialog = new UML22EcoreConverterOptionsDialog(
- shell, ExamplesUIPlugin.getDefault().getString(
- "_UI_ConvertToEcoreActionCommand_label",
+ shell, ExamplesUIPlugin.INSTANCE.getString(
+ "_UI_ConvertToEcoreActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(package_)}),
- ExamplesUIPlugin.getDefault().getString(
- "_UI_OptionsDialog_message"), options);
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_OptionsDialog_message"), options); //$NON-NLS-1$
if (Window.OK == optionsDialog.open()) {
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
@@ -109,7 +109,7 @@
final BasicDiagnostic diagnostics = new BasicDiagnostic(
UML2Validator.DIAGNOSTIC_SOURCE, 0,
EcorePlugin.INSTANCE.getString(
- "_UI_DiagnosticRoot_diagnostic",
+ "_UI_DiagnosticRoot_diagnostic", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(package_)}),
new Object[]{package_});
@@ -118,9 +118,8 @@
context.put(UML2Util.QualifiedTextProvider.class,
qualifiedTextProvider);
- progressMonitor.beginTask(ExamplesUIPlugin
- .getDefault().getString(
- "_UI_ConvertingToEcore_message",
+ progressMonitor.beginTask(ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ConvertingToEcore_message", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(package_)}),
IProgressMonitor.UNKNOWN);
@@ -154,15 +153,15 @@
try {
((Resource) i.next()).save(null);
} catch (Exception e) {
- ExamplesUIPlugin.getDefault().log(e);
+ ExamplesUIPlugin.INSTANCE.log(e);
}
}
handleDiagnostic(progressMonitor.isCanceled()
? Diagnostic.CANCEL_INSTANCE
- : diagnostics, ExamplesUIPlugin.getDefault()
+ : diagnostics, ExamplesUIPlugin.INSTANCE
.getString(
- "_UI_ConvertToEcoreActionCommand_label",
+ "_UI_ConvertToEcoreActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(
package_)}));
@@ -181,7 +180,7 @@
new ProgressMonitorDialog(shell).run(false, true,
runnableWithProgress);
} catch (Exception exception) {
- ExamplesUIPlugin.getDefault().log(exception);
+ ExamplesUIPlugin.INSTANCE.log(exception);
}
}
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToMetamodelAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToMetamodelAction.java
index 21c3ed2..1a3151f 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToMetamodelAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToMetamodelAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ConvertToMetamodelAction.java,v 1.3 2005/05/18 21:43:38 khussey Exp $
+ * $Id: ConvertToMetamodelAction.java,v 1.4 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -104,7 +104,7 @@
}.doSwitch(model);
}
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_ConvertToMetamodelActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(model)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToModelLibraryAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToModelLibraryAction.java
index fd69b6d..708ab9e 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToModelLibraryAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ConvertToModelLibraryAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ConvertToModelLibraryAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: ConvertToModelLibraryAction.java,v 1.3 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -54,7 +54,7 @@
.getOwnedStereotype(STEREOTYPE_NAME__MODEL_LIBRARY));
}
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_ConvertToModelLibraryActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(model)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/CreateExtensionAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/CreateExtensionAction.java
index 9e050e7..60864cb 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/CreateExtensionAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/CreateExtensionAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: CreateExtensionAction.java,v 1.6 2005/05/18 16:43:51 khussey Exp $
+ * $Id: CreateExtensionAction.java,v 1.7 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -90,11 +90,11 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_CreateExtensionActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_CreateExtensionActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(),
+ workbenchPart.getSite().getShell(), getLabelProvider(),
stereotype, UML2Package.eINSTANCE.getStereotype(),
Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DefineProfileAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DefineProfileAction.java
index 5be890b..1ab5be6 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DefineProfileAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DefineProfileAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: DefineProfileAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: DefineProfileAction.java,v 1.4 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -22,10 +22,10 @@
import org.eclipse.uml2.examples.ui.ExamplesUIPlugin;
/**
- *
+ *
*/
public class DefineProfileAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public DefineProfileAction() {
super();
@@ -51,10 +51,10 @@
public void run() {
((Profile) collection.toArray()[0]).define();
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_DefineProfileActionCommand_label", //$NON-NLS-1$
- new Object[] {getLabelProvider().getText(
- collection.toArray()[0])}));
+ new Object[]{getLabelProvider()
+ .getText(collection.toArray()[0])}));
}
return UnexecutableCommand.INSTANCE;
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DestroyElementAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DestroyElementAction.java
index a14694d..e1abc4c 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DestroyElementAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DestroyElementAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: DestroyElementAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: DestroyElementAction.java,v 1.4 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -22,10 +22,10 @@
import org.eclipse.uml2.examples.ui.ExamplesUIPlugin;
/**
- *
+ *
*/
public class DestroyElementAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public DestroyElementAction() {
super();
@@ -49,10 +49,10 @@
public void run() {
((Element) collection.toArray()[0]).destroy();
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_DestroyElementActionCommand_label", //$NON-NLS-1$
- new Object[] {getLabelProvider().getText(
- collection.toArray()[0])}));
+ new Object[]{getLabelProvider()
+ .getText(collection.toArray()[0])}));
}
return UnexecutableCommand.INSTANCE;
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DiagnosticAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DiagnosticAction.java
index 7c1e5b4..013cc71 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DiagnosticAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/DiagnosticAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: DiagnosticAction.java,v 1.4 2005/03/15 18:54:23 khussey Exp $
+ * $Id: DiagnosticAction.java,v 1.5 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -53,12 +53,12 @@
public class DiagnosticAction
extends UML2CommandAction {
- protected static final String URI_SCHEME_PLATFORM = "platform";
+ protected static final String URI_SCHEME_PLATFORM = "platform"; //$NON-NLS-1$
- protected static final String URI_SEGMENT_RESOURCE = "resource";
+ protected static final String URI_SEGMENT_RESOURCE = "resource"; //$NON-NLS-1$
protected final Bundle resourcesBundle = Platform
- .getBundle("org.eclipse.core.resources");
+ .getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
protected final ValidateAction.EclipseResourcesUtil eclipseResourcesUtil = null == resourcesBundle
? null
@@ -104,22 +104,22 @@
case Diagnostic.OK :
MessageDialog.openInformation(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), dialogTitle,
- ExamplesUIPlugin.getDefault().getString(
- "_UI_DiagnosticOK_message"));
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_DiagnosticOK_message")); //$NON-NLS-1$
break;
case Diagnostic.INFO :
ErrorDialog.openError(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), dialogTitle,
- ExamplesUIPlugin.getDefault().getString(
- "_UI_DiagnosticOK_message"), BasicDiagnostic
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_DiagnosticOK_message"), BasicDiagnostic //$NON-NLS-1$
.toIStatus(diagnostic));
break;
default :
ErrorDialog.openError(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), dialogTitle,
- ExamplesUIPlugin.getDefault().getString(
- "_UI_DiagnosticProblems_message"), BasicDiagnostic
- .toIStatus(diagnostic));
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_DiagnosticProblems_message"), //$NON-NLS-1$
+ BasicDiagnostic.toIStatus(diagnostic));
}
if (null != resourcesBundle) {
@@ -139,7 +139,7 @@
file.deleteMarkers(EValidator.MARKER, true,
IResource.DEPTH_ZERO);
} catch (CoreException exception) {
- ExamplesUIPlugin.getDefault().log(exception);
+ ExamplesUIPlugin.INSTANCE.log(exception);
}
fileToDiagnosticMap.put(file,
@@ -171,12 +171,12 @@
if (!data.isEmpty() && data.get(0) instanceof EObject) {
- if (editorPart instanceof ISetSelectionTarget) {
- ((ISetSelectionTarget) editorPart)
+ if (workbenchPart instanceof ISetSelectionTarget) {
+ ((ISetSelectionTarget) workbenchPart)
.selectReveal(new StructuredSelection(data
.get(0)));
- } else if (editorPart instanceof IViewerProvider) {
- Viewer viewer = ((IViewerProvider) editorPart)
+ } else if (workbenchPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider) workbenchPart)
.getViewer();
if (null != viewer) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ExternalizeLabelsAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ExternalizeLabelsAction.java
index 25327e5..18a5c0b 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ExternalizeLabelsAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ExternalizeLabelsAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ExternalizeLabelsAction.java,v 1.1 2005/04/14 17:32:07 khussey Exp $
+ * $Id: ExternalizeLabelsAction.java,v 1.2 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -64,10 +64,10 @@
String qualifiedName = namedElement.getQualifiedName();
if (!isEmpty(qualifiedName)) {
- propertiesWriter.println(getPropertiesKey("_label_",
+ propertiesWriter.println(getPropertiesKey("_label_", //$NON-NLS-1$
qualifiedName)
+ PROPERTIES_SEPARATOR
- + format(capName(namedElement.getLabel()), " ",
+ + format(capName(namedElement.getLabel()), " ", //$NON-NLS-1$
null, false));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateBasicStereotypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateBasicStereotypesAction.java
index 07f43bc..67034ab 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateBasicStereotypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateBasicStereotypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateBasicStereotypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateBasicStereotypesAction.java,v 1.3 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -156,7 +156,7 @@
profile, "Utility", false); //$NON-NLS-1$
generateExtension(utilityStereotype, classMetaclass, false);
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateBasicStereotypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(profile)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateCompleteStereotypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateCompleteStereotypesAction.java
index ece038a..7c75483 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateCompleteStereotypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateCompleteStereotypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateCompleteStereotypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateCompleteStereotypesAction.java,v 1.3 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -58,7 +58,7 @@
generateExtension(systemModelStereotype, modelMetaclass,
false);
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateCompleteStereotypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(profile)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcorePrimitiveTypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcorePrimitiveTypesAction.java
index 1fdf30c..d19d14e 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcorePrimitiveTypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcorePrimitiveTypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateEcorePrimitiveTypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateEcorePrimitiveTypesAction.java,v 1.3 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -72,9 +72,9 @@
}
}.doSwitch(EcorePackage.eINSTANCE);
}
- }, ExamplesUIPlugin.getDefault().getString(
- "_UI_GenerateEcorePrimitiveTypesActionCommand_label",
- new Object[]{getLabelProvider().getText(model)})); //$NON-NLS-1$
+ }, ExamplesUIPlugin.INSTANCE.getString(
+ "_UI_GenerateEcorePrimitiveTypesActionCommand_label", //$NON-NLS-1$
+ new Object[]{getLabelProvider().getText(model)}));
}
return UnexecutableCommand.INSTANCE;
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcoreStereotypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcoreStereotypesAction.java
index a0965f3..46023de 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcoreStereotypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateEcoreStereotypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateEcoreStereotypesAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateEcoreStereotypesAction.java,v 1.4 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -159,9 +159,11 @@
generateOwnedLiteral(featureKindEnumeration, "Unspecified"); //$NON-NLS-1$
generateOwnedLiteral(featureKindEnumeration, "Simple"); //$NON-NLS-1$
generateOwnedLiteral(featureKindEnumeration, "Attribute"); //$NON-NLS-1$
- generateOwnedLiteral(featureKindEnumeration, "AttributeWildcard"); //$NON-NLS-1$
+ generateOwnedLiteral(featureKindEnumeration,
+ "AttributeWildcard"); //$NON-NLS-1$
generateOwnedLiteral(featureKindEnumeration, "Element"); //$NON-NLS-1$
- generateOwnedLiteral(featureKindEnumeration, "ElementWildcard"); //$NON-NLS-1$
+ generateOwnedLiteral(featureKindEnumeration,
+ "ElementWildcard"); //$NON-NLS-1$
generateOwnedLiteral(featureKindEnumeration, "Group"); //$NON-NLS-1$
Enumeration visibilityKindEnumeration = generateOwnedEnumeration(
@@ -220,7 +222,7 @@
"isResolveProxies", booleanPrimitiveType, 0, 1) //$NON-NLS-1$
.setBooleanDefault(true);
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateEcoreStereotypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(profile)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateIntermediateStereotypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateIntermediateStereotypesAction.java
index 8b0cb58..29cf058 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateIntermediateStereotypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateIntermediateStereotypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateIntermediateStereotypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateIntermediateStereotypesAction.java,v 1.3 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -106,7 +106,7 @@
generateExtension(subsystemStereotype, componentMetaclass,
false);
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateIntermediateStereotypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(profile)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateJavaPrimitiveTypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateJavaPrimitiveTypesAction.java
index a0054ed..1a1aa3e 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateJavaPrimitiveTypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateJavaPrimitiveTypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateJavaPrimitiveTypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateJavaPrimitiveTypesAction.java,v 1.3 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -51,7 +51,7 @@
generateOwnedPrimitiveType(model, "long"); //$NON-NLS-1$
generateOwnedPrimitiveType(model, "short"); //$NON-NLS-1$
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateJavaPrimitiveTypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(model)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateUML2PrimitiveTypesAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateUML2PrimitiveTypesAction.java
index c8a8b49..5c1cdff 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateUML2PrimitiveTypesAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/GenerateUML2PrimitiveTypesAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: GenerateUML2PrimitiveTypesAction.java,v 1.2 2005/05/18 16:43:51 khussey Exp $
+ * $Id: GenerateUML2PrimitiveTypesAction.java,v 1.3 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -47,7 +47,7 @@
generateOwnedPrimitiveType(model, "String"); //$NON-NLS-1$
generateOwnedPrimitiveType(model, "UnlimitedNatural"); //$NON-NLS-1$
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_GenerateUML2PrimitiveTypesActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(model)}));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ImportPrimitiveTypeAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ImportPrimitiveTypeAction.java
index 2bf5578..fd60209 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ImportPrimitiveTypeAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ImportPrimitiveTypeAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ImportPrimitiveTypeAction.java,v 1.4 2005/05/18 16:43:51 khussey Exp $
+ * $Id: ImportPrimitiveTypeAction.java,v 1.5 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -35,10 +35,10 @@
import org.eclipse.uml2.util.UML2Resource;
/**
- *
+ *
*/
public class ImportPrimitiveTypeAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public ImportPrimitiveTypeAction() {
super();
@@ -156,13 +156,13 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_ImportPrimitiveTypeActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ImportPrimitiveTypeActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(),
- package_, UML2Package.eINSTANCE.getPackageableElement(),
- Collections.EMPTY_LIST, label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ package_, UML2Package.eINSTANCE.getPackageableElement(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/MergePackageAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/MergePackageAction.java
index c8fa6de..d313bef 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/MergePackageAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/MergePackageAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: MergePackageAction.java,v 1.6 2005/05/18 16:43:51 khussey Exp $
+ * $Id: MergePackageAction.java,v 1.7 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -85,11 +85,11 @@
final Map options = new HashMap();
OptionsDialog optionsDialog = new PackageMergerOptionsDialog(shell,
- ExamplesUIPlugin.getDefault().getString(
- "_UI_MergePackageActionCommand_label",
+ ExamplesUIPlugin.INSTANCE.getString(
+ "_UI_MergePackageActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(package_)}),
- ExamplesUIPlugin.getDefault().getString(
- "_UI_OptionsDialog_message"), options);
+ ExamplesUIPlugin.INSTANCE
+ .getString("_UI_OptionsDialog_message"), options); //$NON-NLS-1$
if (Window.OK == optionsDialog.open()) {
editingDomain.getCommandStack().execute(
@@ -110,7 +110,7 @@
0,
EcorePlugin.INSTANCE
.getString(
- "_UI_DiagnosticRoot_diagnostic",
+ "_UI_DiagnosticRoot_diagnostic", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(package_)}),
new Object[]{package_});
@@ -123,10 +123,9 @@
progressMonitor
.beginTask(
- ExamplesUIPlugin
- .getDefault()
+ ExamplesUIPlugin.INSTANCE
.getString(
- "_UI_MergingPackage_message",
+ "_UI_MergingPackage_message", //$NON-NLS-1$
new Object[]{substitutionLabelProvider
.getObjectLabel(package_)}),
IProgressMonitor.UNKNOWN);
@@ -138,10 +137,9 @@
progressMonitor.isCanceled()
? Diagnostic.CANCEL_INSTANCE
: diagnostics,
- ExamplesUIPlugin
- .getDefault()
+ ExamplesUIPlugin.INSTANCE
.getString(
- "_UI_MergePackageActionCommand_label",
+ "_UI_MergePackageActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider()
.getText(package_)}));
} finally {
@@ -159,10 +157,10 @@
new ProgressMonitorDialog(shell).run(false,
true, runnableWithProgress);
} catch (Exception exception) {
- ExamplesUIPlugin.getDefault().log(exception);
+ ExamplesUIPlugin.INSTANCE.log(exception);
}
}
- }, ExamplesUIPlugin.getDefault().getString(
+ }, ExamplesUIPlugin.INSTANCE.getString(
"_UI_MergePackageActionCommand_label", //$NON-NLS-1$
new Object[]{getLabelProvider().getText(package_)})));
}
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
index 071074c..f55bf98 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ReferenceMetaclassAction.java,v 1.5 2005/05/18 16:43:51 khussey Exp $
+ * $Id: ReferenceMetaclassAction.java,v 1.6 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -34,10 +34,10 @@
import org.eclipse.uml2.util.UML2Resource;
/**
- *
+ *
*/
public class ReferenceMetaclassAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public ReferenceMetaclassAction() {
super();
@@ -103,13 +103,13 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_ReferenceMetaclassActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_ReferenceMetaclassActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(),
- profile, UML2Package.eINSTANCE.getClass_(),
- Collections.EMPTY_LIST, label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ profile, UML2Package.eINSTANCE.getClass_(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UML2CommandAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UML2CommandAction.java
index 317e271..9d3c85b 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UML2CommandAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UML2CommandAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: UML2CommandAction.java,v 1.5 2005/05/18 16:43:51 khussey Exp $
+ * $Id: UML2CommandAction.java,v 1.6 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -38,9 +38,9 @@
}
protected AdapterFactory getAdapterFactory() {
- return null == editorPart
- ? null
- : ((UML2Editor) editorPart).getAdapterFactory();
+ return workbenchPart instanceof UML2Editor
+ ? ((UML2Editor) workbenchPart).getAdapterFactory()
+ : null;
}
/*
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyProfileAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyProfileAction.java
index c0460f2..2d08dbd 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyProfileAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyProfileAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: UnapplyProfileAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: UnapplyProfileAction.java,v 1.4 2005/06/02 14:29:46 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -32,10 +32,10 @@
import org.eclipse.uml2.examples.ui.ExamplesUIPlugin;
/**
- *
+ *
*/
public class UnapplyProfileAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public UnapplyProfileAction() {
super();
@@ -92,15 +92,15 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
+ String label = ExamplesUIPlugin.INSTANCE.getString(
"_UI_UnapplyProfileActionCommand_label", //$NON-NLS-1$
- new Object[] {getLabelProvider().getText(
- collection.toArray()[0])});
+ new Object[]{getLabelProvider()
+ .getText(collection.toArray()[0])});
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(), package_,
- UML2Package.eINSTANCE.getProfile(), Collections.EMPTY_LIST,
- label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ package_, UML2Package.eINSTANCE.getProfile(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyStereotypeAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyStereotypeAction.java
index ed9405d..212977d 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyStereotypeAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/UnapplyStereotypeAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: UnapplyStereotypeAction.java,v 1.3 2005/05/18 16:43:51 khussey Exp $
+ * $Id: UnapplyStereotypeAction.java,v 1.4 2005/06/02 14:29:45 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -32,10 +32,10 @@
import org.eclipse.uml2.examples.ui.ExamplesUIPlugin;
/**
- *
+ *
*/
public class UnapplyStereotypeAction
- extends UML2CommandAction {
+ extends UML2CommandAction {
public UnapplyStereotypeAction() {
super();
@@ -89,13 +89,13 @@
}
});
- String label = ExamplesUIPlugin.getDefault().getString(
- "_UI_UnapplyStereotypeActionCommand_label"); //$NON-NLS-1$
+ String label = ExamplesUIPlugin.INSTANCE
+ .getString("_UI_UnapplyStereotypeActionCommand_label"); //$NON-NLS-1$
final FeatureEditorDialog dialog = new FeatureEditorDialog(
- editorPart.getSite().getShell(), getLabelProvider(), element,
- UML2Package.eINSTANCE.getElement(), Collections.EMPTY_LIST,
- label, choiceOfValues);
+ workbenchPart.getSite().getShell(), getLabelProvider(),
+ element, UML2Package.eINSTANCE.getElement(),
+ Collections.EMPTY_LIST, label, choiceOfValues);
dialog.open();
if (FeatureEditorDialog.OK == dialog.getReturnCode()) {
diff --git a/deprecated/examples/org.eclipse.uml2.examples/plugin.xml b/deprecated/examples/org.eclipse.uml2.examples/plugin.xml
index fd49bc3..7c70a8b 100644
--- a/deprecated/examples/org.eclipse.uml2.examples/plugin.xml
+++ b/deprecated/examples/org.eclipse.uml2.examples/plugin.xml
@@ -3,7 +3,7 @@
<!--
/*
- * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: plugin.xml,v 1.10 2005/03/15 18:54:14 khussey Exp $
+ * $Id: plugin.xml,v 1.11 2005/06/02 14:29:44 khussey Exp $
*/
-->
@@ -21,7 +21,7 @@
version="1.1.0"
name="%pluginName"
provider-name="%providerName"
- class="org.eclipse.uml2.examples.ExamplesPlugin">
+ class="org.eclipse.uml2.examples.ExamplesPlugin$Implementation">
<requires>
<import plugin="org.eclipse.uml2" export="true"/>
diff --git a/deprecated/examples/org.eclipse.uml2.examples/src/org/eclipse/uml2/examples/ExamplesPlugin.java b/deprecated/examples/org.eclipse.uml2.examples/src/org/eclipse/uml2/examples/ExamplesPlugin.java
index 59adae9..001a21f 100644
--- a/deprecated/examples/org.eclipse.uml2.examples/src/org/eclipse/uml2/examples/ExamplesPlugin.java
+++ b/deprecated/examples/org.eclipse.uml2.examples/src/org/eclipse/uml2/examples/ExamplesPlugin.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,78 +8,71 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ExamplesPlugin.java,v 1.3 2005/03/15 18:54:14 khussey Exp $
+ * $Id: ExamplesPlugin.java,v 1.4 2005/06/02 14:29:44 khussey Exp $
*/
package org.eclipse.uml2.examples;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-
import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
/**
- *
+ * This is the central singleton for the UML2 examples plugin.
*/
public class ExamplesPlugin
- extends EMFPlugin.EclipsePlugin {
+ extends EMFPlugin {
- //The shared instance.
- private static ExamplesPlugin plugin;
-
- //Resource bundle.
- private ResourceBundle resourceBundle;
+ public static final String copyright = "Copyright (c) IBM Corporation and others."; //$NON-NLS-1$
/**
- * The constructor.
+ * Keep track of the singleton.
+ */
+ public static final ExamplesPlugin INSTANCE = new ExamplesPlugin();
+
+ /**
+ * Keep track of the singleton.
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
*/
public ExamplesPlugin() {
- super();
-
- plugin = this;
-
- try {
- resourceBundle = ResourceBundle
- .getBundle("org.eclipse.uml2.examples.ExamplesPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
+ super(new ResourceLocator[]{});
}
/**
- * Returns the shared instance.
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
*/
- public static ExamplesPlugin getDefault() {
+ public ResourceLocator getPluginResourceLocator() {
return plugin;
}
/**
- * Returns the workspace instance.
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
*/
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
+ public static Implementation getPlugin() {
+ return plugin;
}
/**
- * Returns the string from the plugin's resource bundle, or 'key' if not
- * found.
+ * The actual implementation of the Eclipse <b>Plugin</b>.
*/
- public static String getResourceString(String key) {
- ResourceBundle bundle = ExamplesPlugin.getDefault().getResourceBundle();
+ public static class Implementation
+ extends EclipsePlugin {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
+ /**
+ * Creates an instance.
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
}
}
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
}
\ No newline at end of file
diff --git a/deprecated/plugins/org.eclipse.uml2.edit/src/org/eclipse/uml2/provider/ElementItemProvider.java b/deprecated/plugins/org.eclipse.uml2.edit/src/org/eclipse/uml2/provider/ElementItemProvider.java
index 815c1c5..9de142f 100644
--- a/deprecated/plugins/org.eclipse.uml2.edit/src/org/eclipse/uml2/provider/ElementItemProvider.java
+++ b/deprecated/plugins/org.eclipse.uml2.edit/src/org/eclipse/uml2/provider/ElementItemProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: ElementItemProvider.java,v 1.23 2005/05/18 16:40:46 khussey Exp $
+ * $Id: ElementItemProvider.java,v 1.24 2005/06/02 14:29:47 khussey Exp $
*/
package org.eclipse.uml2.provider;
@@ -260,6 +260,14 @@
return UML2EditPlugin.INSTANCE;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#shouldTranslate()
+ */
+ protected boolean shouldTranslate() {
+ return UML2EditPlugin.INSTANCE.shouldTranslate();
+ }
/*
* (non-Javadoc)
@@ -377,6 +385,4 @@
}
}
-
-
}