Search in sources :

Example 1 with PartInitException

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

the class StartMonitorJobAction method showPropertiesView.

public void showPropertiesView(IActiveJvm jvm) {
    try {
        List<PropertySheet> views = getProperriesView();
        // check if there are no properties views
        if (views.size() == 0) {
            openPropertiesView(jvm);
            return;
        }
        // check if there is a corresponding properties view
        PropertySheet view = getPropertiesView(jvm, views);
        if (view != null) {
            brindPropertiesViewToFront(view);
            return;
        }
        // check if there is non-pinned properties view
        view = getNonPinnedPropertiesView(views);
        if (view != null) {
            brindPropertiesViewToFront(view);
            return;
        }
        openPropertiesView(jvm);
    } catch (PartInitException e) {
        Activator.log(IStatus.ERROR, Messages.bringPropertiesViewToFrontFailedMsg, e);
    }
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with PartInitException

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

the class ComponentSearcher method openEditorOperation.

public void openEditorOperation(RepositoryNode repositoryNode) {
    if (repositoryNode != null && repositoryNode.getObject() != null && repositoryNode.getObject().getProperty() != null && repositoryNode.getObject().getProperty().getItem() != null) {
        Item item = repositoryNode.getObject().getProperty().getItem();
        try {
            ERepositoryObjectType repObjType = ERepositoryObjectType.getItemType(item);
            IJobEditorHandler editorInputFactory = JobEditorHandlerManager.getInstance().extractEditorInputFactory(repObjType.getType());
            editorInputFactory.openJobEditor(editorInputFactory.createJobEditorInput(item, true));
        } catch (PartInitException e) {
            ExceptionHandler.process(e);
        } catch (PersistenceException e) {
            ExceptionHandler.process(e);
        }
    }
}
Also used : ProcessItem(org.talend.core.model.properties.ProcessItem) Item(org.talend.core.model.properties.Item) PersistenceException(org.talend.commons.exception.PersistenceException) PartInitException(org.eclipse.ui.PartInitException) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) IJobEditorHandler(org.talend.core.ui.editor.IJobEditorHandler)

Example 3 with PartInitException

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

the class OpenExistVersionProcessAction method getCorrespondingEditor.

@Override
protected IEditorPart getCorrespondingEditor(IRepositoryNode node) {
    IEditorReference[] eidtors = getActivePage().getEditorReferences();
    for (IEditorReference eidtor : eidtors) {
        try {
            IEditorInput input = eidtor.getEditorInput();
            if (!(input instanceof JobEditorInput)) {
                continue;
            }
            JobEditorInput repositoryInput = (JobEditorInput) input;
            checkUnLoadedNodeForProcess(repositoryInput);
            if (repositoryInput.getItem().equals(node.getObject().getProperty().getItem())) {
                IPath path = repositoryInput.getFile().getLocation();
                return eidtor.getEditor(false);
            }
        } catch (PartInitException e) {
            continue;
        }
    }
    return null;
}
Also used : JobEditorInput(org.talend.core.ui.editor.JobEditorInput) IEditorReference(org.eclipse.ui.IEditorReference) IPath(org.eclipse.core.runtime.IPath) PartInitException(org.eclipse.ui.PartInitException) IEditorInput(org.eclipse.ui.IEditorInput)

Example 4 with PartInitException

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

the class OpentRunJobComponentAction method run.

@Override
public void run() {
    List selection = getSelectedObjects();
    Object input = selection.get(0);
    if (input instanceof NodePart) {
        NodePart part = (NodePart) input;
        Node node = (Node) part.getModel();
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        String processName = (String) node.getPropertyValue(EParameterName.PROCESS_TYPE_PROCESS.getName());
        String version = (String) node.getPropertyValue(EParameterName.PROCESS_TYPE_VERSION.getName());
        if (processName != null && !"".equals(processName)) {
            //$NON-NLS-1$
            try {
                ItemCacheManager.clearCache();
                ProcessItem processItem = ItemCacheManager.getProcessItem(processName, version);
                if (processItem != null) {
                    ProcessEditorInput fileEditorInput = new ProcessEditorInput(processItem, true);
                    IEditorPart editorPart = page.findEditor(fileEditorInput);
                    if (editorPart == null) {
                        ERepositoryObjectType repObjType = ERepositoryObjectType.getItemType(processItem);
                        IJobEditorHandler editorInputFactory = JobEditorHandlerManager.getInstance().extractEditorInputFactory(repObjType.getType());
                        editorInputFactory.openJobEditor(editorInputFactory.createJobEditorInput(processItem, true));
                    } else {
                        page.activate(editorPart);
                    }
                }
            } catch (PartInitException e) {
                MessageBoxExceptionHandler.process(e);
            } catch (PersistenceException e) {
                MessageBoxExceptionHandler.process(e);
            }
        } else {
            try {
                // modified for feature 2454.
                page.showView(ComponentSettingsView.ID);
            } catch (PartInitException e) {
                ExceptionHandler.process(e);
            }
        }
    }
}
Also used : Node(org.talend.designer.core.ui.editor.nodes.Node) IEditorPart(org.eclipse.ui.IEditorPart) IJobEditorHandler(org.talend.core.ui.editor.IJobEditorHandler) ProcessEditorInput(org.talend.designer.core.ui.editor.ProcessEditorInput) ProcessItem(org.talend.core.model.properties.ProcessItem) PersistenceException(org.talend.commons.exception.PersistenceException) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) List(java.util.List) PartInitException(org.eclipse.ui.PartInitException) NodePart(org.talend.designer.core.ui.editor.nodes.NodePart) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType)

Example 5 with PartInitException

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

the class EditRoutineAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    if (repositoryNode == null) {
        repositoryNode = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
    }
    RoutineItem routineItem = (RoutineItem) repositoryNode.getObject().getProperty().getItem();
    try {
        openRoutineEditor(routineItem, false);
        refresh(repositoryNode);
        // CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
        CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<ModuleNeeded>(), null);
    } catch (PartInitException e) {
        MessageBoxExceptionHandler.process(e);
    } catch (SystemException e) {
        MessageBoxExceptionHandler.process(e);
    }
}
Also used : SystemException(org.talend.commons.exception.SystemException) RoutineItem(org.talend.core.model.properties.RoutineItem) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException) ModuleNeeded(org.talend.core.model.general.ModuleNeeded)

Aggregations

PartInitException (org.eclipse.ui.PartInitException)720 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)300 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)177 IFile (org.eclipse.core.resources.IFile)146 IEditorPart (org.eclipse.ui.IEditorPart)141 CoreException (org.eclipse.core.runtime.CoreException)94 FileEditorInput (org.eclipse.ui.part.FileEditorInput)88 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)82 IEditorInput (org.eclipse.ui.IEditorInput)74 ISelection (org.eclipse.jface.viewers.ISelection)62 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)60 IResource (org.eclipse.core.resources.IResource)59 IEditorReference (org.eclipse.ui.IEditorReference)53 IViewPart (org.eclipse.ui.IViewPart)53 IOException (java.io.IOException)42 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)41 Point (org.eclipse.swt.graphics.Point)40 IWorkbench (org.eclipse.ui.IWorkbench)40 Path (org.eclipse.core.runtime.Path)39 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)39