highlighting infrastructure added
diff --git a/org.eclipse.emf.refactor.smells.papyrus/META-INF/MANIFEST.MF b/org.eclipse.emf.refactor.smells.papyrus/META-INF/MANIFEST.MF
index 884ccd8..b0c0c42 100644
--- a/org.eclipse.emf.refactor.smells.papyrus/META-INF/MANIFEST.MF
+++ b/org.eclipse.emf.refactor.smells.papyrus/META-INF/MANIFEST.MF
@@ -8,6 +8,8 @@
org.eclipse.core.runtime,
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.1",
- org.eclipse.emf.refactor.smells;bundle-version="0.7.0"
+ org.eclipse.emf.refactor.smells;bundle-version="0.7.0",
+ org.eclipse.emf.refactor.smells.configuration;bundle-version="0.7.0",
+ org.eclipse.emf.refactor.smells.runtime;bundle-version="0.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.emf.refactor.smells.papyrus/build.properties b/org.eclipse.emf.refactor.smells.papyrus/build.properties
index e9863e2..316d0b2 100644
--- a/org.eclipse.emf.refactor.smells.papyrus/build.properties
+++ b/org.eclipse.emf.refactor.smells.papyrus/build.properties
@@ -2,4 +2,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ bin/,\
+ src/
diff --git a/org.eclipse.emf.refactor.smells.papyrus/plugin.xml b/org.eclipse.emf.refactor.smells.papyrus/plugin.xml
index fc1f945..8ab83d7 100644
--- a/org.eclipse.emf.refactor.smells.papyrus/plugin.xml
+++ b/org.eclipse.emf.refactor.smells.papyrus/plugin.xml
@@ -3,6 +3,13 @@
<plugin>
<extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.emf.refactor.smells.papyrus.ReporterStartup">
+ </startup>
+ </extension>
+
+ <extension
id="org.eclipse.emf.refactor.qa.menu"
point="org.eclipse.ui.menus">
<menuContribution
diff --git a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ReporterStartup.java b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ReporterStartup.java
new file mode 100644
index 0000000..e9af5fe
--- /dev/null
+++ b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ReporterStartup.java
@@ -0,0 +1,15 @@
+package org.eclipse.emf.refactor.smells.papyrus;
+
+import org.eclipse.emf.refactor.smells.papyrus.ui.PapyrusHighlighting;
+import org.eclipse.emf.refactor.smells.runtime.managers.RuntimeManager;
+import org.eclipse.ui.IStartup;
+
+public class ReporterStartup implements IStartup {
+
+ @Override
+ public void earlyStartup() {
+ RuntimeManager.getInstance(new PapyrusHighlighting());
+ System.out.println("Started");
+ }
+
+}
diff --git a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/handler/FindModelSmellHandler.java b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/handler/FindModelSmellHandler.java
index 18fd4cf..c03d416 100644
--- a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/handler/FindModelSmellHandler.java
+++ b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/handler/FindModelSmellHandler.java
@@ -8,7 +8,9 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.smells.papyrus.managers.PapyrusManager;
import org.eclipse.emf.refactor.smells.papyrus.managers.PapyrusSelectionManager;
+import org.eclipse.emf.refactor.smells.runtime.managers.RuntimeManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
@@ -32,10 +34,10 @@
@SuppressWarnings("finally")
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- System.out.println("Here we go ...");
Cursor oldCursor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getCursor();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setCursor(new Cursor(null,SWT.CURSOR_WAIT));
ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ PapyrusManager.setComponents(PapyrusSelectionManager.getObject(selection));
selectedEObject = PapyrusSelectionManager.getEObject(selection);
if (selectedEObject == null) {
MessageDialog.openError(
@@ -51,10 +53,10 @@
selectedFile = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember(path);
}
selectedProject = selectedFile.getProject();
-// RuntimeManager.getInstance();
-// System.out.println("Root: " + selectedEObject);
-// System.out.println("Project: " + selectedProject);
-// RuntimeManager.findConfiguredModelSmells(selectedProject, selectedEObject, selectedFile);
+ RuntimeManager.getInstance();
+ System.out.println("Root: " + selectedEObject);
+ System.out.println("Project: " + selectedProject);
+ RuntimeManager.findConfiguredModelSmells(selectedProject, selectedEObject, selectedFile);
} catch (Exception ex) {
Throwable cause = ex.getCause();
if(!(cause == null) && cause.getClass().getName().equals("org.eclipse.emf.ecore.xmi.PackageNotFoundException")){
diff --git a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusManager.java b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusManager.java
new file mode 100644
index 0000000..1ea7db4
--- /dev/null
+++ b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusManager.java
@@ -0,0 +1,14 @@
+package org.eclipse.emf.refactor.smells.papyrus.managers;
+
+
+public class PapyrusManager {
+
+ public static void highlight() {
+ System.out.println("Do something ...");
+ }
+
+ public static void setComponents(Object o) {
+ System.out.println("Do something ...");
+ }
+
+}
diff --git a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusSelectionManager.java b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusSelectionManager.java
index 7e65c3c..952c3f9 100644
--- a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusSelectionManager.java
+++ b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/managers/PapyrusSelectionManager.java
@@ -37,4 +37,14 @@
return ret;
}
+ public static Object getObject(ISelection selection) {
+ if (selection == null)
+ return null;
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ return ss.getFirstElement();
+ }
+ return null;
+ }
+
}
diff --git a/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ui/PapyrusHighlighting.java b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ui/PapyrusHighlighting.java
new file mode 100644
index 0000000..f5671e0
--- /dev/null
+++ b/org.eclipse.emf.refactor.smells.papyrus/src/org/eclipse/emf/refactor/smells/papyrus/ui/PapyrusHighlighting.java
@@ -0,0 +1,13 @@
+package org.eclipse.emf.refactor.smells.papyrus.ui;
+
+import org.eclipse.emf.refactor.smells.interfaces.IHighlighting;
+import org.eclipse.emf.refactor.smells.papyrus.managers.PapyrusManager;
+
+public class PapyrusHighlighting implements IHighlighting {
+
+ @Override
+ public void highlight() {
+ PapyrusManager.highlight();
+ }
+
+}