diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings index e664805a7626a79fb7643ca63ad570c7424a16af..e06b4549dbfa9c3655bfa62ce91532456c95c333 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings @@ -2,7 +2,7 @@ DynamicTreeContentProviderBase.java e801da995a1b6e5a1b757247c1638bafb6073e6d GRE DynamicTreeItem.java 75dc5534b119ffdb3c10a65810c2a0f330b7955e GREEN DynamicTreeTableUIProviderBase.java 7bfc1395283d3dc10026aff5e2e65df88d25f3a7 GREEN DynamicTreeTableViewer.java 43757359b3071192ae79710bcbc0e9577bb6f62d GREEN -DynamicTreeUIProviderBase.java 56fe4df4577b35f1e5e6e4c4be189b706c852d52 GREEN -DynamicTreeViewer.java 6fc80215348ddb8bb0f79f5b1b66bad1d73adace YELLOW +DynamicTreeUIProviderBase.java 3f4a9f0e861ce1c8c122feb487388317464752a1 YELLOW +DynamicTreeViewer.java 933021a9f4cfad90f85cabe3a1be278391851166 YELLOW DynamicTreeViewerBase.java 47124c847de322a0ae26eb7a114f85ce4bd02d7e GREEN IDoubleClickHandler.java 447f7769dead9a106b3ea3139ef0da51eb0b9a89 GREEN diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeUIProviderBase.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeUIProviderBase.java index 56fe4df4577b35f1e5e6e4c4be189b706c852d52..3f4a9f0e861ce1c8c122feb487388317464752a1 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeUIProviderBase.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeUIProviderBase.java @@ -15,10 +15,11 @@ package org.fortiss.tooling.common.ui.javafx.control.treetableview; import javafx.scene.Node; import javafx.scene.control.ContextMenu; +import javafx.scene.input.MouseEvent; /** * This UI provider is responsible to return the label, the icon, and the context menu for each cell - * in the {@link DynamicTreeViewer} based on the data object. + * in the {@link DynamicTreeViewer} based on the data object. It also handles drag start events. */ public abstract class DynamicTreeUIProviderBase<T> { /** @@ -47,4 +48,14 @@ public abstract class DynamicTreeUIProviderBase<T> { public ContextMenu createContextMenu(T element) { return null; } + + /** + * @param event + * the mouse event, which caused the drag detection + * @param element + * the tree element, which was dragged + */ + public void dragDetected(MouseEvent event, T element) { + // ignored + } } diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeViewer.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeViewer.java index 6fc80215348ddb8bb0f79f5b1b66bad1d73adace..933021a9f4cfad90f85cabe3a1be278391851166 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeViewer.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeViewer.java @@ -138,6 +138,9 @@ public final class DynamicTreeViewer<T> extends DynamicTreeViewerBase<T> { this.setEventDispatcher(new DoubleClickEventDispatcher(original)); this.setText(uiProvider.getLabel(item)); this.setGraphic(uiProvider.getIconNode(item)); + this.setOnDragDetected(evt -> { + uiProvider.dragDetected(evt, item); + }); } else { this.setText(null); this.setGraphic(null); diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/.ratings index 6a45de1ab4384717bf779777e0716b4f3b66b50a..5aba20d5b2e5e2bf6bde342fcb001930f4c7e2bd 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/.ratings @@ -5,7 +5,7 @@ LibraryViewDragSourceAdapter.java 56ef61b214ef5d6cb5b751791a92158bda0391ec GREEN LinkWithEditorPartListener.java c5ab74424378e7b158a805c4dd14fc03c8abeded GREEN MarkerViewContentProvider.java 4cb1192baebe21bca951c439c163d0c171512515 GREEN MarkerViewPart.java cbb650271b6877af205421b7cb11f930440a7ef9 GREEN -ModelElementsViewFX.java 395402b845f6ce997ab8dac96a8fc70e715f88ab YELLOW +ModelElementsViewFX.java f08b6ddb8aab338c3f2a53b899a8189e4e005d63 RED NavigatorNewMenu.java a35e391960d1dacbe7f77982e53e1891e9382d5a GREEN NavigatorTreeContentComparator.java d9f1354cfdff78b104b28887d2397e5ca0e9755b GREEN NavigatorTreeContentProvider.java 1fbe97bebf3805cc1af190cecd784fc1cfd12306 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ModelElementsViewFX.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ModelElementsViewFX.java index 395402b845f6ce997ab8dac96a8fc70e715f88ab..f08b6ddb8aab338c3f2a53b899a8189e4e005d63 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ModelElementsViewFX.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ModelElementsViewFX.java @@ -47,6 +47,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.TextField; +import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; /** @@ -238,6 +239,12 @@ public final class ModelElementsViewFX extends FXViewPart { } return null; } + + /** {@inheritDoc} */ + @Override + public void dragDetected(MouseEvent event, Object element) { + System.out.println("Detected drag on " + element.toString()); + } } /** If an editor in a different Project is opened the Model is reinitialized */