### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.doc.isv Index: guide/tutorial/DeveloperFilterStringEditPane.html =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/DeveloperFilterStringEditPane.html,v retrieving revision 1.2 diff -u -r1.2 DeveloperFilterStringEditPane.html --- guide/tutorial/DeveloperFilterStringEditPane.html 4 Aug 2006 20:37:04 -0000 1.2 +++ guide/tutorial/DeveloperFilterStringEditPane.html 12 Sep 2007 18:51:48 -0000 @@ -1,210 +1,210 @@ - - - -
- - - - --package samples.subsystems; - -import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.rse.ui.filters.SystemFilterStringEditPane; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import samples.RSESamplesPlugin; - -/** - * Our specialized filter string edit pane for developer filters. - */ -public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane { - - // gui widgets - private Text textTeam, textDevr; - - /** - * Constructor for DeveloperFilterStringEditPane. - * @param shell - parent window - */ - public DeveloperFilterStringEditPane(Shell shell) - { - super(shell); - } - - /** - * Override of parent method. - * This is where we populate the client area. - * @param parent - the composite that will be the parent of the returned client area composite - * @return Control - a client-area composite populated with widgets. - * - * @see org.eclipse.rse.ui.SystemWidgetHelpers - */ - public Control createContents(Composite parent) - { - // Inner composite - int nbrColumns = 1; - Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); - ((GridLayout)composite_prompts.getLayout()).marginWidth = 0; - - // CREATE TEAM-PARENT PROMPT - textTeam = SystemWidgetHelpers.createLabeledTextField( - composite_prompts, - null, - RSESamplesPlugin.getResourceString("filter.devr.teamprompt.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("filter.devr.teamprompt.tooltip") //$NON-NLS-1$ - ); - - // CREATE DEVELOPER PROMPT - textDevr = SystemWidgetHelpers.createLabeledTextField( - composite_prompts, - null, - RSESamplesPlugin.getResourceString("filter.devr.devrprompt.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("filter.devr.devrprompt.tooltip") //$NON-NLS-1$ - ); - - resetFields(); - doInitializeFields(); - - // add keystroke listeners... - textTeam.addModifyListener( - new ModifyListener() - { - public void modifyText(ModifyEvent e) - { - validateStringInput(); - } - } - ); - textDevr.addModifyListener( - new ModifyListener() - { - public void modifyText(ModifyEvent e) - { - validateStringInput(); - } - } - ); - return composite_prompts; - } - - /** - * Override of parent method. - * Return the control to recieve initial focus. - */ - public Control getInitialFocusControl() - { - return textTeam; - } - - /** - * Override of parent method. - * Initialize the input fields based on the inputFilterString, and perhaps refProvider. - * This can be called before createContents, so test for null widgets first! - * Prior to this being called, resetFields is called to set the initial default state prior to input - */ - protected void doInitializeFields() - { - if (textTeam == null) - return; // do nothing - if (inputFilterString != null) - { - int idx = inputFilterString.indexOf('/'); - if (idx < 0) - textTeam.setText(inputFilterString); - else - { - textTeam.setText(inputFilterString.substring(0,idx)); - textDevr.setText(inputFilterString.substring(idx+1)); - } - } - } - - /** - * Override of parent method. - * This is called in the change filter dialog when the user selects "new", or selects another string. - */ - protected void resetFields() - { - textTeam.setText(""); //$NON-NLS-1$ - textDevr.setText("*"); //$NON-NLS-1$ - } - - /** - * Override of parent method. - * Called by parent to decide if information is complete enough to enable finish. - */ - protected boolean areFieldsComplete() - { - if ((textTeam == null) || (textDevr == null)) - return false; - else - return (textTeam.getText().trim().length()>0) && (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; - } - -} -- - + + + + + + + + +
+package samples.subsystems; + +import org.eclipse.rse.services.clientserver.messages.SystemMessage; +import org.eclipse.rse.ui.SystemWidgetHelpers; +import org.eclipse.rse.ui.filters.SystemFilterStringEditPane; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +import samples.RSESamplesPlugin; + +/** + * Our specialized filter string edit pane for developer filters. + */ +public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane { + + // gui widgets + private Text textTeam, textDevr; + + /** + * Constructor for DeveloperFilterStringEditPane. + * @param shell - parent window + */ + public DeveloperFilterStringEditPane(Shell shell) + { + super(shell); + } + + /** + * Override of parent method. + * This is where we populate the client area. + * @param parent - the composite that will be the parent of the returned client area composite + * @return Control - a client-area composite populated with widgets. + * + * @see org.eclipse.rse.ui.SystemWidgetHelpers + */ + public Control createContents(Composite parent) + { + // Inner composite + int nbrColumns = 1; + Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); + ((GridLayout)composite_prompts.getLayout()).marginWidth = 0; + + // CREATE TEAM-PARENT PROMPT + textTeam = SystemWidgetHelpers.createLabeledTextField( + composite_prompts, + null, + RSESamplesPlugin.getResourceString("filter.devr.teamprompt.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("filter.devr.teamprompt.tooltip") //$NON-NLS-1$ + ); + + // CREATE DEVELOPER PROMPT + textDevr = SystemWidgetHelpers.createLabeledTextField( + composite_prompts, + null, + RSESamplesPlugin.getResourceString("filter.devr.devrprompt.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("filter.devr.devrprompt.tooltip") //$NON-NLS-1$ + ); + + resetFields(); + doInitializeFields(); + + // add keystroke listeners... + textTeam.addModifyListener( + new ModifyListener() + { + public void modifyText(ModifyEvent e) + { + validateStringInput(); + } + } + ); + textDevr.addModifyListener( + new ModifyListener() + { + public void modifyText(ModifyEvent e) + { + validateStringInput(); + } + } + ); + return composite_prompts; + } + + /** + * Override of parent method. + * Return the control to recieve initial focus. + */ + public Control getInitialFocusControl() + { + return textTeam; + } + + /** + * Override of parent method. + * Initialize the input fields based on the inputFilterString, and perhaps refProvider. + * This can be called before createContents, so test for null widgets first! + * Prior to this being called, resetFields is called to set the initial default state prior to input + */ + protected void doInitializeFields() + { + if (textTeam == null) + return; // do nothing + if (inputFilterString != null) + { + int idx = inputFilterString.indexOf('/'); + if (idx < 0) + textTeam.setText(inputFilterString); + else + { + textTeam.setText(inputFilterString.substring(0,idx)); + textDevr.setText(inputFilterString.substring(idx+1)); + } + } + } + + /** + * Override of parent method. + * This is called in the change filter dialog when the user selects "new", or selects another string. + */ + protected void resetFields() + { + textTeam.setText(""); //$NON-NLS-1$ + textDevr.setText("*"); //$NON-NLS-1$ + } + + /** + * Override of parent method. + * Called by parent to decide if information is complete enough to enable finish. + */ + protected boolean areFieldsComplete() + { + if ((textTeam == null) || (textDevr == null)) + return false; + else + return (textTeam.getText().trim().length()>0) && (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; + } + +} ++ + Index: guide/tutorial/FolderInfoPropertyPage2.html =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/FolderInfoPropertyPage2.html,v retrieving revision 1.3 diff -u -r1.3 FolderInfoPropertyPage2.html --- guide/tutorial/FolderInfoPropertyPage2.html 14 Dec 2006 22:04:00 -0000 1.3 +++ guide/tutorial/FolderInfoPropertyPage2.html 12 Sep 2007 18:51:48 -0000 @@ -1,269 +1,269 @@ - - - - - - - - -
-
-package samples.ui.propertypages; - -import org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction; -import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; -import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; - -import samples.RSESamplesPlugin; - -/** - * A sample property page for a remote object, which in this case is scoped via the - * extension point xml to only apply to folder objects. - */ -public class FolderInfoPropertyPage - extends SystemAbstractRemoteFilePropertyPageExtensionAction - implements SelectionListener -{ - // gui widgets... - private Label sizeLabel, filesLabel, foldersLabel; - private Button stopButton; - // state... - private int totalSize = 0; - private int totalFolders = 0; - private int totalFiles = 0; - private boolean stopped = false; - private Thread workerThread; - private Runnable guiUpdater; - - /** - * Constructor for FolderInfoPropertyPage. - */ - public FolderInfoPropertyPage() - { - super(); - } - - // -------------------------- - // Parent method overrides... - // -------------------------- - - - /* (non-Javadoc) - * @see org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction#createContentArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createContentArea(Composite parent) - { - Composite composite = SystemWidgetHelpers.createComposite(parent, 2); - // draw the gui - sizeLabel = SystemWidgetHelpers.createLabeledLabel(composite, - RSESamplesPlugin.getResourceString("pp.size.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("pp.size.tooltip"), //$NON-NLS-1$ - false); - filesLabel = SystemWidgetHelpers.createLabeledLabel(composite, - RSESamplesPlugin.getResourceString("pp.files.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("pp.files.tooltip"), //$NON-NLS-1$ - false); - foldersLabel = SystemWidgetHelpers.createLabeledLabel(composite, - RSESamplesPlugin.getResourceString("pp.folders.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("pp.folders.tooltip"), //$NON-NLS-1$ - false); - stopButton = SystemWidgetHelpers.createPushButton(composite, null, - RSESamplesPlugin.getResourceString("pp.stopButton.label"), //$NON-NLS-1$ - RSESamplesPlugin.getResourceString("pp.stopButton.tooltip") //$NON-NLS-1$ - ); - stopButton.addSelectionListener(this); - - setValid(false); // Disable OK button until thread is done - - // show "Processing..." message - setMessage(RSESamplesPlugin.getPluginMessage("RSSG1002")); //$NON-NLS-1$ - - // create instance of Runnable to allow asynchronous GUI updates from background thread - guiUpdater = new RunnableGUIClass(); - // spawn a thread to calculate the information - workerThread = new RunnableClass(getRemoteFile()); - workerThread.start(); - - return composite; - } - - /** - * Intercept from PreferencePage. Called when user presses Cancel button. - * We stop the background thread. - * @see org.eclipse.jface.preference.PreferencePage#performCancel() - */ - public boolean performCancel() - { - killThread(); - return true; - } - - /** - * Intercept from DialogPage. Called when dialog going away. - * If the user presses the X to close this dialog, we - * need to stop that background thread. - */ - public void dispose() - { - killThread(); - super.dispose(); - } - - /** - * Private method to kill our background thread. - * Control doesn't return until it ends. - */ - private void killThread() - { - if (!stopped && workerThread.isAlive()) - { - stopped = true; - try { - workerThread.join(); // wait for thread to end - } catch (InterruptedException exc) {} - } - } - - // ------------------------------------------- - // Methods from SelectionListener interface... - // ------------------------------------------- - - /** - * From SelectionListener - * @see SelectionListener#widgetSelected(SelectionEvent) - */ - public void widgetSelected(SelectionEvent event) - { - if (event.getSource() == stopButton) - { - stopped = true; - stopButton.setEnabled(false); - } - } - /** - * From SelectionListener - * @see SelectionListener#widgetDefaultSelected(SelectionEvent) - */ - public void widgetDefaultSelected(SelectionEvent event) - { - } - - // ---------------- - // Inner classes... - // ---------------- - /** - * Inner class encapsulating the background work to be done, so it may be executed - * in background thread. - */ - private class RunnableClass extends Thread - { - IRemoteFile inputFolder; - - RunnableClass(IRemoteFile inputFolder) - { - this.inputFolder = inputFolder; - } - - public void run() - { - if (stopped) - return; - walkFolder(inputFolder); - updateGUI(); - if (!stopped) - { - stopped = true; - updateGUI(); - } - } - - /** - * Recursively walk a folder, updating the running tallies. - * Update the GUI after processing each subfolder. - */ - private void walkFolder(IRemoteFile currFolder) - { - try - { - IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null); - if ((folders != null) && (folders.length>0)) - { - for (int idx=0; !stopped && (idx<folders.length); idx++) - { - // is this a folder? - if (folders[idx].isDirectory()) - { - ++totalFolders; - walkFolder(folders[idx]); - updateGUI(); - } - // is this a file? - else - { - ++totalFiles; - totalSize += folders[idx].getLength(); - } - } - } - } - catch (SystemMessageException e) - { - - } - } // end of walkFolder method - - } // end of inner class - - /** - * Inner class encapsulating the GUI work to be done from the - * background thread. - */ - private class RunnableGUIClass implements Runnable - { - public void run() - { - if (stopButton.isDisposed()) - return; - if (!stopped) - { - sizeLabel.setText(Integer.toString(totalSize)); - filesLabel.setText(Integer.toString(totalFiles)); - foldersLabel.setText(Integer.toString(totalFolders)); - } - else if (stopped) - { - setValid(true); // re-enable OK button - stopButton.setEnabled(false); // disable Stop button - clearMessage(); // clear "Processing..." message - } - } - } - - - /** - * Update the GUI with the current status - */ - private void updateGUI() - { - Display.getDefault().asyncExec(guiUpdater); - } - - -} -- - - + + + + + + + + +
+
+package samples.ui.propertypages; + +import org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.rse.ui.SystemWidgetHelpers; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; + +import samples.RSESamplesPlugin; + +/** + * A sample property page for a remote object, which in this case is scoped via the + * extension point xml to only apply to folder objects. + */ +public class FolderInfoPropertyPage + extends SystemAbstractRemoteFilePropertyPageExtensionAction + implements SelectionListener +{ + // gui widgets... + private Label sizeLabel, filesLabel, foldersLabel; + private Button stopButton; + // state... + private int totalSize = 0; + private int totalFolders = 0; + private int totalFiles = 0; + private boolean stopped = false; + private Thread workerThread; + private Runnable guiUpdater; + + /** + * Constructor for FolderInfoPropertyPage. + */ + public FolderInfoPropertyPage() + { + super(); + } + + // -------------------------- + // Parent method overrides... + // -------------------------- + + + /* (non-Javadoc) + * @see org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction#createContentArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createContentArea(Composite parent) + { + Composite composite = SystemWidgetHelpers.createComposite(parent, 2); + // draw the gui + sizeLabel = SystemWidgetHelpers.createLabeledLabel(composite, + RSESamplesPlugin.getResourceString("pp.size.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("pp.size.tooltip"), //$NON-NLS-1$ + false); + filesLabel = SystemWidgetHelpers.createLabeledLabel(composite, + RSESamplesPlugin.getResourceString("pp.files.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("pp.files.tooltip"), //$NON-NLS-1$ + false); + foldersLabel = SystemWidgetHelpers.createLabeledLabel(composite, + RSESamplesPlugin.getResourceString("pp.folders.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("pp.folders.tooltip"), //$NON-NLS-1$ + false); + stopButton = SystemWidgetHelpers.createPushButton(composite, null, + RSESamplesPlugin.getResourceString("pp.stopButton.label"), //$NON-NLS-1$ + RSESamplesPlugin.getResourceString("pp.stopButton.tooltip") //$NON-NLS-1$ + ); + stopButton.addSelectionListener(this); + + setValid(false); // Disable OK button until thread is done + + // show "Processing..." message + setMessage(RSESamplesPlugin.getPluginMessage("RSSG1002")); //$NON-NLS-1$ + + // create instance of Runnable to allow asynchronous GUI updates from background thread + guiUpdater = new RunnableGUIClass(); + // spawn a thread to calculate the information + workerThread = new RunnableClass(getRemoteFile()); + workerThread.start(); + + return composite; + } + + /** + * Intercept from PreferencePage. Called when user presses Cancel button. + * We stop the background thread. + * @see org.eclipse.jface.preference.PreferencePage#performCancel() + */ + public boolean performCancel() + { + killThread(); + return true; + } + + /** + * Intercept from DialogPage. Called when dialog going away. + * If the user presses the X to close this dialog, we + * need to stop that background thread. + */ + public void dispose() + { + killThread(); + super.dispose(); + } + + /** + * Private method to kill our background thread. + * Control doesn't return until it ends. + */ + private void killThread() + { + if (!stopped && workerThread.isAlive()) + { + stopped = true; + try { + workerThread.join(); // wait for thread to end + } catch (InterruptedException exc) {} + } + } + + // ------------------------------------------- + // Methods from SelectionListener interface... + // ------------------------------------------- + + /** + * From SelectionListener + * @see SelectionListener#widgetSelected(SelectionEvent) + */ + public void widgetSelected(SelectionEvent event) + { + if (event.getSource() == stopButton) + { + stopped = true; + stopButton.setEnabled(false); + } + } + /** + * From SelectionListener + * @see SelectionListener#widgetDefaultSelected(SelectionEvent) + */ + public void widgetDefaultSelected(SelectionEvent event) + { + } + + // ---------------- + // Inner classes... + // ---------------- + /** + * Inner class encapsulating the background work to be done, so it may be executed + * in background thread. + */ + private class RunnableClass extends Thread + { + IRemoteFile inputFolder; + + RunnableClass(IRemoteFile inputFolder) + { + this.inputFolder = inputFolder; + } + + public void run() + { + if (stopped) + return; + walkFolder(inputFolder); + updateGUI(); + if (!stopped) + { + stopped = true; + updateGUI(); + } + } + + /** + * Recursively walk a folder, updating the running tallies. + * Update the GUI after processing each subfolder. + */ + private void walkFolder(IRemoteFile currFolder) + { + try + { + IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null); + if ((folders != null) && (folders.length>0)) + { + for (int idx=0; !stopped && (idx<folders.length); idx++) + { + // is this a folder? + if (folders[idx].isDirectory()) + { + ++totalFolders; + walkFolder(folders[idx]); + updateGUI(); + } + // is this a file? + else + { + ++totalFiles; + totalSize += folders[idx].getLength(); + } + } + } + } + catch (SystemMessageException e) + { + + } + } // end of walkFolder method + + } // end of inner class + + /** + * Inner class encapsulating the GUI work to be done from the + * background thread. + */ + private class RunnableGUIClass implements Runnable + { + public void run() + { + if (stopButton.isDisposed()) + return; + if (!stopped) + { + sizeLabel.setText(Integer.toString(totalSize)); + filesLabel.setText(Integer.toString(totalFiles)); + foldersLabel.setText(Integer.toString(totalFolders)); + } + else if (stopped) + { + setValid(true); // re-enable OK button + stopButton.setEnabled(false); // disable Stop button + clearMessage(); // clear "Processing..." message + } + } + } + + + /** + * Update the GUI with the current status + */ + private void updateGUI() + { + Display.getDefault().asyncExec(guiUpdater); + } + + +} ++ + + Index: guide/tutorial/pdeProject.html =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/pdeProject.html,v retrieving revision 1.4 diff -u -r1.4 pdeProject.html --- guide/tutorial/pdeProject.html 26 Jun 2007 22:11:58 -0000 1.4 +++ guide/tutorial/pdeProject.html 12 Sep 2007 18:51:48 -0000 @@ -1,105 +1,105 @@ - - - - - - - - -
To use any Eclipse extension point, including those defined by the Remote System Explorer, you must first create a plug-in project using the plug-in development environment (PDE), which you will do shortly. At its simplest, a plug-in project requires a MANIFEST.MF file describing the plugin and its dependencies and, if extending the workbench a plugin.xml file identifying the extension points being implemented, and a set of Java classes implementing those extension points. There is usually also a plug-in class file that is used as the overall manager of the project, and point of integration that other classes can rely on.
-If you already have a plugin project, you will need to update it slightly to make it extend SystemBasePlugin and add the few methods it requires. You may wish to examine these steps to see what methods to add. The Eclipse environment will keep your classpaths and plugin dependecies in sync for you.
-Eclipse supplies a number of plug-in project templates, which generate a number of project files that illustrate examples of various Eclipse extension points. While you are free to pick one of these, or indeed start with any existing plug-in project if you have one, in the RSE tutorials everything is created by hand so as to keep focused on the RSE-required classes and files.
-The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.
-
-Bundle-SymbolicName:RSESamples;singleton:=true
-
-This allows us to add extensions to the plugin at a later point.
-Save the plugin properties and close the editor.
-
-<plugin>
-</plugin>
-
-Add the lines above to the empty plugin.xml file and save it.
-
-<?xml version="1.0" encoding='UTF-8'?>
-<!DOCTYPE MessageFile SYSTEM "../org.eclipse.rse.ui/messageFile.dtd">
-<!-- This is a message file used by SystemMessage and SystemMessageDialog -->
-<MessageFile Version="1.0">
- <Component Name="RSE Samples" Abbr="RSS">
- <Subcomponent Name="General" Abbr="G">
- <MessageList>
- <Message ID="1001" Indicator="E">
- <LevelOne>Sample message</LevelOne>
- <LevelTwo>This is a sample with one substitution variable: %1</LevelTwo>
- </Message>
- </MessageList>
- </Subcomponent>
- </Component>
-</MessageFile>
-
-Save and close the file.
-To use any Eclipse extension point, including those defined by the Remote System Explorer, you must first create a plug-in project using the plug-in development environment (PDE), which you will do shortly. At its simplest, a plug-in project requires a MANIFEST.MF file describing the plugin and its dependencies and, if extending the workbench a plugin.xml file identifying the extension points being implemented, and a set of Java classes implementing those extension points. There is usually also a plug-in class file that is used as the overall manager of the project, and point of integration that other classes can rely on.
+If you already have a plugin project, you will need to update it slightly to make it extend SystemBasePlugin and add the few methods it requires. You may wish to examine these steps to see what methods to add. The Eclipse environment will keep your classpaths and plugin dependecies in sync for you.
+Eclipse supplies a number of plug-in project templates, which generate a number of project files that illustrate examples of various Eclipse extension points. While you are free to pick one of these, or indeed start with any existing plug-in project if you have one, in the RSE tutorials everything is created by hand so as to keep focused on the RSE-required classes and files.
+The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.
+
+Bundle-SymbolicName:RSESamples;singleton:=true
+
+This allows us to add extensions to the plugin at a later point.
+Save the plugin properties and close the editor.
+
+<plugin>
+</plugin>
+
+Add the lines above to the empty plugin.xml file and save it.
+
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE MessageFile SYSTEM "../org.eclipse.rse.ui/messageFile.dtd">
+<!-- This is a message file used by SystemMessage and SystemMessageDialog -->
+<MessageFile Version="1.0">
+ <Component Name="RSE Samples" Abbr="RSS">
+ <Subcomponent Name="General" Abbr="G">
+ <MessageList>
+ <Message ID="1001" Indicator="E">
+ <LevelOne>Sample message</LevelOne>
+ <LevelTwo>This is a sample with one substitution variable: %1</LevelTwo>
+ </Message>
+ </MessageList>
+ </Subcomponent>
+ </Component>
+</MessageFile>
+
+Save and close the file.
+-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-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-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-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 org.eclipse.rse.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-Javadoc) - * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemConfigurationId(java.lang.Object) - */ - public String getSubSystemConfigurationId(Object element) - { - return "samples.subsystems.factory"; // as declared in extension in plugin.xml - } - - /* (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-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-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; idx < allTeams.length; idx++) - allNames[idx] = allTeams[idx].getName(); - return allNames; // Return list of all team names - } - - /* (non-Javadoc) - * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object) - */ - public boolean supportsUserDefinedActions(Object object) { - return false; - } - -} -- - + + + + + + + + +
+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-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-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-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 org.eclipse.rse.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-Javadoc) + * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemConfigurationId(java.lang.Object) + */ + public String getSubSystemConfigurationId(Object element) + { + return "samples.subsystems.factory"; // as declared in extension in plugin.xml + } + + /* (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-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-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; idx < allTeams.length; idx++) + allNames[idx] = allTeams[idx].getName(); + return allNames; // Return list of all team names + } + + /* (non-Javadoc) + * @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object) + */ + public boolean supportsUserDefinedActions(Object object) { + return false; + } + +} ++ + Index: guide/tutorial/popup.html =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/popup.html,v retrieving revision 1.6 diff -u -r1.6 popup.html --- guide/tutorial/popup.html 27 Jun 2007 01:52:08 -0000 1.6 +++ guide/tutorial/popup.html 12 Sep 2007 18:51:48 -0000 @@ -97,7 +97,7 @@
public void runCommand(String command) {
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
- if (cmdss != null && cmdss.isConnected()) {
+ if (cmdss != null && cmdss.isConnected()) {
// Run the command in a visible shell
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
} else {
@@ -111,7 +111,7 @@
public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
IHost myHost = getSubSystem().getHost();
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
- for (int i = 0; i < subsys.length; i++) {
+ for (int i = 0; i < subsys.length; i++) {
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
return subsys[i];
}
Index: guide/tutorial/DeveloperSubSystemConfiguration.html
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/DeveloperSubSystemConfiguration.html,v
retrieving revision 1.4
diff -u -r1.4 DeveloperSubSystemConfiguration.html
--- guide/tutorial/DeveloperSubSystemConfiguration.html 10 May 2007 12:39:29 -0000 1.4
+++ guide/tutorial/DeveloperSubSystemConfiguration.html 12 Sep 2007 18:51:48 -0000
@@ -59,7 +59,7 @@
* We intercept so that we can create an initial filter in that pool, which will
* list all teams.
*/
- protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
+ protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
{
ISystemFilterPool defaultPool = null;
try {
Index: guide/tutorial/ShowJarContents2.html
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/ShowJarContents2.html,v
retrieving revision 1.4
diff -u -r1.4 ShowJarContents2.html
--- guide/tutorial/ShowJarContents2.html 27 Jun 2007 01:52:08 -0000 1.4
+++ guide/tutorial/ShowJarContents2.html 12 Sep 2007 18:51:48 -0000
@@ -1,117 +1,117 @@
-
-
-
-
-
-
-
-
-ShowJarContents Class After Editing
-
-
-
-ShowJarContents Class After Editing
-
-package samples.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
-import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
-import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
-import org.eclipse.rse.ui.SystemBasePlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * 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 implements IObjectActionDelegate {
- private List _selectedFiles;
-
- /**
- * Constructor for ShowJarContents.
- */
- public ShowJarContents() {
- _selectedFiles = new ArrayList();
- }
-
- protected Shell getShell() {
- return SystemBasePlugin.getActiveWorkbenchShell();
- }
-
- protected IRemoteFile getFirstSelectedRemoteFile() {
- if (_selectedFiles.size() > 0) {
- return (IRemoteFile) _selectedFiles.get(0);
- }
- return null;
- }
-
- protected ISubSystem getSubSystem() {
- return getFirstSelectedRemoteFile().getParentRemoteFileSubSystem();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IRemoteFile selectedFile = getFirstSelectedRemoteFile();
- String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); //$NON-NLS-1$
- try {
- runCommand(cmdToRun);
- } catch (Exception e) {
- String excType = e.getClass().getName();
- MessageDialog.openError(getShell(), excType, excType + ": " + e.getLocalizedMessage()); //$NON-NLS-1$
- e.printStackTrace();
- }
- }
-
- public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
- //get the Command subsystem associated with the current host
- IHost myHost = getSubSystem().getHost();
- IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
- for (int i = 0; i < subsys.length; i++) {
- if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
- return subsys[i];
- }
- }
- return null;
- }
-
- public void runCommand(String command) throws Exception {
- IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
- if (cmdss != null && cmdss.isConnected()) {
- // Run the command in a visible shell
- RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
- } else {
- MessageDialog.openError(getShell(), "No command subsystem", "Found no command subsystem");
- }
- }
-
- public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
- _selectedFiles.clear();
- // store the selected jars to be used when running
- Iterator theSet = ((IStructuredSelection) selection).iterator();
- while (theSet.hasNext()) {
- Object obj = theSet.next();
- if (obj instanceof IRemoteFile) {
- _selectedFiles.add(obj);
- }
- }
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-}
-
-
-
+
+
+
+
+
+
+
+
+ShowJarContents Class After Editing
+
+
+
+ShowJarContents Class After Editing
+
+package samples.ui.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
+import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
+import org.eclipse.rse.ui.SystemBasePlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * 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 implements IObjectActionDelegate {
+ private List _selectedFiles;
+
+ /**
+ * Constructor for ShowJarContents.
+ */
+ public ShowJarContents() {
+ _selectedFiles = new ArrayList();
+ }
+
+ protected Shell getShell() {
+ return SystemBasePlugin.getActiveWorkbenchShell();
+ }
+
+ protected IRemoteFile getFirstSelectedRemoteFile() {
+ if (_selectedFiles.size() > 0) {
+ return (IRemoteFile) _selectedFiles.get(0);
+ }
+ return null;
+ }
+
+ protected ISubSystem getSubSystem() {
+ return getFirstSelectedRemoteFile().getParentRemoteFileSubSystem();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IRemoteFile selectedFile = getFirstSelectedRemoteFile();
+ String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); //$NON-NLS-1$
+ try {
+ runCommand(cmdToRun);
+ } catch (Exception e) {
+ String excType = e.getClass().getName();
+ MessageDialog.openError(getShell(), excType, excType + ": " + e.getLocalizedMessage()); //$NON-NLS-1$
+ e.printStackTrace();
+ }
+ }
+
+ public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
+ //get the Command subsystem associated with the current host
+ IHost myHost = getSubSystem().getHost();
+ IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
+ for (int i = 0; i < subsys.length; i++) {
+ if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
+ return subsys[i];
+ }
+ }
+ return null;
+ }
+
+ public void runCommand(String command) throws Exception {
+ IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
+ if (cmdss != null && cmdss.isConnected()) {
+ // Run the command in a visible shell
+ RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
+ } else {
+ MessageDialog.openError(getShell(), "No command subsystem", "Found no command subsystem");
+ }
+ }
+
+ public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
+ _selectedFiles.clear();
+ // store the selected jars to be used when running
+ Iterator theSet = ((IStructuredSelection) selection).iterator();
+ while (theSet.hasNext()) {
+ Object obj = theSet.next();
+ if (obj instanceof IRemoteFile) {
+ _selectedFiles.add(obj);
+ }
+ }
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+}
+
+
+
Index: guide/tutorial/index.html
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/index.html,v
retrieving revision 1.1
diff -u -r1.1 index.html
--- guide/tutorial/index.html 4 Aug 2006 20:37:04 -0000 1.1
+++ guide/tutorial/index.html 12 Sep 2007 18:51:48 -0000
@@ -1 +1,21 @@
-
RSE Tutorials
Note: This page exists only to provide a root page for debugging the
tutorial and should not
be accessible from any page or the table of contents.
\ No newline at end of file
+
+
+
+
+
+
+
+ RSE Tutorials
+
+
+
+ Note: This page exists only to provide a root page for debugging the
+ tutorial and should not
+ be accessible from any page or the table of contents.
+
+
+
+
+
+
+
\ No newline at end of file
Index: guide/tutorial/DeveloperSubSystem.html
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/DeveloperSubSystem.html,v
retrieving revision 1.4
diff -u -r1.4 DeveloperSubSystem.html
--- guide/tutorial/DeveloperSubSystem.html 14 May 2007 09:43:48 -0000 1.4
+++ guide/tutorial/DeveloperSubSystem.html 12 Sep 2007 18:51:48 -0000
@@ -125,7 +125,7 @@
* @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(Object parent, String filterString, IProgressMonitor monitor)
+ protected Object[] internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor)
throws java.lang.reflect.InvocationTargetException,
java.lang.InterruptedException
{
Index: guide/tutorial/RSESamplesPlugin.html
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/RSESamplesPlugin.html,v
retrieving revision 1.4
diff -u -r1.4 RSESamplesPlugin.html
--- guide/tutorial/RSESamplesPlugin.html 19 Jun 2007 21:18:42 -0000 1.4
+++ guide/tutorial/RSESamplesPlugin.html 12 Sep 2007 18:51:48 -0000
@@ -11,7 +11,6 @@
RSESamplesPlugin Class
-
package rsesamples;
@@ -168,6 +167,6 @@
}
}
-
+