Author: jjohnstn
Date: 2010-09-29 15:05:26 -0400 (Wed, 29 Sep 2010)
New Revision: 25308
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/reboot.gif
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/rebootd.gif
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/runningd.gif
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/stoppedd.gif
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
Log:
2010-09-29 Jeff Johnston <jjohnstn(a)redhat.com>
* icons/reboot.gif: New file.
* icons/rebootd.gif: New file.
* icons/runningd.gif: New file.
* icons/stoppedd.gif: New file.
* src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java: Add new images for starting,
stopping, and
rebooting, plus their disabled versions.
* src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (handleSelection): Disable
actions unless
the selected item is an instance and then use its actions to determine which actions
should be enabled.
(makeActions): Add images for enabled and disabled for starting, stopping, rebooting, and
destroy actions.
(fillLocalToolBar): Add starting, stopping, rebooting, and destroy actions.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-29 19:02:51
UTC (rev 25307)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-29 19:05:26
UTC (rev 25308)
@@ -1,3 +1,16 @@
+2010-09-29 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * icons/reboot.gif: New file.
+ * icons/rebootd.gif: New file.
+ * icons/runningd.gif: New file.
+ * icons/stoppedd.gif: New file.
+ * src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java: Add new images for starting,
stopping, and
+ rebooting, plus their disabled versions.
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (handleSelection): Disable
actions unless
+ the selected item is an instance and then use its actions to determine which actions
should be enabled.
+ (makeActions): Add images for enabled and disabled for starting, stopping, rebooting,
and destroy actions.
+ (fillLocalToolBar): Add starting, stopping, rebooting, and destroy actions.
+
2010-09-17 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java:
Renamed.
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/reboot.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/reboot.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/rebootd.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/rebootd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/runningd.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/runningd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/stoppedd.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/stoppedd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java 2010-09-29
19:02:51 UTC (rev 25307)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java 2010-09-29
19:05:26 UTC (rev 25308)
@@ -41,6 +41,12 @@
public static final String IMG_COLLAPSE_ALL= NAME_PREFIX + "collapseall.gif";
//$NON-NLS-1$
public static final String IMG_DELTA= NAME_PREFIX + "delta.gif";
//$NON-NLS-1$
public static final String IMG_DELTA_LARGE= NAME_PREFIX + "delta-large.gif";
//$NON-NLS-1$
+ public static final String IMG_START= NAME_PREFIX + "running.gif";
//$NON-NLS-1$
+ public static final String IMG_STARTD = NAME_PREFIX + "runningd.gif";
//$NON-NLS-1$
+ public static final String IMG_STOP = NAME_PREFIX + "stopped.gif";
//$NON-NLS-1$
+ public static final String IMG_STOPD = NAME_PREFIX + "stoppedd.gif";
//$NON-NLS-1$
+ public static final String IMG_REBOOT = NAME_PREFIX + "reboot.gif";
//$NON-NLS-1$
+ public static final String IMG_REBOOTD = NAME_PREFIX + "rebootd.gif";
//$NON-NLS-1$
public static final ImageDescriptor DESC_CLOUD= createManaged("", IMG_CLOUD);
public static final ImageDescriptor DESC_FOLDER= createManaged("",
IMG_FOLDER);
public static final ImageDescriptor DESC_INSTANCE= createManaged("",
IMG_INSTANCE);
@@ -48,6 +54,12 @@
public static final ImageDescriptor DESC_COLLAPSE_ALL= createManaged("",
IMG_COLLAPSE_ALL);
public static final ImageDescriptor DESC_DELTA= createManaged("", IMG_DELTA);
public static final ImageDescriptor DESC_DELTA_LARGE= createManaged("",
IMG_DELTA_LARGE);
+ public static final ImageDescriptor DESC_START= createManaged("", IMG_START);
+ public static final ImageDescriptor DESC_STARTD= createManaged("",
IMG_STARTD);
+ public static final ImageDescriptor DESC_STOP= createManaged("", IMG_STOP);
+ public static final ImageDescriptor DESC_STOPD= createManaged("", IMG_STOPD);
+ public static final ImageDescriptor DESC_REBOOT= createManaged("",
IMG_REBOOT);
+ public static final ImageDescriptor DESC_REBOOTD= createManaged("",
IMG_REBOOTD);
private static ImageDescriptor createManaged(String prefix, String name) {
return createManaged(imageRegistry, prefix, name);
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-09-29
19:02:51 UTC (rev 25307)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-09-29
19:05:26 UTC (rev 25308)
@@ -26,6 +26,7 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -70,6 +71,7 @@
import org.jboss.tools.deltacloud.core.IInstanceListListener;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.osgi.service.prefs.Preferences;
public class InstanceView extends ViewPart implements ICloudManagerListener,
IInstanceListListener {
@@ -299,6 +301,16 @@
private void handleSelection() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
selectedElement = (DeltaCloudInstance)selection.getFirstElement();
+ instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.DESTROY).setEnabled(false);
+ if (selectedElement != null) {
+ List<String> actions = selectedElement.getActions();
+ for (String action : actions) {
+ instanceActions.get(action).setEnabled(true);
+ }
+ }
}
private void fillLocalPullDown(IMenuManager manager) {
@@ -331,7 +343,10 @@
}
private void fillLocalToolBar(IToolBarManager manager) {
- //TODO
+ manager.add(instanceActions.get(DeltaCloudInstance.START));
+ manager.add(instanceActions.get(DeltaCloudInstance.STOP));
+ manager.add(instanceActions.get(DeltaCloudInstance.REBOOT));
+ manager.add(instanceActions.get(DeltaCloudInstance.DESTROY));
}
private class PerformInstanceActionThread extends Job {
@@ -469,6 +484,8 @@
};
startAction.setText(CVMessages.getString(START_LABEL));
startAction.setToolTipText(CVMessages.getString(START_LABEL));
+ startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
+ startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
stopAction = new Action() {
public void run() {
@@ -484,6 +501,8 @@
};
stopAction.setText(CVMessages.getString(STOP_LABEL));
stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
+ stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
+ stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
rebootAction = new Action() {
public void run() {
@@ -499,6 +518,8 @@
};
rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
+ rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
+ rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
destroyAction = new Action() {
public void run() {
@@ -513,6 +534,11 @@
};
destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ ImageDescriptor delete =
ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
+ ImageDescriptor delete_disabled =
ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
+ destroyAction.setImageDescriptor(delete);
+ destroyAction.setDisabledImageDescriptor(delete_disabled);
rseAction = new Action() {
public void run() {