diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/.classpath b/rse/examples/org.eclipse.rse.examples.tutorial/.classpath
new file mode 100644
index 00000000000..751c8f2e504
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/.cvsignore b/rse/examples/org.eclipse.rse.examples.tutorial/.cvsignore
new file mode 100644
index 00000000000..ba077a4031a
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/.project b/rse/examples/org.eclipse.rse.examples.tutorial/.project
new file mode 100644
index 00000000000..704598e3c99
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.rse.examples.tutorial
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/META-INF/MANIFEST.MF b/rse/examples/org.eclipse.rse.examples.tutorial/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..9b75b36fb66
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: RSE Tutorial Examples
+Bundle-SymbolicName: org.eclipse.rse.examples.developer;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: samples.RSESamplesPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.views,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.rse.ui,
+ org.eclipse.rse.core,
+ org.eclipse.rse.services
+Eclipse-LazyStart: true
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/about.html b/rse/examples/org.eclipse.rse.examples.tutorial/about.html
new file mode 100644
index 00000000000..c14155849e8
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/about.html
@@ -0,0 +1,22 @@
+
+
+
+About
+
+
+
+About This Content
+
+April 25, 2006
+License
+
+The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html.
+For purposes of the EPL, "Program" will mean the Content.
+
+If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content.
+
+
+
\ No newline at end of file
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/build.properties b/rse/examples/org.eclipse.rse.examples.tutorial/build.properties
new file mode 100644
index 00000000000..b46013e1edb
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/build.properties
@@ -0,0 +1,12 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ icons/,\
+ plugin.xml
+src.includes = META-INF/,\
+ about.html,\
+ icons/,\
+ plugin.xml
+
\ No newline at end of file
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/developer.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/developer.gif
new file mode 100644
index 00000000000..9dae955d029
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/developer.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/developerFilter.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/developerFilter.gif
new file mode 100644
index 00000000000..aaf3084450b
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/developerFilter.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnection.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnection.gif
new file mode 100644
index 00000000000..e8efe69dc35
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnection.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnectionlive.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnectionlive.gif
new file mode 100644
index 00000000000..f97fa6b48eb
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/systemconnectionlive.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/team.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/team.gif
new file mode 100644
index 00000000000..510a75377df
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/team.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/icons/teamFilter.gif b/rse/examples/org.eclipse.rse.examples.tutorial/icons/teamFilter.gif
new file mode 100644
index 00000000000..a8091af8f6a
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.tutorial/icons/teamFilter.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml b/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml
new file mode 100644
index 00000000000..d810117c803
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/rseSamplesMessages.xml b/rse/examples/org.eclipse.rse.examples.tutorial/rseSamplesMessages.xml
new file mode 100644
index 00000000000..6ae016e251b
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/rseSamplesMessages.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+ Sample message
+ This is a sample with one substution variable: %1
+
+
+
+
+
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/RSESamplesPlugin.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/RSESamplesPlugin.java
new file mode 100644
index 00000000000..809aa8a45ec
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/RSESamplesPlugin.java
@@ -0,0 +1,164 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.rse.core.SystemBasePlugin;
+import org.eclipse.rse.services.clientserver.messages.SystemMessage;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
+import org.osgi.framework.BundleContext;
+
+import samples.subsystems.DeveloperSubSystemConfigurationAdapterFactory;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RSESamplesPlugin extends SystemBasePlugin {
+ //The shared instance.
+ private static RSESamplesPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private static SystemMessageFile messageFile = null;
+
+ /**
+ * The constructor.
+ */
+ public RSESamplesPlugin() {
+ super();
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ messageFile = getMessageFile("rseSamplesMessages.xml"); //$NON-NLS-1$
+
+ IAdapterManager manager = Platform.getAdapterManager();
+ samples.model.DeveloperAdapterFactory factory = new samples.model.DeveloperAdapterFactory();
+ manager.registerAdapters(factory, samples.model.TeamResource.class);
+ manager.registerAdapters(factory, samples.model.DeveloperResource.class);
+
+ DeveloperSubSystemConfigurationAdapterFactory sscaf = new DeveloperSubSystemConfigurationAdapterFactory();
+ sscaf.registerWithManager(manager);
+
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ resourceBundle = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static RSESamplesPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle= RSESamplesPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ try {
+ if (resourceBundle == null)
+ resourceBundle = ResourceBundle.getBundle("samples.rseSamplesResources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ return resourceBundle;
+ }
+
+ /**
+ * @see AbstractUIPlugin#initializeDefaultPreferences
+ */
+ //protected void initializeDefaultPreferences(IPreferenceStore store)
+ //{
+ // super.initializeDefaultPreferences(store);
+ // //RSESamplesPreferencePage.initDefaults(store);
+ //}
+
+ /**
+ * Initialize the image registry by declaring all of the required graphics.
+ */
+ protected void initializeImageRegistry()
+ {
+ String path = getIconPath();
+ putImageInRegistry("ICON_ID_TEAM", path+"/team.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ putImageInRegistry("ICON_ID_DEVELOPER", path+"/developer.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ putImageInRegistry("ICON_ID_TEAMFILTER", path+"/teamFilter.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ putImageInRegistry("ICON_ID_DEVELOPERFILTER", path+"/developerFilter.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ // TO RETRIEVE AN ICON, CALL GETIMAGE OR GETIMAGEDESCRIPTOR WITH ITS XXX_ID ID
+ }
+
+ /**
+ * Load a message file for this plugin.
+ * @param messageFileName - the name of the message xml file. Will look for it in this plugin's install folder.
+ * @return a message file object containing the parsed contents of the message file, or null if not found.
+ */
+ public SystemMessageFile getMessageFile(String messageFileName)
+ {
+ return loadMessageFile(getBundle(), messageFileName);
+ }
+
+ /**
+ * Return our message file
+ */
+ public static SystemMessageFile getPluginMessageFile()
+ {
+ return messageFile;
+ }
+
+ /**
+ * Retrieve a message from this plugin's message file
+ */
+ public static SystemMessage getPluginMessage(String msgId)
+ {
+ return getMessage(messageFile, msgId);
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperAdapterFactory.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperAdapterFactory.java
new file mode 100644
index 00000000000..8bfbb4a80c7
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperAdapterFactory.java
@@ -0,0 +1,55 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.model;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.rse.ui.view.AbstractSystemRemoteAdapterFactory;
+import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+/**
+ * This factory maps requests for an adapter object from a given remote object.
+ */
+public class DeveloperAdapterFactory extends AbstractSystemRemoteAdapterFactory
+ implements IAdapterFactory
+{
+ private TeamResourceAdapter teamAdapter = new TeamResourceAdapter();
+ private DeveloperResourceAdapter developerAdapter = new DeveloperResourceAdapter();
+
+ /**
+ * Constructor for DeveloperAdapterFactory.
+ */
+ public DeveloperAdapterFactory() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemRemoteAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ ISystemViewElementAdapter adapter = null;
+ if (adaptableObject instanceof TeamResource)
+ adapter = teamAdapter;
+ else if (adaptableObject instanceof DeveloperResource)
+ adapter = developerAdapter;
+ // these lines are very important!
+ if ((adapter != null) && (adapterType == IPropertySource.class))
+ adapter.setPropertySourceInput(adaptableObject);
+ return adapter;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResource.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResource.java
new file mode 100644
index 00000000000..f497650b4c3
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResource.java
@@ -0,0 +1,100 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.model;
+
+import org.eclipse.rse.core.internal.subsystems.AbstractResource;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+
+/**
+ * This models a remote resource representing a developer defined on a particular system.
+ */
+public class DeveloperResource extends AbstractResource {
+
+ private String name;
+ private String id;
+ private String deptNbr;
+
+ /**
+ * Default constructor for DeveloperResource.
+ */
+ public DeveloperResource()
+ {
+ super();
+ }
+
+ /**
+ * Constructor for DeveloperResource when given parent subsystem.
+ */
+ public DeveloperResource(ISubSystem parentSubSystem)
+ {
+ super(parentSubSystem);
+ }
+
+ /**
+ * Returns the name.
+ * @return String
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ * @param name The name to set
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Returns the id.
+ * @return String
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ * @param id The id to set
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+ /**
+ * Returns the deptNbr.
+ * @return String
+ */
+ public String getDeptNbr()
+ {
+ return deptNbr;
+ }
+
+ /**
+ * Sets the deptNbr.
+ * @param deptNbr The deptNbr to set
+ */
+ public void setDeptNbr(String deptNbr)
+ {
+ this.deptNbr = deptNbr;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResourceAdapter.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResourceAdapter.java
new file mode 100644
index 00000000000..5e311893abb
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/DeveloperResourceAdapter.java
@@ -0,0 +1,221 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.model;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.rse.ui.SystemMenuManager;
+import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
+import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+import samples.RSESamplesPlugin;
+
+/**
+ * This is the adapter which enables us to work with our remote developer resources.
+ */
+public class DeveloperResourceAdapter extends AbstractSystemViewAdapter
+ implements ISystemRemoteElementAdapter
+{
+
+ /**
+ * Constructor
+ */
+ public DeveloperResourceAdapter() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#addActions(org.eclipse.rse.ui.SystemMenuManager, org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.swt.widgets.Shell, java.lang.String)
+ */
+ public void addActions(SystemMenuManager menu,
+ IStructuredSelection selection, Shell parent, String menuGroup)
+ {
+ }
+
+ /**
+ * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(Object)
+ */
+ public ImageDescriptor getImageDescriptor(Object object)
+ {
+ return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_DEVELOPER"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getText(java.lang.Object)
+ */
+ public String getText(Object element)
+ {
+ return ((DeveloperResource)element).getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getAbsoluteName(java.lang.Object)
+ */
+ public String getAbsoluteName(Object object)
+ {
+ DeveloperResource devr = (DeveloperResource)object;
+ return "Devr_" + devr.getId(); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getType(java.lang.Object)
+ */
+ public String getType(Object element)
+ {
+ return RSESamplesPlugin.getResourceString("property.devr_resource.type"); //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(Object)
+ */
+ public Object getParent(Object o)
+ {
+ return null; // not really used, which is good because it is ambiguous
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element)
+ {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(Object)
+ */
+ public Object[] getChildren(Object o)
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyDescriptors()
+ */
+ protected IPropertyDescriptor[] internalGetPropertyDescriptors()
+ {
+ // the following array should be made static to it isn't created every time
+ PropertyDescriptor[] ourPDs = new PropertyDescriptor[2];
+ ourPDs[0] = new PropertyDescriptor("devr_id", //$NON-NLS-1$
+ RSESamplesPlugin.getResourceString("property.devr_id.name")); //$NON-NLS-1$
+ ourPDs[0].setDescription(
+ RSESamplesPlugin.getResourceString("property.devr_id.desc")); //$NON-NLS-1$
+ ourPDs[1] = new PropertyDescriptor("devr_dept", //$NON-NLS-1$
+ RSESamplesPlugin.getResourceString("property.devr_dept.name")); //$NON-NLS-1$
+ ourPDs[1].setDescription(
+ RSESamplesPlugin.getResourceString("property.devr_dept.desc")); //$NON-NLS-1$
+ return ourPDs;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyValue(java.lang.Object)
+ */
+ protected Object internalGetPropertyValue(Object key)
+ {
+ // propertySourceInput holds the currently selected object
+ DeveloperResource devr = (DeveloperResource)propertySourceInput;
+ if (key.equals("devr_id")) //$NON-NLS-1$
+ return devr.getId();
+ else if (key.equals("devr_dept")) //$NON-NLS-1$
+ return devr.getDeptNbr();
+ return null;
+ }
+ // --------------------------------------
+ // ISystemRemoteElementAdapter methods...
+ // --------------------------------------
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getAbsoluteParentName(java.lang.Object)
+ */
+ public String getAbsoluteParentName(Object element)
+ {
+ return "root"; // not really applicable as we have no unique hierarchy //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemFactoryId(java.lang.Object)
+ */
+ public String getSubSystemFactoryId(Object element)
+ {
+ return "samples.subsystems.factory"; // as declared in extension in plugin.xml //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteTypeCategory(java.lang.Object)
+ */
+ public String getRemoteTypeCategory(Object element)
+ {
+ return "developers"; // Course grained. Same for all our remote resources. //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteType(java.lang.Object)
+ */
+ public String getRemoteType(Object element)
+ {
+ return "developer"; // Fine grained. Unique to this resource type. //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubType(java.lang.Object)
+ */
+ public String getRemoteSubType(Object element)
+ {
+ return null; // Very fine grained. We don't use it.
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#refreshRemoteObject(java.lang.Object, java.lang.Object)
+ */
+ public boolean refreshRemoteObject(Object oldElement, Object newElement)
+ {
+ DeveloperResource oldDevr= (DeveloperResource)oldElement;
+ DeveloperResource newDevr = (DeveloperResource)newElement;
+ newDevr.setName(oldDevr.getName());
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParent(org.eclipse.swt.widgets.Shell, java.lang.Object)
+ */
+ public Object getRemoteParent(Shell shell, Object element) throws Exception
+ {
+ return null; // maybe this would be a Department obj, if we fully fleshed out our model
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParentNamesInUse(org.eclipse.swt.widgets.Shell, java.lang.Object)
+ */
+ public String[] getRemoteParentNamesInUse(Shell shell, Object element)
+ throws Exception
+ {
+ // developers names do not have to be unique! So we don't need to implement this!
+ return null;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object)
+ */
+ public boolean supportsUserDefinedActions(Object object) {
+ return false;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResource.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResource.java
new file mode 100644
index 00000000000..7b421c844e8
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResource.java
@@ -0,0 +1,82 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.model;
+
+import org.eclipse.rse.core.internal.subsystems.AbstractResource;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+
+/**
+ * This models a remote resource representing a team defined on a particular system.
+ */
+public class TeamResource extends AbstractResource {
+
+ private String name;
+ private DeveloperResource[] developers;
+
+ /**
+ * Default constructor
+ */
+ public TeamResource()
+ {
+ super();
+ }
+ /**
+ * Constructor for TeamResource when given a parent subsystem.
+ */
+ public TeamResource(ISubSystem parentSubSystem)
+ {
+ super(parentSubSystem);
+ }
+
+ /**
+ * Returns the name.
+ * @return String
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ * @param name The name to set
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Returns the developers.
+ * @return DeveloperResource[]
+ */
+ public DeveloperResource[] getDevelopers()
+ {
+ return developers;
+ }
+
+ /**
+ * Sets the developers.
+ * @param developers The developers to set
+ */
+ public void setDevelopers(DeveloperResource[] developers)
+ {
+ this.developers = developers;
+ }
+
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResourceAdapter.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResourceAdapter.java
new file mode 100644
index 00000000000..a21f73dc361
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/model/TeamResourceAdapter.java
@@ -0,0 +1,225 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.model;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.rse.ui.SystemMenuManager;
+import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
+import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+import samples.RSESamplesPlugin;
+import samples.subsystems.DeveloperSubSystem;
+
+/**
+ * This is the adapter which enables us to work with our remote team resources.
+ */
+public class TeamResourceAdapter extends AbstractSystemViewAdapter implements
+ ISystemRemoteElementAdapter {
+
+ /**
+ * Constructor.
+ */
+ public TeamResourceAdapter() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#addActions(org.eclipse.rse.ui.SystemMenuManager, org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.swt.widgets.Shell, java.lang.String)
+ */
+ public void addActions(SystemMenuManager menu,
+ IStructuredSelection selection, Shell parent, String menuGroup)
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getImageDescriptor(java.lang.Object)
+ */
+ public ImageDescriptor getImageDescriptor(Object element)
+ {
+ return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_TEAM"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getText(java.lang.Object)
+ */
+ public String getText(Object element)
+ {
+ return ((TeamResource)element).getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getAbsoluteName(java.lang.Object)
+ */
+ public String getAbsoluteName(Object object)
+ {
+ TeamResource team = (TeamResource)object;
+ return "Team_"+team.getName(); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getType(java.lang.Object)
+ */
+ public String getType(Object element)
+ {
+ return RSESamplesPlugin.getResourceString("property.team_resource.type"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getParent(java.lang.Object)
+ */
+ public Object getParent(Object element)
+ {
+ return null; // not really used, which is good because it is ambiguous
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element)
+ {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object element)
+ {
+ return ((TeamResource)element).getDevelopers();
+ }
+
+ /**
+ * @see com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter#internalGetPropertyDescriptors()
+ */
+ protected IPropertyDescriptor[] internalGetPropertyDescriptors()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyValue(java.lang.Object)
+ */
+ protected Object internalGetPropertyValue(Object key)
+ {
+ return null;
+ }
+ /**
+ * Intercept of parent method to indicate these objects can be renamed using the RSE-supplied
+ * rename action.
+ */
+ public boolean canRename(Object element)
+ {
+ return true;
+ }
+
+ /**
+ * Intercept of parent method to actually do the rename. RSE supplies the rename GUI, but
+ * defers the action work of renaming to this adapter method.
+ */
+ public boolean doRename(Shell shell, Object element, String newName)
+ {
+ ((TeamResource)element).setName(newName);
+ return true;
+ }
+ // --------------------------------------
+ // ISystemRemoteElementAdapter methods...
+ // --------------------------------------
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getAbsoluteParentName(java.lang.Object)
+ */
+ public String getAbsoluteParentName(Object element)
+ {
+ return "root"; // not really applicable as we have no unique hierarchy //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemFactoryId(java.lang.Object)
+ */
+ public String getSubSystemFactoryId(Object element)
+ {
+ return "samples.subsystems.factory"; // as declared in extension in plugin.xml //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteTypeCategory(java.lang.Object)
+ */
+ public String getRemoteTypeCategory(Object element)
+ {
+ return "developers"; // Course grained. Same for all our remote resources. //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteType(java.lang.Object)
+ */
+ public String getRemoteType(Object element)
+ {
+ return "team"; // Fine grained. Unique to this resource type. //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubType(java.lang.Object)
+ */
+ public String getRemoteSubType(Object element)
+ {
+ return null; // Very fine grained. We don't use it.
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#refreshRemoteObject(java.lang.Object, java.lang.Object)
+ */
+ public boolean refreshRemoteObject(Object oldElement, Object newElement)
+ {
+ TeamResource oldTeam = (TeamResource)oldElement;
+ TeamResource newTeam = (TeamResource)newElement;
+ newTeam.setName(oldTeam.getName());
+ return false; // If developer objects held references to their team names, we'd have to return true
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParent(org.eclipse.swt.widgets.Shell, java.lang.Object)
+ */
+ public Object getRemoteParent(Shell shell, Object element) throws Exception
+ {
+ return null; // maybe this would be a Project or Roster object, or leave as null if this is the root
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParentNamesInUse(org.eclipse.swt.widgets.Shell, java.lang.Object)
+ */
+ public String[] getRemoteParentNamesInUse(Shell shell, Object element)
+ throws Exception
+ {
+ DeveloperSubSystem ourSS = (DeveloperSubSystem)getSubSystem(element);
+ TeamResource[] allTeams = ourSS.getAllTeams();
+ String[] allNames = new String[allTeams.length];
+ for (int idx=0; idx0) && (textDevr.getText().trim().length()>0);
+ }
+
+ /**
+ * Override of parent method.
+ * Get the filter string in its current form.
+ * Functional opposite of doInitializeFields, which tears apart the input string in update mode,
+ * to populate the GUIs. This method creates the filter string from the information in the GUI.
+ */
+ public String getFilterString()
+ {
+ if ((textTeam == null) || (textDevr == null))
+ return inputFilterString; // return what we were given.
+ else
+ {
+ String teamName = textTeam.getText().trim();
+ String devrName = textDevr.getText().trim();
+ return teamName + "/" + devrName; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Override of parent method.
+ * Does complete verification of input fields. If this
+ * method returns null, there are no errors and the dialog or wizard can close.
+ *
+ * @return error message if there is one, else null if ok
+ */
+ public SystemMessage verify()
+ {
+ errorMessage = null;
+ Control controlInError = null;
+
+ /*
+ errorMessage = validateTeamInput(); // todo: implement if we want to syntax check input
+ if (errorMessage != null)
+ controlInError = textTeam;
+ else
+ {
+ errorMessage = validateDevrInput(); // todo: implement to syntax check input
+ if (errorMessage != null)
+ controlInError = textDevr;
+ }
+ */
+
+ if (errorMessage != null)
+ {
+ if (controlInError != null)
+ controlInError.setFocus();
+ }
+ return errorMessage;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java
new file mode 100644
index 00000000000..cc738112fd7
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java
@@ -0,0 +1,229 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.subsystems;
+
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.eclipse.rse.core.subsystems.SubSystem;
+import org.eclipse.rse.model.IHost;
+import org.eclipse.rse.services.clientserver.NamePatternMatcher;
+
+import samples.model.DeveloperResource;
+import samples.model.TeamResource;
+
+/**
+ * This is our subsystem, which manages the remote connection and resources for
+ * a particular system connection object.
+ */
+public class DeveloperSubSystem extends SubSystem
+{
+ private TeamResource[] teams; // faked-out master list of teams
+ private Vector devVector = new Vector(); // faked-out master list of developers
+ private static int employeeId = 123456; // employee Id factory
+
+ /**
+ * @param host
+ * @param connectorService
+ */
+ public DeveloperSubSystem(IHost host, IConnectorService connectorService) {
+ super(host, connectorService);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.core.subsystems.SubSystem#initializeSubSystem(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void initializeSubSystem(IProgressMonitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.core.subsystems.ISubSystem#uninitializeSubSystem(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void uninitializeSubSystem(IProgressMonitor monitor) {
+ }
+
+ /**
+ * For drag and drop, and clipboard support of remote objects.
+ *
+ * Return the remote object within the subsystem that corresponds to
+ * the specified unique ID. Because each subsystem maintains it's own
+ * objects, it's the responsability of the subsystem to determine
+ * how an ID (or key) for a given object maps to the real object.
+ * By default this returns null.
+ */
+ public Object getObjectWithAbsoluteName(String key)
+ {
+ // Functional opposite of getAbsoluteName(Object) in our resource adapters
+ if (key.startsWith("Team_")) //$NON-NLS-1$
+ {
+ String teamName = key.substring(5);
+ TeamResource[] allTeams = getAllTeams();
+ for (int idx=0; idx
+ * For us, it is a Team resource that was expanded, and an array of Developer resources will be returned.
+ *
+ * @param monitor - the progress monitor in effect while this operation performs
+ * @param parent - the parent resource object being expanded
+ * @param filterString - typically defaults to "*". In future additional user-specific quick-filters may be supported.
+ */
+ protected Object[] internalResolveFilterString(IProgressMonitor monitor, Object parent, String filterString)
+ throws java.lang.reflect.InvocationTargetException,
+ java.lang.InterruptedException
+ {
+ // typically we ignore the filter string as it is always "*"
+ // until support is added for "quick filters" the user can specify/select
+ // at the time they expand a remote resource.
+
+ TeamResource team = (TeamResource)parent;
+ return team.getDevelopers();
+ }
+
+ // ------------------
+ // Our own methods...
+ // ------------------
+ /**
+ * Get the list of all teams. Normally this would involve a trip the server, but we
+ * fake it out and return a hard-coded local list.
+ */
+ public TeamResource[] getAllTeams()
+ {
+ if (teams == null)
+ teams = createTeams("Team ", 4);
+ return teams;
+ }
+ /**
+ * Get the list of all developers. Normally this would involve a trip the server, but we
+ * fake it out and return a hard-coded local list.
+ */
+ public DeveloperResource[] getAllDevelopers()
+ {
+ DeveloperResource[] allDevrs = new DeveloperResource[devVector.size()];
+ for (int idx=0; idxis deletable by user
+ Vector strings = new Vector();
+ strings.add("*"); //$NON-NLS-1$
+ //--tutorial part 1
+ //mgr.createSystemFilter(defaultPool, "All teams", strings);
+ //--tutorial part 2
+ ISystemFilter filter = mgr.createSystemFilter(defaultPool,
+ RSESamplesPlugin.getResourceString("filter.default.name"), //$NON-NLS-1$
+ strings);
+ filter.setType("team"); //$NON-NLS-1$
+ } catch (Exception exc) {}
+ return defaultPool;
+ }
+
+ /**
+ * Intercept of parent method so we can supply our own value shown in the property
+ * sheet for the "type" property when a filter is selected within our subsystem.
+ *
+ * Requires this line in rseSamplesResources.properties: property.type.teamfilter=Team filter
+ */
+ public String getTranslatedFilterTypeProperty(SystemFilter selectedFilter)
+ {
+ //--tutorial part 1
+ //return RSESamplesPlugin.getResourceString("property.type.teamfilter"); //$NON-NLS-1$
+ //--tutorial part 2
+ String type = selectedFilter.getType();
+ if (type == null)
+ type = "team"; //$NON-NLS-1$
+ if (type.equals("team")) //$NON-NLS-1$
+ return RSESamplesPlugin.getResourceString("property.type.teamfilter"); //$NON-NLS-1$
+ else
+ return RSESamplesPlugin.getResourceString("property.type.devrfilter"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.model.IHost)
+ */
+ public boolean supportsServerLaunchProperties(IHost host) {
+ return false;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java
new file mode 100644
index 00000000000..99e53a8a5ec
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java
@@ -0,0 +1,107 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.subsystems;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
+import org.eclipse.rse.filters.ISystemFilter;
+import org.eclipse.rse.filters.ISystemFilterPool;
+import org.eclipse.rse.ui.filters.actions.SystemChangeFilterAction;
+import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction;
+import org.eclipse.rse.ui.view.SubsystemFactoryAdapter;
+import org.eclipse.swt.widgets.Shell;
+
+import samples.RSESamplesPlugin;
+
+/**
+ * Adds functionality to the basic SubSystemConfiguration.
+ */
+public class DeveloperSubSystemConfigurationAdapter extends
+ SubsystemFactoryAdapter
+{
+
+ /**
+ * Constructor for DeveloperSubSystemConfigurationAdapter.
+ */
+ public DeveloperSubSystemConfigurationAdapter()
+ {
+ super();
+ }
+
+ /**
+ * Override of parent method, to affect what is returned for the New Filter-> actions.
+ * We intercept here, versus getNewFilterPoolFilterAction, so that we can return multiple
+ * actions versus just one.
+ */
+ protected IAction[] getNewFilterPoolFilterActions(ISubSystemConfiguration factory, ISystemFilterPool selectedPool, Shell shell)
+ {
+ SystemNewFilterAction teamAction = (SystemNewFilterAction)super.getNewFilterPoolFilterAction(factory, selectedPool, shell);
+ teamAction.setWizardPageTitle(RSESamplesPlugin.getResourceString("filter.team.pagetitle")); //$NON-NLS-1$
+ teamAction.setPage1Description(RSESamplesPlugin.getResourceString("filter.team.pagetext")); //$NON-NLS-1$
+ teamAction.setType("team"); //$NON-NLS-1$
+ teamAction.setText(RSESamplesPlugin.getResourceString("filter.team.pagetitle") + "..."); //$NON-NLS-1$ //$NON-NLS-2$
+
+ SystemNewFilterAction devrAction = (SystemNewFilterAction)super.getNewFilterPoolFilterAction(factory, selectedPool, shell);
+ devrAction.setWizardPageTitle(RSESamplesPlugin.getResourceString("filter.devr.pagetitle")); //$NON-NLS-1$
+ devrAction.setPage1Description(RSESamplesPlugin.getResourceString("filter.devr.pagetext")); //$NON-NLS-1$
+ devrAction.setType("devr"); //$NON-NLS-1$
+ devrAction.setText(RSESamplesPlugin.getResourceString("filter.devr.pagetitle") + "..."); //$NON-NLS-1$ //$NON-NLS-2$
+ devrAction.setFilterStringEditPane(new DeveloperFilterStringEditPane(shell));
+
+ IAction[] actions = new IAction[2];
+ actions[0] = teamAction;
+ actions[1] = devrAction;
+ return actions;
+ }
+
+ /**
+ * Override of parent method for returning the change-filter action, so we can affect it.
+ */
+ protected IAction getChangeFilterAction(ISubSystemConfiguration factory, ISystemFilter selectedFilter, Shell shell)
+ {
+ SystemChangeFilterAction action = (SystemChangeFilterAction)super.getChangeFilterAction(factory, selectedFilter, shell);
+ String type = selectedFilter.getType();
+ if (type == null)
+ type = "team"; //$NON-NLS-1$
+ if (type.equals("team")) //$NON-NLS-1$
+ {
+ action.setDialogTitle(RSESamplesPlugin.getResourceString("filter.team.dlgtitle")); //$NON-NLS-1$
+ }
+ else
+ {
+ action.setDialogTitle(RSESamplesPlugin.getResourceString("filter.devr.dlgtitle")); //$NON-NLS-1$
+ action.setFilterStringEditPane(new DeveloperFilterStringEditPane(shell));
+ }
+ return action;
+ }
+
+ /**
+ * Override of parent method for returning the image for filters in our subsystem.
+ */
+ public ImageDescriptor getSystemFilterImage(ISystemFilter filter)
+ {
+ String type = filter.getType();
+ if (type == null)
+ type = "team"; //$NON-NLS-1$
+ if (type.equals("team")) //$NON-NLS-1$
+ return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_TEAMFILTER"); //$NON-NLS-1$
+ else
+ return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_DEVELOPERFILTER"); //$NON-NLS-1$
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapterFactory.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapterFactory.java
new file mode 100644
index 00000000000..f67d5e242c4
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapterFactory.java
@@ -0,0 +1,62 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.subsystems;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.rse.core.subsystems.util.ISubsystemConfigurationAdapter;
+
+/**
+ * @author martin.oberhuber@windriver.com
+ *
+ */
+public class DeveloperSubSystemConfigurationAdapterFactory implements
+ IAdapterFactory {
+
+ private ISubsystemConfigurationAdapter ssConfigAdapter = new DeveloperSubSystemConfigurationAdapter();
+
+ /**
+ * @see IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList()
+ {
+ return new Class[] {ISubsystemConfigurationAdapter.class};
+ }
+
+ /**
+ * Called by our plugin's startup method to register our adaptable object types
+ * with the platform. We prefer to do it here to isolate/encapsulate all factory
+ * logic in this one place.
+ */
+ public void registerWithManager(IAdapterManager manager)
+ {
+ manager.registerAdapters(this, DeveloperSubSystemConfiguration.class);
+ }
+
+ /**
+ * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType)
+ {
+ Object adapter = null;
+ if (adaptableObject instanceof DeveloperSubSystemConfiguration)
+ adapter = ssConfigAdapter;
+
+ return adapter;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/IDeveloperSubSystem.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/IDeveloperSubSystem.java
new file mode 100644
index 00000000000..e073498e3bb
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/IDeveloperSubSystem.java
@@ -0,0 +1,21 @@
+/********************************************************************************
+ * Copyright (c) 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
+ *
+ * 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) - Adapted original tutorial code to Open RSE.
+ ********************************************************************************/
+
+package samples.subsystems;
+
+public interface IDeveloperSubSystem {
+
+}