use of org.eclipse.ui.ide.undo.CreateFileOperation in project tdi-studio-se by Talend.
the class ExportProjectsAsAction method initializeExternalLibraries.
/**
* DOC bqian Comment method "test".
*/
private void initializeExternalLibraries() {
initializeLibPath();
// final InputStream initialContents = null;
final Map<Project, List<LinkTargetStore>> map = getProjectAndRelatedLinks();
IRunnableWithProgress op = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) {
Set<Project> projects = map.keySet();
//$NON-NLS-1$
monitor.beginTask(Messages.getString("ExportProjectsAsAction.createLiberariesLink"), projects.size());
for (Project project : projects) {
//$NON-NLS-1$
monitor.setTaskName(Messages.getString("ExportProjectsAsAction.processProject") + project.getLabel());
List<LinkTargetStore> links = map.get(project);
for (LinkTargetStore store : links) {
// CreateFileOperation op = new CreateFileOperation(store.file, store.uri, null,
// IDEWorkbenchMessages.WizardNewFileCreationPage_title);
CreateFileOperation op = new CreateFileOperation(store.file, store.uri, null, //$NON-NLS-1$
Messages.getString("IDEWorkbenchMessages.WizardNewFileCreationPage_title"));
try {
PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(op, monitor, WorkspaceUndoUtil.getUIInfoAdapter(window.getShell()));
} catch (final ExecutionException e) {
ExceptionHandler.process(e);
}
}
monitor.worked(1);
}
monitor.done();
}
};
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, op);
} catch (Exception e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
Aggregations