Author: max.andersen(a)jboss.com
Date: 2007-10-19 08:45:12 -0400 (Fri, 19 Oct 2007)
New Revision: 4380
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
Log:
Switcher status from Error to Warning to avoid model dialog if a module is not available
anymore - it will be logged as warning by Eclipse statusmanager.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-10-19
12:43:41 UTC (rev 4379)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-10-19
12:45:12 UTC (rev 4380)
@@ -106,12 +106,16 @@
if (ServerBehaviourDelegate.REMOVED == deltaKind) {
status = unpublish(server, module, monitor);
} else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
- if( deleted )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"The module cannot be published because it cannot be located. (" + modulePath +
")"));
+ if( deleted ) {
+ publishState = IServer.PUBLISH_STATE_UNKNOWN;
+ throw new CoreException(new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
"The module cannot be published because it cannot be located. (" + modulePath +
")"));
+ }
status = fullPublish(module, module[module.length-1], monitor);
} else if (kind == IServer.PUBLISH_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
- if( deleted )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"The module cannot be published because it cannot be located. (" + modulePath +
")"));
+ if( deleted ) {
+ publishState = IServer.PUBLISH_STATE_UNKNOWN;
+ throw new CoreException(new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
"The module cannot be published because it cannot be located. (" + modulePath +
")"));
+ }
status = incrementalPublish(module, module[module.length-1], monitor);
}
return status;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-10-19
12:43:41 UTC (rev 4379)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-10-19
12:45:12 UTC (rev 4380)
@@ -70,10 +70,14 @@
FileUtil.fileSafeCopy(sourcePath.toFile(), destFile, l);
if( updateTimestamp )
destFile.setLastModified(new Date().getTime());
- if( l.errorFound ) publishState = IServer.PUBLISH_STATE_FULL;
+ if( l.errorFound ) {
+ publishState = IServer.PUBLISH_STATE_FULL;
+ }
} else {
// deleted module. o noes. Ignore it. We can't re-publish it, so just ignore it.
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"The module cannot be published because it cannot be located"));
+ publishState = IServer.PUBLISH_STATE_UNKNOWN;
+ Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, "The
module cannot be published because it cannot be located. (" + module.getName() +
")");
+ throw new CoreException(status);
}
return null;
Show replies by date