1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

[cleanup] Reinstate icon properties for systemTypes extension point, add documentation, and get rid of obsolete ui.systemtypes declaration.

This commit is contained in:
Martin Oberhuber 2006-08-24 17:08:21 +00:00
parent e780290bec
commit 36d695e826
21 changed files with 259 additions and 487 deletions

View file

@ -52,11 +52,11 @@ Here are the extension points that are defined by the RSE:
<TH>Description</TH>
</TR>
<TR>
<TD><A href="plugin/systemtype.html">org.eclipse.rse.core.<b>systemType</b></A></TD>
<TD><A href="plugin/systemtype.html">org.eclipse.rse.core.<b>systemTypes</b></A></TD>
<TD>For defining new system types that show up in the New Connection wizard.</TD>
</TR>
<TR>
<TD><A href="plugin/subsystem.html">org.eclipse.rse.core.<b>subsystemConfiguration</b></A></TD>
<TD><A href="plugin/subsystem.html">org.eclipse.rse.ui.<b>subsystemConfiguration</b></A></TD>
<TD>For defining new subsystems that appear when a connection is expanded.</TD>
</TR>
<TR>

View file

@ -89,7 +89,7 @@ add the line highlighted <a href="rseSamplesResources3.html">here</a>.
&lt;/configuration&gt;
&lt;/extension&gt;
</samp></pre>
<b>Note:</b> You would normal use the <samp>icon</samp> and <samp>iconLive</samp> attributes to specify
<b>Note:</b> You would normal use the <samp>icon</samp> and <samp>iconlive</samp> attributes to specify
a unique icon for your subsystem, but to keep it simple here, just use the default icon.
</li>
</ol>

View file

@ -15,10 +15,9 @@ Martin Oberhuber (Wind River) - initial API and implementation
<extension point="org.eclipse.rse.core.systemTypes">
<systemType id="org.eclipse.rse.examples.daytime.systemtype.ftp"
name="FTP-Daytime"
description="%FTPDaytimeSystemDescription">
<property name="icon" value="icons/full/obj16/daytime_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/daytimelive_obj.gif"/>
</systemType>
description="%FTPDaytimeSystemDescription"
icon="icons/full/obj16/daytime_obj.gif"
iconLive="icons/full/obj16/daytimelive_obj.gif"/>
</extension>
<!-- Instantiate the FTP subsystem by referencing it from the external implementation -->
<extension

View file

@ -5,10 +5,9 @@
point="org.eclipse.rse.core.systemTypes">
<systemType id="org.eclipse.rse.remotecdt.sshgdbserver"
name="Ssh/Gdbserver"
description="Place holder for host information used by the Remote C++ Application launch configuration.">
<property name="icon" value="icons/full/obj16/systemlocal_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemlocallive_obj.gif"/>
</systemType>
description="Place holder for host information used by the Remote C++ Application launch configuration."
icon="icons/full/obj16/systemlocal_obj.gif"
iconLive="icons/full/obj16/systemlocallive_obj.gif"/>
</extension>
<extension
point="org.eclipse.debug.core.launchConfigurationTypes">

View file

@ -29,15 +29,17 @@ public class Activator extends Plugin {
plugin = this;
}
/**
* This method is called upon plug-in activation
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);

View file

@ -19,12 +19,12 @@ public interface IRemoteConnectionConfigurationConstants extends
IMILaunchConfigurationConstants {
public static final String ATTR_REMOTE_CONNECTION =
DebugPlugin.getUniqueIdentifier() + ".REMOTE_TCP";
DebugPlugin.getUniqueIdentifier() + ".REMOTE_TCP"; //$NON-NLS-1$
/*
* ATTR_TCP_PORT: gdbserver port.
*/
public static final String ATTR_TCP_PORT = "2345";
public static final String ATTR_TCP_PORT = "2345"; //$NON-NLS-1$
/*
* Generic Remote Path and Download options
@ -32,8 +32,8 @@ public interface IRemoteConnectionConfigurationConstants extends
* ATTR_SKIP_DOWNLOAD_TO_TARGET: true if download to remote is not desired.
*/
public static final String ATTR_REMOTE_PATH =
DebugPlugin.getUniqueIdentifier() + ".ATTR_TARGET_PATH";
DebugPlugin.getUniqueIdentifier() + ".ATTR_TARGET_PATH"; //$NON-NLS-1$
public static final String ATTR_SKIP_DOWNLOAD_TO_TARGET =
DebugPlugin.getUniqueIdentifier() + ".ATTR_SKIP_DOWNLOAD_TO_TARGET";
DebugPlugin.getUniqueIdentifier() + ".ATTR_SKIP_DOWNLOAD_TO_TARGET"; //$NON-NLS-1$
}

View file

