Search in sources :

Example 1 with DragEditPartsTrackerEx

use of org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx in project tdi-studio-se by Talend.

the class BusinessTextNonResizableEditPolicy method createSelectionHandles.

/**
     * @generated
     */
protected List createSelectionHandles() {
    MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
    moveHandle.setBorder(null);
    moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
    return Collections.singletonList(moveHandle);
}
Also used : DragEditPartsTrackerEx(org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx) MoveHandle(org.eclipse.gef.handles.MoveHandle)

Example 2 with DragEditPartsTrackerEx

use of org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx in project statecharts by Yakindu.

the class TransitionExpressionEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new TransitionExpressionComponentEditPolicy());
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(HelpContextIds.SC_PROPERTIES_TRANSITION_EXPRESSION));
    // BUGFIX:
    // https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=26
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {

        @Override
        protected void replaceHandleDragEditPartsTracker(Handle handle) {
            if (handle instanceof AbstractHandle) {
                AbstractHandle h = (AbstractHandle) handle;
                h.setDragTracker(new DragEditPartsTrackerEx(getHost()) {

                    protected boolean isMove() {
                        return true;
                    }
                });
            }
        }
    });
}
Also used : DragEditPartsTrackerEx(org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx) TransitionExpressionComponentEditPolicy(org.yakindu.sct.ui.editor.policies.TransitionExpressionComponentEditPolicy) ContextSensitiveHelpPolicy(org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy) AbstractHandle(org.eclipse.gef.handles.AbstractHandle) NonResizableLabelEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy) Handle(org.eclipse.gef.Handle) AbstractHandle(org.eclipse.gef.handles.AbstractHandle)

Aggregations

DragEditPartsTrackerEx (org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx)2 Handle (org.eclipse.gef.Handle)1 AbstractHandle (org.eclipse.gef.handles.AbstractHandle)1 MoveHandle (org.eclipse.gef.handles.MoveHandle)1 NonResizableLabelEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy)1 ContextSensitiveHelpPolicy (org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy)1 TransitionExpressionComponentEditPolicy (org.yakindu.sct.ui.editor.policies.TransitionExpressionComponentEditPolicy)1