[172651] isv docs updated with removal of rse popup menus and rse property pages extension points
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||
<title>Plugging In Popup Menu Actions</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>Plugging In Popup Menu Actions</h1>
|
||||
<p>The <samp><A href="../../reference/extension-points/org_eclipse_rse_ui_popupMenus.html">org.eclipse.rse.ui.popupMenus</a></samp> extension point is defined in the
|
||||
plugin <samp>org.eclipse.rse.ui</samp>, and it is patterned
|
||||
after Eclipse's <samp>org.eclipse.ui.popupMenus</samp> extension point. However, it is
|
||||
both simplified and extended specifically for remote objects.
|
||||
</p>
|
||||
<p>The primary element in the markup for this extension point is the <b><samp><objectContribution></samp></b> element,
|
||||
which scopes the remote objects to which the child elements apply:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>id</b>.A unique ID for this extension point. Not used, but required by Eclipse.
|
||||
<li><b><i>filtering attributes</i></b>.To scope which remote objects these actions should show up for.
|
||||
Described in the <samp><A href="../../reference/extension-points/org_eclipse_rse_ui_popupMenus.html">documentation</a></samp>
|
||||
of this element.
|
||||
</ul>
|
||||
<p>Within each <samp><objectContribution></samp> element are zero or more <B><samp><menu></samp></B> elements for
|
||||
optionally defining cascading submenus, and <<B>action</B>> elements for the actual actions.
|
||||
To have the actions show up in a cascading menu, use the <samp><menu></samp> element with these
|
||||
attributes:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>id</b>. Unique id for the submenu. Used later to target actions into this cascading submenu.
|
||||
<li><b>label</b>. The text the user sees in the pop-up menu.
|
||||
<li><b>path</b>. For multi-cascading menus, use this attribute to identify a previously specified menu that
|
||||
this menu is to be nested within. The syntax is a bit tricky. It is <samp>id/group</samp>, where <samp>id</samp>
|
||||
matches the id attribute from a previous <samp><menu></samp> element, and <samp>group</samp> matches the name attribute
|
||||
of a <samp><separator></samp> sub-element within that previous <samp><menu></samp> element. For multi-nesting, repeat the <samp>id</samp>
|
||||
part, as in <samp>id1/id2/id3/group</samp>. In this case, there must be a <samp><menu></samp> element with and id value of
|
||||
<samp>id3</samp> that refers to another <samp><menu></samp> element <samp>id2</samp> via is path attribute, which in turn
|
||||
refers to <samp><menu></samp> element <samp>id1</samp> via its <samp>path</samp> attribute. If the group does not exist,
|
||||
it will be created.
|
||||
<br>
|
||||
For the root cascading menu, you can also use this to specify a group within the remote object's pop-up,
|
||||
for where to place this cascading menu. The default is the <samp>additions</samp> group, which is near the
|
||||
bottom of the pop-up menu. The RSE-supplied groups for pop-up menus are listed shortly in Table 4. There are
|
||||
also a few RSE-supplied cascading menus listed in Table 4, which can be specified for the id prefix in order
|
||||
to add a cascading menu to an RSE-supplied cascading menu.
|
||||
</ul>
|
||||
<P>Within each <samp><menu></samp> element are one or more <b><samp><separator></samp></b> elements that partition the cascading
|
||||
menu into groups. Groups are simply named physical areas of the menu. The order in which they are defined is the order they
|
||||
appear in the menu. Actions always go into groups. Groups avoid the need to specify relative information to identify where
|
||||
within a pop-up menu to place actions. There is only one attribute for this element:
|
||||
</P>
|
||||
<ul>
|
||||
<li><b>name</b>. The name to give this group. Users do not see this, but it is used in the <samp>action</samp> element to identify where to place
|
||||
the action within this submenu. Groups exist in the order they are defined, top to bottom. Between groups is a separator unless
|
||||
contiguous groups are empty. There is always a default group named <samp>additions</samp> supplied for you.
|
||||
</ul>
|
||||
<p>Finally, within <samp><objectContribution></samp> elements are one or more <b><samp><action></samp></b> elements identifying the
|
||||
actual actions, each of which only show up if the scoping criteria is met for that parent <samp><objectContribution></samp>
|
||||
element. The attributes for <samp><action></samp> elements are:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>id</b>. Unique id for the action.
|
||||
<li><b>label</b>. What the user sees in the pop-up menu.
|
||||
<li><b>icon</b>. Optional icon to show beside the label. This is the name of a file qualified by a path relative to this plugin's directory.
|
||||
<li><b>class</b>. Name of the class extending one of the classes listed in the documentation.
|
||||
<li><b>menubarPath</b>. Where to put this action. This is optional and only required when you do not want the action to go into the
|
||||
default location within the remote object's pop-up menu. This is a group name, optionally preceded by slash-delimited Ids for actions
|
||||
that go inside cascading menus, where each Id matches an id attribute from a previously specified <samp><menu></samp> element.
|
||||
If no menubarPath is specified, the action goes into the <samp><additions></samp> area of the object's popup menu, which is
|
||||
near the bottom of the pop-up menu. The RSE-supplied groups for remote object pop-up menus are listed in Table 4, as well as menu Ids
|
||||
for RSE-supplied cascading menus, should you wish to add an action to an RSE-supplied cascading menu.
|
||||
<li><b>enablesFor</b>. Tells when to enable this action based on how many items are selected. Typically, specify "1" for
|
||||
single-selection or "+" for multiple-selection. You can also change the enabled state of your action within your class,
|
||||
by calling the <samp>setEnabled(boolean)</samp> method or overriding the <samp>getEnabled(Object[] currentlySelected)</samp> method that is called
|
||||
when the selection changes.
|
||||
<li><b>state</b>. Specify if this is a toggle (checkable) menu item. Specify "true" or "false" to indicate initial
|
||||
toggle status. Call <samp>setChecked(boolean)</samp> in your class to change the toggled state.
|
||||
<li><b>helpContextId</b>. Allows F1 help for this action. Optional.
|
||||
</ul>
|
||||
<p>
|
||||
The <samp>path</samp> attribute for the <samp><menu></samp> element, and the <samp>menubarPath</samp> attribute for the <samp><action></samp>
|
||||
element, are the most difficult to master. The rules are reasonably simple though:
|
||||
</p>
|
||||
<ol>
|
||||
<li>To have your action show up in the initial pop-up menu, just specify a group name on the <samp>menubarPath</samp> attribute. That name can be
|
||||
one of the RSE-supplied group names defined in Table 4, or your own group name, which will be created and appended to the end of the
|
||||
pop-up menu. The default group is <samp>"additions"</samp>.
|
||||
<br>Example: <samp>menubarPath="myGroup"</samp>
|
||||
<li>To have your action show up in a simple RSE-supplied cascading menu within the pop-up menu, in your <samp><action></samp> element,
|
||||
specify the RSE-supplied menu ID from Table 4 in the <samp>menubarPath</samp> attribute, then a slash followed by the name of a group. The only
|
||||
RSE-supplied group for cascading menus is <samp>"additions"</samp>. If you specify anything else for the group, the group will be created for you
|
||||
at the bottom of the menu.
|
||||
<br>Example: <samp>menubarPath="menu.new/myGroup"</samp>
|
||||
<li>To have your action show up in a simple cascading menu of your own, first define the menu with a <samp><menu></samp> element,
|
||||
giving it an ID via the id attribute. In your <samp><action></samp> element, in the <samp>menubarPath</samp> attribute specify that id followed by a slash
|
||||
and then the name of a group. That group name can be one specified on a <samp><separator></samp> element within your menu, or a new name, which
|
||||
results in a new group at the bottom of the menu. In the latter case, there will be no separators delimiting the group, while in the former case
|
||||
there will be.
|
||||
<br>Example: <samp>menubarPath="myMenu1/myGroup"</samp>
|
||||
<li>To have your action show up in a multi-cascading menu of your own, define each of the menu via <samp><menu></samp> elements. For all but the
|
||||
first, identify the parent menu using the path attribute, specifying the Ids for each of the parent menus, slash-separated. At
|
||||
the end of the path attribute, specify the group within the final parent menu into which this menu will be placed. Again, this
|
||||
will either be a group defined with a <samp><separator></samp> element in the parent <samp>menu</samp> element, or specify a non-existing group that will be
|
||||
created for you. Once your multi-cascading menu is created, you identify it in your <samp><action></samp> element via the <samp>menubarPath</samp> attribute,
|
||||
specifying all the menu Ids up to the final menu, slash-separated, and then the group within that final menu, as usual.
|
||||
<br>Example: <samp>menubarPath="myMenu1/myMenu2/myGroup"</samp>
|
||||
</ol>
|
||||
|
||||
<h2>Programming Details</h2>
|
||||
<p>To use this extension point you will create a class that extends the
|
||||
<samp><A href="../../reference/api/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.html">SystemAbstractPopupMenuExtensionAction</A></samp> class in the
|
||||
package <samp><A href="../../reference/api/org/eclipse/rse/ui/actions/package-summary.html">org.eclipse.rse.ui.actions</A></samp>. This is your action class,
|
||||
and when the user selects your action, the <samp>run()</samp>
|
||||
method in your action class will be called. You will rarely extend the <samp>SystemAbstractPopupMenuExtensionAction</samp> base class
|
||||
directly, though. Instead there are subclasses of it that offer additional functionality for specific types of remote objects,
|
||||
as shown here:
|
||||
</p>
|
||||
|
||||
|
||||
<TABLE border="1">
|
||||
<TBODY>
|
||||
<TR>
|
||||
<TH>Base Class</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><samp><A href="../../reference/api/org/eclipse/rse/ui/actions/SystemAbstractPopupMenuExtensionAction.html">SystemAbstractPopupMenuExtensionAction</A></samp> in
|
||||
<samp>org.eclipse.rse.ui</samp> plugin</TD>
|
||||
<TD>Base class offering generic support for any remote object pop-up menu action, for any system type.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><samp><A href="../../reference/api/org/eclipse/rse/files/ui/actions/SystemAbstractRemoteFilePopupMenuExtensionAction.html">SystemAbstractRemoteFilePopupMenuExtensionAction</A></samp>
|
||||
in <samp>org.eclipse.rse.files.ui</samp> plugin</TD>
|
||||
<TD>Specialized base class offering specific support for any remote file object pop-up menu action, for any system type.</TD>
|
||||
</TR>
|
||||
</TBODY>
|
||||
</TABLE>
|
||||
|
||||
<br><hr>
|
||||
<p>See the <a href="../tutorial/popup.html">pop-up menu action tutorial</a> for a step-by-step example.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,77 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||
<title>Plugging In Property Pages</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>Plugging In Property Pages</h1>
|
||||
<p>The <samp><A href="../../reference/extension-points/org_eclipse_rse_ui_propertyPages.html">org.eclipse.rse.ui.propertyPages</a></samp> extension point is defined in the
|
||||
plugin <samp>org.eclipse.rse.ui</samp>, and it is patterned after Eclipse's <samp>org.eclipse.ui.propertyPages</samp> extension point, but both
|
||||
simplified and extended specifically for remote objects. <BR>
|
||||
What is a property page?
|
||||
It is a page that shows up in the Eclipse <A href="propertypage_figure2.gif">Properties dialog</A> that users
|
||||
get to by right-clicking on an object within any tree or table view, and selecting
|
||||
the <A href="propertypage_figure1.gif">Properties action</A>.</p>
|
||||
<p>Extenders supply one or more <samp><page></samp> elements within the beginning and ending <samp><extension></samp> element for this.
|
||||
The attributes of this <samp><page></samp> element are:</p>
|
||||
<ul>
|
||||
<li><b>id</b>. A unique ID for this extension point. Not actually used, but required by Eclipse.
|
||||
<li><b>name</b>. A translated node-name to show in the left tree view in the Eclipse-supplied
|
||||
Properties dialog that comes up when the user selects "Properties..." from the pop-up menu.
|
||||
<li><b>icon</b>. An optional icon to show in the Properties dialog for this property page.
|
||||
<li><b>class</b>. The fully qualified name of the class that implements the Eclipse interface
|
||||
<samp>org.Eclipse.ui.IWorkbenchPropertyPage</samp>. This is usually done by extending the Eclipse class
|
||||
<samp>org.Eclipse.ui.dialog.PropertyPage</samp>. Your class will populate the detail page on the right of the
|
||||
Eclipse-supplied Properties dialog when the node-name is selected in the left hand tree view.
|
||||
<li><b><i>filtering criteria</i></b>. To scope which remote objects these property pages should show up for,
|
||||
there are a series of filtering attributes. These attributes are identical to those in the <samp><A href="popup.html">pop-upMenus</A></samp>
|
||||
extension point. Providers supply as many as needed to uniquely identify their target objects. Every one of these
|
||||
values can be scalar or "simple generic", meaning it can start or end with an asterisk for pattern matching:
|
||||
<ul>
|
||||
<li><b>subsystemconfigurationid</b>. Restrict to remote objects originating from subsystems created by this subsystem factory.
|
||||
<li><b>typecategoryfilter</b>. Restrict to remote objects originating from subsystems created by a subsystem factory that specified this value for their category attribute
|
||||
<li><b>namefilter</b>. Restrict to remote objects matching this simple generic name
|
||||
<li><b>typefilter</b>. Restrict to remote objects matching this simple type filter. The "type" of any remote object is subsystem-determined.
|
||||
<li><b>subtypefilter</b>. Restrict to remote objects matching this simple sub-type filter. The "subtype" of any remote object is subsystem-determined.
|
||||
<li><b>subsubtypefilter</b>. Restrict to remote objects matching this simple sub-sub-type filter. The "sub-subtype" of any remote object is subsystem-determined.
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<h2>Programming Details</h2>
|
||||
<p>To use this extension point your class will typically extend one of the supplied base classes to
|
||||
make it easier to create these property pages for remote objects. The only method you must implement in these
|
||||
classes is <samp>createContents(Composite)</samp>, which populates the details page on the right side when the node is
|
||||
selected on the left side. The supplied classes are listed here:
|
||||
</p>
|
||||
|
||||
<TABLE border="1">
|
||||
<TBODY>
|
||||
<TR>
|
||||
<TH>Base Class</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><samp><A href="../../reference/api/org/eclipse/rse/ui/propertypages/SystemAbstractPropertyPageExtensionAction.html">SystemAbstractPropertyPageExtensionAction</A></samp>
|
||||
in <samp>org.eclipse.rse.ui</samp> plugin.</TD>
|
||||
<TD>Base class offering generic support for any remote object property page.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><samp><A href="../../reference/api/org/eclipse/rse/files/ui/propertypages/SystemAbstractRemoteFilePropertyPageExtensionAction.html">SystemAbstractRemoteFilePropertyPageExtensionAction</A></samp>
|
||||
in <samp>org.eclipse.rse.files.ui</samp> plugin.</TD>
|
||||
<TD>Specialized base class offering specific support for any remote file object property page.</TD>
|
||||
</TR>
|
||||
</TBODY>
|
||||
</TABLE>
|
||||
<p>
|
||||
</p>
|
||||
|
||||
<br><hr>
|
||||
<p>See the <a href="../tutorial/propertypage.html">property page tutorial</a> for a step-by-step example.</p>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.6 KiB |
|
@ -1,113 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||
<title>Creating a Remote Resource Popup Menu Action</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>Creating a Remote Resource pop-up Menu Action</h1>
|
||||
<p>In this tutorial, you will use the RSE <A href="../plugin/popup.html">pop-up menus
|
||||
extension point</A> to
|
||||
create a pop-up menu action that will appear
|
||||
in the context menu for any <samp>.jar</samp> file, for any connection to
|
||||
any system type. The action will be labeled "Show contents" and will simply
|
||||
run the <samp>jar -tvf</samp> JDK command when selected, displaying the results
|
||||
in the command console. You could expand this example to copy the file
|
||||
to a local temporary folder, extract the list of file names within the jar, and
|
||||
display those names in an Eclipse table view.
|
||||
</p>
|
||||
|
||||
<p><b>Tip:</b> If you prefer your Java code to use lined-up braces, select the
|
||||
first two options in the <b><A href="preferences_JavaFormatting.gif">Code
|
||||
Formatter</A></b> preferences page for <b>Java</b>, via <b>Windows->Preferences</b>.
|
||||
|
||||
This will affect code generated by wizards. The source code shown assumes this option has been set, but this is not required.
|
||||
|
||||
<h2>Step-by-Step: Creating an RSE Remote Resource Pop-up Menu Action</h2>
|
||||
|
||||
<ol>
|
||||
<li>If you have not already, first <a href="pdeProject.html">create or prepare a plugin project</a>.
|
||||
</li>
|
||||
<li>Open the <b>plugin.xml</b> file for editing by right-clicking on it and selecting
|
||||
<b>Open With->Text Editor</b>. Before the ending </plugin> statement, add the following lines:
|
||||
<pre><code>
|
||||
<!-- ======================================= -->
|
||||
<!-- Remote Object Popup Menu Actions -->
|
||||
<!-- ======================================= -->
|
||||
<extension point="org.eclipse.rse.ui.popupMenus">
|
||||
<objectContribution id="actions.jar"
|
||||
typecategoryfilter="files"
|
||||
typefilter="file"
|
||||
namefilter="*.jar">
|
||||
<action id="actions.jar.show"
|
||||
enablesFor="1"
|
||||
label="Show contents"
|
||||
tooltip="List contents of this file"
|
||||
class="samples.ui.actions.ShowJarContents">
|
||||
</action>
|
||||
</objectContribution>
|
||||
</extension>
|
||||
</code></pre>
|
||||
Save and close the file.
|
||||
</li>
|
||||
<li>
|
||||
Create the Java package: right-click on the <B>src</B> source folder and select <B>New->Package</B> to open the <B>New
|
||||
Java Package</B> wizard. Enter <B>"samples.ui.actions"</B> for the name of the package and press <B>Finish</B>.</li>
|
||||
<li>
|
||||
Create the Java class: right-click on the new <B>"samples.ui.actions"</B> package folder and select <B>New->Class</B> to open the <B>New
|
||||
Java Class</B> wizard. Enter <B>"ShowJarContents"</B> for the <b>Name</b>
|
||||
and <b>"org.eclipse.rse.files.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction"</b>
|
||||
for the <b>Superclass</b>. Select the <b>Constructors from superclass</b> check box, as shown
|
||||
<A href="popup_newClass.gif">here</A>.
|
||||
Press <b>Finish</b> to create the <samp><a href="ShowJarContents1.html">ShowJarContents</a></samp> class.
|
||||
</li>
|
||||
<li>Edit the generated <samp>ShowJarContents.java</samp> file as follows:
|
||||
<ol>
|
||||
<li type="i">Add the following three statements to the body of the <samp>run()</samp> method:</li>
|
||||
<pre><code>
|
||||
IRemoteFile selectedFile = getFirstSelectedRemoteFile();
|
||||
String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath();
|
||||
runCommand(cmdToRun);
|
||||
</code></pre>
|
||||
<li type="i">Add the following two methods to find the subsystem and run the command:</li>
|
||||
<pre><code>
|
||||
private void runCommand(String command) {
|
||||
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
|
||||
if (cmdss != null && cmdss.isConnected()) {
|
||||
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss);
|
||||
} else {
|
||||
MessageDialog.openError(getShell(), "No command subsystem", "Found no command subsystem");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Command subsystem associated with the current host
|
||||
*/
|
||||
private IRemoteCmdSubSystem getRemoteCmdSubSystem() {
|
||||
IHost myHost = getSubSystem().getHost();
|
||||
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
|
||||
for (int i = 0; i < subsys.length; i++) {
|
||||
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
|
||||
return subsys[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
</code></pre>
|
||||
<li type="i">User the "Source -> Organize Imports" context menu item to add the appropriate import statements.</li>
|
||||
</ol>
|
||||
The final result after editing is shown <a href="ShowJarContents2.html">here</a>.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>Thats it! Now, you can try your new action. Use <b>Run->Run As->Run-time Workbench</b>. Drill
|
||||
down in the RSE to a Jar file in a local or remote connection and right-click to <a href="popup_see.gif">see</a> and <a href="popup_run.gif">run</a> your new action. Notice
|
||||
how it does not appear for files that do not end with the ".jar" extension. This is because of the "namefilter" attribute
|
||||
in our extension point .xml file.
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 10 KiB |
|
@ -1,84 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||
<title>Creating a Remote Resource Property Page</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>Creating a Remote Resource Property Page</h1>
|
||||
<p>In this tutorial, you will use the RSE <A href="../plugin/propertypage.html">propertyPage
|
||||
extension point</A> to
|
||||
create a <a href="propertypage_run_done.gif">property page</a> that will appear
|
||||
in the Properties dialog for any folder, for any connection to
|
||||
any system type. The page will be labeled "Folder Contents" and will show the
|
||||
cumulative size of the contents of the folder, and the number of folders and files within it.
|
||||
This will show the extension point, plus how to use some of the RSE user interface helpers, as well
|
||||
as the remote file API for querying information about remote folders and files.
|
||||
</p>
|
||||
|
||||
<p><b>Tip:</b> If you prefer your Java code to use lined-up braces, select the
|
||||
first two options in the <b><A href="preferences_JavaFormatting.gif">Code
|
||||
Formatter</A></b> preferences page for <b>Java</b>, via <b>Windows->Preferences</b>.
|
||||
|
||||
This will affect code generated by wizards. The source code shown assumes this option has been set, but this is not required.
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Step-by-Step: Creating a Remote Resource Property Page</h2>
|
||||
<ol>
|
||||
<li>If you have not already, first <a href="pdeProject.html">create or prepare a plugin project</a>.
|
||||
|
||||
Open the <b>plugin.xml</b> file for editing by right-clicking on it, and selecting
|
||||
<b>Open With->Text Editor</b>. Before the ending </plugin> statement, add the following lines:
|
||||
<pre><code>
|
||||
<!-- ======================================= -->
|
||||
<!-- Remote Object Property Pages -->
|
||||
<!-- ======================================= -->
|
||||
<extension point="org.eclipse.rse.ui.propertyPages">
|
||||
<page name="Folder Contents"
|
||||
class="samples.ui.propertypages.FolderInfoPropertyPage"
|
||||
id="samples.ui.PropertyPage1"
|
||||
typefilter="folder"
|
||||
typecategoryfilter="files">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
</code></pre></li>
|
||||
<li>Save and close the file.</li>
|
||||
<li>
|
||||
Create the Java package: right-click on the <B>src</B> source folder and select <B>New->Package</B> to get the <B>New
|
||||
Java Package</B> wizard. Enter <B>"samples.ui.propertypages"</B> for the name of the package and press <B>Finish</B>.</li>
|
||||
<li>
|
||||
Create the Java class: right-click on the new <B>"samples.ui.propertypages"</B> package folder and select <B>New->Class</B> to open the <B>New
|
||||
Java Class</B> wizard. Enter <B>"FolderInfoPropertyPage"</B> for the <b>Name</b>
|
||||
and <b>"org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction"</b>
|
||||
for the <b>Superclass</b>. Select the <b>Constructors from superclass</b> check box, as shown
|
||||
<A href="propertypage_newClass.gif">here</A>.
|
||||
Press <b>Finish</b> to create the <samp><a href="FolderInfoPropertyPage1.html">FolderInfoPropertyPage</a></samp> class.
|
||||
</li>
|
||||
<li>Edit the <samp>FolderInfoPropertyPage</samp> class to look like <A href="FolderInfoPropertyPage2.html">this</A>. There are many changes, so you should use
|
||||
the clipboard to copy and paste.
|
||||
</li>
|
||||
<li>Edit the <samp>rseSamplesMesssage.xml</samp> file to look like <A href="rseSamplesMessages2.html">this</A>, where the changes are highlighted.
|
||||
</li>
|
||||
<li>Edit the <samp>rseSamplesResources.properties</samp> file to look like <A href="rseSamplesResources2.html">this</A>.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>Thats it! Now, you can try out your new property page. Use <b>Run->Run As->Run-time Workbench</b>. Drill
|
||||
down in the RSE to a folder in a local or remote connection and right-click to <a href="propertypage_see.gif">see</a>
|
||||
and <a href="propertypage_run_during.gif">run</a> your new property page. This sample is a unique case, in that this operation could potentially run for a long time, as you are recursively walking all
|
||||
the sub-folders and files to accumulate the size and count information. Because of this, we put this work
|
||||
in a background thread, and update the GUI as each sub-folder is processed. We also supply a stop button
|
||||
to the user and watch for them pressing Cancel or closing the dialog. When the thread ends, the
|
||||
result looks like <a href="propertypage_run_done.gif">this</a>.
|
||||
<p>Notice how this property page only appears for folders, due to the <b><samp>typefilter="folder"</samp></b> attribute
|
||||
in our extension point xml.
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 13 KiB |
|
@ -13,8 +13,8 @@
|
|||
<p>This section walks through the tutorials that demonstrate how to use the RSE <a href="Extensions.html">extension points</a> to
|
||||
extend the RSE:
|
||||
<ul>
|
||||
<li><a href="tutorial/popup.html">Creating a remote resource pop-up menu action</a> using the <a href="plugin/popup.html">org.eclipse.rse.core.popupMenus</a> extension point.
|
||||
<li><a href="tutorial/propertypage.html">Creating a remote resource property page</a> using the <a href="plugin/propertypage.html">org.eclipse.rse.core.propertyPages</a> extension point.
|
||||
<li>Popup menu actions for remote resources should now be contributed via the standard Eclipse extension point, <tt>org.eclipse.ui.popupMenus</tt>. An example of this usage is provided in the <tt>org.eclipse.rse.examples.tutorial</tt> plug-in.
|
||||
<li>Property pages should for remote resources now be contributed via the standard Eclipse extension point, <tt>org.eclipse.ui.propertyPages<tt>. An example of this usage is provided in the <tt>org.eclipse.rse.examples.tutorial</tt> plug-in.
|
||||
<li><a href="tutorial/subsystem.html">Creating a subsystem configuration</a> for working with remote resources, using the <a href="plugin/subsystem.html">org.eclipse.rse.core.subsystemConfigurations</a> extension point.
|
||||
</ul>
|
||||
<p>The source code for all tutorials is available in the RSE-examples package, which
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
<li><a href="org_eclipse_rse_ui_mountPathMappers.html">org.eclipse.rse.ui.mountPathMappers</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_newConnectionWizardDelegates.html">org.eclipse.rse.ui.newConnectionWizardDelegates</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_persistenceProviders.html">org.eclipse.rse.ui.persistenceProviders</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_popupMenus.html">org.eclipse.rse.ui.popupMenus</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_propertyPages.html">org.eclipse.rse.ui.propertyPages</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_remoteSystemsViewPreferencesActions.html">org.eclipse.rse.ui.remoteSystemsViewPreferencesActions</a></li>
|
||||
<li><a href="org_eclipse_rse_ui_subsystemConfigurations.html">org.eclipse.rse.ui.subsystemConfigurations</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
<topic label="org.eclipse.rse.ui.mountPathMappers" href="reference/extension-points/org_eclipse_rse_ui_mountPathMappers.html" />
|
||||
<topic label="org.eclipse.rse.ui.newConnectionWizardDelegates" href="reference/extension-points/org_eclipse_rse_ui_newConnectionWizardDelegates.html" />
|
||||
<topic label="org.eclipse.rse.ui.persistenceProviders" href="reference/extension-points/org_eclipse_rse_ui_persistenceProviders.html" />
|
||||
<topic label="org.eclipse.rse.ui.popupMenus" href="reference/extension-points/org_eclipse_rse_ui_popupMenus.html" />
|
||||
<topic label="org.eclipse.rse.ui.propertyPages" href="reference/extension-points/org_eclipse_rse_ui_propertyPages.html" />
|
||||
<topic label="org.eclipse.rse.ui.remoteSystemsViewPreferencesActions" href="reference/extension-points/org_eclipse_rse_ui_remoteSystemsViewPreferencesActions.html" />
|
||||
<topic label="org.eclipse.rse.ui.subsystemConfigurations" href="reference/extension-points/org_eclipse_rse_ui_subsystemConfigurations.html" />
|
||||
<anchor id="rse-extension-points-ref" />
|
||||
|
|