use of org.csstudio.opibuilder.actions.ChangeOrderAction.OrderType in project yamcs-studio by yamcs.
the class OPIEditor method createActions.
@SuppressWarnings("unchecked")
@Override
protected void createActions() {
super.createActions();
((IContextService) getEditorSite().getService(IContextService.class)).activateContext(// $NON-NLS-1$
"org.csstudio.opibuilder.opiEditor");
ActionRegistry registry = getActionRegistry();
IAction action;
action = new CopyTemplateAction(this);
registry.registerAction(action);
action = new MatchWidthAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new MatchHeightAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new DirectEditAction((IWorkbenchPart) this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
String id = ActionFactory.DELETE.getId();
action = getActionRegistry().getAction(id);
// $NON-NLS-1$
action.setActionDefinitionId("org.eclipse.ui.edit.delete");
action = new PasteWidgetsAction(this);
registry.registerAction(action);
action = new CopyWidgetsAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new CutWidgetsAction(this, (DeleteAction) registry.getAction(ActionFactory.DELETE.getId()));
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new PrintDisplayAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
id = ActionFactory.SELECT_ALL.getId();
action = getActionRegistry().getAction(id);
// $NON-NLS-1$
action.setActionDefinitionId("org.eclipse.ui.edit.selectAll");
id = ActionFactory.UNDO.getId();
action = getActionRegistry().getAction(id);
// $NON-NLS-1$
action.setActionDefinitionId("org.eclipse.ui.edit.undo");
id = ActionFactory.REDO.getId();
action = getActionRegistry().getAction(id);
// $NON-NLS-1$
action.setActionDefinitionId("org.eclipse.ui.edit.redo");
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.LEFT);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.TOP);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.BOTTOM);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.CENTER);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.MIDDLE);
registry.registerAction(action);
getSelectionActions().add(action.getId());
for (DistributeType dt : DistributeType.values()) {
action = new DistributeWidgetsAction((IWorkbenchPart) this, dt);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
for (OrderType orderType : OrderType.values()) {
action = new ChangeOrderAction((IWorkbenchPart) this, orderType);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
for (OrientationType orientationType : OrientationType.values()) {
action = new ChangeOrientationAction(this, orientationType);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
action = new RunOPIAction();
registry.registerAction(action);
PastePropertiesAction pastePropAction = new PastePropertiesAction(this);
registry.registerAction(pastePropAction);
getSelectionActions().add(pastePropAction.getId());
action = new CopyPropertiesAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
action = new ReplaceWidgetsAction(this);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
use of org.csstudio.opibuilder.actions.ChangeOrderAction.OrderType in project yamcs-studio by yamcs.
the class OPIEditorContextMenuProvider method buildContextMenu.
/**
* {@inheritDoc}
*/
@Override
public void buildContextMenu(final IMenuManager menu) {
menu.add(new Separator(GEFActionConstants.GROUP_UNDO));
menu.add(new Separator(GEFActionConstants.GROUP_COPY));
menu.add(new Separator(GEFActionConstants.GROUP_PRINT));
menu.add(new Separator(GEFActionConstants.GROUP_EDIT));
menu.add(new Separator(GEFActionConstants.GROUP_VIEW));
menu.add(new Separator(GEFActionConstants.GROUP_FIND));
menu.add(new Separator(GEFActionConstants.GROUP_ADD));
menu.add(new Separator(GEFActionConstants.GROUP_REST));
menu.add(new Separator(GEFActionConstants.GROUP_SAVE));
// $NON-NLS-1$
menu.add(new Separator(GROUP_GROUP));
menu.add(new Separator(GEFActionConstants.MB_ADDITIONS));
menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.UNDO.getId()));
menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.COPY.getId()));
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.CUT.getId()));
((WorkbenchPartAction) getAction(ActionFactory.PASTE.getId())).update();
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.PASTE.getId()));
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(CopyPropertiesAction.ID));
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(PastePropertiesAction.ID));
menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ReplaceWidgetsAction.ID));
menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.PRINT.getId()));
String orderGroup = "Order";
MenuManager orderMenu = new MenuManager(orderGroup, CustomMediaFactory.getInstance().getImageDescriptorFromPlugin(OPIBuilderPlugin.PLUGIN_ID, "icons/shape_move_front.png"), // $NON-NLS-1$
null);
orderMenu.add(new Separator(orderGroup));
for (OrderType orderType : OrderType.values()) {
orderMenu.appendToGroup(orderGroup, getAction(orderType.getActionID()));
}
menu.appendToGroup(GEFActionConstants.GROUP_COPY, orderMenu);
String orientationGroup = "Orientation";
MenuManager orientationMenu = new MenuManager(orientationGroup, CustomMediaFactory.getInstance().getImageDescriptorFromPlugin(OPIBuilderPlugin.PLUGIN_ID, "icons/flip_horizontal.png"), // $NON-NLS-1$
null);
orientationMenu.add(new Separator(orientationGroup));
for (OrientationType orientationType : OrientationType.values()) {
orientationMenu.appendToGroup(orientationGroup, getAction(orientationType.getActionID()));
}
menu.appendToGroup(GEFActionConstants.GROUP_COPY, orientationMenu);
// MenuManager cssMenu = new MenuManager("CSS", "css");//$NON-NLS-1$ //$NON-NLS-2$
// cssMenu.add(new Separator("additions"));//$NON-NLS-1$
// menu.add(cssMenu);
}
Aggregations