use of org.csstudio.display.builder.rcp.OpenDisplayAction in project org.csstudio.display.builder by kasemir.
the class RuntimeLauncher method open.
@Override
public void open(final IPath location) {
String path = location.toOSString();
// If possible, convert to workspace resource
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
URI uri = URIUtil.toURI(location);
final IFile[] files = root.findFilesForLocationURI(uri);
if (files != null && files.length > 0)
path = files[0].getFullPath().toOSString();
final DisplayInfo info = new DisplayInfo(path, "Navigator File", new Macros());
new OpenDisplayAction(info).run();
}
use of org.csstudio.display.builder.rcp.OpenDisplayAction 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.OpenDisplayAction 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