blob: f73c7fb320e11fee4307c57f200cd4ba317f352c [file] [log] [blame]
<!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, 2007. 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>RSE User Interface API</title>
</head>
<body bgcolor="#ffffff">
<h1>RSE User Interface API</h1>
<p>The RSE provides a number of classes that can help with programming productivity when authoring
user interface artifacts, such as actions, dialogs, wizards, property pages and preferences pages.
Further, a common requirement in all of these artifacts is the need to display translated messages
to the user. The RSE supplies a framework for defining and displaying rich messages that have second
level help, severity and ID attributes.
</p>
<p>
In the following sections we introduce the support offered by the RSE for these UI constructs.
<h2>Plugin Class</h2>
<p>The RSE supplies a base plugin class <samp><a href="plugin/uiPluginAPI.html">SystemBasePlugin</a></samp> that offers
some advantages over the base eclipse <samp>AbstractUIPlugin</samp> class:
<ol>
<li>Simplified methods for registering images, and support for retrieving them either as an image
or an image descriptor.
<li>Support for <a href="logger/uiLoggerAPI.html">logging</a> error, warning and information messages, using the RSE logging framework.
<li>Support for loading a resource bundle, and easily retrieving translated strings from it.
<li>Support for loading an RSE <a href="messages/uiMessageFile.html">message file</a>, and easily retrieving translated messages from it.
<li>Helper methods for getting the active workbench window and shell.
</ol>
</p>
<p>To use the base plugin class effectively, you must subclass it and supply some critical
methods of your own.
</p>
<h2>Logging</h2>
<p>The Remote System Explorer comes with special support for <a href="logger/uiLoggerAPI.html">logging information</a> to a log file,
for the purpose of problem determination for servicing your plugin. The log file support allows
you to either log your messages to the common RSE log file in the <samp>.metadata\plugins\org.eclipse.rse.core</samp>
folder, or to define your own log file in your plugin metadata folder, if desired.
</p>
<h2>Messages</h2>
<p>The Java property file for messages is not very rich, as it offers only the ability to define a
single message string. Throughout the RSE perspective you will notice that the messages are richer
than this. They contain second level help, severity, and ID and more. Further, there is a unique
error message dialog for displaying messages, with their second level help, and specialized support
in the RSE dialog, wizard and property page classes for displaying messages on a message line. These
messages can be selected by the user, to bring up the specialized message dialog displaying the
additional properties of the message. Further, there is support for logging severe errors to a log
file, enabling better service support.
</p>
<p>
Your own plugins can enjoy this rich message support too, even independently of using the rest of
the RSE for remote resource access. This support involves defining an xml
<a href="messages/uiMessageFile.html">message file</a>, which defines
the messages, and using a set of
<a href="messages/uiMessageAPI.html">supplied classes</a> to work with the messages.
</p>
<p>Before defining your own messages, you may wish to peruse the list of <a href="messages/uiMessagesCore.html">RSE-supplied messages</a> that are
already defined. The key benefit to using an existing message is translation, as these are already
translated into many languages.
</p>
<h2>Preference Pages</h2>
<p>When defining your own <a href="preferences/uiPreferencesAPI.html">preferences pages</a>,
you may want to place your preference pages within the Remote Systems preference page category.
As you author your preference page classes, you may find some of the RSE-supplied classes for
preference pages to be useful.
</p>
<h2>Property Pages</h2>
<p>Property pages can appear in the Properties dialog of any object in eclipse. This dialog is available by selecting
"Properties" from the pop-up menu for the object. The RSE supports defining your own
<a href="properties/uiPropertiesAPI.html">property pages</a> for the resources in its model, although there is a
distinction between local and remote resources.
</p>
<h2>Validators</h2>
<p>Validating user-entered text is a common and tedious task in any GUI programming. Using validators to encapsulate
the error checking for a particular type of data is a highly recommended practice. The
<a href="validators/uiValidatorsAPI.html">RSE validator</a> support is very
helpful for this, offering both a common interface for all manner of validators and a large list of pre-supplied
validators.
</p>
<h2>Massagers</h2>
<p>While validating user-entered text is common, so is affecting user-entered text prior to saving it. For example, folding it
to upper or lower case. The <a href="massagers/uiMassagersAPI.html">RSE massager</a> support encapsulates this concept, and
supplies a few re-usable massagers for you.
</p>
<h2>Widgets</h2>
<p>Populating preference pages, property pages, dialogs and wizards requires use of SWT widget programming. The RSE
<a href="widgets/uiWidgetsAPI.html">widget support</a> can help, with helper methods and classes, and re-usable widgets you may
find useful.
</p>
<h2>Dialogs</h2>
<p>The RSE supplies rich support for <a href="dialogs/uiDialogsAPI.html">dialogs</a>, including a powerful base class
and, re-usable pre-built dialogs.
</p>
<h2>Wizards</h2>
<p>Wizards are a common building block of an eclipse GUI. Typically, a wizard is used to prompt for information to create
something new, while a dialog is used to prompt for information for other purposes.
The RSE <a href="wizards/uiWizardsAPI.html">wizard support</a> includes base classes that can simplify the task of creating wizards.
</p>
<h2>Actions</h2>
<p>Populating popup and pulldown menu items requires the creation of actions. These actions typically popup dialogs or wizards,
and need to be able to pass selections and inputs from the action to the dialog or wizard, and get outputs back. The RSE
<a href="actions/uiActionsAPI.html">action support</a> can significantly help with this programming task, especially when used
together with the RSE dialog and wizard support.
</p>
<p>Often we want to refresh the contents of the Remote Systems view or Table view from within our actions, to visualize
changes to the selected resources. To do this, use the
<samp><A href="../../reference/api/org/eclipse/rse/core/model/ISystemRegistry.html#fireRemoteResourceChangeEvent(int, java.lang.Object, java.lang.Object, org.eclipse.rse.core.subsystems.ISubSystem, java.lang.String)">method</a></samp>.
To get the system registry, use the
<samp><A href="../../reference/api/org/eclipse/rse/core/model/SystemStartHere.html#getSystemRegistry()">method</a></samp>.
</p>
<p>At times, you may want to post events in a dispatch thread rather than using the
original client's thread; or you may need access to the System Clipboard.
Such operations are only possible when the UI
is loaded, and therefore you need to use
<samp><A href="../../reference/api/org/eclipse/rse/core/model/ISystemRegistry.html#fireRemoteResourceChangeEvent(int, java.lang.Object, java.lang.Object, org.eclipse.rse.core.subsystems.ISubSystem, java.lang.String, java.lang.Object)">ISystemRegistry.fireEvent()</a></samp>
method in that case. To get the system registry UI interface, use the
<samp><A href="../../reference/api/org/eclipse/rse/ui/RSEUIPlugin.html#getTheSystemRegistryUI()">RSEUIPlugin.getTheSystemRegistryUI()</a></samp>
method.
</p>
</body>
</html>