mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
initial population
This commit is contained in:
parent
76eaebbe41
commit
332aa4d488
904 changed files with 177047 additions and 0 deletions
13
rse/plugins/org.eclipse.rse.ui/.classpath
Normal file
13
rse/plugins/org.eclipse.rse.ui/.classpath
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="filters"/>
|
||||
<classpathentry kind="src" path="persistence"/>
|
||||
<classpathentry kind="src" path="references"/>
|
||||
<classpathentry kind="src" path="model"/>
|
||||
<classpathentry kind="src" path="UI"/>
|
||||
<classpathentry kind="src" path="subsystems"/>
|
||||
<classpathentry kind="src" path="systems"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
1
rse/plugins/org.eclipse.rse.ui/.cvsignore
Normal file
1
rse/plugins/org.eclipse.rse.ui/.cvsignore
Normal file
|
@ -0,0 +1 @@
|
|||
bin
|
28
rse/plugins/org.eclipse.rse.ui/.project
Normal file
28
rse/plugins/org.eclipse.rse.ui/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.eclipse.rse.ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
946
rse/plugins/org.eclipse.rse.ui/HelpContexts.xml
Normal file
946
rse/plugins/org.eclipse.rse.ui/HelpContexts.xml
Normal file
|
@ -0,0 +1,946 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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:
|
||||
{Name} (company) - description of contribution.
|
||||
-->
|
||||
<?NLS TYPE="org.eclipse.help.contexts"?>
|
||||
<contexts>
|
||||
|
||||
<!-- System types table in RS preferences -->
|
||||
<context id="systype_preferences">
|
||||
<description>Click in the columns to change the enablement state or default user ID for a given system type. Disabled system types do not appear in the New Connection wizard. Default user IDs are used when connecting to a remote system of that type.</description>
|
||||
</context>
|
||||
|
||||
<!-- Import wizard help -->
|
||||
<context id="import_context">
|
||||
<description>Import files from a remote server to a project on your local workstation.</description>
|
||||
<topic href="../org.eclipse.rse.doc.user/tasks/tremoimp.htm" label="Importing resources from a remote file system"/>
|
||||
</context>
|
||||
|
||||
<!-- Export wizard help -->
|
||||
<context id="export_context">
|
||||
<description>Export files from your local workstation to a folder on a remote server.</description>
|
||||
<topic href="../org.eclipse.rse.doc.user/tasks/tremoexp.htm" label="Exporting resources to a remote file system"/>
|
||||
</context>
|
||||
|
||||
<!-- PULLDOWN ACTION: New Connection action... -->
|
||||
<context id="actn0000">
|
||||
<description>Open a wizard to create a new connection to a remote system.</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: MoveUp Connection action...-->
|
||||
<context id="actn0001">
|
||||
<description>Move the selected connections up within its profile. This is disabled if the first connection is selected. Connection order is a local preference not shared by the team.</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: MoveDown Connection action...-->
|
||||
<context id="actn0002">
|
||||
<description>Move a connection down within its profile. This is disabled if the last connection is selected. Connection order is a local preference not shared by the team.</description>
|
||||
</context>
|
||||
|
||||
<!-- TEAM VIEW -->
|
||||
<context id="teamview">
|
||||
<description>Use this view to work with the team-sharable artifacts from the Remote System Explorer: connection, filters, user actions and compile commands. These are contained in profiles. Use this view to see the sharable artifacts by profile, and share those artifacts using the popup menu of the root node. </description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: New Profile action... -->
|
||||
<context id="actn0003">
|
||||
<description>Open a wizard to create a new profile for partitioning your connections, filters, user actions and compile commands.</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: Active profile action... -->
|
||||
<context id="actnactp">
|
||||
<description>Toggle this profile between active and not active. The Remote Systems view only shows connections, filters, user actions and compile commands from active profiles.
|
||||
</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: Make Active profile action... -->
|
||||
<context id="ActionMakeActive">
|
||||
<description>Make all the selected profiles active, such that their connections, filters, user actions and compile commands are visible in the Remote Systems view.
|
||||
</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: Make Inactive profile action... -->
|
||||
<context id="ActionMakeInactive">
|
||||
<description>Make all the selected profiles inactive, such that their connections, filters, user actions and compile commands are not visible in the Remote Systems view.
|
||||
</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
|
||||
<!-- TEAM VIEW ACTION: Rename profile action... -->
|
||||
<context id="actnrnpr">
|
||||
<description>Rename selected profile.
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</description>
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: Delete profiles action... -->
|
||||
<context id="actndlpr">
|
||||
<description>Delete selected profiles, including all of their connections, filters, user actions and compile commands.</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- TEAM VIEW ACTION: Duplicate profile action... -->
|
||||
<context id="actndupr">
|
||||
<description>Copy selected profile, including all its connections, filters, user actions and compile commands.
|
||||
</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
|
||||
<!-- PULLDOWN ACTION: Work with profiles action...-->
|
||||
<context id="actnwwpr">
|
||||
<description>Switch to the Team view, where you can create, delete, copy, rename and activate profiles</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/concepts/cprofile.htm" label="Remote System Explorer Profiles" />
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Qualify connections action...-->
|
||||
<context id="actn0008">
|
||||
<description>Show connections and filter pools in the Remote Systems view prefixed by profile name. This is recommended if two profiles have connections or filter pools with the same names.</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Reload-RSE action... -->
|
||||
<context id="actn0009">
|
||||
<description>Use this action after receiving Remote System Explorer files from the team repository, such as after a synchronize action. It reloads the contents of the Remote System Explore from the workspace, processing the new files.</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Default userID action... -->
|
||||
<context id="actn0010">
|
||||
<description>Set as the default user ID for a given system type when creating a new connection, or change it for existing connections that inherit the user ID.</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Preferences cascading action... -->
|
||||
<context id="actnpref">
|
||||
<description>Go directly to a preference page. Saves drilling down via Windows->Preferences.</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Preferences->RSE cascaded action... -->
|
||||
<context id="aprefrse">
|
||||
<description>Go directly to the main preference page for the Remote System Explorer. From there, you can also access the subpages.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Preferences->LPEX cascaded action... -->
|
||||
<context id="apreflpx">
|
||||
<description>Go directly to the main preference page for the LPEX editor. From there, you can also access the subpages. </description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Show filter pools action... -->
|
||||
<context id="actn0011">
|
||||
<description>Specify whether to show filter pools when subsystems are expanded in the Remote Systems view. Filter pools allow you to partition filters into named groups for easier management.</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Restore State action... -->
|
||||
<context id="aprefres">
|
||||
<description>Select this to restore the Remote Systems tree view to its previous expanded state the next time you start the workbench. Previous selections and active connections are also restored. This preference increases the amount of time needed to start the Remote System Explorer, but improves productivity overall since you do not need to reconfigure the view.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Team Synch action... -->
|
||||
<context id="actn0013">
|
||||
<description>All your connections, filters, and user-defined actions can be shared by your team. Use this to synchronize your latest changes with those of the team. Only valid if a team repository has been identified within the team properties.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Team Properties action... -->
|
||||
<context id="actn0014">
|
||||
<description>All your connections, filters, and user-defined actions can be shared by your team. Use this to identify the remote repository that will centrally host the Remote Systems Connections project containing all the Remote Systems information.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Create Another Connection action... -->
|
||||
<context id="actn0015">
|
||||
<description>Open a wizard to create a new connection to a remote system. By default, the values are used from the selected connection.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Open in New Perspective action... -->
|
||||
<context id="actn0016">
|
||||
<description>Open a new instance of the Remote Systems view, within its own perspective page. Its contents will start with those of the child of the selected resource.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Refresh action... -->
|
||||
<context id="actn0017">
|
||||
<description>Refresh the contents of the current selection. If the node is expanded, all children are re-retrieved successively.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Rename action... -->
|
||||
<context id="actn0018">
|
||||
<description>Open a dialog for renaming the currently selected resources.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Copy action... -->
|
||||
<context id="actn0019">
|
||||
<description>Copy this connection and resources to the same profile, or a different profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Move action... -->
|
||||
<context id="actn0020">
|
||||
<description>Move this connection to a different profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Delete action... -->
|
||||
<context id="actn0021">
|
||||
<description>Permanently delete the selected resources.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CONNECTION ACTION: Disconnect All action... -->
|
||||
<context id="actn0022"><description>Ask each subsystem to disconnect from the remote system. Disabled unless at least one subsystem is currently connected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: New Filter Pool action... -->
|
||||
<context id="actn0040"><description>Open a wizard to create a new filter pool in any profile, and a reference to the new pool in this subsystem.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: New Filter Pool Reference action... -->
|
||||
<context id="actn0041"><description>Add a reference to an existing filter pool to this subsystem. Multiple subsystems can reference the same pool, and subsystems can contain multiple filter pool references.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: New Filter action... -->
|
||||
<context id="actn0042"><description>Open a wizard to create a new filter in the selected or default filter pool.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- ACTION: Remote Servers cascading action... -->
|
||||
<context id="actnsrsv"><description>For remotely starting or stopping servers (or daemons) on this remote system.
|
||||
</description>
|
||||
</context>
|
||||
<!-- ACTION: Start action cascaded from an action underneath the Remote Servers cascading action... -->
|
||||
<context id="actnstsv"><description>Start this remote server or daemon.</description></context>
|
||||
<!-- ACTION: Stop action cascaded from an action underneath the Remote Servers cascading action... -->
|
||||
<context id="actnspsv"><description>Stop this remote server or daemon.</description></context>
|
||||
|
||||
<!-- SUBSYSTEM ACTION: Select Filter Pools action... -->
|
||||
<context id="actn0043"><description>Select the filter pools referenced by this subsystem.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: WorkWith Filter Pools action... -->
|
||||
<context id="actn0044"><description>Work with all filter pools in all active profiles for this subsystem type.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: WorkWith User Actions action... -->
|
||||
<context id="actn0045"><description>Work with user-defined actions that appear in the pop-up menu of remote system objects for subsystems of this subsystem type.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: Work With Named Types action... -->
|
||||
<context id="actn0046"><description>Work with named types that group one or more resource types into named collections.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: Connect action... -->
|
||||
<context id="actn0047"><description>Connect this subsystem's service to the remote system identified by the parent connection. This is disabled if already connected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: Disconnect action... -->
|
||||
<context id="actn0048"><description>Disconnect this subsystem's service from the remote system identified by the parent connection. This is disabled if not connected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: Clear Password Cache action... -->
|
||||
<context id="actn0049"><description>Clear the password retained in memory after this subsystem is disconnected. This is disabled if not connected, or there is no password cached in memory.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERPOOL ACTION: Copy action... -->
|
||||
<context id="actn0060"><description>Copy this filter pool, and all of its filters, to another profile, or copy and rename to the same profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERPOOL ACTION: Move action... -->
|
||||
<context id="actn0061"><description>Move this filter pool to another profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERPOOL ACTION: Remove Reference action... -->
|
||||
<context id="actn0062"><description>Remove this subsystem's reference to this filter pool. This action does not delete the filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERPOOL ACTION: Move Up action... -->
|
||||
<context id="actn0063"><description>Move the selected filter pool references up within this subsystem. This is disabled if first filter pool reference is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERPOOL ACTION: Move Down action... -->
|
||||
<context id="actn0064"><description>Move the selected filter pool references down within this subsystem. This is disabled if the last filter pool reference is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: New Filter String action... -->
|
||||
<context id="actn0080"><description>Open a wizard to create a new filter string within the selected filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: Change Filter action... -->
|
||||
<context id="acfr0000"><description>Change this filter by adding, editing, removing or re-ordering filter strings within it</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: New Filter String action... -->
|
||||
<context id="actn0082"><description>Copy the selected filters to a different filter pool, or copy and rename in the same pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: New Filter String action... -->
|
||||
<context id="actn0083"><description>Move the selected filters to a different filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: New Filter String action... -->
|
||||
<context id="actn0084"><description>Move the selected filters up within their filter. This is disabled if the first filter is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTER ACTION: New Filter String action... -->
|
||||
<context id="actn0085"><description>Move the selected filters down within their filter pool. This is disabled if the last filter is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERSTRING ACTION: Change action... -->
|
||||
<context id="actn0090"><description>Edit this filter string.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERSTRING ACTION: Copy action... -->
|
||||
<context id="actn0091"><description>Copy the selected filter strings to a different filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERSTRING ACTION: Move action... -->
|
||||
<context id="actn0092"><description>Move the selected filter strings to a different filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERSTRING ACTION: Move Up action... -->
|
||||
<context id="actn0093"><description>Move the selected filter strings up within their filter. This is disabled if the first filter string is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FILTERSTRING ACTION: Move Down action... -->
|
||||
<context id="actn0094"><description>Move the selected filter strings down within their filter. This is disabled if the last filter string is selected.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PROMPTABLE OBJECT ACTION: Run action... -->
|
||||
<context id="actn0100"><description>Run the selected prompt to open a wizard to create a new object. </description>
|
||||
</context>
|
||||
<!-- REMOTE FILE ACTION: Copy action... -->
|
||||
<context id="actn0110"><description>Copy the selected folders or files. You will be prompted for the target folder, and for a new name if a folder or file name is already in use in that target folder.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE FILE ACTION: Move action... -->
|
||||
<context id="actn0111"><description>Move the selected folders or files. You will be prompted for the target folder, and for a new name if a folder or file name is already in use in that target folder.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE FILE ACTION: New Filter From Folder action... -->
|
||||
<context id="actn0112"><description>Open a wizard to create a new filter from the selected folder.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SUBSYSTEM ACTION: Launch Shell action... -->
|
||||
<context id="actn0113"><description>Launch a command shell on the remote host. The Remote Shell view will allow you to interact with the remote shell.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE FILE ACTION: Run Command action... -->
|
||||
<context id="actn0114"><description>Run a command on the remote host. You will be prompted for the command to run on the host.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE FILE ACTION: Search action... -->
|
||||
<context id="actn0115"><description>Search files and file contents within the selected folder. You will be prompted with the Remote Search dialog.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Copy to clipboard action... -->
|
||||
<context id="actn0116"><description>Copy the selected resource to the system clipboard.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Paste from clipboard action... -->
|
||||
<context id="actn0117"><description>Paste the contents of the system clipboard into the selected resource.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Extract Archive action... -->
|
||||
<context id="actn0118"><description>Extract the selected archive's contents to the same folder in which the archive is located. A new folder will be created with the same name as the archive for the archive's contents.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Extract Archive To action... -->
|
||||
<context id="actn0119"><description>Extract the selected archive's contents to another folder. You will be prompted to select the destination folder.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Combine action... -->
|
||||
<context id="actn0120"><description>Combine the selected archives into a single archive. You will be prompted to create the destination archive.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Convert action... -->
|
||||
<context id="actn0121"><description>Convert the selected archives into another type of archive. You will be prompted to create the destination archive.
|
||||
</description>
|
||||
</context>
|
||||
<!-- REMOTE RESOURCE ACTION: Add to archive action... -->
|
||||
<context id="actn0122"><description>Add the selected files to a new or existing archive. You will be prompted to select or create the destination archive.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CASCADING COMPILE PROMPT ACTION: Compile -->
|
||||
<context id="ccpa0000"><description>Select a command to compile this resource with. The command will first be prompted, then run.
|
||||
</description></context>
|
||||
<!-- CASCADING COMPILE NOPROMPT ACTION: Compile -->
|
||||
<context id="ccna0000"><description>Select a command to compile this resource with. The command will be run without prompting.
|
||||
</description></context>
|
||||
<!-- SINGLE COMPILE ACTION: PROMPT... -->
|
||||
<context id="scpa0000"><description>Compile the selected resource with this compile command. The command is prompted first, then run.
|
||||
</description></context>
|
||||
<!-- SINGLE COMPILE ACTION: NO PROMPT... -->
|
||||
<context id="scna0000"><description>Compile the selected resource with this compile command. The command is not prompted.
|
||||
</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS ACTION... -->
|
||||
<context id="actnwwcc"><description>Work with commands for compiling selected resources.
|
||||
</description></context>
|
||||
|
||||
<!-- Duplicate Profile dialog... -->
|
||||
<context id="drnp0000">
|
||||
<description>Specify a new, unique name for the profile. Profiles can be unique to a person and specific to a task, such as <b>Release 1</b>.
|
||||
</description>
|
||||
</context>
|
||||
<context id="drnp0002"><description>Specify the name for the copied profile.
|
||||
</description>
|
||||
</context>
|
||||
<context id="drnp0003"><description>Specify if the new copied profile is to be made active. If active, its connections are visible.
|
||||
</description>
|
||||
</context>
|
||||
<!-- New Profile wizard... -->
|
||||
<context id="wnpr0000">
|
||||
<description>This wizard will guide you through the creation of a new profile to hold connections and filters. Profiles are folders that hold connections and filter pools. They enable team support by allowing you to decide which connections will be private and which will be shared. Team members only see connections within the profiles they make active.
|
||||
</description>
|
||||
</context>
|
||||
<context id="wnpr0001"><description>Specify a name for the profile. This might be a personal name that is unique within the team, or a name such as <b>Release 1</b>.
|
||||
</description>
|
||||
</context>
|
||||
<context id="wnpr0002"><description>If you do not make this profile active, its connections will not be visible. If you want to share the profile, inform other team members to make it active after team synchronization.
|
||||
</description>
|
||||
</context>
|
||||
<!-- New Connection wizard page 1 (name profile)... -->
|
||||
<context id="wncp0000">
|
||||
<description>This is your first connection. Connections are grouped into profiles to facilitate team sharing. Specify the name for your personal profile to contain connections unique to you. The default is your local machine hostname.
|
||||
</description>
|
||||
</context>
|
||||
<!-- New Connection wizard page 2 (connection properties)... -->
|
||||
<context id="wncc0000">
|
||||
<description>Specify the information needed to create a connection to a remote system.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0001"><description>Select a profile to contain this connection.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0002"><description>Arbitrary name for this connection. It must be unique to this profile.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0003"><description>Operating system type of the remote host.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0004"><description>Hostname or IP address of the remote host.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0005"><description>Default user ID that is used by subsystems that do not have a specific user ID. If the arrow is to the left, the user ID comes from the preferences settings for this system type, and can only be changed. Changing it affects all connections that inherit this user ID. If you toggle the arrow to the right, the user ID will be set locally for this connection and not inherited from the preferences setting.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ccon0006"><description>A brief description of the connection.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Default User Id dialog... -->
|
||||
<context id="ddid0000">
|
||||
<description>Set the default user ID for all connections to systems of the selected type. This can be overridden within a particular connection or connection subsystem.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Single Resource Rename dialog... -->
|
||||
<context id="drns0000">
|
||||
<description>Specify the new name for the selected resource.
|
||||
</description>
|
||||
</context>
|
||||
<context id="drns0001">
|
||||
<description>Indicate whether to overwrite the existing resource or specify a unique name.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- Single Profile Rename dialog... -->
|
||||
<context id="drnsprfl">
|
||||
<description>Specify the new name for the selected profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Multiple Resource Rename dialog... -->
|
||||
<context id="drnm0000">
|
||||
<description>Specify the new name for each of the selected resources. Use the <b>Tab</b> key to move to the next resource name.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Multiple Profile Rename dialog... -->
|
||||
<context id="drnmprfl">
|
||||
<description>Specify the new name for each of the selected profiles. Use the <b>Tab</b> key to move to the next profile name.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- Work With History dialog... -->
|
||||
<context id="dwwh0000">
|
||||
<description>Delete or re-order the items in the drop-down list. The items all represent previously-typed or selected values for this drop-down list.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Copy/Move Collision dialog... -->
|
||||
<context id="dccc0000">
|
||||
<description>Select the target profile. The connection's profile is preselected. If you select the existing parent profile, you will be asked to rename the connection.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Delete Confirmation dialog... -->
|
||||
<context id="ddlt0000">
|
||||
<description>Confirm that you want to delete the selected resources that are listed. Select <b>Delete</b> to confirm the deletion. Select <b>Cancel</b> if you decide not to delete the resources.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Delete Profile Confirmation dialog... -->
|
||||
<context id="ddltprfl">
|
||||
<description>Confirm that you want to delete the selected profiles that are listed, including their connections, filters and user actions. Select <b>Delete</b> to confirm the deletion. Select <b>Cancel</b> if you decide not to delete the profiles.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Copy Connection dialog... -->
|
||||
<context id="dccn0000">
|
||||
<description>Select the target profile. The connection's profile is preselected. If you select the existing parent profile, you will be asked to rename the connection.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Move Connection dialog... -->
|
||||
<context id="dmcn0000">
|
||||
<description>Select the target profile. The connection's profile is excluded.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Select Filter Pools dialog... -->
|
||||
<context id="dsfp0000">
|
||||
<description>Select the filter pools to reference in this subsystem. All filters from the referenced pools will be available when the subsystem is expanded.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Work With Filter Pools dialog... -->
|
||||
<context id="dwfp0000">
|
||||
<description>Create, delete, rename, copy, and move filter pools. The filter pools for each active profile are listed under that profile. Select a profile or filter pool to enable the toolbar actions. The actions are also available in the pop-up menu.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Copy Filter Pool dialog... -->
|
||||
<context id="dcfp0000">
|
||||
<description>Select the target profile. The filter pool's profile is preselected. If you select the existing parent profile, you will be asked to rename the filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Move Filter Pool dialog... -->
|
||||
<context id="dmfp0000">
|
||||
<description>Select the target profile. The filter pool's profile is excluded.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Copy Filter dialog... -->
|
||||
<context id="dcfr0000">
|
||||
<description>Select the target filter pool within a profile. If you select the existing parent filter pool, you will be asked to rename the filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Move Filter dialog... -->
|
||||
<context id="dmfr0000">
|
||||
<description>Select the target filter pool within a profile.
|
||||
</description>
|
||||
</context>
|
||||
<!-- CHANGE FILTER DIALOG... -->
|
||||
<context id="dufr0000">
|
||||
<description>Use this dialog to change your filter. Filters can contain one or more filter strings. In the Remote Systems view, when a filter is expanded, the results of resolving all the strings are concatenated together. Use this dialog to add additional strings, and to order, delete or change the strings. Use the context menu on a string for additional actions.</description>
|
||||
</context>
|
||||
<!-- CHANGE FILTER DIALOG ACTION: Delete... -->
|
||||
<context id="dufr1000"><description>Delete the selected filter string. You will be asked to confirm your action.</description></context>
|
||||
<!-- CHANGE FILTER DIALOG ACTION: Copy -->
|
||||
<context id="dufr2000"><description>Copy the selected filter string to the clipboard. The copy can be pasted to create a new filter string.</description></context>
|
||||
<!-- CHANGE FILTER DIALOG ACTION: Paste -->
|
||||
<context id="dufr3000"><description>Paste a copy of a filter string from the clipboard.</description></context>
|
||||
<!-- CHANGE FILTER DIALOG ACTION: Move Up -->
|
||||
<context id="dufr4000"><description>Move the selected filter string up in the list.</description></context>
|
||||
<!-- CHANGE FILTER DIALOG ACTION: Move Down -->
|
||||
<context id="dufr5000"><description>Move the selected filter string down in the list.</description></context>
|
||||
|
||||
<!-- Copy Filter String dialog... -->
|
||||
<context id="dcfs0000">
|
||||
<description>Select the target filter within a profile and filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Move Filter String dialog... -->
|
||||
<context id="dmfs0000">
|
||||
<description>Select the target filter within a profile and filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Commands View... -->
|
||||
<context id="cmdv0000">
|
||||
<description>This view shows the commands that have been run on remote systems, along with the resulting messages.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Connection Properties Page... -->
|
||||
<context id="pcon0000">
|
||||
<description>Browse or update information about the selected connection.
|
||||
</description>
|
||||
</context>
|
||||
<!-- SubSystem Properties Page... -->
|
||||
<context id="psub0000">
|
||||
<description>Browse or update information about the selected subsystem.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FilterPool Properties Page 1... -->
|
||||
<context id="pfp10000">
|
||||
<description>Browse information about the selected filter pool reference. Subsystems contain references to filter pools that physically exist within profiles. Multiple subsystems can reference the same filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FilterPool Properties Page 2... -->
|
||||
<context id="pfp20000">
|
||||
<description>Browse information about the filter pool being referenced. Subsystems contain references to filter pools that physically exist within profiles. Multiple subsystems can reference the same filter pool.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Filter Properties Page ... -->
|
||||
<context id="pflr0000">
|
||||
<description>Browse information about the selected filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- FilterString Properties Page 1... -->
|
||||
<context id="pfls0000">
|
||||
<description>Browse information about the selected filter string.</description>
|
||||
</context>
|
||||
<!-- New Filter Pool Wizard... -->
|
||||
<context id="wnfp0000">
|
||||
<description>Specify the name and parent profile for the new filter pool. Profiles own filter pools, while subsystems reference them.
|
||||
</description>
|
||||
</context>
|
||||
<!-- New Filter Wizard... -->
|
||||
<context id="wnfr0000">
|
||||
<description>Specify a unique name for the filter, and click <b>Add</b> to create one or more filter strings. When this filter is expanded, the filter strings will be resolved and the results listed in the tree.
|
||||
</description>
|
||||
</context>
|
||||
<context id="nfp20000">
|
||||
<description>On this page, specify a unique name for the filter, and whether it is unique for this connection or will appear in all applicable connections. For the latter, you also specify what filter pool to contain the filter.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Copy Remote Files Dialog... -->
|
||||
<context id="dcrf0000">
|
||||
<description>Select the folder where you want to copy the selected folders or files. The folder they exist in is pre-selected. If you leave this as the default, you will be prompted for new names for the copied folders and files.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Move Remote Files Dialog... -->
|
||||
<context id="dmrf0000">
|
||||
<description>Select the folder where you want to move the selected folders or files. The folder they exist in is pre-selected. If you leave this as the default, you will be prompted for new names for the moved folders and files.
|
||||
</description>
|
||||
</context>
|
||||
<context id="pwdp0000">
|
||||
<description>Specify the user ID and password used to log onto the remote system.
|
||||
</description>
|
||||
</context>
|
||||
<context id="rsep0000">
|
||||
<description>Specify the settings used by the Remote System Explorer.
|
||||
</description>
|
||||
</context>
|
||||
<context id="sysv0000">
|
||||
<description>This view lets you create connections to remote systems and work with them.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufwf0000">
|
||||
<description>This wizard will guide you through the creation of a new file.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufwr0000">
|
||||
<description>This wizard will guide you through the creation of a new folder.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufaf0000">
|
||||
<description>This command creates a new file.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufar0000">
|
||||
<description>This command creates a new folder resource.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufac0000">
|
||||
<description>This command copies an object to another location.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufam0000">
|
||||
<description>This command moves an object to another location.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ufpf0000">
|
||||
<description>Specify options for the Files System.
|
||||
</description>
|
||||
</context>
|
||||
<!-- ============================================ -->
|
||||
<!-- File filter string wizard, dialog, form... -->
|
||||
<!-- ============================================ -->
|
||||
<!-- New File Filter String Wizard... -->
|
||||
<context id="ffsw0000">
|
||||
<description>This wizard will guide you through the creation of a filter string for listing files.
|
||||
</description>
|
||||
</context>
|
||||
<!-- Update File Filter String Dialog... -->
|
||||
<context id="ffsd0000">
|
||||
<description>This dialog updates your filter string that are used for listing files.
|
||||
</description>
|
||||
</context>
|
||||
<!-- New/Update File Filter String controls... -->
|
||||
<context id="ffsd0001">
|
||||
<description> Type or select the fully-qualified folder of the files that you want to list.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0002">
|
||||
<description>Select this to list all files, or all files whose name meets a generic pattern.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0003">
|
||||
<description>Specify a simple file name or a generic name pattern, containing up to 2 wildcard characters <b>*</b>. For example, <b>abc*def*</b>. Specify <b>*</b> to list all files.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0004">
|
||||
<description>Select this to list all files that match one or more file types.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0005">
|
||||
<description>Click <b>Select</b> to choose one or more file types to restrict. Only files of the selected types will be shown for this filter string.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0006">
|
||||
<description>Select this to list only matching files within the given folder. Deselect this to list all folders within the given folder.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ffsd0007">
|
||||
<description>Select this to test the filter string and see the list of files that match its criteria.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Collapse-all action... -->
|
||||
<context id="actn0023">
|
||||
<description>Collapses all currently expanded resources in the Remote Systems view.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Collapse action... -->
|
||||
<context id="actn0024">
|
||||
<description>Collapses all selected resources in the view.
|
||||
</description>
|
||||
</context>
|
||||
<!-- PULLDOWN ACTION: Expand action... -->
|
||||
<context id="actn0025"><description>Expands all selected resources in the view.</description></context>
|
||||
|
||||
<!-- WORK WITH USER DEFINED ACTIONS DIALOG... -->
|
||||
<context id="wwua0000"><description>Use this dialog to create or edit user actions that appear in the User Actions pop-up menu for remote objects. Each active profile can contain unique actions, and all applicable actions from all active profiles are shown in the User Actions menu.
|
||||
The list on the left shows the existing user actions:
|
||||
- To <b>create</b> a new action, select the "New" node at the top of the list, enter information in the edit pane on the right, and press the <b>Create</b> button.
|
||||
- To <b>edit</b> an existing action, select the action in the list, update the information in the edit pane on the right, and press the <b>Apply</b> button.
|
||||
- To copy, paste, delete or re-order existing actions, use the pop-up menu.
|
||||
</description>
|
||||
<topic label="Working with user actions" href="../org.eclipse.rse.doc.user/tasks/tworkuseract.htm" />
|
||||
</context>
|
||||
|
||||
|
||||
<!-- WORK WITH NAMED TYPES DIALOG... -->
|
||||
<context id="wwnt0000"><description>Use this dialog to create or edit named types, which are named collections of resource types. These named types make it easier to identify resources which match one or more resource types.
|
||||
The list on the left shows the existing named types:
|
||||
- To <b>create</b> a new type, select the "New" node at the top of the list, enter information in the edit pane on the right, and press the <b>Create</b> button.
|
||||
- To <b>edit</b> an existing type, select the type in the list, update the information in the edit pane on the right, and press the <b>Apply</b> button.
|
||||
- To copy, paste, delete or re-order existing types, use the pop-up menu.
|
||||
IBM-supplied types cannot be edited, but you can create a new type based on them by using copy and paste.
|
||||
</description></context>
|
||||
<context id="wwnt0002"><description>Enter a comma-separated list of file extensions or file names. For file names that have no extension, such as "makefile", specify ".null" for the extension, as in "makefile.null".</description></context>
|
||||
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Delete... -->
|
||||
<context id="udad0000"><description>Delete the selected action or type. You will be asked to confirm your action.</description></context>
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Copy -->
|
||||
<context id="udac0000"><description>Copy the selected action or type to the clipboard.</description></context>
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Paste -->
|
||||
<context id="udap0000"><description>Paste an action or type from the clipboard. You will be asked for a new name.</description></context>
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Move Up -->
|
||||
<context id="udmu0000"><description>Move the selected action or type up in the list.</description></context>
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Move Down -->
|
||||
<context id="udmd0000"><description>Move the selected action or type down in the list.</description></context>
|
||||
<!-- USER DEFINED ACTIONS DIALOG ACTION: Restore Defaults -->
|
||||
<context id="udrd0000"><description>Restore the action or type to its values as originally supplied by IBM.</description></context>
|
||||
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG... -->
|
||||
<context id="wwcc0000"><description>Use this dialog to create or edit compile commands that appear in the Compile pop-up menu for remote resources. Each active profile can contain unique compile commands, and all applicable commands from all active profiles are shown in the Compile menu.
|
||||
The list on the left shows the existing compile commands:
|
||||
- To <b>create</b> a new compile command, select the "New" node at the top of the list, enter information in the edit pane on the right, and press the <b>Create</b> button.
|
||||
- To <b>edit</b> an existing compile command, select the command in the list, update the information in the edit pane on the right, and press the <b>Apply</b> button.
|
||||
- To copy, paste, delete or re-order existing compile commands, use the pop-up menu.
|
||||
</description>
|
||||
</context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Delete... -->
|
||||
<context id="wwcc1000"><description>Delete the selected compile command. You will be asked to confirm your action.</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Copy -->
|
||||
<context id="wwcc2000"><description>Copy the selected compile command to the clipboard. The copy can be pasted to create a new compile command.</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Paste -->
|
||||
<context id="wwcc3000"><description>Paste a copy of a compile command from the clipboard.</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Move Up -->
|
||||
<context id="wwcc4000"><description>Move the selected compile command up in the list.</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Move Down -->
|
||||
<context id="wwcc5000"><description>Move the selected compile command down in the list.</description></context>
|
||||
<!-- WORK WITH COMPILE COMMANDS DIALOG ACTION: Restore Defaults -->
|
||||
<context id="wwcc6000"><description>Restore the compile command to its values as originally supplied by IBM.</description></context>
|
||||
|
||||
<!-- Save password dialogs -->
|
||||
<context id="pwdi0000">
|
||||
<description>Use the password information preference page to add, change, and remove stored passwords for remote systems. The stored passwords are used whenever a password is required to connect to the remote system.</description>
|
||||
<topic label="Changing your saved password for a remote host connection" href="../org.eclipse.rse.doc.user/tasks/tbeginpass.htm" />
|
||||
</context>
|
||||
<context id="pwdi0001">
|
||||
<description>Type the password information for the remote system and click <b>OK</b> to save the information or <b>Cancel</b> to exit without saving.</description>
|
||||
<topic label="Changing your saved password for a remote host connection" href="../org.eclipse.rse.doc.user/tasks/tbeginpass.htm" />
|
||||
</context>
|
||||
<context id="pwdi0002">
|
||||
<description>Modify the saved password information for the remote system and click <b>OK</b> to update the saved information or <b>Cancel</b> to exit without updating.</description>
|
||||
<topic label="Changing your saved password for a remote host connection" href="../org.eclipse.rse.doc.user/tasks/tbeginpass.htm" />
|
||||
</context>
|
||||
|
||||
<!-- SubSystem property page -->
|
||||
<context id="psubs0000">
|
||||
<description>Use the subsystem property page to see and edit common information about the subsystem:
|
||||
<b>Vendor:</b> - the company who created this subsystem
|
||||
<b>Name:</b> - the name of this subsystem, as shown in the Remote Systems view
|
||||
<b>Parent connection:</b> - the connection that owns this subsystem
|
||||
<b>Parent profile:</b> - the system profile that owns the connection
|
||||
<b>Port:</b> - the port used for the communication between this client, and the remote server for this subsystem
|
||||
<b>User ID:</b> - the user ID to use to signon to the remote server
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- Environment variables property page -->
|
||||
<context id="envv0000">
|
||||
<description>Use the environment variables property page to specify environment variables for the remote system. These environment variables will be set when the remote system is connected. Any changes made to the environment variables while connected, will not be set on the remote system until it is disconnected and reconnected.</description>
|
||||
</context>
|
||||
<context id="envv0001">
|
||||
<description>Type the name and value for the new environment variable. Click <b>OK</b> to add the new environment variable or <b>Cancel</b> to exit without adding it.</description>
|
||||
</context>
|
||||
<context id="envv0002">
|
||||
<description>Modify the name or value for the environment variable. Click <b>OK</b> to update the existing environment variable or <b>Cancel</b> to exit without modifying.</description>
|
||||
</context>
|
||||
|
||||
<!-- Server launcher property page -->
|
||||
<context id="srln0000">
|
||||
<description>Use the server launcher settings property page to specify how to connect to a remote server on the remote system. To connect to a remote Linux, Unix or Windows host you must first install the Remote System Explorer server on the remote host.</description>
|
||||
<topic label="Connecting to a remote Linux or UNIX host" href="../org.eclipse.rse.doc.user/tasks/tbeginlinux.htm" />
|
||||
<topic label="Connecting to a remote Windows host" href="../org.eclipse.rse.doc.user/tasks/tbeginwindows.htm" />
|
||||
</context>
|
||||
<context id="srln0001">
|
||||
<description>Indicate that a connection should be established with a server on the remote system using the remote daemon to start the server. To use this option, the remote daemon must be running on the remote system.</description>
|
||||
</context>
|
||||
<context id="srln0002">
|
||||
<description>Indicate that a connection should be established with a server on the remote system using the REXEC service to start the server. To use this option, the REXEC service must be running on the remote system.</description>
|
||||
</context>
|
||||
<context id="srln0003">
|
||||
<description>Indicate that a connection should be established with a server that is already running on some known port. To use this option, the server needs to be started up before attempting to connect in the Remote System Explorer.</description>
|
||||
</context>
|
||||
<context id="srln0004">
|
||||
<description>Specify the location of the server installed on the host. REXEC uses this location to determine where to run the startup script from.</description>
|
||||
</context>
|
||||
<context id="srln0005">
|
||||
<description>Specify the name of the command or script that REXEC needs to run to invoke the server installed on the host.</description>
|
||||
</context>
|
||||
|
||||
|
||||
|
||||
<!-- Installing remote server -->
|
||||
<context id="rsrv0000">
|
||||
<description>To connect to a remote Linux, Unix or Windows host you must first install the Remote System Explorer server on the remote host.</description>
|
||||
<topic label="Connecting to a remote Linux or UNIX host" href="../org.eclipse.rse.doc.user/tasks/tbeginlinux.htm" />
|
||||
<topic label="Connecting to a remote Windows host" href="../org.eclipse.rse.doc.user/tasks/tbeginwindows.htm" />
|
||||
</context>
|
||||
|
||||
|
||||
<!-- Universal Command Dialog -->
|
||||
<context id="cmdi0000">
|
||||
<description>Specify a command to run on the remote system.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote Search Dialog -->
|
||||
<context id="rsdi0000">
|
||||
<description>Specify a search string and optionally limit the search to a subset of files by specifying file name patterns. Leave the search string empty to search for files only.</description>
|
||||
<topic label="Search for text and files on remote servers" href="../org.eclipse.rse.doc.user/tasks/tmanagesearch.htm"/>
|
||||
</context>
|
||||
<context id="rsac0000">
|
||||
<description>Opens Remote Search dialog page for text and file searching on remote systems.</description>
|
||||
</context>
|
||||
|
||||
<!-- Extract To Dialog -->
|
||||
<context id="exdi0000">
|
||||
<description>Specify the name and location of a new folder which will be created to hold the extracted contents of the archive.</description>
|
||||
</context>
|
||||
|
||||
<!-- Combine Dialog -->
|
||||
<context id="cmbd0000">
|
||||
<description>Specify the name, type and location of a new file which will be created to hold the combined archives.</description>
|
||||
</context>
|
||||
|
||||
<!-- Convert Dialog -->
|
||||
<context id="cnvd0000">
|
||||
<description>Specify the name, type and location of the file to which the archive will be converted.</description>
|
||||
</context>
|
||||
|
||||
<!-- Add to Archive Dialog -->
|
||||
<context id="atad0000">
|
||||
<description>Specify the name, type and location of the archive file to which the selected files will be added.</description>
|
||||
</context>
|
||||
|
||||
<!-- Generic Position To Dialog -->
|
||||
<context id="gnpt0000">
|
||||
<description>Specify a name filter to use in locating objects in the view.</description>
|
||||
</context>
|
||||
|
||||
<!-- Generic Subset Dialog -->
|
||||
<context id="gnss0000">
|
||||
<description>Specify a set of property filters to use as criteria in populating the table.</description>
|
||||
</context>
|
||||
|
||||
<!-- Generic Table Customization Dialog -->
|
||||
<context id="gntc0000">
|
||||
<description>Specify the list of columns and the order in which to display them in the table.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote System Details View -->
|
||||
<context id="sysd0000">
|
||||
<description>This view lets you view the contents and properties of remote objects.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote Search View -->
|
||||
<context id="srch0000">
|
||||
<description>This view shows you the results of a remote file search.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote Shell View -->
|
||||
<context id="ucmd0000">
|
||||
<description>This view allows you to run and view shell commands.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote Scratchpad View -->
|
||||
<context id="scrp0000">
|
||||
<description>Drag and drop objects here from other Remote Systems Explorer views to work with them in isolation.</description>
|
||||
</context>
|
||||
|
||||
<!-- Remote Error List View -->
|
||||
<context id="uerr0000">
|
||||
<description>This view shows you errors, warnings and informational messages resulting from a compile command.</description>
|
||||
</context>
|
||||
|
||||
<!-- Save Conflict Dialog -->
|
||||
<context id="scdl0000">
|
||||
<description>You are about to save your changes to a file on the remote system that has been modified since you started editing. Choose whether you want to overwrite the remote file, replace your changes with those of the file on the remote system, save your changes to another remote file or cancel the save.</description>
|
||||
</context>
|
||||
|
||||
<!-- Local Changes Pending Dialog -->
|
||||
<context id="lcdl0000">
|
||||
<description>You have made changes to this file during a previous editing session that have not been saved on the remote system. If you open the remote file, you will lose all pending changes. Choose whether you want to replace your changes with the remote file, keep your changes or cancel the operation. You will be able to save your file to a different location without overwriting the remote file if you choose to keep your pending changes.</description>
|
||||
</context>
|
||||
|
||||
<context id="ecth0000">
|
||||
<description>Select this option to enable the help to work in the CODE tools, and VisualAge RPG tools. It uncompresses the html help files for these tools.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- General RSE communications preference page -->
|
||||
<context id="cmmp0000">
|
||||
<description>This is the RSE communications preferences page. These preferences are not specific to any single RSE connection. The <b>RSE communications daemon</b> can be used by local Workbench functions to listen for incoming socket requests from remote systems. The daemon can be started and stopped from the pull down menu in the RSE's Remote Systems view.
|
||||
|
||||
Use the start RSE communications daemon checkbox to automatically start the daemon when the Workbench is started.
|
||||
|
||||
Use the port preference to change which local TCP/IP port the daemon uses to listen for incoming requests. A valid TCP/IP port number must be entered. If the port is changed and the daemon is currently running then the daemon will be stopped and restarted on the new port when the preference page is closed.</description>
|
||||
</context>
|
||||
|
||||
<!-- file cache preference page -->
|
||||
<context id="fchp0000">
|
||||
<description>This is the RSE file cache preference page.
|
||||
|
||||
Use this page to limit the amount of disk space used to store locally replicated remote files.
|
||||
|
||||
Use the clear button to remove all cached files.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
<!-- RSE Communications daemon action -->
|
||||
<context id="dmna0000">
|
||||
<description>This action starts and stops the local Remote System Explorer (RSE) communications daemon. This daemon is not directly used by individual RSE connections. Instead it allows local Workbench functions to accept incoming socket requests from remote systems. You can set the daemon to automatically start and configure the port used by the daemon in the Workbench preferences under Remote Systems->Communications.</description>
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/reference/rports.htm" label="Port information for Development Studio Client" />
|
||||
<topic href="..com.ibm.etools.iseries.rse.doc/reference/rprefcom.htm" label="Preferences: communications" />
|
||||
</context>
|
||||
|
||||
<!-- Work offline support -->
|
||||
<context id="wofa0000">
|
||||
<description>The Work Offline action toggles the connection between offline and online modes. In offline mode information is retrieved from the cache if available and supported by the connection type. If the action currently has a check mark beside it then the connection is offline and selecting this action will put the connection in online mode so it can be connected to the remote system.</description>
|
||||
</context>
|
||||
<context id="wofp0000">
|
||||
<description>Select the Work Offline property to set the connection offline. In offline mode the connection cannot be connected to the remote system. Information is retrieved from the cache if available and supported by the connection type.</description>
|
||||
</context>
|
||||
|
||||
<!-- SSL support -->
|
||||
<context id="ssls0000">
|
||||
<description>This is the RSE SSL preference page.
|
||||
From here you can manage the certificates that the RSE client uses when connecting to a server that is configured to use SSL.
|
||||
</description>
|
||||
</context>
|
||||
<context id="ssls0001">
|
||||
<description>Use the server connection security property page to indicate whether the server you are connecting to is running in SSL mode.
|
||||
</description>
|
||||
</context>
|
||||
|
||||
</contexts>
|
56
rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF
Normal file
56
rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,56 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %plugin.name
|
||||
Bundle-SymbolicName: org.eclipse.rse.ui;singleton:=true
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Activator: org.eclipse.rse.core.SystemPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.rse.services,
|
||||
org.eclipse.rse.logging,
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.jface.text,
|
||||
org.eclipse.ui.views,
|
||||
org.eclipse.ui.forms,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.debug.ui,
|
||||
org.eclipse.ui.workbench.texteditor
|
||||
Eclipse-LazyStart: true
|
||||
Export-Package: org.eclipse.rse.core,
|
||||
org.eclipse.rse.core.comm,
|
||||
org.eclipse.rse.core.internal.subsystems,
|
||||
org.eclipse.rse.core.servicesubsystem,
|
||||
org.eclipse.rse.core.subsystems,
|
||||
org.eclipse.rse.core.subsystems.util,
|
||||
org.eclipse.rse.filters,
|
||||
org.eclipse.rse.internal.filters,
|
||||
org.eclipse.rse.internal.model,
|
||||
org.eclipse.rse.internal.persistence,
|
||||
org.eclipse.rse.internal.persistence.dom,
|
||||
org.eclipse.rse.internal.references,
|
||||
org.eclipse.rse.model,
|
||||
org.eclipse.rse.persistence,
|
||||
org.eclipse.rse.persistence.dom,
|
||||
org.eclipse.rse.references,
|
||||
org.eclipse.rse.ui,
|
||||
org.eclipse.rse.ui.actions,
|
||||
org.eclipse.rse.ui.dialogs,
|
||||
org.eclipse.rse.ui.filters,
|
||||
org.eclipse.rse.ui.filters.actions,
|
||||
org.eclipse.rse.ui.filters.dialogs,
|
||||
org.eclipse.rse.ui.messages,
|
||||
org.eclipse.rse.ui.open,
|
||||
org.eclipse.rse.ui.operations,
|
||||
org.eclipse.rse.ui.propertypages,
|
||||
org.eclipse.rse.ui.validators,
|
||||
org.eclipse.rse.ui.view,
|
||||
org.eclipse.rse.ui.view.monitor,
|
||||
org.eclipse.rse.ui.view.scratchpad,
|
||||
org.eclipse.rse.ui.view.search,
|
||||
org.eclipse.rse.ui.view.team,
|
||||
org.eclipse.rse.ui.widgets,
|
||||
org.eclipse.rse.ui.widgets.services,
|
||||
org.eclipse.rse.ui.wizards
|
||||
Bundle-Vendor: Eclipse.org
|
||||
Bundle-ClassPath: systems.jar
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,40 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
//import org.eclipse.ui.views.properties.*;
|
||||
|
||||
/**
|
||||
* In order to populate the PropertySheet, an object must implement the
|
||||
* IAdaptable interface. Thus, this is the minimum requirement for any
|
||||
* object that we wish to represent in a tree or table viewer. We simply
|
||||
* defer the request for an adapter to the platform, assuming that the
|
||||
* adapter has been registered with it.
|
||||
*/
|
||||
public class AbstractElement implements IAdaptable
|
||||
{
|
||||
|
||||
/**
|
||||
* @see IAdaptable#getAdapter(Class)
|
||||
*/
|
||||
public Object getAdapter(Class adapterType)
|
||||
{
|
||||
return Platform.getAdapterManager().getAdapter(this, adapterType);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/********************************************************************************
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class GenericMessages extends NLS
|
||||
{
|
||||
private static String BUNDLE_NAME = "org.eclipse.rse.ui.GenericMessages";//$NON-NLS-1$
|
||||
|
||||
public static String ResourceNavigator_goto;
|
||||
|
||||
public static String RefreshAction_text;
|
||||
public static String RefreshAction_toolTip;
|
||||
public static String RefreshAction_progressMessage;
|
||||
public static String RefreshAction_problemTitle;
|
||||
public static String RefreshAction_problemMessage;
|
||||
public static String RefreshAction_locationDeletedMessage;
|
||||
public static String RefreshAction_dialogTitle;
|
||||
|
||||
public static String DragAndDropOperation_message;
|
||||
public static String RSESubSystemOperation_message;
|
||||
public static String RSESubSystemOperation_Connect_message;
|
||||
public static String RSESubSystemOperation_Disconnect_message;
|
||||
public static String RSESubSystemOperation_Get_properties_message;
|
||||
public static String RSESubSystemOperation_Get_property_message;
|
||||
public static String RSESubSystemOperation_Resolve_filter_strings_message;
|
||||
public static String RSESubSystemOperation_Set_properties_message;
|
||||
public static String RSESubSystemOperation_Set_property_message;
|
||||
public static String RSESubSystemOperation_Notifying_registry_message;
|
||||
|
||||
// ==============================================================================
|
||||
// Property Pages
|
||||
// ==============================================================================
|
||||
public static String PropertyDialog_messageTitle;
|
||||
public static String PropertyDialog_noPropertyMessage;
|
||||
public static String PropertyDialog_propertyMessage;
|
||||
|
||||
// ==============================================================================
|
||||
// Editor Framework
|
||||
// ==============================================================================
|
||||
public static String EditorManager_saveResourcesMessage;
|
||||
public static String EditorManager_saveResourcesTitle;
|
||||
|
||||
public static String TypesFiltering_title;
|
||||
public static String TypesFiltering_message;
|
||||
public static String TypesFiltering_otherExtensions;
|
||||
public static String TypesFiltering_typeDelimiter;
|
||||
|
||||
|
||||
public static String FileExtension_extensionEmptyMessage;
|
||||
public static String FileExtension_fileNameInvalidMessage;
|
||||
public static String FilteredPreferenceDialog_PreferenceSaveFailed;
|
||||
|
||||
static {
|
||||
// load message values from bundle file
|
||||
NLS.initializeMessages(BUNDLE_NAME, GenericMessages.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
################################################################################
|
||||
# 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:
|
||||
# {Name} (company) - description of contribution.
|
||||
################################################################################
|
||||
|
||||
ResourceNavigator_goto = Goto
|
||||
|
||||
RefreshAction_text = Re&fresh
|
||||
RefreshAction_toolTip = Refresh
|
||||
RefreshAction_progressMessage = Refreshing...
|
||||
RefreshAction_problemTitle = Refresh Problems
|
||||
RefreshAction_problemMessage = Problems occurred refreshing the selected resources.
|
||||
RefreshAction_locationDeletedMessage = The location for project ''{0}'' ({1}) has been deleted.\n Delete ''{0}'' from the workspace?
|
||||
RefreshAction_dialogTitle = Project location has been deleted
|
||||
|
||||
EditorManager_saveResourcesMessage = Select the &resources to save:
|
||||
EditorManager_saveResourcesTitle = Save Resources
|
||||
|
||||
# ==============================================================================
|
||||
# Editors
|
||||
# ==============================================================================
|
||||
|
||||
TypesFiltering_title = Select Types
|
||||
TypesFiltering_message = Reduce selection to only files of &type(s):
|
||||
TypesFiltering_otherExtensions = &Other Extensions:
|
||||
TypesFiltering_typeDelimiter = ,
|
||||
|
||||
FileExtension_extensionEmptyMessage = The file extension cannot be empty
|
||||
FileExtension_fileNameInvalidMessage = The file name cannot include the wild card character (*) in the current location
|
||||
FilteredPreferenceDialog_PreferenceSaveFailed=Preferences save failed.
|
||||
|
||||
DragAndDropOperation_message = Drag and Drop Operation
|
||||
RSESubSystemOperation_message = RSE SubSystem Operation:
|
||||
RSESubSystemOperation_Connect_message = Connect
|
||||
RSESubSystemOperation_Disconnect_message = Disconnect
|
||||
RSESubSystemOperation_Get_properties_message = Get properties
|
||||
RSESubSystemOperation_Get_property_message = Get property
|
||||
RSESubSystemOperation_Resolve_filter_strings_message = Resolve filter strings
|
||||
RSESubSystemOperation_Set_properties_message = Set properties
|
||||
RSESubSystemOperation_Set_property_message = Set property
|
||||
RSESubSystemOperation_Notifying_registry_message = Notifying registry of connection status change...
|
||||
|
||||
PropertyDialog_messageTitle = Properties
|
||||
PropertyDialog_noPropertyMessage Properties
|
||||
PropertyDialog_propertyMessage = Properties for {0}
|
|
@ -0,0 +1,67 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This interface is used by the remote object selection dialogs when Add mode is enabled.
|
||||
* <p>
|
||||
* This interface allows you to listen generically for selection events on any remote object,
|
||||
* and be called when the user selects something or presses. You can use instanceof to
|
||||
* decide what was selected.
|
||||
* <p>
|
||||
* If you call the enableAddButton method you must pass an object that implements this interface.
|
||||
* The dialog will call you back when the user presses the Add button, so you can take
|
||||
* appropriate action.
|
||||
*/
|
||||
public interface IRemoteSelectionAddListener
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* The user has selected a remote object. Is this object valid to be added?
|
||||
* If so, return null. If not, return a string to display on the
|
||||
* message line indicating why it is not valid, such as it already has
|
||||
* been added.
|
||||
*
|
||||
* @param selectedConnection The connection the object was selected in
|
||||
* @param selectedObjects Will be a list of objects such as AS400Library or IRemoteFile. They are
|
||||
* resolved so that the remote adapter is not required.
|
||||
*
|
||||
* @return A String or SystemMessage object that will be displayed if the
|
||||
* action fails, null if the action was successfull
|
||||
*/
|
||||
public Object okToEnableAddButton(IHost selectedConnection, Object[] selectedObjects);
|
||||
|
||||
/**
|
||||
* The user has pressed the Add button.
|
||||
* Do something appropriate with the request.
|
||||
* If this action fails for some reason, or you wish to display a completion
|
||||
* message, return message text that will be displayed in the dialog's message
|
||||
* line. Else, return null.
|
||||
*
|
||||
* @param selectedConnection The connection the object was selected in
|
||||
* @param selectedObjects Will be a list of objects such as AS400Library or IRemoteFile. They are
|
||||
* resolved so that the remote adapter is not required.
|
||||
*
|
||||
* @return A String or SystemMessage object that will be displayed if the
|
||||
* action fails, null if the action was successfull
|
||||
*/
|
||||
public Object addButtonPressed(IHost selectedConnection, Object[] selectedObjects);
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* Interface that any UI that uses the SystemConnectionForm must implement
|
||||
*/
|
||||
public interface ISystemConnectionFormCaller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Event: the user has selected a system type.
|
||||
* @param systemType the type of system selected
|
||||
* @param duringInitialization true if this is being set at page initialization time versus selected by the user
|
||||
*/
|
||||
public void systemTypeSelected(String systemType, boolean duringInitialization);
|
||||
/**
|
||||
* Return the shell hosting this form
|
||||
*/
|
||||
public Shell getShell();
|
||||
|
||||
}
|
|
@ -0,0 +1,296 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.ui.IWorkbenchActionConstants;
|
||||
/**
|
||||
* Constants defining our groups inside our right-click popup menu in the system view.
|
||||
* <pre><code>
|
||||
* // simply sets partitions in the menu, into which actions can be directed.
|
||||
* // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_NEW)); // new->
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GOTO)); // goto into, go->
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_EXPANDTO)); // expand to->
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_EXPAND)); // expand, collapse
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPEN)); // open xxx
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_OPENWITH)); // open with->
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_BROWSEWITH)); // open with->
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_WORKWITH)); // work with->
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_BUILD)); // build, rebuild, refresh
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_CHANGE)); // update, change
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORGANIZE)); // rename,move,copy,delete,bookmark,refactoring
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_REORDER)); // move up, move down
|
||||
* menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_GENERATE)); // getters/setters, etc. Typically in editor
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_SEARCH)); // search
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_CONNECTION)); // connection-related actions
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_IMPORTEXPORT)); // get or put actions
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADAPTERS)); // actions queried from adapters
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_TEAM)); // Team
|
||||
* menu.add(new Separator(ISystemContextMenuConstants.GROUP_PROPERTIES)); // Properties
|
||||
* </code></pre>
|
||||
*/
|
||||
public interface ISystemContextMenuConstants
|
||||
{
|
||||
/**
|
||||
* Pop-up menu: name of group for goto actions (value <code>"group.goto"</code>).
|
||||
* <p>
|
||||
* Examples for open actions are:
|
||||
* <ul>
|
||||
* <li>Go Into</li>
|
||||
* <li>Go To</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_GOTO= "group.goto";
|
||||
/**
|
||||
* ID of the submenu for "Go To->"
|
||||
*/
|
||||
public static final String MENU_GOTO= "menu.goto";
|
||||
/**
|
||||
* ID of the submenu for "Preferences->"
|
||||
*/
|
||||
public static final String MENU_PREFERENCES= "menu.preferences";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for open-with actions (value <code>"group.openwith"</code>).
|
||||
* <p>
|
||||
* Examples for open-with actions are:
|
||||
* <ul>
|
||||
* <li>Open With->Editor</li>
|
||||
* <li>Open With->Designer</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_OPENWITH= "group.openwith";
|
||||
/**
|
||||
* ID of the submenu for "Open With->"
|
||||
*/
|
||||
public static final String MENU_OPENWITH= "menu.openwith";
|
||||
|
||||
/**
|
||||
* Group name for the "Browse With" submenu
|
||||
*/
|
||||
public static final String GROUP_BROWSEWITH= "group.browsewith";
|
||||
|
||||
/**
|
||||
* Group name for the "Compare With" submenu
|
||||
*/
|
||||
public static final String GROUP_COMPAREWITH= "group.comparewith";
|
||||
|
||||
/**
|
||||
* Group name for the "Replace With" submenu
|
||||
*/
|
||||
public static final String GROUP_REPLACEWITH= "group.replacewith";
|
||||
|
||||
/**
|
||||
* ID for "Browse With" submenu
|
||||
*/
|
||||
public static final String MENU_BROWSEWITH = "menu.browsewith";
|
||||
|
||||
/**
|
||||
* ID for "Compare With" submenu
|
||||
*/
|
||||
public static final String MENU_COMPAREWITH = "menu.comparewith";
|
||||
|
||||
/**
|
||||
* ID for "Compare With" submenu
|
||||
*/
|
||||
public static final String MENU_REPLACEWITH = "menu.replacewith";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for expand actions (value <code>"group.expand"</code>).
|
||||
*/
|
||||
public static final String GROUP_EXPAND = "group.expand";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for expand-to cascading actions (value <code>"group.expandto"</code>).
|
||||
*/
|
||||
public static final String GROUP_EXPANDTO= "group.expandto";
|
||||
/**
|
||||
* ID of the submenu for "Expand to->"
|
||||
*/
|
||||
public static final String MENU_EXPANDTO= "menu.expandto";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for open-to actions (value <code>"group.opento"</code>).
|
||||
* <p>
|
||||
* Examples for open-to actions are:
|
||||
* <ul>
|
||||
* <li>Open To->Navigator</li>
|
||||
* <li>Open To->iSeries Navigator</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_OPENTO= "group.opento";
|
||||
/**
|
||||
* ID of the submenu for "Open To->"
|
||||
*/
|
||||
public static final String MENU_OPENTO= "menu.opento";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for work-with actions (value <code>"group.workwith"</code>).
|
||||
* <p>
|
||||
* Examples for work-with actions are:
|
||||
* <ul>
|
||||
* <li>Work with->Filter Pools...</li>
|
||||
* <li>Work with->User Actions...</li>
|
||||
* <li>Work with->File Types...</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_WORKWITH= "group.workwith";
|
||||
/**
|
||||
* ID of the submenu for "Work Work->"
|
||||
*/
|
||||
public static final String MENU_WORKWITH= "menu.workwith";
|
||||
/**
|
||||
* Pop-up menu: name of group for open actions (value <code>"group.open"</code>).
|
||||
* <p>
|
||||
* Examples for open actions are:
|
||||
* <ul>
|
||||
* <li>Open To</li>
|
||||
* <li>Open With</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_OPEN= "group.open";
|
||||
/**
|
||||
* Pop-up menu: name of group for show actions (value <code>"group.show"</code>).
|
||||
* <p>
|
||||
* Examples for show actions are:
|
||||
* <ul>
|
||||
* <li>Show in Navigator</li>
|
||||
* <li>Show in Type Hierarchy</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_SHOW= "group.show";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for new actions (value <code>"group.new"</code>).
|
||||
* This is a cascading group.
|
||||
* <p>
|
||||
* Examples for new actions are:
|
||||
* <ul>
|
||||
* <li>Create new filter</li>
|
||||
* <li>Create new folder</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_NEW= "group.new";
|
||||
/**
|
||||
* ID of the submenu for "New->"
|
||||
*/
|
||||
public static final String MENU_NEW= "menu.new";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for new actions (value <code>"group.new.noncascade"</code>).
|
||||
* This is a non-cascading group.
|
||||
* <p>
|
||||
* This is used in the Team view
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_NEW_NONCASCADING="group.new.noncascade";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for build actions (value <code>"group.build"</code>).
|
||||
*/
|
||||
public static final String GROUP_BUILD= "group.build";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for reorganize actions (value <code>"group.reorganize"</code>).
|
||||
*/
|
||||
public static final String GROUP_REORGANIZE= "group.reorganize";
|
||||
/**
|
||||
* Pop-up menu: name of group for reorder actions like move up/down(value <code>"group.reorder"</code>).
|
||||
*/
|
||||
public static final String GROUP_REORDER= "group.reorder";
|
||||
/**
|
||||
* Pop-up menu: name of group for CHANGE actions. (value <code>"group.change"</code>).
|
||||
* <p>
|
||||
* Examples for change actions are:
|
||||
* <ul>
|
||||
* <li>Change...</li>
|
||||
* <li>Update...</li>
|
||||
* </ul>
|
||||
* SHould you even have a change action? Maybe it should be a PropertyPage instead!
|
||||
* </p>
|
||||
*/
|
||||
public static final String GROUP_CHANGE = "group.change";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for code generation or refactoring actions (
|
||||
* value <code>"group.generate"</code>).
|
||||
*/
|
||||
public static final String GROUP_GENERATE= "group.generate";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for search actions (value <code>"group.search"</code>).
|
||||
*/
|
||||
public static final String GROUP_SEARCH= "group.search";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for additional actions (value <code>"group.additions"</code>).
|
||||
*/
|
||||
public static final String GROUP_ADDITIONS= IWorkbenchActionConstants.MB_ADDITIONS; //"additions";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for viewer setup actions (value <code>"group.viewerSetup"</code>).
|
||||
*/
|
||||
public static final String GROUP_VIEWER_SETUP= "group.viewerSetup";
|
||||
|
||||
/**
|
||||
* Pop-up menu: name of group for properties actions (value <code>"group.properties"</code>).
|
||||
*/
|
||||
public static final String GROUP_PROPERTIES= "group.properties";
|
||||
/**
|
||||
* Pop-up menu: name of group for actions contributed by the adaptors for the selected object, which
|
||||
* are related to the live connection.
|
||||
*/
|
||||
public static final String GROUP_CONNECTION= "group.connection";
|
||||
/**
|
||||
* Pop-up menu: name of group for actions related to getting and putting the selected object.
|
||||
*/
|
||||
public static final String GROUP_IMPORTEXPORT= "group.importexport";
|
||||
/**
|
||||
* Pop-up menu: name of group for actions contributed by the adaptors for the selected object
|
||||
*/
|
||||
public static final String GROUP_ADAPTERS= "group.adapters";
|
||||
/**
|
||||
* Pop-up menu: name of group for team actions
|
||||
*/
|
||||
public static final String GROUP_TEAM= "group.team";
|
||||
|
||||
|
||||
/**
|
||||
* ID of the submenu for "Compile->"
|
||||
*/
|
||||
public static final String MENU_COMPILE= "menu.compile";
|
||||
/**
|
||||
* ID of the submenu for "User Actions->"
|
||||
*/
|
||||
public static final String MENU_USERACTIONS= "menu.useractions";
|
||||
|
||||
/**
|
||||
* Group for "Start Server->"
|
||||
*/
|
||||
public static final String GROUP_STARTSERVER= "group.remoteservers";
|
||||
/**
|
||||
* ID of the submenu for "Start Server->"
|
||||
*/
|
||||
public static final String MENU_STARTSERVER= "menu.remoteservers";
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
|
||||
|
||||
/**
|
||||
* Any UI part that supports global deletion can implement
|
||||
* this to enable the Edit menu's delete item.
|
||||
*/
|
||||
public interface ISystemDeleteTarget extends ISelectionProvider
|
||||
{
|
||||
/**
|
||||
* Return true if delete should even be shown in the popup menu
|
||||
*/
|
||||
public boolean showDelete();
|
||||
/**
|
||||
* Return true if delete should be enabled based on your current selection.
|
||||
*/
|
||||
public boolean canDelete();
|
||||
/**
|
||||
* Actually do the delete of currently selected items.
|
||||
* Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)
|
||||
*/
|
||||
public boolean doDelete(IProgressMonitor monitor);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,447 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2000, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
/**
|
||||
* Constants used throughout the System plugin.
|
||||
*/
|
||||
public interface ISystemIconConstants
|
||||
{
|
||||
public static final String PLUGIN_ID ="org.eclipse.rse.ui";
|
||||
public static final String PREFIX = PLUGIN_ID+".";
|
||||
|
||||
// Icons
|
||||
public static final String ICON_DIR = "icons";
|
||||
public static final String ICON_PATH = java.io.File.separator + ICON_DIR + java.io.File.separator;
|
||||
public static final String ICON_SUFFIX = "Icon";
|
||||
public static final String ICON_BANNER_SUFFIX = "BannerIcon";
|
||||
public static final String ICON_EXT = ".gif";
|
||||
|
||||
// WIZARD ICONS...
|
||||
public static final String ICON_WIZARD_DIR = java.io.File.separator + "full" + java.io.File.separator + "wizban" + java.io.File.separator + "";
|
||||
public static final String ICON_SYSTEM_NEWPROFILEWIZARD_ROOT = "newprofile_wiz";
|
||||
public static final String ICON_SYSTEM_NEWPROFILEWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWPROFILEWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWPROFILEWIZARD_ID = PREFIX + ICON_SYSTEM_NEWPROFILEWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT = "newconnection_wiz";
|
||||
public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWCONNECTIONWIZARD_ID = PREFIX + ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILTERWIZARD_ROOT = "newfilter_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILTERWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILTERWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILTERWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILTERWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT = "newfilterpool_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILEWIZARD_ROOT = "newfile_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILEWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFILEWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILEWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFILEWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFOLDERWIZARD_ROOT = "newfolder_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFOLDERWIZARD = ICON_WIZARD_DIR + ICON_SYSTEM_NEWFOLDERWIZARD_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFOLDERWIZARD_ID = PREFIX + ICON_SYSTEM_NEWFOLDERWIZARD_ROOT + ICON_BANNER_SUFFIX;
|
||||
|
||||
|
||||
// THING ICONS...
|
||||
public static final String ICON_MODEL_DIR = java.io.File.separator + "full" + java.io.File.separator + "obj16" + java.io.File.separator + "";
|
||||
|
||||
public static final String ICON_SYSTEM_USERACTION_NEW_ROOT = "user_action_new_obj";
|
||||
public static final String ICON_SYSTEM_USERACTION_NEW = ICON_MODEL_DIR + ICON_SYSTEM_USERACTION_NEW_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERACTION_NEW_ID = PREFIX+ICON_SYSTEM_USERACTION_NEW_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERACTION_USR_ROOT = "user_action_obj";
|
||||
public static final String ICON_SYSTEM_USERACTION_USR = ICON_MODEL_DIR + ICON_SYSTEM_USERACTION_USR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERACTION_USR_ID = PREFIX+ICON_SYSTEM_USERACTION_USR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERACTION_IBM_ROOT = "user_action_ibm_obj";
|
||||
public static final String ICON_SYSTEM_USERACTION_IBM = ICON_MODEL_DIR + ICON_SYSTEM_USERACTION_IBM_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERACTION_IBM_ID = PREFIX+ICON_SYSTEM_USERACTION_IBM_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERACTION_IBMUSR_ROOT = "user_action_ibm_user_obj";
|
||||
public static final String ICON_SYSTEM_USERACTION_IBMUSR = ICON_MODEL_DIR + ICON_SYSTEM_USERACTION_IBMUSR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERACTION_IBMUSR_ID = PREFIX+ICON_SYSTEM_USERACTION_IBMUSR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERTYPE_NEW_ROOT = "user_type_new_obj";
|
||||
public static final String ICON_SYSTEM_USERTYPE_NEW = ICON_MODEL_DIR + ICON_SYSTEM_USERTYPE_NEW_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERTYPE_NEW_ID = PREFIX+ICON_SYSTEM_USERTYPE_NEW_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERTYPE_USR_ROOT = "user_type_obj";
|
||||
public static final String ICON_SYSTEM_USERTYPE_USR = ICON_MODEL_DIR + ICON_SYSTEM_USERTYPE_USR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERTYPE_USR_ID = PREFIX+ICON_SYSTEM_USERTYPE_USR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBM_ROOT = "user_type_ibm_obj";
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBM = ICON_MODEL_DIR + ICON_SYSTEM_USERTYPE_IBM_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBM_ID = PREFIX+ICON_SYSTEM_USERTYPE_IBM_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBMUSR_ROOT = "user_type_ibm_user_obj";
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBMUSR = ICON_MODEL_DIR + ICON_SYSTEM_USERTYPE_IBMUSR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_USERTYPE_IBMUSR_ID = PREFIX+ICON_SYSTEM_USERTYPE_IBMUSR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_COMPILE_NEW_ROOT = "compcmd_new_obj";
|
||||
public static final String ICON_SYSTEM_COMPILE_NEW = ICON_MODEL_DIR + ICON_SYSTEM_COMPILE_NEW_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMPILE_NEW_ID = PREFIX+ICON_SYSTEM_COMPILE_NEW_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_COMPILE_USR_ROOT = "compcmd_user_obj";
|
||||
public static final String ICON_SYSTEM_COMPILE_USR = ICON_MODEL_DIR + ICON_SYSTEM_COMPILE_USR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMPILE_USR_ID = PREFIX+ICON_SYSTEM_COMPILE_USR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_COMPILE_IBM_ROOT = "compcmd_ibm_obj";
|
||||
public static final String ICON_SYSTEM_COMPILE_IBM = ICON_MODEL_DIR + ICON_SYSTEM_COMPILE_IBM_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMPILE_IBM_ID = PREFIX+ICON_SYSTEM_COMPILE_IBM_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_COMPILE_IBMUSR_ROOT = "compcmd_ibmuser_obj";
|
||||
public static final String ICON_SYSTEM_COMPILE_IBMUSR = ICON_MODEL_DIR + ICON_SYSTEM_COMPILE_IBMUSR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMPILE_IBMUSR_ID = PREFIX+ICON_SYSTEM_COMPILE_IBMUSR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_PROFILE_ROOT = "systemprofile";
|
||||
public static final String ICON_SYSTEM_PROFILE = ICON_MODEL_DIR + ICON_SYSTEM_PROFILE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_PROFILE_ID = PREFIX+ICON_SYSTEM_PROFILE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_PROFILE_ACTIVE_ROOT = "systemprofile_active";
|
||||
public static final String ICON_SYSTEM_PROFILE_ACTIVE = ICON_MODEL_DIR + ICON_SYSTEM_PROFILE_ACTIVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_PROFILE_ACTIVE_ID = PREFIX+ICON_SYSTEM_PROFILE_ACTIVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CONNECTION_ROOT = "systemconnection";
|
||||
public static final String ICON_SYSTEM_CONNECTION = ICON_MODEL_DIR + ICON_SYSTEM_CONNECTION_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CONNECTION_ID = PREFIX+ICON_SYSTEM_CONNECTION_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CONNECTIONLIVE_ROOT = "systemconnectionlive"; // not currently used
|
||||
public static final String ICON_SYSTEM_CONNECTIONLIVE = ICON_MODEL_DIR + ICON_SYSTEM_CONNECTIONLIVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CONNECTIONLIVE_ID = PREFIX+ICON_SYSTEM_CONNECTIONLIVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_FILTERPOOL_ROOT = "systemfilterpool";
|
||||
public static final String ICON_SYSTEM_FILTERPOOL = ICON_MODEL_DIR + ICON_SYSTEM_FILTERPOOL_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_FILTERPOOL_ID = PREFIX+ICON_SYSTEM_FILTERPOOL_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_FILTER_ROOT = "systemfilter";
|
||||
public static final String ICON_SYSTEM_FILTER_ID = PREFIX + ICON_SYSTEM_FILTER_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_FILTER = ICON_MODEL_DIR + ICON_SYSTEM_FILTER_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_FILTERSTRING_ROOT = "systemfilterstring";
|
||||
public static final String ICON_SYSTEM_FILTERSTRING_ID = PREFIX + ICON_SYSTEM_FILTERSTRING_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_FILTERSTRING = ICON_MODEL_DIR + ICON_SYSTEM_FILTERSTRING_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_ROOTDRIVE_ROOT = "systemrootdrive";
|
||||
public static final String ICON_SYSTEM_ROOTDRIVE = ICON_MODEL_DIR + ICON_SYSTEM_ROOTDRIVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ROOTDRIVE_ID = PREFIX+ICON_SYSTEM_ROOTDRIVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_ROOTDRIVEOPEN_ROOT = "systemrootdriveopen";
|
||||
public static final String ICON_SYSTEM_ROOTDRIVEOPEN = ICON_MODEL_DIR + ICON_SYSTEM_ROOTDRIVEOPEN_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ROOTDRIVEOPEN_ID = PREFIX+ICON_SYSTEM_ROOTDRIVEOPEN_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_FOLDER_ROOT = "systemfolder";
|
||||
public static final String ICON_SYSTEM_FOLDER = ICON_MODEL_DIR + ICON_SYSTEM_FOLDER_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_FOLDER_ID = PREFIX+ICON_SYSTEM_FOLDER_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_ENVVAR_ROOT = "systemenvvar";
|
||||
public static final String ICON_SYSTEM_ENVVAR = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ENVVAR_ID = PREFIX+ICON_SYSTEM_ENVVAR+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_ENVVAR_LIBPATH_ROOT = "systemenvvarlibpath";
|
||||
public static final String ICON_SYSTEM_ENVVAR_LIBPATH = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_LIBPATH_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ENVVAR_LIBPATH_ID = PREFIX+ICON_SYSTEM_ENVVAR_LIBPATH+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_ENVVAR_PATH_ROOT = "systemenvvarpath";
|
||||
public static final String ICON_SYSTEM_ENVVAR_PATH = ICON_MODEL_DIR + ICON_SYSTEM_ENVVAR_PATH_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ENVVAR_PATH_ID = PREFIX+ICON_SYSTEM_ENVVAR_PATH+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_PROCESS_ROOT = "systemprocess";
|
||||
public static final String ICON_SYSTEM_PROCESS = ICON_MODEL_DIR + ICON_SYSTEM_PROCESS_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_PROCESS_ID = PREFIX+ICON_SYSTEM_PROCESS+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_TARGET_ROOT = "systemTarget";
|
||||
public static final String ICON_SYSTEM_TARGET = ICON_MODEL_DIR + ICON_SYSTEM_TARGET_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_TARGET_ID = PREFIX+ICON_SYSTEM_TARGET_ROOT+ICON_SUFFIX;
|
||||
|
||||
// NEW ACTION ICONS...
|
||||
public static final String ICON_NEWACTIONS_DIR = java.io.File.separator + "full" + java.io.File.separator + "ctool16" + java.io.File.separator + "";
|
||||
|
||||
public static final String ICON_SYSTEM_NEW_ROOT = "new";
|
||||
public static final String ICON_SYSTEM_NEW = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEW_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEW_ID = PREFIX+ICON_SYSTEM_NEW_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWPROFILE_ROOT = "newprofile_wiz";
|
||||
public static final String ICON_SYSTEM_NEWPROFILE = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWPROFILE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWPROFILE_ID = PREFIX+ICON_SYSTEM_NEWPROFILE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWCONNECTION_ROOT = "newconnection_wiz";
|
||||
public static final String ICON_SYSTEM_NEWCONNECTION = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWCONNECTION_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWCONNECTION_ID = PREFIX+ICON_SYSTEM_NEWCONNECTION_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOL_ROOT = "newfilterpool_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOL = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTERPOOL_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOL_ID = PREFIX+ICON_SYSTEM_NEWFILTERPOOL_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLREF_ROOT = "newfilterpoolref_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLREF = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTERPOOLREF_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILTERPOOLREF_ID = PREFIX+ICON_SYSTEM_NEWFILTERPOOLREF_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILTER_ROOT = "newfilter_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILTER = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILTER_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILTER_ID = PREFIX+ICON_SYSTEM_NEWFILTER_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFILE_ROOT = "newfile_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFILE = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFILE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFILE_ID = PREFIX+ICON_SYSTEM_NEWFILE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_NEWFOLDER_ROOT = "newfolder_wiz";
|
||||
public static final String ICON_SYSTEM_NEWFOLDER = ICON_NEWACTIONS_DIR + ICON_SYSTEM_NEWFOLDER_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_NEWFOLDER_ID = PREFIX+ICON_SYSTEM_NEWFOLDER_ROOT+ICON_SUFFIX;
|
||||
|
||||
|
||||
// OTHER ACTION ICONS...
|
||||
public static final String ICON_ACTIONS_DIR = java.io.File.separator + "full" + java.io.File.separator + "elcl16" + java.io.File.separator + "";
|
||||
|
||||
public static final String ICON_SYSTEM_COMPILE_ROOT = "compile";
|
||||
public static final String ICON_SYSTEM_COMPILE = ICON_ACTIONS_DIR + ICON_SYSTEM_COMPILE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMPILE_ID = PREFIX+ICON_SYSTEM_COMPILE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_LOCK_ROOT = "lock";
|
||||
public static final String ICON_SYSTEM_LOCK = ICON_ACTIONS_DIR + ICON_SYSTEM_LOCK_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_LOCK_ID = PREFIX+ICON_SYSTEM_LOCK_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_MOVEUP_ROOT = "up";
|
||||
public static final String ICON_SYSTEM_MOVEUP = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVEUP_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_MOVEUP_ID = PREFIX+ICON_SYSTEM_MOVEUP_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_MOVEDOWN_ROOT = "down";
|
||||
public static final String ICON_SYSTEM_MOVEDOWN = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVEDOWN_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_MOVEDOWN_ID = PREFIX+ICON_SYSTEM_MOVEDOWN_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_MOVE_ROOT = "move";
|
||||
public static final String ICON_SYSTEM_MOVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MOVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_MOVE_ID = PREFIX+ICON_SYSTEM_MOVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CLEAR_ROOT = "clear";
|
||||
public static final String ICON_SYSTEM_CLEAR = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CLEAR_ID = PREFIX+ICON_SYSTEM_CLEAR_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CLEAR_ALL_ROOT = "clearall";
|
||||
public static final String ICON_SYSTEM_CLEAR_ALL = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_ALL_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CLEAR_ALL_ID = PREFIX+ICON_SYSTEM_CLEAR_ALL_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CLEAR_SELECTED_ROOT = "clearselected";
|
||||
public static final String ICON_SYSTEM_CLEAR_SELECTED = ICON_ACTIONS_DIR + ICON_SYSTEM_CLEAR_SELECTED_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CLEAR_SELECTED_ID = PREFIX+ICON_SYSTEM_CLEAR_SELECTED_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_DELETEREF_ROOT = "deletereference";
|
||||
public static final String ICON_SYSTEM_DELETEREF = ICON_ACTIONS_DIR + ICON_SYSTEM_DELETEREF_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_DELETEREF_ID = PREFIX+ICON_SYSTEM_DELETEREF_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_RUN_ROOT = "run";
|
||||
public static final String ICON_SYSTEM_RUN = ICON_ACTIONS_DIR + ICON_SYSTEM_RUN_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_RUN_ID = PREFIX+ICON_SYSTEM_RUN_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_STOP_ROOT = "stop";
|
||||
public static final String ICON_SYSTEM_STOP = ICON_ACTIONS_DIR + ICON_SYSTEM_STOP_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_STOP_ID = PREFIX+ICON_SYSTEM_STOP_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_RENAME_ROOT = "rename";
|
||||
public static final String ICON_SYSTEM_RENAME = ICON_ACTIONS_DIR + ICON_SYSTEM_RENAME_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_RENAME_ID = PREFIX+ICON_SYSTEM_RENAME_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_IDE_REFRESH_ID = "elcl16/refresh_nav.gif";
|
||||
public static final String ICON_IDE_COLLAPSEALL_ID = "elcl16/collapseall.gif";
|
||||
public static final String ICON_IDE_LINKTOEDITOR_ID = "elcl16/synced.gif";
|
||||
public static final String ICON_IDE_FILTER_ID = "elcl16/filter_ps.gif";
|
||||
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT = "makeProfileActive";
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEACTIVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEACTIVE_ID = PREFIX+ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT = "makeProfileInActive";
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE = ICON_ACTIONS_DIR + ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_MAKEPROFILEINACTIVE_ID = PREFIX+ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CHANGEFILTER_ROOT = "editfilter";
|
||||
public static final String ICON_SYSTEM_CHANGEFILTER = ICON_ACTIONS_DIR + ICON_SYSTEM_CHANGEFILTER_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CHANGEFILTER_ID = PREFIX+ICON_SYSTEM_CHANGEFILTER_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SELECTPROFILE_ROOT = "selectprofile";
|
||||
public static final String ICON_SYSTEM_SELECTPROFILE = ICON_ACTIONS_DIR + ICON_SYSTEM_SELECTPROFILE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SELECTPROFILE_ID = PREFIX+ICON_SYSTEM_SELECTPROFILE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SELECTFILTERPOOLS_ROOT = "selectpool";
|
||||
public static final String ICON_SYSTEM_SELECTFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_SELECTFILTERPOOLS_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SELECTFILTERPOOLS_ID = PREFIX+ICON_SYSTEM_SELECTFILTERPOOLS_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT = "workwithfilterpools";
|
||||
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS_ID = PREFIX+ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT = "workwithuseractions";
|
||||
public static final String ICON_SYSTEM_WORKWITHUSERACTIONS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ID = PREFIX+ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT = "workwithnamedtypes";
|
||||
public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ID = PREFIX+ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT = "workwithcompilecmds";
|
||||
public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ID = PREFIX+ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_REMOVE_SHELL_ROOT = "removeshell";
|
||||
public static final String ICON_SYSTEM_REMOVE_SHELL_ID = PREFIX + ICON_SYSTEM_REMOVE_SHELL_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_REMOVE_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_REMOVE_SHELL_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_CANCEL_SHELL_ROOT = "cancelshell";
|
||||
public static final String ICON_SYSTEM_CANCEL_SHELL_ID = PREFIX + ICON_SYSTEM_CANCEL_SHELL_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_CANCEL_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_CANCEL_SHELL_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_EXTRACT_ROOT = "xtrctarchv_tsk";
|
||||
public static final String ICON_SYSTEM_EXTRACT = ICON_ACTIONS_DIR + ICON_SYSTEM_EXTRACT_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_EXTRACT_ID = PREFIX+ICON_SYSTEM_EXTRACT_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_EXTRACTTO_ROOT = "xtrctarchvto_tsk";
|
||||
public static final String ICON_SYSTEM_EXTRACTTO = ICON_ACTIONS_DIR + ICON_SYSTEM_EXTRACTTO_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_EXTRACTTO_ID = PREFIX+ICON_SYSTEM_EXTRACTTO_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_CONVERT_ROOT = "convertarchive_tsk";
|
||||
public static final String ICON_SYSTEM_CONVERT = ICON_ACTIONS_DIR + ICON_SYSTEM_CONVERT_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CONVERT_ID = PREFIX+ICON_SYSTEM_CONVERT_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_COMBINE_ROOT = "combine_tsk";
|
||||
public static final String ICON_SYSTEM_COMBINE = ICON_ACTIONS_DIR + ICON_SYSTEM_COMBINE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_COMBINE_ID = PREFIX+ICON_SYSTEM_COMBINE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SHOW_TABLE_ROOT = "systemshowintable";
|
||||
public static final String ICON_SYSTEM_SHOW_TABLE = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SHOW_TABLE_ID = PREFIX + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SHOW_MONITOR_ROOT = "monitor_view";
|
||||
public static final String ICON_SYSTEM_SHOW_MONITOR = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_MONITOR_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SHOW_MONITOR_ID = PREFIX + ICON_SYSTEM_SHOW_MONITOR_ROOT + ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SHOW_SHELL_ROOT = "systemshell";
|
||||
public static final String ICON_SYSTEM_SHOW_SHELL = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_SHELL_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SHOW_SHELL_ID = PREFIX + ICON_SYSTEM_SHOW_SHELL_ROOT + ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT = "exportshelloutput";
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT = ICON_ACTIONS_DIR + ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ID = PREFIX + ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT + ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT = "exportshellhistory";
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY = ICON_ACTIONS_DIR + ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT + ICON_EXT;
|
||||
public static final String ICON_SYSTEM_EXPORT_SHELL_HISTORY_ID = PREFIX + ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT + ICON_SUFFIX;
|
||||
|
||||
// SPECIAL MODEL OBJECT ICONS...
|
||||
public static final String ICON_OBJS_DIR = java.io.File.separator + "full" + java.io.File.separator + "obj16" + java.io.File.separator;
|
||||
public static final String ICON_SYSTEM_ERROR_ROOT = "error";
|
||||
public static final String ICON_SYSTEM_ERROR_ID = PREFIX + ICON_SYSTEM_ERROR_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_ERROR = ICON_OBJS_DIR + ICON_SYSTEM_ERROR_ROOT + ICON_EXT;
|
||||
|
||||
// info is to be used in dialogs
|
||||
public static final String ICON_SYSTEM_INFO_ROOT = "info";
|
||||
public static final String ICON_SYSTEM_INFO_ID = PREFIX + ICON_SYSTEM_INFO_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_INFO = ICON_OBJS_DIR + ICON_SYSTEM_INFO_ROOT + ICON_EXT;
|
||||
|
||||
// systeminfo is to be used in tree view
|
||||
public static final String ICON_SYSTEM_INFO_TREE_ROOT = "systeminfo";
|
||||
public static final String ICON_SYSTEM_INFO_TREE_ID = PREFIX + ICON_SYSTEM_INFO_TREE_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_INFO_TREE = ICON_OBJS_DIR + ICON_SYSTEM_INFO_TREE_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_HELP_ROOT = "systemhelp";
|
||||
public static final String ICON_SYSTEM_HELP_ID = PREFIX + ICON_SYSTEM_HELP_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_HELP = ICON_OBJS_DIR + ICON_SYSTEM_HELP_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_CANCEL_ROOT = "systemcancel";
|
||||
public static final String ICON_SYSTEM_CANCEL_ID = PREFIX + ICON_SYSTEM_CANCEL_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_CANCEL = ICON_OBJS_DIR + ICON_SYSTEM_CANCEL_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_EMPTY_ROOT = "systemempty";
|
||||
public static final String ICON_SYSTEM_EMPTY_ID = PREFIX + ICON_SYSTEM_EMPTY_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_EMPTY = ICON_OBJS_DIR + ICON_SYSTEM_EMPTY_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_OK_ROOT = "systemok";
|
||||
public static final String ICON_SYSTEM_OK_ID = PREFIX + ICON_SYSTEM_OK_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_OK = ICON_OBJS_DIR + ICON_SYSTEM_OK_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_WARNING_ROOT = "warning";
|
||||
public static final String ICON_SYSTEM_WARNING_ID = PREFIX + ICON_SYSTEM_WARNING_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_WARNING = ICON_OBJS_DIR + ICON_SYSTEM_WARNING_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_FAILED_ROOT = "systemfailed"; // not used yet
|
||||
public static final String ICON_SYSTEM_FAILED_ID = PREFIX + ICON_SYSTEM_FAILED_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_FAILED = ICON_OBJS_DIR + ICON_SYSTEM_FAILED_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_BLANK_ROOT = "systemblank"; // not used yet
|
||||
public static final String ICON_SYSTEM_BLANK_ID = PREFIX + ICON_SYSTEM_BLANK_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_BLANK = ICON_OBJS_DIR + ICON_SYSTEM_BLANK_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_SEARCH_ROOT = "system_search";
|
||||
public static final String ICON_SYSTEM_SEARCH_ID = PREFIX + ICON_SYSTEM_SEARCH_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_SEARCH = ICON_OBJS_DIR + ICON_SYSTEM_SEARCH_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_SEARCH_RESULT_ROOT = "systemsearchresult";
|
||||
public static final String ICON_SYSTEM_SEARCH_RESULT_ID = PREFIX + ICON_SYSTEM_SEARCH_RESULT_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_SEARCH_RESULT = ICON_OBJS_DIR + ICON_SYSTEM_SEARCH_RESULT_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_SHELL_ROOT = "systemshell"; // not used yet
|
||||
public static final String ICON_SYSTEM_SHELL_ID = PREFIX + ICON_SYSTEM_SHELL_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_SHELL = ICON_OBJS_DIR + ICON_SYSTEM_SHELL_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_SHELLLIVE_ROOT = "systemshelllive"; // not used yet
|
||||
public static final String ICON_SYSTEM_SHELLLIVE_ID = PREFIX + ICON_SYSTEM_SHELLLIVE_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_SHELLLIVE = ICON_OBJS_DIR + ICON_SYSTEM_SHELLLIVE_ROOT + ICON_EXT;
|
||||
|
||||
public static final String ICON_SYSTEM_PERSPECTIVE_ROOT ="system_persp";
|
||||
public static final String ICON_SYSTEM_PERSPECTIVE_ID = PREFIX + ICON_SYSTEM_PERSPECTIVE_ROOT + ICON_SUFFIX;
|
||||
public static final String ICON_SYSTEM_PERSPECTIVE = ICON_OBJS_DIR + ICON_SYSTEM_PERSPECTIVE_ROOT + ICON_EXT;
|
||||
|
||||
|
||||
|
||||
public static final String ICON_SYSTEM_ARROW_UP_ROOT = "arrowup_obj";
|
||||
public static final String ICON_SYSTEM_ARROW_UP = ICON_OBJS_DIR + ICON_SYSTEM_ARROW_UP_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ARROW_UP_ID = PREFIX+ICON_SYSTEM_ARROW_UP_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_ARROW_DOWN_ROOT = "arrowdown_obj";
|
||||
public static final String ICON_SYSTEM_ARROW_DOWN = ICON_OBJS_DIR + ICON_SYSTEM_ARROW_DOWN_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_ARROW_DOWN_ID = PREFIX+ICON_SYSTEM_ARROW_DOWN_ROOT+ICON_SUFFIX;
|
||||
|
||||
|
||||
public static final String ICON_SYSTEM_CONNECTOR_SERVICE_ROOT = "connectorservice_obj";
|
||||
public static final String ICON_SYSTEM_CONNECTOR_SERVICE = ICON_OBJS_DIR + ICON_SYSTEM_CONNECTOR_SERVICE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_CONNECTOR_SERVICE_ID = PREFIX+ICON_SYSTEM_CONNECTOR_SERVICE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_SERVICE_ROOT = "service_obj";
|
||||
public static final String ICON_SYSTEM_SERVICE = ICON_OBJS_DIR + ICON_SYSTEM_SERVICE_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_SERVICE_ID = PREFIX+ICON_SYSTEM_SERVICE_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT = "launcher_config_obj";
|
||||
public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION = ICON_OBJS_DIR + ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID = PREFIX+ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SYSTEM_PROPERTIES_ROOT = "properties_obj";
|
||||
public static final String ICON_SYSTEM_PROPERTIES = ICON_OBJS_DIR + ICON_SYSTEM_PROPERTIES_ROOT+ICON_EXT;
|
||||
public static final String ICON_SYSTEM_PROPERTIES_ID = PREFIX+ICON_SYSTEM_PROPERTIES_ROOT+ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT = "searchremoveselected";
|
||||
public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES = ICON_ACTIONS_DIR + ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT + ICON_EXT;
|
||||
public static final String ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID = PREFIX + ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT + ICON_SUFFIX;
|
||||
|
||||
public static final String ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT = "searchremoveall";
|
||||
public static final String ICON_SEARCH_REMOVE_ALL_MATCHES = ICON_ACTIONS_DIR + ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT + ICON_EXT;
|
||||
public static final String ICON_SEARCH_REMOVE_ALL_MATCHES_ID = PREFIX + ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT + ICON_SUFFIX;
|
||||
|
||||
// we reuse the Remove all matches action icon
|
||||
public static final String ICON_SEARCH_CLEAR_HISTORY_ROOT = ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT;
|
||||
public static final String ICON_SEARCH_CLEAR_HISTORY = ICON_ACTIONS_DIR + ICON_SEARCH_CLEAR_HISTORY_ROOT + ICON_EXT;
|
||||
public static final String ICON_SEARCH_CLEAR_HISTORY_ID = PREFIX + ICON_SEARCH_CLEAR_HISTORY_ROOT + ICON_SUFFIX;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
//import org.eclipse.jface.dialogs.*;
|
||||
//import org.eclipse.jface.viewers.*;
|
||||
|
||||
/**
|
||||
* This interface is used to identify objects whose job is to massage user-entered
|
||||
* text before saving it to a model. Eg, the text, while valid, may need to be folded
|
||||
* to uppercase or trimmed of blanks, or resolved if it has a substitution variable.
|
||||
* <p>
|
||||
* This interface, like IInputValidator, allows this work to be abstracted such that one
|
||||
* object that does it can be used in various dialogs or wizards or property sheets.
|
||||
*/
|
||||
public interface ISystemMassager
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Given the user-entered input, return the massaged version of it.
|
||||
* If no massaging required, return the input as is.
|
||||
*/
|
||||
public String massage(String text);
|
||||
}
|
|
@ -0,0 +1,454 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2000, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
/**
|
||||
* Message IDs
|
||||
*/
|
||||
public interface ISystemMessages
|
||||
{
|
||||
|
||||
public static final String PLUGIN_ID ="org.eclipse.rse.ui";
|
||||
public static final String PREFIX = PLUGIN_ID+".";
|
||||
// Resource Bundle ids
|
||||
public static final String RESID_PREFIX = PREFIX+"ui.";
|
||||
// Messages
|
||||
public static final String MSG_PREFIX = RESID_PREFIX+"msg.";
|
||||
//public static final String MSG_TITLE = MSG_PREFIX + "Title";
|
||||
//public static final String MSG_TITLEWARNING = MSG_PREFIX + "TitleWarning";
|
||||
//public static final String MSG_TITLEINFORMATION = MSG_PREFIX + "TitleInformation";
|
||||
//public static final String MSG_TITLECONFIRMATION = MSG_PREFIX + "TitleConfirmation";
|
||||
|
||||
//public static final String MSG_CREATE_PROJECT_ERROR = "RSEG1002"; //MSG_PREFIX + "CreateProjectFailed";
|
||||
|
||||
//public static final String MSG_VALIDATE_PREFIX = MSG_PREFIX + "Validate.";
|
||||
public static final String MSG_UNDERCONSTRUCTION = "RSEG1001";
|
||||
|
||||
public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002";
|
||||
|
||||
public static final String MSG_CONFIRM_ENABLE_CLASSIC_HELP = "RSEG1400";
|
||||
public static final String MSG_ERROR_ENABLE_CLASSIC_HELP = "RSEG1401";
|
||||
|
||||
public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006";
|
||||
public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007";
|
||||
public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008";
|
||||
|
||||
public static final String MSG_VALIDATE_RENAME_EMPTY = "RSEG1012"; //MSG_VALIDATE_PREFIX + "ReName.Required";
|
||||
public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique";
|
||||
public static final String MSG_VALIDATE_RENAME_NOTVALID = "RSEG1011"; //MSG_VALIDATE_PREFIX + "ReName.NotValid";
|
||||
public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew";
|
||||
|
||||
public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014";
|
||||
public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015";
|
||||
public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016";
|
||||
public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040";
|
||||
|
||||
public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032";
|
||||
public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033";
|
||||
public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034";
|
||||
|
||||
public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017";
|
||||
public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027";
|
||||
public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028";
|
||||
public static final String MSG_VALIDATE_FOLDERNAME_NOTVALID = "RSEG1018";
|
||||
public static final String MSG_VALIDATE_FILENAME_NOTVALID = "RSEG1019";
|
||||
|
||||
public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021";
|
||||
public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022";
|
||||
public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041";
|
||||
public static final String MSG_VALIDATE_CONNECTIONNAME_NOTVALID = "RSEG1023";
|
||||
|
||||
public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired";
|
||||
public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025";
|
||||
public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026";
|
||||
|
||||
public static final String MSG_VALIDATE_ENTRY_EMPTY = "RSEG1029";
|
||||
public static final String MSG_VALIDATE_ENTRY_NOTUNIQUE= "RSEG1030";
|
||||
public static final String MSG_VALIDATE_ENTRY_NOTVALID = "RSEG1031";
|
||||
|
||||
public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037";
|
||||
public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038";
|
||||
public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTVALID = "RSEG1039";
|
||||
|
||||
public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042";
|
||||
public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043";
|
||||
public static final String MSG_VALIDATE_FILTERNAME_NOTVALID = "RSEG1044";
|
||||
|
||||
public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired";
|
||||
public static final String MSG_VALIDATE_PASSWORD_EXPIRED = "RSEG1036"; //MSG_VALIDATE_PREFIX + "PasswordExpired";
|
||||
public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045";
|
||||
public static final String MSG_VALIDATE_FILTERSTRING_NOTUNIQUE= "RSEG1046";
|
||||
public static final String MSG_VALIDATE_FILTERSTRING_NOTVALID = "RSEG1047";
|
||||
public static final String MSG_VALIDATE_FILTERSTRING_DUPLICATES = "RSEG1048";
|
||||
public static final String MSG_VALIDATE_FILTERSTRING_ALREADYEXISTS = "RSEG1049";
|
||||
public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170";
|
||||
public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171";
|
||||
public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172";
|
||||
|
||||
public static final String MSG_CONFIRM_DELETE = "RSEG1052";
|
||||
public static final String MSG_CONFIRM_DELETEREMOTE = "RSEG1130";
|
||||
public static final String MSG_CONFIRM_DELETEPROFILE = "RSEG1053";
|
||||
public static final String MSG_CONFIRM_CHANGES = "RSEG1201";
|
||||
public static final String MSG_CONFIRM_CHANGES_CANCELABLE = "RSEG1202";
|
||||
|
||||
//public static final String MSG_CONNECT_PREFIX = MSG_PREFIX + "Connect.";
|
||||
public static final String MSG_CONNECT_PROGRESS = "RSEG1054"; //MSG_CONNECT_PREFIX + "Connecting";
|
||||
public static final String MSG_CONNECTWITHPORT_PROGRESS = "RSEG1055"; //MSG_CONNECT_PREFIX + "ConnectingWithPort";
|
||||
public static final String MSG_CONNECT_FAILED = "RSEG1056"; //MSG_CONNECT_PREFIX + "Failed";
|
||||
public static final String MSG_CONNECT_UNKNOWNHOST = "RSEG1057"; //MSG_CONNECT_PREFIX + "UnknownHost";
|
||||
public static final String MSG_CONNECT_CANCELLED = "RSEG1058"; //MSG_CONNECT_PREFIX + "Cancelled";
|
||||
|
||||
|
||||
public static final String MSG_CONNECT_DAEMON_FAILED = "RSEG1242"; //MSG_CONNECT_PREFIX + "Failed";
|
||||
public static final String MSG_CONNECT_DAEMON_FAILED_EXCEPTION = "RSEG1243"; //MSG_CONNECT_PREFIX + "Failed";
|
||||
public static final String MSG_CONNECT_SSL_EXCEPTION = "RSEC2307"; //MSG_CONNECT_PREFIX + "Failed";
|
||||
|
||||
public static final String MSG_STARTING_SERVER_VIA_REXEC = "RSEC2310";
|
||||
public static final String MSG_STARTING_SERVER_VIA_DAEMON = "RSEC2311";
|
||||
public static final String MSG_CONNECTING_TO_SERVER= "RSEC2312";
|
||||
public static final String MSG_INITIALIZING_SERVER= "RSEC2313";
|
||||
|
||||
//public static final String MSG_DISCONNECT_PREFIX = MSG_PREFIX + "Disconnect.";
|
||||
public static final String MSG_DISCONNECT_PROGRESS = "RSEG1059"; //MSG_DISCONNECT_PREFIX + "Disconnecting";
|
||||
public static final String MSG_DISCONNECTWITHPORT_PROGRESS = "RSEG1060"; //MSG_DISCONNECT_PREFIX + "DisconnectingWithPort";
|
||||
public static final String MSG_DISCONNECT_FAILED = "RSEG1061"; // MSG_DISCONNECT_PREFIX + "Failed";
|
||||
public static final String MSG_DISCONNECT_CANCELLED = "RSEG1062"; //MSG_DISCONNECT_PREFIX + "Cancelled";
|
||||
|
||||
//public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save.";
|
||||
public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed";
|
||||
public static final String MSG_RESTORE_FAILED = "RSEG1051";
|
||||
public static final String MSG_SAVE_CHANGES_PENDING = "RSEG1201";
|
||||
|
||||
//public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception.";
|
||||
public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003";
|
||||
public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004";
|
||||
public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming";
|
||||
public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving";
|
||||
|
||||
//public static final String MSG_RESOLVE_PREFIX = MSG_PREFIX + "Resolve.";
|
||||
public static final String MSG_RESOLVE_PROGRESS = "RSEG1070";
|
||||
|
||||
//public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query.";
|
||||
public static final String MSG_QUERY_PROGRESS = "RSEG1095";
|
||||
public static final String MSG_QUERY_PROPERTIES_PROGRESS = "RSEG1096";
|
||||
|
||||
//public static final String MSG_SET_PREFIX = MSG_PREFIX + "Set.";
|
||||
public static final String MSG_SET_PROGRESS = "RSEG1093";
|
||||
public static final String MSG_SET_PROPERTIES_PROGRESS = "RSEG1094";
|
||||
|
||||
//public static final String MSG_RUN_PREFIX = MSG_PREFIX + "Run.";
|
||||
public static final String MSG_RUN_PROGRESS = "RSEG1071";
|
||||
|
||||
//public static final String MSG_COPY_PREFIX = MSG_PREFIX + "Copy.";
|
||||
public static final String MSG_COPY_PROGRESS = "RSEG1072";
|
||||
public static final String MSG_COPYCONNECTION_PROGRESS = "RSEG1073";
|
||||
public static final String MSG_COPYCONNECTIONS_PROGRESS = "RSEG1074";
|
||||
public static final String MSG_COPYFILTERPOOLS_PROGRESS = "RSEG1075";
|
||||
public static final String MSG_COPYFILTERPOOL_PROGRESS = "RSEG1076";
|
||||
public static final String MSG_COPYFILTERS_PROGRESS = "RSEG1077";
|
||||
public static final String MSG_COPYFILTER_PROGRESS = "RSEG1078";
|
||||
public static final String MSG_COPYFILTERSTRINGS_PROGRESS="RSEG1079";
|
||||
public static final String MSG_COPYFILTERSTRING_PROGRESS ="RSEG1080";
|
||||
public static final String MSG_COPYSUBSYSTEMS_PROGRESS = "RSEG1081";
|
||||
|
||||
public static final String MSG_DOWNLOAD_PROGRESS = "RSEG1280";
|
||||
public static final String MSG_UPLOAD_PROGRESS = "RSEG1281";
|
||||
public static final String MSG_SYNCHRONIZE_PROGRESS = "RSEG1282";
|
||||
public static final String MSG_EXTRACT_PROGRESS = "RSEG1285";
|
||||
public static final String MSG_PERCENT_DONE = "RSEG1290";
|
||||
public static final String MSG_DOWNLOADING_PROGRESS = "RSEG1295";
|
||||
public static final String MSG_UPLOADING_PROGRESS = "RSEG1296";
|
||||
|
||||
public static final String MSG_COPYFILTERPOOL_COMPLETE = "RSEG1082";
|
||||
|
||||
//public static final String MSG_MOVE_PREFIX = MSG_PREFIX + "Move.";
|
||||
public static final String MSG_MOVE_PROGRESS = "RSEG1083"; // "moving %1 to %2"
|
||||
public static final String MSG_MOVECONNECTION_PROGRESS = "RSEG1084";
|
||||
public static final String MSG_MOVECONNECTIONS_PROGRESS = "RSEG1085";
|
||||
public static final String MSG_MOVEFILTERPOOLS_PROGRESS = "RSEG1086";
|
||||
public static final String MSG_MOVEFILTERPOOL_PROGRESS = "RSEG1087";
|
||||
public static final String MSG_MOVEFILTERS_PROGRESS = "RSEG1088";
|
||||
public static final String MSG_MOVEFILTER_PROGRESS = "RSEG1089";
|
||||
public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090";
|
||||
public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091";
|
||||
public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092";
|
||||
|
||||
public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115";
|
||||
public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116";
|
||||
public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117";
|
||||
public static final String MSG_MOVETHINGGENERIC_PROGRESS = "RSEG1118";
|
||||
|
||||
public static final String MSG_SAVING_PROGRESS = "RSEG1119";
|
||||
|
||||
public static final String MSG_VALIDATE_UDANAME_EMPTY = "RSEG1180";
|
||||
public static final String MSG_VALIDATE_UDANAME_NOTUNIQUE= "RSEG1181";
|
||||
public static final String MSG_VALIDATE_UDANAME_NOTVALID = "RSEG1182";
|
||||
|
||||
public static final String MSG_VALIDATE_UDACMT_EMPTY = "RSEG1183";
|
||||
public static final String MSG_VALIDATE_UDACMT_NOTVALID = "RSEG1184";
|
||||
|
||||
public static final String MSG_VALIDATE_UDACMD_EMPTY = "RSEG1185";
|
||||
public static final String MSG_VALIDATE_UDACMD_NOTVALID = "RSEG1186";
|
||||
|
||||
public static final String MSG_VALIDATE_UDTNAME_EMPTY = "RSEG1187";
|
||||
public static final String MSG_VALIDATE_UDTNAME_NOTUNIQUE= "RSEG1188";
|
||||
public static final String MSG_VALIDATE_UDTNAME_NOTVALID = "RSEG1189";
|
||||
|
||||
public static final String MSG_VALIDATE_UDTTYPES_EMPTY = "RSEG1190";
|
||||
public static final String MSG_VALIDATE_UDTTYPES_NOTVALID = "RSEG1191";
|
||||
|
||||
public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192";
|
||||
public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193";
|
||||
public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194";
|
||||
|
||||
public static final String MSG_VALIDATE_COMPILELABEL_EMPTY = "RSEG1195";
|
||||
public static final String MSG_VALIDATE_COMPILELABEL_NOTUNIQUE= "RSEG1196";
|
||||
public static final String MSG_VALIDATE_COMPILELABEL_NOTVALID = "RSEG1197";
|
||||
public static final String MSG_VALIDATE_COMPILESTRING_EMPTY = "RSEG1198";
|
||||
public static final String MSG_VALIDATE_COMPILESTRING_NOTVALID = "RSEG1199";
|
||||
|
||||
public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120";
|
||||
public static final String MSG_COMBINETO_VIRTUAL_DEST = "RSEG1121";
|
||||
public static final String MSG_CONVERTTO_VIRTUAL_DEST = "RSEG1127";
|
||||
public static final String MSG_ADDTO_VIRTUAL_DEST = "RSEG1128";
|
||||
public static final String MSG_DEST_NOT_IN_SOURCE = "RSEG1129";
|
||||
public static final String MSG_DEST_TARGET_READONLY = "RSEF1313";
|
||||
|
||||
public static final String FILEMSG_ARCHIVE_CORRUPTED = "RSEG1122";
|
||||
public static final String MSG_FOLDER_INUSE = "RSEG1150"; // defect 42138
|
||||
public static final String MSG_FILE_INUSE = "RSEG1151"; // defect 42332
|
||||
|
||||
public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503
|
||||
public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161";
|
||||
public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162";
|
||||
|
||||
//public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation.";
|
||||
public static final String MSG_OPERATION_FAILED = "RSEG1066";
|
||||
public static final String MSG_OPERATION_CANCELLED = "RSEG1067";
|
||||
|
||||
|
||||
//public static final String MSG_LOADING_PREFIX = MSG_PREFIX + "Loading.";
|
||||
public static final String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = "RSEG1068";
|
||||
public static final String MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED = "RSEG1069";
|
||||
|
||||
public static final String MSG_UDA_LOAD_ERROR = "RSEG1140";
|
||||
public static final String MSG_UDA_ROOTTAG_ERROR = "RSEG1141";
|
||||
|
||||
public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220";
|
||||
public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221";
|
||||
|
||||
public static final String MSG_CONFIRM_DELETE_USERACTION = "RSEG1230";
|
||||
public static final String MSG_CONFIRM_DELETE_USERTYPE = "RSEG1231";
|
||||
|
||||
public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240";
|
||||
|
||||
// universal find files
|
||||
public static final String MSG_UFF_PATTERN_EMPTY = "RSEG1250";
|
||||
public static final String MSG_UFF_PATTERN_INVALID_REGEX = "RSEG1251";
|
||||
|
||||
// universal commands
|
||||
public static final String MSG_UCMD_INVOCATION_EMPTY = "RSEG1260";
|
||||
|
||||
// operation status
|
||||
public static final String MSG_OPERATION_RUNNING = "RSEG1255";
|
||||
public static final String MSG_OPERATION_FINISHED = "RSEG1256";
|
||||
public static final String MSG_OPERTION_STOPPED = "RSEG1257";
|
||||
public static final String MSG_OPERATION_DISCONNECTED = "RSEG1258";
|
||||
|
||||
|
||||
|
||||
// --------------------------
|
||||
// UNIVERSAL FILE MESSAGES...
|
||||
// --------------------------
|
||||
public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY = "RSEF1011";
|
||||
public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE= "RSEF1007";
|
||||
public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID = "RSEF1008";
|
||||
public static final String FILEMSG_VALIDATE_FILEFILTERSTRING_NOINCLUDES = "RSEF1009";
|
||||
public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300";
|
||||
public static final String FILEMSG_RENAME_FILE_FAILED = "RSEF1301";
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED = "RSEF1302";
|
||||
public static final String FILEMSG_CREATE_FILE_FAILED_EXIST = "RSEF1303";
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED = "RSEF1304";
|
||||
public static final String FILEMSG_CREATE_FOLDER_FAILED_EXIST = "RSEF1309";
|
||||
public static final String FILEMSG_CREATE_RESOURCE_NOTVISIBLE = "RSEF1310";
|
||||
public static final String FILEMSG_RENAME_RESOURCE_NOTVISIBLE = "RSEF1311";
|
||||
public static final String FILEMSG_ERROR_NOFILETYPES = "RSEF1010";
|
||||
public static final String FILEMSG_COPY_FILE_FAILED = "RSEF1306";
|
||||
public static final String FILEMSG_MOVE_FILE_FAILED = "RSEF1307";
|
||||
public static final String FILEMSG_MOVE_TARGET_EQUALS_SOURCE = "RSEF1308";
|
||||
public static final String FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOUCE = "RSEF1312";
|
||||
public static final String FILEMSG_DELETING = "RSEF1315";
|
||||
|
||||
// -------------------------
|
||||
// IMPORT/EXPORT MESSAGES...
|
||||
// -------------------------
|
||||
public static final String FILEMSG_COPY_ROOT = "RSEF8050";
|
||||
public static final String FILEMSG_IMPORT_ERROR = "RSEF8052";
|
||||
public static final String FILEMSG_IMPORT_PROBLEMS = "RSEF8054";
|
||||
public static final String FILEMSG_IMPORT_SELF = "RSEF8056";
|
||||
public static final String FILEMSG_EXPORT_ERROR = "RSEF8057";
|
||||
public static final String FILEMSG_EXPORT_PROBLEMS = "RSEF8058";
|
||||
public static final String FILEMSG_NOT_WRITABLE = "RSEF8059";
|
||||
|
||||
public static final String FILEMSG_TARGET_EXISTS = "RSEF8060";
|
||||
public static final String FILEMSG_FOLDER_IS_FILE = "RSEF8061";
|
||||
public static final String FILEMSG_DESTINATION_CONFLICTING = "RSEF8062";
|
||||
public static final String FILEMSG_SOURCE_IS_FILE = "RSEF8063";
|
||||
public static final String FILEMSG_SOURCE_EMPTY = "RSEF8066";
|
||||
public static final String FILEMSG_EXPORT_FAILED = "RSEF8067";
|
||||
public static final String FILEMSG_EXPORT_NONE_SELECTED = "RSEF8068";
|
||||
public static final String FILEMSG_DESTINATION_EMPTY = "RSEF8069";
|
||||
public static final String FILEMSG_IMPORT_FAILED = "RSEF8070";
|
||||
public static final String FILEMSG_IMPORT_NONE_SELECTED = "RSEF8071";
|
||||
public static final String FILEMSG_IMPORT_FILTERING = "RSEF8072";
|
||||
|
||||
// --------------------------------
|
||||
// INFO-POPS FOR UNIVERSAL FILE
|
||||
// -------------------------------
|
||||
|
||||
public static final String NEW_FILE_WIZARD = "ufwf0000";
|
||||
public static final String NEW_FOLDER_WIZARD = "ufwr0000";
|
||||
public static final String NEW_FILE_ACTION = "ufaf0000";
|
||||
public static final String NEW_FOLDER_ACTION = "ufar0000";
|
||||
|
||||
|
||||
// Remote File Exception Messages
|
||||
public static final String FILEMSG_SECURITY_ERROR = "RSEF1001";
|
||||
public static final String FILEMSG_IO_ERROR = "RSEF1002";
|
||||
|
||||
public static final String FILEMSG_FOLDER_NOTEMPTY = "RSEF1003";
|
||||
public static final String FILEMSG_FOLDER_NOTFOUND = "RSEF1004";
|
||||
public static final String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE = "RSEF1005";
|
||||
public static final String FILEMSG_FILE_NOTFOUND = "RSEF1006";
|
||||
|
||||
// --------------------------
|
||||
// SYSTEM VIEW MESSAGES...
|
||||
// --------------------------
|
||||
public static final String MSG_EXPAND_PREFIX = MSG_PREFIX + "Expand.";
|
||||
public static final String MSG_EXPAND_FAILED = "RSEG1098"; //MSG_EXPAND_PREFIX + "Failed";
|
||||
public static final String MSG_EXPAND_CANCELLED = "RSEG1067"; //MSG_EXPAND_PREFIX + "Cancelled";
|
||||
// Message vetoed by UCD
|
||||
//public static final String MSG_EXPAND_CANCELLED = "RSEG1099"; //MSG_EXPAND_PREFIX + "Cancelled";
|
||||
public static final String MSG_EXPAND_EMPTY = "RSEG1100"; //MSG_EXPAND_PREFIX + "Empty";
|
||||
public static final String MSG_EXPAND_FILTERCREATED = "RSEG1102"; //MSG_EXPAND_PREFIX + "FilterCreated";
|
||||
public static final String MSG_EXPAND_CONNECTIONCREATED = "RSEG1108"; //MSG_EXPAND_PREFIX + "ConnectionCreated";
|
||||
|
||||
public static final String MSG_LIST_PREFIX = MSG_PREFIX + "List.";
|
||||
public static final String MSG_LIST_CANCELLED = "RSEG1101"; //MSG_LIST_PREFIX + "Cancelled";
|
||||
|
||||
// ----------------------------------
|
||||
// GENERIC ERROR CHECKING MESSAGES...
|
||||
// ----------------------------------
|
||||
public static final String MSG_ERROR_CONNECTION_NOTFOUND = "RSEG1103";
|
||||
public static final String MSG_ERROR_PROFILE_NOTFOUND = "RSEG1104";
|
||||
public static final String MSG_ERROR_FOLDER_NOTFOUND = "RSEG1105";
|
||||
public static final String MSG_ERROR_FILE_NOTFOUND = "RSEG1106";
|
||||
public static final String MSG_ERROR_FOLDERORFILE_NOTFOUND = "RSEG1107";
|
||||
public static final String MSG_ERROR_ARCHIVEMANAGEMENT_NOTSUPPORTED = "RSEG1304";
|
||||
|
||||
// --------------------------
|
||||
// Generic messages, must substitute in values...
|
||||
// --------------------------
|
||||
public static final String MSG_GENERIC_I = "RSEO1010";
|
||||
public static final String MSG_GENERIC_W = "RSEO1011";
|
||||
public static final String MSG_GENERIC_E = "RSEO1012";
|
||||
public static final String MSG_GENERIC_U = "RSEO1013";
|
||||
public static final String MSG_GENERIC_Q = "RSEO1014";
|
||||
public static final String MSG_GENERIC_I_HELP = "RSEO1000";
|
||||
public static final String MSG_GENERIC_W_HELP = "RSEO1001";
|
||||
public static final String MSG_GENERIC_E_HELP = "RSEO1002";
|
||||
public static final String MSG_GENERIC_U_HELP = "RSEO1003";
|
||||
public static final String MSG_GENERIC_Q_HELP = "RSEO1004";
|
||||
public static final String MSG_GENERIC_I_TWOPARMS_HELP = "RSEO1005";
|
||||
public static final String MSG_GENERIC_W_TWOPARMS_HELP = "RSEO1006";
|
||||
public static final String MSG_GENERIC_E_TWOPARMS_HELP = "RSEO1007";
|
||||
public static final String MSG_GENERIC_U_TWOPARMS_HELP = "RSEO1008";
|
||||
public static final String MSG_GENERIC_Q_TWOPARMS_HELP = "RSEO1009";
|
||||
|
||||
// ----------------------------------
|
||||
// COMMUNICATIONS ERROR CHECKING MESSAGES...
|
||||
// ----------------------------------
|
||||
public static final String MSG_COMM_CONNECT_FAILED = "RSEC1001";
|
||||
public static final String MSG_COMM_AUTH_FAILED = "RSEC1002";
|
||||
public static final String MSG_COMM_PWD_INVALID = "RSEC1004";
|
||||
|
||||
public static final String MSG_COMM_PWD_EXISTS = "RSEC2101";
|
||||
public static final String MSG_COMM_PWD_MISMATCH = "RSEC2102";
|
||||
public static final String MSG_COMM_PWD_BLANKFIELD = "RSEC2103";
|
||||
|
||||
public static final String MSG_COMM_ENVVAR_DUPLICATE = "RSEC2001";
|
||||
public static final String MSG_COMM_ENVVAR_NONAME = "RSEC2002";
|
||||
public static final String MSG_COMM_ENVVAR_INVALIDCHAR = "RSEC2004";
|
||||
|
||||
public static final String MSG_COMM_DAEMON_NOTSTARTED = "RSEC2201";
|
||||
|
||||
public static final String MSG_COMM_SERVER_NOTSTARTED = "RSEC2301";
|
||||
public static final String MSG_COMM_INVALID_LOGIN = "RSEC2302";
|
||||
|
||||
public static final String MSG_COMM_INCOMPATIBLE_PROTOCOL = "RSEC2303";
|
||||
public static final String MSG_COMM_INCOMPATIBLE_UPDATE = "RSEC2304";
|
||||
|
||||
|
||||
public static final String MSG_COMM_REXEC_NOTSTARTED = "RSEC2305";
|
||||
|
||||
public static final String MSG_COMM_PORT_WARNING = "RSEC2306";
|
||||
|
||||
public static final String MSG_COMM_SERVER_OLDER_WARNING = "RSEC2308";
|
||||
public static final String MSG_COMM_CLIENT_OLDER_WARNING = "RSEC2309";
|
||||
|
||||
// Unexpected error message
|
||||
public static final String MSG_ERROR_UNEXPECTED = "RSEF8002";
|
||||
|
||||
// Connection doesn't exist
|
||||
public static final String MSG_CONNECTION_DELETED = "RSEF5011";
|
||||
|
||||
// Remote editing messages
|
||||
public static final String MSG_DOWNLOAD_NO_WRITE = "RSEF5002";
|
||||
public static final String MSG_DOWNLOAD_ALREADY_OPEN_IN_EDITOR = "RSEF5009";
|
||||
public static final String MSG_UPLOAD_FILE_EXISTS = "RSEF5012";
|
||||
|
||||
// General error message
|
||||
public static final String MSG_ERROR_GENERAL = "RSEO1002";
|
||||
|
||||
// file transfer message
|
||||
public static final String MSG_TRANSFER_INVALID = "RSEG1270";
|
||||
|
||||
|
||||
// remote error list title message
|
||||
public static final String MSG_ERROR_LIST_TITLE = "RSEG1500";
|
||||
|
||||
// name validation
|
||||
public static final String MSG_ERROR_EXTENSION_EMPTY = "RSEF6001";
|
||||
public static final String MSG_ERROR_FILENAME_INVALID = "RSEF6002";
|
||||
|
||||
// cache preferences
|
||||
public static final String MSG_CACHE_UPLOAD_BEFORE_DELETE = "RSEF6101";
|
||||
public static final String MSG_CACHE_UNABLE_TO_SYNCH = "RSEF6102";
|
||||
|
||||
// remote search messages
|
||||
public static final String MSG_REMOTE_SEARCH_INVALID_REGEX = "RSEG1601";
|
||||
|
||||
// yantzi: artemis 6.0, offline messages
|
||||
public static final String MSG_OFFLINE_CANT_CONNECT = "RSEC3001";
|
||||
|
||||
// file import/export messages
|
||||
public static final String MSG_IMPORT_EXPORT_UNABLE_TO_USE_CONNECTION = "RSEF5101";
|
||||
public static final String MSG_IMPORT_EXPORT_UNEXPECTED_EXCEPTION = "RSEF5102";
|
||||
|
||||
// jar export messages
|
||||
public static final String MSG_REMOTE_JAR_EXPORT_OVERWRITE_FILE = "RSEF5103";
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2003, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* This is used in forms that are used within dialogs and pages, and
|
||||
* specifically with {@link org.eclipse.rse.ui.SystemBaseForm}.
|
||||
* It allows the dialog or page to be called back when the form code calls
|
||||
* setPageComplete, a method within the form class. This way the diaog or
|
||||
* page can themselves call their own setPageComplete method.
|
||||
*/
|
||||
public interface ISystemPageCompleteListener
|
||||
{
|
||||
/**
|
||||
* The callback method.
|
||||
* This is called whenever setPageComplete is called by the form code.
|
||||
* @see {@link SystemBaseForm#addPageCompleteListener(ISystemPageCompleteListener)}
|
||||
*/
|
||||
public void setPageComplete(boolean complete);
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* Keys into preferences bundle.
|
||||
*/
|
||||
public interface ISystemPreferencesConstants
|
||||
{
|
||||
|
||||
// root
|
||||
public static final String ROOT = "org.eclipse.rse.preferences.";
|
||||
|
||||
// keys
|
||||
public static final String SYSTEMTYPE = ROOT + "systemtype";
|
||||
public static final String SYSTEMTYPE_VALUES = ROOT + "systemtype.info";
|
||||
public static final String USERIDPERKEY = ROOT + "useridperkey";
|
||||
public static final String USERIDKEYS = ROOT + "userid.keys";
|
||||
public static final String SHOWFILTERPOOLS = ROOT + "filterpools.show";
|
||||
public static final String ACTIVEUSERPROFILES = ROOT + "activeuserprofiles";
|
||||
public static final String QUALIFY_CONNECTION_NAMES= ROOT + "qualifyconnectionnames";
|
||||
public static final String ORDER_CONNECTIONS = ROOT + "order.connections";
|
||||
public static final String HISTORY_FOLDER = ROOT + "history.folder";
|
||||
public static final String HISTORY_QUALIFIED_FOLDER= ROOT + "history.qualified.folder";
|
||||
public static final String SHOWHIDDEN = ROOT + "showhidden";
|
||||
public static final String SHOWNEWCONNECTIONPROMPT = ROOT + "shownewconnection";
|
||||
public static final String REMEMBER_STATE = ROOT + "rememberState";
|
||||
public static final String USE_DEFERRED_QUERIES = ROOT + "useDeferredQueries";
|
||||
public static final String RESTORE_STATE_FROM_CACHE = ROOT + "restoreStateFromCache";
|
||||
public static final String CASCADE_UDAS_BYPROFILE = ROOT + "uda.cascade";
|
||||
public static final String FILETRANSFERMODEDEFAULT = ROOT + "filetransfermodedefault";
|
||||
public static final String DAEMON_AUTOSTART = ROOT + "daemon.autostart";
|
||||
public static final String DAEMON_PORT = ROOT + "daemon.port";
|
||||
|
||||
public static final String LIMIT_CACHE = ROOT + "limit.cache";
|
||||
public static final String MAX_CACHE_SIZE = ROOT + "max.cache.size";
|
||||
|
||||
public static final String DOSUPERTRANSFER = ROOT + "dosupertransfer";
|
||||
public static final String SUPERTRANSFER_ARC_TYPE = ROOT + "supertransfer.archivetype";
|
||||
|
||||
public static final String DOWNLOAD_BUFFER_SIZE = ROOT + "download.buffer.size";
|
||||
public static final String UPLOAD_BUFFER_SIZE = ROOT + "upload.buffer.size";
|
||||
|
||||
public static final String VERIFY_CONNECTION = ROOT + "verify.connection";
|
||||
|
||||
// DEFAULTS
|
||||
public static final boolean DEFAULT_SHOWFILTERPOOLS = false;
|
||||
public static final boolean DEFAULT_QUALIFY_CONNECTION_NAMES = false;
|
||||
public static final String DEFAULT_SYSTEMTYPE = "";
|
||||
public static final String DEFAULT_USERID = "";
|
||||
//DKM public static final String DEFAULT_ACTIVEUSERPROFILES = "Team;Private";
|
||||
public static final String DEFAULT_ACTIVEUSERPROFILES = "Team";
|
||||
|
||||
public static final String DEFAULT_ORDER_CONNECTIONS = "";
|
||||
public static final String DEFAULT_HISTORY_FOLDER = "";
|
||||
public static final boolean DEFAULT_SHOW_HIDDEN = true;
|
||||
public static final boolean DEFAULT_SHOWNEWCONNECTIONPROMPT = true;
|
||||
public static final boolean DEFAULT_REMEMBER_STATE = true; // changed in R2. Phil
|
||||
public static final boolean DEFAULT_RESTORE_STATE_FROM_CACHE = true; // yantzi: artemis 6.0
|
||||
public static final boolean DEFAULT_CASCADE_UDAS_BYPROFILE = false;
|
||||
public static final int DEFAULT_FILETRANSFERMODE = 0;
|
||||
|
||||
public static final String DEFAULT_TEAMPROFILE = "Team";
|
||||
|
||||
public static final int FILETRANSFERMODE_BINARY = 0;
|
||||
public static final int FILETRANSFERMODE_TEXT = 1;
|
||||
|
||||
public static final boolean DEFAULT_DAEMON_AUTOSTART = false;
|
||||
public static final int DEFAULT_DAEMON_PORT = 4300;
|
||||
|
||||
public static final boolean DEFAULT_LIMIT_CACHE = false;
|
||||
public static final String DEFAULT_MAX_CACHE_SIZE = "512";
|
||||
|
||||
public static final String DEFAULT_SUPERTRANSFER_ARCHIVE_TYPE = "zip";
|
||||
public static final boolean DEFAULT_DOSUPERTRANSFER = true;
|
||||
|
||||
public static final int DEFAULT_DOWNLOAD_BUFFER_SIZE = 4;
|
||||
|
||||
public static final boolean DEFAULT_VERIFY_CONNECTION = true;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
|
||||
|
||||
/**
|
||||
* Any UI part that supports the common rename action can implement
|
||||
* this to enable the rename popup menu action, supplied by the system explorer view.
|
||||
*/
|
||||
public interface ISystemRenameTarget extends ISelectionProvider
|
||||
{
|
||||
/**
|
||||
* Return true if rename should even be shown in the popup menu
|
||||
*/
|
||||
public boolean showRename();
|
||||
/**
|
||||
* Return true if rename should be enabled based on your current selection.
|
||||
*/
|
||||
public boolean canRename();
|
||||
/**
|
||||
* Actually do the rename of currently selected items.
|
||||
* The array of new names matches the currently selected items.
|
||||
* Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)
|
||||
*/
|
||||
public boolean doRename(String[] newNames);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface ISystemStringsInputAction
|
||||
{
|
||||
/**
|
||||
* Set the list of existing filter strings to help with validation.
|
||||
* Called when launched from WorkWithList widget
|
||||
*/
|
||||
public void setExistingStrings(String[] existingStrings, boolean caseSensitive);
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/********************************************************************************
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
/**
|
||||
* This interface should be used to maintain all constants related to colors and fonts
|
||||
* that are settable by the user through preferences
|
||||
*/
|
||||
public interface ISystemThemeConstants {
|
||||
|
||||
// color constants used for messages
|
||||
public static final String MESSAGE_ERROR_COLOR = "MESSAGE_ERROR_COLOR";
|
||||
public static final String MESSAGE_WARNING_COLOR = "MESSAGE_WARNING_COLOR" ;
|
||||
public static final String MESSAGE_INFORMATION_COLOR = "MESSAGE_INFORMATION_COLOR";
|
||||
|
||||
// color constants used by Remote Commnds view
|
||||
public static final String REMOTE_COMMANDS_VIEW_BG_COLOR = "REMOTE_COMMANDS_VIEW_BG_COLOR";
|
||||
public static final String REMOTE_COMMANDS_VIEW_FG_COLOR = "REMOTE_COMMANDS_VIEW_FG_COLOR";
|
||||
public static final String REMOTE_COMMANDS_VIEW_PROMPT_COLOR = "REMOTE_COMMANDS_VIEW_PROMPT_COLOR";
|
||||
|
||||
// font constant used by Remote Commands view
|
||||
public static final String REMOTE_COMMANDS_VIEW_FONT = "REMOTE_COMMANDS_VIEW_FONT";
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2005, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* @author mjberger
|
||||
* This is used in forms that are used within dialogs and pages, and
|
||||
* specifically with {@link org.eclipse.rse.ui.IBMBaseServerLauncherForm}.
|
||||
* It allows the dialog or page to be called back when the form code calls
|
||||
* verify, a method within the form class. This way the diaog or
|
||||
* page can update their error messages if there are any.
|
||||
*/
|
||||
public interface ISystemVerifyListener
|
||||
{
|
||||
/**
|
||||
* The callback method.
|
||||
* This is called whenever verify is called by the form code.
|
||||
*/
|
||||
public void handleVerifyComplete();
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
/**
|
||||
* This massager will take a string an add quotes to it by
|
||||
* wrapping the string in the quote character and doubling
|
||||
* any interior instances of the quote character.
|
||||
*/
|
||||
public class MassagerAddQuotes implements ISystemMassager {
|
||||
|
||||
|
||||
|
||||
private char quote = '\'';
|
||||
|
||||
/**
|
||||
* Construct a new instance of the massager. This instance
|
||||
* assumes the quote character is the apostrophe '\''.
|
||||
*/
|
||||
public MassagerAddQuotes() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new instance of the massager. This instance
|
||||
* uses the supplied character as the quoting character.
|
||||
*
|
||||
* @param quote the quote character to use in quoting strings
|
||||
*/
|
||||
public MassagerAddQuotes(char quote) {
|
||||
this.quote = quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quotes the string by surround the original string with
|
||||
* the quote character and doubling any internal occurences of
|
||||
* the character.
|
||||
*
|
||||
* @param text the string to be quoted
|
||||
* @return the quoted string
|
||||
* @see org.eclipse.rse.ui.ISystemMassager#massage(String)
|
||||
*/
|
||||
public String massage(String text) {
|
||||
|
||||
char[] chars = text.toCharArray();
|
||||
|
||||
/* determine the number of extra quotes needed */
|
||||
int n = 0;
|
||||
for (int i = 0; i < chars.length; i++) {
|
||||
if (chars[i] == quote) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
n += 2;
|
||||
|
||||
/* Allocate and move the characters into the buffer */
|
||||
StringBuffer buf = new StringBuffer(chars.length + n);
|
||||
buf.append(quote);
|
||||
for (int i = 0; i < chars.length; i++) {
|
||||
if (chars[i] == quote) {
|
||||
buf.append(quote);
|
||||
}
|
||||
buf.append(chars[i]);
|
||||
}
|
||||
buf.append(quote);
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* This massager folds the input text into either uppercase or lowercase,
|
||||
* depending on the value pass to the constructor or setter.
|
||||
* <p>
|
||||
* Note by default this also trims the
|
||||
*/
|
||||
public class MassagerFoldCase implements ISystemMassager
|
||||
{
|
||||
|
||||
private boolean uppercase;
|
||||
private boolean trim;
|
||||
|
||||
/**
|
||||
* Constructor using uppercase as the case direction
|
||||
*/
|
||||
public MassagerFoldCase()
|
||||
{
|
||||
this(true);
|
||||
}
|
||||
/**
|
||||
* Constructor using given case direction
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
*/
|
||||
public MassagerFoldCase(boolean foldToUpperCase)
|
||||
{
|
||||
super();
|
||||
setFoldToUpperCase(foldToUpperCase);
|
||||
setTrimBlanks(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle whether to fold to uppercase or lowercase
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
*/
|
||||
public void setFoldToUpperCase(boolean foldToUpperCase)
|
||||
{
|
||||
this.uppercase = foldToUpperCase;
|
||||
}
|
||||
/**
|
||||
* Toggle whether to trim blanks for not
|
||||
* @param trimBlanks - whether to trim blanks (true) or leave them (false).
|
||||
*/
|
||||
public void setTrimBlanks(boolean trimBlanks)
|
||||
{
|
||||
this.trim = trimBlanks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property about whether to fold to uppercase or lowercase
|
||||
* @return true if folder to uppercase, false if folded to lowercaese
|
||||
*/
|
||||
public boolean getFoldToUpperCase()
|
||||
{
|
||||
return uppercase;
|
||||
}
|
||||
/**
|
||||
* Return property about whether to trim blanks for not
|
||||
* @return true if blanks are trimmed
|
||||
*/
|
||||
public boolean getTrimBlanks()
|
||||
{
|
||||
return trim;
|
||||
}
|
||||
/**
|
||||
* @see org.eclipse.rse.ui.ISystemMassager#massage(String)
|
||||
*/
|
||||
public String massage(String text)
|
||||
{
|
||||
if (text == null)
|
||||
return null;
|
||||
if (trim)
|
||||
text = text.trim();
|
||||
if (uppercase)
|
||||
return toUpperCase(text);
|
||||
else
|
||||
return toLowerCase(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrridable method that actually does the uppercasing
|
||||
*/
|
||||
protected String toUpperCase(String input)
|
||||
{
|
||||
return input.toUpperCase();
|
||||
}
|
||||
/**
|
||||
* Overrridable method that actually does the lowercasing
|
||||
*/
|
||||
protected String toLowerCase(String input)
|
||||
{
|
||||
return input.toLowerCase();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* This massager folds the input text into either uppercase or lowercase,
|
||||
* but ONLY for those portions of the string that are not inside delimiters.
|
||||
* <p>
|
||||
* The default delimiter characters checked for are single or double quote characters, but this
|
||||
* can be changed by a setter method. When any of the delimiter characters are
|
||||
* first found we enter delimited (non-folding) mode, until the same
|
||||
* non-escaped delimiter character is found.
|
||||
* <p>
|
||||
* This massager assumes an imbedded delimiter is denoted by a doubled up
|
||||
* delimiter. If this is not the case, a setter can be used for the escape
|
||||
* character.
|
||||
* <p>
|
||||
* This massager takes more time than the MassageFoldCaseUnlessQuoted massager,
|
||||
* as that one just checks if the entire string is delimited, while this one
|
||||
* attempts to check for ranges of delimiting.
|
||||
*/
|
||||
public class MassagerFoldCaseOutsideQuotes extends MassagerFoldCase
|
||||
{
|
||||
|
||||
private static final char[] DEFAULT_DELIMITERS = {'\"', '\''};
|
||||
private char[] delimiters;
|
||||
private char escape = ' ';
|
||||
|
||||
/**
|
||||
* Constructor using uppercase and using single and double quotes as delimiters
|
||||
*/
|
||||
public MassagerFoldCaseOutsideQuotes()
|
||||
{
|
||||
this(true, DEFAULT_DELIMITERS);
|
||||
}
|
||||
/**
|
||||
* Constructor using given case direction, using single and double quotes as delimiters
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
*/
|
||||
public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase)
|
||||
{
|
||||
this(foldToUpperCase, DEFAULT_DELIMITERS);
|
||||
}
|
||||
/**
|
||||
* Constructor using given case direction, using given delimiters
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
* @param delimiters - chars to trigger delimited mode. Delimited sections are not folded.
|
||||
*/
|
||||
public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase, char[] delimiters)
|
||||
{
|
||||
super(foldToUpperCase);
|
||||
setDelimiters(delimiters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the delimiter characters
|
||||
* @param delimiters - chars to trigger delimited mode. Delimited sections are not folded.
|
||||
*/
|
||||
public void setDelimiters(char[] delimiters)
|
||||
{
|
||||
this.delimiters = delimiters;
|
||||
}
|
||||
/**
|
||||
* Set the escape character used for denoted an imbedded delimiter. By default, it is assumed
|
||||
* a doubled up delimiter is used for this.
|
||||
* @param escapeChar - char that escapes the delimiter. Eg '\'
|
||||
*/
|
||||
public void setEscapeCharacter(char escapeChar)
|
||||
{
|
||||
this.escape = escapeChar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the delimiter characters
|
||||
*/
|
||||
public char[] getDelimiters()
|
||||
{
|
||||
return delimiters;
|
||||
}
|
||||
/**
|
||||
* Get the escape character
|
||||
*/
|
||||
public char getEscapeCharacter()
|
||||
{
|
||||
return escape;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrridable method that actually does the uppercasing
|
||||
*/
|
||||
protected String toUpperCase(String input)
|
||||
{
|
||||
if ((input==null) || (input.length() == 0))
|
||||
return input;
|
||||
else if (!hasAnyDelimiters(input)) // no delimit characters?
|
||||
return input.toUpperCase(); // fold it all!
|
||||
else
|
||||
return doFolding(input, true);
|
||||
}
|
||||
/**
|
||||
* Overrridable method that actually does the lowercasing
|
||||
*/
|
||||
protected String toLowerCase(String input)
|
||||
{
|
||||
if ((input==null) || (input.length() == 0))
|
||||
return input;
|
||||
else if (!hasAnyDelimiters(input)) // no delimit characters?
|
||||
return input.toLowerCase(); // fold it all!
|
||||
else
|
||||
return doFolding(input, false);
|
||||
}
|
||||
/**
|
||||
* Check for existence of any delimiters
|
||||
*/
|
||||
protected boolean hasAnyDelimiters(String input)
|
||||
{
|
||||
boolean hasAny = false;
|
||||
for (int idx=0; !hasAny && (idx<delimiters.length); idx++)
|
||||
if (input.indexOf(delimiters[idx]) != -1)
|
||||
hasAny = true;
|
||||
return hasAny;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that actually walks the given string, character by character,
|
||||
* folding all those which are not inside delimiters
|
||||
*/
|
||||
protected String doFolding(String input, boolean upperCase)
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer(input.length());
|
||||
boolean insideDelimiters = false;
|
||||
boolean checkForEscape = (escape != ' ');
|
||||
char currDelimiter = ' ';
|
||||
char prevChar = ' ';
|
||||
char currChar = ' ';
|
||||
for (int idx=0; idx<input.length(); idx++)
|
||||
{
|
||||
prevChar = currChar;
|
||||
currChar = input.charAt(idx);
|
||||
// ------------------------
|
||||
// outside of delimiters...
|
||||
// ------------------------
|
||||
if (!insideDelimiters)
|
||||
{
|
||||
// append folded
|
||||
if (upperCase)
|
||||
buffer.append(Character.toUpperCase(currChar));
|
||||
else
|
||||
buffer.append(Character.toLowerCase(currChar));
|
||||
// check if this is the start of delimiting...
|
||||
if (isDelimiter(currChar))
|
||||
{
|
||||
currDelimiter = currChar;
|
||||
insideDelimiters = true; // enter delimited mode
|
||||
}
|
||||
}
|
||||
// -----------------------
|
||||
// inside of delimiters...
|
||||
// -----------------------
|
||||
else
|
||||
{
|
||||
buffer.append(currChar); // append as is
|
||||
// check if this is the end of delimiting...
|
||||
if (currChar == currDelimiter)
|
||||
{
|
||||
// ensure this isn't an escaped delimiter
|
||||
if (!checkForEscape || (prevChar != escape))
|
||||
insideDelimiters = false; // exit delimited mode
|
||||
}
|
||||
}
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
/**
|
||||
* Check if given character is one of the delimiters
|
||||
*/
|
||||
protected boolean isDelimiter(char currChar)
|
||||
{
|
||||
for (int idx=0; idx<delimiters.length; idx++)
|
||||
if (currChar == delimiters[idx])
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
/**
|
||||
* This massager folds the input text into either uppercase or lowercase,
|
||||
* but ONLY if the given input is not delimited. The default delimiter checked
|
||||
* for is the double quote character, but this can be changed by a setter method.
|
||||
*/
|
||||
public class MassagerFoldCaseUnlessQuoted extends MassagerFoldCase
|
||||
{
|
||||
|
||||
private char delimiter;
|
||||
|
||||
/**
|
||||
* Constructor using uppercase and using a double quote as delimiter
|
||||
*/
|
||||
public MassagerFoldCaseUnlessQuoted()
|
||||
{
|
||||
this(true, '\"');
|
||||
}
|
||||
/**
|
||||
* Constructor using given case direction, using a double quote as delimiter
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
*/
|
||||
public MassagerFoldCaseUnlessQuoted(boolean foldToUpperCase)
|
||||
{
|
||||
this(foldToUpperCase, '\"');
|
||||
}
|
||||
/**
|
||||
* Constructor using given case direction, using given delimiter
|
||||
* @param foldToUpperCase - whether to fold to uppercase (true) or lowercase (false).
|
||||
* @param delimiter - char to check if text is enclosed with. If it is, then no folding is done.
|
||||
*/
|
||||
public MassagerFoldCaseUnlessQuoted(boolean foldToUpperCase, char delimiter)
|
||||
{
|
||||
super(foldToUpperCase);
|
||||
setDelimiter(delimiter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the delimiter character
|
||||
* @param delimiter - char to check if text is enclosed with. If it is, then no folding is done.
|
||||
*/
|
||||
public void setDelimiter(char delimiter)
|
||||
{
|
||||
this.delimiter = delimiter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the delimiter character
|
||||
*/
|
||||
public char getDelimiter()
|
||||
{
|
||||
return delimiter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrridable method that actually does the uppercasing
|
||||
*/
|
||||
protected String toUpperCase(String input)
|
||||
{
|
||||
if ((input.length() >= 2) &&
|
||||
(input.charAt(0) == delimiter) && // start with delimiter?
|
||||
(input.charAt(input.length()-1) == delimiter)) // end with delimiter?
|
||||
return input; // do nothing
|
||||
else
|
||||
return input.toUpperCase(); // fold
|
||||
}
|
||||
/**
|
||||
* Overrridable method that actually does the lowercasing
|
||||
*/
|
||||
protected String toLowerCase(String input)
|
||||
{
|
||||
if ((input.length() >= 2) &&
|
||||
(input.charAt(0) == delimiter) && // start with delimiter?
|
||||
(input.charAt(input.length()-1) == delimiter)) // end with delimiter?
|
||||
return input; // do nothing
|
||||
else
|
||||
return input.toLowerCase(); // fold
|
||||
}
|
||||
}
|
|
@ -0,0 +1,192 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
/**
|
||||
* Utility class used by UI widgets to format a srcpf or member Description string.<br>
|
||||
* It checks to see if the string is legally quoted, and if not, it returns it as is. A legally quoted
|
||||
* string is one which begins and ends with single quotes, and where all single quotes inside the
|
||||
* string are escaped with another single quote. If the string is legally quoted, it de-quotes it
|
||||
* (hence the name). Dequoting means remove the single quotes, and remove any escape quotes
|
||||
* from the inside of the string.
|
||||
* There is also a general constructor that takes in the quoting character, the character to escape,
|
||||
* and the character to use as an escape charcter. It also takes n a boolean flag that decides wether
|
||||
* or not the string has to be quoted before this massager actually does the job.
|
||||
*/
|
||||
public class MassagerRemoveQuotes implements ISystemMassager {
|
||||
|
||||
|
||||
|
||||
private String quoteChar;
|
||||
private String charToEscape;
|
||||
private String escapeChar;
|
||||
private boolean mustBeQuoted;
|
||||
|
||||
/**
|
||||
* Default constructor for MassagerRemoveQuotes.<br>
|
||||
* Assumes that a legal string is one where the string is quoted with single quotes,
|
||||
* and all inner quotes are escaped with a single quote.
|
||||
*/
|
||||
public MassagerRemoveQuotes() {
|
||||
this('\'', '\'', '\'', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic constructor. A valid string is one where every charToEscape is actually
|
||||
* escaped with an escapeChar before it. If mustBeQuoted is true, then the string
|
||||
* is only valid if it is quoted with the quoteChar, and the characters inside the
|
||||
* string itself are properly escaped. If the string is determined to be a valid string,
|
||||
* this massager returns the string with the quotes and escape characters stripped out.
|
||||
* if not, the string is returned as is.
|
||||
*/
|
||||
public MassagerRemoveQuotes(
|
||||
char quoteChar,
|
||||
char charToEscape,
|
||||
char escapeChar,
|
||||
boolean mustBeQuoted) {
|
||||
|
||||
this.quoteChar = String.valueOf(quoteChar);
|
||||
this.charToEscape = String.valueOf(charToEscape);
|
||||
this.escapeChar = String.valueOf(escapeChar);
|
||||
this.mustBeQuoted = mustBeQuoted;
|
||||
}
|
||||
|
||||
public String massage(String text) {
|
||||
String strippedText = text;
|
||||
|
||||
if (mustBeQuoted) {
|
||||
if (!isQuoted(text))
|
||||
// String is not quoted, when it should be, return it as is.
|
||||
// No need to de-quote since it is not a legal string.
|
||||
return text;
|
||||
else
|
||||
strippedText = stripQuotes(text);
|
||||
}
|
||||
|
||||
// check to see if string is a legal string, and if it is, de-quote it.
|
||||
boolean islegal = isLegalString(strippedText);
|
||||
if (islegal)
|
||||
return deQuote(strippedText);
|
||||
else
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if string is single quoted.
|
||||
*/
|
||||
protected boolean isQuoted(String text) {
|
||||
if (text.startsWith(quoteChar) && text.endsWith(quoteChar))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if we have a valid string. A valid string is one where all
|
||||
* quotes are escaped with another quote.
|
||||
*/
|
||||
protected boolean isLegalString(String text) {
|
||||
if (charToEscape.equals(escapeChar))
|
||||
return doForwardChecking(text);
|
||||
else
|
||||
return doBackwardChecking(text);
|
||||
}
|
||||
|
||||
private boolean doForwardChecking(String text) {
|
||||
int index = text.indexOf(charToEscape);
|
||||
while (index != -1) {
|
||||
// check the char AFTER the escape char since they are both the
|
||||
// same. . Be careful if it is the last char.
|
||||
if ((index == text.length() - 1)
|
||||
|| (text.charAt(index + 1) != escapeChar.charAt(0)))
|
||||
// we have a quote that is not escaped => not a legal string.
|
||||
return false;
|
||||
|
||||
// search for another quote *after* the escaped one.
|
||||
index = text.indexOf(charToEscape, index + 2);
|
||||
}
|
||||
|
||||
// all quotes are escaped, legal string.
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
private boolean doBackwardChecking(String text) {
|
||||
int index = text.indexOf(charToEscape);
|
||||
while (index != -1) {
|
||||
// check the char before the character to escape. Be careful if it is the first char.
|
||||
if ((index == 0)
|
||||
|| (text.charAt(index - 1) != escapeChar.charAt(0)))
|
||||
// we have a quote that is not escaped => not a legal string.
|
||||
return false;
|
||||
|
||||
// search for another quote *after* the escaped one.
|
||||
index = text.indexOf(charToEscape, index + 1);
|
||||
}
|
||||
|
||||
// all quotes are escaped, legal string.
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes first and last chars if they are single quotes, otherwise
|
||||
* returns the string as is.
|
||||
*/
|
||||
private String stripQuotes(String text) {
|
||||
if (isQuoted(text)) {
|
||||
text = text.substring(1, text.length() - 1);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method assumes that the passed string is a legal string, and it does
|
||||
* the qe-quoting.
|
||||
*/
|
||||
private String deQuote(String text) {
|
||||
if (charToEscape.equals(escapeChar))
|
||||
return doForwardDeQuote(text);
|
||||
else
|
||||
return doBackwardDeQuote(text);
|
||||
}
|
||||
|
||||
private String doForwardDeQuote(String text) {
|
||||
int index = text.indexOf(charToEscape);
|
||||
while (index != -1) {
|
||||
// strip the escape char.
|
||||
text = text.substring(0, index) + text.substring(index + 1);
|
||||
|
||||
// search for another quote *after* the escaped one.
|
||||
index = text.indexOf(charToEscape, index + 2);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private String doBackwardDeQuote(String text) {
|
||||
int index = text.indexOf(charToEscape);
|
||||
while (index != -1) {
|
||||
// strip the escape char.
|
||||
text = text.substring(0, index - 1) + text.substring(index);
|
||||
|
||||
// search for another quote *after* the escaped one.
|
||||
index = text.indexOf(charToEscape, index + 1);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,578 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2000, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.rse.ui.widgets.InheritableEntryField;
|
||||
import org.eclipse.swt.events.ArmListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A class for creating unique mnemonics per control per window.
|
||||
*/
|
||||
public class Mnemonics
|
||||
{
|
||||
private static final String[] TransparentEndings = { // endings that should appear after a mnemonic
|
||||
"...", // ellipsis
|
||||
">>", // standard "more"
|
||||
"<<", // standard "less"
|
||||
">", // "more" -- non-standard usage, must appear in list after >>
|
||||
"<", // "less" -- non-standard usage, must appear in list after <<
|
||||
":", // colon
|
||||
"\uff0e\uff0e\uff0e", // wide ellipsis
|
||||
"\uff1e\uff1e", // wide standard "more"
|
||||
"\uff1c\uff1c", // wide standard "less"
|
||||
"\uff1e", // wide non-standard "more"
|
||||
"\uff1c", // wide non-standard "less"
|
||||
"\uff1a" // wide colon
|
||||
};
|
||||
|
||||
private StringBuffer mnemonics = new StringBuffer(); // mnemonics used so far
|
||||
private static final String candidateChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
private String preferencePageMnemonics = null; // mnemonics used by Eclipse on preference pages
|
||||
private String wizardPageMnemonics = null; // mnemonics used by Eclipse on wizard pages
|
||||
// private static String preferencePageMnemonics = "AD"; // mnemonics used by Eclipse on preference pages
|
||||
// private static String wizardPageMnemonics = "FBN"; // mnemonics used by Eclipse on wizard pages
|
||||
public static final char MNEMONIC_CHAR = '&';
|
||||
private boolean onPrefPage = false;
|
||||
private boolean onWizardPage = false;
|
||||
private boolean applyMnemonicsToPrecedingLabels = true;
|
||||
|
||||
/**
|
||||
* Clear the list for re-use
|
||||
*/
|
||||
public void clear()
|
||||
{
|
||||
mnemonics = new StringBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts an added mnemonic of the form (&x) into a StringBuffer at the correct point.
|
||||
* Checks for transparent endings and trailing spaces.
|
||||
* @param label the label to check
|
||||
*/
|
||||
private static void insertMnemonic(StringBuffer label, String mnemonic) {
|
||||
int p = label.length();
|
||||
// check for trailing spaces #1
|
||||
while (p > 0 && label.charAt(p - 1) == ' ') {
|
||||
p--;
|
||||
}
|
||||
// check for transparent endings
|
||||
for (int i = 0; i < TransparentEndings.length; i++) {
|
||||
String transparentEnding = TransparentEndings[i];
|
||||
int l = transparentEnding.length();
|
||||
int n = p - l;
|
||||
if (n >= 0) {
|
||||
String labelEnding = label.substring(n, n + l);
|
||||
if (labelEnding.equals(transparentEnding)) {
|
||||
p = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check for trailing spaces #2
|
||||
while (p > 0 && label.charAt(p - 1) == ' ') {
|
||||
p--;
|
||||
}
|
||||
// make sure there is something left to attach a mnemonic to
|
||||
if (p > 0) {
|
||||
label.insert(p, mnemonic);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a string, this starts at the first character and iterates until
|
||||
* it finds a character not previously used as a mnemonic on this page.
|
||||
* Not normally called from other classes, but rather by the setMnemonic
|
||||
* methods in this class.
|
||||
* @param label String to which to generate and apply the mnemonic
|
||||
* @return input String with '&' inserted in front of the unique character
|
||||
*/
|
||||
public String setUniqueMnemonic(String label)
|
||||
{
|
||||
|
||||
// Kludge for now
|
||||
// If there is already a mnemonic, remove it
|
||||
label = removeMnemonic(label);
|
||||
//int iMnemonic = label.indexOf( MNEMONIC_CHAR );
|
||||
//if( iMnemonic >= 0 && iMnemonic < label.length() - 1 ){
|
||||
//mnemonics.append( label.charAt( iMnemonic + 1 ) );
|
||||
//return label;
|
||||
//}
|
||||
|
||||
int labelLen = label.length();
|
||||
if (labelLen == 0)
|
||||
return label;
|
||||
else if ((labelLen == 1) && label.equals("?"))
|
||||
return label;
|
||||
StringBuffer newLabel = new StringBuffer(label);
|
||||
int mcharPos = findUniqueMnemonic(label);
|
||||
if (mcharPos != -1)
|
||||
newLabel.insert(mcharPos,MNEMONIC_CHAR);
|
||||
// if no unique character found, then
|
||||
// find a new arbitrary one from the alphabet...
|
||||
else
|
||||
{
|
||||
mcharPos = findUniqueMnemonic(candidateChars);
|
||||
if (mcharPos != -1)
|
||||
{
|
||||
String addedMnemonic = "(" + MNEMONIC_CHAR + candidateChars.charAt(mcharPos) + ")";
|
||||
insertMnemonic(newLabel, addedMnemonic);
|
||||
}
|
||||
}
|
||||
return newLabel.toString();
|
||||
} // end getUniqueMnemonic
|
||||
/**
|
||||
* Given a label and mnemonic, this applies that mnemonic to the label.
|
||||
* Not normally called from other classes, but rather by the setUniqueMnemonic
|
||||
* methods in this class.
|
||||
* @param label String to which to apply the mnemonic
|
||||
* @param mnemonicChar the character that is to be the mnemonic character
|
||||
* @return input String with '&' inserted in front of the given character
|
||||
*/
|
||||
public static String applyMnemonic(String label, char mnemonicChar)
|
||||
{
|
||||
int labelLen = label.length();
|
||||
if (labelLen == 0)
|
||||
return label;
|
||||
StringBuffer newLabel = new StringBuffer(label);
|
||||
int mcharPos = findCharPos(label, mnemonicChar);
|
||||
if (mcharPos != -1)
|
||||
newLabel.insert(mcharPos,MNEMONIC_CHAR);
|
||||
else
|
||||
{
|
||||
String addedMnemonic = new String("("+MNEMONIC_CHAR + mnemonicChar + ")");
|
||||
insertMnemonic(newLabel, addedMnemonic);
|
||||
}
|
||||
return newLabel.toString();
|
||||
} // end getUniqueMnemonic
|
||||
/**
|
||||
* Given a char, find its position in the given string
|
||||
*/
|
||||
private static int findCharPos(String label, char charToFind)
|
||||
{
|
||||
int pos = -1;
|
||||
for (int idx=0; (pos==-1) && (idx<label.length()); idx++)
|
||||
if (label.charAt(idx) == charToFind)
|
||||
pos = idx;
|
||||
return pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if given char is a unique mnemonic
|
||||
*/
|
||||
public boolean isUniqueMnemonic(char currchar)
|
||||
{
|
||||
boolean isUnique = true;
|
||||
for (int idx=0; isUnique && (idx < mnemonics.length()); idx++)
|
||||
if (mnemonics.charAt(idx) == currchar)
|
||||
isUnique = false;
|
||||
return isUnique;
|
||||
}
|
||||
/**
|
||||
* Find a uniqe mnemonic char in given string.
|
||||
* Note if one is found, it is added to the list of currently used mnemonics!
|
||||
*
|
||||
* @param string to search each char for unique candidate
|
||||
* @return index position of unique character in input string, or -1 if none found.
|
||||
*/
|
||||
public int findUniqueMnemonic(String label)
|
||||
{
|
||||
int labelLen = label.length();
|
||||
if (labelLen == 0)
|
||||
return -1;
|
||||
int retcharPos = -1;
|
||||
label = label.toUpperCase();
|
||||
char currchar = label.charAt(0);
|
||||
boolean isUnique = false;
|
||||
|
||||
// if we're on a preference page, get the preference page mnemonics
|
||||
if (onPrefPage) {
|
||||
|
||||
if (preferencePageMnemonics == null) {
|
||||
preferencePageMnemonics = getPreferencePageMnemonics();
|
||||
}
|
||||
}
|
||||
|
||||
// if we're on a wizard page, get the wizard page mnemonics
|
||||
if (onWizardPage) {
|
||||
|
||||
if (wizardPageMnemonics == null) {
|
||||
wizardPageMnemonics = getWizardPageMnemonics();
|
||||
}
|
||||
}
|
||||
|
||||
// attempt to find the first character in the given
|
||||
// string that has not already been used as a mnemonic
|
||||
for (int idx=0; (idx<labelLen) && (retcharPos==-1); idx++)
|
||||
{
|
||||
currchar = label.charAt(idx);
|
||||
|
||||
if ( !(onPrefPage && preferencePageMnemonics.indexOf( currchar ) != -1)
|
||||
&& !(onWizardPage && wizardPageMnemonics.indexOf( currchar ) != -1)
|
||||
&& candidateChars.indexOf( currchar ) != -1 )
|
||||
{
|
||||
isUnique = isUniqueMnemonic(currchar);
|
||||
if (isUnique)
|
||||
{
|
||||
mnemonics.append(currchar);
|
||||
retcharPos = idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
return retcharPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string containing the mnemonics for a preference page.
|
||||
* @return the mnemonics.
|
||||
*/
|
||||
private String getPreferencePageMnemonics() {
|
||||
String[] labels = JFaceResources.getStrings(new String[] { "defaults", "apply" });
|
||||
return getMnemonicsFromStrings(labels).toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string containing the mnemonics for a wizard page.
|
||||
* @return the mnemonics.
|
||||
*/
|
||||
private String getWizardPageMnemonics() {
|
||||
String[] labels = new String[] {IDialogConstants.BACK_LABEL, IDialogConstants.NEXT_LABEL, IDialogConstants.FINISH_LABEL};
|
||||
return getMnemonicsFromStrings(labels).toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string with the mnemonics for a given array of strings.
|
||||
* @param strings the array of strings.
|
||||
* @return a string containing the mnemonics.
|
||||
*/
|
||||
private String getMnemonicsFromStrings(String[] strings) {
|
||||
|
||||
StringBuffer result = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < strings.length; i++) {
|
||||
int idx = strings[i].indexOf(MNEMONIC_CHAR);
|
||||
|
||||
if (idx != -1) {
|
||||
result.append(strings[i].charAt(idx+1));
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a mnemonic to an SWT Button such that the user can select it via Ctrl/Alt+mnemonic.
|
||||
* Note a mnemonic unique to this window is chosen
|
||||
*/
|
||||
public void setMnemonic(Button button)
|
||||
{
|
||||
removeMnemonic(button); // just in case it already has a mnemonic
|
||||
String text = button.getText();
|
||||
if ((text != null) && (text.trim().length() > 0))
|
||||
button.setText(setUniqueMnemonic(text));
|
||||
}
|
||||
/**
|
||||
* If a button is removed from a dialog window, call this method to remove its mnemonic from the list for this dialog.
|
||||
* This frees it up for another button to use.
|
||||
*/
|
||||
public void removeMnemonic(Button button)
|
||||
{
|
||||
String text = button.getText();
|
||||
if (text == null)
|
||||
return;
|
||||
int idx = text.indexOf(MNEMONIC_CHAR);
|
||||
if (idx >= 0)
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer(text);
|
||||
char mchar = buffer.charAt(idx+1); // the char after the &
|
||||
buffer.deleteCharAt(idx); // delete the &
|
||||
boolean found = false;
|
||||
for (int mdx=0; !found && (mdx < mnemonics.length()); mdx++)
|
||||
if (mnemonics.charAt(mdx) == mchar)
|
||||
{
|
||||
found = true;
|
||||
mnemonics.deleteCharAt(mdx);
|
||||
}
|
||||
|
||||
button.setText(buffer.toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Helper method to strip the mnemonic from a string.
|
||||
* Useful if using Eclipse supplied labels
|
||||
*/
|
||||
public static String removeMnemonic(String text)
|
||||
{
|
||||
int idx = text.indexOf(MNEMONIC_CHAR);
|
||||
if (idx >= 0)
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer(text);
|
||||
char mchar = buffer.charAt(idx+1); // the char after the &
|
||||
buffer.deleteCharAt(idx); // delete the &
|
||||
|
||||
// in case of already appended (&X), remove the remaining (X)
|
||||
if ( buffer.length() > (1 + idx) && idx > 1 && buffer.charAt(idx+1) == ')' && buffer.charAt(idx-1) == '(' )
|
||||
buffer.delete(idx - 1, idx + 2);
|
||||
return buffer.toString();
|
||||
}
|
||||
else
|
||||
return text;
|
||||
}
|
||||
/**
|
||||
* Remove and free up mnemonic
|
||||
*/
|
||||
public String removeAndFreeMnemonic(String text)
|
||||
{
|
||||
int idx = text.indexOf(MNEMONIC_CHAR);
|
||||
if (idx >= 0)
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer(text);
|
||||
char mchar = buffer.charAt(idx+1); // the char after the &
|
||||
buffer.deleteCharAt(idx); // delete the &
|
||||
boolean found = false;
|
||||
for (int mdx=0; !found && (mdx < mnemonics.length()); mdx++)
|
||||
if (mnemonics.charAt(mdx) == mchar)
|
||||
{
|
||||
found = true;
|
||||
mnemonics.deleteCharAt(mdx);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
else
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to return the mnemonic from a string.
|
||||
* Helpful when it is necessary to know the mnemonic assigned so it can be reassigned,
|
||||
* such as is necessary for buttons which toggle their text.
|
||||
* @return the mnemonic if assigned, else a blank character.
|
||||
*/
|
||||
public static char getMnemonic(String text)
|
||||
{
|
||||
int idx = text.indexOf(MNEMONIC_CHAR);
|
||||
if (idx >= 0)
|
||||
return text.charAt(idx+1);
|
||||
else
|
||||
return ' ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a Composite, this method walks all the children recursively and
|
||||
* and sets the mnemonics uniquely for each child control where a
|
||||
* mnemonic makes sense (eg, buttons).
|
||||
* The letter/digit chosen for the mnemonic is unique for this Composite,
|
||||
* so you should call this on as high a level of a composite as possible
|
||||
* per Window.
|
||||
* Call this after populating your controls.
|
||||
*/
|
||||
public void setMnemonics(Composite parent)
|
||||
{
|
||||
Control children[] = parent.getChildren();
|
||||
if (children != null)
|
||||
{
|
||||
//com.ibm.etools.systems.SystemPlugin.getDefault().logMessage("setMnemonics: child count = " + children.length);
|
||||
Control currChild = null;
|
||||
boolean bSetText = false;
|
||||
for (int idx=0; idx < children.length; idx++)
|
||||
{
|
||||
currChild = children[idx];
|
||||
// composite? Recurse
|
||||
// d54732: but do not recurse if it is a combo! For a combo, we want to check
|
||||
// if there is a preceding label. It's meaningless for a combo to
|
||||
// have children anyway (KM)
|
||||
if ((currChild instanceof Composite) &&
|
||||
(!applyMnemonicsToPrecedingLabels || (applyMnemonicsToPrecedingLabels &&
|
||||
!(currChild instanceof Combo) && !(currChild instanceof InheritableEntryField))))
|
||||
setMnemonics((Composite)currChild);
|
||||
// button? select and apply unique mnemonic...
|
||||
else if (currChild instanceof Button)
|
||||
{
|
||||
Button currButton = (Button)currChild;
|
||||
String text = currButton.getText();
|
||||
if ((text!=null) && (text.trim().length()>0))
|
||||
{
|
||||
currButton.setText(setUniqueMnemonic(text));
|
||||
bSetText = true;
|
||||
}
|
||||
}
|
||||
// entry field or combo box? select and apply unique mnemonic to preceding label...
|
||||
else if (applyMnemonicsToPrecedingLabels && (idx>0) && ((currChild instanceof Text) || (currChild instanceof Combo) || (currChild instanceof InheritableEntryField)) &&
|
||||
(children[idx-1] instanceof Label))
|
||||
{
|
||||
Label currLabel = (Label)children[idx-1];
|
||||
String text = currLabel.getText();
|
||||
if ((text!=null) && (text.trim().length()>0))
|
||||
{
|
||||
currLabel.setText(setUniqueMnemonic(text));
|
||||
bSetText = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( bSetText == true )
|
||||
parent.layout(true); // in case a (x) was appended, we need to layout the controls again
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a menu, this method walks all the items and assigns each a unique
|
||||
* memnonic. Also handles casdading submenus.
|
||||
* Call this after populating the menu.
|
||||
*/
|
||||
public void setMnemonics(Menu menu)
|
||||
{
|
||||
MenuItem[] children = menu.getItems();
|
||||
if ((children != null) && (children.length>0))
|
||||
{
|
||||
MenuItem currChild = null;
|
||||
for (int idx=0; idx < children.length; idx++)
|
||||
{
|
||||
currChild = children[idx];
|
||||
String text = currChild.getText();
|
||||
if ((text!=null)&&(text.length()>0))
|
||||
{
|
||||
if (text.indexOf(MNEMONIC_CHAR) < 0) // bad things happen when setting mnemonics twice!
|
||||
{
|
||||
Image image = currChild.getImage();
|
||||
currChild.setText(setUniqueMnemonic(text));
|
||||
if (image != null)
|
||||
currChild.setImage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a menu, this method walks all the items and assigns each a unique
|
||||
* memnonic. Also handles casdading submenus.
|
||||
* <p>
|
||||
* Also, since while we are at it, this overloaded method also sets a given ArmListener
|
||||
* to each menu item, perhaps for the purpose of displaying tooltip text.
|
||||
* It makes sense to do this when doing mnemonics because both must be done for every menu item
|
||||
* with text and must be done exactly once for each.
|
||||
* <p>
|
||||
* Call this after populating the menu.
|
||||
*/
|
||||
public void setMnemonicsAndArmListener(Menu menu, ArmListener listener)
|
||||
{
|
||||
MenuItem[] children = menu.getItems();
|
||||
if ((children != null) && (children.length>0))
|
||||
{
|
||||
MenuItem currChild = null;
|
||||
for (int idx=0; idx < children.length; idx++)
|
||||
{
|
||||
currChild = children[idx];
|
||||
String text = currChild.getText();
|
||||
if ((text!=null)&&(text.length()>0))
|
||||
{
|
||||
int mnemonicIndex = text.indexOf(MNEMONIC_CHAR);
|
||||
if (mnemonicIndex < 0) // bad things happen when setting mnemonics twice!
|
||||
{
|
||||
Image image = currChild.getImage();
|
||||
currChild.setText(setUniqueMnemonic(text));
|
||||
if (image != null)
|
||||
currChild.setImage(image);
|
||||
currChild.addArmListener(listener);
|
||||
}
|
||||
else
|
||||
// hmm, already has a mnemonic char. Either it is an Eclipse/BP-supplied action, or we have been here before.
|
||||
// The distinction is important as want to add an Arm listener, but only once!
|
||||
{
|
||||
// for now we do the brute force ugly thing...
|
||||
Image image = currChild.getImage();
|
||||
|
||||
// need to adjust any action that already has this mnemonic
|
||||
char c = text.charAt(mnemonicIndex + 1);
|
||||
|
||||
// anything already have this?
|
||||
if (!isUniqueMnemonic(c))
|
||||
{
|
||||
// if so, we need to adjust existing action
|
||||
for (int n = 0; n < idx; n++)
|
||||
{
|
||||
MenuItem oChild = children[n];
|
||||
String oText = oChild.getText();
|
||||
char oldN = getMnemonic(oText);
|
||||
if (oldN == c)
|
||||
{
|
||||
// this one now needs to change
|
||||
String cleanText = removeMnemonic(oText);
|
||||
oChild.setText(setUniqueMnemonic(cleanText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
text = removeAndFreeMnemonic(text);
|
||||
currChild.setText(setUniqueMnemonic(text));
|
||||
if (image != null)
|
||||
currChild.setImage(image);
|
||||
currChild.removeArmListener(listener); // just in case
|
||||
currChild.addArmListener(listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the mnemonics are for a preference page
|
||||
* Preference pages already have a few buttons with mnemonics set by Eclipse
|
||||
* We have to make sure we do not use the ones they use
|
||||
*/
|
||||
public Mnemonics setOnPreferencePage(boolean page)
|
||||
{
|
||||
this.onPrefPage = page;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the mnemonics are for a wizard page
|
||||
* Wizard pages already have a few buttons with mnemonics set by Eclipse
|
||||
* We have to make sure we do not use the ones they use
|
||||
*/
|
||||
public Mnemonics setOnWizardPage(boolean page)
|
||||
{
|
||||
this.onWizardPage = page;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
|
||||
* This is for consistency with Eclipse. Only set to <code>false</code> if it does not work
|
||||
* in your dialog, wizard, preference or property page, i.e. you have labels preceding these
|
||||
* widgets that do not necessarily refer to them.
|
||||
* @param apply <code>true</code> to apply mnemonic to preceding labels, <code>false</code> otherwise.
|
||||
* @return this instance, for convenience
|
||||
*/
|
||||
public Mnemonics setApplyMnemonicsToPrecedingLabels(boolean apply) {
|
||||
this.applyMnemonicsToPrecedingLabels = apply;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,303 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A reusable base form.
|
||||
* <p>
|
||||
* May be used to populate a dialog or a wizard page or properties page.
|
||||
* Often we need to support multiple ways to edit the same thing, and we need to
|
||||
* abstract out the client area. This base class puts some structure around these
|
||||
* abstractions. Note we don't extend Composite. Rather the subclass will create
|
||||
* and return the composite in createContents(). This offers us more flexibility
|
||||
* in how/where this is used.
|
||||
* <p>
|
||||
* For error checking, subclasses should simply call setPageComplete whenever they
|
||||
* do error checking (such as in response to an event). This will then call any
|
||||
* interested listeners who have registered via {@link #addPageCompleteListener(ISystemPageCompleteListener)}.
|
||||
* Error messages should be set via {@link #showErrorMessage(SystemMessage)}.
|
||||
*/
|
||||
|
||||
public abstract class SystemBaseForm
|
||||
implements Listener, ISystemConnectionWizardErrorUpdater //, ISystemMessages
|
||||
{
|
||||
|
||||
private ISystemMessageLine msgLine;
|
||||
private Shell shell;
|
||||
private Object inputObject, outputObject;
|
||||
private Vector pageCompleteListeners;
|
||||
private boolean complete;
|
||||
protected Vector verifyListeners;
|
||||
protected boolean alreadyNotified;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @deprecated You should now use the constructor that takes a shell.
|
||||
* @param msgLine A GUI widget capable of writing error messages to.
|
||||
*/
|
||||
public SystemBaseForm(ISystemMessageLine msgLine)
|
||||
{
|
||||
this.msgLine = msgLine;
|
||||
}
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell The parent shell.
|
||||
* @param msgLine A GUI widget capable of writing error messages to.
|
||||
*/
|
||||
public SystemBaseForm(Shell shell, ISystemMessageLine msgLine)
|
||||
{
|
||||
this.msgLine = msgLine;
|
||||
this.shell = shell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Often the message line is null at the time of instantiation, so we have to call this after
|
||||
* it is created.
|
||||
*/
|
||||
public void setMessageLine(ISystemMessageLine msgLine)
|
||||
{
|
||||
this.msgLine = msgLine;
|
||||
}
|
||||
/**
|
||||
* Return the message line as set via setMessageLine
|
||||
*/
|
||||
public ISystemMessageLine getMessageLine()
|
||||
{
|
||||
return msgLine;
|
||||
}
|
||||
/**
|
||||
* Occassionally we don't know the shell at constructor time, so we need to be able to set it later
|
||||
*/
|
||||
public void setShell(Shell shell)
|
||||
{
|
||||
this.shell = shell;
|
||||
}
|
||||
/**
|
||||
* Return the shell as set via setShell(Shell)
|
||||
*/
|
||||
public Shell getShell()
|
||||
{
|
||||
return shell;
|
||||
}
|
||||
/**
|
||||
* Set the input object. This is usually set to the current selection, from where
|
||||
* the dialog/page is launched. This matches similar inputObject support in the
|
||||
* RSE classes for dialogs and wizards.<br>
|
||||
* This is usually set by the using dialog/pane, and queried by this object.
|
||||
*/
|
||||
public void setInputObject(Object inputObject)
|
||||
{
|
||||
this.inputObject = inputObject;
|
||||
}
|
||||
/**
|
||||
* Return the input object as set by {@link #setInputObject(Object)}.
|
||||
*/
|
||||
protected Object getInputObject()
|
||||
{
|
||||
return inputObject;
|
||||
}
|
||||
/**
|
||||
* Set the output object. This is usually set by this object, and is subsequently
|
||||
* queried by the using dialog/page.
|
||||
*/
|
||||
protected void setOutputObject(Object outputObject)
|
||||
{
|
||||
this.outputObject = outputObject;
|
||||
}
|
||||
/**
|
||||
* Return the output object as set by {@link #setOutputObject(Object)}.
|
||||
*/
|
||||
public Object getOutputObject()
|
||||
{
|
||||
return outputObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default implementation to satisfy Listener interface. Does nothing.
|
||||
*/
|
||||
public void handleEvent(Event evt) {}
|
||||
|
||||
/**
|
||||
* Register an interest in knowing whenever {@link #setPageComplete(boolean)} is
|
||||
* called by subclass code.
|
||||
*/
|
||||
public void addPageCompleteListener(ISystemPageCompleteListener l)
|
||||
{
|
||||
if (pageCompleteListeners == null)
|
||||
pageCompleteListeners = new Vector();
|
||||
pageCompleteListeners.add(l);
|
||||
}
|
||||
/**
|
||||
* De-register a page complete listener.
|
||||
*/
|
||||
public void removePageCompleteListener(ISystemPageCompleteListener l)
|
||||
{
|
||||
if (pageCompleteListeners != null)
|
||||
pageCompleteListeners.remove(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* The completeness of the page has changed.
|
||||
* We direct it to the Apply button versus just the OK button
|
||||
* @see {@link #addPageCompleteListener(ISystemPageCompleteListener)}
|
||||
*/
|
||||
protected void setPageComplete(boolean complete)
|
||||
{
|
||||
this.complete = complete;
|
||||
if (pageCompleteListeners != null)
|
||||
{
|
||||
for (int idx=0; idx<pageCompleteListeners.size(); idx++)
|
||||
{
|
||||
ISystemPageCompleteListener l = (ISystemPageCompleteListener)pageCompleteListeners.elementAt(idx);
|
||||
l.setPageComplete(complete);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return the current completeness value, as last set by {@link #setPageComplete(boolean)}.
|
||||
*/
|
||||
public boolean isPageComplete()
|
||||
{
|
||||
return complete;
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateContents is the one method that must be overridden from the parent class.
|
||||
* In this method, we populate an SWT container with widgets and return the container
|
||||
* to the caller (JFace). This is used as the contents of this page.
|
||||
* @param parent The parent composite
|
||||
*/
|
||||
public abstract Control createContents(Composite parent);
|
||||
|
||||
|
||||
|
||||
// -----------------
|
||||
// HELPER METHODS...
|
||||
// -----------------
|
||||
|
||||
/**
|
||||
* Display error message or clear error message (if passed null)
|
||||
*/
|
||||
protected void showErrorMessage(SystemMessage msg)
|
||||
{
|
||||
if (msgLine != null)
|
||||
{
|
||||
if (msg != null)
|
||||
msgLine.setErrorMessage(msg);
|
||||
else
|
||||
msgLine.clearErrorMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a separator line. This is a physically visible line.
|
||||
*/
|
||||
protected Label addSeparatorLine(Composite parent, int nbrColumns)
|
||||
{
|
||||
Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
|
||||
GridData data = new GridData();
|
||||
data.horizontalSpan = nbrColumns;
|
||||
data.horizontalAlignment = GridData.FILL;
|
||||
separator.setLayoutData(data);
|
||||
return separator;
|
||||
}
|
||||
/**
|
||||
* Add a spacer line
|
||||
*/
|
||||
protected Label addFillerLine(Composite parent, int nbrColumns)
|
||||
{
|
||||
Label filler = new Label(parent, SWT.LEFT);
|
||||
GridData data = new GridData();
|
||||
data.horizontalSpan = nbrColumns;
|
||||
data.horizontalAlignment = GridData.FILL;
|
||||
filler.setLayoutData(data);
|
||||
return filler;
|
||||
}
|
||||
/**
|
||||
* Add a spacer line that grows in height to absorb extra space
|
||||
*/
|
||||
protected Label addGrowableFillerLine(Composite parent, int nbrColumns)
|
||||
{
|
||||
Label filler = new Label(parent, SWT.LEFT);
|
||||
GridData data = new GridData();
|
||||
data.horizontalSpan = nbrColumns;
|
||||
data.horizontalAlignment = GridData.FILL;
|
||||
data.verticalAlignment = GridData.FILL;
|
||||
data.grabExcessVerticalSpace = true;
|
||||
filler.setLayoutData(data);
|
||||
return filler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an interest in knowing whenever the form is
|
||||
* verified and error messages are updated.
|
||||
*/
|
||||
public void addVerifyListener(ISystemVerifyListener l)
|
||||
{
|
||||
if (verifyListeners == null)
|
||||
verifyListeners = new Vector();
|
||||
verifyListeners.add(l);
|
||||
}
|
||||
|
||||
protected void notifyVerifyListeners()
|
||||
{
|
||||
if (alreadyNotified == true)
|
||||
return; // prevent recursion
|
||||
if (verifyListeners == null) return;
|
||||
alreadyNotified = true;
|
||||
for (int i = 0; i < verifyListeners.size(); i++)
|
||||
{
|
||||
((ISystemVerifyListener)verifyListeners.get(i)).handleVerifyComplete();
|
||||
}
|
||||
alreadyNotified = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* De-register a verify listener.
|
||||
*/
|
||||
public void removePageCompleteListener(ISystemVerifyListener l)
|
||||
{
|
||||
if (verifyListeners != null)
|
||||
verifyListeners.remove(l);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.core.ui.propertypages.ISystemConnectionWizardErrorUpdatingPropertyPage#getTheErrorMessage()
|
||||
*/
|
||||
public String getTheErrorMessage()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,359 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IContributionItem;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.rse.ui.actions.ISystemAction;
|
||||
import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingBrowseWithAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingCompareWithAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingExpandToAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingNewAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingOpenWithAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingRemoteServersAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingReplaceWithAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingViewAction;
|
||||
import org.eclipse.rse.ui.actions.SystemCascadingWorkWithAction;
|
||||
import org.eclipse.rse.ui.actions.SystemSeparatorAction;
|
||||
|
||||
/**
|
||||
* Override/wrapper of JFace MenuManager so we can redirect any
|
||||
* menu additions to specific menu groups to go into
|
||||
* pre-defined submenus.
|
||||
* <p>
|
||||
* Only exposes core set of MenuManager methods. Rest can be
|
||||
* accessed by calling getMenuManger().
|
||||
*/
|
||||
public class SystemMenuManager //implements IMenuManager
|
||||
implements ISystemContextMenuConstants
|
||||
{
|
||||
private IMenuManager mgr;
|
||||
private IMenuManager newSubMenu, expandtoSubMenu, openwithSubMenu, browsewithSubMenu, comparewithSubMenu, replacewithSubMenu, workwithSubMenu, viewSubMenu, serverSubMenu;
|
||||
private boolean menuCreated = false;
|
||||
|
||||
/**
|
||||
* Constructor for SystemMenuManager
|
||||
* @param menuManager existing JFace menu manager
|
||||
*/
|
||||
public SystemMenuManager(IMenuManager menuManager)
|
||||
{
|
||||
super();
|
||||
mgr = menuManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the wrapped IMenuManager manager
|
||||
*/
|
||||
public IMenuManager getMenuManager()
|
||||
{
|
||||
return mgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method declared on IContributionManager.
|
||||
* Add an action to this menu.
|
||||
* COMMENTED OUT TO PREVENT CALLING IT. YOU SHOULD EXPLICITLY
|
||||
* DECIDE WHAT GROUP EACH ACTION SHOULD BE ADDED TO, SO WE FORCE
|
||||
* YOU TO CALL APPENDTOGROUP!
|
||||
*
|
||||
public void add(IAction action)
|
||||
{
|
||||
mgr.add(action);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Method declared on IContributionManager.
|
||||
* Append an action to the menu.
|
||||
* <p>
|
||||
* Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
|
||||
* <p>
|
||||
* @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
|
||||
* @param action action to append.
|
||||
*/
|
||||
public void appendToGroup(String groupName, IAction action)
|
||||
{
|
||||
if (!checkForSpecialGroup(groupName, action, true))
|
||||
if (groupName != null)
|
||||
mgr.appendToGroup(groupName, action);
|
||||
else
|
||||
mgr.add(action);
|
||||
}
|
||||
/**
|
||||
* Method declared on IContributionManager.
|
||||
* Append a submenu to the menu.
|
||||
* <p>
|
||||
* Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
|
||||
* <p>
|
||||
* @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
|
||||
* @param submenu submenu to append.
|
||||
*/
|
||||
public void appendToGroup(String groupName, IContributionItem menuOrSeparator)
|
||||
{
|
||||
if (!checkForSpecialGroup(groupName, menuOrSeparator, true))
|
||||
if (groupName != null)
|
||||
mgr.appendToGroup(groupName, menuOrSeparator);
|
||||
else
|
||||
mgr.add(menuOrSeparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method declared on IContributionManager.
|
||||
* Prepend an action to the menu.
|
||||
* <p>
|
||||
* Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
|
||||
* <p>
|
||||
* @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
|
||||
* @param action action to prepend.
|
||||
*/
|
||||
public void prependToGroup(String groupName, IAction action)
|
||||
{
|
||||
if (!checkForSpecialGroup(groupName, action, false))
|
||||
mgr.prependToGroup(groupName, action);
|
||||
}
|
||||
/**
|
||||
* Method declared on IContributionManager.
|
||||
* Prepend a submenu to the menu.
|
||||
* <p>
|
||||
* Intercepted so we can direct appends to certain groups into appropriate cascading submenus.
|
||||
* <p>
|
||||
* @param groupName group to append to. See {@link org.eclipse.rse.ui.ISystemContextMenuConstants}.
|
||||
* @param submenu submenu to append.
|
||||
*/
|
||||
public void prependToGroup(String groupName, IContributionItem subMenu)
|
||||
{
|
||||
if (!checkForSpecialGroup(groupName, subMenu, true))
|
||||
mgr.prependToGroup(groupName, subMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a separator.
|
||||
* HOPEFULLY THIS IS NEVER CALLED. RATHER, BY USING GROUPS AND DECIDING PER GROUP IF THERE
|
||||
* SHOULD BE SEPARATORS, WE AVOID HARDCODING SEPARATORS LIKE THIS.
|
||||
*/
|
||||
public void addSeparator()
|
||||
{
|
||||
mgr.add(new Separator());
|
||||
}
|
||||
|
||||
/**
|
||||
* Special helper that intelligently adds system framework actions
|
||||
* @param menuGroup default menuGroup to add to, if action doesn't contain an explicit location
|
||||
* @param action action to add to the menu
|
||||
*/
|
||||
public void add(String menuGroup, IAction action)
|
||||
{
|
||||
if (action instanceof SystemBaseSubMenuAction)
|
||||
appendToGroup(getMenuGroup(action,menuGroup),
|
||||
((SystemBaseSubMenuAction)action).getSubMenu());
|
||||
else if (!(action instanceof SystemSeparatorAction))
|
||||
appendToGroup(getMenuGroup(action,menuGroup),action);
|
||||
else // hopefully we don't have these!
|
||||
appendToGroup(menuGroup, new Separator()); // add a separator, which is an IContributionItem
|
||||
}
|
||||
|
||||
private String getMenuGroup(IAction action, String defaultGroup)
|
||||
{
|
||||
if ( (action instanceof ISystemAction) &&
|
||||
(((ISystemAction)action).getContextMenuGroup()!=null) )
|
||||
return ((ISystemAction)action).getContextMenuGroup();
|
||||
else
|
||||
return defaultGroup;
|
||||
}
|
||||
|
||||
private boolean checkForSpecialGroup(String groupName, IAction action, boolean add)
|
||||
{
|
||||
boolean takenCareOf = false;
|
||||
IMenuManager subMenu = getSpecialSubMenu(groupName);
|
||||
if (subMenu != null)
|
||||
{
|
||||
takenCareOf = true;
|
||||
if (action instanceof SystemSeparatorAction)
|
||||
{
|
||||
subMenu.add(new Separator());
|
||||
if (((SystemSeparatorAction)action).isRealAction())
|
||||
subMenu.add(action);
|
||||
}
|
||||
else
|
||||
subMenu.add(action);
|
||||
}
|
||||
|
||||
return takenCareOf;
|
||||
}
|
||||
|
||||
private boolean checkForSpecialGroup(String groupName, IContributionItem contribution, boolean add)
|
||||
{
|
||||
boolean takenCareOf = false;
|
||||
IMenuManager subMenu = getSpecialSubMenu(groupName);
|
||||
if (subMenu != null)
|
||||
{
|
||||
takenCareOf = true;
|
||||
subMenu.add(contribution);
|
||||
}
|
||||
return takenCareOf;
|
||||
}
|
||||
|
||||
private IMenuManager getSpecialSubMenu(String groupName)
|
||||
{
|
||||
IMenuManager subMenu = null;
|
||||
menuCreated = false;
|
||||
if (groupName!=null)
|
||||
{
|
||||
if (groupName.equals(GROUP_NEW))
|
||||
{
|
||||
if (newSubMenu == null)
|
||||
{
|
||||
newSubMenu = (new SystemCascadingNewAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_NEW, newSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = newSubMenu;
|
||||
}
|
||||
/*
|
||||
else if (groupName.equals(GROUP_GOTO))
|
||||
{
|
||||
if (gotoSubMenu == null)
|
||||
{
|
||||
gotoSubMenu = (new SystemCascadingGoToAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_GOTO, gotoSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = gotoSubMenu;
|
||||
}
|
||||
*/
|
||||
else if (groupName.equals(GROUP_EXPANDTO))
|
||||
{
|
||||
if (expandtoSubMenu == null)
|
||||
{
|
||||
expandtoSubMenu = (new SystemCascadingExpandToAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_EXPANDTO, expandtoSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = expandtoSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_OPENWITH))
|
||||
{
|
||||
if (openwithSubMenu == null)
|
||||
{
|
||||
openwithSubMenu = (new SystemCascadingOpenWithAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_OPENWITH, openwithSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = openwithSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_BROWSEWITH))
|
||||
{
|
||||
if (browsewithSubMenu == null)
|
||||
{
|
||||
browsewithSubMenu = (new SystemCascadingBrowseWithAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_BROWSEWITH, browsewithSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = browsewithSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_COMPAREWITH))
|
||||
{
|
||||
if (comparewithSubMenu == null)
|
||||
{
|
||||
comparewithSubMenu = (new SystemCascadingCompareWithAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_COMPAREWITH, comparewithSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = comparewithSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_REPLACEWITH))
|
||||
{
|
||||
if (replacewithSubMenu == null)
|
||||
{
|
||||
replacewithSubMenu = (new SystemCascadingReplaceWithAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_REPLACEWITH, replacewithSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = replacewithSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_WORKWITH))
|
||||
{
|
||||
if (workwithSubMenu == null)
|
||||
{
|
||||
workwithSubMenu = (new SystemCascadingWorkWithAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_WORKWITH, workwithSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = workwithSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_VIEWER_SETUP))
|
||||
{
|
||||
if (viewSubMenu == null)
|
||||
{
|
||||
viewSubMenu = (new SystemCascadingViewAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_VIEWER_SETUP, viewSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = viewSubMenu;
|
||||
}
|
||||
else if (groupName.equals(GROUP_STARTSERVER))
|
||||
{
|
||||
if (serverSubMenu == null)
|
||||
{
|
||||
serverSubMenu = (new SystemCascadingRemoteServersAction()).getSubMenu();
|
||||
mgr.appendToGroup(GROUP_STARTSERVER, serverSubMenu);
|
||||
menuCreated = true;
|
||||
}
|
||||
subMenu = serverSubMenu;
|
||||
}
|
||||
}
|
||||
return subMenu;
|
||||
}
|
||||
|
||||
public IMenuManager getSpecialSubMenuByMenuID(String menuID)
|
||||
{
|
||||
IMenuManager subMenu = null;
|
||||
String groupName = null;
|
||||
menuCreated = false;
|
||||
if (menuID!=null)
|
||||
{
|
||||
if (menuID.equals(MENU_NEW))
|
||||
groupName = GROUP_NEW;
|
||||
else if (menuID.equals(MENU_GOTO))
|
||||
groupName = GROUP_GOTO;
|
||||
else if (menuID.equals(MENU_EXPANDTO))
|
||||
groupName = GROUP_EXPANDTO;
|
||||
else if (menuID.equals(MENU_OPENWITH))
|
||||
groupName = GROUP_OPENWITH;
|
||||
else if (menuID.equals(MENU_BROWSEWITH))
|
||||
groupName = GROUP_BROWSEWITH;
|
||||
else if (menuID.equals(MENU_COMPAREWITH))
|
||||
groupName = GROUP_COMPAREWITH;
|
||||
else if (menuID.equals(MENU_REPLACEWITH))
|
||||
groupName = GROUP_REPLACEWITH;
|
||||
else if (menuID.equals(MENU_WORKWITH))
|
||||
groupName = GROUP_WORKWITH;
|
||||
else if (menuID.equals(MENU_STARTSERVER))
|
||||
groupName = GROUP_STARTSERVER;
|
||||
|
||||
if (groupName != null)
|
||||
subMenu = getSpecialSubMenu(groupName);
|
||||
}
|
||||
return subMenu;
|
||||
}
|
||||
|
||||
public boolean wasMenuCreated()
|
||||
{
|
||||
return menuCreated;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,263 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import org.eclipse.jface.wizard.WizardPage;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
|
||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.validators.ISystemValidator;
|
||||
import org.eclipse.rse.ui.validators.ValidatorProfileName;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
|
||||
/**
|
||||
* A reusable form for prompting for profile information,
|
||||
* in new or update mode.
|
||||
* <p>
|
||||
* May be used to populate a dialog or a wizard page.
|
||||
*/
|
||||
|
||||
public class SystemProfileForm
|
||||
implements Listener, ISystemMessages
|
||||
{
|
||||
|
||||
// GUI widgets
|
||||
protected Label profileLabel;
|
||||
protected Control verbage;
|
||||
//protected Combo profileCombo;
|
||||
protected Text profileName;
|
||||
protected ISystemMessageLine msgLine;
|
||||
// validators
|
||||
protected ISystemValidator nameValidator;
|
||||
protected Object caller;
|
||||
protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog;
|
||||
|
||||
// max lengths
|
||||
protected static final int profileNameLength = ValidatorProfileName.MAX_PROFILENAME_LENGTH;
|
||||
// state
|
||||
protected ISystemProfile profile;
|
||||
private boolean showVerbage = true;
|
||||
private SystemMessage errorMessage = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param msgLine A GUI widget capable of writing error messages to.
|
||||
* @param caller. The wizardpage or dialog hosting this form.
|
||||
* @param profile. The existing profile being updated, or null for New action.
|
||||
* @param showVerbage. Specify true to show first-time-user verbage.
|
||||
*/
|
||||
public SystemProfileForm(ISystemMessageLine msgLine, Object caller, ISystemProfile profile, boolean showVerbage)
|
||||
{
|
||||
this.msgLine = msgLine;
|
||||
this.caller = caller;
|
||||
this.profile = profile;
|
||||
this.showVerbage = showVerbage;
|
||||
callerInstanceOfWizardPage = (caller instanceof WizardPage);
|
||||
callerInstanceOfSystemPromptDialog = (caller instanceof SystemPromptDialog);
|
||||
nameValidator = SystemPlugin.getTheSystemRegistry().getSystemProfileManager().getProfileNameValidator(profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Often the message line is null at the time of instantiation, so we have to call this after
|
||||
* it is created.
|
||||
*/
|
||||
public void setMessageLine(ISystemMessageLine msgLine)
|
||||
{
|
||||
this.msgLine = msgLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to specify a validator for the profile name. It will be called per keystroke.
|
||||
* If not specified, a default is used.
|
||||
*/
|
||||
public void setNameValidators(ISystemValidator v)
|
||||
{
|
||||
nameValidator = v;
|
||||
}
|
||||
/**
|
||||
* Call to initialize the profile name in create mode. Must be called after createContents
|
||||
*/
|
||||
public void setProfileName(String name)
|
||||
{
|
||||
if ((name != null) && (profileName != null))
|
||||
profileName.setText(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateContents is the one method that must be overridden from the parent class.
|
||||
* In this method, we populate an SWT container with widgets and return the container
|
||||
* to the caller (JFace). This is used as the contents of this page.
|
||||
* @param parent The parent composite
|
||||
*/
|
||||
public Control createContents(Composite parent)
|
||||
{
|
||||
// Inner composite
|
||||
int nbrColumns = 2;
|
||||
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
||||
|
||||
// VERBAGE LABEL
|
||||
if (showVerbage)
|
||||
{
|
||||
verbage = SystemWidgetHelpers.createVerbage(
|
||||
composite_prompts, SystemResources.RESID_PROFILE_PROFILENAME_VERBAGE, nbrColumns, false, 200);
|
||||
SystemWidgetHelpers.createLabel(composite_prompts, "", nbrColumns); // dummy line for spacing
|
||||
}
|
||||
|
||||
// NAME PROMPT
|
||||
String temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_PROFILE_PROFILENAME_LABEL);
|
||||
profileLabel = SystemWidgetHelpers.createLabel(composite_prompts, temp);
|
||||
profileName = SystemWidgetHelpers.createTextField(
|
||||
composite_prompts,this,
|
||||
SystemResources.RESID_PROFILE_PROFILENAME_TIP);
|
||||
profileName.setTextLimit(profileNameLength);
|
||||
|
||||
if (profile != null)
|
||||
profileName.setText(profile.getName());
|
||||
|
||||
profileName.setFocus();
|
||||
|
||||
|
||||
// add keystroke listeners...
|
||||
profileName.addModifyListener(
|
||||
new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
validateNameInput();
|
||||
}
|
||||
}
|
||||
);
|
||||
return composite_prompts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return control to recieve initial focus
|
||||
*/
|
||||
public Control getInitialFocusControl()
|
||||
{
|
||||
return profileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default implementation to satisfy Listener interface. Does nothing.
|
||||
*/
|
||||
public void handleEvent(Event evt) {}
|
||||
|
||||
/**
|
||||
* Verifies all input.
|
||||
* @return true if there are no errors in the user input
|
||||
*/
|
||||
public boolean verify()
|
||||
{
|
||||
SystemMessage errMsg = null;
|
||||
Control controlInError = null;
|
||||
if (msgLine != null)
|
||||
msgLine.clearErrorMessage();
|
||||
errMsg = validateNameInput();
|
||||
if (errMsg != null)
|
||||
controlInError = profileName;
|
||||
else
|
||||
{
|
||||
}
|
||||
if (errMsg != null)
|
||||
{
|
||||
controlInError.setFocus();
|
||||
showErrorMessage(errMsg);
|
||||
}
|
||||
return (errMsg == null);
|
||||
}
|
||||
|
||||
// --------------------------------- //
|
||||
// METHODS FOR EXTRACTING USER DATA ...
|
||||
// --------------------------------- //
|
||||
/**
|
||||
* Return user-entered profile Name.
|
||||
* Call this after finish ends successfully.
|
||||
*/
|
||||
public String getProfileName()
|
||||
{
|
||||
return profileName.getText().trim();
|
||||
}
|
||||
/**
|
||||
* Display error message or clear error message
|
||||
*/
|
||||
private void showErrorMessage(SystemMessage msg)
|
||||
{
|
||||
if (msgLine != null)
|
||||
if (msg != null)
|
||||
msgLine.setErrorMessage(msg);
|
||||
else
|
||||
msgLine.clearErrorMessage();
|
||||
else
|
||||
System.out.println("MSGLINE NULL. TRYING TO WRITE MSG " + msg);
|
||||
}
|
||||
|
||||
// ---------------------------------------------
|
||||
// METHODS FOR VERIFYING INPUT PER KEYSTROKE ...
|
||||
// ---------------------------------------------
|
||||
/**
|
||||
* This hook method is called whenever the text changes in the input field.
|
||||
* The default implementation delegates the request to an <code>ISystemValidator</code> object.
|
||||
* If the <code>ISystemValidator</code> reports an error the error message is displayed
|
||||
* in the Dialog's message line.
|
||||
* @see #setNameValidators(ISystemValidator)
|
||||
*/
|
||||
protected SystemMessage validateNameInput()
|
||||
{
|
||||
errorMessage= null;
|
||||
errorMessage= nameValidator.validate(profileName.getText().trim());
|
||||
showErrorMessage(errorMessage);
|
||||
setPageComplete();
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method can be called by the dialog or wizard page host, to decide whether to enable
|
||||
* or disable the next, final or ok buttons. It returns true if the minimal information is
|
||||
* available and is correct.
|
||||
*/
|
||||
public boolean isPageComplete()
|
||||
{
|
||||
boolean pageComplete = false;
|
||||
if (errorMessage == null)
|
||||
pageComplete = (getProfileName().length() > 0);
|
||||
return pageComplete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform caller of page-complete status of this form
|
||||
*/
|
||||
public void setPageComplete()
|
||||
{
|
||||
boolean complete = isPageComplete();
|
||||
if (callerInstanceOfWizardPage)
|
||||
{
|
||||
((WizardPage)caller).setPageComplete(complete);
|
||||
}
|
||||
else if (callerInstanceOfSystemPromptDialog)
|
||||
{
|
||||
((SystemPromptDialog)caller).setPageComplete(complete);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/********************************************************************************
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class SystemPropertyResources extends NLS
|
||||
{
|
||||
private static String BUNDLE_NAME = "org.eclipse.rse.ui.SystemPropertyResources";//$NON-NLS-1$
|
||||
|
||||
// ------------------------------
|
||||
// PROPERTY SHEET VALUES
|
||||
// ------------------------------
|
||||
// PROPERTY SHEET VALUES: GENERIC
|
||||
|
||||
public static String RESID_PROPERTY_NAME_LABEL;
|
||||
public static String RESID_PROPERTY_NAME_TOOLTIP;
|
||||
|
||||
public static String RESID_PROPERTY_TYPE_LABEL;
|
||||
public static String RESID_PROPERTY_TYPE_TOOLTIP;
|
||||
|
||||
public static String RESID_PROPERTY_DESCRIPTION_LABEL;
|
||||
public static String RESID_PROPERTY_DESCRIPTION_TOOLTIP;
|
||||
|
||||
public static String RESID_PROPERTY_FILTERTYPE_VALUE;
|
||||
|
||||
public static String RESID_TERM_NOTAPPLICABLE;
|
||||
public static String RESID_TERM_NOTAVAILABLE;
|
||||
|
||||
public static String RESID_PORT_DYNAMICSELECT;
|
||||
public static String RESID_PROPERTY_INHERITED;
|
||||
|
||||
static {
|
||||
// load message values from bundle file
|
||||
NLS.initializeMessages(BUNDLE_NAME, SystemPropertyResources.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
################################################################################
|
||||
# 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:
|
||||
# {Name} (company) - description of contribution.
|
||||
################################################################################
|
||||
|
||||
##############################################################
|
||||
# PROPERTY VALUES...
|
||||
##############################################################
|
||||
# NLS_MESSAGEFORMAT_NONE
|
||||
|
||||
RESID_PROPERTY_NAME_LABEL=Name
|
||||
RESID_PROPERTY_NAME_TOOLTIP=Name of resources
|
||||
RESID_PROPERTY_TYPE_LABEL=Type
|
||||
RESID_PROPERTY_TYPE_TOOLTIP=Type of resource
|
||||
RESID_PROPERTY_DESCRIPTION_LABEL=Description
|
||||
RESID_PROPERTY_DESCRIPTION_TOOLTIP=Description of resource
|
||||
|
||||
RESID_TERM_NOTAPPLICABLE=Not applicable
|
||||
RESID_TERM_NOTAVAILABLE=Not available
|
||||
RESID_PORT_DYNAMICSELECT=(First-available)
|
||||
RESID_PROPERTY_INHERITED=(Inherited)
|
||||
|
||||
RESID_PROPERTY_FILTERTYPE_VALUE=Remote system filter
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,132 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
||||
/**
|
||||
* The TreeViewer widget does not seem to guarantee that multiple-selections are
|
||||
* returned sorted in order of appearance in the tree. Some action require they be,
|
||||
* such as MoveUp and MoveDown. This class captures the information for each selected item
|
||||
* and permits sorting via position, using the Arrays helper class in java.util.
|
||||
*/
|
||||
public class SystemSortableSelection implements Comparable
|
||||
{
|
||||
|
||||
private Object selectedObject;
|
||||
private int position;
|
||||
|
||||
/**
|
||||
* Constructor for SystemSortableSelection
|
||||
*/
|
||||
public SystemSortableSelection(Object selectedObject)
|
||||
{
|
||||
super();
|
||||
this.selectedObject = selectedObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the selected object
|
||||
*/
|
||||
public Object getSelectedObject()
|
||||
{
|
||||
return selectedObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the position of the selected object within its parent list
|
||||
*/
|
||||
public void setPosition(int position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the poisition of the selected object within its parent list
|
||||
*/
|
||||
public int getPosition()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Comparable#compareTo(Object)
|
||||
*/
|
||||
public int compareTo(Object other)
|
||||
{
|
||||
SystemSortableSelection otherSelectableObject = (SystemSortableSelection)other;
|
||||
int otherPosition = otherSelectableObject.getPosition();
|
||||
if (position < otherPosition)
|
||||
return -1;
|
||||
else if (position == otherPosition)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if (!(other instanceof SystemSortableSelection))
|
||||
return super.equals(other);
|
||||
SystemSortableSelection otherSelectableObject = (SystemSortableSelection)other;
|
||||
int otherPosition = otherSelectableObject.getPosition();
|
||||
return (position == otherPosition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert structured selection into an array of these objects.
|
||||
* YOU MUST CALL SET POSITION AFTER FOR EACH ITEM, BEFORE YOU CAN SORT THIS ARRAY!
|
||||
*/
|
||||
public static SystemSortableSelection[] makeSortableArray(IStructuredSelection selection)
|
||||
{
|
||||
SystemSortableSelection[] array = new SystemSortableSelection[selection.size()];
|
||||
Iterator i = selection.iterator();
|
||||
int idx=0;
|
||||
while (i.hasNext())
|
||||
array[idx++] = new SystemSortableSelection(i.next());
|
||||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* IF YOU HAVE CALLED SETPOSITION ON EACH ITEM IN THE GIVEN ARRAY, THIS WILL SORT THAT ARRAY
|
||||
* BY THE POSITION
|
||||
*/
|
||||
public static void sortArray(SystemSortableSelection[] sortableArray)
|
||||
{
|
||||
Arrays.sort(sortableArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* IF YOU HAVE CALLED SETPOSITION ON EACH ITEM IN THE GIVEN ARRAY, AND CALLED SORTARRAY,
|
||||
* THIS CONVERTS INTO A SORTED ARRAY THAT JUST HAS THE ORIGINAL OBJECTS IN IT FROM THE SELECTION LIST.
|
||||
*/
|
||||
public static Object[] getSortedObjects(SystemSortableSelection[] sortedArray, Object[] outputArray)
|
||||
{
|
||||
//System.out.println("in SystemSortableSelection#getSortedObjects:");
|
||||
for (int idx=0;idx<outputArray.length; idx++)
|
||||
{
|
||||
outputArray[idx] = sortedArray[idx].getSelectedObject();
|
||||
//System.out.println("...selected Object: " + outputArray[idx]);
|
||||
//System.out.println("...position.......: " + sortedArray[idx].getPosition());
|
||||
}
|
||||
//System.out.println();
|
||||
return outputArray;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Layout;
|
||||
|
||||
public class SystemTabFolderLayout extends Layout
|
||||
{
|
||||
|
||||
protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
|
||||
if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
|
||||
return new Point(wHint, hHint);
|
||||
|
||||
Control [] children = composite.getChildren ();
|
||||
int count = children.length;
|
||||
int maxWidth = 0, maxHeight = 0;
|
||||
for (int i=0; i<count; i++) {
|
||||
Control child = children [i];
|
||||
Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
|
||||
maxWidth = Math.max (maxWidth, pt.x);
|
||||
maxHeight = Math.max (maxHeight, pt.y);
|
||||
}
|
||||
|
||||
if (wHint != SWT.DEFAULT)
|
||||
maxWidth= wHint;
|
||||
if (hHint != SWT.DEFAULT)
|
||||
maxHeight= hHint;
|
||||
|
||||
return new Point(maxWidth, maxHeight);
|
||||
|
||||
}
|
||||
protected void layout (Composite composite, boolean flushCache) {
|
||||
Rectangle rect= composite.getClientArea();
|
||||
|
||||
Control[] children = composite.getChildren();
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
children[i].setBounds(rect);
|
||||
}
|
||||
|
||||
// System.out.println("Setting bounds of each page to " + rect);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,60 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* DisplayDialogAction can be used to display a JFace Dialog when
|
||||
* not running on the UI thread and no shell is availble. For example:
|
||||
* <code>
|
||||
* Display.getDefault().syncExec(new DisplayDialogAction(myDialog));
|
||||
* </code>
|
||||
*/
|
||||
public class DisplayDialogAction implements Runnable {
|
||||
|
||||
|
||||
private Dialog _dialog;
|
||||
|
||||
/**
|
||||
* Constructor for DisplayDialogAction.
|
||||
*
|
||||
* @param dialog The dialog to be displayed.
|
||||
*/
|
||||
public DisplayDialogAction(Dialog dialog) {
|
||||
_dialog = dialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
public void run() {
|
||||
boolean finished = false;
|
||||
|
||||
Shell[] shells = Display.getCurrent().getShells();
|
||||
for (int loop = 0; loop < shells.length && !finished; loop++) {
|
||||
if (shells[loop].isEnabled())
|
||||
{
|
||||
_dialog.open();
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* This class can be used to display SystemMessages via the Display.async
|
||||
* and sync methods.
|
||||
*/
|
||||
public class DisplaySystemMessageAction implements Runnable {
|
||||
|
||||
|
||||
private SystemMessage message;
|
||||
private int rc;
|
||||
|
||||
public DisplaySystemMessageAction(SystemMessage message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see Runnable#run()
|
||||
*/
|
||||
public void run() {
|
||||
boolean finished = false;
|
||||
|
||||
Shell[] shells = Display.getCurrent().getShells();
|
||||
for (int loop = 0; loop < shells.length && !finished; loop++) {
|
||||
if (shells[loop].isEnabled() && shells[loop].isVisible()) {
|
||||
SystemMessageDialog dialog = new SystemMessageDialog(shells[loop], message);
|
||||
dialog.open();
|
||||
rc = dialog.getButtonPressedId();
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the return code from displaying the SystemMessageDialog
|
||||
*/
|
||||
public int getReturnCode() {
|
||||
return rc;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
/**
|
||||
* Suggested interface for actions in popup menus of the remote systems explorer view.
|
||||
* While suggested, it is not required to implement this interface.
|
||||
* @see SystemBaseAction
|
||||
*/
|
||||
public interface ISystemAction extends IAction, ISelectionChangedListener
|
||||
{
|
||||
|
||||
// ------------------------
|
||||
// CONFIGURATION METHODS...
|
||||
// ------------------------
|
||||
/**
|
||||
* Set the help id for the action
|
||||
*/
|
||||
public void setHelp(String id);
|
||||
/**
|
||||
* Set the context menu group this action is to go into, for popup menus. If not set,
|
||||
* someone else will make this decision.
|
||||
*/
|
||||
public void setContextMenuGroup(String group);
|
||||
/**
|
||||
* Is this action to be enabled or disabled when multiple items are selected.
|
||||
*/
|
||||
public void allowOnMultipleSelection(boolean allow);
|
||||
/**
|
||||
* Specify whether this action is selection-sensitive. The default is true.
|
||||
* This means the enabled state is tested and set when the selection is set.
|
||||
*/
|
||||
public void setSelectionSensitive(boolean sensitive);
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// STATE METHODS CALLED BY VIEWER AT FILL CONTEXT MENU TIME...
|
||||
// -----------------------------------------------------------
|
||||
/**
|
||||
* Set shell of parent window. Remote systems explorer will call this.
|
||||
*/
|
||||
public void setShell(Shell shell);
|
||||
/**
|
||||
* Set the Viewer that called this action. It is good practice for viewers to call this
|
||||
* so actions can directly access them if needed.
|
||||
*/
|
||||
public void setViewer(Viewer v);
|
||||
/**
|
||||
* Sometimes we can't call selectionChanged() because we are not a selection provider.
|
||||
* In this case, use this to set the selection.
|
||||
*/
|
||||
public void setSelection(ISelection selection);
|
||||
/**
|
||||
* An optimization for performance reasons that allows all inputs to be set in one call
|
||||
*/
|
||||
public void setInputs(Shell shell, Viewer v, ISelection selection);
|
||||
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// GET METHODS FOR RETRIEVING STATE OR CONFIGURATION INFORMATION...
|
||||
// ----------------------------------------------------------------
|
||||
/**
|
||||
* Get the help id for this action
|
||||
*/
|
||||
public String getHelpContextId();
|
||||
/**
|
||||
* Convenience method to get shell of parent window, as set via setShell.
|
||||
*/
|
||||
public Shell getShell();
|
||||
/**
|
||||
* Get the Viewer that called this action. Not guaranteed to be set,
|
||||
* depends if that viewer called setViewer or not. SystemView does.
|
||||
*/
|
||||
public Viewer getViewer();
|
||||
/**
|
||||
* Retrieve selection as set by selectionChanged() or setSelection()
|
||||
*/
|
||||
public IStructuredSelection getSelection();
|
||||
/**
|
||||
* Get the context menu group this action is to go into, for popup menus. By default is
|
||||
* null, meaning there is no recommendation
|
||||
*/
|
||||
public String getContextMenuGroup();
|
||||
/**
|
||||
* Return whether this action is selection-sensitive. The default is true.
|
||||
* This means the enabled state is tested and set when the selection is set.
|
||||
*/
|
||||
public boolean isSelectionSensitive();
|
||||
/**
|
||||
* Return if true if this is a dummy action
|
||||
*/
|
||||
public boolean isDummy();
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
|
||||
|
||||
|
||||
/**
|
||||
* Callback interface between copy-actions and copy select-target-parent dialogs
|
||||
*/
|
||||
public interface ISystemCopyTargetSelectionCallback
|
||||
{
|
||||
|
||||
/**
|
||||
* This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
|
||||
* object is a valid parent object. This affects the enabling of the OK button on that dialog.
|
||||
*/
|
||||
public boolean isValidTargetParent(SystemSimpleContentElement selectedElement);
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
/**
|
||||
* Suggested interface for actions in popup menus of the remote systems explorer view,
|
||||
* which put up dialogs.
|
||||
* @see SystemBaseDialogAction
|
||||
*/
|
||||
public interface ISystemDialogAction extends ISystemAction
|
||||
{
|
||||
/*
|
||||
* Return the parent window/dialog of this action. Same as getShell()
|
||||
*
|
||||
public Shell getParent();*/
|
||||
|
||||
/*
|
||||
* Set the parent window/dialog of this action. Same as setShell(Shell parent)
|
||||
*
|
||||
public void setParent(Shell parent);*/
|
||||
|
||||
/**
|
||||
* Set the value used as input to the dialog. Usually for update mode.
|
||||
* This is an alternative to selectionChanged or setSelection, as typically it is
|
||||
* the selection that is used as the input to the dialog.
|
||||
*/
|
||||
public void setValue(Object value);
|
||||
/**
|
||||
* If this action supports allowOnMultipleSelection, then whether the action is to
|
||||
* be invoked once per selected item (false), or once for all selected items (true)
|
||||
*/
|
||||
public void setProcessAllSelections(boolean all);
|
||||
|
||||
/**
|
||||
* Get the output of the dialog.
|
||||
*/
|
||||
public Object getValue();
|
||||
/**
|
||||
* Returns true if the user cancelled the dialog.
|
||||
* The default way to guess at this is to test if the output from
|
||||
* getDialogValue was null or not. Override if you need to refine this.
|
||||
*/
|
||||
public boolean wasCancelled();
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2005, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* Required interface for use in making contributions view the
|
||||
* adapter menu extension extension point (org.eclipse.rse.core.dynamicPopupMenuActions).
|
||||
*/
|
||||
public interface ISystemDynamicPopupMenuExtension
|
||||
{
|
||||
/**
|
||||
* Returns true if this menu extension supports the specified selection.
|
||||
* @param selection the resources to contriubte menu items to
|
||||
* @return true if the extension will be used for menu population
|
||||
*/
|
||||
public boolean supportsSelection(IStructuredSelection selection);
|
||||
|
||||
/**
|
||||
* Populates the menu with specialized actions.
|
||||
* @param shell the shell
|
||||
* @param menu the menu to contribute actions to
|
||||
* @param menuGroup the defect menu group to add actions to
|
||||
* @param selection the resources to contriubte menu items to
|
||||
*
|
||||
*/
|
||||
public void populateMenu(Shell shell, IMenuManager menu, IStructuredSelection selection, String menuGroup);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2004, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
/**
|
||||
* @author dmcknigh
|
||||
*/
|
||||
public interface ISystemDynamicPopupMenuExtensionManager {
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
/**
|
||||
* Suggested interface for actions in popup menus of the remote systems explorer view,
|
||||
* which put up wizards.
|
||||
* @see SystemBaseWizardAction
|
||||
*/
|
||||
public interface ISystemWizardAction extends ISystemDialogAction
|
||||
{
|
||||
}
|
|
@ -0,0 +1,393 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IActionDelegate;
|
||||
import org.eclipse.ui.IObjectActionDelegate;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
|
||||
|
||||
/**
|
||||
* This is a base class to simplify the creation of actions supplied via the
|
||||
* org.eclipse.rse.core.popupMenus extension point.
|
||||
* <p>
|
||||
* The only method you must implement is {@link #run()}.
|
||||
* You may optionally override {@link #getEnabled(Object[])}
|
||||
* <p>
|
||||
* Convenience methods are:
|
||||
* <ul>
|
||||
* <li>{@link #getShell()}
|
||||
* <li>{@link #getProxyAction()}
|
||||
* <li>{@link #getSelection()}
|
||||
* <li>{@link #getSelectionCount()}
|
||||
* <li>{@link #getSelectedRemoteObjects()}
|
||||
* <li>{@link #getFirstSelectedRemoteObject()}
|
||||
* <li>{@link #getRemoteAdapter(Object)}
|
||||
*
|
||||
* <li>{@link #getSubSystem()}
|
||||
* <li>{@link #getSubSystemFactory()}
|
||||
* <li>{@link #getSystemConnection()}
|
||||
*
|
||||
* <li>{@link #getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* <li>{@link #getRemoteObjectSubSystemFactoryId(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* <li>{@link #getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* <li>{@link #getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* <li>{@link #getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* <li>{@link #getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)}
|
||||
* </ul>
|
||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter
|
||||
* @see org.eclipse.rse.ui.dialogs.SystemPromptDialog
|
||||
*/
|
||||
public abstract class SystemAbstractPopupMenuExtensionAction implements IObjectActionDelegate
|
||||
{
|
||||
protected IWorkbenchPart viewPart = null;
|
||||
protected IStructuredSelection sel = null;
|
||||
protected IAction proxyAction;
|
||||
protected Shell shell;
|
||||
protected static final Object[] EMPTY_ARRAY = new Object[0];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemAbstractPopupMenuExtensionAction()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// OVERRIDABLE METHODS...
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* The user has selected this action. This is where the actual code for the action goes.
|
||||
*/
|
||||
public abstract void run();
|
||||
|
||||
/**
|
||||
* The user has selected one or more objects. This is an opportunity to enable/disable
|
||||
* this action based on the current selection. By default, it is always enabled. Return
|
||||
* false to disable it.
|
||||
*/
|
||||
public boolean getEnabled(Object[] currentlySelected)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// IOBJECTACTIONDELEGATE METHODS...
|
||||
// ---------------------------------
|
||||
|
||||
/**
|
||||
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
||||
*/
|
||||
public void setActivePart(IAction action, IWorkbenchPart part)
|
||||
{
|
||||
this.viewPart = part;
|
||||
this.proxyAction = action;
|
||||
this.shell = part.getSite().getShell();
|
||||
}
|
||||
/**
|
||||
* Get the current view part.
|
||||
* Handy for things like getting the shell.
|
||||
*/
|
||||
public IWorkbenchPart getActivePart()
|
||||
{
|
||||
return viewPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Eclipse-supplied proxy action has been selected to run.
|
||||
* This is the foreward to us, the actual action. This method's default
|
||||
* implementation is to simply call {@link #run()}.
|
||||
*
|
||||
* @see IActionDelegate#run(IAction)
|
||||
*/
|
||||
public void run(IAction action)
|
||||
{
|
||||
run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by Eclipse when the user selects something. Our opportunity
|
||||
* to enable or disable this menu item. The default implementation of this
|
||||
* method calls getEnabled to determine if the proxy action should be enabled
|
||||
* or not, then calls setEnabled on that proxy action with the result.
|
||||
*
|
||||
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
||||
*/
|
||||
public void selectionChanged(IAction action, ISelection sel)
|
||||
{
|
||||
if (!action.isEnabled())
|
||||
return; // defect 43471: we were overriding the enableFor attribute enablement
|
||||
if (sel instanceof IStructuredSelection)
|
||||
{
|
||||
this.sel = (IStructuredSelection)sel;
|
||||
action.setEnabled(getEnabled(getSelectedRemoteObjects()));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.sel = null;
|
||||
action.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------
|
||||
// CONVENIENCE METHODS FOR SUBCLASSES TO USE...
|
||||
// ---------------------------------------------
|
||||
/**
|
||||
* For toggle actions (attribute state specified in action tag), set the toggle state
|
||||
*/
|
||||
public void setChecked(boolean checked)
|
||||
{
|
||||
proxyAction.setChecked(checked);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the enabled state of the action
|
||||
*/
|
||||
public void setEnabled(boolean enabled)
|
||||
{
|
||||
proxyAction.setEnabled(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the proxy action for this action delegate
|
||||
*/
|
||||
public IAction getProxyAction()
|
||||
{
|
||||
return proxyAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the shell hosting this action
|
||||
*/
|
||||
public Shell getShell()
|
||||
{
|
||||
return shell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the current selected objects as a structured selection
|
||||
*/
|
||||
public IStructuredSelection getSelection()
|
||||
{
|
||||
return sel;
|
||||
}
|
||||
/**
|
||||
* Retrieve the number of items currently selected
|
||||
*/
|
||||
public int getSelectionCount()
|
||||
{
|
||||
return ((sel==null)?0:sel.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the currently selected objects as an array of Object objects.
|
||||
* Array may be length 0, but will never be null, for convenience.
|
||||
* To do anything interesting with the object, you will also need to retrieve its adapter
|
||||
* @see #getRemoteAdapter(Object)
|
||||
*/
|
||||
public Object[] getSelectedRemoteObjects()
|
||||
{
|
||||
Object[] seld = new Object[(sel!=null) ? sel.size() : 0];
|
||||
if (sel == null)
|
||||
return seld;
|
||||
Iterator i = sel.iterator();
|
||||
int idx=0;
|
||||
while (i.hasNext())
|
||||
seld[idx++] = i.next();
|
||||
return seld;
|
||||
}
|
||||
/**
|
||||
* Retrieve the first selected object, for convenience.
|
||||
* Will be null if there is nothing selected
|
||||
* To do anything interesting with the object, you will also need to retrieve its adapter
|
||||
* @see #getRemoteAdapter(Object)
|
||||
*/
|
||||
public Object getFirstSelectedRemoteObject()
|
||||
{
|
||||
if (sel == null)
|
||||
return null;
|
||||
return sel.getFirstElement();
|
||||
}
|
||||
/**
|
||||
* Retrieve the adapters of the currently selected objects as an array of ISystemRemoteElementAdapter objects.
|
||||
* Array may be length 0, but will never be null, for convenience.
|
||||
*/
|
||||
public ISystemRemoteElementAdapter[] getSelectedRemoteObjectAdapters()
|
||||
{
|
||||
ISystemRemoteElementAdapter[] seld = new ISystemRemoteElementAdapter[(sel!=null) ? sel.size() : 0];
|
||||
if (sel == null)
|
||||
return seld;
|
||||
Iterator i = sel.iterator();
|
||||
int idx=0;
|
||||
while (i.hasNext())
|
||||
seld[idx++] = getRemoteAdapter(i.next());
|
||||
return seld;
|
||||
}
|
||||
/**
|
||||
* Retrieve the adapter of the first selected object as an ISystemRemoteElementAdapter object, for convenience.
|
||||
* Will be null if there is nothing selected
|
||||
*/
|
||||
public ISystemRemoteElementAdapter getFirstSelectedRemoteObjectAdapter()
|
||||
{
|
||||
if (sel == null)
|
||||
return null;
|
||||
return getRemoteAdapter(sel.getFirstElement());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the implementation of ISystemRemoteElementAdapter for the given
|
||||
* object. Returns null if this object does not adaptable to this.
|
||||
*/
|
||||
public ISystemRemoteElementAdapter getRemoteAdapter(Object o)
|
||||
{
|
||||
if (!(o instanceof IAdaptable))
|
||||
return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
|
||||
return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getName(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectName(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getName(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the id of the subsystem factory of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getSubSystemFactoryId(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectSubSystemFactoryId(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getSubSystemFactoryId(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the type category of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getRemoteTypeCategory(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectTypeCategory(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getRemoteTypeCategory(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the type of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getRemoteType(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectType(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getRemoteType(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the subtype of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getRemoteSubType(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectSubType(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getRemoteSubType(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the sub-subtype of the given remote object, given its remote object adapter.
|
||||
* Same as <code>adapter.getRemoteSubSubType(obj);</code>
|
||||
*/
|
||||
public String getRemoteObjectSubSubType(Object obj, ISystemRemoteElementAdapter adapter)
|
||||
{
|
||||
return adapter.getRemoteSubSubType(obj);
|
||||
}
|
||||
/**
|
||||
* Returns the subsystem from which the selected remote objects were resolved.
|
||||
*/
|
||||
public ISubSystem getSubSystem()
|
||||
{
|
||||
ISystemRemoteElementAdapter ra = getFirstSelectedRemoteObjectAdapter();
|
||||
if (ra != null)
|
||||
return ra.getSubSystem(getFirstSelectedRemoteObject());
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Returns the subsystem factory which owns the subsystem from which the selected remote objects were resolved
|
||||
*/
|
||||
public ISubSystemConfiguration getSubSystemFactory()
|
||||
{
|
||||
ISubSystem ss = getSubSystem();
|
||||
if (ss != null)
|
||||
return ss.getSubSystemConfiguration();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SystemConnection from which the selected remote objects were resolved
|
||||
*/
|
||||
public IHost getSystemConnection()
|
||||
{
|
||||
IHost conn = null;
|
||||
ISystemRemoteElementAdapter ra = getFirstSelectedRemoteObjectAdapter();
|
||||
if (ra != null)
|
||||
{
|
||||
ISubSystem ss = ra.getSubSystem(getFirstSelectedRemoteObject());
|
||||
if (ss != null)
|
||||
conn = ss.getHost();
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Debug method to print out details of given selected object...
|
||||
*/
|
||||
public void printTest()
|
||||
{
|
||||
System.out.println("Testing. Number of selected objects = "+getSelectionCount());
|
||||
Object obj = getFirstSelectedRemoteObject();
|
||||
if (obj == null)
|
||||
System.out.println("selected obj is null");
|
||||
else
|
||||
{
|
||||
ISystemRemoteElementAdapter adapter = getRemoteAdapter(obj);
|
||||
System.out.println();
|
||||
System.out.println("REMOTE INFORMATION FOR FIRST SELECTION");
|
||||
System.out.println("--------------------------------------");
|
||||
System.out.println("Remote object name................: " + getRemoteObjectName(obj,adapter));
|
||||
System.out.println("Remote object subsystem factory id: " + getRemoteObjectSubSystemFactoryId(obj,adapter));
|
||||
System.out.println("Remote object type category.......: " + getRemoteObjectTypeCategory(obj,adapter));
|
||||
System.out.println("Remote object type ...............: " + getRemoteObjectType(obj,adapter));
|
||||
System.out.println("Remote object subtype ............: " + getRemoteObjectSubType(obj,adapter));
|
||||
System.out.println("Remote object subsubtype .........: " + getRemoteObjectSubSubType(obj,adapter));
|
||||
System.out.println();
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,818 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.ui.SystemWidgetHelpers;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.rse.ui.view.ISystemTree;
|
||||
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Cursor;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* A suggested base class for remote systems related actions.
|
||||
* <p>
|
||||
* What this offers beyond the basic Action class:
|
||||
* <ul>
|
||||
* <li>Support for setting label and tooltip and description from a resource bundle and single key prefix,
|
||||
* from which each string is derived by appending ".label", ".tooltip" and ".description" to the prefix.
|
||||
* <li>Support for setting and retrieving the shell from which the action is launched. Can be
|
||||
* set in the parent, or passed as null there and set later via setShell. Retrieve via getShell.
|
||||
* <li>Support actions that are selection-dependent, but need not be informed of every selection change.
|
||||
* For performance reasons, only track selections if the action is displayed in the toolbar where
|
||||
* state change needs to be visible. For popup actions, we only need to be informed of the
|
||||
* currently selection at the time the popup is built. Popup menu builders call selectionChanged
|
||||
* in this class at popup population time, so you need only subclass this method. However, even
|
||||
* that is made easier. The default implementation of this method in this class converts the
|
||||
* selection to an IStructuredSelection, and calls an overridable method named updateSelection
|
||||
* passing the structured selection. The action is enabled or disabled based on the returned
|
||||
* boolean value. Just override updateSelection to enable or disable based on selection.
|
||||
* Indeed, the default implementation of the updateSelection method is to return the result of
|
||||
* AND-ED result of calling checkObjectType on each item in the selection. So the easiest thing
|
||||
* you can do to enable/disable is to override checkObjectType.
|
||||
* <li>Support actions that are selection-dependent and need to be informed of every selection change
|
||||
* as it happens. To enable this, simply call setSelectionProvider to supply the GUI object such
|
||||
* as a viewer which fires the selection changed events we wish to monitor for. For the Remote
|
||||
* System Explorer viewer, we would get call setSelectionProvider(SystemViewPlugin.getSystemView());
|
||||
* <li>Support for actions that are only to be enabled when a single item is selected. To enable this
|
||||
* and save from testing for it yourself, simply call the method allowOnMultipleSelection(false).
|
||||
* The default is true, multiple selections are allowed.
|
||||
* <li>Support for disabling actions when the corresponding SystemConnection for the selected object
|
||||
* is offline. The SystemConnection can be automatically determined for some of the common
|
||||
* objects (subsystems, IRemoteFiles), for others you must set the SystemConnection for
|
||||
* this offline support.</li>
|
||||
* </ul>
|
||||
* There are many constructors but they can be broken down into permutations of the following info:
|
||||
* <ul>
|
||||
* <li>Label, tooltip and description. These can be supplied as strings, or via resource bundle and key.
|
||||
* This requires four flavors of constructor to except varying of these four pieces of information.
|
||||
* <li>Images. There are four flavors of constructors that take an image, and four identical that do not.
|
||||
* </ul>
|
||||
*
|
||||
* <p>To use this dialog, subclass it and <b>override</b> the following methods</p>:
|
||||
* <sl>
|
||||
* <li>{@link #run()}, where you place the code to do the actual work when this action is invoked.
|
||||
* <li>{@link #updateSelection(IStructuredSelection)}, for selection sensitive actions. This is your first
|
||||
* opporunity to enable/disable the action when the selection changes, by looking at the given selection
|
||||
* and returning true or false. The default implementation calls checkObjectType for each selected object.
|
||||
* <li>{@link #checkObjectType(Object)}, for selection sensitive actions. This is your second
|
||||
* opporunity to enable/disable the action when the selection changes, by looking at each individual
|
||||
* selected object, and returning true or false.
|
||||
* </sl>
|
||||
* <p>In addition to the methods you must override, you can optionally call various methods to configure
|
||||
* this action:</p>
|
||||
* <sl>
|
||||
* <li>{@link #setInputs(Shell, Viewer,ISelection)} or {@link #setShell(Shell)} and {@link #setViewer(Viewer)} and
|
||||
* {@link #setSelection(ISelection)}. These methods are called by the RSE viewers for context menu actions, and
|
||||
* can be called directly for actions used in other contexts.
|
||||
* <li>{@link #setSelectionProvider(ISelectionProvider)}, for those cases when your action monitors for selection
|
||||
* changes (pull) versus being told about them (push) via setSelection. This is less efficient, and should only
|
||||
* be used for selection-dependent actions in toolbars and pull-down menus, versus popup menus.
|
||||
* <li>{@link #setHelp(String)} to set the ID of the F1 context help for this action.
|
||||
* <li>{@link #setContextMenuGroup(String)} to set the menu group in which to place this action, when used in menus.
|
||||
* <li>{@link #allowOnMultipleSelection(boolean)} to specify if this action is to be enabled or disabled when multiple
|
||||
* objects are selected. The default is disabled.
|
||||
* <li>{@link #setSelectionSensitive(boolean)} to specify if this action's enabled state is not sensitive to what
|
||||
* is currently selected.
|
||||
* </sl>
|
||||
* <p>Further, the code you write can use the properties captured by this action and retrievable by the getter methods
|
||||
* supplied by this class.</p>
|
||||
*
|
||||
* @see ISystemAction
|
||||
* @see SystemBaseDialogAction
|
||||
* @see SystemBaseWizardAction
|
||||
*/
|
||||
public class SystemBaseAction extends Action implements ISystemAction
|
||||
{
|
||||
protected Shell shell;
|
||||
protected boolean allowOnMultipleSelection = false;
|
||||
protected IStructuredSelection sSelection = null;
|
||||
private Iterator selectionIterator = null;
|
||||
private String contextMenuGroup = null;
|
||||
protected boolean selectionSensitive = true;
|
||||
protected boolean traceSelections = false;
|
||||
protected String traceTarget;
|
||||
protected Viewer viewer = null;
|
||||
protected String helpId;
|
||||
protected Cursor waitCursor;
|
||||
protected Cursor arrowCursor;
|
||||
private ISelectionProvider fSelectionProvider;
|
||||
private Vector previousShells = new Vector();
|
||||
private Vector previousViewers = new Vector();
|
||||
//private Vector previousSelections = new Vector(); hmm, a problem here: can't just test for disposed.
|
||||
// todo: remember previous selections stack, and add a restoreSelection() method that the SystemView
|
||||
// will call after the context menu is disposed
|
||||
|
||||
// yantzi: artemis 6.0: offline support
|
||||
private boolean isAvailableOffline;
|
||||
private IHost conn;
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseAction when translated label is known. You must separately
|
||||
* call setToolTipText and setDescription to enable these if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
this(text, null, null, image, shell);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseAction when translated label and tooltip are known. You must
|
||||
* separately call setDescription to enable this if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, String tooltip, ImageDescriptor image, Shell parent)
|
||||
{
|
||||
this(text, tooltip, null, image, parent);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseAction when translated label and tooltip and description are
|
||||
* all known.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param description string displayed in status bar of some displays. Longer than tooltip.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, String tooltip, String description, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(text, image);
|
||||
this.shell = shell;
|
||||
if (tooltip != null)
|
||||
setToolTipText(tooltip);
|
||||
if (description != null)
|
||||
setDescription(description);
|
||||
//setTracing("SystemFilterPoolReferenceSelectAction");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseAction when translated label and tooltip and description are
|
||||
* all known.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param description string displayed in status bar of some displays. Longer than tooltip.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param style one of <code>AS_PUSH_BUTTON</code>, <code>AS_CHECK_BOX</code>,
|
||||
* <code>AS_DROP_DOWN_MENU</code>, <code>AS_RADIO_BUTTON</code>, and <code>AS_UNSPECIFIED</code>.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, String tooltip, String description, ImageDescriptor image, int style, Shell shell)
|
||||
{
|
||||
super(text, style);
|
||||
this.shell = shell;
|
||||
if (image != null)
|
||||
setImageDescriptor(image);
|
||||
if (tooltip != null)
|
||||
setToolTipText(tooltip);
|
||||
if (description != null)
|
||||
setDescription(description);
|
||||
//setTracing("SystemFilterPoolReferenceSelectAction");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used for actions with no image icon.
|
||||
* Constructor for SystemBaseAction when translated label is known. You must separately
|
||||
* call setToolTipText and setDescription to enable these if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, Shell shell)
|
||||
{
|
||||
this(text, null, null, null, shell);
|
||||
}
|
||||
/**
|
||||
* Used for actions with no image icon.
|
||||
* Constructor for SystemBaseAction when translated label and tooltip are known. You must
|
||||
* separately call setDescription to enable this if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, String tooltip, Shell shell)
|
||||
{
|
||||
this(text, tooltip, null, null, shell);
|
||||
}
|
||||
/**
|
||||
* Used for actions with no image icon.
|
||||
* Constructor for SystemBaseAction when translated label and tooltip and description are
|
||||
* all known.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param description string displayed in status bar of some displays. Longer than tooltip.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
public SystemBaseAction(String text, String tooltip, String description, Shell shell)
|
||||
{
|
||||
this(text, tooltip, description, null, shell);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
// HELPER METHODS...
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* Set the cursor to the wait cursor (true) or restores it to the normal cursor (false).
|
||||
*/
|
||||
public void setBusyCursor(boolean setBusy)
|
||||
{
|
||||
if (setBusy)
|
||||
{
|
||||
// Set the busy cursor to all shells.
|
||||
Display d = getShell().getDisplay();
|
||||
waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
|
||||
setDisplayCursor(waitCursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDisplayCursor(null);
|
||||
if (waitCursor != null)
|
||||
waitCursor.dispose();
|
||||
waitCursor = null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the given cursor for all shells currently active
|
||||
* for this window's display.
|
||||
*
|
||||
* @param c the cursor
|
||||
*/
|
||||
protected void setDisplayCursor(Cursor c)
|
||||
{
|
||||
setDisplayCursor(getShell(), c);
|
||||
}
|
||||
/**
|
||||
* Sets the given cursor for all shells currently active for the given shell's display.
|
||||
*
|
||||
* @param c the cursor
|
||||
*/
|
||||
public static void setDisplayCursor(Shell shell, Cursor c)
|
||||
{
|
||||
if (c == null)
|
||||
{
|
||||
// attempt to fix problem that the busy cursor sometimes stays. Phil
|
||||
shell.forceActive();
|
||||
shell.forceFocus();
|
||||
}
|
||||
Shell[] shells = shell.getDisplay().getShells();
|
||||
for (int i = 0; i < shells.length; i++)
|
||||
{
|
||||
shells[i].setCursor(c);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Turn on tracing for selections, shell and viewer to watch as it is set
|
||||
*/
|
||||
protected void setTracing(boolean tracing)
|
||||
{
|
||||
traceSelections = tracing;
|
||||
}
|
||||
/**
|
||||
* Turn on tracing for selections, shell and viewer to watch as it is set,
|
||||
* scoped to a particular class name (will use indexOf('xxx') to match).
|
||||
*/
|
||||
protected void setTracing(String tracingClassTarget)
|
||||
{
|
||||
traceSelections = true;
|
||||
traceTarget = tracingClassTarget;
|
||||
}
|
||||
/**
|
||||
* Issue trace message
|
||||
*/
|
||||
protected void issueTraceMessage(String msg)
|
||||
{
|
||||
if (traceSelections)
|
||||
{
|
||||
String className = this.getClass().getName();
|
||||
if ((traceTarget==null) || (className.indexOf(traceTarget)>=0))
|
||||
SystemBasePlugin.logInfo(this.getClass().getName()+": "+getText()+": "+msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the implementation of ISystemViewElement for the given
|
||||
* object. Returns null if the adapter is not defined or the
|
||||
* object is not adaptable.
|
||||
*/
|
||||
protected ISystemViewElementAdapter getAdapter(Object o)
|
||||
{
|
||||
return SystemAdapterHelpers.getAdapter(o);
|
||||
}
|
||||
/**
|
||||
* Returns the implementation of ISystemRemoteElement for the given
|
||||
* object. Returns null if this object does not adaptable to this.
|
||||
*/
|
||||
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
|
||||
{
|
||||
return SystemAdapterHelpers.getRemoteAdapter(o);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// CONFIGURATION METHODS...
|
||||
// -----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* An optimization for performance reasons that allows all inputs to be set in one call
|
||||
*/
|
||||
public void setInputs(Shell shell, Viewer v, ISelection selection)
|
||||
{
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS");
|
||||
setShell(shell);
|
||||
setViewer(v);
|
||||
setSelection(selection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent shell for this action. Usually context dependent.
|
||||
*/
|
||||
public void setShell(Shell shell)
|
||||
{
|
||||
// in defect 42399 it was reported the shell for persistent actions gets reset in browse
|
||||
// dialogs, on a right click, overriding the real shell with the browse dialog's shell.
|
||||
// When the browse dialog is closed, we only retain the disposed shell. To solve this
|
||||
// we have to return a stack of shells and on getShell peel back to the last non-disposed
|
||||
// one...
|
||||
this.previousShells.add(this.shell);
|
||||
this.shell = shell;
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETSHELL. shell = " + shell);
|
||||
}
|
||||
/**
|
||||
* Set the Viewer that called this action. It is good practice for viewers to call this
|
||||
* so actions can directly access them if needed.
|
||||
*/
|
||||
public void setViewer(Viewer v)
|
||||
{
|
||||
this.previousViewers.add(this.viewer); // see comment in setShell
|
||||
this.viewer = v;
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETVIEWER. viewer = " + viewer);
|
||||
}
|
||||
/**
|
||||
* This is called when the user selects something in the tree.
|
||||
* This is your opportunity to disable the action based on the current selection.
|
||||
* The default implementation of this method:
|
||||
* <ul>
|
||||
* <li>Disables the action if the selection is not a structured selection. Should never happen.
|
||||
* <li>Disables the action if more than one item is selected and allowOnMultipleSelection is false.
|
||||
* <li>Converts the selection to a structured selection and calls updateSelection. Uses returned
|
||||
* boolean value to setEnabled() this action.
|
||||
* </ul>
|
||||
*/
|
||||
public void selectionChanged(SelectionChangedEvent event)
|
||||
{
|
||||
ISelection selection = event.getSelection();
|
||||
if (traceSelections)
|
||||
issueTraceMessage("INSIDE SELECTIONCHANGED. Selection null? " + (selection==null));
|
||||
setSelection(selection);
|
||||
}
|
||||
/**
|
||||
* This is called by the UI calling the action, if that UI is not a selection provider.
|
||||
* That is, this is an alternative to calling selectionChanged when there is no SelectionChangedEvent.
|
||||
* @see #selectionChanged(SelectionChangedEvent event)
|
||||
*/
|
||||
public void setSelection(ISelection selection)
|
||||
{
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETSELECTION. Selection null? " + (selection==null));
|
||||
if ( !(selection instanceof IStructuredSelection) )
|
||||
{
|
||||
if (selectionSensitive)
|
||||
setEnabled(false);
|
||||
if (traceSelections)
|
||||
System.out.println(this.getClass().getName() + ". Returning false in setSelection. selection= " + selection);
|
||||
return;
|
||||
}
|
||||
if (selectionSensitive)
|
||||
{
|
||||
// see comment in setShell
|
||||
//this.previousSelections.add(this.sSelection);
|
||||
}
|
||||
sSelection = (IStructuredSelection)selection;
|
||||
if (!selectionSensitive || (selection == null))
|
||||
{
|
||||
if (traceSelections)
|
||||
System.out.println(this.getClass().getName() + ". Returning. selectionSensitive = " + selectionSensitive);
|
||||
return;
|
||||
}
|
||||
boolean multiSelect = (sSelection.size() > 1);
|
||||
if (!allowOnMultipleSelection && multiSelect)
|
||||
{
|
||||
setEnabled(false);
|
||||
if (traceSelections)
|
||||
System.out.println(this.getClass().getName() + ". Returning false in setSelection. #selected = " + sSelection.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean enable = false;
|
||||
/*
|
||||
boolean debug = getText().equals("Copy");
|
||||
if (debug)
|
||||
enable = updateSelection(sSelection);
|
||||
else */
|
||||
enable = updateSelection(sSelection);
|
||||
setEnabled(enable);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Identify the UI object that will be used to get the selection
|
||||
* list from. <b>Only call this if your action is displayed in a toolbar
|
||||
* or non-popup menu<b>, as it will impact performance. It results in your
|
||||
* action getting called every time the user changes his selection in
|
||||
* the given provider viewer.
|
||||
*/
|
||||
public void setSelectionProvider(ISelectionProvider provider)
|
||||
{
|
||||
if (fSelectionProvider != null)
|
||||
fSelectionProvider.removeSelectionChangedListener(this);
|
||||
|
||||
fSelectionProvider = provider;
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETSELECTIONPROVIDER. fSelectionProvider = " + fSelectionProvider);
|
||||
|
||||
|
||||
if (fSelectionProvider != null)
|
||||
fSelectionProvider.addSelectionChangedListener(this);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// CONFIGURATION METHODS CHILD CLASSES OR OTHERS CALL TO CONFIGURE THIS ACTION
|
||||
// ---------------------------------------------------------------------------
|
||||
/**
|
||||
* Set the help id for the action
|
||||
*/
|
||||
public void setHelp(String id)
|
||||
{
|
||||
SystemWidgetHelpers.setHelp(this, id);
|
||||
this.helpId = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the context menu group this action is to go into, for popup menus. If not set,
|
||||
* someone else will make this decision.
|
||||
*/
|
||||
public void setContextMenuGroup(String group)
|
||||
{
|
||||
contextMenuGroup = group;
|
||||
}
|
||||
/**
|
||||
* This method is supplied for actions that are to be enable even when more than
|
||||
* one item is selected. The default is to only enable on single selections.
|
||||
*/
|
||||
public void allowOnMultipleSelection(boolean allow)
|
||||
{
|
||||
allowOnMultipleSelection = allow;
|
||||
}
|
||||
/**
|
||||
* Specify whether this action is selection-sensitive. The default is true.
|
||||
* This means the enabled state is tested and set when the selection is set.
|
||||
*/
|
||||
public void setSelectionSensitive(boolean sensitive)
|
||||
{
|
||||
selectionSensitive = sensitive;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// METHODS THAT CAN OR SHOULD BE OVERRIDDEN BY CHILD CLASSES...
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* First opportunity to decide if the action should be enabled or not based on the
|
||||
* current selection. Called by default implementation of selectionChanged, which
|
||||
* converts the ISelection to an IStructuredSelection, which is all we support. The
|
||||
* return result is used to enable or disable this action.
|
||||
* <p>
|
||||
* The default implementation of this method:
|
||||
* <ul>
|
||||
* <li>Returns false if calling checkObjectType on any object in the selection list returns false.
|
||||
* <li>Returns true otherwise.
|
||||
* </ul>
|
||||
* If desired, override this method for a different algorithm to decide enablement.
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
enable = checkObjectType(e.next());
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Second and easiest opportunity to decide if the action should be enabled or not based
|
||||
* on the current selection. Called by default implementation of updateSelection, once for
|
||||
* each item in the selection. If any call to this returns false, the action is disabled.
|
||||
* The default implementation returns true.
|
||||
*/
|
||||
public boolean checkObjectType(Object selectedObject)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* Child classes need to override this. If you need the parent shell,
|
||||
* call getShell. If you need to know the current selection, call
|
||||
* getSelection(), or getFirstSelection() followed by getNextSelection()
|
||||
* until null is returned.
|
||||
* @see Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// GETTER METHODS RETURNING INFORMATION CAPTURED IN BASE CLASS
|
||||
// -----------------------------------------------------------
|
||||
/**
|
||||
* Return if true if this is a dummy action
|
||||
*/
|
||||
public boolean isDummy()
|
||||
{
|
||||
String label = getText();
|
||||
if (label == null)
|
||||
return false;
|
||||
return label.equals("dummy");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the help id for this action
|
||||
*/
|
||||
public String getHelpContextId()
|
||||
{
|
||||
return helpId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the parent shell for this action. Will be null if setShell has not been called.
|
||||
*/
|
||||
public Shell getShell()
|
||||
{
|
||||
return internalGetShell(true);
|
||||
}
|
||||
/**
|
||||
* Retrieves the parent shell for this action. Will be null if setShell has not been called.
|
||||
* Method for subclasses that want to call this and not do the test for null.
|
||||
*/
|
||||
protected Shell getShell(boolean doTest)
|
||||
{
|
||||
return internalGetShell(doTest);
|
||||
}
|
||||
/**
|
||||
* Abstraction
|
||||
*/
|
||||
private Shell internalGetShell(boolean doTest)
|
||||
{
|
||||
// in defect 42399 it was reported the shell for persistent actions gets reset in browse
|
||||
// dialogs, on a right click, overriding the real shell with the browse dialog's shell.
|
||||
// When the browse dialog is closed, we only retain the disposed shell. To solve this
|
||||
// we have to return a stack of shells and on getShell peel back to the last non-disposed
|
||||
// one...
|
||||
if ((shell!=null) && (shell.isDisposed()))
|
||||
{
|
||||
boolean found = false;
|
||||
Vector disposedShells = new Vector();
|
||||
for (int idx=previousShells.size()-1; !found && (idx>=0); idx--)
|
||||
{
|
||||
shell = (Shell)previousShells.elementAt(idx);
|
||||
if (shell.isDisposed())
|
||||
disposedShells.add(shell);
|
||||
else
|
||||
found = true;
|
||||
}
|
||||
if (!found)
|
||||
shell = null;
|
||||
for (int idx=0; idx<disposedShells.size(); idx++)
|
||||
previousShells.remove(disposedShells.elementAt(idx));
|
||||
}
|
||||
if (doTest && (shell == null))
|
||||
{
|
||||
System.out.println("Inside getShell for " + this.getClass().getName() + " and the shell is null! This needs to be investigated");
|
||||
SystemBasePlugin.logDebugMessage("SystemBaseAction", "Inside getShell for " + this.getClass().getName() + " and the shell is null! This needs to be investigated");
|
||||
}
|
||||
return shell;
|
||||
}
|
||||
/**
|
||||
* Get the Viewer that called this action. Not guaranteed to be set,
|
||||
* depends if that viewer called setViewer or not. SystemView does.
|
||||
*/
|
||||
public Viewer getViewer()
|
||||
{
|
||||
// see comment in getShell()...
|
||||
if ((viewer!=null) && (viewer.getControl().isDisposed()))
|
||||
{
|
||||
boolean found = false;
|
||||
Vector disposedViewers = new Vector();
|
||||
for (int idx=disposedViewers.size()-1; !found && (idx>=0); idx--)
|
||||
{
|
||||
viewer = (Viewer)previousViewers.elementAt(idx);
|
||||
if (viewer.getControl().isDisposed())
|
||||
disposedViewers.add(viewer);
|
||||
else
|
||||
found = true;
|
||||
}
|
||||
if (!found)
|
||||
viewer = null;
|
||||
for (int idx=0; idx<disposedViewers.size(); idx++)
|
||||
previousViewers.remove(disposedViewers.elementAt(idx));
|
||||
}
|
||||
return viewer;
|
||||
}
|
||||
/**
|
||||
* Return the current viewer as an ISystemTree if it is one, or null otherwise
|
||||
*/
|
||||
protected ISystemTree getCurrentTreeView()
|
||||
{
|
||||
Viewer v = getViewer();
|
||||
if (v instanceof ISystemTree)
|
||||
return (ISystemTree)v;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the context menu group this action is to go into, for popup menus. By default is
|
||||
* null, meaning there is no recommendation
|
||||
*/
|
||||
public String getContextMenuGroup()
|
||||
{
|
||||
return contextMenuGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this action is selection-sensitive. The default is true.
|
||||
* This means the enabled state is tested and set when the selection is set.
|
||||
*/
|
||||
public boolean isSelectionSensitive()
|
||||
{
|
||||
return selectionSensitive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return value of last call to getSelectionProvider.
|
||||
*/
|
||||
public ISelectionProvider getSelectionProvider()
|
||||
{
|
||||
return fSelectionProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current selection, as per last call to selectionChanged.
|
||||
*/
|
||||
public IStructuredSelection getSelection()
|
||||
{
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE GETSELECTION. sSelection null? " + (sSelection==null));
|
||||
return sSelection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return first item currently selected, as per last call to selectionChanged.
|
||||
* This is handy for actions where allowOnMultipleSelection is false.
|
||||
* This method also starts a new iterator, and after you can call getNextSelection()
|
||||
* until it returns null. This is handy for actions where allowOnMultipleSelection is true.
|
||||
* @see #getNextSelection()
|
||||
*/
|
||||
protected Object getFirstSelection()
|
||||
{
|
||||
if (sSelection != null)
|
||||
{
|
||||
selectionIterator = sSelection.iterator();
|
||||
if (selectionIterator.hasNext())
|
||||
return selectionIterator.next();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
selectionIterator = null;
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Return next item currently selection, as per last call to selectionChanged.
|
||||
* YOU MUST HAVE CALLED GETFIRSTSELECTION() PRIOR TO CALLING THIS.
|
||||
* Your code can loop until this returns null.
|
||||
* @see #getFirstSelection()
|
||||
*/
|
||||
protected Object getNextSelection()
|
||||
{
|
||||
if ((sSelection != null) && (selectionIterator != null))
|
||||
{
|
||||
if (selectionIterator.hasNext())
|
||||
return selectionIterator.next();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
selectionIterator = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables this action if offline mode, otherwise delegates to the super class.
|
||||
*
|
||||
* @see org.eclipse.jface.action.IAction#isEnabled()
|
||||
*/
|
||||
public boolean isEnabled()
|
||||
{
|
||||
if (!isAvailableOffline)
|
||||
{
|
||||
if (conn != null && conn.isOffline())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Object selection = getFirstSelection();
|
||||
while (selection != null)
|
||||
{
|
||||
if (selection instanceof ISubSystem && ((ISubSystem)selection).isOffline())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// yantzi: this disables all actions on SystemConnection
|
||||
//else if (selection instanceof SystemConnection)
|
||||
//{
|
||||
// connection = (SystemConnection)selection;
|
||||
// if (connection.isOffline())
|
||||
// return false;
|
||||
//}
|
||||
|
||||
selection = getNextSelection();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return super.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* If this is one of those rare actions that is to be made available in offline mode, then call this
|
||||
* during or immediately after constructing to state that. The default is false.
|
||||
*/
|
||||
public void setAvailableOffline(boolean availableOffline)
|
||||
{
|
||||
this.isAvailableOffline = availableOffline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the SystemConnection used by this action for disabling the action
|
||||
* in offline mode, or for whatever reason subclasses may need it.
|
||||
*/
|
||||
public void setHost(IHost connection)
|
||||
{
|
||||
conn = connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the system connection which is the parent of whatever is currently selected.
|
||||
*/
|
||||
public IHost getSystemConnection()
|
||||
{
|
||||
return conn;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,439 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.internal.model.SystemProfileManager;
|
||||
import org.eclipse.rse.model.ISystemProfileManager;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
|
||||
import org.eclipse.rse.ui.dialogs.SystemSimpleCopyDialog;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* An abstract base class for all copy actions. Defers minimal requirements to
|
||||
* child classes.
|
||||
*/
|
||||
public abstract class SystemBaseCopyAction extends SystemBaseDialogAction
|
||||
implements ISystemMessages, IRunnableWithProgress, ISystemCopyTargetSelectionCallback
|
||||
{
|
||||
protected ISystemProfileManager mgr;
|
||||
protected ISystemRegistry sr;
|
||||
protected String[] oldNames;
|
||||
protected String[] newNames;
|
||||
protected Object[] oldObjects;
|
||||
protected Object targetContainer;
|
||||
protected boolean copiedOk = true;
|
||||
//private boolean makeActive;
|
||||
protected Exception runException = null;
|
||||
protected int mode = SystemSimpleCopyDialog.MODE_COPY;
|
||||
protected int runCount = 0;
|
||||
public static final int MODE_COPY = SystemSimpleCopyDialog.MODE_COPY;
|
||||
public static final int MODE_MOVE = SystemSimpleCopyDialog.MODE_MOVE;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor when using default action ID
|
||||
* @param parent Owning shell
|
||||
* @param mode Either MODE_COPY or MODE_MOVE from this class
|
||||
*/
|
||||
public SystemBaseCopyAction(Shell parent, int mode)
|
||||
{
|
||||
this(parent, mode==MODE_COPY ? SystemResources.ACTION_COPY_LABEL : SystemResources.ACTION_MOVE_LABEL, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param parent Owning shell
|
||||
* @param label
|
||||
* @param mode Either MODE_COPY or MODE_MOVE from this class
|
||||
*/
|
||||
public SystemBaseCopyAction(Shell parent, String label, int mode)
|
||||
{
|
||||
super(label,
|
||||
(mode==MODE_COPY ?
|
||||
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY)
|
||||
//SystemPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_COPY_ID)
|
||||
: SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVE_ID)),
|
||||
parent);
|
||||
this.mode = mode;
|
||||
mgr = SystemProfileManager.getSystemProfileManager();
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
allowOnMultipleSelection(true);
|
||||
setProcessAllSelections(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset. This is a re-run of this action
|
||||
*/
|
||||
protected void reset()
|
||||
{
|
||||
oldNames = null;
|
||||
newNames = null;
|
||||
oldObjects = null;
|
||||
targetContainer = null;
|
||||
copiedOk = true;
|
||||
runException = null;
|
||||
//System.out.println("inside base reset()");
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of parent.
|
||||
* Return the dialog that will be used to prompt for the copy/move target location
|
||||
* @see #run()
|
||||
*/
|
||||
protected Dialog createDialog(Shell parent)
|
||||
{
|
||||
++runCount;
|
||||
if (runCount > 1)
|
||||
reset();
|
||||
SystemSimpleCopyDialog copyDlg = new SystemSimpleCopyDialog(parent, getPromptString(), mode, this, getTreeModel(), getTreeInitialSelection());
|
||||
|
||||
// our title now reflects multiple selection. If single change it.
|
||||
IStructuredSelection sel = getSelection();
|
||||
//System.out.println("size = "+sel.size());
|
||||
if (sel.size() == 1)
|
||||
{
|
||||
String singleTitle = null;
|
||||
if (mode == MODE_COPY)
|
||||
singleTitle = SystemResources.RESID_COPY_SINGLE_TITLE;
|
||||
else
|
||||
singleTitle = SystemResources.RESID_MOVE_SINGLE_TITLE;
|
||||
//System.out.println("..."+singleTitle);
|
||||
if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev
|
||||
copyDlg.setTitle(singleTitle);
|
||||
}
|
||||
|
||||
return copyDlg;
|
||||
}
|
||||
|
||||
protected abstract String[] getOldNames();
|
||||
protected abstract Object[] getOldObjects();
|
||||
/**
|
||||
* Get the verbage prompt to show on line one of the copy dialog
|
||||
*/
|
||||
protected String getPromptString()
|
||||
{
|
||||
if (mode == MODE_COPY)
|
||||
return SystemResources.RESID_COPY_PROMPT;
|
||||
else
|
||||
return SystemResources.RESID_MOVE_PROMPT;
|
||||
}
|
||||
|
||||
protected abstract SystemSimpleContentElement getTreeModel();
|
||||
protected abstract SystemSimpleContentElement getTreeInitialSelection();
|
||||
|
||||
/**
|
||||
* This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected
|
||||
* object is a valid parent object. This affects the enabling of the OK button on that dialog.
|
||||
* <p>
|
||||
* The default is to return true if the selected element has no children. This is sufficient for most cases. However,
|
||||
* in some cases it is not, such as for filter strings where we want to only enable OK if a filter is selected. It is
|
||||
* possible that filter pools have no filters, so the default algorithm is not sufficient. In these cases the child class
|
||||
* can override this method.
|
||||
*/
|
||||
public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
|
||||
{
|
||||
return !selectedElement.hasChildren();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Required by parent. We use it to actually do the work.
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
targetContainer = getTargetContainer(dlg);
|
||||
if (targetContainer != null)
|
||||
{
|
||||
boolean okToProceed = preCheckForCollision();
|
||||
if (!okToProceed)
|
||||
return null;
|
||||
IRunnableContext runnableContext = getRunnableContext();
|
||||
try
|
||||
{
|
||||
runnableContext.run(false,false,this); // inthread, cancellable, IRunnableWithProgress
|
||||
if (copiedOk)
|
||||
{
|
||||
SystemMessage completeMsg = getCompletionMessage(targetContainer, oldNames, newNames);
|
||||
if (completeMsg != null)
|
||||
{
|
||||
SystemMessageDialog msgDlg = new SystemMessageDialog(getShell(),completeMsg);
|
||||
msgDlg.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (java.lang.reflect.InvocationTargetException exc) // unexpected error
|
||||
{
|
||||
showOperationMessage((Exception)exc.getTargetException(), getShell());
|
||||
//throw (Exception) exc.getTargetException();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
showOperationMessage(exc, getShell());
|
||||
//throw exc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with
|
||||
* a progress monitor in it, we will use this, else we will create a progress monitor dialog.
|
||||
*/
|
||||
protected IRunnableContext getRunnableContext()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
IRunnableContext irc = sr.getRunnableContext();
|
||||
if (irc == null)
|
||||
irc = new ProgressMonitorDialog(getShell());
|
||||
return irc;
|
||||
}
|
||||
/**
|
||||
* Override this method if you supply your own copy/move target dialog.
|
||||
* Return the user-selected target or null if cancelled
|
||||
*/
|
||||
protected Object getTargetContainer(Dialog dlg)
|
||||
{
|
||||
SystemSimpleCopyDialog cpyDlg = (SystemSimpleCopyDialog)dlg;
|
||||
Object targetContainer = null;
|
||||
if (!cpyDlg.wasCancelled())
|
||||
targetContainer = cpyDlg.getTargetContainer();
|
||||
return targetContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do a pre-check for a collision situation.
|
||||
* This really is only a problem for filter strings, when a name collision is fatal verus
|
||||
* recoverable via a new-name prompt.
|
||||
*/
|
||||
protected boolean preCheckForCollision()
|
||||
{
|
||||
boolean ok = true;
|
||||
oldNames = getOldNames();
|
||||
oldObjects = getOldObjects();
|
||||
int steps = oldObjects.length;
|
||||
|
||||
String oldName = null;
|
||||
Object oldObject = null;
|
||||
for (int idx=0; ok && (idx<steps); idx++)
|
||||
{
|
||||
oldName = oldNames[idx];
|
||||
oldObject = oldObjects[idx];
|
||||
ok = preCheckForCollision(getShell(), targetContainer, oldObject, oldName);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
/**
|
||||
* Overridable entry point when you want to prevent any copies/moves if any of the
|
||||
* selected objects have a name collision.
|
||||
* <p>
|
||||
* If you decide to override this, it is your responsibility to issue the error
|
||||
* message to the user and return false here.
|
||||
* <p>
|
||||
* @return true if there is no problem, false if there is a fatal collision
|
||||
*/
|
||||
protected boolean preCheckForCollision(Shell shell, Object targetContainer,
|
||||
Object oldObject, String oldName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after all the copy/move operations end, be it successfully or not.
|
||||
* Your opportunity to display completion or do post-copy selections/refreshes
|
||||
*/
|
||||
public void copyComplete() {}
|
||||
|
||||
// ----------------------------------
|
||||
// INTERNAL METHODS...
|
||||
// ----------------------------------
|
||||
/**
|
||||
* Method required by IRunnableWithProgress interface.
|
||||
* Allows execution of a long-running operation modally by via a thread.
|
||||
* In our case, it runs the copy operation with a visible progress monitor
|
||||
*/
|
||||
public void run(IProgressMonitor monitor)
|
||||
throws java.lang.reflect.InvocationTargetException,
|
||||
java.lang.InterruptedException
|
||||
{
|
||||
SystemMessage msg = getCopyingMessage();
|
||||
runException = null;
|
||||
|
||||
try
|
||||
{
|
||||
//oldNames = getOldNames();
|
||||
//oldObjects = getOldObjects();
|
||||
int steps = oldObjects.length;
|
||||
monitor.beginTask(msg.getLevelOneText(), steps);
|
||||
copiedOk = true;
|
||||
String oldName = null;
|
||||
String newName = null;
|
||||
Object oldObject = null;
|
||||
newNames = new String[oldNames.length];
|
||||
for (int idx=0; copiedOk && (idx<steps); idx++)
|
||||
{
|
||||
oldName = oldNames[idx];
|
||||
oldObject = oldObjects[idx];
|
||||
monitor.subTask(getCopyingMessage(oldName).getLevelOneText());
|
||||
newName = checkForCollision(getShell(), monitor, targetContainer, oldObject, oldName);
|
||||
if (newName == null)
|
||||
copiedOk = false;
|
||||
else
|
||||
copiedOk = doCopy(monitor, targetContainer, oldObject, newName);
|
||||
newNames[idx] = newName;
|
||||
monitor.worked(1);
|
||||
}
|
||||
monitor.done();
|
||||
}
|
||||
catch(java.lang.InterruptedException exc)
|
||||
{
|
||||
monitor.done();
|
||||
runException = exc;
|
||||
throw (java.lang.InterruptedException)runException;
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
monitor.done();
|
||||
runException = new java.lang.reflect.InvocationTargetException(exc);
|
||||
throw (java.lang.reflect.InvocationTargetException)runException;
|
||||
}
|
||||
copyComplete();
|
||||
}
|
||||
|
||||
protected abstract String checkForCollision(Shell shell, IProgressMonitor monitor, Object targetContainer, Object oldObject, String oldName);
|
||||
/**
|
||||
* Get the generic "Copying..." or "Moving..." message
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage()
|
||||
{
|
||||
if (mode == MODE_COPY)
|
||||
return SystemPlugin.getPluginMessage(MSG_COPYGENERIC_PROGRESS);
|
||||
else
|
||||
return SystemPlugin.getPluginMessage(MSG_MOVEGENERIC_PROGRESS);
|
||||
}
|
||||
/**
|
||||
* Get the specific "Copying %1..." or "Moving %1..." message
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage(String oldName)
|
||||
{
|
||||
SystemMessage msg = null;
|
||||
if (mode == MODE_COPY)
|
||||
msg = SystemPlugin.getPluginMessage(MSG_COPYTHINGGENERIC_PROGRESS);
|
||||
else
|
||||
msg = SystemPlugin.getPluginMessage(MSG_MOVETHINGGENERIC_PROGRESS);
|
||||
msg.makeSubstitution(oldName);
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* DO THE ACTUAL COPY OR MOVE. THIS MUST BE IMPLEMENTED BY CHILD CLASSES
|
||||
*/
|
||||
protected abstract boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Return complete message.
|
||||
* Override if you want to popup a completion message after a successful copy/move
|
||||
*/
|
||||
public SystemMessage getCompletionMessage(Object targetContainer, String[] oldNames, String[] newNames)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to show an error message resulting from the attempted operation.
|
||||
*/
|
||||
protected void showOperationMessage(Exception exc, Shell shell)
|
||||
{
|
||||
if (exc instanceof java.lang.InterruptedException)
|
||||
showOperationCancelledMessage(shell);
|
||||
else if (exc instanceof java.lang.reflect.InvocationTargetException)
|
||||
showOperationErrorMessage(shell, ((java.lang.reflect.InvocationTargetException)exc).getTargetException());
|
||||
else
|
||||
showOperationErrorMessage(shell, exc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an error message when the operation fails.
|
||||
* Shows a common message by default.
|
||||
* Overridable.
|
||||
*/
|
||||
protected void showOperationErrorMessage(Shell shell, Throwable exc)
|
||||
{
|
||||
if (exc instanceof SystemMessageException)
|
||||
showOperationErrorMessage(shell, (SystemMessageException)exc);
|
||||
else
|
||||
{
|
||||
String msg = exc.getMessage();
|
||||
if ((msg == null) || (exc instanceof ClassCastException))
|
||||
msg = exc.getClass().getName();
|
||||
SystemMessageDialog msgDlg =
|
||||
new SystemMessageDialog(shell,
|
||||
SystemPlugin.getPluginMessage(MSG_OPERATION_FAILED).makeSubstitution(msg));
|
||||
msgDlg.setException(exc);
|
||||
msgDlg.open();
|
||||
//SystemPlugin.logError("Copy/Move operation failed",exc);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Show an error message when the operation fails.
|
||||
* Shows a SystemMessage that was encapsulated in a SystemMessage exception
|
||||
* Overridable.
|
||||
*/
|
||||
protected void showOperationErrorMessage(Shell shell, SystemMessageException exc)
|
||||
{
|
||||
SystemMessage msg = exc.getSystemMessage();
|
||||
SystemMessageDialog msgDlg =
|
||||
new SystemMessageDialog(shell, msg);
|
||||
msgDlg.open();
|
||||
//SystemPlugin.logError("Copy/Move operation failed",exc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an error message when the user cancels the operation.
|
||||
* Shows a common message by default.
|
||||
* Overridable.
|
||||
*/
|
||||
protected void showOperationCancelledMessage(Shell shell)
|
||||
{
|
||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, SystemPlugin.getPluginMessage(MSG_OPERATION_CANCELLED));
|
||||
msgDlg.open();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,360 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.ui.dialogs.ISystemPromptDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A specialization for Action for actions that put up dialogs.
|
||||
* These actions have some common requirements:
|
||||
* <sl>
|
||||
* <li>They need to take the parent Shell object in the constructor or later perhaps via setParent
|
||||
* <li>They need to be able to set the input value for the dialog. This is typically related to
|
||||
* what is currently selected.
|
||||
* <li>They need to be able to get the output value from the dialog. This can be queried by
|
||||
* calling getValue after the action runs.
|
||||
* </sl>
|
||||
* <p>This subclass of SystemBaseAction implements the run() method in a way optimized for the processing
|
||||
* of dialogs: it calls an abstract method to create the dialog, then sets the input from the action's
|
||||
* value (if set) or selection (otherwise) and opens the dialog. After, it calls an abstract method to
|
||||
* extract the dialog's output object which is used to set this action's value, for the benefit of the
|
||||
* caller.
|
||||
* </p>
|
||||
* <p>To use this dialog, subclass it and <b>override</b> the following methods</p>:
|
||||
* <sl>
|
||||
* <li>{@link #createDialog(Shell)}
|
||||
* <li>{@link #getDialogValue(Dialog)}
|
||||
* <li>{@link #run()} but ONLY if you don't want the default implementation of this method.
|
||||
* </sl>
|
||||
* <p>In addition to the methods you must override, you can optionally call various methods to configure
|
||||
* this action. In addition to those in the parent class, this class offers these configuration methods:</p>
|
||||
* <sl>
|
||||
* <li>{@link #setDialogHelp(String)} to set the context help ID for the dialog, for cases where the dialog is generic
|
||||
* and its help depends on context and hence cannot be hardcoded in the dialog class.
|
||||
* <li>{@link #setValue(Object)} to the set the input object to pass to the dialog, for cases where the current selection
|
||||
* is not what you want to pass to the dialog.
|
||||
* <li>{@link #setNeedsProgressMonitor(boolean)} to specify if the dialog is to display a progress monitor or not, for cases
|
||||
* where this decision depends on context and hence cannot be hardcoded in the dialog class.
|
||||
* <li>{@link #setProcessAllSelections(boolean)} to specify the behaviour when there are multiple objects selected. By
|
||||
* default, the dialog will be created and processed once for each selected object, but you can specify that you instead
|
||||
* want to only invoke the dialog once and pass in all selected objects as a single ISelection object.
|
||||
* </sl>
|
||||
*
|
||||
*/
|
||||
public abstract class SystemBaseDialogAction extends SystemBaseAction
|
||||
implements ISystemDialogAction
|
||||
{
|
||||
protected Object value;
|
||||
protected boolean processAll;
|
||||
protected boolean needsProgressMonitor, needsProgressMonitorSet;
|
||||
protected boolean cancelled;
|
||||
protected String dlgHelpId;
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseDialogAction when translated label is known. You must separately
|
||||
* call setToolTipText and setDescription to enable these if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseDialogAction(String text, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(text, image, shell);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseDialogAction when translated label and tooltip are known. You must
|
||||
* separately call setDescription to enable this if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseDialogAction(String text, String tooltip, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(text, tooltip, image, shell);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseDialogAction when translated label and tooltip and description are
|
||||
* all known.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param description string displayed in status bar of some displays. Longer than tooltip.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param shell Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseDialogAction(String text, String tooltip, String description, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(text, tooltip, description, image, shell);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------
|
||||
// HELPER/GETTER METHODS...
|
||||
// ------------------------
|
||||
/**
|
||||
* Return the help Id destined for the dialog this action brings up
|
||||
*/
|
||||
public String getDialogHelpContextId()
|
||||
{
|
||||
return dlgHelpId;
|
||||
}
|
||||
/**
|
||||
* Get the value, typically set in actionPerformed
|
||||
* after putting up the dialog, and holds the output
|
||||
* from the dialog.
|
||||
*/
|
||||
public Object getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* Return true if the action's dialog/wizard is to include a progress monitor
|
||||
*/
|
||||
public boolean getNeedsProgressMonitor()
|
||||
{
|
||||
return needsProgressMonitor;
|
||||
}
|
||||
/**
|
||||
* Return true if the caller explicitly called setNeedsProgressMonitor
|
||||
*/
|
||||
protected boolean wasNeedsProgressMonitorSet()
|
||||
{
|
||||
return needsProgressMonitorSet;
|
||||
}
|
||||
/**
|
||||
* Return setting of setProcessAllSelections.
|
||||
* @see #setProcessAllSelections(boolean)
|
||||
*/
|
||||
protected boolean getProcessAllSelections()
|
||||
{
|
||||
return this.processAll;
|
||||
}
|
||||
/**
|
||||
* Returns true if the user cancelled the dialog.
|
||||
* The default way to guess at this is to test if the output from
|
||||
* getDialogValue was null or not. Override if you need to refine this.
|
||||
*/
|
||||
public boolean wasCancelled()
|
||||
{
|
||||
if (cancelled) // most accurate
|
||||
return true;
|
||||
else
|
||||
return (value == null);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// CONFIGURATION METHODS...
|
||||
// -----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* When using generic dialogs, it is nice to offer non-generic help.
|
||||
* If desired, set the help context ID here, and it will be passed on
|
||||
* to the generic dialog after instantiation of it.
|
||||
*/
|
||||
public void setDialogHelp(String id)
|
||||
{
|
||||
this.dlgHelpId = id;
|
||||
}
|
||||
/**
|
||||
* Set the value used as input to the dialog
|
||||
*/
|
||||
public void setValue(Object value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* If desired, specify if you want to include a progress monitor in your
|
||||
* dialog or wizard. If the dialog is a SystemPromptDialog or the Wizard
|
||||
* is a SystemWizardDialog, it will be passed on after instantiating the
|
||||
* dialog or wizard.
|
||||
*/
|
||||
public void setNeedsProgressMonitor(boolean needs)
|
||||
{
|
||||
this.needsProgressMonitor = needs;
|
||||
this.needsProgressMonitorSet = true;
|
||||
}
|
||||
/**
|
||||
* If this action supports being enabled for multiple selections (the default,
|
||||
* but changable by calling allowOnMultipleSelections(false)), then by default
|
||||
* the default run() implementation will create and invoke the dialog once for each
|
||||
* item selected. Call this with true to change that behaviour so that the dialog
|
||||
* is only created and processed once.
|
||||
* <p>
|
||||
* Use this when the dialog itself will process all selected items at once.
|
||||
* <p>
|
||||
* The default is false.
|
||||
*/
|
||||
public void setProcessAllSelections(boolean all)
|
||||
{
|
||||
this.processAll = all;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// OVERRIDABLE METHODS...
|
||||
// -----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* This is the method called by the system when the user
|
||||
* selects this action. This is a default implementation
|
||||
* which:
|
||||
* <ul>
|
||||
* <li>calls abstract method createDialog() to get the dialog
|
||||
* object. Child classes must implement this method.
|
||||
* <li>if the returned dialog implements ISystemPromptDialog, then
|
||||
* it will call setInputObject passing getValue() as the paramter.
|
||||
* If getValue returns null, then instead the currently selected objects
|
||||
* are passed as the parameter. If setProcessAllSelections has been called
|
||||
* then the current ISelection is passed, else the each object in the selection
|
||||
* is passed, and the dialog is displayed once per selected object.
|
||||
* Your dialog can then cast this input as necessary to initialize its input
|
||||
* fields, say. Presumably it knows what to cast it to. Note: code that
|
||||
* creates actions does not typically call setValue unless
|
||||
* the action is used in a UI that has no concept of ISelection, such as a
|
||||
* raw swt widget. ISelection is a JFace viewer concept.
|
||||
* <li>calls dlg.open(getShell()) on the dialog to display it.
|
||||
* <li>calls setValue(getDialogValue(dlg)) so callers can get the dialog output
|
||||
* via a call to getValue() on this action object. Again, this is typically only
|
||||
* used when launching actions from non-viewers, such as launching one dialog from
|
||||
* another dialog. When launching from popup-menus of viewers, use selectionChanged
|
||||
* instead. Either way, the object set or selected is passed on to the dialog,
|
||||
* if not null, by way of a call to the dialog's setInputObject method.
|
||||
* </ul>
|
||||
* If this action is to be enabled when multiple items are selected
|
||||
* (the default) then the processing above is repeated once for every object
|
||||
* selected. If your dialog actually processes all the selected items, then
|
||||
* call setProcessAllSelections(true) to change the behaviour to only do all
|
||||
* of this once. In this case setInputObject will be called with the
|
||||
* entire IStructuredSelection object, and your dialog code can process each
|
||||
* of the objects in it.
|
||||
* <p>
|
||||
* Please note that if NO ITEMS are selected, we will still call createDialog
|
||||
* but not call setInput.
|
||||
* <p>
|
||||
* To use this default implementation you must implement
|
||||
* the createDialog method. Note we will also call
|
||||
* dlg.setBlockOnOpen(true) on the returned dialog to
|
||||
* force it to be modal.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
Shell shell = getShell();
|
||||
if (shell == null)
|
||||
SystemBasePlugin.logDebugMessage(this.getClass().getName(),"Warning: shell is null!");
|
||||
Object currentSelection = null;
|
||||
if (!getProcessAllSelections())
|
||||
currentSelection = getFirstSelection();
|
||||
else
|
||||
currentSelection = getSelection();
|
||||
boolean cancelled = false;
|
||||
|
||||
do
|
||||
{
|
||||
Dialog dlg = createDialog(getShell());
|
||||
if (dlg == null)
|
||||
return;
|
||||
dlg.setBlockOnOpen(true);
|
||||
Object dialogInputValue = currentSelection;
|
||||
if (getValue() != null)
|
||||
dialogInputValue = getValue();
|
||||
if ((dialogInputValue != null) && (dlg instanceof ISystemPromptDialog))
|
||||
{
|
||||
((ISystemPromptDialog)dlg).setInputObject(dialogInputValue);
|
||||
}
|
||||
if (dlgHelpId!=null)
|
||||
{
|
||||
if (dlg instanceof SystemPromptDialog)
|
||||
((SystemPromptDialog)dlg).setHelp(dlgHelpId);
|
||||
else if (dlg instanceof SystemWizardDialog)
|
||||
((SystemWizardDialog)dlg).setHelp(dlgHelpId);
|
||||
}
|
||||
if (dlg instanceof SystemPromptDialog)
|
||||
{
|
||||
if (needsProgressMonitorSet)
|
||||
((SystemPromptDialog)dlg).setNeedsProgressMonitor(needsProgressMonitor);
|
||||
}
|
||||
|
||||
int rc = dlg.open();
|
||||
|
||||
// if (rc != 0) NOT RELIABLE!
|
||||
if (dlg instanceof SystemWizardDialog)
|
||||
{
|
||||
if (((SystemWizardDialog)dlg).wasCancelled())
|
||||
cancelled = true;
|
||||
//System.out.println("Testing cancelled state of SystemWizardDialog: " + cancelled);
|
||||
}
|
||||
else if (dlg instanceof SystemPromptDialog)
|
||||
{
|
||||
if (((SystemPromptDialog)dlg).wasCancelled())
|
||||
cancelled = true;
|
||||
//System.out.println("Testing cancelled state of SystemPromptDialog: " + cancelled);
|
||||
}
|
||||
|
||||
if (!cancelled)
|
||||
{
|
||||
setValue(getDialogValue(dlg));
|
||||
|
||||
if ((currentSelection != null) && !getProcessAllSelections())
|
||||
currentSelection = getNextSelection();
|
||||
else if (currentSelection != null)
|
||||
currentSelection = null;
|
||||
}
|
||||
else
|
||||
setValue(null);
|
||||
} while (!cancelled && (currentSelection != null));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// ABSTRACT METHODS...
|
||||
// -----------------------------------------------------------
|
||||
/**
|
||||
* If you decide to use the supplied run method as is,
|
||||
* then you must override this method to create and return
|
||||
* the dialog that is displayed by the default run method
|
||||
* implementation.
|
||||
* <p>
|
||||
* If you override actionPerformed with your own, then
|
||||
* simply implement this to return null as it won't be used.
|
||||
* @see #run()
|
||||
*/
|
||||
protected abstract Dialog createDialog(Shell parent);
|
||||
/**
|
||||
* If you decide to use the supplied run method as is,
|
||||
* then you must override this method to retrieve the data
|
||||
* from the dialog. For SystemPromptDialog dialogs, this is simply
|
||||
* a matter of returning dlg.getOutputObject();
|
||||
* <p>
|
||||
* This is called by the run method after the dialog returns, and
|
||||
* wasCancelled() is false. Callers of this object can subsequently
|
||||
* retrieve this returned value by calling getValue. If you don't need
|
||||
* to pass a value back to the caller of this action, simply return null
|
||||
* from this method.
|
||||
*
|
||||
* @param dlg The dialog object, after it has returned from open.
|
||||
*/
|
||||
protected abstract Object getDialogValue(Dialog dlg);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
/**
|
||||
* A dummy "placeholder" action for submenus that will be dynamically populated
|
||||
*/
|
||||
public class SystemBaseDummyAction extends SystemBaseAction
|
||||
{
|
||||
|
||||
|
||||
public SystemBaseDummyAction()
|
||||
{
|
||||
super("dummy", null);
|
||||
setSelectionSensitive(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,475 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.jface.action.ActionContributionItem;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IContributionItem;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.ui.view.SystemViewMenuListener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* Our framework is designed to allow actions to be added to popup menus.
|
||||
* Sometimes, we want an expandable or cascading menu item for an action.
|
||||
* That is what this class is designed for. It represents a populated submenu.
|
||||
*/
|
||||
public abstract class SystemBaseSubMenuAction
|
||||
extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
protected SystemSubMenuManager subMenu = null;
|
||||
protected String actionLabel;
|
||||
protected String menuID;
|
||||
protected boolean createMenuEachTime = true;
|
||||
protected boolean populateMenuEachTime = true;
|
||||
private boolean dontCascade = false;
|
||||
private boolean test;
|
||||
private static final IAction[] EMPTY_ACTION_ARRAY = new IAction[0];
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseSubMenuAction when there is an image
|
||||
* @param label
|
||||
* @param tooltip
|
||||
* @param image The image to display for this action
|
||||
* @param shell The owning shell. If you pass null now, be sure to call setShell later
|
||||
*
|
||||
* @deprecated use fields from resource class directly now instead of via ResourceBundle
|
||||
*/
|
||||
protected SystemBaseSubMenuAction(ResourceBundle rb, String label, String tooltip,ImageDescriptor image,Shell shell)
|
||||
{
|
||||
super(label, tooltip, image, shell);
|
||||
actionLabel = label;
|
||||
//setTracing(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseSubMenuAction when there is just a string
|
||||
* @param label The label to display
|
||||
* @param parent The owning shell. If you pass null now, be sure to call setShell later
|
||||
*/
|
||||
protected SystemBaseSubMenuAction(String label, Shell shell)
|
||||
{
|
||||
super(label, shell);
|
||||
actionLabel = label;
|
||||
//setTracing(true);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseSubMenuAction when there is just a string
|
||||
* @param label The label to display
|
||||
* @param tooltip The tooltip to display
|
||||
* @param parent The owning shell. If you pass null now, be sure to call setShell later
|
||||
*/
|
||||
protected SystemBaseSubMenuAction(String label, String tooltip, Shell shell)
|
||||
{
|
||||
super(label, tooltip, shell);
|
||||
actionLabel = label;
|
||||
//setTracing(true);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseSubMenuAction when there is just a string and image
|
||||
* @param label The label to display
|
||||
* @param parent The owning shell. If you pass null now, be sure to call setShell later
|
||||
*/
|
||||
protected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(label, image, shell);
|
||||
actionLabel = label;
|
||||
//setTracing(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseSubMenuAction when there is just a string and image
|
||||
* @param label The label to display
|
||||
* @param tooltip the tooltip to display
|
||||
* @param parent The owning shell. If you pass null now, be sure to call setShell later
|
||||
*/
|
||||
protected SystemBaseSubMenuAction(String label, String tooltip, ImageDescriptor image, Shell shell)
|
||||
{
|
||||
super(label, tooltip, image, shell);
|
||||
actionLabel = label;
|
||||
//setTracing(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the menu ID. This is important to allow action contributions via the popupMenus extension point.
|
||||
*/
|
||||
public void setMenuID(String Id)
|
||||
{
|
||||
this.menuID = Id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this if the submenu should be created on-the-fly every time, versus creating and populating it
|
||||
* only on the first usage.
|
||||
*/
|
||||
public void setCreateMenuEachTime(boolean eachTime)
|
||||
{
|
||||
this.createMenuEachTime = eachTime;
|
||||
}
|
||||
/**
|
||||
* Call this if the submenu should be populated on-the-fly every time, versus populating it
|
||||
* only on the first usage. This only makes sense to be true if setCreateMenuEachTime is false.
|
||||
*/
|
||||
public void setPopulateMenuEachTime(boolean eachTime)
|
||||
{
|
||||
this.populateMenuEachTime = eachTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set test mode on
|
||||
*/
|
||||
public void setTest(boolean testMode)
|
||||
{
|
||||
this.test = testMode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <i>Must be overridden</i>
|
||||
* <p>Example of this:<p>
|
||||
* <pre><code>
|
||||
* menu.add(new MyAction1());
|
||||
* </code></pre>
|
||||
* @param menu The cascading menu, which is created for you. Add your actions to it.
|
||||
* @return The given menu if you just populated it, or a new menu if you want to create the menu yourself.
|
||||
*/
|
||||
public abstract IMenuManager populateSubMenu(IMenuManager menu);
|
||||
|
||||
/**
|
||||
* Return the MenuManager object. It is this that is added to the primary popup menu.
|
||||
*/
|
||||
public IMenuManager getSubMenu()
|
||||
{
|
||||
if ((subMenu == null) || createMenuEachTime)
|
||||
{
|
||||
if (menuID == null)
|
||||
{
|
||||
if (test)
|
||||
subMenu = new SystemSubMenuManagerForTesting(this,actionLabel);
|
||||
else
|
||||
subMenu = new SystemSubMenuManager(this,actionLabel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (test)
|
||||
subMenu = new SystemSubMenuManagerForTesting(this, actionLabel, menuID);
|
||||
else
|
||||
subMenu = new SystemSubMenuManager(this,actionLabel, menuID);
|
||||
}
|
||||
createStandardGroups(subMenu);
|
||||
subMenu.setTracing(traceSelections, traceTarget);
|
||||
populateSubMenu(subMenu);
|
||||
if (traceSelections)
|
||||
{
|
||||
issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". createMenuEachTime = " + createMenuEachTime);
|
||||
}
|
||||
subMenu.setToolTipText(getToolTipText());
|
||||
//cascadeAllInputs(); no point in doing in now, setInputs will be called later by SV
|
||||
subMenu.addMenuListener(createMnemonicsListener(!populateMenuEachTime));
|
||||
}
|
||||
else if (populateMenuEachTime)
|
||||
{
|
||||
subMenu.removeAll();
|
||||
createStandardGroups(subMenu);
|
||||
populateSubMenu(subMenu);
|
||||
if (traceSelections)
|
||||
{
|
||||
issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". populateMenuEachTime = " + populateMenuEachTime);
|
||||
}
|
||||
//cascadeAllInputs(); no point in doing in now, setInputs will be called later by SV
|
||||
//Menu m = subMenu.getMenu();
|
||||
//System.out.println("SubMenu's menu null? " + (m==null));
|
||||
//if (m != null)
|
||||
//m.addMenuListener(new SystemViewMenuListener());
|
||||
}
|
||||
else if (traceSelections)
|
||||
{
|
||||
issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". SUBMENU ALREADY CREATED. ");
|
||||
}
|
||||
|
||||
return subMenu;
|
||||
}
|
||||
/**
|
||||
* Creates the standard groups for the context sub-menu.
|
||||
*/
|
||||
protected void createStandardGroups(IMenuManager menu)
|
||||
{
|
||||
if (!menu.isEmpty())
|
||||
return;
|
||||
// simply sets partitions in the menu, into which actions can be directed.
|
||||
// Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
|
||||
// Deleted groups are not used yet.
|
||||
//... decided it is better to let this get created when needed, else will be at the top of the menu.
|
||||
//menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the actions currently in the menu.
|
||||
* Never returns null, but may return an empty array.
|
||||
*/
|
||||
public IAction[] getActions()
|
||||
{
|
||||
//System.out.println("in getActions. subMenu null? "+(subMenu==null));
|
||||
if (subMenu==null)
|
||||
return EMPTY_ACTION_ARRAY;
|
||||
else
|
||||
{
|
||||
IContributionItem[] items = subMenu.getItems();
|
||||
//System.out.println("in getActions. #items "+items.length);
|
||||
Vector v = new Vector();
|
||||
for (int idx=0; idx<items.length; idx++)
|
||||
if (items[idx] instanceof ActionContributionItem)
|
||||
v.add( ((ActionContributionItem)items[idx]).getAction() );
|
||||
else if (items[idx] instanceof SystemSubMenuManager)
|
||||
{
|
||||
SystemSubMenuManager menu = (SystemSubMenuManager)items[idx];
|
||||
v.add(menu.getParentCascadingAction());
|
||||
}
|
||||
//else
|
||||
//System.out.println("...item: "+items[idx].getClass().getName());
|
||||
IAction[] actions = new IAction[v.size()];
|
||||
for (int idx=0; idx<v.size(); idx++)
|
||||
actions[idx] = (IAction)v.elementAt(idx);
|
||||
return actions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Overridable method that instantiates the menu listener who job is to add mnemonics.
|
||||
* @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics need only be set once. False if it is dynamic
|
||||
*/
|
||||
protected SystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
|
||||
{
|
||||
return new SystemViewMenuListener(setMnemonicsOnlyOnce);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent shell for this action. This is an override of our parent's method so we can
|
||||
* cascade it to each sub-action.
|
||||
*/
|
||||
public void setShell(Shell shell)
|
||||
{
|
||||
super.setShell(shell);
|
||||
if (!dontCascade)
|
||||
cascadeShell();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called by the framework to set the selection input, just prior to showing the popup menu.
|
||||
* We cascade this down to all of the actions added to this submenu.
|
||||
*/
|
||||
public void setSelection(ISelection selection)
|
||||
{
|
||||
super.setSelection(selection);
|
||||
if (!dontCascade)
|
||||
cascadeSelection(selection);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called by the framework to set the selection input, just prior to showing the popup menu.
|
||||
* We cascade this down to all of the actions added to this submenu.
|
||||
*/
|
||||
public void setViewer(Viewer v)
|
||||
{
|
||||
super.setViewer(v);
|
||||
if (!dontCascade)
|
||||
cascadeViewer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the shell. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
|
||||
*/
|
||||
public Shell getShell()
|
||||
{
|
||||
if (super.getShell(false) != null)
|
||||
return super.getShell(false);
|
||||
else if (subMenu != null)
|
||||
return subMenu.getShell();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Return the selection. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
|
||||
*/
|
||||
public IStructuredSelection getSelection()
|
||||
{
|
||||
if (super.getSelection() != null)
|
||||
return super.getSelection();
|
||||
else if (subMenu != null)
|
||||
return subMenu.getSelection();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Return the viewer. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
|
||||
*/
|
||||
public Viewer getViewer()
|
||||
{
|
||||
if (super.getViewer() != null)
|
||||
return super.getViewer();
|
||||
else if (subMenu != null)
|
||||
return subMenu.getViewer();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Special method called by our submenu manager when from its setInputs method. No need to
|
||||
* cascade as the menu manager will do it for us.
|
||||
*/
|
||||
public void setInputsFromSubMenuManager(Shell shell, Viewer v, ISelection selection)
|
||||
{
|
||||
dontCascade = true; // so we don't redundantly do cascading. Phil
|
||||
super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer
|
||||
dontCascade = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* An optimization for performance reasons that allows all inputs to be set in one call.
|
||||
* Intercept of parent so we can cascade to sub-actions. Note however this won't really ever
|
||||
* get called. This is because for cascading menu actions we don't put this action object into
|
||||
* the menumanager ... we put the SystemSubMenu object so that is what the SystemView will call.
|
||||
*/
|
||||
public void setInputs(Shell shell, Viewer v, ISelection selection)
|
||||
{
|
||||
dontCascade = true; // so we don't redundantly do cascading. Phil
|
||||
super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer
|
||||
dontCascade = false;
|
||||
if (traceSelections)
|
||||
issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS");
|
||||
cascadeAllInputs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cascade the current selection to all actions
|
||||
*/
|
||||
private void cascadeSelection(ISelection selection)
|
||||
{
|
||||
if (traceSelections)
|
||||
{
|
||||
issueTraceMessage("*** INSIDE CASCADESELECTION ***");
|
||||
issueTraceMessage(" subMenu = " + subMenu);
|
||||
issueTraceMessage(" selection = " + selection);
|
||||
}
|
||||
if (subMenu == null)
|
||||
return;
|
||||
subMenu.setSelection(selection);
|
||||
/*
|
||||
IAction[] actions = subMenu.getActions();
|
||||
for (int idx=0; idx<actions.length; idx++)
|
||||
{
|
||||
if (actions[idx] instanceof ISystemAction)
|
||||
{
|
||||
((ISystemAction)actions[idx]).setSelection(selection);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Cascade the current shell to all actions
|
||||
*/
|
||||
private void cascadeShell()
|
||||
{
|
||||
if (subMenu == null)
|
||||
return;
|
||||
Shell shell = super.getShell(false);
|
||||
if (shell != null)
|
||||
{
|
||||
subMenu.setShell(shell);
|
||||
/*
|
||||
IAction[] items = subMenu.getActions();
|
||||
for (int idx=0; idx<items.length; idx++)
|
||||
if (items[idx] instanceof ISystemAction)
|
||||
((ISystemAction)items[idx]).setShell(shell);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cascade the current viewer to all actions
|
||||
*/
|
||||
private void cascadeViewer()
|
||||
{
|
||||
if (subMenu == null)
|
||||
return;
|
||||
if (viewer != null)
|
||||
{
|
||||
subMenu.setViewer(viewer);
|
||||
/*
|
||||
IAction[] items = subMenu.getActions();
|
||||
for (int idx=0; idx<items.length; idx++)
|
||||
if (items[idx] instanceof ISystemAction)
|
||||
((ISystemAction)items[idx]).setViewer(viewer);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when actions added dynamically
|
||||
*/
|
||||
protected void cascadeAllInputs()
|
||||
{
|
||||
if (subMenu == null)
|
||||
return;
|
||||
Shell shell = super.getShell(false);
|
||||
Viewer viewer = super.getViewer();
|
||||
ISelection selection = super.getSelection();
|
||||
subMenu.setInputs(shell, viewer, selection);
|
||||
/*
|
||||
IAction[] actions = subMenu.getActions();
|
||||
if (traceSelections)
|
||||
{
|
||||
issueTraceMessage("INSIDE CASCADEALLINPUTS FOR "+actionLabel+". NBR ACTIONS = "+actions.length);
|
||||
}
|
||||
|
||||
for (int idx=0; idx<actions.length; idx++)
|
||||
{
|
||||
if (actions[idx] instanceof ISystemAction)
|
||||
{
|
||||
ISystemAction action = (ISystemAction)actions[idx];
|
||||
action.setInputs(shell, viewer, selection);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable this menu action. This amounts to enabling/disabling the associated sub menu.
|
||||
* Unfortunately, there is no way to do this!
|
||||
*/
|
||||
public void setEnabled(boolean enable)
|
||||
{
|
||||
super.setEnabled(enable);
|
||||
if (subMenu!=null)
|
||||
{
|
||||
//subMenu.setEnabled(enable);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,280 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.wizard.IWizard;
|
||||
import org.eclipse.jface.wizard.Wizard;
|
||||
import org.eclipse.jface.wizard.WizardDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemWizardDialog;
|
||||
import org.eclipse.rse.ui.wizards.ISystemWizard;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A specialization for the eclipse Action method, for actions that put up wizards.
|
||||
* <p> This class is most effective when used with actions that extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard},
|
||||
* or implement {@link org.eclipse.rse.ui.wizards.ISystemWizard}. It supports
|
||||
* settings that are propogated to the wizard, and wizard pages if they extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage},
|
||||
* or implement {@link org.eclipse.rse.ui.wizards.ISystemWizardPage}.
|
||||
* </p>
|
||||
* The advantages to using this class over the base action class are:
|
||||
* <ul>
|
||||
* <li>Supports setting the label, description, image and tooltip text for this action, via constructors.
|
||||
* <li>Sets {@link org.eclipse.rse.ui.SystemBaseAction#allowOnMultipleSelection(boolean)} to false, since most wizard actions are not permitted on multiple selection.
|
||||
* <li>Supports setting whether the wizard requires a {@link org.eclipse.rse.ui.actions.SystemBaseDialogAction#setNeedsProgressMonitor() progress-monitor} or not, which is propogated to the wizard.
|
||||
* <li>Supports setting the overall wizard {@link #setWizardTitle(String) title}, which is propogated to the wizard.
|
||||
* <li>Supports setting the overall wizard {@link #setWizardImage(ImageDescriptor) image}, which is propogated to the wizard.
|
||||
* <li>Supports setting the default wizard {@link #setWizardPageTitle(String) page-title}, which is propogated to the wizard and the wizard pages.
|
||||
* <li>Supports setting the wizard;s default {@link #setHelp(String) contextual-help}, which is propogated to the wizard and the wizard pages.
|
||||
* <li>Supports setting the wizard's {@link #setMinimumPageSize(int,int) minimum-size}, which is propogated and applied to the wizard.
|
||||
* <li>Supports setting an {@link org.eclipse.rse.ui.SystemBaseAction#setInputObject(Object) input-object}, which is propogated to the wizard and wizard pages. By default, this
|
||||
* is set the current StructuredSelection.
|
||||
* <li>Supports querying a {@link org.eclipse.rse.ui.SystemBaseAction#getOutputObject() output-object} which is set by the wizard class.
|
||||
* <li>Supports a {@link #wasCancelled()} method so the caller can easily determine if the wizard was dismissed or cancelled by the user.
|
||||
* <li>Supports propogation of the {@link org.eclipse.rse.ui.SystemBaseAction#getViewer() current-viewer}.
|
||||
* </ul>
|
||||
*
|
||||
* <p>To use this class:</p>
|
||||
* <ol>
|
||||
* <li>Create your wizard class that extends {@link org.eclipse.rse.ui.wizards.AbstractSystemWizard}, and is populated with
|
||||
* pages that extend {@link org.eclipse.rse.ui.wizards.AbstractSystemWizardPage}.
|
||||
* <li>Define your action's label and tooltip translatable strings in a resource bundle, where the former's key ends with "label" and the latter's
|
||||
* key ends with "tooltip".
|
||||
* <li>Define your subclass of this wizard. Decide if you want to set the wizard's title, page-title, image, help and optionally minimum size
|
||||
* in your wizard subclass, or here in your action subclass. For re-use it is best to set it in the wizard, if possible.
|
||||
* <li>Override {@link #createWizard()} to instantiate, configure and return your wizard.
|
||||
* <li>Decide if you will do the work of the wizard in the wizard's performFinish method, or here in this action subclass. If here,
|
||||
* override {@link #postProcessWizard(IWizard)}. You might also override this if you need to set output variables in the action,
|
||||
* after the sucessful completion of the wizard.
|
||||
* </ol>
|
||||
*/
|
||||
public abstract class SystemBaseWizardAction extends SystemBaseDialogAction
|
||||
implements ISystemWizardAction
|
||||
{
|
||||
|
||||
private IWizard newWizard;
|
||||
private String wizardTitle, pageTitle;
|
||||
private ImageDescriptor wizardImage;
|
||||
private int minPageWidth=-1, minPageHeight=-1;
|
||||
|
||||
/**
|
||||
* Constructor for SystemBaseWizardAction when translated label is known. You must separately
|
||||
* call setToolTipText and setDescription to enable these if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseWizardAction(String text, ImageDescriptor image, Shell parent)
|
||||
{
|
||||
super(text, image, parent);
|
||||
allowOnMultipleSelection(false);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseWizardAction when translated label and tooltip are known. You must
|
||||
* separately call setDescription to enable this if desired.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseWizardAction(String text, String tooltip, ImageDescriptor image, Shell parent)
|
||||
{
|
||||
super(text, tooltip, image, parent);
|
||||
allowOnMultipleSelection(false);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemBaseWizardAction when translated label and tooltip and description are
|
||||
* all known.
|
||||
* @param text string to display in menu or toolbar
|
||||
* @param tooltip string to display when user hovers mouse over action.
|
||||
* @param description string displayed in status bar of some displays. Longer than tooltip.
|
||||
* @param image icon to display in menu or toolbar. Can be null.
|
||||
* @param parent Shell of parent window. Can be null if you don't know it, but call setShell when you do.
|
||||
*/
|
||||
protected SystemBaseWizardAction(String text, String tooltip, String description, ImageDescriptor image, Shell parent)
|
||||
{
|
||||
super(text, tooltip, description, image, parent);
|
||||
allowOnMultipleSelection(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the wizard title. Using this makes it possible to avoid subclassing a wizard
|
||||
*/
|
||||
public void setWizardTitle(String title)
|
||||
{
|
||||
this.wizardTitle = title;
|
||||
}
|
||||
/**
|
||||
* Set the wizard image. Using this makes it possible to avoid subclassing a wizard
|
||||
*/
|
||||
public void setWizardImage(ImageDescriptor wizardImage)
|
||||
{
|
||||
this.wizardImage = wizardImage;
|
||||
}
|
||||
/**
|
||||
* Set the wizard page title. Using this makes it possible to avoid subclassing.
|
||||
* The page title goes below the wizard title, and can be unique per page. However,
|
||||
* typically the wizard page title is the same for all pages... eg "Filter".
|
||||
* <p>
|
||||
* This is not used by default, but can be queried via getPageTitle() when constructing
|
||||
* pages.
|
||||
*/
|
||||
public void setWizardPageTitle(String pageTitle)
|
||||
{
|
||||
this.pageTitle = pageTitle;
|
||||
}
|
||||
/**
|
||||
* Return the page title as set via setWizardPageTitle
|
||||
*/
|
||||
public String getWizardPageTitle()
|
||||
{
|
||||
return pageTitle;
|
||||
}
|
||||
/**
|
||||
* Call this method to set the wizard's dimensions without having to subclass the wizard.
|
||||
* If you pass zero for either value, then the default will be used for that.
|
||||
*/
|
||||
public void setMinimumPageSize(int width, int height)
|
||||
{
|
||||
//if (width <= 0)
|
||||
// width = 300; // found this number in WizardDialog code
|
||||
//if (height<= 0)
|
||||
// height = 225; // found this number in WizardDialog code
|
||||
this.minPageWidth = width;
|
||||
this.minPageHeight = height;
|
||||
}
|
||||
/**
|
||||
* Override of parent's method. Does the following:
|
||||
* <ul>
|
||||
* <li>Calls abstract createWizard() method to get wizard instance
|
||||
* <li>If wizard implements ISystemWizard, calls setInputValue(...), passing in
|
||||
* getValue() if not null, else passing in getFirstSelection() if not null.
|
||||
* <li>Instantiates a WizardDialog object with the wizard object from createWizard().
|
||||
* Returns this to run() in our parent class which then opens this dialog.
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
protected Dialog createDialog(Shell shell)
|
||||
{
|
||||
newWizard = createWizard();
|
||||
|
||||
if ((newWizard instanceof Wizard) && wasNeedsProgressMonitorSet())
|
||||
((Wizard)newWizard).setNeedsProgressMonitor(getNeedsProgressMonitor());
|
||||
|
||||
if (newWizard instanceof Wizard)
|
||||
{
|
||||
if (wizardTitle != null)
|
||||
((Wizard)newWizard).setWindowTitle(wizardTitle);
|
||||
if (wizardImage != null)
|
||||
((Wizard)newWizard).setDefaultPageImageDescriptor(wizardImage);
|
||||
}
|
||||
|
||||
|
||||
WizardDialog dialog = null;
|
||||
|
||||
if (newWizard instanceof ISystemWizard)
|
||||
{
|
||||
ISystemWizard swizard = (ISystemWizard)newWizard;
|
||||
if (pageTitle != null)
|
||||
swizard.setWizardPageTitle(pageTitle);
|
||||
swizard.setViewer(getViewer());
|
||||
dialog = new SystemWizardDialog(shell,swizard);
|
||||
int w = swizard.getMinimumPageWidth();
|
||||
int h = swizard.getMinimumPageHeight();
|
||||
if (minPageWidth > 0)
|
||||
w = minPageWidth;
|
||||
if (minPageHeight > 0)
|
||||
h = minPageHeight;
|
||||
//System.out.println("In SystemBaseWizardAction. minPageWidth = " + w + ", minPageHeight = " + h);
|
||||
if ((w>0) && (h>0))
|
||||
dialog.setMinimumPageSize(w,h);
|
||||
|
||||
/*
|
||||
* Don't do the following here as it is redundant! The run method in the parent SystemBaseDialogAction
|
||||
* does this already
|
||||
Object wizardInputValue = null;
|
||||
if (getValue() != null)
|
||||
wizardInputValue = getValue();
|
||||
else
|
||||
wizardInputValue = getFirstSelection();
|
||||
if (wizardInputValue != null)
|
||||
((SystemWizardDialog)dialog).setInputObject(wizardInputValue);
|
||||
*/
|
||||
}
|
||||
else
|
||||
dialog = new WizardDialog(shell,newWizard);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default processing for the run method calls createDialog, which
|
||||
* we override in this class. The implementation of createDialog calls
|
||||
* this method that you must override, to create the wizard. The result
|
||||
* goes into a WizardDialog which is opened and hence displayed to the
|
||||
* user.
|
||||
*/
|
||||
protected abstract IWizard createWizard();
|
||||
|
||||
/**
|
||||
* By default, we try to get the wizard's value by calling getOutputObject()
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
postProcessWizard(newWizard);
|
||||
if (newWizard instanceof ISystemWizard)
|
||||
{
|
||||
ISystemWizard ourWizard = (ISystemWizard)newWizard;
|
||||
return ourWizard.getOutputObject();
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Typically, the wizard's performFinish method does the work required by
|
||||
* a successful finish of the wizard. However, often we also want to be
|
||||
* able to extract user-entered data from the wizard, by calling getters
|
||||
* in this action. To enable this, override this method to populate your
|
||||
* output instance variables from the completed wizard, which is passed
|
||||
* as a parameter. This is only called after successful completion of the
|
||||
* wizard.
|
||||
*/
|
||||
protected void postProcessWizard(IWizard wizard)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the user cancelled the wizard.
|
||||
* This is an override of the parent method, since we can be more
|
||||
* accurate with wizards than we can with dialogs.
|
||||
*/
|
||||
public boolean wasCancelled()
|
||||
{
|
||||
if (newWizard instanceof ISystemWizard)
|
||||
{
|
||||
ISystemWizard ourWizard = (ISystemWizard)newWizard;
|
||||
return ourWizard.wasCancelled();
|
||||
}
|
||||
else
|
||||
return super.wasCancelled();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Browse With->"
|
||||
*/
|
||||
public class SystemCascadingBrowseWithAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingBrowseWithAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_BROWSEWITH_LABEL,SystemResources.ACTION_CASCADING_BROWSEWITH_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_BROWSEWITH);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Compare With->"
|
||||
*/
|
||||
public class SystemCascadingCompareWithAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingCompareWithAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_COMPAREWITH_LABEL, SystemResources.ACTION_CASCADING_COMPAREWITH_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_COMPAREWITH);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Expand To->"
|
||||
*/
|
||||
public class SystemCascadingExpandToAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingExpandToAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_EXPAND_TO_LABEL, SystemResources.ACTION_CASCADING_EXPAND_TO_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_EXPANDTO);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.SystemViewPart;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.views.framelist.BackAction;
|
||||
import org.eclipse.ui.views.framelist.ForwardAction;
|
||||
import org.eclipse.ui.views.framelist.FrameList;
|
||||
import org.eclipse.ui.views.framelist.UpAction;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Go To->"
|
||||
*/
|
||||
public class SystemCascadingGoToAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
//private IAdaptable pageInput;
|
||||
//private IMenuManager parentMenuManager;
|
||||
private boolean actionsMade = false;
|
||||
|
||||
private SystemViewPart fSystemViewPart;
|
||||
private BackAction backAction;
|
||||
private ForwardAction forwardAction;
|
||||
private UpAction upAction;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingGoToAction(Shell shell, SystemViewPart systemViewPart)
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_GOTO_LABEL, SystemResources.ACTION_CASCADING_GOTO_TOOLTIP, shell);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_GOTO);
|
||||
this.fSystemViewPart = systemViewPart;
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_GOTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager gotoMenu)
|
||||
{
|
||||
if (!actionsMade)
|
||||
makeActions();
|
||||
gotoMenu.add(backAction);
|
||||
gotoMenu.add(forwardAction);
|
||||
gotoMenu.add(upAction);
|
||||
return gotoMenu;
|
||||
}
|
||||
|
||||
protected void makeActions()
|
||||
{
|
||||
FrameList frameList = fSystemViewPart.getFrameList();
|
||||
backAction = new BackAction(frameList);
|
||||
forwardAction = new ForwardAction(frameList);
|
||||
upAction = new UpAction(frameList);
|
||||
|
||||
actionsMade = true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "View->"
|
||||
*/
|
||||
public class SystemCascadingGotoActionOLD extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingGotoActionOLD()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_GOTO_LABEL, SystemResources.ACTION_CASCADING_GOTO_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_GOTO);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "New->"
|
||||
*/
|
||||
public class SystemCascadingNewAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for SystemCascadingNewAction
|
||||
*/
|
||||
public SystemCascadingNewAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_NEW_LABEL, SystemResources.ACTION_CASCADING_NEW_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_NEW);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Open With->"
|
||||
*/
|
||||
public class SystemCascadingOpenWithAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingOpenWithAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_OPENWITH_LABEL, SystemResources.ACTION_CASCADING_OPENWITH_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_OPENWITH);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Preferences->".
|
||||
* @see org.eclipse.rse.ui.actions.SystemShowPreferencesPageAction
|
||||
*/
|
||||
public class SystemCascadingPreferencesAction
|
||||
extends SystemBaseSubMenuAction implements IMenuListener
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingPreferencesAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_PREFERENCES_LABEL, SystemResources.ACTION_CASCADING_PREFERENCES_TOOLTIP, shell);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_PREFERENCES);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actnpref");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager ourSubMenu)
|
||||
{
|
||||
// WE DON'T WANT TO FIRE UP ALL PLUGINS THAT USE OUR EXTENSION POINT,
|
||||
// AT THE TIEM WE ARE CREATING OUR VIEW! SO WE DEFER IT UNTIL THIS CASCADING
|
||||
// MENU IS FIRST EXPANDED...
|
||||
ourSubMenu.addMenuListener(this);
|
||||
ourSubMenu.setRemoveAllWhenShown(true);
|
||||
//menu.setEnabled(true);
|
||||
ourSubMenu.add(new SystemBaseAction("dummy",null));
|
||||
|
||||
return ourSubMenu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when submenu is about to show
|
||||
*/
|
||||
public void menuAboutToShow(IMenuManager ourSubMenu)
|
||||
{
|
||||
//System.out.println("In menuAboutToShow!");
|
||||
setBusyCursor(true);
|
||||
ourSubMenu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
|
||||
SystemShowPreferencesPageAction[] prefPageActions = SystemPlugin.getDefault().getShowPreferencePageActions();
|
||||
if (prefPageActions!=null)
|
||||
{
|
||||
for (int idx=0; idx<prefPageActions.length; idx++)
|
||||
{
|
||||
prefPageActions[idx].setShell(getShell());
|
||||
ourSubMenu.appendToGroup(ISystemContextMenuConstants.GROUP_ADDITIONS, prefPageActions[idx]);
|
||||
}
|
||||
}
|
||||
setBusyCursor(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuCreator;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.SystemViewPart;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for a toolbar, emulating the pulldown menu view parts have.
|
||||
*/
|
||||
public class SystemCascadingPulldownMenuAction
|
||||
extends SystemBaseSubMenuAction
|
||||
implements IMenuListener, IMenuCreator
|
||||
{
|
||||
|
||||
private SystemSubMenuManager dropDownMenuMgr;
|
||||
private ISelectionProvider sp = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingPulldownMenuAction(Shell shell, ISelectionProvider selectionProviderForToolbarActions)
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_PULLDOWN_LABEL, SystemResources.ACTION_CASCADING_PULLDOWN_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID),shell);
|
||||
sp = selectionProviderForToolbarActions;
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
setMenuCreator(this); // this IAction method tells JFace this is a dropdown menu
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
menu.addMenuListener(this);
|
||||
menu.setRemoveAllWhenShown(false);
|
||||
boolean showConnectionActions = true;
|
||||
SystemViewPart.populateSystemViewPulldownMenu(menu, getShell(), showConnectionActions, null, sp);
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when submenu is about to show
|
||||
*/
|
||||
public void menuAboutToShow(IMenuManager ourSubMenu)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------
|
||||
// IMenuCreator methods...
|
||||
//------------------------
|
||||
/**
|
||||
* dispose method comment.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
if (dropDownMenuMgr != null)
|
||||
{
|
||||
dropDownMenuMgr.dispose();
|
||||
dropDownMenuMgr = null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* getMenu method comment.
|
||||
*/
|
||||
public Menu getMenu(Control parent)
|
||||
{
|
||||
if (dropDownMenuMgr == null)
|
||||
{
|
||||
//dropDownMenuMgr = new MenuManager();
|
||||
dropDownMenuMgr = (SystemSubMenuManager)getSubMenu();
|
||||
}
|
||||
return dropDownMenuMgr.createContextMenu(parent);
|
||||
}
|
||||
public Menu getMenu(Menu parent)
|
||||
{
|
||||
//System.out.println("In SystemCascadingPulldownMenuAction#getMenu(Menu)");
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* This is the base class for actions that populate the "Remote Servers" cascading
|
||||
* menu. The actions in this menu cascade again, into Start and Stop actions.
|
||||
* These cascading actions are handling automatically by this base class, but when
|
||||
* they are run, they call back into abstract methods in this base class, to
|
||||
* actually start and stop the remote server/daemon.
|
||||
*
|
||||
*/
|
||||
public abstract class SystemCascadingRemoteServerBaseAction extends SystemBaseSubMenuAction implements IMenuListener
|
||||
{
|
||||
private SystemRemoteServerStartAction startAction;
|
||||
private SystemRemoteServerStopAction stopAction;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @deprecated
|
||||
*/
|
||||
public SystemCascadingRemoteServerBaseAction(String label, String tooltip, Shell shell)
|
||||
{
|
||||
super(label, tooltip, shell);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the submenu for this action. Here is where we add the start and stop actions.
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
startAction = new SystemRemoteServerStartAction(getShell(), this);
|
||||
stopAction = new SystemRemoteServerStopAction(getShell(), this);
|
||||
startAction.setHelp(getHelpContextId());
|
||||
stopAction.setHelp(getHelpContextId());
|
||||
menu.add(startAction);
|
||||
menu.add(stopAction);
|
||||
menu.addMenuListener(this); // we want to know when menu is about to be shown.
|
||||
//System.out.println("in populateSubMenu in "+getClass().getName());
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when submenu is about to show.
|
||||
* We use this to decide whether to enable/disable the start and stop actions underneath.
|
||||
*/
|
||||
public void menuAboutToShow(IMenuManager subMenu)
|
||||
{
|
||||
//System.out.println("menuAboutToShow");
|
||||
/*
|
||||
IStructuredSelection selection = getSelection();
|
||||
if( selection == null )
|
||||
{
|
||||
subMenu.add(new SystemBaseAction("Programming error. Selection is null! ", null));
|
||||
return;
|
||||
} // end if(nothing is selected)
|
||||
*/
|
||||
if (!isEnabled())
|
||||
{
|
||||
startAction.setEnabled(false);
|
||||
stopAction.setEnabled(false);
|
||||
}
|
||||
else if (canDetectServerState())
|
||||
{
|
||||
//System.out.println("in action itself. getSystemConnection() = "+getSystemConnection());
|
||||
boolean started = isServerStarted(getSystemConnection());
|
||||
//System.out.println("... started? "+started);
|
||||
startAction.setEnabled(started);
|
||||
stopAction.setEnabled(!started);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This method is an opportunity to decide whether to enable this action or not.
|
||||
* Sometimes we can determine if the connection is connected or not, in which case
|
||||
* we want to disable this action if the connection is not connected.
|
||||
*/
|
||||
protected boolean shouldEnable(IHost connection)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridable method to tell the base code if you are able to determine dynamically if
|
||||
* the server is currently running or not. The default is true, and so {@link #isStarted(IHost)} is
|
||||
* called to determine enablement state of the cascading start and stop actions. If you
|
||||
* cannot determine this, override this method and return false, and both start and stop
|
||||
* will be enabled always.
|
||||
* @return true if you have the capability of dynamically determining if this server is running.
|
||||
*/
|
||||
protected boolean canDetectServerState()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridable method to compute if this remote server/daemon is currently running or not.
|
||||
* This decides the enablement of the start and stop actions underneath. If there is no way
|
||||
* to determine this, return false from {@link #canDetectServerState()}, and ignore this method.
|
||||
* @return true if the server is currently running or not.
|
||||
*/
|
||||
protected abstract boolean isServerStarted(IHost connection);
|
||||
|
||||
/**
|
||||
* Callback from the {@link org.eclipse.rse.ui.actions.SystemRemoteServerStartAction} class
|
||||
* that is called when the user selects to start this remote server/daemon.
|
||||
* @return true if the remote server was successfully started, false if not.
|
||||
*/
|
||||
public abstract boolean startServer();
|
||||
|
||||
/**
|
||||
* Callback from the {@link org.eclipse.rse.ui.actions.SystemRemoteServerStartAction} class
|
||||
* that is called when the user selects to stop this remote server/daemon.
|
||||
* @return true if the remote server was successfully stopped, false if not.
|
||||
*/
|
||||
public abstract boolean stopServer();
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Remote Servers->". The actions contributed to the
|
||||
* menu must implement the ISystemRemoteServerAction interface.
|
||||
* @see org.eclipse.rse.ui.actions.ISystemRemoteServerAction
|
||||
*/
|
||||
public class SystemCascadingRemoteServersAction extends SystemBaseSubMenuAction implements IMenuListener
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingRemoteServersAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_REMOTESERVERS_LABEL, SystemResources.ACTION_CASCADING_REMOTESERVERS_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_STARTSERVER);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actnsrsv");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
menu.addMenuListener(this);
|
||||
//System.out.println("in populateSubMenu");
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when submenu is about to show
|
||||
*/
|
||||
public void menuAboutToShow(IMenuManager subMenu)
|
||||
{
|
||||
//System.out.println("menuAboutToShow");
|
||||
IStructuredSelection selection = getSelection();
|
||||
if( selection == null )
|
||||
{
|
||||
subMenu.add(new SystemBaseAction("Programming error. Selection is null! ", null));
|
||||
return;
|
||||
} // end if(nothing is selected)
|
||||
Object firstSelection = selection.getFirstElement();
|
||||
IHost conn = null;
|
||||
if (firstSelection instanceof IHost)
|
||||
conn = (IHost)firstSelection;
|
||||
else if (firstSelection instanceof ISubSystem)
|
||||
conn = ((ISubSystem)firstSelection).getHost();
|
||||
|
||||
// decide whether or not to enable/disable each entry, by letting it decide...
|
||||
IAction[] actions = getActions();
|
||||
//System.out.println("...how many actions? "+actions.length);
|
||||
//System.out.println("...connection null ? "+(conn==null));
|
||||
for (int idx=0; idx<actions.length; idx++)
|
||||
{
|
||||
if (actions[idx] instanceof SystemCascadingRemoteServerBaseAction)
|
||||
{
|
||||
SystemCascadingRemoteServerBaseAction action = (SystemCascadingRemoteServerBaseAction)actions[idx];
|
||||
action.setHost(conn);
|
||||
if (conn.isOffline())
|
||||
action.setEnabled(false);
|
||||
else
|
||||
action.setEnabled(action.shouldEnable(conn));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Replace With->"
|
||||
*/
|
||||
public class SystemCascadingReplaceWithAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingReplaceWithAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_REPLACEWITH_LABEL, SystemResources.ACTION_CASCADING_REPLACEWITH_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_REPLACEWITH);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.SystemType;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Set Default UserId->"
|
||||
*/
|
||||
public class SystemCascadingUserIdPerSystemTypeAction
|
||||
extends SystemBaseSubMenuAction
|
||||
implements IMenuListener
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingUserIdPerSystemTypeAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_USERID_LABEL, SystemResources.ACTION_CASCADING_USERID_TOOLTIP, shell);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(false);
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0010");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
menu.addMenuListener(this);
|
||||
menu.setRemoveAllWhenShown(true);
|
||||
//menu.setEnabled(true);
|
||||
menu.add(new SystemBaseAction("dummy",null));
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when submenu is about to show
|
||||
*/
|
||||
public void menuAboutToShow(IMenuManager ourSubMenu)
|
||||
{
|
||||
SystemType[] types = SystemPlugin.getTheSystemTypes(SystemPlugin.INCLUDE_LOCAL_NO); // false => do not include local
|
||||
for (int idx=0; idx<types.length; idx++)
|
||||
ourSubMenu.add(new SystemPreferenceUserIdPerSystemTypeAction(getShell(),types[idx]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "View->"
|
||||
*/
|
||||
public class SystemCascadingViewAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingViewAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_VIEW_LABEL, SystemResources.ACTION_CASCADING_VIEW_TOOLTIP, null);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
|
||||
|
||||
/**
|
||||
* A cascading menu action for "Work With->"
|
||||
*/
|
||||
public class SystemCascadingWorkWithAction extends SystemBaseSubMenuAction
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCascadingWorkWithAction()
|
||||
{
|
||||
super(SystemResources.ACTION_CASCADING_WORKWITH_LABEL, SystemResources.ACTION_CASCADING_WORKWITH_TOOLTIP, null);
|
||||
setMenuID(ISystemContextMenuConstants.MENU_WORKWITH);
|
||||
setCreateMenuEachTime(false);
|
||||
setPopulateMenuEachTime(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseSubMenuAction#getSubMenu()
|
||||
*/
|
||||
public IMenuManager populateSubMenu(IMenuManager menu)
|
||||
{
|
||||
// we don't populate it. SystemView populates it by calling each adapter and letting them populate it.
|
||||
return menu;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
/********************************************************************************
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* Action to clear cached passwords for all subsystems in a connection.
|
||||
*/
|
||||
public class SystemClearAllPasswordsAction extends SystemBaseAction {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell the parent shell.
|
||||
*/
|
||||
public SystemClearAllPasswordsAction(Shell shell) {
|
||||
super(SystemResources.ACTION_CLEARPASSWORD_ALL_LABEL, SystemResources.ACTION_CLEARPASSWORD_ALL_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.rse.ui.actions.SystemBaseAction#checkObjectType(java.lang.Object)
|
||||
*/
|
||||
public boolean checkObjectType(Object selectedObject) {
|
||||
|
||||
if (!(selectedObject instanceof IHost)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
IHost conn = (IHost)selectedObject;
|
||||
|
||||
ISubSystem[] subsystems = conn.getSubSystems();
|
||||
|
||||
boolean anyOk = false;
|
||||
|
||||
for (int i = 0; i < subsystems.length; i++) {
|
||||
|
||||
ISubSystem subsystem = subsystems[i];
|
||||
IConnectorService system = subsystem.getConnectorService();
|
||||
|
||||
anyOk = !system.isConnected() && system.isPasswordCached();
|
||||
|
||||
if (anyOk)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return anyOk;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.action.IAction#run()
|
||||
*/
|
||||
public void run() {
|
||||
|
||||
IHost conn = (IHost)getFirstSelection();
|
||||
|
||||
ISubSystem[] subsystems = conn.getSubSystems();
|
||||
|
||||
for (int i = 0; i < subsystems.length; i++)
|
||||
{
|
||||
ISubSystem ss = subsystems[i];
|
||||
try
|
||||
{
|
||||
IConnectorService system = ss.getConnectorService();
|
||||
|
||||
if (system.isPasswordCached())
|
||||
{
|
||||
// get the user id
|
||||
String userId = system.getUserId();
|
||||
|
||||
// clear userid/password from memory and fire event
|
||||
//DKM and disk now
|
||||
system.clearPasswordCache(true);
|
||||
SystemPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss,
|
||||
ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,
|
||||
ss.getHost()));
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// msg already shown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is the action for clearing in-memory userId and password cache
|
||||
*/
|
||||
public class SystemClearPasswordAction extends SystemBaseAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell Shell of parent window, used as the parent for the dialog.
|
||||
* Can be null, but be sure to call setParent before the action is used (ie, run).
|
||||
*/
|
||||
public SystemClearPasswordAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_CLEARPASSWORD_LABEL, SystemResources.ACTION_CLEARPASSWORD_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0049");
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of parent. Called when testing if action should be enabled base on current
|
||||
* selection. We check the selected object is one of our subsystems, and we are not
|
||||
* already connected.
|
||||
*/
|
||||
public boolean checkObjectType(Object obj)
|
||||
{
|
||||
if (!(obj instanceof ISubSystem) ||
|
||||
((ISubSystem)obj).getConnectorService().isConnected() ||
|
||||
!(((ISubSystem)obj).getConnectorService().isPasswordCached())) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this action is selection from the popup menu.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISubSystem ss = (ISubSystem)getFirstSelection();
|
||||
try {
|
||||
IConnectorService system = ss.getConnectorService();
|
||||
|
||||
// get the user id
|
||||
String userId = system.getUserId();
|
||||
|
||||
// clear userid/password from memory and fire event
|
||||
//DKM and disk now
|
||||
system.clearPasswordCache(true);
|
||||
SystemPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss,
|
||||
ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,
|
||||
ss.getHost()));
|
||||
|
||||
/* DKM - this is now done in clearPasswordCache
|
||||
*
|
||||
// now get rid of userid/password from disk
|
||||
String systemType = ss.getSystem().getSystemType();
|
||||
String hostName = system.getHostName();
|
||||
PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId);
|
||||
*/
|
||||
}
|
||||
catch (Exception exc) {
|
||||
// msg already shown
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.ISystemTree;
|
||||
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to collapse the selected nodes in the Remote Systems Explorer tree view
|
||||
*/
|
||||
public class SystemCollapseAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
// see defect 41203
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCollapseAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_COLLAPSE_SELECTED_LABEL, SystemResources.ACTION_COLLAPSE_SELECTED_TOOLTIP,
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
|
||||
setAccelerator('-');
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0024");
|
||||
setAvailableOffline(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* We intercept to ensure at least one selected item is collapsable
|
||||
*
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = false;
|
||||
if ((viewer != null) && (viewer instanceof ISystemTree))
|
||||
{
|
||||
return ((ISystemTree)viewer).areAnySelectedItemsExpanded();
|
||||
}
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
ISystemViewElementAdapter adapter = null;
|
||||
while (!enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
adapter = getAdapter(selectedObject);
|
||||
if (adapter != null)
|
||||
{
|
||||
if (adapter.hasChildren(selectedObject))
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
//System.out.println("Inside run of SystemRefreshAction");
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener))
|
||||
{
|
||||
sr.fireEvent((ISystemResourceChangeListener)viewer,
|
||||
new SystemResourceChangeEvent("dummy",
|
||||
ISystemResourceChangeEvents.EVENT_COLLAPSE_SELECTED, null));
|
||||
}
|
||||
else
|
||||
sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_COLLAPSE_SELECTED, null));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to collapse the entire Remote Systems Explorer tree view.
|
||||
*/
|
||||
public class SystemCollapseAllAction extends SystemBaseAction
|
||||
//
|
||||
{
|
||||
|
||||
// See defect 41203
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCollapseAllAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_COLLAPSE_ALL_LABEL, SystemResources.ACTION_COLLAPSE_ALL_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_COLLAPSEALL_ID), // D54577
|
||||
parent);
|
||||
setHoverImageDescriptor(SystemPlugin.getDefault().getImageDescriptorFromIDE("elcl16/collapseall.gif")); //$NON-NLS-1$
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); // should never be used
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0023");
|
||||
setAccelerator(SWT.CTRL | '-');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener))
|
||||
{
|
||||
sr.fireEvent((ISystemResourceChangeListener)viewer,
|
||||
new SystemResourceChangeEvent("false",
|
||||
ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
|
||||
}
|
||||
else
|
||||
sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,205 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemDeleteTarget;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemDeleteDialog;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
||||
/**
|
||||
* The action that displays the Delete confirmation dialog.There are two ways to use this action:
|
||||
* <ol>
|
||||
* <li>When invoking from a class that implements ISystemDeleteTarget. In this case, that class
|
||||
* will be called back to determine if this action is to be enabled or not, and to do the actual delete for
|
||||
* each selected object, after the dialog is dismissed.
|
||||
* <li>When used without an ISystemDeleteTarget, in which case you need to call wasCancelled() after
|
||||
* running the action, and then do your own delete.
|
||||
* </ol>
|
||||
* <p>
|
||||
* If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
|
||||
* {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter}, then you
|
||||
* should call {@link #setNameValidator(org.eclipse.rse.core.ui.validators.ISystemValidator)} to
|
||||
* specify a validator that is called to verify the typed new name is valid. Further, to show the type value
|
||||
* of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
|
||||
*
|
||||
* @see org.eclipse.rse.ui.dialogs.SystemDeleteDialog
|
||||
*/
|
||||
public class SystemCommonDeleteAction
|
||||
extends SystemBaseDialogAction
|
||||
implements ISystemIconConstants
|
||||
{
|
||||
private String promptLabel;
|
||||
|
||||
/**
|
||||
* Constructor for SystemDeleteAction when using a delete target
|
||||
* @param parent The Shell of the parent UI for this dialog
|
||||
* @param deleteTarget The UI part that has selectable and deletable parts.
|
||||
*/
|
||||
public SystemCommonDeleteAction(Shell parent, ISystemDeleteTarget deleteTarget)
|
||||
{
|
||||
super(SystemResources.ACTION_DELETE_LABEL, SystemResources.ACTION_DELETE_TOOLTIP,
|
||||
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)
|
||||
, parent);
|
||||
setSelectionProvider(deleteTarget);
|
||||
allowOnMultipleSelection(true);
|
||||
setProcessAllSelections(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0021");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for SystemDeleteAction when not using a delete target
|
||||
* @param parent The Shell of the parent UI for this dialog
|
||||
*/
|
||||
public SystemCommonDeleteAction(Shell parent)
|
||||
{
|
||||
this(parent, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify the text to show for the label prompt. The default is
|
||||
* "Delete selected resources?"
|
||||
*/
|
||||
public void setPromptLabel(String text)
|
||||
{
|
||||
this.promptLabel = text;
|
||||
}
|
||||
|
||||
private ISystemDeleteTarget getDeleteTarget()
|
||||
{
|
||||
return (ISystemDeleteTarget)getSelectionProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by SystemBaseAction when selection is set.
|
||||
* Our opportunity to verify we are allowed for this selected type.
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
ISystemDeleteTarget deleteTarget = getDeleteTarget();
|
||||
if (deleteTarget == null)
|
||||
return true;
|
||||
else
|
||||
return deleteTarget.showDelete() && getDeleteTarget().canDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
* If you decide to use the supplied run method as is,
|
||||
* then you must override this method to create and return
|
||||
* the dialog that is displayed by the default run method
|
||||
* implementation.
|
||||
* <p>
|
||||
* If you override run with your own, then
|
||||
* simply implement this to return null as it won't be used.
|
||||
* @see #run()
|
||||
*/
|
||||
protected Dialog createDialog(Shell shell)
|
||||
{
|
||||
SystemDeleteDialog dlg = new SystemDeleteDialog(shell);
|
||||
if (promptLabel != null)
|
||||
dlg.setPromptLabel(promptLabel);
|
||||
Object firstSelection = getFirstSelection();
|
||||
if (getRemoteAdapter(firstSelection) != null)
|
||||
{
|
||||
String warningMsg = null;
|
||||
String warningTip = null;
|
||||
|
||||
warningMsg = SystemResources.RESID_DELETE_WARNING_LABEL;
|
||||
warningTip = SystemResources.RESID_DELETE_WARNING_TOOLTIP;
|
||||
dlg.setWarningMessage(warningMsg,warningTip);
|
||||
}
|
||||
return dlg;
|
||||
}
|
||||
|
||||
public class DeleteRunnable implements IRunnableWithProgress
|
||||
{
|
||||
private ISystemDeleteTarget _target;
|
||||
public DeleteRunnable(ISystemDeleteTarget target)
|
||||
{
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public void run(IProgressMonitor monitor)
|
||||
{
|
||||
_target.doDelete(monitor); // deletes all the currently selected items
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by parent.
|
||||
* In our case, we overload it to also perform the deletion, but only if using a delete target,
|
||||
* else it is up to the caller to call wasCancelled() and if not true, do their own deletion.
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
if (!((SystemDeleteDialog)dlg).wasCancelled() && (getDeleteTarget() != null))
|
||||
{
|
||||
ISystemDeleteTarget target = getDeleteTarget();
|
||||
DeleteRunnable delRunnable = new DeleteRunnable(target);
|
||||
IRunnableContext runnableContext = getRunnableContext(dlg.getShell());
|
||||
try
|
||||
{
|
||||
runnableContext.run(false, true, delRunnable);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
SystemPlugin.getTheSystemRegistry().clearRunnableContext();
|
||||
setEnabled(target.canDelete());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected IRunnableContext getRunnableContext(Shell shell)
|
||||
{
|
||||
IRunnableContext irc = SystemPlugin.getTheSystemRegistry().getRunnableContext();
|
||||
if (irc != null)
|
||||
{
|
||||
return irc;
|
||||
}
|
||||
else
|
||||
{
|
||||
irc = new ProgressMonitorDialog(shell);
|
||||
SystemPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
|
||||
return irc;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the implementation of ISystemRemoteElement for the given
|
||||
* object. Returns null if this object does not adaptable to this.
|
||||
*/
|
||||
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
|
||||
{
|
||||
return SystemAdapterHelpers.getRemoteAdapter(o);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,236 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.ISystemRenameTarget;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemRenameDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
|
||||
import org.eclipse.rse.ui.validators.ISystemValidator;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action that displays the Rename dialog. There are two ways to use this action:
|
||||
* <ol>
|
||||
* <li>When invoking from a class that implements ISystemRenameTarget. In this case, that class
|
||||
* will be called back to determine if this action is to be enabled or not, and to do the actual rename for
|
||||
* each selected object, after the dialog is dismissed.
|
||||
* <li>When used without an ISystemRenameTarget, in which case you need to call getNewNames() after
|
||||
* running the action, and then use the new names to do the rename. This will return null if the dialog
|
||||
* was cancelled.
|
||||
* </ol>
|
||||
* <p>
|
||||
* If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
|
||||
* {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter}, then you
|
||||
* should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
|
||||
* specify a validator that is called to verify the typed new name is valid. Further, to show the type value
|
||||
* of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
|
||||
*
|
||||
* @see org.eclipse.rse.ui.dialogs.SystemRenameDialog
|
||||
* @see org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog
|
||||
*/
|
||||
public class SystemCommonRenameAction extends SystemBaseDialogAction
|
||||
|
||||
{
|
||||
private ISystemRenameTarget renameTarget;
|
||||
private boolean copyCollisionMode = false;
|
||||
private String newNames[];
|
||||
private ISystemValidator nameValidator;
|
||||
private String singleSelectionHelp, multiSelectionHelp, promptLabel, promptTip, verbage;
|
||||
|
||||
/**
|
||||
* Constructor when using a rename target
|
||||
* @param parent The Shell of the parent UI for this dialog
|
||||
* @param target The UI part that has selectable and renamable parts.
|
||||
*/
|
||||
public SystemCommonRenameAction(Shell parent, ISystemRenameTarget target)
|
||||
{
|
||||
super(SystemResources.ACTION_RENAME_LABEL, SystemResources.ACTION_RENAME_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_RENAME_ID), parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setProcessAllSelections(true);
|
||||
renameTarget = target;
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0018");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor when not using a rename target
|
||||
* @param parent The Shell of the parent UI for this dialog
|
||||
*/
|
||||
public SystemCommonRenameAction(Shell parent)
|
||||
{
|
||||
this(parent, null);
|
||||
}
|
||||
/**
|
||||
* Set the help to use in the dialog when there is a single selection
|
||||
*/
|
||||
public void setDialogSingleSelectionHelp(String helpID)
|
||||
{
|
||||
this.singleSelectionHelp = helpID;
|
||||
}
|
||||
/**
|
||||
* Set the help to use in the dialog when there are multiple selections
|
||||
*/
|
||||
public void setDialogMultiSelectionHelp(String helpID)
|
||||
{
|
||||
this.multiSelectionHelp = helpID;
|
||||
}
|
||||
/**
|
||||
* Set the label and tooltip of the prompt, used when only one thing is selected. The default is "New name:"
|
||||
*/
|
||||
public void setSingleSelectPromptLabel(String label, String tooltip)
|
||||
{
|
||||
this.promptLabel = label;
|
||||
this.promptTip = tooltip;
|
||||
}
|
||||
/**
|
||||
* Set the verbage to show at the top of the table, used when multi things are selected. The default is "Enter a new name for each resource"
|
||||
*/
|
||||
public void setMultiSelectVerbage(String verbage)
|
||||
{
|
||||
this.verbage = verbage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the validator for the new name,as supplied by the adaptor for name checking.
|
||||
* Overrides the default which is to query it from the object's adapter.
|
||||
*/
|
||||
public void setNameValidator(ISystemValidator nameValidator)
|
||||
{
|
||||
this.nameValidator = nameValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate this dialog is the result of a copy/move name collision.
|
||||
* Affects the title, verbage at the top of the dialog, and context help.
|
||||
*/
|
||||
public void setCopyCollisionMode(boolean copyCollisionMode)
|
||||
{
|
||||
this.copyCollisionMode = copyCollisionMode;
|
||||
}
|
||||
/**
|
||||
* Query if this dialog is the result of a copy/move name collision.
|
||||
* Affects the title, verbage at the top of the dialog, and context help.
|
||||
*/
|
||||
public boolean getCopyCollisionMode()
|
||||
{
|
||||
return copyCollisionMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by SystemBaseAction when selection is set.
|
||||
* Our opportunity to verify we are allowed for this selected type.
|
||||
* We overload it to call canRename() in the SystemView class.
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
if (renameTarget == null)
|
||||
return true;
|
||||
else
|
||||
return renameTarget.canRename();
|
||||
}
|
||||
|
||||
/**
|
||||
* If you decide to use the supplied run method as is,
|
||||
* then you must override this method to create and return
|
||||
* the dialog that is displayed by the default run method
|
||||
* implementation.
|
||||
* <p>
|
||||
* If you override run with your own, then
|
||||
* simply implement this to return null as it won't be used.
|
||||
* @see #run()
|
||||
*/
|
||||
protected Dialog createDialog(Shell parent)
|
||||
{
|
||||
// multi-select
|
||||
if (getSelection().size() > 1)
|
||||
{
|
||||
SystemRenameDialog dlg = new SystemRenameDialog(parent);
|
||||
if (nameValidator != null)
|
||||
dlg.setNameValidator(nameValidator);
|
||||
if (multiSelectionHelp != null)
|
||||
dlg.setHelp(multiSelectionHelp);
|
||||
if (verbage != null)
|
||||
dlg.setVerbage(verbage);
|
||||
return dlg;
|
||||
}
|
||||
// single-select
|
||||
else
|
||||
{
|
||||
SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(parent);
|
||||
if (copyCollisionMode)
|
||||
dlg.setCopyCollisionMode(copyCollisionMode);
|
||||
if (nameValidator != null)
|
||||
dlg.setNameValidator(nameValidator);
|
||||
if (singleSelectionHelp != null)
|
||||
dlg.setHelp(singleSelectionHelp);
|
||||
if ((promptLabel != null) || (promptTip != null))
|
||||
dlg.setPromptLabel(promptLabel, promptTip);
|
||||
return dlg;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by parent. We use it to actually do the rename by calling doRename
|
||||
* in the supplied ISystemRenameTarget, if we are in that mode.
|
||||
* As a result, we return null from here.
|
||||
* @see #getNewNames()
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
newNames = null;
|
||||
if (dlg instanceof SystemRenameDialog)
|
||||
{
|
||||
SystemRenameDialog rnmDlg = (SystemRenameDialog)dlg;
|
||||
if (!rnmDlg.wasCancelled())
|
||||
{
|
||||
newNames = rnmDlg.getNewNames();
|
||||
if (renameTarget != null)
|
||||
renameTarget.doRename(newNames); // perform the actual renames.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemRenameSingleDialog rnmDlg = (SystemRenameSingleDialog)dlg;
|
||||
if (!rnmDlg.wasCancelled())
|
||||
{
|
||||
String name = rnmDlg.getNewName();
|
||||
newNames = new String[1];
|
||||
newNames[0] = name;
|
||||
if (renameTarget != null)
|
||||
renameTarget.doRename(newNames); // perform the actual renames.
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the new names entered by the user. You only need to call this when you don't supply a
|
||||
* rename target. In this case, it is your responsibility to do the actual renames.
|
||||
* @return - array of new names, with the order matching the order of the input selection. Null if dialog cancelled.
|
||||
*/
|
||||
public String[] getNewNames()
|
||||
{
|
||||
return newNames;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.view.ISystemSelectAllTarget;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The global action that enables select all.
|
||||
* For the RSE tree view, we interpret select all to mean select all the
|
||||
* children of the currently selected parent, if applicable.
|
||||
*/
|
||||
public class SystemCommonSelectAllAction
|
||||
extends SystemBaseAction
|
||||
|
||||
{
|
||||
private ISystemSelectAllTarget target;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param parent The Shell of the parent UI for this dialog
|
||||
* @param selProvider The viewer that provides the selections
|
||||
* @param target The viewer that is running this action
|
||||
*/
|
||||
public SystemCommonSelectAllAction(Shell parent, ISelectionProvider selProvider, ISystemSelectAllTarget target)
|
||||
{
|
||||
//super(SystemPlugin.getResourceBundle(), ISystemConstants.ACTION_SELECTALL, null, parent); TODO: XLATE!
|
||||
super("Select All", (ImageDescriptor)null, parent);
|
||||
setSelectionProvider(selProvider);
|
||||
this.target = target;
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
//setHelp(SystemPlugin.HELPPREFIX+"actn0021"); // TODO: ADD HELP!
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by SystemBaseAction when selection is set.
|
||||
* Our opportunity to verify we are allowed for this selected type.
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
return target.enableSelectAll(selection);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
target.doSelectAll(getSelection());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.rse.core.ISystemTypes;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
//import org.eclipse.rse.core.ui.SystemMessage;
|
||||
|
||||
|
||||
/**
|
||||
* This is the action for connecting to the remote subsystem
|
||||
*/
|
||||
public class SystemConnectAction extends SystemBaseAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell Shell of parent window, used as the parent for the dialog.
|
||||
* Can be null, but be sure to call setParent before the action is used (ie, run).
|
||||
*/
|
||||
public SystemConnectAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_CONNECT_LABEL,SystemResources.ACTION_CONNECT_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0047");
|
||||
}
|
||||
/**
|
||||
* Override of parent. Called when testing if action should be enabled base on current
|
||||
* selection. We check the selected object is one of our subsystems, and we are not
|
||||
* already connected.
|
||||
*/
|
||||
public boolean checkObjectType(Object obj)
|
||||
{
|
||||
if ( !(obj instanceof ISubSystem) ||
|
||||
((ISubSystem)obj).getConnectorService().isConnected() )
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this action is selection from the popup menu.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISubSystem ss = (ISubSystem)getFirstSelection();
|
||||
try {
|
||||
if (ss.getHost().getSystemType().equals(ISystemTypes.SYSTEMTYPE_WINDOWS))
|
||||
ss.connect(getShell());
|
||||
else
|
||||
ss.connect(getShell(), true);
|
||||
} catch (Exception exc) {} // msg already shown
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
//import com.ibm.etools.systems.*;
|
||||
/**
|
||||
* This is the action for connecting all subsystems for a given connection.
|
||||
*/
|
||||
public class SystemConnectAllSubSystemsAction extends SystemBaseAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
|
||||
private ISystemRegistry sr = null;
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell Shell of parent window, used as the parent for the dialog.
|
||||
* Can be null, but be sure to call setParent before the action is used (ie, run).
|
||||
*/
|
||||
public SystemConnectAllSubSystemsAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_CONNECT_ALL_LABEL,SystemResources.ACTION_CONNECT_ALL_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
//setHelp(SystemPlugin.HELPPREFIX+"actn0022");
|
||||
}
|
||||
/**
|
||||
* Override of parent. Called when testing if action should be enabled base on current
|
||||
* selection. We check the selected object is one of our subsystems, and if we are
|
||||
* currently connected.
|
||||
*/
|
||||
public boolean checkObjectType(Object obj)
|
||||
{
|
||||
if ((obj instanceof IHost) &&
|
||||
!sr.areAllSubSystemsConnected((IHost)obj))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this action is selection from the popup menu.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
List failedSystems = new ArrayList();
|
||||
IHost conn = (IHost)getFirstSelection();
|
||||
try
|
||||
{
|
||||
Shell shell = getShell();
|
||||
ISubSystem[] subsystems = conn.getSubSystems();
|
||||
for (int i = 0; i < subsystems.length; i++)
|
||||
{
|
||||
ISubSystem subsystem = subsystems[i];
|
||||
IConnectorService system = subsystem.getConnectorService();
|
||||
if (!subsystem.isConnected() && !failedSystems.contains(system))
|
||||
{
|
||||
try
|
||||
{
|
||||
subsystem.connect(shell, false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
failedSystems.add(system);
|
||||
|
||||
// if the user was prompted for password and cancelled
|
||||
// or if the connect was interrupted for some other reason
|
||||
// we don't attempt to connect the other subsystems
|
||||
if (e instanceof InterruptedException) {
|
||||
break;
|
||||
}
|
||||
}// msg already shown
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
} // msg already shown
|
||||
}
|
||||
}
|
|
@ -0,0 +1,248 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* Copy a connection action.
|
||||
*/
|
||||
public class SystemCopyConnectionAction extends SystemBaseCopyAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
private ISystemRegistry sr = null;
|
||||
private SystemSimpleContentElement initialSelectionElement = null;
|
||||
/**
|
||||
* Constructor for SystemCopyConnectionAction
|
||||
*/
|
||||
public SystemCopyConnectionAction(Shell parent)
|
||||
{
|
||||
super(parent, SystemResources.ACTION_COPY_CONNECTION_LABEL, MODE_COPY);
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0019");
|
||||
setDialogHelp(SystemPlugin.HELPPREFIX+"dccn0000");
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We intercept to ensure only connections from the same profile are selected.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
ISystemRegistry sr = SystemPlugin.getDefault().getSystemRegistry();
|
||||
ISystemProfile prevProfile = null;
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IHost)
|
||||
{
|
||||
IHost conn = (IHost)selectedObject;
|
||||
if (prevProfile == null)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
else
|
||||
enable = (prevProfile == conn.getSystemProfile());
|
||||
if (enable)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
}
|
||||
else
|
||||
enable = false;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
// --------------------------
|
||||
// PARENT METHOD OVERRIDES...
|
||||
// --------------------------
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
|
||||
*/
|
||||
protected String checkForCollision(Shell shell, IProgressMonitor monitor,
|
||||
Object targetContainer, Object oldObject, String oldName)
|
||||
{
|
||||
ISystemProfile profile = (ISystemProfile)targetContainer;
|
||||
String newName = oldName;
|
||||
IHost match = sr.getHost(profile, oldName);
|
||||
if (match != null)
|
||||
{
|
||||
//monitor.setVisible(false); wish we could!
|
||||
//ValidatorConnectionName validator = new ValidatorConnectionName(sr.getConnectionAliasNames(profile));
|
||||
//SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
|
||||
SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
|
||||
dlg.open();
|
||||
if (!dlg.wasCancelled())
|
||||
newName = dlg.getNewName();
|
||||
else
|
||||
newName = null;
|
||||
}
|
||||
return newName;
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
|
||||
*/
|
||||
protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
|
||||
throws Exception
|
||||
{
|
||||
IHost oldConnection = (IHost)oldObject;
|
||||
String oldName = oldConnection.getAliasName();
|
||||
//SystemPlugin.logDebugMessage(this.getClass().getName(),"starting to copy "+oldName+" to "+newName);
|
||||
ISystemProfile targetProfile = (ISystemProfile)targetContainer;
|
||||
IHost newConn = sr.copyHost(monitor, oldConnection, targetProfile, newName);
|
||||
return (newConn != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getTreeModel()
|
||||
*/
|
||||
protected SystemSimpleContentElement getTreeModel()
|
||||
{
|
||||
return getProfileTreeModel(getFirstSelectedConnection().getSystemProfile());
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getTreeInitialSelection()
|
||||
*/
|
||||
protected SystemSimpleContentElement getTreeInitialSelection()
|
||||
{
|
||||
return initialSelectionElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getPromptString()
|
||||
*/
|
||||
protected String getPromptString()
|
||||
{
|
||||
return SystemResources.RESID_COPY_TARGET_PROFILE_PROMPT;
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getCopyingMessage()
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage()
|
||||
{
|
||||
return SystemPlugin.getPluginMessage(MSG_COPYCONNECTIONS_PROGRESS);
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getCopyingMessage( String)
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage(String oldName)
|
||||
{
|
||||
return SystemPlugin.getPluginMessage(MSG_COPYCONNECTION_PROGRESS).makeSubstitution(oldName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getOldObjects()
|
||||
*/
|
||||
protected Object[] getOldObjects()
|
||||
{
|
||||
return getSelectedConnections();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getOldNames()
|
||||
*/
|
||||
protected String[] getOldNames()
|
||||
{
|
||||
IHost[] conns = getSelectedConnections();
|
||||
String[] names = new String[conns.length];
|
||||
for (int idx=0; idx<conns.length; idx++)
|
||||
names[idx] = conns[idx].getAliasName();
|
||||
return names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currently selected connections
|
||||
*/
|
||||
protected IHost[] getSelectedConnections()
|
||||
{
|
||||
IStructuredSelection selection = (IStructuredSelection)getSelection();
|
||||
IHost[] conns = new IHost[selection.size()];
|
||||
Iterator i = selection.iterator();
|
||||
int idx=0;
|
||||
while (i.hasNext())
|
||||
{
|
||||
conns[idx++] = (IHost)i.next();
|
||||
}
|
||||
return conns;
|
||||
}
|
||||
/**
|
||||
* Get the first selected connection
|
||||
*/
|
||||
protected IHost getFirstSelectedConnection()
|
||||
{
|
||||
return (IHost)getFirstSelection();
|
||||
}
|
||||
|
||||
// ------------------
|
||||
// PRIVATE METHODS...
|
||||
// ------------------
|
||||
|
||||
/**
|
||||
* Create and return data model to populate selection tree with.
|
||||
* @param profile whose tree model element is to be selected
|
||||
*/
|
||||
protected SystemSimpleContentElement getProfileTreeModel(ISystemProfile profile)
|
||||
{
|
||||
SystemSimpleContentElement veryRootElement =
|
||||
new SystemSimpleContentElement("Profiles",
|
||||
null, null, (Vector)null);
|
||||
veryRootElement.setRenamable(false);
|
||||
veryRootElement.setDeletable(false);
|
||||
|
||||
ISystemProfile[] profiles = SystemPlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
||||
ImageDescriptor image = SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
|
||||
|
||||
if (profiles == null)
|
||||
return veryRootElement;
|
||||
|
||||
Vector veryRootChildren = new Vector();
|
||||
for (int idx=0; idx<profiles.length; idx++)
|
||||
{
|
||||
SystemSimpleContentElement profileElement =
|
||||
new SystemSimpleContentElement(profiles[idx].getName(),
|
||||
profiles[idx], veryRootElement, (Vector)null);
|
||||
profileElement.setRenamable(false);
|
||||
profileElement.setDeletable(false);
|
||||
profileElement.setImageDescriptor(image);
|
||||
veryRootChildren.addElement(profileElement);
|
||||
if (profiles[idx] == profile)
|
||||
initialSelectionElement = profileElement;
|
||||
}
|
||||
veryRootElement.setChildren(veryRootChildren);
|
||||
return veryRootElement;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,234 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||
import org.eclipse.rse.ui.view.SystemDropActionDelegate;
|
||||
import org.eclipse.rse.ui.view.SystemViewDataDropAdapter;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.dnd.FileTransfer;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.dnd.Transfer;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.PluginTransfer;
|
||||
import org.eclipse.ui.part.PluginTransferData;
|
||||
|
||||
|
||||
/**
|
||||
* Copy selected objects to clipboard action.
|
||||
*/
|
||||
public class SystemCopyToClipboardAction extends SystemBaseAction implements ISystemMessages, IValidatorRemoteSelection
|
||||
{
|
||||
|
||||
|
||||
private IStructuredSelection _selection;
|
||||
private Clipboard _clipboard;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemCopyToClipboardAction(Shell shell, Clipboard clipboard)
|
||||
{
|
||||
super(SystemResources.ACTION_COPY_LABEL,
|
||||
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
|
||||
shell);
|
||||
|
||||
_clipboard = clipboard;
|
||||
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0116");
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
if (_selection != null)
|
||||
{
|
||||
copySelectionToClipboard(_selection);
|
||||
}
|
||||
}
|
||||
|
||||
private void copySelectionToClipboard(IStructuredSelection ss)
|
||||
{
|
||||
Iterator iterator = ss.iterator();
|
||||
|
||||
// marshall data
|
||||
StringBuffer textStream = new StringBuffer("");
|
||||
StringBuffer dataStream = new StringBuffer("");
|
||||
ArrayList fileNames = new ArrayList();
|
||||
ISystemRegistry registry = SystemPlugin.getTheSystemRegistry();
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Object dragObject = iterator.next();
|
||||
|
||||
if (dragObject instanceof IAdaptable)
|
||||
{
|
||||
ISystemViewElementAdapter adapter = (ISystemViewElementAdapter) ((IAdaptable) dragObject).getAdapter(ISystemViewElementAdapter.class);
|
||||
|
||||
if (adapter != null)
|
||||
{
|
||||
String text = adapter.getAlternateText(dragObject);
|
||||
textStream.append(getTextTransferPrepend(dragObject, adapter));
|
||||
textStream.append(text);
|
||||
textStream.append(getTextTransferAppend(dragObject, adapter));
|
||||
|
||||
if (adapter.canDrag(dragObject))
|
||||
{
|
||||
// get the subsystem id
|
||||
ISubSystem subSystem = adapter.getSubSystem(dragObject);
|
||||
String subSystemId = registry.getAbsoluteNameForSubSystem(subSystem);
|
||||
|
||||
dataStream.append(subSystemId);
|
||||
dataStream.append(":");
|
||||
|
||||
String objectId = adapter.getAbsoluteName(dragObject);
|
||||
dataStream.append(objectId);
|
||||
|
||||
if (iterator.hasNext())
|
||||
{
|
||||
dataStream.append(SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
|
||||
}
|
||||
|
||||
/** FIXME - files can't be coupled to systems.core!
|
||||
// support for external copy for local files
|
||||
if (dragObject instanceof IRemoteFile)
|
||||
{
|
||||
IRemoteFile file = (IRemoteFile) dragObject;
|
||||
|
||||
String connectionType = file.getParentRemoteFileSubSystem().getHost().getSystemType();
|
||||
|
||||
if (connectionType.equals("Local"))
|
||||
{
|
||||
fileNames.add(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PluginTransferData data = new PluginTransferData(SystemDropActionDelegate.ID, dataStream.toString().getBytes());
|
||||
|
||||
// put data in clipboard
|
||||
if (fileNames.size() == 0)
|
||||
{
|
||||
_clipboard.setContents(new Object[] { data, textStream.toString() }, new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance()});
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] ft = new String[fileNames.size()];
|
||||
for (int i = 0; i < ft.length; i++)
|
||||
{
|
||||
ft[i] = (String) fileNames.get(i);
|
||||
}
|
||||
|
||||
_clipboard.setContents(new Object[] { data, ft, textStream.toString() }, new Transfer[] { PluginTransfer.getInstance(), FileTransfer.getInstance(), TextTransfer.getInstance()});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string to prepend for the selected object for text transfer.
|
||||
* Default implementation returns the empty string.
|
||||
* @param obj the selected object.
|
||||
* @param adapter the adapter of the selected object.
|
||||
* @return the string to prepend for the selected object.
|
||||
*/
|
||||
protected String getTextTransferPrepend(Object obj, ISystemViewElementAdapter adapter) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string to append for the selected object for text transfer.
|
||||
* Default implementation returns the system line separator (i.e. the line.separator property).
|
||||
* @param obj the selected object.
|
||||
* @param adapter the adapter of the selected object.
|
||||
* @return the string to append for the selected object.
|
||||
*/
|
||||
protected String getTextTransferAppend(Object obj, ISystemViewElementAdapter adapter) {
|
||||
return System.getProperty("line.separator");
|
||||
}
|
||||
|
||||
/**
|
||||
* The user has selected a remote object. Return null if OK is to be enabled, or a SystemMessage
|
||||
* if it is not to be enabled. The message will be displayed on the message line.
|
||||
* <p>
|
||||
* This is overridden in SystemMoveRemoteFileAction
|
||||
*/
|
||||
public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We simply ensure every selected object has a system view element adapter.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
Iterator e = ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IAdaptable)
|
||||
{
|
||||
IAdaptable adaptable = (IAdaptable) selectedObject;
|
||||
ISystemViewElementAdapter va = (ISystemViewElementAdapter) (adaptable.getAdapter(ISystemViewElementAdapter.class));
|
||||
if (va != null)
|
||||
{
|
||||
enable = va.canDrag(selectedObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (enable)
|
||||
{
|
||||
_selection = selection;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is the action for disconnecting from a remote subsystem.
|
||||
*/
|
||||
public class SystemDisconnectAction extends SystemBaseAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell Shell of parent window, used as the parent for the dialog.
|
||||
* Can be null, but be sure to call setParent before the action is used (ie, run).
|
||||
*/
|
||||
public SystemDisconnectAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_DISCONNECT_LABEL, SystemResources.ACTION_DISCONNECT_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0048");
|
||||
}
|
||||
/**
|
||||
* Override of parent. Called when testing if action should be enabled based on current
|
||||
* selection. We check the selected object is one of our subsystems, and if we are
|
||||
* currently connected.
|
||||
*/
|
||||
public boolean checkObjectType(Object obj)
|
||||
{
|
||||
if ( !(obj instanceof ISubSystem) ||
|
||||
!((ISubSystem)obj).getConnectorService().isConnected() )
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this action is selection from the popup menu.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISubSystem ss = (ISubSystem)getFirstSelection();
|
||||
try {
|
||||
ss.disconnect(getShell());
|
||||
} catch (Exception exc) {} // msg already shown
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
//import com.ibm.etools.systems.*;
|
||||
/**
|
||||
* This is the action forconnecting all subsystems for a given connection.
|
||||
*/
|
||||
public class SystemDisconnectAllSubSystemsAction extends SystemBaseAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
|
||||
private ISystemRegistry sr = null;
|
||||
/**
|
||||
* Constructor.
|
||||
* @param shell Shell of parent window, used as the parent for the dialog.
|
||||
* Can be null, but be sure to call setParent before the action is used (ie, run).
|
||||
*/
|
||||
public SystemDisconnectAllSubSystemsAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_LABEL, SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP, shell);
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION);
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
// TODO help for connect all
|
||||
//setHelp(SystemPlugin.HELPPREFIX+"actn0022");
|
||||
}
|
||||
/**
|
||||
* Override of parent. Called when testing if action should be enabled base on current
|
||||
* selection. We check the selected object is one of our subsystems, and if we are
|
||||
* currently connected.
|
||||
*/
|
||||
public boolean checkObjectType(Object obj)
|
||||
{
|
||||
if ( !(obj instanceof IHost) ||
|
||||
!(sr.isAnySubSystemConnected((IHost)obj) ))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this action is selection from the popup menu.
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
IHost conn = (IHost)getFirstSelection();
|
||||
try {
|
||||
sr.disconnectAllSubSystems(conn);
|
||||
} catch (Exception exc) {} // msg already shown
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2005, 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
*
|
||||
* Singleton class for managing adapter menu extensions.
|
||||
* View adapters that support this feature, should call populateMenu to allow for
|
||||
* extended menu contributions.
|
||||
*/
|
||||
public class SystemDynamicPopupMenuExtensionManager implements
|
||||
ISystemDynamicPopupMenuExtensionManager
|
||||
{
|
||||
private static SystemDynamicPopupMenuExtensionManager _instance = new SystemDynamicPopupMenuExtensionManager();
|
||||
|
||||
private List _extensions;
|
||||
|
||||
private SystemDynamicPopupMenuExtensionManager()
|
||||
{
|
||||
_extensions= new ArrayList();
|
||||
}
|
||||
|
||||
public static SystemDynamicPopupMenuExtensionManager getInstance()
|
||||
{
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public void registerMenuExtension(ISystemDynamicPopupMenuExtension ext)
|
||||
{
|
||||
_extensions.add(ext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actions are added to a contribution menu.
|
||||
* @param shell the shell
|
||||
* @param menu the menu to contribute to
|
||||
* @param selection(s) are processed to determine the resource source file
|
||||
* @param menuGroup the default menu group to add actions to
|
||||
* @return the menu is populated with actions
|
||||
*/
|
||||
public void populateMenu(Shell shell, IMenuManager menu,IStructuredSelection selection, String menuGroup)
|
||||
{
|
||||
for (int i = 0; i <_extensions.size(); i++)
|
||||
{
|
||||
ISystemDynamicPopupMenuExtension extension = (ISystemDynamicPopupMenuExtension)_extensions.get(i);
|
||||
if (extension.supportsSelection(selection))
|
||||
{
|
||||
extension.populateMenu(shell, menu,selection, menuGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.ISystemTree;
|
||||
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to expand the selected nodes in the Remote Systems Explorer tree view
|
||||
*/
|
||||
public class SystemExpandAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
// see defect 41203
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemExpandAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_EXPAND_SELECTED_LABEL,SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP,
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
|
||||
setAccelerator('+');
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0025");
|
||||
setAvailableOffline(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* We intercept to ensure at least one selected item is expandable
|
||||
*
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = false;
|
||||
if ((viewer != null) && (viewer instanceof ISystemTree))
|
||||
{
|
||||
return ((ISystemTree)viewer).areAnySelectedItemsExpandable();
|
||||
}
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
ISystemViewElementAdapter adapter = null;
|
||||
while (!enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
adapter = getAdapter(selectedObject);
|
||||
if (adapter != null)
|
||||
{
|
||||
if (adapter.hasChildren(selectedObject))
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
//System.out.println("Inside run of SystemRefreshAction");
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener))
|
||||
{
|
||||
sr.fireEvent((ISystemResourceChangeListener)viewer,
|
||||
new SystemResourceChangeEvent("dummy",
|
||||
ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
|
||||
}
|
||||
else
|
||||
sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,256 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
|
||||
import org.eclipse.rse.ui.dialogs.SystemSimpleContentElement;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* Move a connection action.
|
||||
*/
|
||||
public class SystemMoveConnectionAction extends SystemBaseCopyAction
|
||||
implements ISystemMessages
|
||||
{
|
||||
|
||||
private ISystemRegistry sr = null;
|
||||
private SystemSimpleContentElement initialSelectionElement = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemMoveConnectionAction(Shell parent)
|
||||
{
|
||||
super(parent, SystemResources.ACTION_MOVE_CONNECTION_LABEL, MODE_MOVE);
|
||||
//allowOnMultipleSelection(false); // too hard to handle, for now!
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0020");
|
||||
setDialogHelp(SystemPlugin.HELPPREFIX+"dmcn0000");
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We intercept to ensure only connections from the same profile are selected.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
if (sr.getActiveSystemProfiles().length <= 1)
|
||||
return false;
|
||||
boolean enable = true;
|
||||
ISystemProfile prevProfile = null;
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IHost)
|
||||
{
|
||||
IHost conn = (IHost)selectedObject;
|
||||
if (prevProfile == null)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
else
|
||||
enable = (prevProfile == conn.getSystemProfile());
|
||||
if (enable)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
}
|
||||
else
|
||||
enable = false;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
// --------------------------
|
||||
// PARENT METHOD OVERRIDES...
|
||||
// --------------------------
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#checkForCollision(Shell, IProgressMonitor, Object, Object, String)
|
||||
*/
|
||||
protected String checkForCollision(Shell shell, IProgressMonitor monitor,
|
||||
Object targetContainer, Object oldObject, String oldName)
|
||||
{
|
||||
ISystemProfile profile = (ISystemProfile)targetContainer;
|
||||
String newName = oldName;
|
||||
IHost match = sr.getHost(profile, oldName);
|
||||
if (match != null)
|
||||
{
|
||||
//monitor.setVisible(false); wish we could!
|
||||
//ValidatorConnectionName validator = new ValidatorConnectionName(sr.getConnectionAliasNames(profile));
|
||||
//SystemCollisionRenameDialog dlg = new SystemCollisionRenameDialog(shell, validator, oldName);
|
||||
SystemRenameSingleDialog dlg = new SystemRenameSingleDialog(shell, true, match, null); // true => copy-collision-mode
|
||||
dlg.open();
|
||||
if (!dlg.wasCancelled())
|
||||
newName = dlg.getNewName();
|
||||
else
|
||||
newName = null;
|
||||
}
|
||||
return newName;
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#doCopy(IProgressMonitor, Object, Object, String)
|
||||
*/
|
||||
protected boolean doCopy(IProgressMonitor monitor, Object targetContainer, Object oldObject, String newName)
|
||||
throws Exception
|
||||
{
|
||||
IHost oldConnection = (IHost)oldObject;
|
||||
String oldName = oldConnection.getAliasName();
|
||||
//SystemPlugin.logDebugMessage(this.getClass().getName(),"starting to copy "+oldName+" to "+newName);
|
||||
ISystemProfile targetProfile = (ISystemProfile)targetContainer;
|
||||
IHost newConn = sr.moveHost(monitor, oldConnection, targetProfile, newName);
|
||||
return (newConn != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getTreeModel()
|
||||
*/
|
||||
protected SystemSimpleContentElement getTreeModel()
|
||||
{
|
||||
return getProfileTreeModel(getFirstSelectedConnection().getSystemProfile());
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getTreeInitialSelection()
|
||||
*/
|
||||
protected SystemSimpleContentElement getTreeInitialSelection()
|
||||
{
|
||||
return initialSelectionElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getPromptString()
|
||||
*/
|
||||
protected String getPromptString()
|
||||
{
|
||||
return SystemResources.RESID_MOVE_TARGET_PROFILE_PROMPT;
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getCopyingMessage()
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage()
|
||||
{
|
||||
return SystemPlugin.getPluginMessage(MSG_MOVECONNECTIONS_PROGRESS);
|
||||
}
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getCopyingMessage( String)
|
||||
*/
|
||||
protected SystemMessage getCopyingMessage(String oldName)
|
||||
{
|
||||
return SystemPlugin.getPluginMessage(MSG_MOVECONNECTION_PROGRESS).makeSubstitution(oldName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getOldObjects()
|
||||
*/
|
||||
protected Object[] getOldObjects()
|
||||
{
|
||||
return getSelectedConnections();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseCopyAction#getOldNames()
|
||||
*/
|
||||
protected String[] getOldNames()
|
||||
{
|
||||
IHost[] conns = getSelectedConnections();
|
||||
String[] names = new String[conns.length];
|
||||
for (int idx=0; idx<conns.length; idx++)
|
||||
names[idx] = conns[idx].getAliasName();
|
||||
return names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currently selected connections
|
||||
*/
|
||||
protected IHost[] getSelectedConnections()
|
||||
{
|
||||
IStructuredSelection selection = (IStructuredSelection)getSelection();
|
||||
IHost[] conns = new IHost[selection.size()];
|
||||
Iterator i = selection.iterator();
|
||||
int idx=0;
|
||||
while (i.hasNext())
|
||||
{
|
||||
conns[idx++] = (IHost)i.next();
|
||||
}
|
||||
return conns;
|
||||
}
|
||||
/**
|
||||
* Get the first selected connection
|
||||
*/
|
||||
protected IHost getFirstSelectedConnection()
|
||||
{
|
||||
return (IHost)getFirstSelection();
|
||||
}
|
||||
|
||||
// ------------------
|
||||
// PRIVATE METHODS...
|
||||
// ------------------
|
||||
|
||||
/**
|
||||
* Create and return data model to populate selection tree with.
|
||||
* @param profile whose tree model element is not to be include
|
||||
*/
|
||||
protected SystemSimpleContentElement getProfileTreeModel(ISystemProfile profile)
|
||||
{
|
||||
SystemSimpleContentElement veryRootElement =
|
||||
new SystemSimpleContentElement("Profiles",
|
||||
null, null, (Vector)null);
|
||||
veryRootElement.setRenamable(false);
|
||||
veryRootElement.setDeletable(false);
|
||||
|
||||
ISystemProfile[] profiles = SystemPlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
||||
ImageDescriptor image = SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID);
|
||||
|
||||
if (profiles == null)
|
||||
return veryRootElement;
|
||||
|
||||
Vector veryRootChildren = new Vector();
|
||||
|
||||
for (int idx=0; idx<profiles.length; idx++)
|
||||
{
|
||||
if (!(profiles[idx]==profile))
|
||||
{
|
||||
SystemSimpleContentElement profileElement =
|
||||
new SystemSimpleContentElement(profiles[idx].getName(),
|
||||
profiles[idx], veryRootElement, (Vector)null);
|
||||
profileElement.setRenamable(false);
|
||||
profileElement.setDeletable(false);
|
||||
profileElement.setImageDescriptor(image);
|
||||
veryRootChildren.addElement(profileElement);
|
||||
if (initialSelectionElement == null)
|
||||
initialSelectionElement = profileElement;
|
||||
}
|
||||
}
|
||||
veryRootElement.setChildren(veryRootChildren);
|
||||
return veryRootElement;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.SystemSortableSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to move the current connection down in the list
|
||||
*/
|
||||
public class SystemMoveDownConnectionAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
private ISystemProfile prevProfile = null;
|
||||
|
||||
/**
|
||||
* Constructor for SystemMoveDownAction
|
||||
*/
|
||||
public SystemMoveDownConnectionAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_MOVEDOWN_LABEL, SystemResources.ACTION_MOVEDOWN_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEDOWN_ID),
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0002");
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We intercept to ensure only connections from the same profile are selected.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
ISystemRegistry sr = SystemPlugin.getDefault().getSystemRegistry();
|
||||
prevProfile = null;
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IHost)
|
||||
{
|
||||
IHost conn = (IHost)selectedObject;
|
||||
int connCount = sr.getHostCountWithinProfile(conn)-1;
|
||||
if (prevProfile == null)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
else
|
||||
enable = (prevProfile == conn.getSystemProfile());
|
||||
if (enable)
|
||||
{
|
||||
enable = (sr.getHostPosition(conn) < connCount);
|
||||
prevProfile = conn.getSystemProfile();
|
||||
}
|
||||
}
|
||||
else
|
||||
enable = false;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getDefault().getSystemRegistry();
|
||||
SystemSortableSelection[] sortableArray = SystemSortableSelection.makeSortableArray(getSelection());
|
||||
IHost conn = null;
|
||||
for (int idx=0; idx<sortableArray.length; idx++)
|
||||
{
|
||||
conn = (IHost)sortableArray[idx].getSelectedObject();
|
||||
sortableArray[idx].setPosition(sr.getHostPosition(conn));
|
||||
}
|
||||
SystemSortableSelection.sortArray(sortableArray);
|
||||
IHost[] conns = (IHost[])SystemSortableSelection.getSortedObjects(sortableArray, new IHost[sortableArray.length]);
|
||||
sr.moveHosts(prevProfile.getName(),conns,1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.SystemSortableSelection;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to move the current connection up in the list
|
||||
*/
|
||||
public class SystemMoveUpConnectionAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
private ISystemProfile prevProfile = null;
|
||||
|
||||
/**
|
||||
* Constructor for SystemMoveUpAction
|
||||
*/
|
||||
public SystemMoveUpConnectionAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_MOVEUP_LABEL, SystemResources.ACTION_MOVEUP_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID),
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORDER);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0001");
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We intercept to ensure only connections from the same profile are selected.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
ISystemRegistry sr = SystemPlugin.getDefault().getSystemRegistry();
|
||||
prevProfile = null;
|
||||
Iterator e= ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IHost)
|
||||
{
|
||||
IHost conn = (IHost)selectedObject;
|
||||
if (prevProfile == null)
|
||||
prevProfile = conn.getSystemProfile();
|
||||
else
|
||||
enable = (prevProfile == conn.getSystemProfile());
|
||||
if (enable)
|
||||
{
|
||||
enable = (sr.getHostPosition(conn) > 0);
|
||||
prevProfile = conn.getSystemProfile();
|
||||
}
|
||||
}
|
||||
else
|
||||
enable = false;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getDefault().getSystemRegistry();
|
||||
|
||||
SystemSortableSelection[] sortableArray = SystemSortableSelection.makeSortableArray(getSelection());
|
||||
IHost conn = null;
|
||||
for (int idx=0; idx<sortableArray.length; idx++)
|
||||
{
|
||||
conn = (IHost)sortableArray[idx].getSelectedObject();
|
||||
sortableArray[idx].setPosition(sr.getHostPosition(conn));
|
||||
}
|
||||
SystemSortableSelection.sortArray(sortableArray);
|
||||
IHost[] conns = (IHost[])SystemSortableSelection.getSortedObjects(sortableArray, new IHost[sortableArray.length]);
|
||||
|
||||
sr.moveHosts(prevProfile.getName(),conns,-1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,198 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.wizard.IWizard;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.filters.ISystemFilterPoolReference;
|
||||
import org.eclipse.rse.filters.ISystemFilterReference;
|
||||
import org.eclipse.rse.filters.ISystemFilterStringReference;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.wizards.SystemNewConnectionWizard;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action that displays the New Connection wizard
|
||||
*/
|
||||
public class SystemNewConnectionAction extends SystemBaseWizardAction
|
||||
|
||||
{
|
||||
|
||||
private IHost currConn;
|
||||
private boolean fromPopupMenu = true;
|
||||
private ISelectionProvider sp = null;
|
||||
private String[] restrictSystemTypesTo;
|
||||
private String defaultConnectionName, defaultHostName;
|
||||
|
||||
/**
|
||||
* Constructor for SystemNewConnectionAction
|
||||
* @param shell The parent shell to host the new wizard
|
||||
* @param fromPopupMenu true if being launched from the remote systems explorer view directly,
|
||||
* false if being launched from a dialog
|
||||
* @param sp The selection provider that will supply the selection via getSelection, if
|
||||
* fromPopupMenu is false
|
||||
*/
|
||||
public SystemNewConnectionAction(Shell shell, boolean fromPopupMenu, ISelectionProvider sp)
|
||||
{
|
||||
this(shell, fromPopupMenu, true, sp);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemNewConnectionAction when you don't want the icon.
|
||||
* @param shell The parent shell to host the new wizard
|
||||
* @param fromPopupMenu true if being launched from the remote systems explorer view directly,
|
||||
* false if being launched from a dialog
|
||||
* @param wantIcon true if you want the icon to show beside the action, false if not
|
||||
* @param sp The selection provider that will supply the selection via getSelection, if
|
||||
* fromPopupMenu is false
|
||||
*/
|
||||
public SystemNewConnectionAction(Shell shell, boolean fromPopupMenu, boolean wantIcon, ISelectionProvider sp)
|
||||
{
|
||||
this(shell, SystemResources.ACTION_NEWCONN_LABEL, SystemResources.ACTION_NEWCONN_TOOLTIP, fromPopupMenu, wantIcon, sp);
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemNewConnectionAction when you possibly don't want the icon, and want to
|
||||
* supply your own label. This is the "full" flavoured constructor!
|
||||
*
|
||||
* @param shell The parent shell to host the new wizard
|
||||
* @param label The label for the action
|
||||
* @param tooltip the tooltip for the action
|
||||
* @param fromPopupMenu true if being launched from the remote systems explorer view directly,
|
||||
* false if being launched from a dialog
|
||||
* @param wantIcon true if you want the icon to show beside the action, false if not
|
||||
* @param sp The selection provider that will supply the selection via getSelection, if
|
||||
* fromPopupMenu is false
|
||||
*/
|
||||
public SystemNewConnectionAction(Shell shell, String label, String tooltip,
|
||||
boolean fromPopupMenu, boolean wantIcon, ISelectionProvider sp)
|
||||
{
|
||||
super(label, tooltip,
|
||||
wantIcon ? SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID) : null ,
|
||||
shell);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
|
||||
this.fromPopupMenu = fromPopupMenu;
|
||||
this.sp = sp;
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0000");
|
||||
}
|
||||
|
||||
/**
|
||||
* The default processing for the run method calls createDialog, which
|
||||
* in turn calls this method to return an instance of our wizard.
|
||||
* <p>
|
||||
* Our default implementation is to return SystemNewConnectionWizard.
|
||||
*/
|
||||
protected IWizard createWizard()
|
||||
{
|
||||
SystemNewConnectionWizard newConnWizard = new SystemNewConnectionWizard();
|
||||
if (!fromPopupMenu && (sp!=null))
|
||||
{
|
||||
setSelection(sp.getSelection());
|
||||
}
|
||||
|
||||
newConnWizard.setCurrentlySelectedConnection(currConn);
|
||||
if (restrictSystemTypesTo != null)
|
||||
newConnWizard.restrictSystemTypes(restrictSystemTypesTo);
|
||||
if (defaultHostName != null)
|
||||
newConnWizard.setHostName(defaultHostName);
|
||||
if (defaultConnectionName != null)
|
||||
newConnWizard.setConnectionName(defaultConnectionName);
|
||||
return newConnWizard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current selected connection so we can better intelligently set
|
||||
* the defaults.
|
||||
*/
|
||||
public void setCurrentConnection(IHost conn)
|
||||
{
|
||||
this.currConn = conn;
|
||||
}
|
||||
/**
|
||||
* Call this to restrict the system type that the user is allowed to choose
|
||||
*/
|
||||
public void restrictSystemType(String systemType)
|
||||
{
|
||||
restrictSystemTypesTo = new String[1];
|
||||
restrictSystemTypesTo[0] = systemType;
|
||||
}
|
||||
/**
|
||||
* Call this to restrict the system types that the user is allowed to choose
|
||||
*/
|
||||
public void restrictSystemTypes(String[] systemTypes)
|
||||
{
|
||||
this.restrictSystemTypesTo = systemTypes;
|
||||
}
|
||||
/**
|
||||
* Preset the connection name
|
||||
*/
|
||||
public void setConnectionName(String name)
|
||||
{
|
||||
defaultConnectionName = name;
|
||||
}
|
||||
/**
|
||||
* Preset the host name
|
||||
*/
|
||||
public void setHostName(String name)
|
||||
{
|
||||
defaultHostName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of parent method so we can deduce currently selected connection (direct or indirect if child object selected).
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = super.updateSelection(selection);
|
||||
if (enable)
|
||||
{
|
||||
Object firstSelection = getFirstSelection();
|
||||
IHost conn = null;
|
||||
if (firstSelection != null)
|
||||
{
|
||||
if (firstSelection instanceof IHost)
|
||||
conn = (IHost)firstSelection;
|
||||
else if (firstSelection instanceof ISubSystem)
|
||||
conn = ((ISubSystem)firstSelection).getHost();
|
||||
else if (firstSelection instanceof ISystemFilterPoolReference)
|
||||
{
|
||||
ISystemFilterPoolReference sfpr = (ISystemFilterPoolReference)firstSelection;
|
||||
ISubSystem ss = (ISubSystem)sfpr.getProvider();
|
||||
conn = ss.getHost();
|
||||
}
|
||||
else if (firstSelection instanceof ISystemFilterReference)
|
||||
{
|
||||
ISystemFilterReference sfr = (ISystemFilterReference)firstSelection;
|
||||
ISubSystem ss = (ISubSystem)sfr.getProvider();
|
||||
conn = ss.getHost();
|
||||
}
|
||||
else if (firstSelection instanceof ISystemFilterStringReference)
|
||||
{
|
||||
ISystemFilterStringReference sfsr = (ISystemFilterStringReference)firstSelection;
|
||||
ISubSystem ss = (ISubSystem)sfsr.getProvider();
|
||||
conn = ss.getHost();
|
||||
}
|
||||
}
|
||||
setCurrentConnection(conn);
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action that displays the Create Another Connection wizard
|
||||
*/
|
||||
public class SystemNewConnectionFromExistingConnectionAction extends SystemNewConnectionAction
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param shell The parent shell to host the new wizard
|
||||
*/
|
||||
public SystemNewConnectionFromExistingConnectionAction(Shell shell)
|
||||
{
|
||||
super(shell, SystemResources.ACTION_ANOTHERCONN_LABEL, SystemResources.ACTION_ANOTHERCONN_TOOLTIP, false, true, null);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0015");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.wizard.IWizard;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.SystemStartHere;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.team.SystemTeamView;
|
||||
import org.eclipse.rse.ui.wizards.SystemNewProfileWizard;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action that displays the New Profile wizard
|
||||
*/
|
||||
public class SystemNewProfileAction extends SystemBaseWizardAction
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for SystemNewProfileAction for "New -> Profile..."
|
||||
*/
|
||||
public SystemNewProfileAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_NEWPROFILE_LABEL, SystemResources.ACTION_NEWPROFILE_TOOLTIP, SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWPROFILE_ID), parent);
|
||||
setSelectionSensitive(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0003");
|
||||
}
|
||||
/**
|
||||
* Constructor for SystemNewProfileAction where you can choose between "New profile..." and "New -> Profile"
|
||||
*/
|
||||
public SystemNewProfileAction(Shell parent, boolean cascading)
|
||||
{
|
||||
super(cascading ? SystemResources.ACTION_NEWPROFILE_LABEL : SystemResources.ACTION_NEW_PROFILE_LABEL,
|
||||
cascading ? SystemResources.ACTION_NEWPROFILE_TOOLTIP : SystemResources.ACTION_NEW_PROFILE_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWPROFILE_ID), parent);
|
||||
setSelectionSensitive(false);
|
||||
if (cascading)
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW);
|
||||
else
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW_NONCASCADING);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0003");
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the enabled state
|
||||
*/
|
||||
public void refreshEnablement()
|
||||
{
|
||||
setEnabled(isEnabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* We disable this action if it is a new workspace and the user has yet to create
|
||||
* their first connection, and hence rename their default profile.
|
||||
*/
|
||||
public boolean isEnabled()
|
||||
{
|
||||
// defect 43428...
|
||||
ISystemProfile defaultProfile = SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile();
|
||||
if (defaultProfile != null)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The default processing for the run method calls createDialog, which
|
||||
* in turn calls this method to return an instance of our wizard.
|
||||
* <p>
|
||||
* Our default implementation is to call SystemNewProfileWizard.
|
||||
*/
|
||||
protected IWizard createWizard()
|
||||
{
|
||||
return new SystemNewProfileWizard();
|
||||
}
|
||||
|
||||
/**
|
||||
* Typically, the wizard's performFinish method does the work required by
|
||||
* a successful finish of the wizard. However, often we also want to be
|
||||
* able to extract user-entered data from the wizard, by calling getters
|
||||
* in this action. To enable this, override this method to populate your
|
||||
* output instance variables from the completed wizard, which is passed
|
||||
* as a parameter. This is only called after successful completion of the
|
||||
* wizard.
|
||||
*/
|
||||
protected void postProcessWizard(IWizard wizard)
|
||||
{
|
||||
if (getViewer() instanceof SystemTeamView)
|
||||
{
|
||||
getViewer().refresh();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.filters.ISystemFilterReference;
|
||||
import org.eclipse.rse.model.ISystemPromptableObject;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.view.SystemPerspectiveLayout;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IPerspectiveDescriptor;
|
||||
import org.eclipse.ui.IPerspectiveRegistry;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.actions.OpenInNewWindowAction;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to open a new Remote Systems Explorer perspective, anchored
|
||||
* by the currently selected resource.
|
||||
*/
|
||||
public class SystemOpenExplorerPerspectiveAction
|
||||
extends SystemBaseAction
|
||||
|
||||
{
|
||||
//private boolean replaceEnabled = true;
|
||||
private IWorkbenchWindow window;
|
||||
private IPerspectiveRegistry reg;
|
||||
private IPerspectiveDescriptor desc = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemOpenExplorerPerspectiveAction(Shell parent, IWorkbenchWindow currentWorkbenchWindow)
|
||||
{
|
||||
super(SystemResources.ACTION_OPENEXPLORER_DIFFPERSP2_LABEL, SystemResources.ACTION_OPENEXPLORER_DIFFPERSP2_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE_ID),
|
||||
parent);
|
||||
this.window = currentWorkbenchWindow;
|
||||
this.reg = PlatformUI.getWorkbench().getPerspectiveRegistry();
|
||||
this.desc = reg.findPerspectiveWithId(SystemPerspectiveLayout.ID);
|
||||
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_OPEN);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0016");
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We intercept to ensure only connections from the same profile are selected.
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
Object selected = selection.getFirstElement();
|
||||
if (selected instanceof ISystemFilterReference)
|
||||
{
|
||||
if ( ((ISystemFilterReference)selected).getReferencedFilter().isPromptable() )
|
||||
enable = false;
|
||||
}
|
||||
else if (selected instanceof ISystemPromptableObject)
|
||||
enable = false;
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
/* OLD RELEASE 1 CODE
|
||||
IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
|
||||
String perspectiveSetting =
|
||||
store.getString(IWorkbenchPreferenceConstants.OPEN_NEW_PERSPECTIVE);
|
||||
runWithPerspectiveValue(desc, perspectiveSetting);
|
||||
*/
|
||||
OpenInNewWindowAction workbenchOpenAction = // NEW FOR RELEASE 2
|
||||
new OpenInNewWindowAction(window,getPageInput());
|
||||
workbenchOpenAction.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the page input.
|
||||
*
|
||||
* @param input the page input
|
||||
*/
|
||||
public void setPageInput(IAdaptable input)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Get the page input.
|
||||
* Will use explicitly set input if given, else deduces from selection
|
||||
*/
|
||||
public IAdaptable getPageInput()
|
||||
{
|
||||
//if (pageInput != null) safer to always recalculate!
|
||||
// return pageInput;
|
||||
//else
|
||||
{
|
||||
Object firstSel = getFirstSelection();
|
||||
if ((firstSel != null) && (firstSel instanceof IAdaptable))
|
||||
return (IAdaptable)firstSel;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.rse.core.SystemPerspectiveHelpers;
|
||||
|
||||
|
||||
/**
|
||||
* Open the RSE perspective (used in welcome.xml)
|
||||
*/
|
||||
public class SystemOpenRSEPerspectiveAction extends Action {
|
||||
|
||||
|
||||
public SystemOpenRSEPerspectiveAction()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
SystemPerspectiveHelpers.openRSEPerspective();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,350 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.core.runtime.jobs.MultiRule;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
|
||||
import org.eclipse.rse.ui.view.ISystemDragDropAdapter;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.rse.ui.view.SystemDNDTransferRunnable;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.dnd.FileTransfer;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.PluginTransfer;
|
||||
import org.eclipse.ui.part.PluginTransferData;
|
||||
import org.eclipse.ui.part.ResourceTransfer;
|
||||
|
||||
|
||||
/**
|
||||
* Paste resources in system clipboard to the selected resource action.
|
||||
*/
|
||||
public class SystemPasteFromClipboardAction extends SystemBaseAction implements ISystemMessages, IValidatorRemoteSelection
|
||||
{
|
||||
|
||||
|
||||
private int _srcType;
|
||||
private Object _selection;
|
||||
private Clipboard _clipboard;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemPasteFromClipboardAction(Shell shell, Clipboard clipboard)
|
||||
{
|
||||
super(SystemResources.ACTION_PASTE_LABEL,
|
||||
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
|
||||
//SystemPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_PASTE_ID),
|
||||
shell);
|
||||
_clipboard = clipboard;
|
||||
_srcType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
|
||||
setEnabled(false);
|
||||
|
||||
allowOnMultipleSelection(false);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
|
||||
setHelp(SystemPlugin.HELPPREFIX + "actn0117");
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
if (_selection != null)
|
||||
{
|
||||
pasteClipboardToSelection(_selection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void pasteClipboardToSelection(Object target)
|
||||
{
|
||||
List srcObjects = SystemPlugin.getTheSystemRegistry().getSystemClipboardObjects(_srcType);
|
||||
if (srcObjects.size() > 0)
|
||||
{
|
||||
// do the transfer
|
||||
SystemDNDTransferRunnable runnable = new SystemDNDTransferRunnable(target, (ArrayList)srcObjects, getViewer(), _srcType);
|
||||
if (target instanceof IAdaptable)
|
||||
{
|
||||
ISystemDragDropAdapter targetAdapter = (ISystemDragDropAdapter) ((IAdaptable) target).getAdapter(ISystemDragDropAdapter.class);
|
||||
|
||||
if (targetAdapter != null)
|
||||
{
|
||||
ISubSystem targetSubSystem = targetAdapter.getSubSystem(target);
|
||||
List rulesList = new ArrayList();
|
||||
int j = 0;
|
||||
for (int i = 0; i < srcObjects.size(); i++)
|
||||
{
|
||||
if (srcObjects.get(i) instanceof ISchedulingRule)
|
||||
{
|
||||
rulesList.add(srcObjects.get(i));
|
||||
j++;
|
||||
}
|
||||
/** FIXME - IREmoteFile is systems.core independent now
|
||||
else if (srcObjects.get(i) instanceof IRemoteFile)
|
||||
{
|
||||
rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)srcObjects.get(i)));
|
||||
j++;
|
||||
}
|
||||
**/
|
||||
}
|
||||
if (target instanceof ISchedulingRule)
|
||||
{
|
||||
rulesList.add(target);
|
||||
}
|
||||
/** FIXME - IREmoteFile is systems.core independent now
|
||||
else if (target instanceof IRemoteFile)
|
||||
{
|
||||
rulesList.add(new RemoteFileSchedulingRule((IRemoteFile)target));
|
||||
}
|
||||
*/
|
||||
else
|
||||
{
|
||||
rulesList.add(targetSubSystem);
|
||||
}
|
||||
|
||||
ISchedulingRule[] rules = (ISchedulingRule[])rulesList.toArray(new ISchedulingRule[rulesList.size()]);
|
||||
MultiRule rule = new MultiRule(rules);
|
||||
//runnable.setRule(rule);
|
||||
}
|
||||
}
|
||||
runnable.schedule();
|
||||
SystemPlugin.getTheSystemRegistry().clearRunnableContext();
|
||||
}
|
||||
// clear clipboard
|
||||
// _clipboard.setContents(new Object[] { null }, new Transfer[] { PluginTransfer.getInstance()});
|
||||
// setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The user has selected a remote object. Return null if OK is to be enabled, or a SystemMessage
|
||||
* if it is not to be enabled. The message will be displayed on the message line.
|
||||
* <p>
|
||||
* This is overridden in SystemMoveRemoteFileAction
|
||||
*/
|
||||
public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean hasSource()
|
||||
{
|
||||
synchronized (_clipboard)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object object = _clipboard.getContents(PluginTransfer.getInstance());
|
||||
if (object != null)
|
||||
{
|
||||
if (object instanceof PluginTransferData)
|
||||
{
|
||||
PluginTransferData data = (PluginTransferData) object;
|
||||
byte[] result = data.getData();
|
||||
if (result != null)
|
||||
{
|
||||
_srcType = SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// clipboard must have resources or files
|
||||
ResourceTransfer resTransfer = ResourceTransfer.getInstance();
|
||||
object = _clipboard.getContents(resTransfer);
|
||||
if (object != null)
|
||||
{
|
||||
IResource[] resourceData = (IResource[]) object;
|
||||
if (resourceData.length > 0)
|
||||
{
|
||||
_srcType = SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FileTransfer fileTransfer = FileTransfer.getInstance();
|
||||
object = _clipboard.getContents(fileTransfer);
|
||||
|
||||
if (object != null)
|
||||
{
|
||||
String[] fileData = (String[]) object;
|
||||
if (fileData.length > 0)
|
||||
{
|
||||
_srcType = SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TextTransfer textTransfer = TextTransfer.getInstance();
|
||||
object = _clipboard.getContents(textTransfer);
|
||||
|
||||
if (object != null)
|
||||
{
|
||||
//String textData = (String) object;
|
||||
_srcType = SystemDNDTransferRunnable.SRC_TYPE_TEXT;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* We override from parent to do unique checking...
|
||||
* <p>
|
||||
* We simply ensure every selected object is an IRemoteFile
|
||||
* <p>
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
if (hasSource())
|
||||
{
|
||||
boolean enable = true;
|
||||
Iterator e = ((IStructuredSelection) selection).iterator();
|
||||
while (enable && e.hasNext())
|
||||
{
|
||||
Object selectedObject = e.next();
|
||||
if (selectedObject instanceof IAdaptable)
|
||||
{
|
||||
IAdaptable adaptable = (IAdaptable) selectedObject;
|
||||
ISystemDragDropAdapter va = (ISystemDragDropAdapter) (adaptable.getAdapter(ISystemDragDropAdapter.class));
|
||||
if (va != null)
|
||||
{
|
||||
enable = va.canDrop(selectedObject);
|
||||
/* to allow disable of paste
|
||||
* not sure if this is a performance hit or not
|
||||
if (enable)
|
||||
{
|
||||
SubSystem tgtSS = va.getSubSystem(selectedObject);
|
||||
List srcObjects = getClipboardObjects();
|
||||
if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
|
||||
{
|
||||
|
||||
for (int i = 0; i < srcObjects.size() && enable; i++)
|
||||
{
|
||||
Object srcObject = srcObjects.get(i);
|
||||
ISystemDragDropAdapter srcAdapter = (ISystemDragDropAdapter)((IAdaptable)srcObject).getAdapter(ISystemDragDropAdapter.class);
|
||||
SubSystem srcSS = srcAdapter.getSubSystem(srcObject);
|
||||
boolean sameSystem = (srcSS == tgtSS);
|
||||
enable = va.validateDrop(srcObject, selectedObject, sameSystem);
|
||||
}
|
||||
}
|
||||
else if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE)
|
||||
{
|
||||
for (int i = 0; i < srcObjects.size() && enable; i++)
|
||||
{
|
||||
Object srcObject = srcObjects.get(i);
|
||||
boolean sameSystem = false;
|
||||
enable = va.validateDrop(srcObject, selectedObject, sameSystem);
|
||||
}
|
||||
}
|
||||
else if (_srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
|
||||
{
|
||||
for (int i = 0; i < srcObjects.size() && enable; i++)
|
||||
{
|
||||
Object srcObject = srcObjects.get(i);
|
||||
boolean sameSystem = false;
|
||||
enable = va.validateDrop(srcObject, selectedObject, sameSystem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
if (enable)
|
||||
{
|
||||
_selection = selection.getFirstElement();
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected IRunnableContext getRunnableContext(Shell shell)
|
||||
{
|
||||
IRunnableContext irc = SystemPlugin.getTheSystemRegistry().getRunnableContext();
|
||||
if (irc != null)
|
||||
{
|
||||
return irc;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
// for other cases, use statusbar
|
||||
IWorkbenchWindow win = SystemPlugin.getActiveWorkbenchWindow();
|
||||
if (win != null)
|
||||
{
|
||||
Shell winShell = SystemPlugin.getActiveWorkbenchShell();
|
||||
if (winShell != null && !winShell.isDisposed() && winShell.isVisible())
|
||||
{
|
||||
SystemPlugin.logInfo("Using active workbench window as runnable context");
|
||||
shell = winShell;
|
||||
return win;
|
||||
}
|
||||
else
|
||||
{
|
||||
win = null;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
irc = new ProgressMonitorDialog(shell);
|
||||
SystemPlugin.getTheSystemRegistry().setRunnableContext(shell, irc);
|
||||
return irc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
|
||||
import org.eclipse.rse.model.ISystemPreferenceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action is a shortcut to the preferences setting for showing connection names
|
||||
* qualified by profile name.
|
||||
*/
|
||||
public class SystemPreferenceQualifyConnectionNamesAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
private ISystemRegistry sr = null;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemPreferenceQualifyConnectionNamesAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_QUALIFY_CONNECTION_NAMES_LABEL,SystemResources.ACTION_QUALIFY_CONNECTION_NAMES_TOOLTIP,
|
||||
parent);
|
||||
setSelectionSensitive(false);
|
||||
allowOnMultipleSelection(true);
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
setChecked(sr.getQualifiedHostNames());
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0008");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
boolean newState = isChecked();
|
||||
sr.setQualifiedHostNames(newState);
|
||||
firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_QUALIFYCONNECTIONNAMES,
|
||||
!newState,newState); // defect 41794
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire a preference change event
|
||||
*/
|
||||
private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
|
||||
{
|
||||
SystemPlugin.getDefault().getSystemRegistry().fireEvent(
|
||||
new SystemPreferenceChangeEvent(type,
|
||||
oldValue ? Boolean.TRUE : Boolean.FALSE,
|
||||
newValue ? Boolean.TRUE : Boolean.FALSE));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.SystemPreferencesManager;
|
||||
import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
|
||||
import org.eclipse.rse.model.ISystemPreferenceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action is a shortcut to the preferences setting for restoring the RSE to its
|
||||
* previous state.
|
||||
*/
|
||||
public class SystemPreferenceRestoreStateAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
private ISystemRegistry sr = null;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemPreferenceRestoreStateAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_RESTORE_STATE_PREFERENCE_LABEL,SystemResources.ACTION_RESTORE_STATE_PREFERENCE_TOOLTIP, parent);
|
||||
setSelectionSensitive(false);
|
||||
allowOnMultipleSelection(true);
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
setChecked(SystemPreferencesManager.getPreferencesManager().getRememberState());
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"aprefres");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
boolean newState = isChecked();
|
||||
SystemPreferencesManager.getPreferencesManager().setRememberState(newState);
|
||||
firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_RESTORESTATE,
|
||||
!newState,newState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire a preference change event
|
||||
*/
|
||||
private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
|
||||
{
|
||||
SystemPlugin.getDefault().getSystemRegistry().fireEvent(
|
||||
new SystemPreferenceChangeEvent(type,
|
||||
oldValue ? Boolean.TRUE : Boolean.FALSE,
|
||||
newValue ? Boolean.TRUE : Boolean.FALSE));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.SystemPreferencesManager;
|
||||
import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
|
||||
import org.eclipse.rse.model.ISystemPreferenceChangeEvents;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to decide whether or not to show filter pools in the remote systems explorer.
|
||||
* It is a fastpath/convenience method for this option in the preferences page.
|
||||
*/
|
||||
public class SystemPreferenceShowFilterPoolsAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
//private SystemRegistry sr = null;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemPreferenceShowFilterPoolsAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_PREFERENCE_SHOW_FILTERPOOLS_LABEL,SystemResources.ACTION_PREFERENCE_SHOW_FILTERPOOLS_TOOLTIP,
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setChecked(SystemPreferencesManager.getPreferencesManager().getShowFilterPools());
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0011");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
boolean newState = isChecked();
|
||||
SystemPreferencesManager.getPreferencesManager().setShowFilterPools(newState);
|
||||
firePreferenceChangeEvent(ISystemPreferenceChangeEvents.EVENT_SHOWFILTERPOOLS,
|
||||
!newState,newState); // defect 41794
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire a preference change event
|
||||
*/
|
||||
private void firePreferenceChangeEvent(int type, boolean oldValue, boolean newValue)
|
||||
{
|
||||
SystemPlugin.getDefault().getSystemRegistry().fireEvent(
|
||||
new SystemPreferenceChangeEvent(type,
|
||||
oldValue ? Boolean.TRUE : Boolean.FALSE,
|
||||
newValue ? Boolean.TRUE : Boolean.FALSE));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.core.SystemPreferencesManager;
|
||||
import org.eclipse.rse.core.SystemType;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.ui.dialogs.SystemUserIdPerSystemTypeDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* A selectable system type overall default userId action.
|
||||
*/
|
||||
public class SystemPreferenceUserIdPerSystemTypeAction extends SystemBaseDialogAction
|
||||
|
||||
{
|
||||
|
||||
private SystemType systemType;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemPreferenceUserIdPerSystemTypeAction(Shell parent, SystemType systemType)
|
||||
{
|
||||
super(systemType.getName()+"...",null,parent);
|
||||
this.systemType = systemType;
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0010");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
return enable;
|
||||
}
|
||||
|
||||
/*
|
||||
* Override of parent
|
||||
* @see #run()
|
||||
*/
|
||||
protected Dialog createDialog(Shell parent)
|
||||
{
|
||||
return new SystemUserIdPerSystemTypeDialog(parent, systemType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by parent. We use it to return the userId. Note the actual update is done!
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
String userId = null;
|
||||
SystemUserIdPerSystemTypeDialog uidDlg = (SystemUserIdPerSystemTypeDialog)dlg;
|
||||
if (!uidDlg.wasCancelled())
|
||||
{
|
||||
userId = uidDlg.getUserId();
|
||||
SystemPreferencesManager.getPreferencesManager().setDefaultUserId(systemType.getName(), userId);
|
||||
SystemPlugin.getTheSystemRegistry().fireEvent(ISystemResourceChangeEvents.PROPERTYSHEET_UPDATE_EVENT);
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,224 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.internal.model.SystemProfileManager;
|
||||
import org.eclipse.rse.model.IHost;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemProfileManager;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.rse.ui.dialogs.SystemCopyProfileDialog;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A copy profile action. Will copy the profile, and all connections for the profile.
|
||||
* We must first prompt user for a new name for the copied profile.
|
||||
*/
|
||||
public class SystemProfileNameCopyAction extends SystemBaseDialogAction
|
||||
implements ISystemMessages, IRunnableWithProgress
|
||||
{
|
||||
private ISystemProfile profile, newProfile;
|
||||
private ISystemProfileManager mgr;
|
||||
private ISystemRegistry sr;
|
||||
private String oldName,newName;
|
||||
private boolean makeActive;
|
||||
private Exception runException = null;
|
||||
|
||||
/**
|
||||
* Constructor for selection-sensitive popup menu for profiles in Team view.
|
||||
*/
|
||||
public SystemProfileNameCopyAction(Shell shell)
|
||||
{
|
||||
super(SystemResources.ACTION_PROFILE_COPY_LABEL, SystemResources.ACTION_PROFILE_COPY_TOOLTIP,
|
||||
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
|
||||
shell);
|
||||
mgr = SystemProfileManager.getSystemProfileManager();
|
||||
sr = SystemPlugin.getTheSystemRegistry();
|
||||
setSelectionSensitive(true);
|
||||
allowOnMultipleSelection(false);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actndupr");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the profile
|
||||
*/
|
||||
public void setProfile(ISystemProfile profile)
|
||||
{
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override of parent
|
||||
* @see #run()
|
||||
*/
|
||||
protected Dialog createDialog(Shell parent)
|
||||
{
|
||||
return new SystemCopyProfileDialog(parent, profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by parent. We use it to return the new name
|
||||
*/
|
||||
protected Object getDialogValue(Dialog dlg)
|
||||
{
|
||||
newName = null;
|
||||
SystemCopyProfileDialog rnmDlg = (SystemCopyProfileDialog)dlg;
|
||||
if (!rnmDlg.wasCancelled())
|
||||
{
|
||||
oldName = profile.getName();
|
||||
newName = rnmDlg.getNewName();
|
||||
makeActive = rnmDlg.getMakeActive();
|
||||
IRunnableContext runnableContext = getRunnableContext();
|
||||
try
|
||||
{
|
||||
runnableContext.run(false,false,this); // inthread, cancellable, IRunnableWithProgress
|
||||
if (makeActive && (newProfile!=null))
|
||||
sr.setSystemProfileActive(newProfile, true);
|
||||
}
|
||||
catch (java.lang.reflect.InvocationTargetException exc) // unexpected error
|
||||
{
|
||||
showOperationMessage(exc, getShell());
|
||||
//throw (Exception) exc.getTargetException();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
showOperationMessage(exc, getShell());
|
||||
//throw exc;
|
||||
}
|
||||
}
|
||||
return newName;
|
||||
}
|
||||
/**
|
||||
* Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with
|
||||
* a progress monitor in it, we will use this, else we will create a progress monitor dialog.
|
||||
*/
|
||||
protected IRunnableContext getRunnableContext()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
IRunnableContext irc = sr.getRunnableContext();
|
||||
if (irc == null)
|
||||
irc = new ProgressMonitorDialog(getShell());
|
||||
return irc;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------
|
||||
// INTERNAL METHODS...
|
||||
// ----------------------------------
|
||||
/**
|
||||
* Method required by IRunnableWithProgress interface.
|
||||
* Allows execution of a long-running operation modally by via a thread.
|
||||
* In our case, it runs the copy operation with a visible progress monitor
|
||||
*/
|
||||
public void run(IProgressMonitor monitor)
|
||||
throws java.lang.reflect.InvocationTargetException,
|
||||
java.lang.InterruptedException
|
||||
{
|
||||
String msg = getCopyingMessage(oldName,newName);
|
||||
runException = null;
|
||||
|
||||
try
|
||||
{
|
||||
int steps = 0;
|
||||
IHost[] conns = sr.getHostsByProfile(profile);
|
||||
if ((conns != null) && (conns.length > 0))
|
||||
steps = conns.length;
|
||||
steps += 2; // for filterpools and subsystems
|
||||
monitor.beginTask(msg, steps);
|
||||
newProfile = sr.copySystemProfile(monitor, profile,newName,makeActive);
|
||||
monitor.done();
|
||||
}
|
||||
catch(java.lang.InterruptedException exc)
|
||||
{
|
||||
monitor.done();
|
||||
runException = exc;
|
||||
throw (java.lang.InterruptedException)runException;
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
monitor.done();
|
||||
runException = new java.lang.reflect.InvocationTargetException(exc);
|
||||
throw (java.lang.reflect.InvocationTargetException)runException;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper method to return the message "Copying &1 to &2..."
|
||||
*/
|
||||
public static String getCopyingMessage(String oldName, String newName)
|
||||
{
|
||||
SystemMessage msg = SystemPlugin.getPluginMessage(MSG_COPY_PROGRESS);
|
||||
msg.makeSubstitution(oldName,newName);
|
||||
return msg.getLevelOneText();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to show an error message resulting from the attempted operation.
|
||||
*/
|
||||
protected void showOperationMessage(Exception exc, Shell shell)
|
||||
{
|
||||
if (exc instanceof java.lang.InterruptedException)
|
||||
showOperationCancelledMessage(shell);
|
||||
else if (exc instanceof java.lang.reflect.InvocationTargetException)
|
||||
showOperationErrorMessage(shell, ((java.lang.reflect.InvocationTargetException)exc).getTargetException());
|
||||
else
|
||||
showOperationErrorMessage(shell, exc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an error message when the operation fails.
|
||||
* Shows a common message by default.
|
||||
* Overridable.
|
||||
*/
|
||||
protected void showOperationErrorMessage(Shell shell, Throwable exc)
|
||||
{
|
||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, SystemPlugin.getPluginMessage(MSG_OPERATION_FAILED).makeSubstitution(exc.getMessage()));
|
||||
msgDlg.open();
|
||||
SystemBasePlugin.logError("Copy profile operation failed",exc);
|
||||
}
|
||||
/**
|
||||
* Show an error message when the user cancels the operation.
|
||||
* Shows a common message by default.
|
||||
* Overridable.
|
||||
*/
|
||||
protected void showOperationCancelledMessage(Shell shell)
|
||||
{
|
||||
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, SystemPlugin.getPluginMessage(MSG_OPERATION_CANCELLED));
|
||||
msgDlg.open();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.internal.model.SystemProfileManager;
|
||||
import org.eclipse.rse.model.ISystemProfile;
|
||||
import org.eclipse.rse.model.ISystemProfileManager;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* A selectable profile name action.
|
||||
*/
|
||||
public class SystemProfileNameSelectAction extends SystemBaseAction
|
||||
|
||||
{
|
||||
|
||||
private ISystemProfile profile;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemProfileNameSelectAction(Shell parent, ISystemProfile profile)
|
||||
{
|
||||
super(profile.getName(),parent);
|
||||
this.profile = profile;
|
||||
ISystemProfileManager mgr = SystemProfileManager.getSystemProfileManager();
|
||||
setChecked(mgr.isSystemProfileActive(profile.getName()));
|
||||
setSelectionSensitive(false);
|
||||
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0004");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
sr.setSystemProfileActive(profile, isChecked());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* 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:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.actions;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.SystemPlugin;
|
||||
import org.eclipse.rse.model.ISystemContainer;
|
||||
import org.eclipse.rse.model.ISystemRegistry;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||
import org.eclipse.rse.ui.SystemResources;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* The action allows users to refresh the selected node in the Remote Systems Explorer tree view
|
||||
*/
|
||||
public class SystemRefreshAction extends SystemBaseAction
|
||||
//
|
||||
{
|
||||
private IStructuredSelection _selection = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public SystemRefreshAction(Shell parent)
|
||||
{
|
||||
super(SystemResources.ACTION_REFRESH_LABEL, SystemResources.ACTION_REFRESH_TOOLTIP,
|
||||
SystemPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_REFRESH_ID), // D54577
|
||||
parent);
|
||||
allowOnMultipleSelection(true);
|
||||
setContextMenuGroup(ISystemContextMenuConstants.GROUP_BUILD);
|
||||
setHelp(SystemPlugin.HELPPREFIX+"actn0017");
|
||||
setAvailableOffline(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SystemBaseAction#updateSelection(IStructuredSelection)
|
||||
*/
|
||||
public boolean updateSelection(IStructuredSelection selection)
|
||||
{
|
||||
boolean enable = true;
|
||||
_selection = selection;
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when the user selects this action.
|
||||
* @see org.eclipse.jface.action.Action#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
ISystemRegistry sr = SystemPlugin.getTheSystemRegistry();
|
||||
if (_selection != null)
|
||||
{
|
||||
Iterator iter = _selection.iterator();
|
||||
while(iter.hasNext())
|
||||
{
|
||||
Object obj = iter.next();
|
||||
|
||||
if (obj instanceof ISystemContainer)
|
||||
{
|
||||
((ISystemContainer)obj).markStale(true);
|
||||
}
|
||||
sr.fireEvent(new SystemResourceChangeEvent(obj, ISystemResourceChangeEvents.EVENT_REFRESH, obj));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener))
|
||||
{
|
||||
sr.fireEvent((ISystemResourceChangeListener)viewer,
|
||||
new SystemResourceChangeEvent(sr,
|
||||
ISystemResourceChangeEvents.EVENT_REFRESH_SELECTED, null));
|
||||
}
|
||||
else
|
||||
sr.fireEvent(new SystemResourceChangeEvent(sr, ISystemResourceChangeEvents.EVENT_REFRESH_SELECTED, null));
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue