Author: adietish
Date: 2011-03-17 05:12:42 -0400 (Thu, 17 Mar 2011)
New Revision: 29860
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
Log:
[JBIDE-8594] enabled handlers when image-/instance-view is active or cloud is selected in
cloud viewer, changed handlers to be able to adapt image-/instance-view to DeltaCloud
instance
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-17
04:18:41 UTC (rev 29859)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-17
09:12:42 UTC (rev 29860)
@@ -1,5 +1,24 @@
+2011-03-16 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/ * plugin.xml:
+ * src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java (execute):
+ * src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java (execute):
+ [JBIDE-8594] enabled handlers when image-/instance-view is active or cloud is selected
in cloud viewer,
+ changed handlers to be able to adapt image-/instance-view to DeltaCloud instance
+ deltacloud/ui/views/cloudelements/InstanceView.java:
+ * src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java:
+ *
src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
+ (dispose):
+ (addPropertyChangeListener):
+ [JBIDE-8590] removing propertyChangeListeners on disposal,
+ registering listeners for all props only (was: several for each property)
+
2011-03-14 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ *
src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
+ (updateCloudSelector) (.run):
+ [JBIDE-7862] setting all items again so that the combo shrinks to the space needed to
display the largest cloud name
+
* src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
(cloudPropertyListener):
(selectionChanged):
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-03-17
04:18:41 UTC (rev 29859)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-03-17
09:12:42 UTC (rev 29860)
@@ -296,41 +296,31 @@
<handler
class="org.jboss.tools.deltacloud.ui.commands.FilterImagesHandler"
commandId="org.jboss.tools.deltacloud.ui.filterimages">
- <activeWhen>
- <with
- variable="selection">
- <iterate operator="and">
- <adapt
-
type="org.jboss.tools.deltacloud.core.DeltaCloud">
- </adapt>
- </iterate>
- </with>
- </activeWhen>
<enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
+ <or>
+ <with
+ variable="selection">
+ <count value="1" />
+ </with>
+ <with variable="activePartId">
+ <equals
value="org.jboss.tools.deltacloud.ui.views.ImageView"/>
+ </with>
+ </or>
</enabledWhen>
</handler>
<handler
class="org.jboss.tools.deltacloud.ui.commands.FilterInstancesHandler"
commandId="org.jboss.tools.deltacloud.ui.filterinstances">
- <activeWhen>
- <with
- variable="selection">
- <iterate operator="and">
- <adapt
-
type="org.jboss.tools.deltacloud.core.DeltaCloud">
- </adapt>
- </iterate>
- </with>
- </activeWhen>
<enabledWhen>
- <with
- variable="selection">
- <count value="+" />
- </with>
+ <or>
+ <with
+ variable="selection">
+ <count value="1" />
+ </with>
+ <with variable="activePartId">
+ <equals
value="org.jboss.tools.deltacloud.ui.views.InstanceView"/>
+ </with>
+ </or>
</enabledWhen>
</handler>
</extension>
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2011-03-17
04:18:41 UTC (rev 29859)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2011-03-17
09:12:42 UTC (rev 29860)
@@ -35,8 +35,14 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
- createImagesFilter(cloud, HandlerUtil.getActiveShell(event));
+ DeltaCloud deltaCloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+ if (deltaCloud != null) {
+ createImagesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+ } else {
+ // no item selected: try active part
+ deltaCloud = UIUtils.adapt(HandlerUtil.getActivePart(event), DeltaCloud.class);
+ createImagesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+ }
}
return Status.OK_STATUS;
@@ -44,15 +50,15 @@
private void createImagesFilter(final DeltaCloud cloud, final Shell shell) {
if (cloud != null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- IWizard wizard = new ImageFilterWizard(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
- });
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IWizard wizard = new ImageFilterWizard(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+ });
}
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2011-03-17
04:18:41 UTC (rev 29859)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2011-03-17
09:12:42 UTC (rev 29860)
@@ -36,7 +36,13 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
DeltaCloud deltaCloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
- createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+ if (deltaCloud != null) {
+ createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+ } else {
+ // no item selected: try active part
+ deltaCloud = UIUtils.adapt(HandlerUtil.getActivePart(event), DeltaCloud.class);
+ createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+ }
}
return Status.OK_STATUS;
Show replies by date