Search in sources :

Example 1 with ConstrainedToolbarLayoutEditPolicy

use of org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy 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)

Aggregations

Request (org.eclipse.gef.Request)1 Command (org.eclipse.gef.commands.Command)1 UnexecutableCommand (org.eclipse.gef.commands.UnexecutableCommand)1 ConstrainedToolbarLayoutEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy)1 PreferredSizeHandlerEditPolicy (org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy)1