Search in sources :

Example 1 with WidgetContainerEditPolicy

use of org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy in project yamcs-studio by yamcs.

the class AbstractContainerEditpart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new WidgetContainerEditPolicy());
    installEditPolicy(EditPolicy.LAYOUT_ROLE, getExecutionMode() == ExecutionMode.EDIT_MODE ? new WidgetXYLayoutEditPolicy() : null);
    // the snap feedback effect
    // $NON-NLS-1$
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
    if (getExecutionMode() == ExecutionMode.EDIT_MODE)
        installEditPolicy(DropPVtoPVWidgetEditPolicy.DROP_PV_ROLE, new DropPVtoContainerEditPolicy());
}
Also used : WidgetContainerEditPolicy(org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy) WidgetXYLayoutEditPolicy(org.csstudio.opibuilder.editpolicies.WidgetXYLayoutEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy) DropPVtoContainerEditPolicy(org.csstudio.opibuilder.dnd.DropPVtoContainerEditPolicy)

Example 2 with WidgetContainerEditPolicy

use of org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy 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)

Aggregations

WidgetContainerEditPolicy (org.csstudio.opibuilder.editpolicies.WidgetContainerEditPolicy)2 DropPVtoContainerEditPolicy (org.csstudio.opibuilder.dnd.DropPVtoContainerEditPolicy)1 WidgetTreeContainerEditPolicy (org.csstudio.opibuilder.editpolicies.WidgetTreeContainerEditPolicy)1 WidgetXYLayoutEditPolicy (org.csstudio.opibuilder.editpolicies.WidgetXYLayoutEditPolicy)1 RootEditPart (org.eclipse.gef.RootEditPart)1 RootComponentEditPolicy (org.eclipse.gef.editpolicies.RootComponentEditPolicy)1 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)1