From 4aab32e06567237261f23bcf130499f97a95ac2e Mon Sep 17 00:00:00 2001 From: Anna Dushistova Date: Tue, 28 Oct 2008 19:30:10 +0000 Subject: [PATCH] [252058][251492] Added isOffline property test for a subsystem and moved "Launch Shell" action to the plugin.xml file. --- .../org.eclipse.rse.shells.ui/plugin.xml | 55 ++++++++++++------- .../ui/actions/SystemCommandAction.java | 9 +++ ...lServiceSubSystemConfigurationAdapter.java | 55 +------------------ .../org.eclipse.rse.terminals.ui/plugin.xml | 49 ++++++++++------- rse/plugins/org.eclipse.rse.ui/plugin.xml | 2 +- .../subsystems/SubSystemPropertyTester.java | 17 ++++++ 6 files changed, 90 insertions(+), 97 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml index 1dccf0754dd..0a2fd07bc47 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml +++ b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml @@ -18,6 +18,8 @@ Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter fro Anna Dushistova (MontaVista) - [226550] [api] Launch Shell and Launch Terminal actions should be contributed declaratively Anna Dushistova (MontaVista) - [234274][api] Launch Shell / Terminal commands menu placement and category Anna Dushistova (MontaVista) - [235934] Launch Shell/Terminal commands enabled when selection is empty +Anna Dushistova (MontaVista) - [252058] Actions for shells subsystem should be contributed declaratively +Anna Dushistova (MontaVista) - [251492] Launch Shell Action is enabled in Offline mode --> @@ -148,28 +150,39 @@ Anna Dushistova (MontaVista) - [235934] Launch Shell/Terminal commands enabled - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -62,31 +63,37 @@ Anna Dushistova (MontaVista) - [235934] Launch Shell/Terminal commands enabled - + property="org.eclipse.rse.core.isOffline" + value="false"> - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemPropertyTester.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemPropertyTester.java index 6d5ea49a68a..f9d0aba0efe 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemPropertyTester.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/internal/ui/subsystems/SubSystemPropertyTester.java @@ -6,6 +6,7 @@ * * Contributors: * Anna Dushistova (MontaVista) - [227535] [rseterminal][api] terminals.ui should not depend on files.core + * Anna Dushistova (MontaVista) - [251492] Launch Shell Action is enabled in Offline mode ********************************************************************************/ package org.eclipse.rse.internal.ui.subsystems; @@ -48,6 +49,22 @@ public class SubSystemPropertyTester extends PropertyTester { } else { return !test; } + }else if (property.toLowerCase().equals("isoffline")){ //$NON-NLS-1$ + boolean test = ((Boolean) expectedValue).booleanValue(); + + ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) receiver) + .getAdapter(ISystemViewElementAdapter.class); + if (adapter != null) { + ISubSystem subsystem = adapter.getSubSystem(receiver); + if (subsystem != null) { + if(subsystem.isOffline()){ + return test; + } + } + return !test; + } else { + return !test; + } } return false; }