use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.
the class NavigationAction method addAction.
/**
* Add action to navigate to a specific display to the 'menu'.
*
* <p><code>menu</code> must be valid
*
* @param display Target display
* @param steps Position of that display in navigation stack
*/
private void addAction(final DisplayInfo display, final int steps) {
final Action action = new Action(display.getName()) {
@Override
public void run() {
final DisplayInfo display = navigate(steps);
part.loadDisplayFile(display);
}
};
action.setImageDescriptor(icon);
final ActionContributionItem item = new ActionContributionItem(action);
item.fill(menu, -1);
}
use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.
the class NavigationAction method getMenu.
// IMenuCreator
@Override
public Menu getMenu(final Control parent) {
// Entries can change, so re-create on each call
if (menu != null)
menu.dispose();
menu = new Menu(parent);
final List<DisplayInfo> displays = getDisplays();
final int N = displays.size();
for (int i = 0; i < N; ++i) addAction(displays.get(N - i - 1), i + 1);
return menu;
}
use of org.csstudio.display.builder.rcp.DisplayInfo 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.DisplayInfo in project org.csstudio.display.builder by kasemir.
the class StandaloneAction method run.
@Override
public void run() {
final DisplayModel parent_model = view.getDisplayModel();
final DisplayInfo info = view.getDisplayInfo();
ActionUtil.handleAction(parent_model, new OpenDisplayActionInfo(Messages.OpenStandalone, info.getPath(), info.getMacros(), OpenDisplayActionInfo.Target.STANDALONE));
}
use of org.csstudio.display.builder.rcp.DisplayInfo in project org.csstudio.display.builder by kasemir.
the class RCP_JFXRepresentation method openDisplayOnPage.
private ToolkitRepresentation<Parent, Node> openDisplayOnPage(final IWorkbenchPage page, final DisplayModel model, final Consumer<DisplayModel> close_handler) throws Exception {
final DisplayInfo info = DisplayInfo.forModel(model);
final RuntimeViewPart part = RuntimeViewPart.open(page, close_handler, info);
final RCP_JFXRepresentation new_representation = part.getRepresentation();
new_representation.representModel(part.getRoot(), model);
return new_representation;
}
Aggregations