Search in sources :

Example 1 with ContextSensitiveHelpPolicy

use of org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy in project statecharts by Yakindu.

the class EntryEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new OneWayConnectionHandlesEditPolicy(HandleDirection.OUTGOING));
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicyEx());
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(HelpContextIds.SC_PROPERTIES_ENTRY_ENTRYKIND));
    installEditPolicy(EnlargeContainerEditPolicy.ROLE, new EnlargeContainerEditPolicy());
}
Also used : NonResizableEditPolicyEx(org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx) OneWayConnectionHandlesEditPolicy(org.yakindu.base.gmf.runtime.editpolicies.OneWayConnectionHandlesEditPolicy) ContextSensitiveHelpPolicy(org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy) EnlargeContainerEditPolicy(org.yakindu.sct.ui.editor.policies.EnlargeContainerEditPolicy)

Example 2 with ContextSensitiveHelpPolicy

use of org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy in project statecharts by Yakindu.

the class StatechartTextExpressionEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    // Disables deletion of the text compartment via keyboard
    installEditPolicy(COMPONENT_ROLE, new RootComponentEditPolicy());
    removeEditPolicy(PRIMARY_DRAG_ROLE);
    installEditPolicy(SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(HelpContextIds.SC_PROPERTIES_STATECHART_EXPRESSION));
    removeEditPolicy(CONNECTION_HANDLES_ROLE);
}
Also used : RootComponentEditPolicy(org.eclipse.gef.editpolicies.RootComponentEditPolicy) ContextSensitiveHelpPolicy(org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy)

Example 3 with ContextSensitiveHelpPolicy

use of org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy in project statecharts by Yakindu.

the class StateTextCompartmentExpressionEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(HelpContextIds.SC_PROPERTIES_STATE_EXPRESSION));
}
Also used : ContextSensitiveHelpPolicy(org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy)

Example 4 with ContextSensitiveHelpPolicy

use of org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy 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

ContextSensitiveHelpPolicy (org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy)4 Handle (org.eclipse.gef.Handle)1 RootComponentEditPolicy (org.eclipse.gef.editpolicies.RootComponentEditPolicy)1 AbstractHandle (org.eclipse.gef.handles.AbstractHandle)1 NonResizableEditPolicyEx (org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx)1 NonResizableLabelEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy)1 DragEditPartsTrackerEx (org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx)1 OneWayConnectionHandlesEditPolicy (org.yakindu.base.gmf.runtime.editpolicies.OneWayConnectionHandlesEditPolicy)1 EnlargeContainerEditPolicy (org.yakindu.sct.ui.editor.policies.EnlargeContainerEditPolicy)1 TransitionExpressionComponentEditPolicy (org.yakindu.sct.ui.editor.policies.TransitionExpressionComponentEditPolicy)1