Search in sources :

Example 11 with IWorkbench

use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.

the class ShowEditorPageAction method run.

@Override
public void run() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
    IEditorPart editorPart = page.getActiveEditor();
    if (editorPart instanceof MultiPageTalendEditor) {
        ((MultiPageTalendEditor) editorPart).showCodePage();
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) MultiPageTalendEditor(org.talend.designer.core.ui.MultiPageTalendEditor) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart)

Example 12 with IWorkbench

use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.

the class ShowJobSettingsViewAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
public void run() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
    try {
        page.showView(getViewId());
        JobSettingsView view = (JobSettingsView) page.findView(getViewId());
        IDiagramModelService service = CorePlugin.getDefault().getDiagramModelService();
        ISelection selection = service.getBusinessEditorSelection(page.getActiveEditor());
        if (selection instanceof IStructuredSelection) {
            Object firstElement = ((IStructuredSelection) selection).getFirstElement();
            if (firstElement != null) {
                BusinessType type = service.getBusinessModelType(firstElement);
                if (type == BusinessType.CONNECTION || type == BusinessType.NOTE || type == BusinessType.SHAP) {
                    view.refresh(false, firstElement);
                } else if (type == BusinessType.PROCESS || service.isInstanceOfCompartmentEditPart(firstElement)) {
                    view.refresh(false, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor());
                }
            }
        }
    } catch (PartInitException e) {
        // e.printStackTrace();
        ExceptionHandler.process(e);
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) JobSettingsView(org.talend.designer.core.ui.views.jobsettings.JobSettingsView) IDiagramModelService(org.talend.designer.business.diagram.custom.IDiagramModelService) ISelection(org.eclipse.jface.viewers.ISelection) BusinessType(org.talend.core.model.business.BusinessType) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException)

Example 13 with IWorkbench

use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.

the class ConfigRoutineLibraryAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    ConfigExternalLibWizard wizard = new ConfigExternalLibWizard();
    IWorkbench workbench = getWorkbench();
    wizard.init(workbench, (IStructuredSelection) getSelection());
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, wizard);
    dialog.open();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ConfigExternalLibWizard(org.talend.repository.ui.wizards.ConfigExternalLib.ConfigExternalLibWizard)

Example 14 with IWorkbench

use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.

the class RunProcessAction method run.

@Override
public void run() {
    if ((ProcessComposite.getProcessContext() != null && !ProcessComposite.getProcessContext().isRunning())) {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
        // TODO SML Use getInstance
        ShowRunProcessViewAction action = new ShowRunProcessViewAction();
        action.run();
        // TODO SML Optimize
        ProcessView view = (ProcessView) page.getActivePart();
        view.runAction.run();
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) ProcessView(org.talend.designer.runprocess.ui.views.ProcessView) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Example 15 with IWorkbench

use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.

the class RunProcessShortcutAction method run.

public void run() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
    IEditorPart activeEditor = page.getActiveEditor();
    if (CorePlugin.getDefault().getDesignerCoreService().isTalendEditor(activeEditor)) {
        JobLaunchShortcutManager.run(activeEditor);
    } else {
        new RunProcessAction().run();
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart)

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