use of org.eclipse.ui.WorkbenchException in project linuxtools by eclipse.
the class RunScriptChartHandler method scriptConsoleInitialized.
@Override
protected void scriptConsoleInitialized(ScriptConsole console) {
int n = parsers.size();
for (int i = 0; i < n; i++) {
console.getCommand().addInputStreamListener(new ChartStreamDaemon(dataSets.get(i), parsers.get(i)));
}
try {
String name = console.getName();
String title = name.substring(name.lastIndexOf('/') + 1);
IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
GraphSelectorEditor ivp = (GraphSelectorEditor) p.openEditor(new GraphSelectorEditorInput(title), GraphSelectorEditor.ID);
String scriptName = console.getName();
ivp.createScriptSets(scriptName, names, dataSets);
for (int i = 0; i < n; i++) {
for (GraphData graph : graphs.get(i)) {
ivp.getDisplaySet(i).addGraph(graph);
}
}
} catch (WorkbenchException we) {
ExceptionErrorDialog.openError(Messages.RunScriptChartHandler_couldNotSwitchToGraphicPerspective, we);
}
super.scriptConsoleInitialized(console);
}
use of org.eclipse.ui.WorkbenchException in project linuxtools by eclipse.
the class TreeSettings method getTreeFileMemento.
private static IMemento getTreeFileMemento() {
if (!isTreeFileAvailable()) {
return null;
}
try (FileReader reader = new FileReader(settingsFile)) {
IMemento data = XMLMemento.createReadRoot(reader, FILE_NAME);
IMemento versionChild = data.getChild(T_VERSION);
if (versionChild != null && versionChild.getTextData().equals(VERSION_NUMBER)) {
return data;
}
return null;
} catch (IOException | WorkbenchException fnfe) {
return null;
}
}
use of org.eclipse.ui.WorkbenchException in project linuxtools by eclipse.
the class GcovTest method init.
@BeforeClass
public static void init() {
display = Display.getDefault();
display.syncExec(() -> {
try {
window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPart part = window.getActivePage().getActivePart();
if (part.getTitle().equals("Welcome")) {
part.dispose();
}
PlatformUI.getWorkbench().showPerspective(CUIPlugin.ID_CPERSPECTIVE, window);
} catch (WorkbenchException e) {
Assert.fail("Couldn't open C/C++ perspective.");
}
});
}
use of org.eclipse.ui.WorkbenchException in project core by jcryptool.
the class ImportSampleHandler method openActionView.
private void openActionView() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
try {
// open the action view
window.getActivePage().showView(ActionView.ID);
} catch (WorkbenchException e) {
LogUtil.logError(e);
}
}
use of org.eclipse.ui.WorkbenchException in project mdw-designer by CenturyLinkCloud.
the class DesignerPerspective method showPerspectiveAndSelectProjectPreferences.
public static void showPerspectiveAndSelectProjectPreferences(IWorkbenchWindow activeWindow, WorkflowProject project) {
try {
IWorkbenchPage page = showPerspective(activeWindow);
ProcessExplorerView processExplorer = (ProcessExplorerView) page.findView(ProcessExplorerView.VIEW_ID);
if (processExplorer != null) {
processExplorer.setFocus();
processExplorer.select(project);
PropertySheet propSheet = (PropertySheet) page.showView(PROPERTY_SHEET);
if (propSheet != null) {
TabbedPropertySheetPage tabbedPage = (TabbedPropertySheetPage) propSheet.getCurrentPage();
if (tabbedPage != null)
tabbedPage.setSelectedTab("mdw.properties.tabs.preferences");
}
}
} catch (WorkbenchException ex) {
PluginMessages.uiError(activeWindow.getShell(), ex, "Project Preferences", project);
}
}
Aggregations