diff --git a/rse/examples/org.eclipse.rse.examples.dstore/.classpath b/rse/examples/org.eclipse.rse.examples.dstore/.classpath
new file mode 100644
index 00000000000..038c426404c
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/.project b/rse/examples/org.eclipse.rse.examples.dstore/.project
new file mode 100644
index 00000000000..3ad837e42b3
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.rse.examples.dstore
+
+
+
+
+
+ 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.dstore/.settings/org.eclipse.jdt.core.prefs b/rse/examples/org.eclipse.rse.examples.dstore/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..bf1dd7482d4
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Mon Mar 16 11:50:09 EDT 2009
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/META-INF/MANIFEST.MF b/rse/examples/org.eclipse.rse.examples.dstore/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..5443132f3c3
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Dstore Plug-in
+Bundle-SymbolicName: org.eclipse.rse.examples.dstore;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.rse.examples.dstore.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.rse.core;bundle-version="3.1.0",
+ org.eclipse.dstore.core;bundle-version="3.1.0",
+ org.eclipse.dstore.extra;bundle-version="2.1.100",
+ org.eclipse.rse.services.dstore;bundle-version="3.0.100",
+ org.eclipse.rse.services;bundle-version="3.1.0",
+ org.eclipse.rse.ui;bundle-version="3.1.0",
+ org.eclipse.rse.connectorservice.dstore;bundle-version="3.0.1",
+ org.eclipse.swt;bundle-version="3.4.0",
+ org.eclipse.jface;bundle-version="3.4.0",
+ org.eclipse.ui.views;bundle-version="3.3.0",
+ org.eclipse.ui;bundle-version="3.4.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/build.properties b/rse/examples/org.eclipse.rse.examples.dstore/build.properties
new file mode 100644
index 00000000000..c68c49cd42b
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/build.properties
@@ -0,0 +1,8 @@
+source.. = src/,\
+ miners/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystem_obj.gif b/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystem_obj.gif
new file mode 100644
index 00000000000..874c9926215
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystem_obj.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystemlive_obj.gif b/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystemlive_obj.gif
new file mode 100644
index 00000000000..885b8a69e39
Binary files /dev/null and b/rse/examples/org.eclipse.rse.examples.dstore/icons/full/obj16/samplesubsystemlive_obj.gif differ
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/miners/org/eclipse/rse/examples/dstore/miners/SampleMiner.java b/rse/examples/org.eclipse.rse.examples.dstore/miners/org/eclipse/rse/examples/dstore/miners/SampleMiner.java
new file mode 100644
index 00000000000..26c8c52e089
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/miners/org/eclipse/rse/examples/dstore/miners/SampleMiner.java
@@ -0,0 +1,123 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.miners;
+
+import org.eclipse.dstore.core.miners.Miner;
+import org.eclipse.dstore.core.model.DE;
+import org.eclipse.dstore.core.model.DataElement;
+import org.eclipse.dstore.core.model.DataStoreResources;
+
+public class SampleMiner extends Miner {
+
+ public String getVersion() {
+ return "1.0.0";
+ }
+
+
+ protected void load() {
+
+ }
+
+ public DataElement handleCommand(DataElement theElement) throws Exception {
+ String name = getCommandName(theElement);
+ DataElement status = getCommandStatus(theElement);
+ DataElement subject = getCommandArgument(theElement, 0);
+
+ if (name.equals("C_SAMPLE_QUERY")){ //$NON-NLS-1$
+ return handleSampleQuery(subject, status);
+ }
+ else if (name.equals("C_SAMPLE_ACTION")){//$NON-NLS-1$
+ return handleSampleAction(subject, status);
+ }
+ else if (name.equals("C_RENAME")){
+ return handleRename(subject, getCommandArgument(theElement, 1), status);
+ }
+ else if (name.equals("C_DELETE")){
+ return handleDelete(subject, status);
+ }
+ else if (name.equals("C_CREATE_SAMPLE_OBJECT")){
+ return handleCreateSampleObject(subject, status);
+ }
+ else if (name.equals("C_CREATE_SAMPLE_CONTAINER")){
+ return handleCreateSampleContainer(subject, status);
+ }
+ return status;
+ }
+
+ public void extendSchema(DataElement schemaRoot) {
+
+ DataElement sampleContainer = _dataStore.createObjectDescriptor(schemaRoot, "Sample Container"); //$NON-NLS-1$
+ DataElement sampleObject = _dataStore.createObjectDescriptor(schemaRoot, "Sample Object"); //$NON-NLS-1$
+ _dataStore.createReference(sampleObject, sampleContainer, DataStoreResources.model_abstracts, DataStoreResources.model_abstracted_by);
+
+ createCommandDescriptor(sampleContainer, "Query", "C_SAMPLE_QUERY", false); //$NON-NLS-1$ //$NON-NLS-2$
+ createCommandDescriptor(sampleObject, "Do Something", "C_SAMPLE_ACTION", false); //$NON-NLS-1$ //$NON-NLS-2$
+ createCommandDescriptor(sampleObject, "Rename", "C_RENAME", false); //$NON-NLS-1$ //$NON-NLS-2$
+ createCommandDescriptor(sampleObject, "Delete", "C_DELETE", false); //$NON-NLS-1$ //$NON-NLS-2$
+ createCommandDescriptor(sampleObject, "Create Object", "C_CREATE_SAMPLE_OBJECT", false);
+ createCommandDescriptor(sampleObject, "Create Container", "C_CREATE_SAMPLE_CONTAINER", false);
+
+ _dataStore.refresh(schemaRoot);
+ }
+
+ private DataElement handleSampleQuery(DataElement parent, DataElement status){
+ String value = parent.getValue();
+ if (!value.equals("queried")){
+ _dataStore.createObject(parent, "Sample Object", "New Object 1"); //$NON-NLS-1$ //$NON-NLS-2$
+ _dataStore.createObject(parent, "Sample Object", "New Object 2"); //$NON-NLS-1$ //$NON-NLS-2$
+ _dataStore.createObject(parent, "Sample Container", "New Container 3"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ parent.setAttribute(DE.A_VALUE, "queried");
+ _dataStore.refresh(parent);
+ }
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+
+ private DataElement handleSampleAction(DataElement parent, DataElement status){
+ parent.setAttribute(DE.A_NAME, parent.getName() + " - modified");
+ _dataStore.refresh(parent.getParent());
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+
+ private DataElement handleRename(DataElement parent, DataElement newName, DataElement status){
+ parent.setAttribute(DE.A_NAME, newName.getName());
+ _dataStore.refresh(parent.getParent());
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+
+ private DataElement handleDelete(DataElement subject, DataElement status){
+ DataElement parent = subject.getParent();
+ _dataStore.deleteObject(parent, subject);
+ _dataStore.refresh(parent);
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+
+ private DataElement handleCreateSampleObject(DataElement parent, DataElement status){
+ _dataStore.createObject(parent, "Sample Object", "Untitled"); //$NON-NLS-1$ //$NON-NLS-2$
+ _dataStore.refresh(parent);
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+
+ private DataElement handleCreateSampleContainer(DataElement parent, DataElement status){
+ _dataStore.createObject(parent, "Sample Container", "Untitled Container"); //$NON-NLS-1$ //$NON-NLS-2$
+ _dataStore.refresh(parent);
+ status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
+ return status;
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/plugin.properties b/rse/examples/org.eclipse.rse.examples.dstore/plugin.properties
new file mode 100644
index 00000000000..34c89fed8e3
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/plugin.properties
@@ -0,0 +1,17 @@
+################################################################################
+# Copyright (c) 2009 IBM, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# David McKnight - initial API and implementation
+################################################################################
+
+pluginName = DataStore Example
+providerName = Eclipse.org
+
+SampleSubsystemName=DStore Sample SubSystem
+SampleSubsystemDescription=This subsystem allows the user to remotely query a parent node to return children.
+
\ No newline at end of file
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/plugin.xml b/rse/examples/org.eclipse.rse.examples.dstore/plugin.xml
new file mode 100644
index 00000000000..bec50c01c13
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/plugin.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/Activator.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/Activator.java
new file mode 100644
index 00000000000..511d193423f
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/Activator.java
@@ -0,0 +1,62 @@
+package org.eclipse.rse.examples.dstore;
+
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.rse.examples.dstore.subsystems.RemoteSampleObject;
+import org.eclipse.rse.examples.dstore.ui.RemoteSampleObjectAdapterFactory;
+import org.eclipse.rse.examples.dstore.ui.SampleSubSystemConfigurationAdapterFactory;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.rse.examples.dstore";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ IAdapterManager manager = Platform.getAdapterManager();
+ RemoteSampleObjectAdapterFactory factory = new RemoteSampleObjectAdapterFactory();
+ manager.registerAdapters(factory, RemoteSampleObject.class);
+
+ SampleSubSystemConfigurationAdapterFactory sscaf = new SampleSubSystemConfigurationAdapterFactory();
+ sscaf.registerWithManager(manager);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleContainer.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleContainer.java
new file mode 100644
index 00000000000..fcf938366ad
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleContainer.java
@@ -0,0 +1,25 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.services;
+
+import org.eclipse.dstore.core.model.DataElement;
+
+public class HostSampleContainer extends HostSampleObject implements IHostSampleContainer {
+
+ public HostSampleContainer(DataElement element){
+ super(element);
+ }
+
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleObject.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleObject.java
new file mode 100644
index 00000000000..982b2c48142
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/HostSampleObject.java
@@ -0,0 +1,36 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.services;
+
+import org.eclipse.dstore.core.model.DataElement;
+
+public class HostSampleObject implements IHostSampleObject {
+
+ private DataElement _element;
+ public HostSampleObject(DataElement element){
+ _element = element;
+ }
+
+ public DataElement getDataElement() {
+ return _element;
+ }
+
+ public String getName(){
+ return _element.getName();
+ }
+
+ public String getType(){
+ return _element.getType();
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleContainer.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleContainer.java
new file mode 100644
index 00000000000..2a8761fabae
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleContainer.java
@@ -0,0 +1,18 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.services;
+
+
+public interface IHostSampleContainer extends IHostSampleObject {
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleObject.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleObject.java
new file mode 100644
index 00000000000..59ba38beb12
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/IHostSampleObject.java
@@ -0,0 +1,22 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.services;
+
+import org.eclipse.dstore.core.model.DataElement;
+
+public interface IHostSampleObject {
+ public DataElement getDataElement();
+ public String getName();
+ public String getType();
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/SampleService.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/SampleService.java
new file mode 100644
index 00000000000..0a681c887b2
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/services/SampleService.java
@@ -0,0 +1,102 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.services;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.dstore.core.model.DataElement;
+import org.eclipse.dstore.core.model.IDataStoreProvider;
+import org.eclipse.rse.services.dstore.AbstractDStoreService;
+
+public class SampleService extends AbstractDStoreService {
+
+ public SampleService(IDataStoreProvider dataStoreProvider) {
+ super(dataStoreProvider);
+ }
+
+ @Override
+ protected String getMinerId() {
+ return "org.eclipse.rse.examples.dstore.miners.SampleMiner";
+ }
+
+ public IHostSampleContainer getContainer(String name, IProgressMonitor monitor){
+ DataElement universalTemp = getMinerElement();
+ DataElement containerElement = getDataStore().createObject(universalTemp, "Sample Container", name,"", "", false); //$NON-NLS-1$
+
+ return new HostSampleContainer(containerElement);
+ }
+
+ public IHostSampleObject[] query(IHostSampleContainer container, IProgressMonitor monitor){
+ DataElement containerElement = container.getDataElement();
+ if (!isInitialized())
+ {
+ waitForInitialize(monitor);
+ }
+
+ DataElement[] results = dsQueryCommand(containerElement, "C_SAMPLE_QUERY", monitor);
+
+ List returned = new ArrayList();
+ for (int i = 0; i < results.length; i++){
+ DataElement result = results[i];
+ if (result.isDeleted()){
+ // don't add deleted items
+ }
+ else if (result.getType().equals("Sample Container")){
+ returned.add(new HostSampleContainer(result));
+ }
+ else {
+ returned.add(new HostSampleObject(result));
+ }
+ }
+
+ return (IHostSampleObject[])returned.toArray(new IHostSampleObject[returned.size()]);
+ }
+
+ public void doAction(IHostSampleObject object, IProgressMonitor monitor){
+ DataElement subject = object.getDataElement();
+ dsStatusCommand(subject, "C_SAMPLE_ACTION", monitor);
+ }
+
+ public void createSampleObject(IHostSampleObject object, IProgressMonitor monitor){
+ DataElement subject = object.getDataElement();
+ dsStatusCommand(subject, "C_CREATE_SAMPLE_OBJECT", monitor);
+ }
+
+ public void createSampleContainer(IHostSampleObject object, IProgressMonitor monitor){
+ DataElement subject = object.getDataElement();
+ dsStatusCommand(subject, "C_CREATE_SAMPLE_CONTAINER", monitor);
+ }
+
+
+ public boolean rename(IHostSampleObject object, String newName, IProgressMonitor monitor){
+ DataElement subject = object.getDataElement();
+
+ ArrayList args = new ArrayList();
+ DataElement newNameArg = getDataStore().createObject(null, "Name", newName);
+ args.add(newNameArg);
+
+ dsStatusCommand(subject, args, "C_RENAME", monitor);
+ return true;
+ }
+
+ public boolean delete(IHostSampleObject object, IProgressMonitor monitor){
+ DataElement subject = object.getDataElement();
+
+ dsStatusCommand(subject, "C_DELETE", monitor);
+
+ return true;
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/RemoteSampleObject.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/RemoteSampleObject.java
new file mode 100644
index 00000000000..c295875e849
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/RemoteSampleObject.java
@@ -0,0 +1,70 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.subsystems;
+
+import org.eclipse.rse.core.subsystems.AbstractResource;
+import org.eclipse.rse.examples.dstore.services.IHostSampleContainer;
+import org.eclipse.rse.examples.dstore.services.IHostSampleObject;
+
+public class RemoteSampleObject extends AbstractResource {
+ protected IHostSampleObject _hostObject;
+ private RemoteSampleObject[] _contents;
+ private RemoteSampleObject _parent;
+
+ public RemoteSampleObject(RemoteSampleObject parent, IHostSampleObject hostObject, SampleSubSystem ss){
+ _hostObject = hostObject;
+ _parent = parent;
+ setSubSystem(ss);
+ }
+
+ public IHostSampleObject getHostSampleObject(){
+ return _hostObject;
+ }
+
+ public boolean isContainer(){
+ if (_hostObject instanceof IHostSampleContainer){
+ return true;
+ }
+ return false;
+ }
+
+ public String getName(){
+ return _hostObject.getName();
+ }
+
+ public String getType(){
+ return _hostObject.getType();
+ }
+
+ public RemoteSampleObject getParent(){
+ return _parent;
+ }
+
+ public String getAbsolutePath(){
+ if (_parent != null){
+ return _parent.getAbsolutePath() + "." + getName();
+ }
+ else {
+ return getName();
+ }
+ }
+
+ public void setContents(RemoteSampleObject[] contents){
+ _contents = contents;
+ }
+
+ public RemoteSampleObject[] getContents(){
+ return _contents;
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleRootResource.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleRootResource.java
new file mode 100644
index 00000000000..00a4b77539d
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleRootResource.java
@@ -0,0 +1,55 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.subsystems;
+
+import org.eclipse.rse.examples.dstore.services.IHostSampleObject;
+
+
+
+public class SampleRootResource extends RemoteSampleObject {
+
+ public SampleRootResource(SampleSubSystem ss) {
+ super(null, null, ss);
+ }
+
+ public boolean isContainer(){
+ return true;
+ }
+
+ public String getName(){
+ return "Root";
+ }
+
+
+
+ public String getType(){
+ return "Root";
+ }
+
+ public RemoteSampleObject getParent(){
+ return null;
+ }
+
+ public String getAbsolutePath(){
+ return getName();
+ }
+
+ public IHostSampleObject getHostSampleObject(){
+ return _hostObject;
+ }
+
+ public void setHostSampleObject(IHostSampleObject hostObject){
+ _hostObject = hostObject;
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java
new file mode 100644
index 00000000000..56edcfed1a6
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java
@@ -0,0 +1,125 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.subsystems;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.eclipse.rse.core.subsystems.SubSystem;
+import org.eclipse.rse.examples.dstore.services.IHostSampleContainer;
+import org.eclipse.rse.examples.dstore.services.IHostSampleObject;
+import org.eclipse.rse.examples.dstore.services.SampleService;
+
+public class SampleSubSystem extends SubSystem {
+
+ private SampleService _sampleService;
+ private SampleRootResource _root;
+
+ protected SampleSubSystem(IHost host, IConnectorService connectorService, SampleService sampleService) {
+ super(host, connectorService);
+ _sampleService = sampleService;
+ }
+
+ public boolean hasChildren() {
+ return true;
+ }
+
+ public Object[] getChildren() {
+ if (_root == null){
+ _root = new SampleRootResource(this);
+ }
+ return new Object[] {_root};
+ }
+
+ public Object[] list(RemoteSampleObject containerObj, IProgressMonitor monitor){
+ try {
+ checkIsConnected(monitor);
+ }
+ catch (Exception e){
+ e.printStackTrace();
+ }
+
+ RemoteSampleObject[] contents = containerObj.getContents();
+ if (contents == null){
+ IHostSampleContainer container = (IHostSampleContainer)containerObj.getHostSampleObject();
+ if (container == null && containerObj instanceof SampleRootResource){
+ container = getSampleService().getContainer(containerObj.getName(), monitor);
+ ((SampleRootResource)containerObj).setHostSampleObject(container);
+ }
+ IHostSampleObject[] hostResults = getSampleService().query(container, monitor);
+
+ contents = new RemoteSampleObject[hostResults.length];
+ for (int i = 0; i < hostResults.length; i++){
+ IHostSampleObject hobj = hostResults[i];
+ contents[i] = new RemoteSampleObject(containerObj, hobj, this);
+ }
+ containerObj.setContents(contents);
+ }
+
+ return contents;
+ }
+
+ public void doRemoteAction(RemoteSampleObject object, IProgressMonitor monitor){
+ IHostSampleObject hostObject = object.getHostSampleObject();
+ getSampleService().doAction(hostObject, monitor);
+ }
+
+
+ public void createSampleContainer(RemoteSampleObject parentObject, IProgressMonitor monitor){
+ parentObject.setContents(null); // clear contents so that fresh contents arrive after refresh
+ IHostSampleObject hostObject = parentObject.getHostSampleObject();
+ getSampleService().createSampleContainer(hostObject, monitor);
+ }
+
+ public void createSampleObject(RemoteSampleObject parentObject, IProgressMonitor monitor){
+ parentObject.setContents(null); // clear contents so that fresh contents arrive after refresh
+ IHostSampleObject hostObject = parentObject.getHostSampleObject();
+ getSampleService().createSampleObject(hostObject, monitor);
+ }
+
+ public boolean rename(RemoteSampleObject object, String newName, IProgressMonitor monitor){
+ IHostSampleObject hostObject = object.getHostSampleObject();
+ return getSampleService().rename(hostObject, newName, monitor);
+ }
+
+ public boolean delete(RemoteSampleObject object, IProgressMonitor monitor){
+ object.getParent().setContents(null); // clear contents so that fresh contents arrive after refresh
+ IHostSampleObject hostObject = object.getHostSampleObject();
+ return getSampleService().delete(hostObject, monitor);
+ }
+
+ protected SampleService getSampleService(){
+ return _sampleService;
+ }
+
+ @Override
+ public void initializeSubSystem(IProgressMonitor monitor) {
+ super.initializeSubSystem(monitor);
+
+ getSampleService().initService(monitor);
+ }
+
+ @Override
+ public void uninitializeSubSystem(IProgressMonitor monitor) {
+ _root.setHostSampleObject(null);
+ _root.setContents(null);
+ super.uninitializeSubSystem(monitor);
+
+ getSampleService().uninitService(monitor);
+ }
+
+
+
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystemConfiguration.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystemConfiguration.java
new file mode 100644
index 00000000000..6fd20025225
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystemConfiguration.java
@@ -0,0 +1,63 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.subsystems;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.rse.connectorservice.dstore.DStoreConnectorService;
+import org.eclipse.rse.connectorservice.dstore.DStoreConnectorServiceManager;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.core.subsystems.SubSystemConfiguration;
+import org.eclipse.rse.examples.dstore.services.SampleService;
+import org.eclipse.rse.services.dstore.IDStoreService;
+
+public class SampleSubSystemConfiguration extends SubSystemConfiguration {
+
+
+ protected Map _services = new HashMap();
+
+ public ISubSystem createSubSystemInternal(IHost conn) {
+
+ return new SampleSubSystem(conn, getConnectorService(conn), getSampleService(conn));
+ }
+
+ public IConnectorService getConnectorService(IHost host) {
+ return DStoreConnectorServiceManager.getInstance().getConnectorService(host, getServiceImplType());
+ }
+
+ public SampleService getSampleService(IHost host) {
+ SampleService service = (SampleService)_services.get(host);
+ if (service == null)
+ {
+ DStoreConnectorService connectorService = (DStoreConnectorService)getConnectorService(host);
+ service = new SampleService(connectorService);
+ _services.put(host, service);
+ }
+ return service;
+ }
+
+ public boolean supportsFilters() {
+ return false;
+ }
+
+ public Class getServiceImplType(){
+ return IDStoreService.class;
+ }
+
+
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/RemoteSampleObjectAdapterFactory.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/RemoteSampleObjectAdapterFactory.java
new file mode 100644
index 00000000000..ee02f214468
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/RemoteSampleObjectAdapterFactory.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 org.eclipse.rse.examples.dstore.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.rse.examples.dstore.subsystems.RemoteSampleObject;
+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 RemoteSampleObjectAdapterFactory extends AbstractSystemRemoteAdapterFactory
+ implements IAdapterFactory
+{
+
+ private SampleAdapter sampleAdapter = new SampleAdapter();
+
+
+ /**
+ * Constructor for DeveloperAdapterFactory.
+ */
+ public RemoteSampleObjectAdapterFactory() {
+ 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 RemoteSampleObject)
+ adapter = sampleAdapter;
+ // 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.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleAdapter.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleAdapter.java
new file mode 100644
index 00000000000..7aaa2620072
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleAdapter.java
@@ -0,0 +1,248 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.ui;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.examples.dstore.subsystems.RemoteSampleObject;
+import org.eclipse.rse.examples.dstore.subsystems.SampleRootResource;
+import org.eclipse.rse.examples.dstore.subsystems.SampleSubSystem;
+import org.eclipse.rse.examples.dstore.ui.actions.NewSampleObjectAction;
+import org.eclipse.rse.examples.dstore.ui.actions.SampleAction;
+import org.eclipse.rse.ui.ISystemContextMenuConstants;
+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.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+public class SampleAdapter extends AbstractSystemViewAdapter implements
+ ISystemRemoteElementAdapter {
+
+ private SampleAction _sampleAction;
+ private NewSampleObjectAction _newSampleObjectAction;
+ private NewSampleObjectAction _newSampleContainerAction;
+
+ @Override
+ public Object[] getChildren(IAdaptable element, IProgressMonitor monitor) {
+ RemoteSampleObject object = getSampleObject(element);
+ if (object != null){
+ if (object.isContainer()){
+ SampleSubSystem ss = (SampleSubSystem)object.getSubSystem();
+ return ss.list(object, monitor);
+ }
+ }
+ return null;
+ }
+
+
+ @Override
+ public Object getParent(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getParent();
+ }
+ return null;
+ }
+
+ @Override
+ public String getType(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getType();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(IAdaptable element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.isContainer();
+ }
+ return false;
+ }
+
+ @Override
+ protected Object internalGetPropertyValue(Object key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getAbsoluteParentName(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getParent().getAbsolutePath();
+ }
+ return null;
+ }
+
+ public Object getRemoteParent(Object element, IProgressMonitor monitor)
+ throws Exception {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getParent();
+ }
+ return null;
+ }
+
+ public String[] getRemoteParentNamesInUse(Object element,
+ IProgressMonitor monitor) throws Exception {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean refreshRemoteObject(Object oldElement, Object newElement) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public String getRemoteSubType(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getRemoteType(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getRemoteTypeCategory(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSubSystemConfigurationId(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getSubSystem().getSubSystemConfiguration().getId();
+ }
+ return null;
+ }
+
+ public String getText(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getName();
+ }
+ return null;
+ }
+
+ public String getAbsoluteName(Object element) {
+
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ return obj.getAbsolutePath();
+ }
+ return null;
+ }
+
+ @Override
+ public void addActions(SystemMenuManager menu,
+ IStructuredSelection selection, Shell parent, String menuGroup) {
+ Object firstSelection = selection.getFirstElement();
+ if (firstSelection instanceof RemoteSampleObject){
+ if (!(firstSelection instanceof SampleRootResource)){
+ if (_sampleAction == null){
+ _sampleAction = new SampleAction(parent);
+ }
+ menu.add(ISystemContextMenuConstants.GROUP_CHANGE, _sampleAction);
+ }
+
+ if (_newSampleObjectAction == null){
+ _newSampleObjectAction = new NewSampleObjectAction(shell, false);
+ }
+ if (_newSampleContainerAction == null){
+ _newSampleContainerAction = new NewSampleObjectAction(shell, true);
+ }
+
+ if (((RemoteSampleObject)firstSelection).isContainer()){
+ menu.add(ISystemContextMenuConstants.GROUP_NEW, _newSampleObjectAction);
+ menu.add(ISystemContextMenuConstants.GROUP_NEW, _newSampleContainerAction);
+ }
+ }
+ }
+
+ private RemoteSampleObject getSampleObject(Object element){
+ if (element instanceof RemoteSampleObject){
+ return (RemoteSampleObject)element;
+ }
+ return null;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor(Object element) {
+ RemoteSampleObject obj = getSampleObject(element);
+ if (obj != null){
+ if (obj.isContainer()){
+ return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
+ }
+ else {
+ return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected IPropertyDescriptor[] internalGetPropertyDescriptors() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean canRename(Object element) {
+ if (element instanceof SampleRootResource){
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean doRename(Shell shell, Object element, String name,
+ IProgressMonitor monitor) throws Exception {
+ SampleSubSystem ss = (SampleSubSystem)getSubSystem(element);
+ return ss.rename((RemoteSampleObject)element, name, monitor);
+ }
+
+ @Override
+ public boolean canDelete(Object element) {
+ if (element instanceof SampleRootResource){
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean doDelete(Shell shell, Object element,
+ IProgressMonitor monitor) throws Exception {
+ SampleSubSystem ss = (SampleSubSystem)getSubSystem(element);
+ boolean result = ss.delete((RemoteSampleObject)element, monitor);
+ if (result){
+ ss.list(((RemoteSampleObject)element).getParent(), monitor);
+ }
+ return result;
+ }
+
+ @Override
+ public boolean supportsDeferredQueries(ISubSystem subSys) {
+ return true;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapter.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapter.java
new file mode 100644
index 00000000000..65cfc0f9755
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapter.java
@@ -0,0 +1,21 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.ui;
+
+import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter;
+
+public class SampleSubSystemConfigurationAdapter extends
+ SubSystemConfigurationAdapter {
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapterFactory.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapterFactory.java
new file mode 100644
index 00000000000..87340f891d0
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/SampleSubSystemConfigurationAdapterFactory.java
@@ -0,0 +1,64 @@
+/********************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributors:
+ * The following IBM employees contributed to the Remote System Explorer
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
+ *
+ * Contributors:
+ * Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE.
+ * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
+ ********************************************************************************/
+
+package org.eclipse.rse.examples.dstore.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.rse.examples.dstore.subsystems.SampleSubSystemConfiguration;
+import org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter;
+
+/**
+ * @see IAdapterFactory
+ */
+public class SampleSubSystemConfigurationAdapterFactory implements
+ IAdapterFactory {
+
+ private ISubSystemConfigurationAdapter ssConfigAdapter = new SampleSubSystemConfigurationAdapter();
+
+ /**
+ * @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.
+ * @param manager Platform adapter manager
+ */
+ public void registerWithManager(IAdapterManager manager)
+ {
+ manager.registerAdapters(this, SampleSubSystemConfiguration.class);
+ }
+
+ /**
+ * @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType)
+ {
+ Object adapter = null;
+ if (adaptableObject instanceof SampleSubSystemConfiguration)
+ adapter = ssConfigAdapter;
+
+ return adapter;
+ }
+
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/NewSampleObjectAction.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/NewSampleObjectAction.java
new file mode 100644
index 00000000000..884f7822c3d
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/NewSampleObjectAction.java
@@ -0,0 +1,71 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.ui.actions;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
+import org.eclipse.rse.core.events.SystemResourceChangeEvent;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.examples.dstore.subsystems.RemoteSampleObject;
+import org.eclipse.rse.examples.dstore.subsystems.SampleSubSystem;
+import org.eclipse.rse.ui.actions.SystemBaseAction;
+import org.eclipse.swt.widgets.Shell;
+
+public class NewSampleObjectAction extends SystemBaseAction {
+ public class NewSampleObjectJob extends Job {
+ private RemoteSampleObject _selectedObject;
+ public NewSampleObjectJob(RemoteSampleObject selectedObject){
+ super("Create Sample Object");
+ _selectedObject = selectedObject;
+ }
+
+ public IStatus run(IProgressMonitor monitor){
+ SampleSubSystem ss = (SampleSubSystem)_selectedObject.getSubSystem();
+
+ // do remote action
+ if (_container){
+ ss.createSampleContainer(_selectedObject, monitor);
+ }
+ else {
+ ss.createSampleObject(_selectedObject, monitor);
+ }
+
+ // refresh view
+ ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
+ sr.fireEvent(new SystemResourceChangeEvent(_selectedObject, ISystemResourceChangeEvents.EVENT_REFRESH, _selectedObject));
+ return Status.OK_STATUS;
+ }
+ }
+
+
+ private boolean _container;
+ public NewSampleObjectAction(Shell shell, boolean container) {
+ super(container? "Sample Container" : "Sample Object", shell);
+ _container = container;
+ }
+
+ @Override
+ public void run() {
+
+ RemoteSampleObject obj = (RemoteSampleObject)getSelection().getFirstElement();
+ if (obj != null){
+ NewSampleObjectJob job = new NewSampleObjectJob(obj);
+ job.schedule();
+ }
+ }
+}
diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/SampleAction.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/SampleAction.java
new file mode 100644
index 00000000000..02d518b680c
--- /dev/null
+++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/ui/actions/SampleAction.java
@@ -0,0 +1,70 @@
+/********************************************************************************
+ * Copyright (c) 2009 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.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+package org.eclipse.rse.examples.dstore.ui.actions;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
+import org.eclipse.rse.core.events.SystemResourceChangeEvent;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.examples.dstore.subsystems.RemoteSampleObject;
+import org.eclipse.rse.examples.dstore.subsystems.SampleSubSystem;
+import org.eclipse.rse.ui.actions.SystemBaseAction;
+import org.eclipse.swt.widgets.Shell;
+
+public class SampleAction extends SystemBaseAction {
+
+ public class SampleJob extends Job {
+ private RemoteSampleObject _selectedObject;
+ public SampleJob(RemoteSampleObject selectedObject){
+ super("Sample Job");
+ _selectedObject = selectedObject;
+ }
+
+ public IStatus run(IProgressMonitor monitor){
+ SampleSubSystem ss = (SampleSubSystem)_selectedObject.getSubSystem();
+
+ // do remote action
+ ss.doRemoteAction(_selectedObject, monitor);
+
+ // refresh view
+ ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
+ sr.fireEvent(new SystemResourceChangeEvent(_selectedObject.getParent(), ISystemResourceChangeEvents.EVENT_REFRESH, _selectedObject.getParent()));
+ return Status.OK_STATUS;
+ }
+ }
+
+
+
+ public SampleAction(Shell shell) {
+ super("Do Remote Operation", shell);
+ }
+
+ @Override
+ public void run() {
+
+ RemoteSampleObject obj = (RemoteSampleObject)getSelection().getFirstElement();
+ if (obj != null){
+ SampleJob job = new SampleJob(obj);
+ job.schedule();
+ }
+ }
+
+
+
+
+}