mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
[203124] Fix HTML errors in rse.doc.isv (patch by Olivier Thomann)
This commit is contained in:
parent
fcb877ed59
commit
bd2910e381
17 changed files with 943 additions and 942 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- ===================================================================== -->
|
<!-- ===================================================================== -->
|
||||||
<!-- Custom targets called from a project's generated build.xml -->
|
<!-- Custom targets called from a project's generated build.xml -->
|
||||||
<!-- Set customBuildCallbacks=<path/to/this/file> in your build.properties.-->
|
<!-- Set customBuildCallbacks=<path/to/this/file> in your build.properties.-->
|
||||||
|
|
|
@ -31,7 +31,7 @@ help simplify the creation of action classes, especially when used together with
|
||||||
|
|
||||||
<h2>RSE-Supplied Base Classes for Actions</h2>
|
<h2>RSE-Supplied Base Classes for Actions</h2>
|
||||||
<p>Here are the primary base classes the RSE supplies for actions, all of which are found in the
|
<p>Here are the primary base classes the RSE supplies for actions, all of which are found in the
|
||||||
package <samp><A href="../../../reference/api/org/eclipse/rse/ui/actions/package-summary.html"org.eclipse.rse.ui.actions</A></samp>
|
package <samp><A href="../../../reference/api/org/eclipse/rse/ui/actions/package-summary.html">org.eclipse.rse.ui.actions</A></samp>
|
||||||
in the plugin <samp>org.eclipse.rse.ui</samp>:</p>
|
in the plugin <samp>org.eclipse.rse.ui</samp>:</p>
|
||||||
<TABLE border="1">
|
<TABLE border="1">
|
||||||
<TBODY>
|
<TBODY>
|
||||||
|
|
|
@ -15,7 +15,7 @@ you use:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Static methods in the
|
<li>Static methods in the
|
||||||
<samp><A href="../../../reference/api/org/eclipse/rse/ui/SystemBasePlugin.html"org.eclipse.rse.ui.SystemBasePlugin</A></samp>
|
<samp><A href="../../../reference/api/org/eclipse/rse/ui/SystemBasePlugin.html">org.eclipse.rse.ui.SystemBasePlugin</A></samp>
|
||||||
class to load the message file and extract messages from it.
|
class to load the message file and extract messages from it.
|
||||||
<li>Classes in the
|
<li>Classes in the
|
||||||
<samp><A href="../../../reference/api/org/eclipse/rse/ui/messages/package-summary.html">org.eclipse.rse.ui.messages</A></samp>
|
<samp><A href="../../../reference/api/org/eclipse/rse/ui/messages/package-summary.html">org.eclipse.rse.ui.messages</A></samp>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<body bgcolor="#ffffff">
|
<body bgcolor="#ffffff">
|
||||||
<h1>Plugging In Property Pages</h1>
|
<h1>Plugging In Property Pages</h1>
|
||||||
<p>The <samp><a href="../../../org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_propertyPages.html">org.eclipse.ui.propertyPages</a></samp> extension point
|
<p>The <samp><a href="../../../org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_propertyPages.html">org.eclipse.ui.propertyPages</a></samp> extension point
|
||||||
from the base Eclipse Platform is used to contribute property pages.<BR/>
|
from the base Eclipse Platform is used to contribute property pages.<BR>
|
||||||
What is a property page?
|
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
|
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
|
get to by right-clicking on an object within any tree or table view, and selecting
|
||||||
|
|
|
@ -19,6 +19,7 @@ It provides an
|
||||||
<li><a href="rse_int_architecture.html">Architectural Overview</a>,</li>
|
<li><a href="rse_int_architecture.html">Architectural Overview</a>,</li>
|
||||||
<li><a href="usingAPIs.html">API Description</a> as well as some extensive</li>
|
<li><a href="usingAPIs.html">API Description</a> as well as some extensive</li>
|
||||||
<li><a href="tutorials.html">Tutorials</a></li>.
|
<li><a href="tutorials.html">Tutorials</a></li>.
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Provisional API</h2>
|
<h2>Provisional API</h2>
|
||||||
|
|
|
@ -1,210 +1,210 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
<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." >
|
<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">
|
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||||
<title>DeveloperFilterStringEditPane Class After Editing</title>
|
<title>DeveloperFilterStringEditPane Class After Editing</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>DeveloperFilterStringEditPane Class After Editing</h1>
|
<h1>DeveloperFilterStringEditPane Class After Editing</h1>
|
||||||
<pre><samp>
|
<pre><samp>
|
||||||
package samples.subsystems;
|
package samples.subsystems;
|
||||||
|
|
||||||
<strong>import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
<strong>import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||||
import org.eclipse.rse.ui.SystemWidgetHelpers;</strong>
|
import org.eclipse.rse.ui.SystemWidgetHelpers;</strong>
|
||||||
import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
|
import org.eclipse.rse.ui.filters.SystemFilterStringEditPane;
|
||||||
<strong>import org.eclipse.swt.events.ModifyEvent;
|
<strong>import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;</strong>
|
import org.eclipse.swt.widgets.Text;</strong>
|
||||||
|
|
||||||
<strong>import samples.RSESamplesPlugin;</strong>
|
<strong>import samples.RSESamplesPlugin;</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Our specialized filter string edit pane for developer filters.
|
* Our specialized filter string edit pane for developer filters.
|
||||||
*/
|
*/
|
||||||
public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane {
|
public class DeveloperFilterStringEditPane extends SystemFilterStringEditPane {
|
||||||
|
|
||||||
// gui widgets
|
// gui widgets
|
||||||
<strong>private Text textTeam, textDevr;</strong>
|
<strong>private Text textTeam, textDevr;</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for DeveloperFilterStringEditPane.
|
* Constructor for DeveloperFilterStringEditPane.
|
||||||
* @param shell - parent window
|
* @param shell - parent window
|
||||||
*/
|
*/
|
||||||
public DeveloperFilterStringEditPane(Shell shell)
|
public DeveloperFilterStringEditPane(Shell shell)
|
||||||
{
|
{
|
||||||
super(shell);
|
super(shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* This is where we populate the client area.
|
* This is where we populate the client area.
|
||||||
* @param parent - the composite that will be the parent of the returned client area composite
|
* @param parent - the composite that will be the parent of the returned client area composite
|
||||||
* @return Control - a client-area composite populated with widgets.
|
* @return Control - a client-area composite populated with widgets.
|
||||||
*
|
*
|
||||||
* @see org.eclipse.rse.ui.SystemWidgetHelpers
|
* @see org.eclipse.rse.ui.SystemWidgetHelpers
|
||||||
*/
|
*/
|
||||||
<strong>public Control createContents(Composite parent)
|
<strong>public Control createContents(Composite parent)
|
||||||
{
|
{
|
||||||
// Inner composite
|
// Inner composite
|
||||||
int nbrColumns = 1;
|
int nbrColumns = 1;
|
||||||
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
||||||
((GridLayout)composite_prompts.getLayout()).marginWidth = 0;
|
((GridLayout)composite_prompts.getLayout()).marginWidth = 0;
|
||||||
|
|
||||||
// CREATE TEAM-PARENT PROMPT
|
// CREATE TEAM-PARENT PROMPT
|
||||||
textTeam = SystemWidgetHelpers.createLabeledTextField(
|
textTeam = SystemWidgetHelpers.createLabeledTextField(
|
||||||
composite_prompts,
|
composite_prompts,
|
||||||
null,
|
null,
|
||||||
RSESamplesPlugin.getResourceString("filter.devr.teamprompt.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("filter.devr.teamprompt.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("filter.devr.teamprompt.tooltip") //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("filter.devr.teamprompt.tooltip") //$NON-NLS-1$
|
||||||
);
|
);
|
||||||
|
|
||||||
// CREATE DEVELOPER PROMPT
|
// CREATE DEVELOPER PROMPT
|
||||||
textDevr = SystemWidgetHelpers.createLabeledTextField(
|
textDevr = SystemWidgetHelpers.createLabeledTextField(
|
||||||
composite_prompts,
|
composite_prompts,
|
||||||
null,
|
null,
|
||||||
RSESamplesPlugin.getResourceString("filter.devr.devrprompt.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("filter.devr.devrprompt.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("filter.devr.devrprompt.tooltip") //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("filter.devr.devrprompt.tooltip") //$NON-NLS-1$
|
||||||
);
|
);
|
||||||
|
|
||||||
resetFields();
|
resetFields();
|
||||||
doInitializeFields();
|
doInitializeFields();
|
||||||
|
|
||||||
// add keystroke listeners...
|
// add keystroke listeners...
|
||||||
textTeam.addModifyListener(
|
textTeam.addModifyListener(
|
||||||
new ModifyListener()
|
new ModifyListener()
|
||||||
{
|
{
|
||||||
public void modifyText(ModifyEvent e)
|
public void modifyText(ModifyEvent e)
|
||||||
{
|
{
|
||||||
validateStringInput();
|
validateStringInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
textDevr.addModifyListener(
|
textDevr.addModifyListener(
|
||||||
new ModifyListener()
|
new ModifyListener()
|
||||||
{
|
{
|
||||||
public void modifyText(ModifyEvent e)
|
public void modifyText(ModifyEvent e)
|
||||||
{
|
{
|
||||||
validateStringInput();
|
validateStringInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* Return the control to recieve initial focus.
|
* Return the control to recieve initial focus.
|
||||||
*/
|
*/
|
||||||
<strong>public Control getInitialFocusControl()
|
<strong>public Control getInitialFocusControl()
|
||||||
{
|
{
|
||||||
return textTeam;
|
return textTeam;
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* Initialize the input fields based on the inputFilterString, and perhaps refProvider.
|
* Initialize the input fields based on the inputFilterString, and perhaps refProvider.
|
||||||
* This can be called before createContents, so test for null widgets first!
|
* This can be called before createContents, so test for null widgets first!
|
||||||
* Prior to this being called, resetFields is called to set the initial default state prior to input
|
* Prior to this being called, resetFields is called to set the initial default state prior to input
|
||||||
*/
|
*/
|
||||||
<strong>protected void doInitializeFields()
|
<strong>protected void doInitializeFields()
|
||||||
{
|
{
|
||||||
if (textTeam == null)
|
if (textTeam == null)
|
||||||
return; // do nothing
|
return; // do nothing
|
||||||
if (inputFilterString != null)
|
if (inputFilterString != null)
|
||||||
{
|
{
|
||||||
int idx = inputFilterString.indexOf('/');
|
int idx = inputFilterString.indexOf('/');
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
textTeam.setText(inputFilterString);
|
textTeam.setText(inputFilterString);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
textTeam.setText(inputFilterString.substring(0,idx));
|
textTeam.setText(inputFilterString.substring(0,idx));
|
||||||
textDevr.setText(inputFilterString.substring(idx+1));
|
textDevr.setText(inputFilterString.substring(idx+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* This is called in the change filter dialog when the user selects "new", or selects another string.
|
* This is called in the change filter dialog when the user selects "new", or selects another string.
|
||||||
*/
|
*/
|
||||||
<strong>protected void resetFields()
|
<strong>protected void resetFields()
|
||||||
{
|
{
|
||||||
textTeam.setText(""); //$NON-NLS-1$
|
textTeam.setText(""); //$NON-NLS-1$
|
||||||
textDevr.setText("*"); //$NON-NLS-1$
|
textDevr.setText("*"); //$NON-NLS-1$
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* Called by parent to decide if information is complete enough to enable finish.
|
* Called by parent to decide if information is complete enough to enable finish.
|
||||||
*/
|
*/
|
||||||
<strong>protected boolean areFieldsComplete()
|
<strong>protected boolean areFieldsComplete()
|
||||||
{
|
{
|
||||||
if ((textTeam == null) || (textDevr == null))
|
if ((textTeam == null) || (textDevr == null))
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
return (textTeam.getText().trim().length()>0) && (textDevr.getText().trim().length()>0);
|
return (textTeam.getText().trim().length()>0) && (textDevr.getText().trim().length()>0);
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* Get the filter string in its current form.
|
* Get the filter string in its current form.
|
||||||
* Functional opposite of doInitializeFields, which tears apart the input string in update mode,
|
* Functional opposite of doInitializeFields, which tears apart the input string in update mode,
|
||||||
* to populate the GUIs. This method creates the filter string from the information in the GUI.
|
* to populate the GUIs. This method creates the filter string from the information in the GUI.
|
||||||
*/
|
*/
|
||||||
<strong>public String getFilterString()
|
<strong>public String getFilterString()
|
||||||
{
|
{
|
||||||
if ((textTeam == null) || (textDevr == null))
|
if ((textTeam == null) || (textDevr == null))
|
||||||
return inputFilterString; // return what we were given.
|
return inputFilterString; // return what we were given.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String teamName = textTeam.getText().trim();
|
String teamName = textTeam.getText().trim();
|
||||||
String devrName = textDevr.getText().trim();
|
String devrName = textDevr.getText().trim();
|
||||||
return teamName + "/" + devrName; //$NON-NLS-1$
|
return teamName + "/" + devrName; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override of parent method.
|
* Override of parent method.
|
||||||
* Does complete verification of input fields. If this
|
* Does complete verification of input fields. If this
|
||||||
* method returns null, there are no errors and the dialog or wizard can close.
|
* method returns null, there are no errors and the dialog or wizard can close.
|
||||||
*
|
*
|
||||||
* @return error message if there is one, else null if ok
|
* @return error message if there is one, else null if ok
|
||||||
*/
|
*/
|
||||||
<strong>public SystemMessage verify()
|
<strong>public SystemMessage verify()
|
||||||
{
|
{
|
||||||
errorMessage = null;
|
errorMessage = null;
|
||||||
Control controlInError = null;
|
Control controlInError = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
errorMessage = validateTeamInput(); // todo: implement if we want to syntax check input
|
errorMessage = validateTeamInput(); // todo: implement if we want to syntax check input
|
||||||
if (errorMessage != null)
|
if (errorMessage != null)
|
||||||
controlInError = textTeam;
|
controlInError = textTeam;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorMessage = validateDevrInput(); // todo: implement to syntax check input
|
errorMessage = validateDevrInput(); // todo: implement to syntax check input
|
||||||
if (errorMessage != null)
|
if (errorMessage != null)
|
||||||
controlInError = textDevr;
|
controlInError = textDevr;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (errorMessage != null)
|
if (errorMessage != null)
|
||||||
{
|
{
|
||||||
if (controlInError != null)
|
if (controlInError != null)
|
||||||
controlInError.setFocus();
|
controlInError.setFocus();
|
||||||
}
|
}
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}</strong>
|
}</strong>
|
||||||
|
|
||||||
}
|
}
|
||||||
</samp></pre>
|
</samp></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class DeveloperSubSystem extends SubSystem
|
||||||
* @param parent - the parent resource object being expanded
|
* @param parent - the parent resource object being expanded
|
||||||
* @param filterString - typically defaults to "*". In future additional user-specific quick-filters may be supported.
|
* @param filterString - typically defaults to "*". In future additional user-specific quick-filters may be supported.
|
||||||
*/
|
*/
|
||||||
<a id="resolveFilterString"/>protected Object[] internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor)
|
<a id="resolveFilterString"></a>protected Object[] internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor)
|
||||||
throws java.lang.reflect.InvocationTargetException,
|
throws java.lang.reflect.InvocationTargetException,
|
||||||
java.lang.InterruptedException
|
java.lang.InterruptedException
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class DeveloperSubSystem extends SubSystem
|
||||||
// Now, subset master list, based on filter string...
|
// Now, subset master list, based on filter string...
|
||||||
NamePatternMatcher subsetter = new NamePatternMatcher(filterString);
|
NamePatternMatcher subsetter = new NamePatternMatcher(filterString);
|
||||||
Vector v = new Vector();
|
Vector v = new Vector();
|
||||||
for (int idx=0; idx <1; allTeams.length; idx++)
|
for (int idx=0; idx < allTeams.length; idx++)
|
||||||
{
|
{
|
||||||
if (subsetter.matches(allTeams[idx].getName()))
|
if (subsetter.matches(allTeams[idx].getName()))
|
||||||
v.addElement(allTeams[idx]);
|
v.addElement(allTeams[idx]);
|
||||||
|
@ -124,7 +124,7 @@ public class DeveloperSubSystem extends SubSystem
|
||||||
String devrName = filterString.substring(slashIdx+1);
|
String devrName = filterString.substring(slashIdx+1);
|
||||||
TeamResource[] allTeams = getAllTeams();
|
TeamResource[] allTeams = getAllTeams();
|
||||||
TeamResource match = null;
|
TeamResource match = null;
|
||||||
for (int idx=0; (match==null) && (idx < allTeams.length); idx++)
|
for (int idx=0; (match==null) && (idx < allTeams.length); idx++)
|
||||||
if (allTeams[idx].getName().equals(teamName))
|
if (allTeams[idx].getName().equals(teamName))
|
||||||
match = allTeams[idx];
|
match = allTeams[idx];
|
||||||
if (match != null)
|
if (match != null)
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class DeveloperSubSystemConfiguration extends SubSystemConfiguration {
|
||||||
* We intercept so that we can create an initial filter in that pool, which will
|
* We intercept so that we can create an initial filter in that pool, which will
|
||||||
* list all teams.
|
* list all teams.
|
||||||
*/
|
*/
|
||||||
<a id="createDefaultFilterPool"/><strong>protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
|
<a id="createDefaultFilterPool"></a><strong>protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr)
|
||||||
{
|
{
|
||||||
ISystemFilterPool defaultPool = null;
|
ISystemFilterPool defaultPool = null;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,269 +1,269 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
<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." >
|
<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">
|
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||||
<title>FolderInfoPropertyPage Class After Editing</title>
|
<title>FolderInfoPropertyPage Class After Editing</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body bgcolor="#ffffff">
|
<body bgcolor="#ffffff">
|
||||||
<h1>FolderInfoPropertyPage Class After Editing</h1>
|
<h1>FolderInfoPropertyPage Class After Editing</h1>
|
||||||
<p>
|
<p>
|
||||||
<pre><samp>
|
<pre><samp>
|
||||||
package samples.ui.propertypages;
|
package samples.ui.propertypages;
|
||||||
|
|
||||||
import org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction;
|
import org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||||
import org.eclipse.rse.ui.SystemWidgetHelpers;
|
import org.eclipse.rse.ui.SystemWidgetHelpers;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.events.SelectionListener;
|
import org.eclipse.swt.events.SelectionListener;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
|
||||||
import samples.RSESamplesPlugin;
|
import samples.RSESamplesPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sample property page for a remote object, which in this case is scoped via the
|
* A sample property page for a remote object, which in this case is scoped via the
|
||||||
* extension point xml to only apply to folder objects.
|
* extension point xml to only apply to folder objects.
|
||||||
*/
|
*/
|
||||||
public class FolderInfoPropertyPage
|
public class FolderInfoPropertyPage
|
||||||
extends SystemAbstractRemoteFilePropertyPageExtensionAction
|
extends SystemAbstractRemoteFilePropertyPageExtensionAction
|
||||||
implements SelectionListener
|
implements SelectionListener
|
||||||
{
|
{
|
||||||
// gui widgets...
|
// gui widgets...
|
||||||
private Label sizeLabel, filesLabel, foldersLabel;
|
private Label sizeLabel, filesLabel, foldersLabel;
|
||||||
private Button stopButton;
|
private Button stopButton;
|
||||||
// state...
|
// state...
|
||||||
private int totalSize = 0;
|
private int totalSize = 0;
|
||||||
private int totalFolders = 0;
|
private int totalFolders = 0;
|
||||||
private int totalFiles = 0;
|
private int totalFiles = 0;
|
||||||
private boolean stopped = false;
|
private boolean stopped = false;
|
||||||
private Thread workerThread;
|
private Thread workerThread;
|
||||||
private Runnable guiUpdater;
|
private Runnable guiUpdater;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for FolderInfoPropertyPage.
|
* Constructor for FolderInfoPropertyPage.
|
||||||
*/
|
*/
|
||||||
public FolderInfoPropertyPage()
|
public FolderInfoPropertyPage()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// Parent method overrides...
|
// Parent method overrides...
|
||||||
// --------------------------
|
// --------------------------
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction#createContentArea(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.rse.files.ui.propertypages.SystemAbstractRemoteFilePropertyPageExtensionAction#createContentArea(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
protected Control createContentArea(Composite parent)
|
protected Control createContentArea(Composite parent)
|
||||||
{
|
{
|
||||||
Composite composite = SystemWidgetHelpers.createComposite(parent, 2);
|
Composite composite = SystemWidgetHelpers.createComposite(parent, 2);
|
||||||
// draw the gui
|
// draw the gui
|
||||||
sizeLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
sizeLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
||||||
RSESamplesPlugin.getResourceString("pp.size.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.size.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("pp.size.tooltip"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.size.tooltip"), //$NON-NLS-1$
|
||||||
false);
|
false);
|
||||||
filesLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
filesLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
||||||
RSESamplesPlugin.getResourceString("pp.files.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.files.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("pp.files.tooltip"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.files.tooltip"), //$NON-NLS-1$
|
||||||
false);
|
false);
|
||||||
foldersLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
foldersLabel = SystemWidgetHelpers.createLabeledLabel(composite,
|
||||||
RSESamplesPlugin.getResourceString("pp.folders.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.folders.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("pp.folders.tooltip"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.folders.tooltip"), //$NON-NLS-1$
|
||||||
false);
|
false);
|
||||||
stopButton = SystemWidgetHelpers.createPushButton(composite, null,
|
stopButton = SystemWidgetHelpers.createPushButton(composite, null,
|
||||||
RSESamplesPlugin.getResourceString("pp.stopButton.label"), //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.stopButton.label"), //$NON-NLS-1$
|
||||||
RSESamplesPlugin.getResourceString("pp.stopButton.tooltip") //$NON-NLS-1$
|
RSESamplesPlugin.getResourceString("pp.stopButton.tooltip") //$NON-NLS-1$
|
||||||
);
|
);
|
||||||
stopButton.addSelectionListener(this);
|
stopButton.addSelectionListener(this);
|
||||||
|
|
||||||
setValid(false); // Disable OK button until thread is done
|
setValid(false); // Disable OK button until thread is done
|
||||||
|
|
||||||
// show "Processing..." message
|
// show "Processing..." message
|
||||||
setMessage(RSESamplesPlugin.getPluginMessage("RSSG1002")); //$NON-NLS-1$
|
setMessage(RSESamplesPlugin.getPluginMessage("RSSG1002")); //$NON-NLS-1$
|
||||||
|
|
||||||
// create instance of Runnable to allow asynchronous GUI updates from background thread
|
// create instance of Runnable to allow asynchronous GUI updates from background thread
|
||||||
guiUpdater = new RunnableGUIClass();
|
guiUpdater = new RunnableGUIClass();
|
||||||
// spawn a thread to calculate the information
|
// spawn a thread to calculate the information
|
||||||
workerThread = new RunnableClass(getRemoteFile());
|
workerThread = new RunnableClass(getRemoteFile());
|
||||||
workerThread.start();
|
workerThread.start();
|
||||||
|
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept from PreferencePage. Called when user presses Cancel button.
|
* Intercept from PreferencePage. Called when user presses Cancel button.
|
||||||
* We stop the background thread.
|
* We stop the background thread.
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#performCancel()
|
* @see org.eclipse.jface.preference.PreferencePage#performCancel()
|
||||||
*/
|
*/
|
||||||
public boolean performCancel()
|
public boolean performCancel()
|
||||||
{
|
{
|
||||||
killThread();
|
killThread();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept from DialogPage. Called when dialog going away.
|
* Intercept from DialogPage. Called when dialog going away.
|
||||||
* If the user presses the X to close this dialog, we
|
* If the user presses the X to close this dialog, we
|
||||||
* need to stop that background thread.
|
* need to stop that background thread.
|
||||||
*/
|
*/
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
killThread();
|
killThread();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private method to kill our background thread.
|
* Private method to kill our background thread.
|
||||||
* Control doesn't return until it ends.
|
* Control doesn't return until it ends.
|
||||||
*/
|
*/
|
||||||
private void killThread()
|
private void killThread()
|
||||||
{
|
{
|
||||||
if (!stopped && workerThread.isAlive())
|
if (!stopped && workerThread.isAlive())
|
||||||
{
|
{
|
||||||
stopped = true;
|
stopped = true;
|
||||||
try {
|
try {
|
||||||
workerThread.join(); // wait for thread to end
|
workerThread.join(); // wait for thread to end
|
||||||
} catch (InterruptedException exc) {}
|
} catch (InterruptedException exc) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
// Methods from SelectionListener interface...
|
// Methods from SelectionListener interface...
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* From SelectionListener
|
* From SelectionListener
|
||||||
* @see SelectionListener#widgetSelected(SelectionEvent)
|
* @see SelectionListener#widgetSelected(SelectionEvent)
|
||||||
*/
|
*/
|
||||||
public void widgetSelected(SelectionEvent event)
|
public void widgetSelected(SelectionEvent event)
|
||||||
{
|
{
|
||||||
if (event.getSource() == stopButton)
|
if (event.getSource() == stopButton)
|
||||||
{
|
{
|
||||||
stopped = true;
|
stopped = true;
|
||||||
stopButton.setEnabled(false);
|
stopButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* From SelectionListener
|
* From SelectionListener
|
||||||
* @see SelectionListener#widgetDefaultSelected(SelectionEvent)
|
* @see SelectionListener#widgetDefaultSelected(SelectionEvent)
|
||||||
*/
|
*/
|
||||||
public void widgetDefaultSelected(SelectionEvent event)
|
public void widgetDefaultSelected(SelectionEvent event)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------
|
// ----------------
|
||||||
// Inner classes...
|
// Inner classes...
|
||||||
// ----------------
|
// ----------------
|
||||||
/**
|
/**
|
||||||
* Inner class encapsulating the background work to be done, so it may be executed
|
* Inner class encapsulating the background work to be done, so it may be executed
|
||||||
* in background thread.
|
* in background thread.
|
||||||
*/
|
*/
|
||||||
private class RunnableClass extends Thread
|
private class RunnableClass extends Thread
|
||||||
{
|
{
|
||||||
IRemoteFile inputFolder;
|
IRemoteFile inputFolder;
|
||||||
|
|
||||||
RunnableClass(IRemoteFile inputFolder)
|
RunnableClass(IRemoteFile inputFolder)
|
||||||
{
|
{
|
||||||
this.inputFolder = inputFolder;
|
this.inputFolder = inputFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (stopped)
|
if (stopped)
|
||||||
return;
|
return;
|
||||||
walkFolder(inputFolder);
|
walkFolder(inputFolder);
|
||||||
updateGUI();
|
updateGUI();
|
||||||
if (!stopped)
|
if (!stopped)
|
||||||
{
|
{
|
||||||
stopped = true;
|
stopped = true;
|
||||||
updateGUI();
|
updateGUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively walk a folder, updating the running tallies.
|
* Recursively walk a folder, updating the running tallies.
|
||||||
* Update the GUI after processing each subfolder.
|
* Update the GUI after processing each subfolder.
|
||||||
*/
|
*/
|
||||||
private void walkFolder(IRemoteFile currFolder)
|
private void walkFolder(IRemoteFile currFolder)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null);
|
IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null);
|
||||||
if ((folders != null) && (folders.length>0))
|
if ((folders != null) && (folders.length>0))
|
||||||
{
|
{
|
||||||
for (int idx=0; !stopped && (idx<folders.length); idx++)
|
for (int idx=0; !stopped && (idx<folders.length); idx++)
|
||||||
{
|
{
|
||||||
// is this a folder?
|
// is this a folder?
|
||||||
if (folders[idx].isDirectory())
|
if (folders[idx].isDirectory())
|
||||||
{
|
{
|
||||||
++totalFolders;
|
++totalFolders;
|
||||||
walkFolder(folders[idx]);
|
walkFolder(folders[idx]);
|
||||||
updateGUI();
|
updateGUI();
|
||||||
}
|
}
|
||||||
// is this a file?
|
// is this a file?
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
++totalFiles;
|
++totalFiles;
|
||||||
totalSize += folders[idx].getLength();
|
totalSize += folders[idx].getLength();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SystemMessageException e)
|
catch (SystemMessageException e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
} // end of walkFolder method
|
} // end of walkFolder method
|
||||||
|
|
||||||
} // end of inner class
|
} // end of inner class
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class encapsulating the GUI work to be done from the
|
* Inner class encapsulating the GUI work to be done from the
|
||||||
* background thread.
|
* background thread.
|
||||||
*/
|
*/
|
||||||
private class RunnableGUIClass implements Runnable
|
private class RunnableGUIClass implements Runnable
|
||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (stopButton.isDisposed())
|
if (stopButton.isDisposed())
|
||||||
return;
|
return;
|
||||||
if (!stopped)
|
if (!stopped)
|
||||||
{
|
{
|
||||||
sizeLabel.setText(Integer.toString(totalSize));
|
sizeLabel.setText(Integer.toString(totalSize));
|
||||||
filesLabel.setText(Integer.toString(totalFiles));
|
filesLabel.setText(Integer.toString(totalFiles));
|
||||||
foldersLabel.setText(Integer.toString(totalFolders));
|
foldersLabel.setText(Integer.toString(totalFolders));
|
||||||
}
|
}
|
||||||
else if (stopped)
|
else if (stopped)
|
||||||
{
|
{
|
||||||
setValid(true); // re-enable OK button
|
setValid(true); // re-enable OK button
|
||||||
stopButton.setEnabled(false); // disable Stop button
|
stopButton.setEnabled(false); // disable Stop button
|
||||||
clearMessage(); // clear "Processing..." message
|
clearMessage(); // clear "Processing..." message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the GUI with the current status
|
* Update the GUI with the current status
|
||||||
*/
|
*/
|
||||||
private void updateGUI()
|
private void updateGUI()
|
||||||
{
|
{
|
||||||
Display.getDefault().asyncExec(guiUpdater);
|
Display.getDefault().asyncExec(guiUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</samp></pre>
|
</samp></pre>
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>RSESamplesPlugin Class</h1>
|
<h1>RSESamplesPlugin Class</h1>
|
||||||
<pre><samp>
|
|
||||||
<pre><code>
|
<pre><code>
|
||||||
package rsesamples;
|
package rsesamples;
|
||||||
|
|
||||||
|
@ -168,6 +167,6 @@ public class RSESamplesPlugin extends SystemBasePlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</code></pre></samp></pre>
|
</code></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,117 +1,117 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
<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." >
|
<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">
|
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||||
<title>ShowJarContents Class After Editing</title>
|
<title>ShowJarContents Class After Editing</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body bgcolor="#ffffff">
|
<body bgcolor="#ffffff">
|
||||||
<h1>ShowJarContents Class After Editing</h1>
|
<h1>ShowJarContents Class After Editing</h1>
|
||||||
<pre><samp>
|
<pre><samp>
|
||||||
package samples.ui.actions;
|
package samples.ui.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.dialogs.MessageDialog;
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
|
import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
|
||||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
|
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.IObjectActionDelegate;
|
import org.eclipse.ui.IObjectActionDelegate;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An action that runs a command to display the contents of a Jar file.
|
* An action that runs a command to display the contents of a Jar file.
|
||||||
* The plugin.xml file restricts this action so it only appears for .jar files.
|
* The plugin.xml file restricts this action so it only appears for .jar files.
|
||||||
*/
|
*/
|
||||||
public class ShowJarContents implements IObjectActionDelegate {
|
public class ShowJarContents implements IObjectActionDelegate {
|
||||||
private List _selectedFiles;
|
private List _selectedFiles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for ShowJarContents.
|
* Constructor for ShowJarContents.
|
||||||
*/
|
*/
|
||||||
public ShowJarContents() {
|
public ShowJarContents() {
|
||||||
_selectedFiles = new ArrayList();
|
_selectedFiles = new ArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Shell getShell() {
|
protected Shell getShell() {
|
||||||
return SystemBasePlugin.getActiveWorkbenchShell();
|
return SystemBasePlugin.getActiveWorkbenchShell();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IRemoteFile getFirstSelectedRemoteFile() {
|
protected IRemoteFile getFirstSelectedRemoteFile() {
|
||||||
if (_selectedFiles.size() > 0) {
|
if (_selectedFiles.size() > 0) {
|
||||||
return (IRemoteFile) _selectedFiles.get(0);
|
return (IRemoteFile) _selectedFiles.get(0);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ISubSystem getSubSystem() {
|
protected ISubSystem getSubSystem() {
|
||||||
return getFirstSelectedRemoteFile().getParentRemoteFileSubSystem();
|
return getFirstSelectedRemoteFile().getParentRemoteFileSubSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
IRemoteFile selectedFile = getFirstSelectedRemoteFile();
|
IRemoteFile selectedFile = getFirstSelectedRemoteFile();
|
||||||
String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); //$NON-NLS-1$
|
String cmdToRun = "jar -tvf " + selectedFile.getAbsolutePath(); //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
runCommand(cmdToRun);
|
runCommand(cmdToRun);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String excType = e.getClass().getName();
|
String excType = e.getClass().getName();
|
||||||
MessageDialog.openError(getShell(), excType, excType + ": " + e.getLocalizedMessage()); //$NON-NLS-1$
|
MessageDialog.openError(getShell(), excType, excType + ": " + e.getLocalizedMessage()); //$NON-NLS-1$
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
|
public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
|
||||||
//get the Command subsystem associated with the current host
|
//get the Command subsystem associated with the current host
|
||||||
IHost myHost = getSubSystem().getHost();
|
IHost myHost = getSubSystem().getHost();
|
||||||
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
|
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
|
||||||
for (int i = 0; i < subsys.length; i++) {
|
for (int i = 0; i < subsys.length; i++) {
|
||||||
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
|
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
|
||||||
return subsys[i];
|
return subsys[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runCommand(String command) throws Exception {
|
public void runCommand(String command) throws Exception {
|
||||||
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
|
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
|
||||||
if (cmdss != null && cmdss.isConnected()) {
|
if (cmdss != null && cmdss.isConnected()) {
|
||||||
// Run the command in a visible shell
|
// Run the command in a visible shell
|
||||||
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
|
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
MessageDialog.openError(getShell(), "No command subsystem", "Found no command subsystem");
|
MessageDialog.openError(getShell(), "No command subsystem", "Found no command subsystem");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
|
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
|
||||||
_selectedFiles.clear();
|
_selectedFiles.clear();
|
||||||
// store the selected jars to be used when running
|
// store the selected jars to be used when running
|
||||||
Iterator theSet = ((IStructuredSelection) selection).iterator();
|
Iterator theSet = ((IStructuredSelection) selection).iterator();
|
||||||
while (theSet.hasNext()) {
|
while (theSet.hasNext()) {
|
||||||
Object obj = theSet.next();
|
Object obj = theSet.next();
|
||||||
if (obj instanceof IRemoteFile) {
|
if (obj instanceof IRemoteFile) {
|
||||||
_selectedFiles.add(obj);
|
_selectedFiles.add(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</samp></pre>
|
</samp></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,228 +1,228 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
<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." >
|
<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">
|
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||||
<title>TeamResourceAdapter Class After Editing</title>
|
<title>TeamResourceAdapter Class After Editing</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>TeamResourceAdapter Class After Editing</h1>
|
<h1>TeamResourceAdapter Class After Editing</h1>
|
||||||
<pre><samp>
|
<pre><samp>
|
||||||
package samples.model;
|
package samples.model;
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
import org.eclipse.rse.ui.SystemMenuManager;
|
import org.eclipse.rse.ui.SystemMenuManager;
|
||||||
import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
|
import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
|
||||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
||||||
|
|
||||||
<strong>import samples.RSESamplesPlugin;</strong>
|
<strong>import samples.RSESamplesPlugin;</strong>
|
||||||
<strong>import samples.subsystems.DeveloperSubSystem;</strong>
|
<strong>import samples.subsystems.DeveloperSubSystem;</strong>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the adapter which enables us to work with our remote team resources.
|
* This is the adapter which enables us to work with our remote team resources.
|
||||||
*/
|
*/
|
||||||
public class TeamResourceAdapter extends AbstractSystemViewAdapter implements
|
public class TeamResourceAdapter extends AbstractSystemViewAdapter implements
|
||||||
ISystemRemoteElementAdapter {
|
ISystemRemoteElementAdapter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public TeamResourceAdapter() {
|
public TeamResourceAdapter() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#addActions(org.eclipse.rse.ui.SystemMenuManager,
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#addActions(org.eclipse.rse.ui.SystemMenuManager,
|
||||||
* org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.swt.widgets.Shell, java.lang.String)
|
* org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.swt.widgets.Shell, java.lang.String)
|
||||||
*/
|
*/
|
||||||
public void addActions(SystemMenuManager menu,
|
public void addActions(SystemMenuManager menu,
|
||||||
IStructuredSelection selection, Shell parent, String menuGroup)
|
IStructuredSelection selection, Shell parent, String menuGroup)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getImageDescriptor(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getImageDescriptor(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public ImageDescriptor getImageDescriptor(Object element)
|
public ImageDescriptor getImageDescriptor(Object element)
|
||||||
{
|
{
|
||||||
<strong>return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_TEAM");</strong>
|
<strong>return RSESamplesPlugin.getDefault().getImageDescriptor("ICON_ID_TEAM");</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getText(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getText(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getText(Object element)
|
public String getText(Object element)
|
||||||
{
|
{
|
||||||
<strong>return ((TeamResource)element).getName();</strong>
|
<strong>return ((TeamResource)element).getName();</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getAbsoluteName(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getAbsoluteName(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
<a id="getAbsoluteName"/>public String getAbsoluteName(Object object)
|
<a id="getAbsoluteName"></a>public String getAbsoluteName(Object object)
|
||||||
{
|
{
|
||||||
<strong>TeamResource team = (TeamResource)object;
|
<strong>TeamResource team = (TeamResource)object;
|
||||||
return "Team_"+team.getName();</strong>
|
return "Team_"+team.getName();</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getType(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getType(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getType(Object element)
|
public String getType(Object element)
|
||||||
{
|
{
|
||||||
<strong>return RSESamplesPlugin.getResourceString("property.team_resource.type");</strong>
|
<strong>return RSESamplesPlugin.getResourceString("property.team_resource.type");</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getParent(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getParent(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object getParent(Object element)
|
public Object getParent(Object element)
|
||||||
{
|
{
|
||||||
return null; // not really used, which is good because it is ambiguous
|
return null; // not really used, which is good because it is ambiguous
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#hasChildren(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#hasChildren(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean hasChildren(Object element)
|
public boolean hasChildren(Object element)
|
||||||
{
|
{
|
||||||
<strong>return true;</strong>
|
<strong>return true;</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getChildren(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#getChildren(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object[] getChildren(Object element)
|
public Object[] getChildren(Object element)
|
||||||
{
|
{
|
||||||
<strong>return ((TeamResource)element).getDevelopers();</strong>
|
<strong>return ((TeamResource)element).getDevelopers();</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyDescriptors()
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyDescriptors()
|
||||||
*/
|
*/
|
||||||
protected IPropertyDescriptor[] internalGetPropertyDescriptors()
|
protected IPropertyDescriptor[] internalGetPropertyDescriptors()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyValue(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.AbstractSystemViewAdapter#internalGetPropertyValue(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
protected Object internalGetPropertyValue(Object key)
|
protected Object internalGetPropertyValue(Object key)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept of parent method to indicate these objects can be renamed using the RSE-supplied
|
* Intercept of parent method to indicate these objects can be renamed using the RSE-supplied
|
||||||
* rename action.
|
* rename action.
|
||||||
*/
|
*/
|
||||||
<a id="canRename"/>public boolean canRename(Object element)
|
<a id="canRename"></a>public boolean canRename(Object element)
|
||||||
{
|
{
|
||||||
<strong>return true;</strong>
|
<strong>return true;</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept of parent method to actually do the rename. RSE supplies the rename GUI, but
|
* Intercept of parent method to actually do the rename. RSE supplies the rename GUI, but
|
||||||
* defers the action work of renaming to this adapter method.
|
* defers the action work of renaming to this adapter method.
|
||||||
*/
|
*/
|
||||||
<a id="doRename"/>public boolean doRename(Shell shell, Object element, String newName)
|
<a id="doRename"></a>public boolean doRename(Shell shell, Object element, String newName)
|
||||||
{
|
{
|
||||||
<strong>((TeamResource)element).setName(newName);
|
<strong>((TeamResource)element).setName(newName);
|
||||||
return true;</strong>
|
return true;</strong>
|
||||||
}
|
}
|
||||||
// --------------------------------------
|
// --------------------------------------
|
||||||
// ISystemRemoteElementAdapter methods...
|
// ISystemRemoteElementAdapter methods...
|
||||||
// --------------------------------------
|
// --------------------------------------
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getAbsoluteParentName(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getAbsoluteParentName(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getAbsoluteParentName(Object element)
|
public String getAbsoluteParentName(Object element)
|
||||||
{
|
{
|
||||||
<strong>return "root";</strong> // not really applicable as we have no unique hierarchy
|
<strong>return "root";</strong> // not really applicable as we have no unique hierarchy
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemConfigurationId(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getSubSystemConfigurationId(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getSubSystemConfigurationId(Object element)
|
public String getSubSystemConfigurationId(Object element)
|
||||||
{
|
{
|
||||||
<strong>return "samples.subsystems.factory";</strong> // as declared in extension in plugin.xml
|
<strong>return "samples.subsystems.factory";</strong> // as declared in extension in plugin.xml
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteTypeCategory(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteTypeCategory(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getRemoteTypeCategory(Object element)
|
public String getRemoteTypeCategory(Object element)
|
||||||
{
|
{
|
||||||
<strong>return "developers";</strong> // Course grained. Same for all our remote resources.
|
<strong>return "developers";</strong> // Course grained. Same for all our remote resources.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteType(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteType(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getRemoteType(Object element)
|
public String getRemoteType(Object element)
|
||||||
{
|
{
|
||||||
<strong>return "team";</strong> // Fine grained. Unique to this resource type.
|
<strong>return "team";</strong> // Fine grained. Unique to this resource type.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubType(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteSubType(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public String getRemoteSubType(Object element)
|
public String getRemoteSubType(Object element)
|
||||||
{
|
{
|
||||||
return null; // Very fine grained. We don't use it.
|
return null; // Very fine grained. We don't use it.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#refreshRemoteObject(java.lang.Object, java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#refreshRemoteObject(java.lang.Object, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
<a id="refreshRemoteObject"/>public boolean refreshRemoteObject(Object oldElement, Object newElement)
|
<a id="refreshRemoteObject"></a>public boolean refreshRemoteObject(Object oldElement, Object newElement)
|
||||||
{
|
{
|
||||||
<strong>TeamResource oldTeam = (TeamResource)oldElement;
|
<strong>TeamResource oldTeam = (TeamResource)oldElement;
|
||||||
TeamResource newTeam = (TeamResource)newElement;
|
TeamResource newTeam = (TeamResource)newElement;
|
||||||
newTeam.setName(oldTeam.getName());
|
newTeam.setName(oldTeam.getName());
|
||||||
return false;</strong> // If developer objects held references to their team names, we'd have to return true
|
return false;</strong> // If developer objects held references to their team names, we'd have to return true
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParent(org.eclipse.swt.widgets.Shell, java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParent(org.eclipse.swt.widgets.Shell, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object getRemoteParent(Shell shell, Object element) throws Exception
|
public Object getRemoteParent(Shell shell, Object element) throws Exception
|
||||||
{
|
{
|
||||||
return null; // maybe this would be a Project or Roster object, or leave as null if this is the root
|
return null; // maybe this would be a Project or Roster object, or leave as null if this is the root
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParentNamesInUse(org.eclipse.swt.widgets.Shell, java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#getRemoteParentNamesInUse(org.eclipse.swt.widgets.Shell, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
<a id="getNames"/>public String[] getRemoteParentNamesInUse(Shell shell, Object element)
|
<a id="getNames"></a>public String[] getRemoteParentNamesInUse(Shell shell, Object element)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
<strong>DeveloperSubSystem ourSS = (DeveloperSubSystem)getSubSystem(element);
|
<strong>DeveloperSubSystem ourSS = (DeveloperSubSystem)getSubSystem(element);
|
||||||
TeamResource[] allTeams = ourSS.getAllTeams();
|
TeamResource[] allTeams = ourSS.getAllTeams();
|
||||||
String[] allNames = new String[allTeams.length];
|
String[] allNames = new String[allTeams.length];
|
||||||
for (int idx = 0; idx < allTeams.length; idx++)
|
for (int idx = 0; idx < allTeams.length; idx++)
|
||||||
allNames[idx] = allTeams[idx].getName();
|
allNames[idx] = allTeams[idx].getName();
|
||||||
return allNames;</strong> // Return list of all team names
|
return allNames;</strong> // Return list of all team names
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object)
|
* @see org.eclipse.rse.ui.view.ISystemRemoteElementAdapter#supportsUserDefinedActions(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean supportsUserDefinedActions(Object object) {
|
public boolean supportsUserDefinedActions(Object object) {
|
||||||
<strong>return false;</strong>
|
<strong>return false;</strong>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</samp></pre>
|
</samp></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,105 +1,105 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
<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." >
|
<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">
|
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||||
<title>Creating a Plug-in Project</title>
|
<title>Creating a Plug-in Project</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Creating a Plug-in Project</h1>
|
<h1>Creating a Plug-in Project</h1>
|
||||||
<p>To use any Eclipse extension point, including those defined by the Remote System Explorer, you must first create a plug-in project using the plug-in development environment (PDE), which you will do shortly. At its simplest, a plug-in project requires a <tt>MANIFEST.MF</tt> file describing the plugin and its dependencies and, if extending the workbench a <samp>plugin.xml</samp> file identifying the extension points being implemented, and a set of Java classes implementing those extension points. There is usually also a plug-in class file that is used as the overall manager of the project, and point of integration that other classes can rely on.</p>
|
<p>To use any Eclipse extension point, including those defined by the Remote System Explorer, you must first create a plug-in project using the plug-in development environment (PDE), which you will do shortly. At its simplest, a plug-in project requires a <tt>MANIFEST.MF</tt> file describing the plugin and its dependencies and, if extending the workbench a <samp>plugin.xml</samp> file identifying the extension points being implemented, and a set of Java classes implementing those extension points. There is usually also a plug-in class file that is used as the overall manager of the project, and point of integration that other classes can rely on.</p>
|
||||||
<p><i>If you already have a plugin project, you will need to update it slightly to make it extend SystemBasePlugin and add the few methods it requires. You may wish to examine these steps to see what methods to add. The Eclipse environment will keep your classpaths and plugin dependecies in sync for you.</i></p>
|
<p><i>If you already have a plugin project, you will need to update it slightly to make it extend SystemBasePlugin and add the few methods it requires. You may wish to examine these steps to see what methods to add. The Eclipse environment will keep your classpaths and plugin dependecies in sync for you.</i></p>
|
||||||
<p>Eclipse supplies a number of plug-in project templates, which generate a number of project files that illustrate examples of various Eclipse extension points. While you are free to pick one of these, or indeed start with any existing plug-in project if you have one, in the RSE tutorials everything is created by hand so as to keep focused on the RSE-required classes and files.</p>
|
<p>Eclipse supplies a number of plug-in project templates, which generate a number of project files that illustrate examples of various Eclipse extension points. While you are free to pick one of these, or indeed start with any existing plug-in project if you have one, in the RSE tutorials everything is created by hand so as to keep focused on the RSE-required classes and files.</p>
|
||||||
<p>The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.</p>
|
<p>The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.</p>
|
||||||
<h2>Step By Step: Creating an RSE Plug-in Project</h2>
|
<h2>Step By Step: Creating an RSE Plug-in Project</h2>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Select <b>File->New->Project.</b></li>
|
<li>Select <b>File->New->Project.</b></li>
|
||||||
<li>In the dialog box select the <b>Plug-in Project</b> wizard. Click <b>Next ></b>.
|
<li>In the dialog box select the <b>Plug-in Project</b> wizard. Click <b>Next ></b>.
|
||||||
<br /><img src="pdeProj_1.png">
|
<br><img src="pdeProj_1.png">
|
||||||
</li>
|
</li>
|
||||||
<li>In the first page of the wizard enter <b>"RSESamples"</b> for the project name (without the quotes). Click <b>Next ></b>.
|
<li>In the first page of the wizard enter <b>"RSESamples"</b> for the project name (without the quotes). Click <b>Next ></b>.
|
||||||
<br /><img src="pdeProj_wiz_page1.png">
|
<br><img src="pdeProj_wiz_page1.png">
|
||||||
</li>
|
</li>
|
||||||
<li>In the second page of the wizard enter your company for the <b>Plug-in Provider</b>, change the <b>Activator</b> to be "rsesamples.RSESamplesPlugin", and click <b>Next ></b>.
|
<li>In the second page of the wizard enter your company for the <b>Plug-in Provider</b>, change the <b>Activator</b> to be "rsesamples.RSESamplesPlugin", and click <b>Next ></b>.
|
||||||
<br /><img src="pdeProj_wiz_page2.png">
|
<br><img src="pdeProj_wiz_page2.png">
|
||||||
</li>
|
</li>
|
||||||
<li>In the third page of the wizard uncheck the "Create a plug-in using one of the templates" checkbox and click <b>Finish</b>.
|
<li>In the third page of the wizard uncheck the "Create a plug-in using one of the templates" checkbox and click <b>Finish</b>.
|
||||||
<br /><img src="pdeProj_wiz_page3.png">
|
<br><img src="pdeProj_wiz_page3.png">
|
||||||
</li>
|
</li>
|
||||||
<li>Your new plugin project is created and visible in the Package Explorer of the Plug-in Development perspective. Your new plugin properties are also open in the plug-in editor.</li>
|
<li>Your new plugin project is created and visible in the Package Explorer of the Plug-in Development perspective. Your new plugin properties are also open in the plug-in editor.</li>
|
||||||
<li>Go to the dependencies tab of the plug-in editor and add the following plugins to the list:
|
<li>Go to the dependencies tab of the plug-in editor and add the following plugins to the list:
|
||||||
<ul>
|
<ul>
|
||||||
<li>org.eclipse.core.resources</li>
|
<li>org.eclipse.core.resources</li>
|
||||||
<li>org.eclipse.rse.ui</li>
|
<li>org.eclipse.rse.ui</li>
|
||||||
<li>org.eclipse.rse.services</li>
|
<li>org.eclipse.rse.services</li>
|
||||||
<li>org.eclipse.rse.files.ui</li>
|
<li>org.eclipse.rse.files.ui</li>
|
||||||
<li>org.eclipse.rse.shells.ui</li>
|
<li>org.eclipse.rse.shells.ui</li>
|
||||||
<li>org.eclipse.rse.subsystems.files.core</li>
|
<li>org.eclipse.rse.subsystems.files.core</li>
|
||||||
<li>org.eclipse.rse.subsystems.shells.core</li>
|
<li>org.eclipse.rse.subsystems.shells.core</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Now go to the MANIFEST.MF tab of the plugin properties.
|
<li>Now go to the MANIFEST.MF tab of the plugin properties.
|
||||||
This shows the source for the MANIFEST.MF file associated with this plugin.
|
This shows the source for the MANIFEST.MF file associated with this plugin.
|
||||||
Change the Bundle-SymbolicName line adding a singleton:=true directive.
|
Change the Bundle-SymbolicName line adding a singleton:=true directive.
|
||||||
<pre><code>
|
<pre><code>
|
||||||
Bundle-SymbolicName:RSESamples;singleton:=true
|
Bundle-SymbolicName:RSESamples;singleton:=true
|
||||||
</code></pre>
|
</code></pre>
|
||||||
This allows us to add extensions to the plugin at a later point.
|
This allows us to add extensions to the plugin at a later point.
|
||||||
Save the plugin properties and close the editor.
|
Save the plugin properties and close the editor.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Right-click on the RSESamples project and create a plugin.xml file.
|
Right-click on the RSESamples project and create a plugin.xml file.
|
||||||
Normally this would be created if you used a template to create your plugin.
|
Normally this would be created if you used a template to create your plugin.
|
||||||
We will use this file to add extensions to RSE but for now it will just be a skeleton with the following contents:
|
We will use this file to add extensions to RSE but for now it will just be a skeleton with the following contents:
|
||||||
<pre><code>
|
<pre><code>
|
||||||
<plugin>
|
<plugin>
|
||||||
</plugin>
|
</plugin>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
Add the lines above to the empty plugin.xml file and save it.
|
Add the lines above to the empty plugin.xml file and save it.
|
||||||
</li>
|
</li>
|
||||||
<li>Expand the <b>src</b> folder, then the <b>rsesamples</b> package folder, and double-click on <samp><b>RSESamplesPlugin.java</b></samp> to edit this class.
|
<li>Expand the <b>src</b> folder, then the <b>rsesamples</b> package folder, and double-click on <samp><b>RSESamplesPlugin.java</b></samp> to edit this class.
|
||||||
Change it as described below. Reference the source <a href="RSESamplesPlugin.html">here</a> for the details.
|
Change it as described below. Reference the source <a href="RSESamplesPlugin.html">here</a> for the details.
|
||||||
<ul>
|
<ul>
|
||||||
<li>Extend SystemBasePlugin instead of AbstractUIPlugin</li>
|
<li>Extend SystemBasePlugin instead of AbstractUIPlugin</li>
|
||||||
<li>Add the declaration for resourceBundle</li>
|
<li>Add the declaration for resourceBundle</li>
|
||||||
<li>Add the declaration for messageFile</li>
|
<li>Add the declaration for messageFile</li>
|
||||||
<li>Invoke the superclass constructor from this constructor</li>
|
<li>Invoke the superclass constructor from this constructor</li>
|
||||||
<li>Add the initializeImageRegistry() method</li>
|
<li>Add the initializeImageRegistry() method</li>
|
||||||
<li>Add the getMessageFile() method</li>
|
<li>Add the getMessageFile() method</li>
|
||||||
<li>Add the getResourceBundle() method</li>
|
<li>Add the getResourceBundle() method</li>
|
||||||
<li>Add the static getWorkspace() method</li>
|
<li>Add the static getWorkspace() method</li>
|
||||||
<li>Add the static getResourceString(String) method</li>
|
<li>Add the static getResourceString(String) method</li>
|
||||||
<li>Add the static getPluginMessageFile() method</li>
|
<li>Add the static getPluginMessageFile() method</li>
|
||||||
<li>Add the static getPluginMessage(String) method</li>
|
<li>Add the static getPluginMessage(String) method</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Create the project's resources file for translatable strings: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to open the <b>New File</b> wizard. Enter <samp><b>rseSamplesResources.properties</b></samp> for the file name, as was specified in the call to <samp>loadResourceBundle</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will populate as you go through the tutorials, so for now just <i>close</i> the editor opened for the file.</li>
|
<li>Create the project's resources file for translatable strings: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to open the <b>New File</b> wizard. Enter <samp><b>rseSamplesResources.properties</b></samp> for the file name, as was specified in the call to <samp>loadResourceBundle</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will populate as you go through the tutorials, so for now just <i>close</i> the editor opened for the file.</li>
|
||||||
<li>Create the project's RSE-style messages file for translatable messages: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to get the <b>New File</b> wizard. Enter <samp><b>rseSamplesMessages.xml</b></samp> for the file name, as was specified in the call to <samp>loadMessageFile</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will see the XML editor open for the new file. Press the <b>Source</b> tab at the bottom of the editor, and enter the following lines (so that you can add messages to the file later on):
|
<li>Create the project's RSE-style messages file for translatable messages: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to get the <b>New File</b> wizard. Enter <samp><b>rseSamplesMessages.xml</b></samp> for the file name, as was specified in the call to <samp>loadMessageFile</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will see the XML editor open for the new file. Press the <b>Source</b> tab at the bottom of the editor, and enter the following lines (so that you can add messages to the file later on):
|
||||||
<pre><code>
|
<pre><code>
|
||||||
<?xml version="1.0" encoding='UTF-8'?>
|
<?xml version="1.0" encoding='UTF-8'?>
|
||||||
<!DOCTYPE MessageFile SYSTEM "../org.eclipse.rse.ui/messageFile.dtd">
|
<!DOCTYPE MessageFile SYSTEM "../org.eclipse.rse.ui/messageFile.dtd">
|
||||||
<!-- This is a message file used by SystemMessage and SystemMessageDialog -->
|
<!-- This is a message file used by SystemMessage and SystemMessageDialog -->
|
||||||
<<b>MessageFile</b> Version="1.0">
|
<<b>MessageFile</b> Version="1.0">
|
||||||
<<b>Component</b> Name="RSE Samples" Abbr="RSS">
|
<<b>Component</b> Name="RSE Samples" Abbr="RSS">
|
||||||
<<b>Subcomponent</b> Name="General" Abbr="G">
|
<<b>Subcomponent</b> Name="General" Abbr="G">
|
||||||
<<b>MessageList</b>>
|
<<b>MessageList</b>>
|
||||||
<<b>Message</b> ID="1001" Indicator="E">
|
<<b>Message</b> ID="1001" Indicator="E">
|
||||||
<<b>LevelOne</b>>Sample message</<b>LevelOne</b>>
|
<<b>LevelOne</b>>Sample message</<b>LevelOne</b>>
|
||||||
<<b>LevelTwo</b>>This is a sample with one substitution variable: %1</<b>LevelTwo</b>>
|
<<b>LevelTwo</b>>This is a sample with one substitution variable: %1</<b>LevelTwo</b>>
|
||||||
</<b>Message</b>>
|
</<b>Message</b>>
|
||||||
</<b>MessageList</b>>
|
</<b>MessageList</b>>
|
||||||
</<b>Subcomponent</b>>
|
</<b>Subcomponent</b>>
|
||||||
</<b>Component</b>>
|
</<b>Component</b>>
|
||||||
</<b>MessageFile</b>>
|
</<b>MessageFile</b>>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
Save and close the file.
|
Save and close the file.
|
||||||
</li>
|
</li>
|
||||||
<li>Your plugin is created and you are ready to go. Now you only need to add the code to implement the extension points.
|
<li>Your plugin is created and you are ready to go. Now you only need to add the code to implement the extension points.
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -97,7 +97,7 @@ Use the "Source -> Organize Imports" context menu item to add the appropriate
|
||||||
<pre><code>
|
<pre><code>
|
||||||
public void runCommand(String command) {
|
public void runCommand(String command) {
|
||||||
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
|
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
|
||||||
if (cmdss != null && cmdss.isConnected()) {
|
if (cmdss != null && cmdss.isConnected()) {
|
||||||
// Run the command in a visible shell
|
// Run the command in a visible shell
|
||||||
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
|
RemoteCommandHelpers.runUniversalCommand(getShell(), command, ".", cmdss); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,7 +111,7 @@ Use the "Source -> Organize Imports" context menu item to add the appropriate
|
||||||
public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
|
public IRemoteCmdSubSystem getRemoteCmdSubSystem() {
|
||||||
IHost myHost = getSubSystem().getHost();
|
IHost myHost = getSubSystem().getHost();
|
||||||
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
|
IRemoteCmdSubSystem[] subsys = RemoteCommandHelpers.getCmdSubSystems(myHost);
|
||||||
for (int i = 0; i < subsys.length; i++) {
|
for (int i = 0; i < subsys.length; i++) {
|
||||||
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
|
if (subsys[i].getSubSystemConfiguration().supportsCommands()) {
|
||||||
return subsys[i];
|
return subsys[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
extend the RSE:
|
extend the RSE:
|
||||||
<ul>
|
<ul>
|
||||||
<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>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>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.
|
<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>
|
</ul>
|
||||||
<p>The source code for all tutorials is available in the RSE-examples package, which
|
<p>The source code for all tutorials is available in the RSE-examples package, which
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Installing The Examples
|
<h1>Installing The Examples</h1>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Add table
Reference in a new issue