Search in sources :

Example 66 with IEditorPart

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

the class MultiPageSqlBuilderEditor method createPartControl2.

public final void createPartControl2(Composite parent) {
    //super.createPartControl(parent);
    Composite pageContainer = createPageContainer(parent);
    this.container = createContainer(pageContainer);
    createPages();
    // done
    if (getActivePage() == -1) {
        setActivePage(0);
        IEditorPart part = getEditor(0);
        if (part != null) {
            final IServiceLocator serviceLocator = part.getEditorSite();
            if (serviceLocator instanceof INestable) {
                activeServiceLocator = (INestable) serviceLocator;
                activeServiceLocator.activate();
            }
        }
    }
}
Also used : SQLBuilderDesignerComposite(org.talend.sqlbuilder.ui.SQLBuilderDesignerComposite) ErDiagramComposite(org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite) Composite(org.eclipse.swt.widgets.Composite) AbstractSQLEditorComposite(org.talend.sqlbuilder.ui.AbstractSQLEditorComposite) SQLBuilderEditorComposite(org.talend.sqlbuilder.ui.SQLBuilderEditorComposite) IServiceLocator(org.eclipse.ui.services.IServiceLocator) INestable(org.eclipse.ui.internal.services.INestable) IEditorPart(org.eclipse.ui.IEditorPart)

Example 67 with IEditorPart

use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.

the class OpenCamelExistVersionProcessAction method doRun.

@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();
    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setHelpAvailable(false);
    dialog.setPageSize(300, 250);
    //$NON-NLS-1$
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog"));
    if (dialog.open() == Dialog.OK) {
        refresh(node);
        // refresh the corresponding editor's name
        IEditorPart part = getCorrespondingEditor(node);
        if (part != null && part instanceof IUIRefresher) {
            ((IUIRefresher) part).refreshName();
        } else {
            processRoutineRenameOperation(originalName, node, path);
        }
    }
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) IPath(org.eclipse.core.runtime.IPath) RepositoryObject(org.talend.core.model.repository.RepositoryObject) ISelection(org.eclipse.jface.viewers.ISelection) RepositoryObject(org.talend.core.model.repository.RepositoryObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IEditorPart(org.eclipse.ui.IEditorPart) OpenCamelExistVersionProcessWizard(org.talend.camel.designer.ui.wizards.OpenCamelExistVersionProcessWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IUIRefresher(org.talend.core.services.IUIRefresher)

Example 68 with IEditorPart

use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.

the class RunContainerPreferencePage method performOk.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.esb.runcontainer.preferences.FieldLayoutPreferencePage#performOk()
     */
@Override
public boolean performOk() {
    boolean performOk = super.performOk();
    if (runtimeEnable != getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI)) {
        IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
        if (service != null) {
            service.refreshView();
        }
        List<IEditorReference> editorRefs = new ArrayList();
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IEditorReference[] reference = page.getEditorReferences();
        for (IEditorReference editorRef : reference) {
            IEditorPart part = editorRef.getEditor(false);
            if (part.getEditorInput() instanceof JobEditorInput) {
                editorRefs.add(editorRef);
            }
        }
        if (editorRefs.size() > 0 && MessageDialog.openConfirm(getShell(), "Running Container Changed", "All editors need to be closed to apply the changes, do you want to close all opening editors now?")) {
            page.closeEditors(editorRefs.toArray(new IEditorReference[editorRefs.size()]), true);
        }
    }
    return performOk;
}
Also used : JobEditorInput(org.talend.core.ui.editor.JobEditorInput) IEditorReference(org.eclipse.ui.IEditorReference) IRunProcessService(org.talend.designer.runprocess.IRunProcessService) ArrayList(java.util.ArrayList) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart)

Example 69 with IEditorPart

use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.

the class ESBService method refreshComponentView.

/**
     * When services connection is renamed, refresh the connection label in the component view of job.
     * 
     * @param item
     */
@Override
public void refreshComponentView(Item item) {
    try {
        IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
        IEditorReference[] editors = activePage.getEditorReferences();
        for (IEditorReference er : editors) {
            IEditorPart part = er.getEditor(false);
            if (part instanceof AbstractMultiPageTalendEditor) {
                AbstractMultiPageTalendEditor editor = (AbstractMultiPageTalendEditor) part;
                CommandStack stack = (CommandStack) editor.getTalendEditor().getAdapter(CommandStack.class);
                if (stack != null) {
                    IProcess process = editor.getProcess();
                    for (final INode processNode : process.getGraphicalNodes()) {
                        if (processNode instanceof Node) {
                            checkRepository((Node) processNode, item, stack);
                        }
                    }
                }
            }
        }
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) CommandStack(org.eclipse.gef.commands.CommandStack) INode(org.talend.core.model.process.INode) IEditorReference(org.eclipse.ui.IEditorReference) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) Node(org.talend.designer.core.ui.editor.nodes.Node) INode(org.talend.core.model.process.INode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart) IProcess(org.talend.core.model.process.IProcess) CoreException(org.eclipse.core.runtime.CoreException) BusinessException(org.talend.commons.exception.BusinessException) IOException(java.io.IOException) PersistenceException(org.talend.commons.exception.PersistenceException)

Example 70 with IEditorPart

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

the class StatsAndLogsView method createStatsAndLogsView.

/**
     * ftang Comment method "createStatsAndLogsView".
     * 
     */
public void createStatsAndLogsView() {
    IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) activeEditor).getTalendEditor();
    createFullPartControl(this.parent, (Process) talendEditor.getProcess());
}
Also used : AbstractTalendEditor(org.talend.designer.core.ui.editor.AbstractTalendEditor) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) IEditorPart(org.eclipse.ui.IEditorPart)

Aggregations

IEditorPart (org.eclipse.ui.IEditorPart)401 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)137 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)127 PartInitException (org.eclipse.ui.PartInitException)73 IFile (org.eclipse.core.resources.IFile)58 XLIFFEditorImplWithNatTable (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.XLIFFEditorImplWithNatTable)53 IEditorReference (org.eclipse.ui.IEditorReference)52 XLFHandler (net.heartsome.cat.ts.core.file.XLFHandler)45 ArrayList (java.util.ArrayList)43 QueryEditorPart (com.cubrid.common.ui.query.editor.QueryEditorPart)41 IEditorInput (org.eclipse.ui.IEditorInput)37 IViewPart (org.eclipse.ui.IViewPart)34 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)33 Test (org.junit.Test)31 ISelection (org.eclipse.jface.viewers.ISelection)30 FileEditorInput (org.eclipse.ui.part.FileEditorInput)29 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)27 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)26 AbstractMultiPageTalendEditor (org.talend.designer.core.ui.AbstractMultiPageTalendEditor)26 IXliffEditor (net.heartsome.cat.ts.ui.editors.IXliffEditor)24