use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class ActiveProcessTracker method setContextsView.
/**
* qzhang Comment method "setProblemsView".
*
* @param process
*/
private void setContextsView(IProcess2 process, IWorkbenchPart part) {
IRunProcessService service = DesignerPlugin.getDefault().getRunProcessService();
service.setActiveProcess(process, true);
// Contexts.setTitle("Job " + process.getProperty().getLabel()); //$NON-NLS-1$
Contexts.switchToCurContextsView(part);
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class ActiveProcessTracker method addJobInProblemView.
/**
* ftang Comment method "setStatsAndLogsView".
*
* @param process
*/
// private void setStatsAndLogsView(IProcess process) {
// StatsAndLogs.setTitle("Job " + process.getProperty().getLabel()); //$NON-NLS-1$
// StatsAndLogs.switchToCurStatsAndLogsView();
// }
/**
* qzhang Comment method "setProblemsView".
*
* @param process
*/
private void addJobInProblemView(IProcess2 process) {
Problems.addProcess(process);
IRunProcessService service = DesignerPlugin.getDefault().getRunProcessService();
service.setActiveProcess(process);
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class JavaCompilationParticipant method updateProblems.
/**
* yzhang Comment method "updateProblems".
*/
private void updateProblems(List<IRepositoryViewObject> routineObjectList, String filePath) {
IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService();
try {
ITalendProcessJavaProject talendProcessJavaProject = runProcessService.getTalendProcessJavaProject();
if (talendProcessJavaProject == null) {
return;
}
final ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
IProject javaProject = talendProcessJavaProject.getProject();
IFile file = javaProject.getFile(filePath);
String fileName = file.getName();
for (IRepositoryViewObject repositoryObject : routineObjectList) {
Property property = repositoryObject.getProperty();
Item item = property.getItem();
IFile currentFile = synchronizer.getFile(item);
if (currentFile != null && fileName.equals(currentFile.getName()) && currentFile.exists()) {
Problems.addRoutineFile(currentFile, property);
break;
}
}
} catch (SystemException e) {
ExceptionHandler.process(e);
}
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class EditPropertiesAction method doRun.
@Override
protected void doRun() {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
IRepositoryNode node = (IRepositoryNode) obj;
// try {
// ProxyRepositoryFactory.getInstance().initialize();
// } catch (PersistenceException e1) {
// ExceptionHandler.process(e1);
// }
IRepositoryViewObject object = node.getObject();
IPath path = RepositoryNodeUtilities.getPath(node);
String originalName = object.getLabel();
final PropertiesWizard wizard;
if (ERepositoryObjectType.ROUTINES == object.getRepositoryObjectType() || isInstanceofCamelBeans(object.getRepositoryObjectType())) {
wizard = new EditRoutinePropertiesWizard(object, path, true);
} else if (ERepositoryObjectType.PROCESS == object.getRepositoryObjectType()) {
wizard = new EditProcessPropertiesWizard(object, path, true);
} else {
wizard = getPropertiesWizard(object, path);
}
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
if (dlg.open() == Window.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);
}
// rename the job launch, for bug 8878
IDesignerCoreService designerCoreService = RepositoryPlugin.getDefault().getDesignerCoreService();
if (designerCoreService != null) {
designerCoreService.renameJobLaunch(node.getObject(), originalName);
// TDI-24863:reset the job problem list if rename the job item
designerCoreService.resetJobProblemList(node.getObject(), originalName);
}
// refresh ...
IViewPart jobSettingView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
if (jobSettingView != null && jobSettingView instanceof IJobSettingsView) {
((IJobSettingsView) jobSettingView).refreshCurrentViewTab();
}
if (node.getObjectType() == ERepositoryObjectType.ROUTINES) {
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject();
if (talendProcessJavaProject != null) {
talendProcessJavaProject.updateRoutinesPom(true, true);
}
}
}
if (node.getObjectType().getType().equals("SERVICES")) {
//$NON-NLS-1$
ConnectionItem connectionItem = (ConnectionItem) node.getObject().getProperty().getItem();
RepositoryUpdateManager.updateServices(connectionItem);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
if (service != null) {
service.refreshComponentView(connectionItem);
}
}
}
}
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class JobJavaScriptOSGIForESBManager method getNeededModuleURLs.
protected List<URL> getNeededModuleURLs(Set<String> neededModules) {
List<URL> list = new ArrayList<URL>();
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject();
if (talendProcessJavaProject != null) {
IFolder libFolder = talendProcessJavaProject.getLibFolder();
File file = libFolder.getLocation().toFile();
File[] files = file.listFiles(FilesUtils.getAcceptModuleFilesFilter());
for (File tempFile : files) {
try {
if (neededModules.contains(tempFile.getName())) {
list.add(tempFile.toURI().toURL());
}
} catch (MalformedURLException e) {
ExceptionHandler.process(e);
}
}
}
}
return list;
}
Aggregations