Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2013-04-24 13:57:26 +0000
committertarendt2013-04-24 13:57:26 +0000
commit4f01fde24dd4fd1e0a5e61a6bb21ca7eefb1b580 (patch)
treec30ec413a25bc66fbb863edf1668f59c776fd438
parentfc0a54c7343a967a39da67e00586ea333d962e39 (diff)
downloadorg.eclipse.emf.refactor.metrics-4f01fde24dd4fd1e0a5e61a6bb21ca7eefb1b580.tar.gz
org.eclipse.emf.refactor.metrics-4f01fde24dd4fd1e0a5e61a6bb21ca7eefb1b580.tar.xz
org.eclipse.emf.refactor.metrics-4f01fde24dd4fd1e0a5e61a6bb21ca7eefb1b580.zip
bugs in highlighting fixed
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.classbin4005 -> 4339 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.classbin1267 -> 1269 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.classbin1457 -> 1465 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/plugin.xml7
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.java14
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.java5
-rw-r--r--org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.java2
-rw-r--r--org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$1.classbin5418 -> 5369 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$ColumnSortListener.classbin2104 -> 2104 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.classbin7500 -> 7500 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics.runtime/src/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.java3
11 files changed, 21 insertions, 10 deletions
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.class b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.class
index 873e73e..0225093 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.class
+++ b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.class b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.class
index 64bb262..7e16159 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.class
+++ b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.class b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.class
index d9f97ea..ccc0603 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.class
+++ b/org.eclipse.emf.refactor.metrics.papyrus/bin/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/plugin.xml b/org.eclipse.emf.refactor.metrics.papyrus/plugin.xml
index 51be4ef..693b15f 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/plugin.xml
+++ b/org.eclipse.emf.refactor.metrics.papyrus/plugin.xml
@@ -145,15 +145,16 @@
<decoratorProvider
class="org.eclipse.emf.refactor.metrics.papyrus.ui.PapyrusDecoratorProvider">
<Priority
- name="Lowest">
+ name="Low">
</Priority>
<object
class="org.eclipse.gmf.runtime.notation.View(org.eclipse.gmf.runtime.notation)"
- id="NODE">
+ id="org.eclipse.emf.refactor.metrics.papyrus.decorator">
</object>
<context
- decoratorTargets="NODE">
+ decoratorTargets="org.eclipse.emf.refactor.metrics.papyrus.decorator">
</context>
</decoratorProvider>
</extension>
+
</plugin>
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.java b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.java
index cc43d67..6edcfd5 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.java
+++ b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/managers/HighlightManager.java
@@ -2,6 +2,7 @@ package org.eclipse.emf.refactor.metrics.papyrus.managers;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -12,6 +13,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator;
import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.StructuredSelection;
public class HighlightManager {
@@ -38,8 +40,16 @@ public class HighlightManager {
// clear former selected eObjects
selected.clear();
// set selected eObjects from selection
- if (selection instanceof Result) {
- selected.addAll(((Result) selection).getContext());
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ @SuppressWarnings("unchecked")
+ Iterator<Object> it = ss.iterator();
+ while (it.hasNext()) {
+ Object o = it.next();
+ if (o instanceof Result) {
+ selected.addAll(((Result) o).getContext());
+ }
+ }
}
// refresh each corresponding decorator
for (IDecorator decorator : decorators) {
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.java b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.java
index 99aee93..bb18d0f 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.java
+++ b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecorationFigure.java
@@ -7,7 +7,8 @@ import org.eclipse.swt.graphics.Color;
public class PapyrusDecorationFigure extends Figure {
- private static final Color NICE_RED = new Color(null, 232, 72, 72);
+// private static final Color NICE_GREEN = new Color(null, 72, 232, 232);
+ private static final Color NICE_GREEN = new Color(null, 77, 188, 77);
public PapyrusDecorationFigure(){
setLayoutManager(new ToolbarLayout());
@@ -16,7 +17,7 @@ public class PapyrusDecorationFigure extends Figure {
@Override
public void paint(Graphics graphics) {
- graphics.setForegroundColor(NICE_RED);
+ graphics.setForegroundColor(NICE_GREEN);
graphics.setLineWidth(4);
graphics.drawRectangle(getClientArea());
super.paint(graphics);
diff --git a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.java b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.java
index 3948899..10d468b 100644
--- a/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.java
+++ b/org.eclipse.emf.refactor.metrics.papyrus/src/org/eclipse/emf/refactor/metrics/papyrus/ui/PapyrusDecoratorProvider.java
@@ -8,7 +8,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
public class PapyrusDecoratorProvider extends AbstractProvider implements IDecoratorProvider {
- public static final String PAPYRUS_DECORATOR_KEY = "papyrus_decorator";
+ public static final String PAPYRUS_DECORATOR_KEY = "papyrus_decorator_metrics";
@Override
public boolean provides(IOperation operation) {
diff --git a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$1.class b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$1.class
index 1c61f19..8cf2644 100644
--- a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$1.class
+++ b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$ColumnSortListener.class b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$ColumnSortListener.class
index f5e9a6c..c7fb672 100644
--- a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$ColumnSortListener.class
+++ b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView$ColumnSortListener.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.class b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.class
index 6950876..cb34f8a 100644
--- a/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.class
+++ b/org.eclipse.emf.refactor.metrics.runtime/bin/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics.runtime/src/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.java b/org.eclipse.emf.refactor.metrics.runtime/src/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.java
index cc4a6bb..2b7e7cb 100644
--- a/org.eclipse.emf.refactor.metrics.runtime/src/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.java
+++ b/org.eclipse.emf.refactor.metrics.runtime/src/org/eclipse/emf/refactor/metrics/runtime/ui/MetricResultsView.java
@@ -127,8 +127,7 @@ public class MetricResultsView extends ViewPart {
IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
if (event.getSelection() instanceof IStructuredSelection) {
StructuredSelection ss = (StructuredSelection) event.getSelection();
- Object selection = ss.getFirstElement();
- doAdditionalHighlightings(selection);
+ doAdditionalHighlightings(ss);
}
System.out.println("editorPart: " + editorPart);
System.out.println("editorPart.class: " + editorPart.getClass());

Back to the top