use of org.talend.designer.camel.resource.editors.input.RouteResourceInput in project tesb-studio-se by Talend.
the class RouteResourceEditorUtil method openDefaultEditor.
/**
* Open default editor
*
* @param page
* @param node
* @param item
*/
public static void openDefaultEditor(final IWorkbenchPage page, IRepositoryNode node, RouteResourceItem item) {
RouteResourceInput fileEditorInput = RouteResourceInput.createInput(node, item);
openEditor(page, fileEditorInput, item, RouteResourceEditor.ID);
}
use of org.talend.designer.camel.resource.editors.input.RouteResourceInput in project tesb-studio-se by Talend.
the class ResourceEditorListener method partClosed.
@Override
public void partClosed(IWorkbenchPartReference partRef) {
IWorkbenchPart part = partRef.getPart(true);
if (part instanceof IEditorPart) {
IEditorInput input = ((IEditorPart) part).getEditorInput();
if (input instanceof RouteResourceInput) {
Item item = ((RouteResourceInput) input).getItem();
if (item.getProperty().getId().equals(editorInput.getItem().getProperty().getId())) {
try {
ProxyRepositoryFactory.getInstance().unlock(item);
page.getWorkbenchWindow().getPartService().removePartListener(this);
IResourceChangeListener l = editorInput.getListener();
if (null != l) {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(l);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
}
}
use of org.talend.designer.camel.resource.editors.input.RouteResourceInput in project tesb-studio-se by Talend.
the class OpenAnotherVersionResourceAction method getCorrespondingEditor.
protected IEditorPart getCorrespondingEditor(RepositoryNode node) {
for (IEditorReference ref : getActivePage().getEditorReferences()) {
try {
IEditorInput input = ref.getEditorInput();
if (!(input instanceof RouteResourceInput)) {
continue;
}
RouteResourceInput repositoryInput = (RouteResourceInput) input;
if (repositoryInput.getItem().equals(node.getObject().getProperty().getItem())) {
return ref.getEditor(false);
}
} catch (PartInitException e) {
continue;
}
}
return null;
}
Aggregations