Commit d1320bd0 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Kernel: JavaFX editor. Update to latest layout-based classes.

Issue-Ref: 3815
Issue-Url: https://af3-developer.fortiss.org/issues/3815

Signed-off-by: Florian Hölzl's avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent 2c96d87d
EObjectBasedDiagramControllerBase.java 7129769962099851bc48d97d69f259b0f692625c RED
EObjectBasedRectangularResizableContentControllerBase.java 6cdf3d430353b79ec8c2ccf1bc20736db2ed102c RED
LayoutedModelElementBasedContentAnchorageController.java abbf310db98983a6e80c4cd339cb34a23c795101 RED
LayoutedModelElementBasedDiagramAnchorageController.java bb4a942f9cca35f032dfe3adee26443654315774 RED
LayoutedModelElementBasedLinkBendPointController.java 7363f371c416d26540c679036aa27c74d5a32b5a RED
ContextMenuUtil.java b0eaa896a4a237bad418f788314976a383b1fb8a YELLOW
EObjectBasedDiagramControllerBase.java 77cad946c06ab73790220c4b07c392f183cc54cb YELLOW
EObjectBasedRectangularResizableContentControllerBase.java 422211e075f8dc80f5a7096e059822fc39cc81a6 YELLOW
LayoutedModelElementBasedContentAnchorageController.java 37e91dc8639966cb7f802182211105f61385072d YELLOW
LayoutedModelElementBasedDiagramAnchorageController.java a20392301d2cbb2cd85dfc391090453a2cb3b674 YELLOW
LayoutedModelElementBasedLinkBendPointController.java 4b4a5b81186fd485973f2a407648c50f7115ca57 YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2019 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor.fx;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoint;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewer;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.base.dnd.ElementDropContext;
import org.fortiss.tooling.base.model.layout.Point;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPrototypeService;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
/**
* Helper class for creating context menus.
*
* @author hoelzl
*/
final class ContextMenuUtil {
/** Creates the menu populated with composable prototypes. */
public static List<MenuItem> createPrototypeMenu(EObject target,
IElementCompositionContext context) {
List<MenuItem> result = new ArrayList<>();
Menu newMenu = new Menu("New ...");
List<Prototype> protos =
IPrototypeService.getInstance().getComposablePrototypes(target.getClass());
for(Prototype p : protos) {
IElementCompositorService ecs = IElementCompositorService.getInstance();
EObject prototypeCopy = p.getPrototypeCopy();
if(ecs.canCompose(target, prototypeCopy, context)) {
MenuItem mi = new MenuItem(p.getName());
mi.setOnAction(evt -> {
ICommandStackService.getInstance().runAsCommand(target, () -> {
ecs.compose(target, prototypeCopy, context);
});
});
newMenu.getItems().add(mi);
}
}
if(!newMenu.getItems().isEmpty()) {
result.add(newMenu);
}
return result;
}
/** Creates the element composition context. */
public static IElementCompositionContext createElementCompositionContext(EObject target,
double x, double y, boolean isRoot, double zoom) {
Point loc = createPoint((int)x, (int)y, "CompositionPoint");
return new ElementDropContext(target, loc, isRoot, zoom);
}
/** Returns the default display menu for interaction with diagram viewer features. */
public static Menu createDisplayMenu(DiagramViewer viewer) {
Menu menu = new Menu("Display ...");
DiagramViewerFeatures features = viewer.getFeatures();
// link highlighting
if(features.isLinkHighlightingEnabled()) {
MenuItem disableLinkHighlighting = new MenuItem("Disable Link Highlighting");
disableLinkHighlighting.setOnAction(evt -> {
features.setLinkHighlightingEnabled(false);
});
menu.getItems().add(disableLinkHighlighting);
} else {
MenuItem enableLinkHighlighting = new MenuItem("Enable Link Highlighting");
enableLinkHighlighting.setOnAction(evt -> {
features.setLinkHighlightingEnabled(true);
});
menu.getItems().add(enableLinkHighlighting);
}
// interaction area shading
if(features.isInteractionAreaShadingEnabled()) {
MenuItem disableInteractionShading = new MenuItem("Disable Interactive Area Shading");
disableInteractionShading.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(false);
});
menu.getItems().add(disableInteractionShading);
} else {
MenuItem enableInteractionShading = new MenuItem("Enable Interactive Area Shading");
enableInteractionShading.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(true);
});
menu.getItems().add(enableInteractionShading);
}
return menu;
}
}
......@@ -14,12 +14,16 @@
package org.fortiss.tooling.base.ui.editor.fx;
import static java.lang.Math.max;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createDisplayMenu;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createPrototypeMenu;
import java.util.Collections;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
......@@ -29,7 +33,12 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.base.Co
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeListener;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
import javafx.scene.Node;
......@@ -42,25 +51,21 @@ import javafx.scene.control.MenuItem;
public abstract class EObjectBasedDiagramControllerBase extends ControllerBase
implements IModelChangeProvider {
/** Notification adapter for model change events. */
private final Adapter notificationListener = new AdapterImpl() {
@Override
public void notifyChanged(Notification event) {
fireUpdateComplete();
}
};
private final HierarchiElementAdapter notificationListener = new HierarchiElementAdapter();
/** Constructor. */
public EObjectBasedDiagramControllerBase(IMVCBundle mvcb) {
super(mvcb);
if(!(getModel() instanceof EObject)) {
throw new IllegalArgumentException("Model element must be an instance of an EObject.");
if(!(getModel() instanceof IHierarchicElement)) {
throw new IllegalArgumentException(
"Model element must be an instance of an IHierarchicElement.");
}
}
/** Returns the {@link EObject} model element. */
protected EObject getEObject() {
/** Returns the {@link IHierarchicElement} model element. */
protected IHierarchicElement getHierarchicElement() {
// wild cast works: see constructor check with exception
return (EObject)getModel();
return (IHierarchicElement)getModel();
}
/** {@inheritDoc} */
......@@ -72,13 +77,12 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase
double y = max(features.getVerticalSpacing(), diagramLocation.getY());
// wild cast works: see constructor exception
// EObject modelParent = (EObject)getModel();
// IEclipseContext subContext =
// createSubContextWithCompositionLocation(context, modelParent, x, y);
// IContextMenuService icms = context.get(IContextMenuService.class);
// return icms.createDefaultContextMenu(subContext);
// TODO:
return Collections.emptyList();
EObject modelParent = (EObject)getModel();
IElementCompositionContext edc = createElementCompositionContext(modelParent, x, y, true,
getViewer().getFeatures().getCurrentZoomFactor());
List<MenuItem> result = createPrototypeMenu(modelParent, edc);
result.add(createDisplayMenu(getViewer()));
return result;
}
/** The model change listener list. */
......@@ -98,7 +102,10 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase
/** Called when sub-class should register with the underlying {@link EObject}. */
protected void connectToModel() {
getEObject().eAdapters().add(notificationListener);
ITopLevelElement root =
IPersistencyService.getInstance().getTopLevelElementFor(getHierarchicElement());
ICommandStackService.getInstance().addCommandStackListener(root, notificationListener);
getHierarchicElement().eAdapters().add(notificationListener);
}
/** {@inheritDoc} */
......@@ -112,7 +119,10 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase
/** Called when sub-class should unregister from the underlying {@link EObject}. */
protected void disconnectFromModel() {
getEObject().eAdapters().remove(notificationListener);
getHierarchicElement().eAdapters().remove(notificationListener);
ITopLevelElement root =
IPersistencyService.getInstance().getTopLevelElementFor(getHierarchicElement());
ICommandStackService.getInstance().removeCommandStackListener(root, notificationListener);
}
/** Called when sub-class should unregister from the underlying {@link EObject}. */
......@@ -120,9 +130,31 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase
/** {@inheritDoc} */
@Override
public void fireUpdateComplete() {
EObject eo = getEObject();
IHierarchicElement he = getHierarchicElement();
for(IModelChangeListener mcl : changeListeners) {
mcl.changed(eo);
mcl.changed(he);
}
}
/** Specialized adapter listening to model changes of {@link IHierarchicElement}. */
private class HierarchiElementAdapter extends AdapterImpl implements CommandStackListener {
/** The list of observed notifications. */
private final List<Notification> notifications = new ArrayList<>();
/** {@inheritDoc} */
@Override
public void notifyChanged(Notification msg) {
notifications.add(msg);
}
/** {@inheritDoc} */
@Override
public void commandStackChanged(EventObject event) {
if(notifications.isEmpty()) {
return;
}
fireUpdateComplete();
notifications.clear();
}
}
}
......@@ -13,19 +13,24 @@
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
import java.util.Collections;
import static java.lang.Math.max;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createPrototypeMenu;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.rectangular.RectangularResizableContentControllerBase;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeListener;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.utils.LayoutModelElementAdapter;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import javafx.scene.Node;
import javafx.scene.control.MenuItem;
......@@ -48,7 +53,7 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
layoutAdapter = new LayoutModelElementAdapter(lme) {
@Override
public void layoutChanged(Notification notification) {
public void layoutChanged() {
fireUpdateComplete();
}
};
......@@ -60,41 +65,25 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
return (ILayoutedModelElement)getModel();
}
// /** {@inheritDoc} */
// @Override
// protected void link(IMVCBundle startBundle, DiagramCoordinate startLocation,
// IMVCBundle endBundle, DiagramCoordinate endLocation) {
// createLinkByCommand(startBundle, startLocation, endBundle, endLocation,
// (EObject)getViewer().getRootElement(), context);
// }
//
// /** {@inheritDoc} */
// @Override
// public boolean isPossibleLinkTarget() {
// return true;
// }
/** {@inheritDoc} */
@Override
public List<MenuItem> contextMenuContributions(Node node, DiagramCoordinate diagramLocation) {
// // outer-most grid areas of the diagram are inaccessible
// DiagramViewerFeatures features = getViewer().getFeatures();
// double x = max(features.getHorizontalSpacing(), diagramLocation.getX());
// double y = max(features.getVerticalSpacing(), diagramLocation.getY());
// // wild cast works: see constructor exception
// EObject modelParent = (EObject)getModel();
// IEclipseContext subContext =
// createSubContextWithCompositionBorderLocation(context, modelParent, x, y);
//
// IContextMenuService icms = context.get(IContextMenuService.class);
// return icms.createDefaultContextMenu(subContext);
return Collections.emptyList();
// outer-most grid areas of the diagram are inaccessible
DiagramViewerFeatures features = getViewer().getFeatures();
double x = max(features.getHorizontalSpacing(), diagramLocation.getX());
double y = max(features.getVerticalSpacing(), diagramLocation.getY());
// wild cast works: see constructor exception
EObject modelParent = (EObject)getModel();
IElementCompositionContext edc = createElementCompositionContext(modelParent, x, y, false,
getViewer().getFeatures().getCurrentZoomFactor());
return createPrototypeMenu(modelParent, edc);
}
/** {@inheritDoc} */
@Override
public void delete() {
// deleteByService(getEObject(), context);
IElementCompositorService.getInstance().decompose(getLayoutedME());
}
/** The model change listener list. */
......
......@@ -13,17 +13,25 @@
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.base.DelegatingContentAnchorageController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeListener;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.MVCBundleTag;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.utils.LayoutModelElementAdapter;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
/**
* {@link DelegatingContentAnchorageController} for
......@@ -44,7 +52,7 @@ public class LayoutedModelElementBasedContentAnchorageController
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
layoutAdapter = new LayoutModelElementAdapter(lme) {
@Override
public void layoutChanged(Notification notification) {
public void layoutChanged() {
fireUpdateComplete();
}
};
......@@ -58,29 +66,40 @@ public class LayoutedModelElementBasedContentAnchorageController
/** {@inheritDoc} */
@Override
public void delete() {
// TODO
IElementCompositorService.getInstance().decompose(getLayoutedME());
}
/** {@inheritDoc} */
@Override
protected void link(IMVCBundle startBundle, DiagramCoordinate startLocation,
IMVCBundle endBundle, DiagramCoordinate endLocation) {
EObject start = (EObject)startBundle.getModel();
EObject end = (EObject)endBundle.getModel();
EObject root = (EObject)getViewer().getRootElement();
IConnectionCompositorService.getInstance().connect(start, end, root, null);
}
/** {@inheritDoc} */
@Override
public boolean isPossibleLinkTarget() {
return true;
}
// /** {@inheritDoc} */
// @Override
// protected void link(IMVCBundle startBundle, DiagramCoordinate startLocation,
// IMVCBundle endBundle, DiagramCoordinate endLocation) {
// createLinkByCommand(startBundle, startLocation, endBundle, endLocation,
// (EObject)getViewer().getRootElement(), context);
// }
//
// /** {@inheritDoc} */
// @Override
// public boolean isPossibleLinkTarget() {
// return true;
// }
//
// /** {@inheritDoc} */
// @Override
// public MVCBundleTag getLinkTargetEffectForNewLinkFrom(IMVCBundle linkStartBundle) {
// return getLinkTargetEffect(linkStartBundle, getLayoutedME(),
// (EObject)getViewer().getRootElement(), context);
// }
/** {@inheritDoc} */
@Override
public MVCBundleTag getLinkTargetEffectForNewLinkFrom(IMVCBundle linkSourceBundle) {
Object srcModel = linkSourceBundle.getModel();
if(srcModel instanceof ILayoutedModelElement && srcModel instanceof IConnector) {
EObject startModel = (EObject)srcModel;
ILayoutedModelElement endModel = getLayoutedME();
EObject root = (EObject)getViewer().getRootElement();
IConnectionCompositorService srv = IConnectionCompositorService.getInstance();
if(srv.canConnect(startModel, endModel, root, null)) {
return LINK_TARGET_ALLOWED_TAG;
}
}
return LINK_TARGET_DENIED_TAG;
}
/** The model change listener list. */
private final List<IModelChangeListener> changeListeners =
......
......@@ -13,18 +13,26 @@
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.FeedbackChange;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.base.MoveControllerBase;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeListener;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.MVCBundleTag;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.utils.LayoutModelElementAdapter;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
/** {@link MoveControllerBase} for {@link ILayoutedModelElement}s. */
public class LayoutedModelElementBasedDiagramAnchorageController extends MoveControllerBase
......@@ -42,7 +50,7 @@ public class LayoutedModelElementBasedDiagramAnchorageController extends MoveCon
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
layoutAdapter = new LayoutModelElementAdapter(lme) {
@Override
public void layoutChanged(Notification notification) {
public void layoutChanged() {
fireUpdateComplete();
}
};
......@@ -56,59 +64,49 @@ public class LayoutedModelElementBasedDiagramAnchorageController extends MoveCon
/** {@inheritDoc} */
@Override
public void move(FeedbackChange delta) {
// ILayoutedModelElement model = getLayoutedME();
// Point pos = getPosition(model);
// int oldX = pos.getX();
// int oldY = pos.getY();
// DiagramViewerFeatures features = getViewer().getFeatures();
// int newX = (int)max(oldX + delta.getDeltaX(), features.getHorizontalSpacing());
// int newY = (int)max(oldY + delta.getDeltaY(), features.getVerticalSpacing());
// context.get(IPersistencyService.class).runAsCommand(getModelRoot(model),
// new AbstractCommand() {
// @Override
// public boolean canExecute() {
// return true;
// }
//
// @Override
// public void redo() {
// execute();
// }
//
// @Override
// public void execute() {
// setPosition(model, newX, newY);
// }
// });
// setPosition(model, newX, newY);
ILayoutedModelElement model = getLayoutedME();
int dx = (int)delta.getDeltaX();
int dy = (int)delta.getDeltaY();
moveNode(model, dx, dy);
}
/** {@inheritDoc} */
@Override
public void delete() {
// deleteByService(getLayoutedME(), context);
IElementCompositorService.getInstance().decompose(getLayoutedME());
}
/** {@inheritDoc} */
@Override
protected void link(IMVCBundle startBundle, DiagramCoordinate startLocation,
IMVCBundle endBundle, DiagramCoordinate endLocation) {
EObject start = (EObject)startBundle.getModel();
EObject end = (EObject)endBundle.getModel();
EObject root = (EObject)getViewer().getRootElement();
IConnectionCompositorService.getInstance().connect(start, end, root, null);
}
/** {@inheritDoc} */
@Override
public boolean isPossibleLinkTarget() {
return true;
}
// /** {@inheritDoc} */
// @Override
// protected void link(IMVCBundle startBundle, DiagramCoordinate startLocation,
// IMVCBundle endBundle, DiagramCoordinate endLocation) {
// createLinkByCommand(startBundle, startLocation, endBundle, endLocation,
// (EObject)getViewer().getRootElement(), context);
// }
//
// /** {@inheritDoc} */
// @Override
// public boolean isPossibleLinkTarget() {
// return true;