Author: rob.stryker(a)jboss.com
Date: 2008-06-09 18:44:04 -0400 (Mon, 09 Jun 2008)
New Revision: 8655
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java
Log:
JBIDE-2319 - build events occurring from UI thread
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
===================================================================
---
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2008-06-09
22:40:39 UTC (rev 8654)
+++
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2008-06-09
22:44:04 UTC (rev 8655)
@@ -34,7 +34,6 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding.XbException;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.ExtensionManager;
@@ -389,17 +388,22 @@
private void deleteSelectedNode () {
IArchiveNode node = getSelectedNode();
if (node != null) {
- IArchiveNode parent = (IArchiveNode) node.getParent();
+ final IArchiveNode parent = (IArchiveNode) node.getParent();
parent.removeChild(node);
- if( parent.getProjectPath() != null ) {
- try {
- ArchivesModel.instance().save(parent.getProjectPath(), new NullProgressMonitor());
- } catch( ArchivesModelException ame ) {
- IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, "Problem
saving archives model", ame);
- PackagesUIPlugin.getDefault().getLog().log(status);
+ new Job("Delete Archives Node") {
+ protected IStatus run(IProgressMonitor monitor) {
+ if( parent.getProjectPath() != null ) {
+ try {
+ ArchivesModel.instance().save(parent.getProjectPath(), new
NullProgressMonitor());
+ } catch( ArchivesModelException ame ) {
+ IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
"Problem saving archives model", ame);
+ PackagesUIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ return Status.OK_STATUS;
}
-
- }
+
+ }.schedule();
}
}
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java
===================================================================
---
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java 2008-06-09
22:40:39 UTC (rev 8654)
+++
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java 2008-06-09
22:44:04 UTC (rev 8655)
@@ -264,16 +264,16 @@
* @param projectToShow
*/
protected void registerProjects(final IProject[] projects, final IProject projectToShow)
{
+ for( int i = 0; i < projects.length; i++ ) {
+ try {
+ ArchivesModel.instance().registerProject(projects[i].getLocation(),
loadingProgress);
+ } catch( ArchivesModelException ame ) {
+ IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ame.getMessage(), ame);
+ PackagesUIPlugin.getDefault().getLog().log(status);
+ }
+ }
getSite().getShell().getDisplay().asyncExec(new Runnable () {
public void run () {
- for( int i = 0; i < projects.length; i++ ) {
- try {
- ArchivesModel.instance().registerProject(projects[i].getLocation(),
loadingProgress);
- } catch( ArchivesModelException ame ) {
- IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ame.getMessage(), ame);
- PackagesUIPlugin.getDefault().getLog().log(status);
- }
- }
book.showPage(viewerComposite);
packageViewer.setInput(ArchivesModel.instance().getRoot(projectToShow.getLocation()));
}
Show replies by date