diff --git a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/ITerminalServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/ITerminalServiceSubSystem.java index bd2c6fc1273..66061ec3d72 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/ITerminalServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/ITerminalServiceSubSystem.java @@ -5,8 +5,9 @@ * available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Yu-Fen Kuo (MontaVista) - initial API and implementation - * Yu-Fen Kuo (MontaVista) - [227572] RSE Terminal doesn't reset the "connected" state when the shell exits + * Yu-Fen Kuo (MontaVista) - initial API and implementation + * Yu-Fen Kuo (MontaVista) - [227572] RSE Terminal doesn't reset the "connected" state when the shell exits + * Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties ********************************************************************************/ package org.eclipse.rse.subsystems.terminals.core; @@ -17,8 +18,15 @@ public interface ITerminalServiceSubSystem extends ISubSystem { public void addChild(TerminalElement element); public void removeChild(TerminalElement element); - + public void removeChild(String terminalTitle); - + public TerminalElement getChild(String terminalTitle); + + /** + * @return parent subsystem factory, cast to a + * ITerminalServiceSubSystemConfiguration + */ + public ITerminalServiceSubSystemConfiguration getParentRemoteTerminalSubSystemConfiguration(); + } diff --git a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java index 5c1199b4426..631b81c7093 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java @@ -11,6 +11,7 @@ * Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl * Martin Oberhuber (Wind River) - [228577] [rseterminal] Further cleanup * Anna Dushistova (MontaVista) - [227569] [rseterminal][api] Provide a "generic" Terminal subsystem + * Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties ********************************************************************************/ package org.eclipse.rse.subsystems.terminals.core; @@ -194,4 +195,10 @@ public class TerminalServiceSubSystem extends SubSystem implements public boolean canSwitchTo(ISubSystemConfiguration configuration) { return (configuration instanceof ITerminalServiceSubSystemConfiguration); } + + public ITerminalServiceSubSystemConfiguration getParentRemoteTerminalSubSystemConfiguration() { + return (ITerminalServiceSubSystemConfiguration) super + .getSubSystemConfiguration(); + } + } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.terminals.ui/plugin.properties b/rse/plugins/org.eclipse.rse.terminals.ui/plugin.properties index 020475677d8..5690ba53642 100644 --- a/rse/plugins/org.eclipse.rse.terminals.ui/plugin.properties +++ b/rse/plugins/org.eclipse.rse.terminals.ui/plugin.properties @@ -8,6 +8,7 @@ # Contributors: # Yu-Fen Kuo (MontaVista) - initial API and implementation # Anna Dushistova (MontaVista) - [227535][rseterminal][api] terminals.ui should not depend on files.core +# Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties ############################################################################### # NLS_MESSAGEFORMAT_NONE @@ -21,4 +22,5 @@ terminalsView.name = Terminals Launch_Terminal_Label =Launch Terminal Launch_Terminal_Tooltip=Launch a terminal from the selected directory -terminalsCategory.name = Terminal Commands \ No newline at end of file +terminalsCategory.name = Terminal Commands +Terminals.Service = Service \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.terminals.ui/plugin.xml b/rse/plugins/org.eclipse.rse.terminals.ui/plugin.xml index 4d9a4565157..8896ae6100e 100644 --- a/rse/plugins/org.eclipse.rse.terminals.ui/plugin.xml +++ b/rse/plugins/org.eclipse.rse.terminals.ui/plugin.xml @@ -13,12 +13,13 @@ Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. Contributors: Martin Oberhuber (Wind River) - [180519] declaratively register adapter factories -Yu-Fen Kuo (MontaVista) - [170910] Integrate Terminal with RSE +Yu-Fen Kuo (MontaVista) - [170910] Integrate Terminal with RSE Anna Dushistova (MontaVista) - [227535] [rseterminal][api] terminals.ui should not depend on files.core 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) - [251492] Launch Shell Action is enabled in Offline mode Kevin Doyle (IBM) - [249320] Launch Shell action not available in Remote System Details/Monitor views +Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties --> @@ -109,4 +110,15 @@ Kevin Doyle (IBM) - [249320] Launch Shell action not available in Remote Sy commandId="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand"> + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.terminals.ui/src/org/eclipse/rse/internal/terminals/ui/propertypages/TerminalServicesPropertyPage.java b/rse/plugins/org.eclipse.rse.terminals.ui/src/org/eclipse/rse/internal/terminals/ui/propertypages/TerminalServicesPropertyPage.java new file mode 100644 index 00000000000..6b842a09b0a --- /dev/null +++ b/rse/plugins/org.eclipse.rse.terminals.ui/src/org/eclipse/rse/internal/terminals/ui/propertypages/TerminalServicesPropertyPage.java @@ -0,0 +1,93 @@ +/******************************************************************************** + * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType + * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * David Dykstal (IBM) - [217556] remove service subsystem types + * Anna Dushistova (MontaVista) - adapted from ProcessServicesPropertyPage + * Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties + ********************************************************************************/ + +package org.eclipse.rse.internal.terminals.ui.propertypages; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.rse.core.IRSESystemType; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystemConfiguration; +import org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystem; +import org.eclipse.rse.ui.propertypages.ServicesPropertyPage; +import org.eclipse.rse.ui.widgets.services.FactoryServiceElement; +import org.eclipse.rse.ui.widgets.services.ServiceElement; + +public class TerminalServicesPropertyPage extends ServicesPropertyPage { + private ITerminalServiceSubSystemConfiguration _currentFactory; + + protected TerminalServiceSubSystem getTerminalServiceSubSystem() { + return (TerminalServiceSubSystem) getElement(); + } + + protected ServiceElement[] getServiceElements() { + TerminalServiceSubSystem subSystem = getTerminalServiceSubSystem(); + + IHost host = subSystem.getHost(); + _currentFactory = subSystem.getParentRemoteTerminalSubSystemConfiguration(); + ITerminalServiceSubSystemConfiguration[] factories = getTerminalServiceSubSystemConfigurations(host + .getSystemType()); + + // create elements for each + ServiceElement[] elements = new ServiceElement[factories.length]; + for (int i = 0; i < factories.length; i++) { + ITerminalServiceSubSystemConfiguration factory = factories[i]; + elements[i] = new FactoryServiceElement(host, factory); + if (factory == _currentFactory) { + elements[i].setSelected(true); + } + } + + return elements; + } + + protected ITerminalServiceSubSystemConfiguration[] getTerminalServiceSubSystemConfigurations( + IRSESystemType systemType) { + List results = new ArrayList(); + ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); + ISubSystemConfiguration[] factories = sr + .getSubSystemConfigurationsBySystemType(systemType, false, true); + + for (int i = 0; i < factories.length; i++) { + ISubSystemConfiguration factory = factories[i]; + if (factory instanceof ITerminalServiceSubSystemConfiguration) { + results.add(factory); + } + } + + return (ITerminalServiceSubSystemConfiguration[]) results + .toArray(new ITerminalServiceSubSystemConfiguration[results + .size()]); + } + + protected ISubSystemConfiguration getCurrentSubSystemConfiguration() { + return _currentFactory; + } + + public void setSubSystemConfiguration(ISubSystemConfiguration factory) { + _currentFactory = (ITerminalServiceSubSystemConfiguration) factory; + } + +}