Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java
index 55c3db639f7..54723683436 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/strategy/DropStrategy.java
@@ -60,7 +60,7 @@ public interface DropStrategy {
* @param targetEditPart
* The target edit part
* @return
- * A command, or null if the strategy cannot handle the request
+ * A command, or null if the strategy cannot handle the request
*/
public Command getCommand(Request request, EditPart targetEditPart);
@@ -74,4 +74,38 @@ public interface DropStrategy {
@Deprecated
public int getPriority();
+ /**
+ * When this strategy can handle this request, this method can be implemented
+ * to optionally display a visual feedback on the given edit part for this request.
+ *
+ * By default, compartments already support a feedback. Return true to override
+ * the default feedback, false to keep it.
+ *
+ * The feedback should always be erased in {@link #eraseTargetFeedback(Request, EditPart)}
+ *
+ * @param request
+ * @param targetEditPart
+ *
+ * @return true if the default feedback should be overridden, false if it should be preserved
+ *
+ * @since 1.3
+ */
+ public default boolean showTargetFeedback(Request request, EditPart targetEditPart) {
+ return false;
+ }
+
+ /**
+ * Erase any feedback added via {@link #showTargetFeedback(Request, EditPart)}. Note that this method
+ * may be invoked even if {@link #showTargetFeedback(Request, EditPart)} was never called.
+ *
+ * @param request
+ * @param targetEditPart
+ * @return
+ *
+ * @since 1.3
+ */
+ public default boolean eraseTargetFeedback(Request request, EditPart targetEditPart) {
+ return false;
+ }
+
}

Back to the top