Author: rob.stryker(a)jboss.com
Date: 2007-11-01 13:30:07 -0400 (Thu, 01 Nov 2007)
New Revision: 4638
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
Log:
UI error in event log - status object was shown as tostring
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-11-01
16:58:29 UTC (rev 4637)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-11-01
17:30:07 UTC (rev 4638)
@@ -78,7 +78,7 @@
IModule module2 = module[0];
// if it's being removed
if( deltaKind == ServerBehaviourDelegate.REMOVED ) {
- removeModule(module2, kind, deltaKind, monitor);
+ removeModule(module2, kind, deltaKind, modulePublishState, monitor);
return null;
}
@@ -92,10 +92,11 @@
return null;
}
- protected void removeModule(IModule module, int kind, int deltaKind, IProgressMonitor
monitor) {
+ protected void removeModule(IModule module, int kind, int deltaKind, int publishState,
IProgressMonitor monitor) {
IArchive pack = getPackage(module);
// remove all of the deployed items
- PublishEvent event = PublisherEventLogger.createModuleRootEvent(eventRoot, new
IModule[]{module}, kind, deltaKind);
+ PublishEvent event = PublisherEventLogger.createModuleRootEvent(
+ eventRoot, new IModule[]{module}, kind, deltaKind, publishState);
if( pack != null ) {
IPath sourcePath = pack.getArchiveFilePath();
IPath destPath = new
Path(server.getDeployDirectory()).append(sourcePath.lastSegment());
@@ -108,7 +109,8 @@
protected void publishModule(IModule module, int kind, int deltaKind, int
modulePublishState, IProgressMonitor monitor) {
- PublishEvent event = PublisherEventLogger.createModuleRootEvent(eventRoot, new
IModule[]{module}, kind, deltaKind);
+ PublishEvent event = PublisherEventLogger.createModuleRootEvent(
+ eventRoot, new IModule[]{module}, kind, deltaKind, modulePublishState);
IArchive pack = getPackage(module);
IPath sourcePath = pack.getArchiveFilePath();
IPath destPathRoot = new Path(server.getDeployDirectory());
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-11-01
16:58:29 UTC (rev 4637)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-11-01
17:30:07 UTC (rev 4638)
@@ -34,7 +34,9 @@
// properties
public static final String MODULE_KIND =
"org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_KIND";
public static final String DELTA_KIND =
"org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.DELTA_KIND";
- public static PublishEvent createModuleRootEvent(EventLogTreeItem parent, IModule[]
module, int kind, int deltaKind) {
+ public static final String MODULE_PUBLISH_STATE =
"org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_PUBLISH_STATE";
+ public static PublishEvent createModuleRootEvent(EventLogTreeItem parent, IModule[]
module,
+ int kind, int deltaKind, int moduleStateKind) {
PublishEvent event = new PublishEvent(parent, MODULE_ROOT_EVENT);
String name = "";
for( int i = 0; i < module.length; i++ ) {
@@ -43,6 +45,7 @@
name = name.substring(0, name.length()-1);
event.setProperty(MODULE_KIND, new Integer(kind));
event.setProperty(DELTA_KIND, new Integer(deltaKind));
+ event.setProperty(MODULE_PUBLISH_STATE, new Integer(moduleStateKind));
event.setProperty(MODULE_NAME, name);
EventLogModel.markChanged(parent);
return event;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-11-01
16:58:29 UTC (rev 4637)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-11-01
17:30:07 UTC (rev 4638)
@@ -126,8 +126,8 @@
// delta = [no_change, added, changed, removed] = [0,1,2,3]
if( module.length == 0 ) return;
IJBossServerPublisher publisher;
- int modulePublishState = getServer().getModulePublishState(module) + 0;
- PublishEvent root = PublisherEventLogger.createModuleRootEvent(publishEvent, module,
kind, deltaKind);
+ int modulePublishState = getServer().getModulePublishState(module);
+ PublishEvent root = PublisherEventLogger.createModuleRootEvent(publishEvent, module,
kind, deltaKind, modulePublishState);
if( module.length > 0 ) {
IModule lastMod = module[module.length -1];
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-11-01
16:58:29 UTC (rev 4637)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-11-01
17:30:07 UTC (rev 4638)
@@ -56,14 +56,20 @@
propertyToMessageMap.put(PublisherEventLogger.EXCEPTION_MESSAGE,
"Exception");
propertyToMessageMap.put(PublisherEventLogger.SUCCESS_PROPERTY, "Action
Succeeded");
propertyToMessageMap.put(PublisherEventLogger.MODULE_NAME, "Module Name");
- propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND, "Change Type");
- propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND, "Publish Type");
+ propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND, "Module's Change
Type");
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND, "Server's Publish
Type");
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_PUBLISH_STATE, "Module's
Publish Type");
propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND + DELIMITER +
IServer.PUBLISH_AUTO, "Auto");
propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND + DELIMITER +
IServer.PUBLISH_CLEAN, "Clean");
propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND + DELIMITER +
IServer.PUBLISH_FULL, "Full");
propertyToMessageMap.put(PublisherEventLogger.MODULE_KIND + DELIMITER +
IServer.PUBLISH_INCREMENTAL, "Incremental");
-
+
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_PUBLISH_STATE + DELIMITER +
IServer.PUBLISH_STATE_FULL, "Full");
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_PUBLISH_STATE + DELIMITER +
IServer.PUBLISH_STATE_INCREMENTAL, "Incremental");
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_PUBLISH_STATE + DELIMITER +
IServer.PUBLISH_STATE_NONE, "None");
+ propertyToMessageMap.put(PublisherEventLogger.MODULE_PUBLISH_STATE + DELIMITER +
IServer.PUBLISH_STATE_UNKNOWN, "Unknown");
+
propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND + DELIMITER +
ServerBehaviourDelegate.ADDED, "Added");
propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND + DELIMITER +
ServerBehaviourDelegate.CHANGED, "Changed");
propertyToMessageMap.put(PublisherEventLogger.DELTA_KIND + DELIMITER +
ServerBehaviourDelegate.REMOVED, "Removed");
@@ -114,13 +120,18 @@
protected String getKindDeltaKind(EventLogTreeItem item) {
int kind = ((Integer)item.getProperty(PublisherEventLogger.MODULE_KIND)).intValue();
int deltaKind =
((Integer)item.getProperty(PublisherEventLogger.DELTA_KIND)).intValue();
-
+ int modPublishState =
((Integer)item.getProperty(PublisherEventLogger.MODULE_PUBLISH_STATE)).intValue();
String r = "[";
switch(kind) {
- case IServer.PUBLISH_AUTO: r += "Auto, "; break;
case IServer.PUBLISH_CLEAN: r += "Clean, "; break;
case IServer.PUBLISH_FULL: r += "Full, "; break;
- case IServer.PUBLISH_INCREMENTAL: r += "Incremental, "; break;
+ case IServer.PUBLISH_AUTO:
+ case IServer.PUBLISH_INCREMENTAL:
+ if( modPublishState == IServer.PUBLISH_STATE_FULL || modPublishState ==
IServer.PUBLISH_STATE_UNKNOWN)
+ r += "Full, ";
+ else
+ r += "Incremental, ";
+ break;
default: r += "Unknown, ";
}
switch( deltaKind ) {