mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[257638] Implemented service property page for terminal subsystem.
This commit is contained in:
parent
1da881df93
commit
f6194a8283
5 changed files with 128 additions and 6 deletions
|
@ -5,8 +5,9 @@
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Yu-Fen Kuo (MontaVista) - initial API and implementation
|
* 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) - [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;
|
package org.eclipse.rse.subsystems.terminals.core;
|
||||||
|
|
||||||
|
@ -17,8 +18,15 @@ public interface ITerminalServiceSubSystem extends ISubSystem {
|
||||||
public void addChild(TerminalElement element);
|
public void addChild(TerminalElement element);
|
||||||
|
|
||||||
public void removeChild(TerminalElement element);
|
public void removeChild(TerminalElement element);
|
||||||
|
|
||||||
public void removeChild(String terminalTitle);
|
public void removeChild(String terminalTitle);
|
||||||
|
|
||||||
public TerminalElement getChild(String terminalTitle);
|
public TerminalElement getChild(String terminalTitle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return parent subsystem factory, cast to a
|
||||||
|
* ITerminalServiceSubSystemConfiguration
|
||||||
|
*/
|
||||||
|
public ITerminalServiceSubSystemConfiguration getParentRemoteTerminalSubSystemConfiguration();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
* Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl
|
* Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl
|
||||||
* Martin Oberhuber (Wind River) - [228577] [rseterminal] Further cleanup
|
* Martin Oberhuber (Wind River) - [228577] [rseterminal] Further cleanup
|
||||||
* Anna Dushistova (MontaVista) - [227569] [rseterminal][api] Provide a "generic" Terminal subsystem
|
* 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;
|
package org.eclipse.rse.subsystems.terminals.core;
|
||||||
|
@ -194,4 +195,10 @@ public class TerminalServiceSubSystem extends SubSystem implements
|
||||||
public boolean canSwitchTo(ISubSystemConfiguration configuration) {
|
public boolean canSwitchTo(ISubSystemConfiguration configuration) {
|
||||||
return (configuration instanceof ITerminalServiceSubSystemConfiguration);
|
return (configuration instanceof ITerminalServiceSubSystemConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ITerminalServiceSubSystemConfiguration getParentRemoteTerminalSubSystemConfiguration() {
|
||||||
|
return (ITerminalServiceSubSystemConfiguration) super
|
||||||
|
.getSubSystemConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# Yu-Fen Kuo (MontaVista) - initial API and implementation
|
# 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) - [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
|
# NLS_MESSAGEFORMAT_NONE
|
||||||
|
@ -21,4 +22,5 @@ terminalsView.name = Terminals
|
||||||
Launch_Terminal_Label =Launch Terminal
|
Launch_Terminal_Label =Launch Terminal
|
||||||
Launch_Terminal_Tooltip=Launch a terminal from the selected directory
|
Launch_Terminal_Tooltip=Launch a terminal from the selected directory
|
||||||
|
|
||||||
terminalsCategory.name = Terminal Commands
|
terminalsCategory.name = Terminal Commands
|
||||||
|
Terminals.Service = Service
|
|
@ -13,12 +13,13 @@ Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
Martin Oberhuber (Wind River) - [180519] declaratively register adapter factories
|
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) - [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) - [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) - [235934] Launch Shell/Terminal commands enabled when selection is empty
|
||||||
Anna Dushistova (MontaVista) - [251492] Launch Shell Action is enabled in Offline mode
|
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
|
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
|
||||||
-->
|
-->
|
||||||
<?eclipse version="3.2"?>
|
<?eclipse version="3.2"?>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -109,4 +110,15 @@ Kevin Doyle (IBM) - [249320] Launch Shell action not available in Remote Sy
|
||||||
commandId="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand">
|
commandId="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand">
|
||||||
</handler>
|
</handler>
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension
|
||||||
|
point="org.eclipse.ui.propertyPages">
|
||||||
|
<page
|
||||||
|
name="%Terminals.Service"
|
||||||
|
class="org.eclipse.rse.internal.terminals.ui.propertypages.TerminalServicesPropertyPage"
|
||||||
|
id="org.eclipse.rse.terminals.ui.propertypages.TerminalServicesPropertyPage">
|
||||||
|
<enabledWhen>
|
||||||
|
<instanceof value="org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystem"/>
|
||||||
|
</enabledWhen>
|
||||||
|
</page>
|
||||||
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue