Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-11-23 10:52:23 +0000
committercletavernie2012-11-23 10:52:23 +0000
commit6424abf6e7e922c90a56eec84fd3f9b2de9dfae5 (patch)
tree8d3239a03710422cba8493b4dbe9ee2bb9aeda71 /extraplugins/uml/org.eclipse.papyrus.uml.export
parentc7ed19562dfcf443385c0213765c98ffc841409f (diff)
downloadorg.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.tar.gz
org.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.tar.xz
org.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.zip
391945: [Refactoring] Part 2: Refactoring on Kepler (0.10)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391945
Diffstat (limited to 'extraplugins/uml/org.eclipse.papyrus.uml.export')
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java4
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java5
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java14
4 files changed, 14 insertions, 12 deletions
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF b/extraplugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
index c42256b0888..b5871a18e45 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.papyrus.views.modelexplorer;bundle-version="0.10.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.0",
- org.eclipse.papyrus.uml.tools;bundle-version="0.10.0"
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 0.10.0.qualifier
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
index e119ac45ba9..c5b0f77b78b 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.uml.export;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -31,6 +32,8 @@ public class Activator extends AbstractUIPlugin {
/** The plugin. */
private static Activator plugin;
+ public static LogHelper log;
+
/**
* The constructor.
*/
@@ -56,6 +59,7 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ log = new LogHelper(this);
}
/*
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
index 811e1296ad0..b3bdf017afb 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
@@ -14,7 +14,6 @@
package org.eclipse.papyrus.uml.export.handlers;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@@ -49,8 +48,6 @@ import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
import org.eclipse.papyrus.infra.widgets.util.FileUtil;
-
-import org.eclipse.papyrus.uml.export.dialog.ExportProfilesIconsDialog;
import org.eclipse.papyrus.uml.export.dialog.ExportProfilesParametersDialog;
import org.eclipse.papyrus.uml.export.dialog.ProfilesToExportSelectionDialog;
import org.eclipse.papyrus.uml.export.messages.Messages;
@@ -146,7 +143,7 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {
- ServiceUtilsForActionHandlers serviceUtils = new ServiceUtilsForActionHandlers();
+ ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
UmlModel openedModel;
try {
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
index 1705cd006bc..8e76f40ad1e 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
@@ -18,7 +18,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.uml.export.Activator;
import org.eclipse.papyrus.uml.tools.model.UmlModel;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
@@ -57,10 +59,10 @@ public class AreThereAppliedProfilesFromWS extends PropertyTester {
Object currentValue = null;
if(ARE_THERE_APPLIED_PROFILES.equals(property)) {
- ServiceUtilsForActionHandlers serviceUtils = new ServiceUtilsForActionHandlers();
+ ServicesRegistry registry = ((IMultiDiagramEditor)editor).getServicesRegistry();
UmlModel openedModel;
try {
- openedModel = (UmlModel)serviceUtils.getModelSet().getModel(UmlModel.MODEL_ID);
+ openedModel = (UmlModel)ServiceUtils.getInstance().getModelSet(registry).getModel(UmlModel.MODEL_ID);
EObject root = openedModel.lookupRoot();
Object[] profiles = ProfileUtil.getAppliedProfilesFromWS(root);
@@ -72,11 +74,9 @@ public class AreThereAppliedProfilesFromWS extends PropertyTester {
}
return (currentValue == expectedValue);
} catch (ServiceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Activator.log.error(e);
} catch (NotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Activator.log.error(e);
}
}

Back to the top