use of org.eclipse.core.runtime.NullProgressMonitor in project tdi-studio-se by Talend.
the class CodeGenInit method saveWorkspace.
private void saveWorkspace() throws CoreException {
//$NON-NLS-1$
info(Messages.getString("CodeGenInit.saveWorkspace"));
ResourcesPlugin.getWorkspace().save(true, new NullProgressMonitor());
}
use of org.eclipse.core.runtime.NullProgressMonitor in project tdi-studio-se by Talend.
the class CodeGenInit method createAndLogonProject.
private void createAndLogonProject(ECodeLanguage language) throws Exception {
Project project = getProject(language);
if (project == null) {
Project projectInfor = //$NON-NLS-1$
ProjectHelper.createProject(//$NON-NLS-1$
getProjectName(language), //$NON-NLS-1$
"", language.getName(), createUser());
project = repositoryFactory.createProject(projectInfor);
}
repositoryFactory.logOnProject(project, new NullProgressMonitor());
}
use of org.eclipse.core.runtime.NullProgressMonitor in project tdi-studio-se by Talend.
the class ComponentProjectManager method initializeClasspath.
/**
* DOC ycbai Initialize classpath of project.
*
* @param project
* @param monitor
* @throws OperationCanceledException
* @throws CoreException
*/
private void initializeClasspath(IJavaProject project, IProgressMonitor monitor) throws OperationCanceledException, CoreException {
if (monitor != null && monitor.isCanceled()) {
throw new OperationCanceledException();
}
if (project == null)
return;
IClasspathEntry[] entries = null;
List<IClasspathEntry> cpEntries = new ArrayList<IClasspathEntry>();
cpEntries.addAll(Arrays.asList(getDefaultJREClasspathEntries()));
cpEntries.addAll(getDefaultUtilClasspathEntries());
entries = (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
if (monitor != null)
monitor.worked(1);
IPath output = getOutputLocation();
IProgressMonitor subProgressMonitor = monitor == null ? new NullProgressMonitor() : new SubProgressMonitor(monitor, 2);
project.setRawClasspath(entries, output, subProgressMonitor);
}
use of org.eclipse.core.runtime.NullProgressMonitor in project tdi-studio-se by Talend.
the class BusinessNewDiagramFileWizard method performFinish.
/**
* @generated
*/
public boolean performFinish() {
IFile diagramFile = myFileCreationPage.createNewFile();
try {
//$NON-NLS-1$
diagramFile.setCharset("UTF-8", new NullProgressMonitor());
} catch (CoreException e) {
//$NON-NLS-1$
BusinessDiagramEditorPlugin.getInstance().logError("Unable to set charset for diagram file", e);
}
ResourceSet resourceSet = myEditingDomain.getResourceSet();
final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));
List affectedFiles = new LinkedList();
affectedFiles.add(mySelectedModelFile);
affectedFiles.add(diagramFile);
AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, //$NON-NLS-1$
"Initializing diagram contents", //$NON-NLS-1$
affectedFiles) {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
int diagramVID = BusinessVisualIDRegistry.getDiagramVisualID(myDiagramRoot);
if (diagramVID != BusinessProcessEditPart.VISUAL_ID) {
//$NON-NLS-1$
return CommandResult.newErrorCommandResult("Incorrect model object stored as a root resource object");
}
Diagram diagram = ViewService.createDiagram(myDiagramRoot, BusinessProcessEditPart.MODEL_ID, BusinessDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
diagramResource.getContents().add(diagram);
diagramResource.getContents().add(diagram.getElement());
return CommandResult.newOKCommandResult();
}
};
try {
OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
diagramResource.save(Collections.EMPTY_MAP);
IDE.openEditor(myWorkbenchPage, diagramFile);
} catch (ExecutionException e) {
//$NON-NLS-1$
BusinessDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e);
} catch (IOException ex) {
BusinessDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramFile.getFullPath().toString(), //$NON-NLS-1$
ex);
} catch (PartInitException ex) {
//$NON-NLS-1$
BusinessDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex);
}
return true;
}
use of org.eclipse.core.runtime.NullProgressMonitor in project tdi-studio-se by Talend.
the class EmfEmittersPersistenceFactory method getJetProject.
/**
* DOC mhirt Comment method "getJetProject".
*
* @return
* @throws CoreException
*/
private static IProject getJetProject() {
IProject project = null;
try {
IProgressMonitor monitor = new NullProgressMonitor();
IProgressMonitor progressMonitor = new SubProgressMonitor(monitor, 1);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
//$NON-NLS-1$
project = workspace.getRoot().getProject(".JETEmitters");
if (!project.exists()) {
project.create(new SubProgressMonitor(progressMonitor, 1));
progressMonitor.subTask(//$NON-NLS-1$
CodeGenPlugin.getPlugin().getString(//$NON-NLS-1$
"_UI_JETCreatingProject_message", new Object[] { project.getName() }));
project.open(new SubProgressMonitor(progressMonitor, 1));
}
} catch (CoreException e) {
log.error(e.getMessage(), e);
project = null;
}
return project;
}
Aggregations