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 };
}
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);
}
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);
}
}
Aggregations