use of org.eclipse.ui.IWorkbench in project tesb-studio-se by Talend.
the class ExporCameltJobScriptAction method doRun.
protected void doRun() {
JobCamelScriptsExportWizard processWizard = new JobCamelScriptsExportWizard();
IWorkbench workbench = getWorkbench();
processWizard.setWindowTitle(EXPORTJOBSCRIPTS);
processWizard.init(workbench, (IStructuredSelection) this.getSelection());
WizardDialog dialog = new WizardDialog(shell, processWizard);
workbench.saveAllEditors(true);
dialog.setPageSize(830, 450);
dialog.open();
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class PublishOnSpagoAction method doRun.
protected void doRun() {
PublishOnSpagoExportWizard publishWizard = new PublishOnSpagoExportWizard();
IWorkbench workbench = getWorkbench();
//$NON-NLS-1$
publishWizard.setWindowTitle(EXPORTJOBSCRIPTS + " (SpagoBI)");
publishWizard.init(workbench, (IStructuredSelection) this.getSelection());
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, publishWizard);
dialog.open();
}
use of org.eclipse.ui.IWorkbench in project tesb-studio-se by Talend.
the class RefactorRenameHandler method isEnabled.
public boolean isEnabled() {
if (!handler.isEnabled()) {
return false;
}
// disable the command when editor is readonly.
IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null) {
return false;
}
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window == null) {
return false;
}
IWorkbenchPage activePage = window.getActivePage();
if (activePage == null) {
return false;
}
IEditorPart activeEditor = activePage.getActiveEditor();
if (activeEditor != null && activeEditor instanceof LocalWSDLEditor) {
LocalWSDLEditor wsdlEditor = (LocalWSDLEditor) activeEditor;
return !wsdlEditor.isEditorInputReadOnly();
}
return false;
}
use of org.eclipse.ui.IWorkbench in project ACS by ACS-Community.
the class Application method stop.
public void stop() {
final IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null)
return;
final Display display = workbench.getDisplay();
display.syncExec(new Runnable() {
public void run() {
if (!display.isDisposed())
workbench.close();
}
});
}
use of org.eclipse.ui.IWorkbench in project translationstudio8 by heartsome.
the class ConverterCommandTrigger method openDialog.
private static void openDialog(IWorkbenchWindow window, IFile file, String commandId) {
IWorkbench workbench = window.getWorkbench();
ICommandService commandService = (ICommandService) workbench.getService(ICommandService.class);
Command command = commandService.getCommand(commandId);
try {
EvaluationContext context = new EvaluationContext(null, IEvaluationContext.UNDEFINED_VARIABLE);
context.addVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME, window);
if (file != null) {
StructuredSelection selection = new StructuredSelection(file);
context.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
}
command.executeWithChecks(new ExecutionEvent(command, Collections.EMPTY_MAP, null, context));
} catch (ExecutionException e) {
LOGGER.error("", e);
} catch (NotDefinedException e) {
LOGGER.error("", e);
} catch (NotEnabledException e) {
LOGGER.error("", e);
} catch (NotHandledException e) {
LOGGER.error("", e);
}
}
Aggregations