Prevent builds between multiple changes to workspace [message #1444540] |
Tue, 14 October 2014 07:59 |
Alexander R Messages: 211 Registered: July 2013 |
Senior Member |
|
|
Hello,
I try to do the following:
1. I want to create some projects in a runtimeworkspace programmatically
2. Than copy some files to the /bin/.. directory of the created project.
But after (1) the eclipse autobuild starts to run and (2) never take effects.
So I google around and fount the following information:
http://wiki.eclipse.org/FAQ_What_are_IWorkspaceRunnable,_IRunnableWithProgress,_and_WorkspaceModifyOperation%3F
http://wiki.eclipse.org/FAQ_How_do_I_prevent_builds_between_multiple_changes_to_the_workspace%3F
After reading this I decided to try a WorkspaceModifyOperation:
WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
@Override
public void execute(IProgressMonitor monitor) {
try {
monitor.beginTask("Derive Products", IProgressMonitor.UNKNOWN);
monitor.worked(1);
if(!createProject())
monitor.done();
return;
copyFilesToBinFolderOfNewProject();
}
finally {
// close the monitor
monitor.done();
}
};
PlatformUI.getWorkbench().getProgressService().run(false, false, operation );
But the auto-build mechanism interrupt my copy operation somehow. I tried the same logic wrapped in a IWorkspaceRunnable but it didn't change anything.
What am I doing wrong?
PS: When I'm using a WorkspaceJob I am getting some invalid thread access exceptions, because I am using an Inputdialog like this:
InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "Project name",
"Please enter the name of the new project!", newProjectNameProposal, null);
What am I doing wrong?
~Alex
|
|
|
|
Powered by
FUDForum. Page generated in 0.02458 seconds