Author: dazarov
Date: 2012-03-30 13:13:09 -0400 (Fri, 30 Mar 2012)
New Revision: 39947
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
Log:
Some actions on OpenShift console view do not have sense for more applications
JBIDE-11109
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -14,6 +14,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.navigator.CommonViewer;
@@ -27,10 +28,17 @@
protected ISelection selection = null;
protected StructuredViewer viewer;
+
+ private boolean enableForSingleElement = false;
public AbstractAction(String text) {
super(text);
}
+
+ public AbstractAction(String text, boolean enableForSingleElement) {
+ super(text);
+ this.enableForSingleElement = enableForSingleElement;
+ }
public AbstractAction(String text, ImageDescriptor image) {
super(text, image);
@@ -42,6 +50,13 @@
if (source instanceof CommonViewer) {
this.viewer = (CommonViewer) source;
this.selection = ((CommonViewer) source).getSelection();
+ if(enableForSingleElement){
+ if(selection instanceof ITreeSelection && ((ITreeSelection) selection).size()
== 1){
+ setEnabled(true);
+ }else{
+ setEnabled(false);
+ }
+ }
}
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -44,7 +44,7 @@
public class CreateServerAdapterAction extends AbstractAction {
public CreateServerAdapterAction() {
- super(OpenShiftExpressUIMessages.CREATE_SERVER_ADAPTER_ACTION);
+ super(OpenShiftExpressUIMessages.CREATE_SERVER_ADAPTER_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("edit.gif"));
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -21,7 +21,7 @@
public class DeleteConnectionAction extends AbstractAction {
public DeleteConnectionAction() {
- super(OpenShiftExpressUIMessages.DELETE_CONNECTION_ACTION);
+ super(OpenShiftExpressUIMessages.DELETE_CONNECTION_ACTION, true);
}
@Override
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -28,7 +28,7 @@
public class EditCartridgesAction extends AbstractAction {
public EditCartridgesAction() {
- super(OpenShiftExpressUIMessages.EDIT_CARTRIDGES_ACTION);
+ super(OpenShiftExpressUIMessages.EDIT_CARTRIDGES_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("task-repository-new.gif"));
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -30,7 +30,7 @@
public class ImportApplicationAction extends AbstractAction {
public ImportApplicationAction() {
- super(OpenShiftExpressUIMessages.IMPORT_APPLICATION_ACTION);
+ super(OpenShiftExpressUIMessages.IMPORT_APPLICATION_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("go-into.gif"));
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -25,7 +25,7 @@
public class OpenInWebBrowserAction extends AbstractAction {
public OpenInWebBrowserAction() {
- super(OpenShiftExpressUIMessages.SHOW_IN_BROWSER_ACTION);
+ super(OpenShiftExpressUIMessages.SHOW_IN_BROWSER_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("open-browser.gif"));
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -21,7 +21,7 @@
public class ShowPropertiesAction extends AbstractAction {
public ShowPropertiesAction() {
- super(OpenShiftExpressUIMessages.SHOW_PROPERTIES_VIEW_ACTION);
+ super(OpenShiftExpressUIMessages.SHOW_PROPERTIES_VIEW_ACTION, true);
}
/*
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-03-30
17:13:09 UTC (rev 39947)
@@ -55,7 +55,7 @@
* Constructor
*/
public TailServerLogAction() {
- super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION);
+ super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION, true);
IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
setImageDescriptor(desc.getImageDescriptor());
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-03-30
16:37:30 UTC (rev 39946)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-03-30
17:13:09 UTC (rev 39947)
@@ -6,7 +6,7 @@
#
SHOW_IN_ACTION_GROUP=Show In
SHOW_IN_BROWSER_ACTION=Web Browser
-DELETE_APPLICATION_ACTION=Delete Application
+DELETE_APPLICATION_ACTION=Delete Application(s)
CREATE_APPLICATION_ACTION=New OpenShift Application
IMPORT_APPLICATION_ACTION=Import Application
CREATE_SERVER_ADAPTER_ACTION=Create a Server Adapter
Show replies by date