Search in sources :

Example 6 with IWorkbenchPage

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

the class ConnectionPart method setSelected.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#setSelected(int)
     */
@Override
public void setSelected(final int value) {
    super.setSelected(value);
    List cl = this.getChildren();
    for (int i = 0; i < cl.size(); i++) {
        if (((EditPart) cl.get(i)).getSelected() != value) {
            ((EditPart) cl.get(i)).setSelected(value);
        }
    }
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (value == SELECTED_PRIMARY) {
        IViewPart view = page.findView(ComponentSettingsView.ID);
        if (view != null) {
            ComponentSettingsView compSettings = (ComponentSettingsView) view;
            compSettings.setElement((Connection) getModel());
            CodeView.refreshCodeView((Connection) getModel());
        }
    } else if (value == SELECTED_NONE) {
        IViewPart view = page.findView(ComponentSettingsView.ID);
        if (view != null) {
            ComponentSettingsView compSettings = (ComponentSettingsView) view;
            compSettings.cleanDisplay();
        }
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ArrayList(java.util.ArrayList) List(java.util.List) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Example 7 with IWorkbenchPage

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

the class ComponentChooseDialog method getJobletPart.

public AbstractMultiPageTalendEditor getJobletPart(JobletContainerPart part) {
    AbstractMultiPageTalendEditor openEditor = null;
    Node jobletNode = ((JobletContainer) part.getModel()).getNode();
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (PluginChecker.isJobLetPluginLoaded()) {
        IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
        if (service != null) {
            openEditor = (AbstractMultiPageTalendEditor) service.openJobletEditor(jobletNode, page);
        }
    }
    return openEditor;
}
Also used : IJobletProviderService(org.talend.core.ui.IJobletProviderService) JobletContainer(org.talend.designer.core.ui.editor.jobletcontainer.JobletContainer) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) INode(org.talend.core.model.process.INode) RepositoryNode(org.talend.repository.model.RepositoryNode) HL7FileNode(org.talend.core.model.metadata.builder.connection.HL7FileNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) Node(org.talend.designer.core.ui.editor.nodes.Node) IExternalNode(org.talend.core.model.process.IExternalNode) XMLFileNode(org.talend.core.model.metadata.builder.connection.XMLFileNode) MapperExternalNode(org.talend.core.model.process.node.MapperExternalNode) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Example 8 with IWorkbenchPage

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

the class RefreshView method refreshAll.

public static void refreshAll() {
    IWorkbenchWindow workBenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (workBenchWindow == null) {
        return;
    }
    IWorkbenchPage workBenchPage = workBenchWindow.getActivePage();
    if (workBenchPage == null) {
        return;
    }
    for (IViewDescriptor desc : PlatformUI.getWorkbench().getViewRegistry().getViews()) {
        IViewPart viewPart = workBenchPage.findView(desc.getId());
        // show the view again in order to see the change
        if (viewPart != null) {
            workBenchPage.hideView(viewPart);
        }
    }
    workBenchPage.resetPerspective();
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IViewDescriptor(org.eclipse.ui.views.IViewDescriptor) IViewPart(org.eclipse.ui.IViewPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Example 9 with IWorkbenchPage

use of org.eclipse.ui.IWorkbenchPage 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 10 with IWorkbenchPage

use of org.eclipse.ui.IWorkbenchPage 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

IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)827 PartInitException (org.eclipse.ui.PartInitException)309 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)296 IEditorPart (org.eclipse.ui.IEditorPart)268 IFile (org.eclipse.core.resources.IFile)221 FileEditorInput (org.eclipse.ui.part.FileEditorInput)99 IViewPart (org.eclipse.ui.IViewPart)98 IWorkbench (org.eclipse.ui.IWorkbench)89 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)88 IEditorInput (org.eclipse.ui.IEditorInput)84 IEditorReference (org.eclipse.ui.IEditorReference)83 IResource (org.eclipse.core.resources.IResource)76 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)69 CoreException (org.eclipse.core.runtime.CoreException)66 ISelection (org.eclipse.jface.viewers.ISelection)64 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)60 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)59 IOException (java.io.IOException)57 ArrayList (java.util.ArrayList)56 IProject (org.eclipse.core.resources.IProject)51