From 706edc8942c77b81fdab990025e376b9b91cd8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20D=C3=B6bber?= <doebber@in.tum.de> Date: Mon, 5 Dec 2011 10:55:20 +0000 Subject: [PATCH] reviewed portion of kernel.ui --- .../tooling/kernel/ui/databinding/ObservableUtil.java | 4 ++-- .../kernel/ui/dnd/CompositionServiceLocalTransfer.java | 4 +++- .../ui/dnd/ConnectionCompositionDragSourceAdapter.java | 2 +- .../ui/dnd/ConnectionCompositionDropTargetAdapter.java | 6 +++++- .../kernel/ui/dnd/ConnectionCompositionSource.java | 7 ++++++- .../ui/dnd/ElementCompositionDragSourceAdapter.java | 2 +- .../ui/dnd/ElementCompositionDropTargetAdapter.java | 6 +++++- .../tooling/kernel/ui/dnd/ElementCompositionSource.java | 3 ++- .../src/org/fortiss/tooling/kernel/ui/dnd/package.html | 8 ++++++++ 9 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/package.html diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/databinding/ObservableUtil.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/databinding/ObservableUtil.java index 698f050d3..f0a53e031 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/databinding/ObservableUtil.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/databinding/ObservableUtil.java @@ -24,12 +24,12 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; /** - * Observerables for {@link EObject} models. + * Observables for {@link EObject} models. * * @author hummel * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 956DA9605D6EA606250B2B642A1DC34B + * @ConQAT.Rating RED Hash: 63632A77289A55A011049CA80D7F4F52 */ public class ObservableUtil { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/CompositionServiceLocalTransfer.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/CompositionServiceLocalTransfer.java index 8d2e0edc6..9232d59cd 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/CompositionServiceLocalTransfer.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/CompositionServiceLocalTransfer.java @@ -28,12 +28,14 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 736E49D75B233CB065D623C1236DEE52 + * @ConQAT.Rating RED Hash: E8FE5EC5C36C0A8456AEBC887D735DDF */ public class CompositionServiceLocalTransfer extends SimpleObjectTransfer { /** Singleton instance. */ private static final CompositionServiceLocalTransfer INSTANCE = new CompositionServiceLocalTransfer(); /** Transfer type name. */ + // TODO @review CD: Why does it need such a complex name? Super class + // already handles timing . private static final String TYPE_NAME = "Fortiss kernel composition transfer" + System.currentTimeMillis() + ":" + INSTANCE.hashCode(); /** Transfer type ID. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDragSourceAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDragSourceAdapter.java index 2bd7cd271..83154e58c 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDragSourceAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDragSourceAdapter.java @@ -32,7 +32,7 @@ import org.eclipse.swt.dnd.DragSourceAdapter; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 95C337E875F3C6A557C6067C7B4D4C42 + * @ConQAT.Rating GREEN Hash: E262C53D9770AA7BD12D6D71CEB4C586 */ public abstract class ConnectionCompositionDragSourceAdapter extends ElementCompositionDragSourceAdapter { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java index b9b312e42..6576073a3 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java @@ -32,11 +32,14 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 25D176E4F450234660A5B6D8C1054832 + * @ConQAT.Rating RED Hash: 0BFB86B105FFC704BA4114BD223C57B8 */ public abstract class ConnectionCompositionDropTargetAdapter extends DropTargetAdapter { + // TODO @review CD: This class sure is useful yet has never been + // implemented. Has it ever been tested? + /** {@inheritDoc} */ @Override public void drop(DropTargetEvent event) { @@ -56,6 +59,7 @@ public abstract class ConnectionCompositionDropTargetAdapter extends event.detail = DND.DROP_NONE; return; } + // TODO @review CD: abort when canConnect succeeds? if (IConnectionCompositorService.INSTANCE.canConnect( dragSource.getDesignatedElement(), target, dragSource.getDesignatedParentElement(), null)) { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionSource.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionSource.java index fda6aced4..003aa7228 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionSource.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionSource.java @@ -28,10 +28,11 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 7A9A3F2F21B95A7ABBC4CD6743224DD6 + * @ConQAT.Rating RED Hash: D19FC49278D9C24C478FFE4613695AD5 */ public class ConnectionCompositionSource extends ElementCompositionSource { /** Stores the designated parent element. */ + // TODO @review CD: make final? private EObject designatedParentElement; /** Constructor. */ @@ -44,4 +45,8 @@ public class ConnectionCompositionSource extends ElementCompositionSource { public EObject getDesignatedParentElement() { return designatedParentElement; } + + // TODO @review CD: This class is a 95% clone of ElementCompositionSource. + // Moreover derivation does not make sense - neither from the code's nor + // from the semantics' point of view. } \ No newline at end of file diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDragSourceAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDragSourceAdapter.java index a273d5296..5dfd84efe 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDragSourceAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDragSourceAdapter.java @@ -32,7 +32,7 @@ import org.eclipse.swt.dnd.Transfer; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 70273F4B405C5A2C55ACC3BFFC57D5C1 + * @ConQAT.Rating GREEN Hash: 6F0E5F8DCFDB6BDECBC70C85507F2552 */ public abstract class ElementCompositionDragSourceAdapter extends DragSourceAdapter { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java index 6fe4260c5..dad97433e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java @@ -32,10 +32,13 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 3020F65D1AB62A04863249B2EB016773 + * @ConQAT.Rating RED Hash: 194552CC8315FA75482EAFCE4852E161 */ public abstract class ElementCompositionDropTargetAdapter extends DropTargetAdapter { + + // TODO @review CD: Again: This class sure is useful yet has never been + // implemented. Has it ever been tested? /** {@inheritDoc} */ @Override public void drop(DropTargetEvent event) { @@ -54,6 +57,7 @@ public abstract class ElementCompositionDropTargetAdapter extends event.detail = DND.DROP_NONE; return; } + // TODO @review CD: abort when canCompose succeeds? if (IElementCompositorService.INSTANCE.canCompose(target, dragSource.getDesignatedElement(), null)) { event.detail = DND.DROP_NONE; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionSource.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionSource.java index 67b66d908..3d4af3302 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionSource.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionSource.java @@ -28,11 +28,12 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: EAB27D084A09CC5D79CABEBF38DCD7F9 + * @ConQAT.Rating RED Hash: B601637F018D099C468F5470DBE8A605 */ public class ElementCompositionSource { /** Stores the element designated for composition. */ + // TODO @review CD: make final? private EObject designatedElement; /** Constructor. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/package.html b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/package.html new file mode 100644 index 000000000..0e41b06b7 --- /dev/null +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/package.html @@ -0,0 +1,8 @@ +<!-- + $Id: package.html 835 2011-06-28 07:31:00Z ratiu $ + @version $Rev: 835 $ + @ConQAT.Rating RED Hash: 7CD025BCFEDE1B96A0EBDE550A6AD6EE +--> +<body> +Support classes for using the drag and drop mechanism. +</body> -- GitLab