Search in sources :

Example 1 with PreferredSizeHandlerEditPolicy

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

the class RegionEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {

        @Override
        protected Command getAutoSizeCommand(Request request) {
            return UnexecutableCommand.INSTANCE;
        }
    });
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PreferredSizeHandlerEditPolicy());
}
Also used : UnexecutableCommand(org.eclipse.gef.commands.UnexecutableCommand) Command(org.eclipse.gef.commands.Command) Request(org.eclipse.gef.Request) ConstrainedToolbarLayoutEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy) PreferredSizeHandlerEditPolicy(org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy)

Example 2 with PreferredSizeHandlerEditPolicy

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

the class StatechartTextEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    // Disables deletion of the text compartment view if additional elements
    // are selected too
    installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new SemanticEditPolicy() {

        @Override
        protected boolean shouldProceed(DestroyRequest destroyRequest) {
            return false;
        }
    });
    // Disables deletion of the text compartment view via keyboard
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
    removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PreferredSizeHandlerEditPolicy() {

        @Override
        protected IFigure getPreferredSizeFigure() {
            return getChildBySemanticHint(SemanticHints.STATECHART_NAME).getFigure();
        }
    });
}
Also used : SemanticEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy) RootComponentEditPolicy(org.eclipse.gef.editpolicies.RootComponentEditPolicy) DestroyRequest(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest) PreferredSizeHandlerEditPolicy(org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy) IFigure(org.eclipse.draw2d.IFigure)

Example 3 with PreferredSizeHandlerEditPolicy

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

the class StateEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    removeEditPolicy(EditPolicyRoles.CREATION_ROLE);
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PreferredSizeHandlerEditPolicy());
    installEditPolicy(EnlargeContainerEditPolicy.ROLE, new EnlargeContainerEditPolicy());
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new FeedbackGraphicalNodeEditPolicy());
}
Also used : FeedbackGraphicalNodeEditPolicy(org.yakindu.sct.ui.editor.policies.FeedbackGraphicalNodeEditPolicy) PreferredSizeHandlerEditPolicy(org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy) EnlargeContainerEditPolicy(org.yakindu.sct.ui.editor.policies.EnlargeContainerEditPolicy)

Aggregations

PreferredSizeHandlerEditPolicy (org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy)3 IFigure (org.eclipse.draw2d.IFigure)1 Request (org.eclipse.gef.Request)1 Command (org.eclipse.gef.commands.Command)1 UnexecutableCommand (org.eclipse.gef.commands.UnexecutableCommand)1 RootComponentEditPolicy (org.eclipse.gef.editpolicies.RootComponentEditPolicy)1 ConstrainedToolbarLayoutEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy)1 SemanticEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy)1 DestroyRequest (org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest)1 EnlargeContainerEditPolicy (org.yakindu.sct.ui.editor.policies.EnlargeContainerEditPolicy)1 FeedbackGraphicalNodeEditPolicy (org.yakindu.sct.ui.editor.policies.FeedbackGraphicalNodeEditPolicy)1