Search in sources :

Example 6 with DisplayInfo

use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.

the class TopDisplaysMenu method getContributionItems.

@Override
protected IContributionItem[] getContributionItems() {
    final IMenuManager items = new MenuManager(Messages.TopDisplays, OpenDisplayAction.getIcon(), null);
    try {
        final String setting = Preferences.getTopDisplays();
        final List<DisplayInfo> displays = DisplayInfoXMLUtil.fromDisplaysXML(setting);
        for (DisplayInfo display : displays) items.add(new OpenDisplayAction(display));
    } catch (Exception ex) {
        logger.log(Level.WARNING, "Cannot create 'top displays'", ex);
    }
    return new IContributionItem[] { items };
}
Also used : DisplayInfo(org.csstudio.display.builder.rcp.DisplayInfo) IContributionItem(org.eclipse.jface.action.IContributionItem) OpenDisplayAction(org.csstudio.display.builder.rcp.OpenDisplayAction) IMenuManager(org.eclipse.jface.action.IMenuManager) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager)

Example 7 with DisplayInfo

use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.

the class NavigationAction method run.

/**
 * Navigate one step
 *  <p>.. as opposed to selecting a display further down the stack
 *  from the menu
 */
@Override
public void run() {
    final DisplayInfo display = navigate(1);
    part.loadDisplayFile(display);
}
Also used : DisplayInfo(org.csstudio.display.builder.rcp.DisplayInfo)

Example 8 with DisplayInfo

use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.

the class TopDisplaysToolbarItems method createContributionItems.

@Override
public void createContributionItems(final IServiceLocator serviceLocator, final IContributionRoot additions) {
    // for ExtensionContributionFactory example
    try {
        final String setting = Preferences.getTopDisplays();
        final List<DisplayInfo> displays = DisplayInfoXMLUtil.fromDisplaysXML(setting);
        for (DisplayInfo display : displays) {
            final IAction action = new OpenDisplayAction(display);
            final IContributionItem item = new ActionContributionItem(action);
            additions.addContributionItem(item, null);
        }
    } catch (Exception ex) {
        logger.log(Level.WARNING, "Cannot create 'top displays'", ex);
    }
}
Also used : ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) DisplayInfo(org.csstudio.display.builder.rcp.DisplayInfo) IAction(org.eclipse.jface.action.IAction) IContributionItem(org.eclipse.jface.action.IContributionItem) OpenDisplayAction(org.csstudio.display.builder.rcp.OpenDisplayAction)

Aggregations

DisplayInfo (org.csstudio.display.builder.rcp.DisplayInfo)8 OpenDisplayAction (org.csstudio.display.builder.rcp.OpenDisplayAction)3 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)2 IContributionItem (org.eclipse.jface.action.IContributionItem)2 URI (java.net.URI)1 DisplayModel (org.csstudio.display.builder.model.DisplayModel)1 Macros (org.csstudio.display.builder.model.macros.Macros)1 OpenDisplayActionInfo (org.csstudio.display.builder.model.properties.OpenDisplayActionInfo)1 RuntimeViewPart (org.csstudio.display.builder.rcp.RuntimeViewPart)1 IFile (org.eclipse.core.resources.IFile)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 Action (org.eclipse.jface.action.Action)1 IAction (org.eclipse.jface.action.IAction)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 Menu (org.eclipse.swt.widgets.Menu)1