private IFile getBeanFile(Item beanItem) throws SystemException { IRunProcessService service = CamelDesignerPlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject(); if (talendProcessJavaProject == null) { return null; } IFolder beanFolder = talendProcessJavaProject.getSrcSubFolder(null, JavaUtils.JAVA_BEANS_DIRECTORY); IFile file = beanFolder.getFile(beanItem.getProperty().getLabel() + JavaUtils.JAVA_EXTENSION); return file; }
protected ILaunchConfiguration createLaunchConfiguration() { if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) { IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class); ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject(); if (talendProcessJavaProject != null) { IProject project = talendProcessJavaProject.getProject(); return createLaunchConfiguration(project, goals); } } return null; }
/* * (non-Javadoc) * * @see * org.talend.designer.codegen.ISQLPatternSynchronizer#getSQLPattern(org.talend.core.model.properties.SQLPatternItem * ) */ @Override public IFile getSQLPatternFile(SQLPatternItem item) throws SystemException { IRunProcessService service = CodeGeneratorActivator.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject(); if (talendProcessJavaProject == null) { return null; } String basePath = JavaUtils.JAVA_SQLPATTERNS_DIRECTORY + '/' + item.getEltName(); // init user defined folder talendProcessJavaProject.getResourceSubFolder( null, basePath + '/' + JavaUtils.JAVA_USER_DEFINED); IFolder systemFolder = talendProcessJavaProject.getResourceSubFolder( null, basePath + '/' + JavaUtils.JAVA_SYSTEM_DIRECTORY); IFile file = systemFolder.getFile(item.getProperty().getLabel() + JavaUtils.JAVA_SQLPATTERN_EXTENSION); return file; }
/** 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; } IProject javaProject = talendProcessJavaProject.getProject(); IFile file = javaProject.getFile(filePath); String fileName = file.getName(); for (IRepositoryViewObject repositoryObject : routineObjectList) { Property property = repositoryObject.getProperty(); ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer(); Item item = property.getItem(); if (GlobalServiceRegister.getDefault() .isServiceRegistered(ICamelDesignerCoreService.class)) { ICamelDesignerCoreService service = (ICamelDesignerCoreService) GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class); if (service.isInstanceofCamel(item)) { synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createCamelBeanSynchronizer(); } } 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); } }
private IFile getCamelProcessFile(CamelProcessItem item) throws SystemException { IRunProcessService service = CamelDesignerPlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject(); if (talendProcessJavaProject == null) { return null; } IFolder srcFolder = talendProcessJavaProject.getSrcFolder(); String projectFolderName = JavaResourcesHelper.getProjectFolderName(item); String folderName = JavaResourcesHelper.getJobFolderName( item.getProperty().getLabel(), item.getProperty().getVersion()); IFile file = srcFolder.getFile( projectFolderName + '/' + folderName + '/' + item.getProperty().getLabel() + JavaUtils.JAVA_EXTENSION); return file; }