Search in sources :

Example 1 with ConfigureRuntimePropertiesAction

use of org.csstudio.opibuilder.actions.ConfigureRuntimePropertiesAction in project yamcs-studio by yamcs.

the class OPIRunnerContextMenuProvider method addSettingPropertiesAction.

private void addSettingPropertiesAction(final IMenuManager menu) {
    List<?> selectedEditParts = ((IStructuredSelection) getViewer().getSelection()).toList();
    if (selectedEditParts.size() == 1) {
        if (selectedEditParts.get(0) instanceof AbstractBaseEditPart) {
            AbstractBaseEditPart editPart = (AbstractBaseEditPart) selectedEditParts.get(0);
            AbstractWidgetModel widget = editPart.getWidgetModel();
            if (widget.getRuntimePropertyList() != null) {
                menu.add(new ConfigureRuntimePropertiesAction(getViewer().getControl().getShell(), widget));
            }
        }
    }
}
Also used : AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) AbstractBaseEditPart(org.csstudio.opibuilder.editparts.AbstractBaseEditPart) ConfigureRuntimePropertiesAction(org.csstudio.opibuilder.actions.ConfigureRuntimePropertiesAction) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ConfigureRuntimePropertiesAction (org.csstudio.opibuilder.actions.ConfigureRuntimePropertiesAction)1 AbstractBaseEditPart (org.csstudio.opibuilder.editparts.AbstractBaseEditPart)1 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1