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);
}
}
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);
}
}
}
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;
}
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);
}
}
}
}
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);
}
}
Aggregations