@ -38,7 +38,7 @@ import org.eclipse.swt.widgets.Text;
public class RemoteCMainTab extends CMainTab {
private static final String[] SYSTEM_TYPE = {"Ssh/Gdbserver"};
private static final String[] SYSTEM_TYPE = {"Ssh/Gdbserver"}; //$NON-NLS-1$
/* Labels and Error Messages */
private static final String REMOTE_PROG_LABEL_TEXT = "Remote Path for C/C++ Application:";
private static final String SKIP_DOWNLOAD_BUTTON_TEXT = "Skip download to target path.";
@ -111,8 +111,8 @@ public class RemoteCMainTab extends CMainTab {
if(retVal == true) {
setErrorMessage(null);
int currentSelection = connectionCombo.getSelectionIndex();
String connection_name = currentSelection >= 0 ? connectionCombo.getItem(currentSelection) : "";
if(connection_name.equals("")) {
String connection_name = currentSelection >= 0 ? connectionCombo.getItem(currentSelection) : ""; //$NON-NLS-1$
if(connection_name.equals("")) { //$NON-NLS-1$
setErrorMessage(CONNECTION_TEXT_ERROR);
retVal = false;
}
@ -242,7 +242,7 @@ public class RemoteCMainTab extends CMainTab {
String remoteConnection = null;
try {
remoteConnection = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
"");
""); //$NON-NLS-1$
} catch (CoreException ce) {
/* default to doing nothing */
}

View file

@ -45,11 +45,11 @@ import org.eclipse.rse.ui.RSEUIPlugin;
public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
private final static String REMOTE_GDBSERVER_COMMAND = "gdbserver";
private final static String SFTP_COMMAND = "sftp";
private final static String SFTP_COMMAND_ARGS = "-b -";
private final static String SSH_COMMAND = "ssh";
private final static String SYSTEM_TYPE = "Ssh/Gdbserver";
private final static String REMOTE_GDBSERVER_COMMAND = "gdbserver"; //$NON-NLS-1$
private final static String SFTP_COMMAND = "sftp"; //$NON-NLS-1$
private final static String SFTP_COMMAND_ARGS = "-b -"; //$NON-NLS-1$
private final static String SSH_COMMAND = "ssh"; //$NON-NLS-1$
private final static String SYSTEM_TYPE = "Ssh/Gdbserver"; //$NON-NLS-1$
/*
* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch
@ -66,7 +66,7 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
String arguments = getProgramArguments(config);
String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
"");
""); //$NON-NLS-1$
if(mode.equals(ILaunchManager.DEBUG_MODE)){
setDefaultSourceLocator(launch, config);
@ -83,9 +83,9 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
/* Automatically start up the gdbserver to be used by the GDBServerCDIDebugger on the remote
* using ssh.
*/
String command_arguments = ":" + IRemoteConnectionConfigurationConstants.ATTR_TCP_PORT + " " + remoteExePath;
if(arguments != null && !arguments.equals(""))
command_arguments += " " + arguments;
String command_arguments = ":" + IRemoteConnectionConfigurationConstants.ATTR_TCP_PORT + " " + remoteExePath; //$NON-NLS-1$ //$NON-NLS-2$
if(arguments != null && !arguments.equals("")) //$NON-NLS-1$
command_arguments += " " + arguments; //$NON-NLS-1$
Process sshProcess = remoteSshExec(config, REMOTE_GDBSERVER_COMMAND, command_arguments);
DebugPlugin.newProcess(launch, sshProcess, renderProcessLabel(REMOTE_GDBSERVER_COMMAND));
/* Pre-set configuration constants for the GDBSERVERCDIDebugger to indicate how the gdbserver
@ -156,7 +156,7 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
if(inputString == null)
return null;
return inputString.replaceAll(" ", "\\\\ ");
return inputString.replaceAll(" ", "\\\\ "); //$NON-NLS-1$ //$NON-NLS-2$
}
protected Process remoteSftpDownload(ILaunchConfiguration config, ILaunch launch, String localExePath, String remoteExePath)
@ -168,14 +168,14 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
//Nothing to do. Download is skipped.
return null;
String arguments = SFTP_COMMAND_ARGS + " " + getRemoteHostname(config);
String arguments = SFTP_COMMAND_ARGS + " " + getRemoteHostname(config); //$NON-NLS-1$
Process p = null;
try {
p = execLocal(SFTP_COMMAND, arguments);
DebugPlugin.newProcess(launch, p, renderProcessLabel(SFTP_COMMAND));
OutputStream outStream = p.getOutputStream();
String putCommand = "put " + quotify(localExePath) + " " + quotify(remoteExePath) + "\n";
String exitCommand = "exit\n";
String putCommand = "put " + quotify(localExePath) + " " + quotify(remoteExePath) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String exitCommand = "exit\n"; //$NON-NLS-1$
// Execute the put and then the exit command.
outStream.write(putCommand.getBytes());
outStream.write(exitCommand.getBytes());
@ -193,7 +193,7 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
protected String getRemoteHostname(ILaunchConfiguration config) throws CoreException{
String remoteConnection = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
"");
""); //$NON-NLS-1$
IHost[] connections = RSEUIPlugin.getTheSystemRegistry().getHostsBySystemType(SYSTEM_TYPE);
int i = 0;
@ -211,8 +211,8 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
protected Process remoteSshExec(ILaunchConfiguration config, String remoteCommandPath,
String arguments) throws CoreException {
String remote_command = arguments == null ? spaceEscapify(remoteCommandPath) :
spaceEscapify(remoteCommandPath) + " " + arguments;
String ssh_arguments = getRemoteHostname(config) + " " + remote_command;
spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$
String ssh_arguments = getRemoteHostname(config) + " " + remote_command; //$NON-NLS-1$
Process p = execLocal(SSH_COMMAND, ssh_arguments);
return p;
@ -247,7 +247,7 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
protected Process execLocal(String file, String arguments) throws CoreException {
Process p = null;
String command = file + " " + arguments;
String command = file + " " + arguments; //$NON-NLS-1$
try {
p = new Spawner(command, false);
} catch (Exception e) {
@ -263,6 +263,6 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
}
protected String getPluginID() {
return "org.eclipse.rse.remotecdt";
return "org.eclipse.rse.remotecdt"; //$NON-NLS-1$
}
}

View file

@ -12,11 +12,11 @@ Martin Oberhuber - initial API and implementation
<?eclipse version="3.1"?>
<plugin>
<extension point="org.eclipse.rse.core.systemTypes">
<systemType id="org.eclipse.rse.systemtype.ssh"
name="SSH Only"
description="%SshSystemDescription">
<property name="icon" value="icons/full/obj16/systemcommands_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemcommandslive_obj.gif"/>
</systemType>
<systemType
description="%SshSystemDescription"
icon="icons/full/obj16/systemcommands_obj.gif"
iconLive="icons/full/obj16/systemcommandslive_obj.gif"
id="org.eclipse.rse.systemtype.ssh"
name="SSH Only"/>
</extension>
</plugin>

View file

@ -6,46 +6,140 @@
<meta.schema plugin="org.eclipse.rse.core" id="systemTypes" name="RSE System Types"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
This extension point is used in combination with the org.eclipse.rse.ui.subsystemConfiguration
extension point for defining new subsystems, which appear under a connection when it is expanded in the
Remote Systems view. The systemTypes extension point allows subsystem providers to define a new system
type that appears in the list of valid system types in the New Connection wizard, used by users when defining
a new connection to a remote system. The system type is simply a string identifying the operating system
type, such as Solaris, and an pair of icons used to identify connections to systems of this type. One
icon is used when the connection is not connected, while the other is used when there is a live connection.
</documentation>
</annotation>
<element name="systemType">
<element name="extension">
<annotation>
<documentation>
(no description available)
</documentation>
</annotation>
<complexType>
<sequence>
<element ref="systemType" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="systemType">
<annotation>
<appInfo>
<meta.element labelAttribute="name" icon="icon"/>
</appInfo>
<documentation>
This element defines a remote system type like &quot;Linux&quot;, against which subsystem configurations can be registered.
</documentation>
</annotation>
<complexType>
<sequence minOccurs="0" maxOccurs="unbounded">
<element ref="property"/>
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
A unique identifier for this extension.
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
The display name for the system type, such as &quot;Solaris&quot;. This name is also currently used when referencing the system type in filters, subsystem configurations and similar, therefore it is not translatable. Future versions of RSE may change this and reference the systemType id instead of the name.
&lt;p&gt;
RSE pre-defines a number of system types, although they may not appear unless a subsystem configuration is registered against that type. These are the supplied system types:
&lt;ul&gt;
&lt;li&gt;Local&lt;/li&gt;
&lt;li&gt;Unix&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
</documentation>
</annotation>
</attribute>
<attribute name="description" type="string">
<annotation>
<documentation>
A short description of the system type. Shows up in preferences for system type.
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="description" type="string">
<attribute name="icon" type="string">
<annotation>
<documentation>
A relative path to an icon that will be used when displaying connections to systems of this type. If not specified, a default icon will be used by RSE.
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
<meta.attribute kind="resource"/>
</appInfo>
</annotation>
</attribute>
<attribute name="iconLive" type="string">
<annotation>
<documentation>
A relative path to an icon that will be used when displaying connections to systems of this type, when there is a live connection to the remote system. This is usually a derivation of the icon attribute, adorned with a bright green arrow.
If not specified, a default icon will be used by RSE.
</documentation>
<appInfo>
<meta.attribute kind="resource"/>
</appInfo>
</annotation>
</attribute>
<attribute name="enableOffline" type="boolean">
<annotation>
<documentation>
Whether this system type can be put in offline mode. This decides whether to show the Work Offline action for connections of this type. This is an optional attribute, the default value is false.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="property">
<annotation>
<appInfo>
<meta.element labelAttribute="name"/>
</appInfo>
<documentation>
On optional property for the system type. The following property keys are already used internally, and are thus reserved:
&lt;ul&gt;
&lt;li&gt;&quot;icon&quot; to store the value of the icon attribute&lt;/li&gt;
&lt;li&gt;&quot;iconLive&quot; to store the value of the iconLive attribute&lt;/li&gt;
&lt;li&gt;&quot;enableOffline&quot; to store the value of the enableOffline attribute&lt;/li&gt;
&lt;/ul&gt;
</documentation>
</annotation>
<complexType>
<attribute name="name" type="string" use="required">
<annotation>
@ -69,7 +163,7 @@
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
1.0.0
</documentation>
</annotation>
@ -78,7 +172,18 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
The following is an example of the extension point schema:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.rse.ui.systemTypes&quot;&gt;
&lt;systemType id=&quot;com.acme.systemtype.Solaris&quot;
name=&quot;Solaris&quot;
&lt;property name=&quot;icon&quot; value=&quot;icons/solaris.gif&quot;/&gt;
&lt;property name=&quot;iconLive&quot; value=&quot;icons/solarisLive.gif&quot;/&gt;
&lt;/systemType&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
</documentation>
</annotation>
@ -87,7 +192,7 @@
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
[Enter API information here.]
There is no code to implement for this extension point.
</documentation>
</annotation>
@ -96,7 +201,7 @@
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
See the plugin.xml file for plugin org.eclipse.rse.ui for examples of using this extension point.
</documentation>
</annotation>
@ -105,7 +210,13 @@
<meta.section type="copyright"/>
</appInfo>
<documentation>
Copyright (c) 2002, 2006 IBM Corporation. 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
Contributors:
IBM Corporation - initial API and implementation
</documentation>
</annotation>

View file

@ -23,8 +23,8 @@ package org.eclipse.rse.core;
*/
public interface IRSECoreRegistry {
public static final String PI_RSE_CORE = "org.eclipse.rse.core";
public static final String PI_SYSTEM_TYPES = "systemTypes";
public static final String PI_RSE_CORE = "org.eclipse.rse.core"; //$NON-NLS-1$
public static final String PI_SYSTEM_TYPES = "systemTypes"; //$NON-NLS-1$
/**
* Returns all defined system types.
@ -34,6 +34,7 @@ public interface IRSECoreRegistry {
/**
* Returns the names of all defined system types.
* @return all defined system type names
*/
public String[] getSystemTypeNames();

View file

@ -13,6 +13,6 @@ package org.eclipse.rse.core;
* These constants define the set of preference names that the RSE core uses.
*/
public interface IRSEPreferenceNames {
public static final String ST_DEFAULT_USERID = "systemType.defaultUserId";
public static final String ST_ENABLED = "systemType.enabled";
public static final String ST_DEFAULT_USERID = "systemType.defaultUserId"; //$NON-NLS-1$
public static final String ST_ENABLED = "systemType.enabled"; //$NON-NLS-1$
}

View file

@ -30,52 +30,52 @@ public interface IRSESystemType extends IAdaptable {
/**
* Linux system type, "Linux".
*/
public static final String SYSTEMTYPE_LINUX = "Linux";
public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$
/**
* Power Linux type, "Power Linux".
*/
public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux";
public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux"; //$NON-NLS-1$
/**
* Power Linux type, "zSeries Linux".
*/
public static final String SYSTEMTYPE_ZSERIES_LINUX = "zSeries Linux";
public static final String SYSTEMTYPE_ZSERIES_LINUX = "zSeries Linux"; //$NON-NLS-1$
/**
* Unix system type, "Unix".
*/
public static final String SYSTEMTYPE_UNIX = "Unix";
public static final String SYSTEMTYPE_UNIX = "Unix"; //$NON-NLS-1$
/**
* AIX system type, "AIX".
*/
public static final String SYSTEMTYPE_AIX = "AIX";
public static final String SYSTEMTYPE_AIX = "AIX"; //$NON-NLS-1$
/**
* PASE system type, "PASE".
*/
public static final String SYSTEMTYPE_PASE = "PASE";
public static final String SYSTEMTYPE_PASE = "PASE"; //$NON-NLS-1$
/**
* iSeries system type, "iSeries".
*/
public static final String SYSTEMTYPE_ISERIES = "iSeries";
public static final String SYSTEMTYPE_ISERIES = "iSeries"; //$NON-NLS-1$
/**
* Local system type, "Local".
*/
public static final String SYSTEMTYPE_LOCAL = "Local";
public static final String SYSTEMTYPE_LOCAL = "Local"; //$NON-NLS-1$
/**
* z/OS system type, "z/OS".
*/
public static final String SYSTEMTYPE_ZSERIES = "z/OS";
public static final String SYSTEMTYPE_ZSERIES = "z/OS"; //$NON-NLS-1$
/**
* Windows system type, "Windows".
*/
public static final String SYSTEMTYPE_WINDOWS = "Windows";
public static final String SYSTEMTYPE_WINDOWS = "Windows"; //$NON-NLS-1$
/**
* Returns the id of the system type.

View file

@ -7,17 +7,17 @@
* Contributors:
* Kushal Munir (IBM) - Initial API and implementation.
********************************************************************************/
package org.eclipse.rse.ui;
package org.eclipse.rse.core;
/**
* These constants define the set of properties that the UI expects to
* be available via <code>IRSESystemType.getProperty(String)</code>.
*
* @see org.eclipse.core.runtime.IRSESystemType#getProperty(String)
* @see org.eclipse.rse.core.IRSESystemType#getProperty(String)
*/
public interface IRSESystemTypeConstants {
public static final String ICON = "icon";
public static final String ICON_LIVE = "iconLive";
public static final String ENABLE_OFFLINE = "enableOffline";
public static final String ICON = "icon"; //$NON-NLS-1$
public static final String ICON_LIVE = "iconLive"; //$NON-NLS-1$
public static final String ENABLE_OFFLINE = "enableOffline"; //$NON-NLS-1$
}

View file

@ -68,16 +68,18 @@ public class RSECorePlugin extends Plugin {
plugin = this;
}
/**
* Starts the bundle.
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
logger = LoggerFactory.getLogger(this);
}
/**
* This method is called when the plug-in is stopped.
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);

View file

@ -39,7 +39,7 @@ public class RSECoreRegistry implements IRSECoreRegistry {
private IRSESystemType[] systemTypes;
// constants
private static final String ELEMENT_SYTEM_TYPE = "systemType";
private static final String ELEMENT_SYTEM_TYPE = "systemType"; //$NON-NLS-1$
/**
* Constructor.

View file

@ -20,6 +20,7 @@ import java.util.HashMap;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSESystemTypeConstants;
import org.osgi.framework.Bundle;
/**
@ -27,10 +28,13 @@ import org.osgi.framework.Bundle;
*/
public class RSESystemType implements IRSESystemType {
private static final String ATTR_ID = "id";
private static final String ATTR_NAME = "name";
private static final String ATTR_DESCRIPTION = "description";
private static final String ATTR_VALUE = "value";
private static final String ATTR_ID = "id"; //$NON-NLS-1$
private static final String ATTR_NAME = "name"; //$NON-NLS-1$
private static final String ATTR_DESCRIPTION = "description"; //$NON-NLS-1$
private static final String ATTR_ICON = "icon"; //$NON-NLS-1$
private static final String ATTR_ICONLIVE = "iconLive"; //$NON-NLS-1$
private static final String ATTR_ENABLEOFFLINE = "enableOffline"; //$NON-NLS-1$
private static final String ATTR_VALUE = "value"; //$NON-NLS-1$
String id = null;
String name = null;
@ -49,6 +53,13 @@ public class RSESystemType implements IRSESystemType {
description = element.getAttribute(ATTR_DESCRIPTION);
loadProperties(element);
String icon = element.getAttribute(ATTR_ICON);
if (icon!=null) properties.put(IRSESystemTypeConstants.ICON, icon);
String iconLive = element.getAttribute(ATTR_ICONLIVE);
if (iconLive!=null) properties.put(IRSESystemTypeConstants.ICON_LIVE, iconLive);
String enableOffline = element.getAttribute(ATTR_ENABLEOFFLINE);
if (enableOffline!=null) properties.put(IRSESystemTypeConstants.ENABLE_OFFLINE, enableOffline);
definingBundle = Platform.getBundle(element.getContributor().getName());
}

View file

@ -26,6 +26,7 @@ import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.core.IRSEPreferenceNames;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSESystemTypeConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.osgi.framework.Bundle;
@ -39,17 +40,26 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
}
/**
* Returns the image descriptor for the icon of this system type.
* Returns the default live connection image descriptor if no icon has been configured.
* @see org.eclipse.ui.model.WorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
public ImageDescriptor getImageDescriptor(Object object) {
return getImage(object, ICON);
ImageDescriptor img = getImage(object, ICON);
if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTION_ID);
return img;
}
/**
* @see org.eclipse.ui.model.WorkbenchAdapter#getImageDescriptor(java.lang.Object)
* Returns the "live" image descriptor for this system type.
* Returns the default live connection image descriptor if no icon has been configured.
* @param object The object to get an image descriptor for.
* @return ImageDescriptor
*/
public ImageDescriptor getLiveImageDescriptor(Object object) {
return getImage(object, ICON_LIVE);
ImageDescriptor img = getImage(object, ICON_LIVE);
if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID);
return img;
}
private ImageDescriptor getImage(Object object, String propertyKey) {
@ -80,7 +90,7 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
* the absolute or relative path
* @param definingBundle
* bundle to be used for relative paths (may be null)
* @return
* @return ImageDescriptor
*/
public static ImageDescriptor getImage(String value, Bundle definingBundle) {
URL url = getUrl(value, definingBundle);

View file

@ -720,179 +720,6 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
}
/**
* Reset the system types objects to the given array. Called by preferences
* page when Defaults is pressed, and then OK/Apply.
*/
/* public void setSystemTypes(SystemType[] systemTypes)
{
allSystemTypes = systemTypes;
}*/
/**
* Return all system type objects. Unlike {@link #getSystemTypes()}, this method
* returns all registered system types, not just those currently enabled.
* @param refresh - true if to force a re-read from disk. If specified, then the read
* is not effective, but rather is only returned. To affectively revert back, you
* must call setSystemTypes. This is used by the preferences page.
* @return array of SystemType objects, one for every systemtype extension
*/
/* public SystemType[] getAllSystemTypes(boolean refresh)
{
SystemType[] tempAllSystemTypes = null;
if (refresh || (allSystemTypes == null))
{
IConfigurationElement[] typePlugins = getSystemTypePlugins();
if (typePlugins != null)
{
Vector v = new Vector();
List typeStrs = new ArrayList();
ISubSystemConfigurationProxy[] proxies = getSubSystemConfigurationProxies();
if (proxies == null)
proxies = new ISubSystemConfigurationProxy[0];
for (int idx=0; idx<typePlugins.length; idx++)
{
String name = getSystemTypeName(typePlugins[idx]);
// PSC - added this to allow all system types to be declared "up front"
// and then just used later by subsystems. The system types do not
// appear until there is a subsystem factory that is registered for
// this type.
boolean usedBySubSystemConfiguration = false;
for (int proxyIdx=0; !usedBySubSystemConfiguration && (proxyIdx<proxies.length); proxyIdx++)
if (proxies[proxyIdx].appliesToSystemType(name))
usedBySubSystemConfiguration = true;
//DKM v doesn't contain names - it contains SystemTypes
// changing this to use typeStrs - an array of names
boolean alreadyDeclared = typeStrs.contains(name);
if (usedBySubSystemConfiguration && !alreadyDeclared)
{
String icon = getSystemTypeIcon(typePlugins[idx]);
String iconLive = getSystemTypeLiveIcon(typePlugins[idx]);
// first get the namespace of the extension (i.e. the id of the declaring plugin)
String nameSpace = typePlugins[idx].getDeclaringExtension().getNamespace();
// now get bundle which has id equal to the namespace
Bundle bundle = Platform.getBundle(nameSpace);
// get image
ImageDescriptor image = getPluginImage(bundle,icon);
// get image to use when connected
ImageDescriptor connectedImage = getPluginImage(bundle,iconLive);
String desc = typePlugins[idx].getAttribute("description");
boolean enableOffline = getSystemTypeEnableOffline(typePlugins[idx]);
SystemType st = new SystemType(name, image,connectedImage, enableOffline, desc);
v.addElement(st);
typeStrs.add(name);
}
// TODO: need to figure out a way to give preference to a particular declaration
// of a system type (among more than one such declaration). One idea is to tie
// this to a product branding, i.e. product ID.
else if (usedBySubSystemConfiguration && alreadyDeclared)
{
// KM: if a system type is redeclared, how do we know which one
// to give preference to? Currently, we don't, so for now
// we enable offline param if a declaration wants to enable offline,
// i.e. we give preference to positive value for enable offline.
boolean enableOffline = getSystemTypeEnableOffline(typePlugins[idx]);
if (enableOffline) {
SystemType st = null;
for (int jdx=0; (st==null) && (jdx<v.size()); jdx++)
{
st = (SystemType)v.elementAt(jdx);
if (!st.equals(name))
st = null;
}
if (st!=null)
{
st.setEnableOffline(enableOffline);
}
}
}
}
if (v.size() != 0)
{
tempAllSystemTypes = new SystemType[v.size()];
for (int idx=0; idx<v.size(); idx++)
{
tempAllSystemTypes[idx] = (SystemType)v.elementAt(idx);
if (enabledSystemTypes!=null)
tempAllSystemTypes[idx].setEnabled(false);
}
if (enabledSystemTypes!=null)
{
StringTokenizer tokens = new StringTokenizer(enabledSystemTypes,";");
while (tokens.hasMoreTokens())
{
String name = tokens.nextToken();
SystemType type = SystemType.getSystemType(tempAllSystemTypes,name);
if (type != null)
type.setEnabled(true);
}
}
}
if (!refresh) // if not preference page processing load-defaults, update global var
{
allSystemTypes = tempAllSystemTypes;
// now we need to update what we read from disk, with what are in preferences..
SystemTypeFieldEditor.initSystemTypePreferences(getPreferenceStore(), allSystemTypes);
}
}
return tempAllSystemTypes;
}
return allSystemTypes;
}*/
/**
* Return the system type that matches the name. Don't worry about enabled state.
* @param name the system type name
*/
/* public SystemType getSystemType(String name)
{
if (allSystemTypes == null)
getAllSystemTypes(false);
for (int idx=0; idx<allSystemTypes.length; idx++)
{
if (name.equals(allSystemTypes[idx].getName()))
{
return allSystemTypes[idx];
}
}
return null;
}*/
/**
* Return an array of SystemType objects. These are name and image pairs registered
* via plugin.xml extension points.
*/
/* public SystemType[] getSystemTypes()
{
if (allSystemTypes == null)
getAllSystemTypes(false);
int enabledTypes=0;
for (int idx=0; idx<allSystemTypes.length; idx++)
if (allSystemTypes[idx].isEnabled())
enabledTypes++;
SystemType[] systemTypes = new SystemType[enabledTypes];
for (int idx=0, jdx=0; idx<allSystemTypes.length; idx++)
if (allSystemTypes[idx].isEnabled())
systemTypes[jdx++] = allSystemTypes[idx];
return systemTypes;
}*/
/**
* Returns a qualified hostname given a potentially unqualified hostname
@ -909,157 +736,6 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
return hostName;
}
}
/**
* A static version for convenience.
*/
/* public static SystemType[] getTheSystemTypes(boolean includeLocal)
{
SystemType[] allTypes = getDefault().getSystemTypes();
if (!includeLocal)
{
SystemType[] types = new SystemType[allTypes.length-1];
int typeIdx = 0;
for (int idx=0; idx<allTypes.length; idx++)
{
if (!allTypes[idx].getName().equals(IRSESystemType.SYSTEMTYPE_LOCAL))
types[typeIdx++] = allTypes[idx];
}
return types;
}
return allTypes;
}*/
/**
* Convenience method to return an array of names-only for registered SystemType
* extension point implementers.
*/
/* public String[] getSystemTypeNames()
{
return getSystemTypeNames(INCLUDE_LOCAL_NO);
}*/
/**
* Convenience method to return an array of names-only for registered SystemType
* extension point implementers.
* @param includeLocal true if returned names should include "local"
*/
/* public String[] getSystemTypeNames(boolean includeLocal)
{
IRSESystemType[] types = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
String[] names = null;
if (types != null)
{
int len = types.length;
if (!includeLocal && (SystemType.getSystemType(types, "Local")!=null))
--len;
names = new String[len];
int nameIdx = 0;
for (int idx=0; idx<types.length; idx++)
{
String name = types[idx].getName();
if (includeLocal || !name.equals("Local"))
names[nameIdx++] = name;
}
}
return names;
} */
/**
* Return the image for a given system type name.
*/
/* public ImageDescriptor getSystemTypeImage(String name, boolean connected)
{
SystemType match = getSystemType(name);
if (match != null)
{
if (connected)
return match.getConnectedImage();
else
return match.getImage();
}
else
return null;
}*/
/**
* Return whether the system type is enabled for offline support.
*
* @since RSE 6.0
*/
/* public boolean getSystemTypeEnableOffline(String name)
{
SystemType[] types = getSystemTypes();
for (int idx=0; idx<types.length; idx++)
{
if (name.equals(types[idx].getName()))
{
return types[idx].isEnableOffline();
}
}
// An unrecognized type was passed in
logError("RSEUIPlugin.getSystemTypeEnableOffline: invalid systemtype = " + name);
return false;
}*/
/**
* Return all elements that extend the org.eclipse.rse.ui.systemtype extension point
*/
/* private IConfigurationElement[] getSystemTypePlugins()
{
// Get reference to the plug-in registry
IExtensionRegistry registry = Platform.getExtensionRegistry();
// Get configured extenders
IConfigurationElement[] systemTypeExtensions =
registry.getConfigurationElementsFor("org.eclipse.rse.ui","systemtype");
return systemTypeExtensions;
}*/
/**
* Return the value of the "name=" attribute of the "type" tag in a given extension of the
* org.eclipse.rse.ui.systemtype extension point
*/
/* private String getSystemTypeName(IConfigurationElement element)
{
//logMessage("...in getSystemTypeName: "+element.getAttribute("name"));
return element.getAttribute("name");
}*/
/**
* Return the value of the "icon=" attribute of the "type" tag in a given extension of the
* org.eclipse.rse.ui.systemtype extension point
*/
/* private String getSystemTypeIcon(IConfigurationElement element)
{
return element.getAttribute("icon");
} */
/**
* Return the value of the "enableoffline" attribute of the "type" tag in a given extension of
* the org.eclipse.rse.ui.systemtype extension point
*
* @since RSE 6.0
*/
/* private boolean getSystemTypeEnableOffline(IConfigurationElement element)
{
String enableOffline = element.getAttribute("enableoffline");
if (enableOffline != null)
{
return enableOffline.equals("true");
}
return false;
}*/
/**
* Return the value of the "iconlive=" attribute of the "type" tag in a given extension of the
* org.eclipse.rse.ui.systemtype extension point
*/
/* private String getSystemTypeLiveIcon(IConfigurationElement element)
{
String attribute = element.getAttribute("iconlive");
return attribute;
}*/
/**
* Return an array of SubSystemConfigurationProxy objects.

View file

@ -18,7 +18,6 @@
plugin.name = RSE UI
extPoint.systemtype = Remote System Type
extPoint.subsystemConfiguration = Remote Subsystem Configuration
extPoint.popupMenus = Remote Object Popup Menu Actions
extPoint.propertyPages = RRemote Object Property Pages

View file

@ -17,36 +17,6 @@ Contributors:
<?eclipse version="3.1"?>
<plugin>
<!-- ============================================================ -->
<!-- EXTENSION POINT: org.eclipse.rse.ui.systemType -->
<!-- ============================================================ -->
<!-- Extension point for defining system types. -->
<!-- -->
<!-- There is no class to write for this extension -->
<!-- ... all that is required is a name and an icon to use when -->
<!-- .... not connected plus an icon to use when we are connected.-->
<!-- Note we predefine the following, although they won't show up -->
<!-- until a subsystem configuration is registered for them: -->
<!-- Local, Windows, Unix, Linux, AIX, Power Linux, iSeries -->
<!-- and z/OS... -->
<!-- See also the setPreferenceDefaults extension point -->
<!-- -->
<!-- Example of extension configuration: -->
<!-- <extension point="org.eclipse.rse.ui.systemType"> -->
<!-- <type id="com.acme.systemtype.solaris" -->
<!-- name="Solaris" -->
<!-- iconlive="icons/solarisLive.gif" -->
<!-- icon="icons/solaris.gif" -->
<!-- description="SUN Solaris OS" (optional) -->
<!-- enableoffline="false" (default is false) -->
<!-- > -->
<!-- </type> -->
<!-- </extension> -->
<!-- -->
<!-- ============================================================ -->
<!-- <extension-point id="systemtype" name="%extPoint.systemtype" schema="schema/systemtype.exsd" -->
<!-- ================================================================================== -->
<!-- EXTENSION POINT: org.eclipse.rse.ui.subsystemConfiguration -->
<!-- ================================================================================== -->
@ -393,8 +363,10 @@ Contributors:
<!-- Commands dialog. -->
<!-- -->
<!-- See the extension point reference for more details. -->
<!-- TODODeferred after RSE 1.0
<extension-point id="compile" name="%extPoint.compile" schema="schema/compile.exsd"/>
-->
<!-- ================================================================================== -->
<!-- EXTENSION POINT: org.eclipse.rse.ui.remoteSystemsViewPreferencesActions -->
@ -529,71 +501,61 @@ Contributors:
<!--
<systemType id="org.eclipse.rse.systemtype.iseries"
name="iSeries"
description="%systemType.iseries">
<property name="icon" value="icons/full/obj16/system400_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/system400live_obj.gif"/>
</systemType>
description="%systemType.iseries"
icon="icons/full/obj16/system400_obj.gif"
iconLive="icons/full/obj16/system400live_obj.gif"/>
<systemType id="org.eclipse.rse.systemtype.iseries.PASE"
name="PASE"
description="%systemType.iseries.PASE">
<property name="icon" value="icons/full/obj16/system400_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/system400live_obj.gif"/>
</systemType>
description="%systemType.iseries.PASE"
icon="icons/full/obj16/system400_obj.gif"
iconLive="icons/full/obj16/system400live_obj.gif"/>
-->
<systemType id="org.eclipse.rse.systemtype.windows"
name="Windows"
description="%systemType.windows">
<property name="icon" value="icons/full/obj16/systemwin_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemwinlive_obj.gif"/>
</systemType>
description="%systemType.windows"
icon="icons/full/obj16/systemwin_obj.gif"
iconLive="icons/full/obj16/systemwinlive_obj.gif"/>
<!--
<systemType id="org.eclipse.rse.systemtype.zseries"
name="z/OS"
description="%systemType.zseries">
<property name="icon" value="icons/full/obj16/system390_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/system390live_obj.gif"/>
</systemType>
description="%systemType.zseries"
icon="icons/full/obj16/system390_obj.gif"
iconLive="icons/full/obj16/system390live_obj.gif"/>
-->
<systemType id="org.eclipse.rse.systemtype.linux"
name="Linux"
description="%systemType.linux">
<property name="icon" value="icons/full/obj16/systemlinux_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemlinuxlive_obj.gif"/>
</systemType>
description="%systemType.linux"
icon="icons/full/obj16/systemlinux_obj.gif"
iconLive="icons/full/obj16/systemlinuxlive_obj.gif"/>
<!--
<systemType id="org.eclipse.rse.systemtype.linux.power"
name="Power Linux"
description="%systemType.powerlinux">
<property name="icon" value="icons/full/obj16/systemlinux_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemlinuxlive_obj.gif"/>
</systemType>
description="%systemType.powerlinux"
icon="icons/full/obj16/systemlinux_obj.gif"
iconLive="icons/full/obj16/systemlinuxlive_obj.gif"/>
<systemType id="org.eclipse.rse.systemtype.linux.zSeries"
name="zSeries Linux"
description="%systemType.zlinux">
<property name="icon" value="icons/full/obj16/systemlinux_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemlinuxlive_obj.gif"/>
</systemType>
description="%systemType.zlinux"
icon="icons/full/obj16/systemlinux_obj.gif"
iconLive="icons/full/obj16/systemlinuxlive_obj.gif"/>
-->
<systemType id="org.eclipse.rse.systemtype.unix"
name="Unix"
description="%systemType.unix">
<property name="icon" value="icons/full/obj16/systemunix_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemunixlive_obj.gif"/>
</systemType>
description="%systemType.unix"
icon="icons/full/obj16/systemunix_obj.gif"
iconLive="icons/full/obj16/systemunixlive_obj.gif"/>
<!--
<systemType id="org.eclipse.rse.systemtype.aix"
name="AIX"
description="%systemType.aix">
<property name="icon" value="icons/full/obj16/systemaix_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemaixlive_obj.gif"/>
</systemType>
description="%systemType.aix"
icon="icons/full/obj16/systemaix_obj.gif"
iconLive="icons/full/obj16/systemaixlive_obj.gif"/>
-->
<systemType id="org.eclipse.rse.systemtype.local"
name="Local"
description="%systemType.local">
<property name="icon" value="icons/full/obj16/systemlocal_obj.gif"/>
<property name="iconLive" value="icons/full/obj16/systemlocallive_obj.gif"/>
</systemType>
description="%systemType.local"
icon="icons/full/obj16/systemlocal_obj.gif"
iconLive="icons/full/obj16/systemlocallive_obj.gif"/>
</extension>