Search in sources :

Example 1 with RootComponentEditPolicy

use of org.eclipse.gef.editpolicies.RootComponentEditPolicy in project yamcs-studio by yamcs.

the class ContainerTreeEditpart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    if (getWidgetModel().isChildrenOperationAllowable()) {
        installEditPolicy(EditPolicy.CONTAINER_ROLE, new WidgetContainerEditPolicy());
        installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new WidgetTreeContainerEditPolicy());
    }
    // If this editpart is the contents of the viewer, then it is not deletable!
    if (getParent() instanceof RootEditPart)
        installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
Also used : RootComponentEditPolicy(org.eclipse.gef.editpolicies.RootComponentEditPolicy) WidgetTreeContainerEditPolicy(org.csstudio.opibuilder.editpolicies.WidgetTreeContainerEditPolicy) WidgetContainerEditPolicy(org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy) RootEditPart(org.eclipse.gef.RootEditPart)

Example 2 with RootComponentEditPolicy

use of org.eclipse.gef.editpolicies.RootComponentEditPolicy in project whole by wholeplatform.

the class RootFragmentPart method createEditPolicies.

protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
    // installEditPolicy(EditPolicy.LAYOUT_ROLE, null);
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
    installEditPolicy(EditPolicy.NODE_ROLE, null);
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
}
Also used : RootComponentEditPolicy(org.eclipse.gef.editpolicies.RootComponentEditPolicy)

Example 3 with RootComponentEditPolicy

use of org.eclipse.gef.editpolicies.RootComponentEditPolicy 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 4 with RootComponentEditPolicy

use of org.eclipse.gef.editpolicies.RootComponentEditPolicy 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 5 with RootComponentEditPolicy

use of org.eclipse.gef.editpolicies.RootComponentEditPolicy in project yamcs-studio by yamcs.

the class DisplayEditpart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    // disallows the removal of this edit part from its parent
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
    removeEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE);
}
Also used : RootComponentEditPolicy(org.eclipse.gef.editpolicies.RootComponentEditPolicy)

Aggregations

RootComponentEditPolicy (org.eclipse.gef.editpolicies.RootComponentEditPolicy)5 WidgetContainerEditPolicy (org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy)1 WidgetTreeContainerEditPolicy (org.csstudio.opibuilder.editpolicies.WidgetTreeContainerEditPolicy)1 IFigure (org.eclipse.draw2d.IFigure)1 RootEditPart (org.eclipse.gef.RootEditPart)1 SemanticEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy)1 DestroyRequest (org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest)1 ContextSensitiveHelpPolicy (org.yakindu.sct.ui.editor.policies.ContextSensitiveHelpPolicy)1 PreferredSizeHandlerEditPolicy (org.yakindu.sct.ui.editor.policies.PreferredSizeHandlerEditPolicy)1