Author: adietish
Date: 2010-10-29 10:50:51 -0400 (Fri, 29 Oct 2010)
New Revision: 26141
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
Log:
[JBIDE-7459] added error dialog and messages to instance action job
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-29
14:23:51 UTC (rev 26140)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-29
14:50:51 UTC (rev 26141)
@@ -8,6 +8,9 @@
# Contributors:
# Red Hat Incorporated - initial API and implementation
#################################################################################
+InstanceActionError.title=Error
+InstanceActionError.msg=Could not {0} on instance {1}
+
InstanceCategoryName=Instances
ImageCategoryName=Images
CloudViewName=Cloud View
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29
14:23:51 UTC (rev 26140)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29
14:50:51 UTC (rev 26141)
@@ -14,11 +14,19 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
public class PerformInstanceActionThread extends Job {
+
+ private static final String INSTANCEACTION_ERROR_TITLE =
"InstanceActionError.title"; //$NON-NLS-1$
+ private static final String INSTANCEACTION_ERROR_MESSAGE =
"InstanceActionError.msg"; //$NON-NLS-1$
+
private DeltaCloud cloud;
private DeltaCloudInstance instance;
private String action;
@@ -63,7 +71,13 @@
}
}
} catch (DeltaCloudException e) {
- // do nothing..action had problem executing..perhaps illegal
+ IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
e.getMessage(), e);
+ Activator.log(status);
+ ErrorDialog.openError(
+ UIUtils.getActiveShell(),
+ CVMessages.getString(INSTANCEACTION_ERROR_TITLE),
+ CVMessages.getFormattedString(INSTANCEACTION_ERROR_MESSAGE, action,
instance.getName()),
+ status);
} finally {
cloud.removeActionJob(id, this);
pm.done();
Show replies by date