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 index 9b75b36fb66..8e6977b491b 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/META-INF/MANIFEST.MF +++ b/rse/examples/org.eclipse.rse.examples.tutorial/META-INF/MANIFEST.MF @@ -12,5 +12,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.resources, org.eclipse.rse.ui, org.eclipse.rse.core, - org.eclipse.rse.services + org.eclipse.rse.services, + org.eclipse.rse.files.ui, + org.eclipse.rse.subsystems.files.core, + org.eclipse.rse.subsystems.shells.core Eclipse-LazyStart: true diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml b/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml index d810117c803..b9da65c1226 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml +++ b/rse/examples/org.eclipse.rse.examples.tutorial/plugin.xml @@ -16,9 +16,42 @@ Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE. --> + + + + + + + + + + + + + + + + + + + + + + - - - - - Sample message - This is a sample with one substution variable: %1 - - - - + + + + + Sample message + This is a sample with one substution variable: %1 + + + Processing... + + + + + diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/rseSamplesResources.properties b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/rseSamplesResources.properties index 0de54f1ae4f..bab29dbbd83 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/rseSamplesResources.properties +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/rseSamplesResources.properties @@ -14,6 +14,7 @@ # Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE. ################################################################################ +# Tutorial #2: Creating a Remote Resource Property Page pp.size.label=Size pp.size.tooltip=Cumulative size, in bytes pp.files.label=Files @@ -23,6 +24,7 @@ pp.folders.tooltip=Cumulative number of folders pp.stopButton.label=Stop pp.stopButton.tooltip=Cancel the thread +# Tutorial #3: Creating a Subsystem Configuration connectorservice.devr.name=DeveloperConnectorService connectorservice.devr.desc=Manages connections to faked remote developer resources. @@ -31,11 +33,10 @@ property.devr_id.name=Id property.devr_id.desc=ID number property.devr_dept.name=Department property.devr_dept.desc=Department number - property.team_resource.type=Team resource - filter.default.name=All Teams +# Tutorial #3a: Adding a Custom Filter property.type.teamfilter=Team filter property.type.devrfilter=Developer filter diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java new file mode 100644 index 00000000000..d68dbdfc5b3 --- /dev/null +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java @@ -0,0 +1,80 @@ +/******************************************************************************** + * 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.ui.actions; + +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.files.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction; +import org.eclipse.rse.internal.model.SystemRegistry; +import org.eclipse.rse.model.IHost; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; + +/** + * An action that runs a command to display the contents of a Jar file. + * The plugin.xml file restricts this action so it only appears for .jar files. + */ +public class ShowJarContents extends SystemAbstractRemoteFilePopupMenuExtensionAction { + + /** + * Constructor for ShowJarContents. + */ + public ShowJarContents() { + super(); + } + + /* (non-Javadoc) + * @see org.eclipse.rse.ui.actions.SystemAbstractPopupMenuExtensionAction#run() + */ + public void run() { + IRemoteFile selectedFile = getFirstSelectedRemoteFile(); + String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); //$NON-NLS-1$ + try { + runCommand(cmdToRun); + } catch(Exception e) { + //TODO: Display exception + } + } + + public IRemoteCmdSubSystem getRemoteCmdSubSystem() { + //get the Command subsystem associated with the current host + IHost myHost = getSubSystem().getHost(); + ISubSystem[] subsys = SystemRegistry.getSystemRegistry().getSubSystems(myHost); + for (int i=0; i0)) + { + for (int idx=0; !stopped && (idx