Search in sources :

Example 16 with IWorkbench

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();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) JobCamelScriptsExportWizard(org.talend.camel.designer.ui.wizards.JobCamelScriptsExportWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 17 with IWorkbench

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();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) PublishOnSpagoExportWizard(org.talend.sbi.engines.client.ui.wizards.PublishOnSpagoExportWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 18 with IWorkbench

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;
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart)

Example 19 with IWorkbench

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();
        }
    });
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Display(org.eclipse.swt.widgets.Display)

Example 20 with IWorkbench

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);
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) NotHandledException(org.eclipse.core.commands.NotHandledException) Command(org.eclipse.core.commands.Command) ExecutionEvent(org.eclipse.core.commands.ExecutionEvent) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) NotDefinedException(org.eclipse.core.commands.common.NotDefinedException) IEvaluationContext(org.eclipse.core.expressions.IEvaluationContext) EvaluationContext(org.eclipse.core.expressions.EvaluationContext) ExecutionException(org.eclipse.core.commands.ExecutionException) NotEnabledException(org.eclipse.core.commands.NotEnabledException) ICommandService(org.eclipse.ui.commands.ICommandService)

Aggregations

IWorkbench (org.eclipse.ui.IWorkbench)60 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)21 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)17 IEditorPart (org.eclipse.ui.IEditorPart)13 WizardDialog (org.eclipse.jface.wizard.WizardDialog)10 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ISelection (org.eclipse.jface.viewers.ISelection)8 PartInitException (org.eclipse.ui.PartInitException)8 Display (org.eclipse.swt.widgets.Display)7 IProject (org.eclipse.core.resources.IProject)6 IResource (org.eclipse.core.resources.IResource)6 TreeViewer (org.eclipse.jface.viewers.TreeViewer)6 Shell (org.eclipse.swt.widgets.Shell)6 IEditorDescriptor (org.eclipse.ui.IEditorDescriptor)6 TableEditorInput (com.cubrid.common.ui.cubrid.table.editor.TableEditorInput)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)5 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)5 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)5 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)5 IJavaProject (org.eclipse.jdt.core.IJavaProject)5