1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-30 11:43:33 +02:00

[releng][cleanup] Fix @since tags according to API Tooling

This commit is contained in:
Martin Oberhuber 2008-06-04 02:07:21 +00:00
parent 47465ec4e0
commit e71b4c784d
24 changed files with 794 additions and 716 deletions

View file

@ -1,10 +1,10 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others. * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - initial API and implementation. * Uwe Stieber (Wind River) - initial API and implementation.
********************************************************************************/ ********************************************************************************/
@ -21,24 +21,24 @@ import org.eclipse.swt.widgets.Widget;
/** /**
* The SafeTreeViewer wraps an SWT TreeViewer in order to avoid * The SafeTreeViewer wraps an SWT TreeViewer in order to avoid
* exceptions due to accessing already disposed items. * exceptions due to accessing already disposed items.
* *
* The main reason for this wrapping is that delayed label providers * The main reason for this wrapping is that delayed label providers
* (i.e. instances of {@link IDelayedLabelDecorator}) can trigger tree * (i.e. instances of {@link IDelayedLabelDecorator}) can trigger tree
* item updates called in the viewer after the tree item itself got * item updates called in the viewer after the tree item itself got
* disposed already. This happens especially if items appear and * disposed already. This happens especially if items appear and
* disappear very fast within the tree which then will lead to nasty * disappear very fast within the tree which then will lead to nasty
* SWT Widget already disposed exceptions. * SWT Widget already disposed exceptions.
* *
* Clients may subclass this class. * Clients may subclass this class.
* *
* @since RSE 2.0 * @since RSE 2.0
*/ */
public class SafeTreeViewer extends TreeViewer { public class SafeTreeViewer extends TreeViewer {
/** /**
* Constructor. * Constructor.
* *
* @param parent The parant control. * @param parent The parent control.
*/ */
public SafeTreeViewer(Composite parent) { public SafeTreeViewer(Composite parent) {
super(parent); super(parent);
@ -46,7 +46,7 @@ public class SafeTreeViewer extends TreeViewer {
/** /**
* Constructor. * Constructor.
* *
* @param tree The tree control. * @param tree The tree control.
*/ */
public SafeTreeViewer(Tree tree) { public SafeTreeViewer(Tree tree) {
@ -55,7 +55,7 @@ public class SafeTreeViewer extends TreeViewer {
/** /**
* Constructor. * Constructor.
* *
* @param parent The parent control. * @param parent The parent control.
* @param style The SWT style bits passed to the tree creation. * @param style The SWT style bits passed to the tree creation.
*/ */

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin * API to the user actions plugin
@ -28,29 +28,29 @@ package org.eclipse.rse.ui;
/** /**
* Message IDs * Message IDs
*/ */
public interface ISystemMessages public interface ISystemMessages
{ {
public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$ public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$
public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002"; //$NON-NLS-1$ public static final String MSG_CONFIRM_RELOADRSE = "RSEG1002"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NAME_EMPTY = "RSEG1006"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NAME_NOTUNIQUE= "RSEG1007"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NAME_NOTVALID = "RSEG1008"; //$NON-NLS-1$
public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique"; //$NON-NLS-1$ public static final String MSG_VALIDATE_RENAME_NOTUNIQUE= "RSEG1010"; //MSG_VALIDATE_PREFIX + "ReName.NotUnique"; //$NON-NLS-1$
public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew"; //$NON-NLS-1$ public static final String MSG_VALIDATE_RENAME_OLDEQUALSNEW = "RSEG1009"; //MSG_VALIDATE_PREFIX+"ReName.OldEqualsNew"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PROFILENAME_EMPTY = "RSEG1014"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PROFILENAME_NOTUNIQUE= "RSEG1015"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PROFILENAME_NOTVALID = "RSEG1016"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PROFILENAME_RESERVED = "RSEG1040"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PATH_EMPTY = "RSEG1032"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PATH_NOTUNIQUE= "RSEG1033"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PATH_NOTVALID = "RSEG1034"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NOT_NUMERIC = "RSEG1017"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PORT_EMPTY = "RSEG1027"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PORT_NOTVALID = "RSEG1028"; //$NON-NLS-1$
@ -60,7 +60,7 @@ public interface ISystemMessages
public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021"; //$NON-NLS-1$ public static final String MSG_VALIDATE_CONNECTIONNAME_EMPTY= "RSEG1021"; //$NON-NLS-1$
public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022"; //$NON-NLS-1$ public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE = "RSEG1022"; //$NON-NLS-1$
public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041"; //$NON-NLS-1$ public static final String MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE_OTHERPROFILE = "RSEG1041"; //$NON-NLS-1$
public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired"; //$NON-NLS-1$ public static final String MSG_VALIDATE_HOSTNAME_EMPTY= "RSEG1024"; //MSG_VALIDATE_PREFIX + "HostNameRequired"; //$NON-NLS-1$
public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025"; //$NON-NLS-1$ public static final String MSG_VALIDATE_USERID_EMPTY = "RSEG1025"; //$NON-NLS-1$
public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026"; //$NON-NLS-1$ public static final String MSG_VALIDATE_USERID_NOTVALID = "RSEG1026"; //$NON-NLS-1$
@ -71,10 +71,10 @@ public interface ISystemMessages
public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERPOOLNAME_EMPTY = "RSEG1037"; //$NON-NLS-1$
public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE= "RSEG1038"; //$NON-NLS-1$
public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERNAME_EMPTY = "RSEG1042"; //$NON-NLS-1$
public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERNAME_NOTUNIQUE= "RSEG1043"; //$NON-NLS-1$
public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$ public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$
public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045"; //$NON-NLS-1$ public static final String MSG_VALIDATE_FILTERSTRING_EMPTY = "RSEG1045"; //$NON-NLS-1$
@ -85,21 +85,21 @@ public interface ISystemMessages
public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NUMBER_EMPTY = "RSEG1170"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NUMBER_NOTVALID = "RSEG1171"; //$NON-NLS-1$
public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172"; //$NON-NLS-1$ public static final String MSG_VALIDATE_NUMBER_OUTOFRANGE= "RSEG1172"; //$NON-NLS-1$
public static final String MSG_CONFIRM_DELETE = "RSEG1052"; //$NON-NLS-1$ public static final String MSG_CONFIRM_DELETE = "RSEG1052"; //$NON-NLS-1$
public static final String MSG_CONFIRM_CHANGES = "RSEG1201"; //$NON-NLS-1$ public static final String MSG_CONFIRM_CHANGES = "RSEG1201"; //$NON-NLS-1$
//public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save.";
//public static final String MSG_SAVE_PREFIX = MSG_PREFIX + "Save.";
public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_SAVE_FAILED = "RSEG1050"; //MSG_SAVE_PREFIX + "Failed"; //$NON-NLS-1$
//public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception."; //public static final String MSG_EXCEPTION_PREFIX = MSG_PREFIX + "Exception.";
public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$ public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$
public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$ public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$
public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$ public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$
//public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query."; //public static final String MSG_QUERY_PREFIX = MSG_PREFIX + "Query.";
public static final String MSG_QUERY_PROGRESS = "RSEG1095"; //$NON-NLS-1$ public static final String MSG_QUERY_PROGRESS = "RSEG1095"; //$NON-NLS-1$
@ -127,8 +127,8 @@ public interface ISystemMessages
public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090"; //$NON-NLS-1$ public static final String MSG_MOVEFILTERSTRINGS_PROGRESS="RSEG1090"; //$NON-NLS-1$
public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091"; //$NON-NLS-1$ public static final String MSG_MOVEFILTERSTRING_PROGRESS ="RSEG1091"; //$NON-NLS-1$
public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092"; //$NON-NLS-1$ public static final String MSG_MOVEFILTERPOOL_COMPLETE = "RSEG1092"; //$NON-NLS-1$
public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115"; //$NON-NLS-1$ public static final String MSG_COPYGENERIC_PROGRESS = "RSEG1115"; //$NON-NLS-1$
public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116"; //$NON-NLS-1$ public static final String MSG_MOVEGENERIC_PROGRESS = "RSEG1116"; //$NON-NLS-1$
public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117"; //$NON-NLS-1$ public static final String MSG_COPYTHINGGENERIC_PROGRESS = "RSEG1117"; //$NON-NLS-1$
@ -141,14 +141,14 @@ public interface ISystemMessages
public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$ public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$
public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$ public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$
public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$ public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$
public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$ public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$
public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503 //$NON-NLS-1$ public static final String MSG_FILTERPOOL_CREATED = "RSEG1160"; // defect 42503 //$NON-NLS-1$
public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161"; //$NON-NLS-1$ public static final String MSG_UPDATEFILTER_FAILED = "RSEG1161"; //$NON-NLS-1$
public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162"; //$NON-NLS-1$ public static final String MSG_RENAMEFILTER_FAILED = "RSEG1162"; //$NON-NLS-1$
//public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation."; //public static final String MSG_OPERATION_PREFIX = MSG_PREFIX + "Operation.";
public static final String MSG_OPERATION_FAILED = "RSEG1066"; //$NON-NLS-1$ public static final String MSG_OPERATION_FAILED = "RSEG1066"; //$NON-NLS-1$
public static final String MSG_OPERATION_CANCELLED = "RSEG1067"; //$NON-NLS-1$ public static final String MSG_OPERATION_CANCELLED = "RSEG1067"; //$NON-NLS-1$
@ -156,24 +156,23 @@ public interface ISystemMessages
public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$ public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$
public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$ public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$
public static final String MSG_ENCODING_NOT_SUPPORTED = "RSEG1244"; //$NON-NLS-1$ public static final String MSG_ENCODING_NOT_SUPPORTED = "RSEG1244"; //$NON-NLS-1$
// -------------------------- // --------------------------
// UNIVERSAL FILE MESSAGES... // UNIVERSAL FILE MESSAGES...
// -------------------------- // --------------------------
/** @since 3.0 */
public static final String FILEMSG_RENAME_INTERRUPTED = "RSEG1246"; //$NON-NLS-1$ public static final String FILEMSG_RENAME_INTERRUPTED = "RSEG1246"; //$NON-NLS-1$
/** /** @since 3.0 */
* @since 3.0
*/
public static final String FILEMSG_DELETE_INTERRUPTED = "RSEG1247"; //$NON-NLS-1$ public static final String FILEMSG_DELETE_INTERRUPTED = "RSEG1247"; //$NON-NLS-1$
// -------------------------- // --------------------------
// SYSTEM VIEW MESSAGES... // SYSTEM VIEW MESSAGES...
// -------------------------- // --------------------------
//public static final String MSG_EXPAND_PREFIX = MSG_PREFIX + "Expand."; //public static final String MSG_EXPAND_PREFIX = MSG_PREFIX + "Expand.";
public static final String MSG_EXPAND_FAILED = "RSEG1098"; //MSG_EXPAND_PREFIX + "Failed"; //$NON-NLS-1$ public static final String MSG_EXPAND_FAILED = "RSEG1098"; //MSG_EXPAND_PREFIX + "Failed"; //$NON-NLS-1$
public static final String MSG_EXPAND_CANCELLED = "RSEG1067"; //MSG_EXPAND_PREFIX + "Cancelled"; //$NON-NLS-1$ public static final String MSG_EXPAND_CANCELLED = "RSEG1067"; //MSG_EXPAND_PREFIX + "Cancelled"; //$NON-NLS-1$
@ -182,7 +181,7 @@ public interface ISystemMessages
public static final String MSG_EXPAND_EMPTY = "RSEG1100"; //MSG_EXPAND_PREFIX + "Empty"; //$NON-NLS-1$ public static final String MSG_EXPAND_EMPTY = "RSEG1100"; //MSG_EXPAND_PREFIX + "Empty"; //$NON-NLS-1$
public static final String MSG_EXPAND_FILTERCREATED = "RSEG1102"; //MSG_EXPAND_PREFIX + "FilterCreated"; //$NON-NLS-1$ public static final String MSG_EXPAND_FILTERCREATED = "RSEG1102"; //MSG_EXPAND_PREFIX + "FilterCreated"; //$NON-NLS-1$
public static final String MSG_EXPAND_CONNECTIONCREATED = "RSEG1108"; //MSG_EXPAND_PREFIX + "ConnectionCreated"; //$NON-NLS-1$ public static final String MSG_EXPAND_CONNECTIONCREATED = "RSEG1108"; //MSG_EXPAND_PREFIX + "ConnectionCreated"; //$NON-NLS-1$
//public static final String MSG_LIST_PREFIX = MSG_PREFIX + "List."; //public static final String MSG_LIST_PREFIX = MSG_PREFIX + "List.";
public static final String MSG_LIST_CANCELLED = "RSEG1101"; //MSG_LIST_PREFIX + "Cancelled"; //$NON-NLS-1$ public static final String MSG_LIST_CANCELLED = "RSEG1101"; //MSG_LIST_PREFIX + "Cancelled"; //$NON-NLS-1$
@ -197,7 +196,7 @@ public interface ISystemMessages
// -------------------------- // --------------------------
// Generic messages, must substitute in values... // Generic messages, must substitute in values...
// -------------------------- // --------------------------
public static final String MSG_GENERIC_I = "RSEO1010"; //$NON-NLS-1$ public static final String MSG_GENERIC_I = "RSEO1010"; //$NON-NLS-1$
public static final String MSG_GENERIC_W = "RSEO1011"; //$NON-NLS-1$ public static final String MSG_GENERIC_W = "RSEO1011"; //$NON-NLS-1$
public static final String MSG_GENERIC_E = "RSEO1012"; //$NON-NLS-1$ public static final String MSG_GENERIC_E = "RSEO1012"; //$NON-NLS-1$
@ -213,7 +212,7 @@ public interface ISystemMessages
// ---------------------------------- // ----------------------------------
// COMMUNICATIONS ERROR CHECKING MESSAGES... // COMMUNICATIONS ERROR CHECKING MESSAGES...
// ---------------------------------- // ----------------------------------
public static final String MSG_COMM_PWD_INVALID = "RSEC1004"; //$NON-NLS-1$ public static final String MSG_COMM_PWD_INVALID = "RSEC1004"; //$NON-NLS-1$
public static final String MSG_COMM_PWD_EXISTS = "RSEC2101"; //$NON-NLS-1$ public static final String MSG_COMM_PWD_EXISTS = "RSEC2101"; //$NON-NLS-1$
@ -223,14 +222,14 @@ public interface ISystemMessages
public static final String MSG_COMM_ENVVAR_DUPLICATE = "RSEC2001"; //$NON-NLS-1$ public static final String MSG_COMM_ENVVAR_DUPLICATE = "RSEC2001"; //$NON-NLS-1$
public static final String MSG_COMM_ENVVAR_NONAME = "RSEC2002"; //$NON-NLS-1$ public static final String MSG_COMM_ENVVAR_NONAME = "RSEC2002"; //$NON-NLS-1$
public static final String MSG_COMM_ENVVAR_INVALIDCHAR = "RSEC2004"; //$NON-NLS-1$ public static final String MSG_COMM_ENVVAR_INVALIDCHAR = "RSEC2004"; //$NON-NLS-1$
public static final String MSG_COMM_PORT_WARNING = "RSEC2306"; //$NON-NLS-1$ public static final String MSG_COMM_PORT_WARNING = "RSEC2306"; //$NON-NLS-1$
// Unexpected error message // Unexpected error message
public static final String MSG_ERROR_UNEXPECTED = "RSEF8002"; //$NON-NLS-1$ public static final String MSG_ERROR_UNEXPECTED = "RSEF8002"; //$NON-NLS-1$
// file transfer message // file transfer message
public static final String MSG_TRANSFER_INVALID = "RSEG1270"; //$NON-NLS-1$ public static final String MSG_TRANSFER_INVALID = "RSEG1270"; //$NON-NLS-1$
} }

View file

@ -19,8 +19,10 @@ package org.eclipse.rse.ui;
import org.eclipse.ui.model.WorkbenchAdapter; import org.eclipse.ui.model.WorkbenchAdapter;
/** /**
* Abstract base class with basic implementations of the <code>IRSEAdapter</code> interface. * Abstract base class with basic implementations of the
* Intended to be subclassed. * <code>IRSEAdapter</code> interface. Intended to be subclassed.
*
* @since org.eclipse.rse.ui 3.0
*/ */
public abstract class RSEAdapter extends WorkbenchAdapter implements IRSEAdapter { public abstract class RSEAdapter extends WorkbenchAdapter implements IRSEAdapter {

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - moved methods to SystemPreferencesManager. * David Dykstal (IBM) - moved methods to SystemPreferencesManager.
* Uwe Stieber (Wind River) - bugfixing. * Uwe Stieber (Wind River) - bugfixing.
@ -26,9 +26,9 @@
* David Dykstal (IBM) - [189858] Delay the creation of the remote systems project * David Dykstal (IBM) - [189858] Delay the creation of the remote systems project
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin * API to the user actions plugin
* David Dykstal (IBM) - [191038] initialize SystemRegistryUI without a log file, it was not used * David Dykstal (IBM) - [191038] initialize SystemRegistryUI without a log file, it was not used
* David McKnight (IBM) - [196838] Don't recreate local after it has been deleted * David McKnight (IBM) - [196838] Don't recreate local after it has been deleted
* David Dykstal (IBM) - [197036] formatted the initialize job to be able to read it * David Dykstal (IBM) - [197036] formatted the initialize job to be able to read it
* Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core * Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core
* David Dykstal (IBM) - [197167] adding notification and waiting for RSE model * David Dykstal (IBM) - [197167] adding notification and waiting for RSE model
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
@ -72,30 +72,30 @@ import org.osgi.framework.BundleContext;
*/ */
public class RSEUIPlugin extends SystemBasePlugin public class RSEUIPlugin extends SystemBasePlugin
{ {
public static final String PLUGIN_ID = "org.eclipse.rse.ui"; //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.rse.ui"; //$NON-NLS-1$
public static final String HELPPREFIX = "org.eclipse.rse.ui."; //$NON-NLS-1$ public static final String HELPPREFIX = "org.eclipse.rse.ui."; //$NON-NLS-1$
public static final boolean INCLUDE_LOCAL_YES = true; public static final boolean INCLUDE_LOCAL_YES = true;
public static final boolean INCLUDE_LOCAL_NO = false; public static final boolean INCLUDE_LOCAL_NO = false;
private static RSEUIPlugin inst = null; private static RSEUIPlugin inst = null;
private static SystemMessageFile messageFile = null; private static SystemMessageFile messageFile = null;
private static SystemMessageFile defaultMessageFile = null; private static SystemMessageFile defaultMessageFile = null;
private Vector viewSuppliers = new Vector(); private Vector viewSuppliers = new Vector();
private SystemViewAdapterFactory svaf; // for fastpath access private SystemViewAdapterFactory svaf; // for fastpath access
private SystemTeamViewResourceAdapterFactory svraf; // for fastpath private SystemTeamViewResourceAdapterFactory svraf; // for fastpath
private boolean loggingSystemMessageLine = false; private boolean loggingSystemMessageLine = false;
/** /**
* Constructor for SystemsPlugin * Constructor for SystemsPlugin
*/ */
public RSEUIPlugin() public RSEUIPlugin()
{ {
super(); super();
if (inst == null) if (inst == null)
{ {
inst = this; inst = this;
} }
@ -105,7 +105,7 @@ public class RSEUIPlugin extends SystemBasePlugin
* Return singleton. Same as inherited getBaseDefault but returned object * Return singleton. Same as inherited getBaseDefault but returned object
* is typed as RSEUIPlugin versus SystemBasePlugin. * is typed as RSEUIPlugin versus SystemBasePlugin.
*/ */
public static RSEUIPlugin getDefault() public static RSEUIPlugin getDefault()
{ {
return inst; return inst;
} }
@ -119,7 +119,7 @@ public class RSEUIPlugin extends SystemBasePlugin
/** /**
* Set whether or not to log the messages shown on the system message line for dialogs * Set whether or not to log the messages shown on the system message line for dialogs
* and wizards. These message are typically validation messages for fields. * and wizards. These message are typically validation messages for fields.
* These are logged using the RSE logging settings. The default is to not log * These are logged using the RSE logging settings. The default is to not log
* these messages. * these messages.
* @param flag true if logging of these messages is desired, false otherwise. * @param flag true if logging of these messages is desired, false otherwise.
@ -127,18 +127,18 @@ public class RSEUIPlugin extends SystemBasePlugin
public void setLoggingSystemMessageLine(boolean flag) { public void setLoggingSystemMessageLine(boolean flag) {
loggingSystemMessageLine = flag; loggingSystemMessageLine = flag;
} }
/** /**
* @return true if we are logging messages displayed on the system message line. * @return true if we are logging messages displayed on the system message line.
*/ */
public boolean getLoggingSystemMessageLine() { public boolean getLoggingSystemMessageLine() {
return loggingSystemMessageLine; return loggingSystemMessageLine;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.SystemBasePlugin#initializeImageRegistry() * @see org.eclipse.rse.core.SystemBasePlugin#initializeImageRegistry()
*/ */
protected void initializeImageRegistry() protected void initializeImageRegistry()
{ {
//SystemElapsedTimer timer = new SystemElapsedTimer(); //SystemElapsedTimer timer = new SystemElapsedTimer();
//timer.setStartTime(); //timer.setStartTime();
@ -150,7 +150,7 @@ public class RSEUIPlugin extends SystemBasePlugin
*/ */
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD_ID,
path+ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD); path+ISystemIconConstants.ICON_SYSTEM_NEWPROFILEWIZARD);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD_ID,
path+ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD); path+ISystemIconConstants.ICON_SYSTEM_NEWCONNECTIONWIZARD);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID,
@ -162,10 +162,10 @@ public class RSEUIPlugin extends SystemBasePlugin
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD_ID,
path+ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD); path+ISystemIconConstants.ICON_SYSTEM_NEWFILEWIZARD);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD_ID,
path+ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD); path+ISystemIconConstants.ICON_SYSTEM_NEWFOLDERWIZARD);
// Things... // Things...
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ID,
path+ISystemIconConstants.ICON_SYSTEM_PROFILE); path+ISystemIconConstants.ICON_SYSTEM_PROFILE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROFILE_ACTIVE_ID,
@ -190,13 +190,13 @@ public class RSEUIPlugin extends SystemBasePlugin
path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVE); path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN_ID,
path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN); path+ISystemIconConstants.ICON_SYSTEM_ROOTDRIVEOPEN);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROCESS_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROCESS_ID,
path+ISystemIconConstants.ICON_SYSTEM_PROCESS); path+ISystemIconConstants.ICON_SYSTEM_PROCESS);
// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_TARGET_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_TARGET_ID,
// path+ISystemIconConstants.ICON_SYSTEM_TARGET); // path+ISystemIconConstants.ICON_SYSTEM_TARGET);
// Message icons: REDUNDANT // Message icons: REDUNDANT
/* /*
putImageInRegistry(ISystemConstants.ICON_SYSTEM_SMALLERROR_ID, putImageInRegistry(ISystemConstants.ICON_SYSTEM_SMALLERROR_ID,
@ -240,13 +240,13 @@ public class RSEUIPlugin extends SystemBasePlugin
path+ISystemIconConstants.ICON_SYSTEM_MOVE); path+ISystemIconConstants.ICON_SYSTEM_MOVE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ID,
path+ISystemIconConstants.ICON_SYSTEM_CLEAR); path+ISystemIconConstants.ICON_SYSTEM_CLEAR);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL_ID,
path+ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL); path+ISystemIconConstants.ICON_SYSTEM_CLEAR_ALL);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED_ID,
path+ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED); path+ISystemIconConstants.ICON_SYSTEM_CLEAR_SELECTED);
//putImageInRegistry(ISystemConstants.ICON_SYSTEM_DELETE_ID, //putImageInRegistry(ISystemConstants.ICON_SYSTEM_DELETE_ID,
// path+ISystemConstants.ICON_SYSTEM_DELETE); // path+ISystemConstants.ICON_SYSTEM_DELETE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_DELETEREF_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_DELETEREF_ID,
@ -254,9 +254,9 @@ public class RSEUIPlugin extends SystemBasePlugin
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RENAME_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RENAME_ID,
path+ISystemIconConstants.ICON_SYSTEM_RENAME); path+ISystemIconConstants.ICON_SYSTEM_RENAME);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RUN_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_RUN_ID,
path+ISystemIconConstants.ICON_SYSTEM_RUN); path+ISystemIconConstants.ICON_SYSTEM_RUN);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID,
path+ISystemIconConstants.ICON_SYSTEM_STOP); path+ISystemIconConstants.ICON_SYSTEM_STOP);
// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID,
// path+ISystemIconConstants.ICON_SYSTEM_COMPILE); // path+ISystemIconConstants.ICON_SYSTEM_COMPILE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID,
@ -283,7 +283,7 @@ public class RSEUIPlugin extends SystemBasePlugin
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID,
path+ISystemIconConstants.ICON_SYSTEM_REFRESH); path+ISystemIconConstants.ICON_SYSTEM_REFRESH);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFILE_ID,
path+ISystemIconConstants.ICON_SYSTEM_NEWFILE); path+ISystemIconConstants.ICON_SYSTEM_NEWFILE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDER_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_NEWFOLDER_ID,
@ -291,24 +291,24 @@ public class RSEUIPlugin extends SystemBasePlugin
//putImageInRegistry(ISystemConstants.ICON_SYSTEM_COLLAPSEALL_ID, //putImageInRegistry(ISystemConstants.ICON_SYSTEM_COLLAPSEALL_ID,
// path+ISystemConstants.ICON_SYSTEM_COLLAPSEALL); // defect 41203 D54577 // path+ISystemConstants.ICON_SYSTEM_COLLAPSEALL); // defect 41203 D54577
// System view icons... // System view icons...
//putImageInRegistry(ISystemConstants.ICON_SYSTEM_VIEW_ID, // only needed from plugin.xml //putImageInRegistry(ISystemConstants.ICON_SYSTEM_VIEW_ID, // only needed from plugin.xml
// path+ISystemConstants.ICON_SYSTEM_VIEW); // path+ISystemConstants.ICON_SYSTEM_VIEW);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ERROR_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ERROR_ID,
path+ISystemIconConstants.ICON_SYSTEM_ERROR); path+ISystemIconConstants.ICON_SYSTEM_ERROR);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_ID,
path+ISystemIconConstants.ICON_SYSTEM_INFO); path+ISystemIconConstants.ICON_SYSTEM_INFO);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_TREE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_INFO_TREE_ID,
path+ISystemIconConstants.ICON_SYSTEM_INFO_TREE); path+ISystemIconConstants.ICON_SYSTEM_INFO_TREE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CANCEL_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CANCEL_ID,
path+ISystemIconConstants.ICON_SYSTEM_CANCEL); path+ISystemIconConstants.ICON_SYSTEM_CANCEL);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_HELP_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_HELP_ID,
@ -317,30 +317,30 @@ public class RSEUIPlugin extends SystemBasePlugin
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EMPTY_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_EMPTY_ID,
path+ISystemIconConstants.ICON_SYSTEM_EMPTY); path+ISystemIconConstants.ICON_SYSTEM_EMPTY);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_OK_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_OK_ID,
path+ISystemIconConstants.ICON_SYSTEM_OK); path+ISystemIconConstants.ICON_SYSTEM_OK);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WARNING_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WARNING_ID,
path+ISystemIconConstants.ICON_SYSTEM_WARNING); path+ISystemIconConstants.ICON_SYSTEM_WARNING);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_BLANK_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_BLANK_ID,
path+ISystemIconConstants.ICON_SYSTEM_BLANK); path+ISystemIconConstants.ICON_SYSTEM_BLANK);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_ID,
path+ISystemIconConstants.ICON_SYSTEM_SEARCH); path+ISystemIconConstants.ICON_SYSTEM_SEARCH);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT_ID,
path+ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT); path+ISystemIconConstants.ICON_SYSTEM_SEARCH_RESULT);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE_ID,
path + ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE); path + ISystemIconConstants.ICON_SYSTEM_SHOW_TABLE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR_ID,
path + ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR); path + ISystemIconConstants.ICON_SYSTEM_SHOW_MONITOR);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE_ID,
path + ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE); path + ISystemIconConstants.ICON_SYSTEM_PERSPECTIVE);
putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID, putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID,
path + ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES); path + ISystemIconConstants.ICON_SEARCH_REMOVE_SELECTED_MATCHES);
putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES_ID, putImageInRegistry(ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES_ID,
path + ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES); path + ISystemIconConstants.ICON_SEARCH_REMOVE_ALL_MATCHES);
@ -352,75 +352,77 @@ public class RSEUIPlugin extends SystemBasePlugin
putImageInRegistry(ISystemConstants.ICON_INHERITWIDGET_INTERIM_ID, putImageInRegistry(ISystemConstants.ICON_INHERITWIDGET_INTERIM_ID,
path+ISystemConstants.ICON_INHERITWIDGET_INTERIM); path+ISystemConstants.ICON_INHERITWIDGET_INTERIM);
*/ */
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_UP_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_UP_ID,
path+ISystemIconConstants.ICON_SYSTEM_ARROW_UP); path+ISystemIconConstants.ICON_SYSTEM_ARROW_UP);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID,
path+ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN); path+ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE_ID,
path+ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE); path+ISystemIconConstants.ICON_SYSTEM_CONNECTOR_SERVICE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SERVICE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_SERVICE_ID,
path+ISystemIconConstants.ICON_SYSTEM_SERVICE); path+ISystemIconConstants.ICON_SYSTEM_SERVICE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID,
path+ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION); path+ISystemIconConstants.ICON_SYSTEM_LAUNCHER_CONFIGURATION);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROPERTIES_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_PROPERTIES_ID,
path+ISystemIconConstants.ICON_SYSTEM_PROPERTIES); path+ISystemIconConstants.ICON_SYSTEM_PROPERTIES);
// close to 1 second... // close to 1 second...
//timer.setEndTime(); //timer.setEndTime();
//System.out.println("Time to load images: "+timer); //System.out.println("Time to load images: "+timer);
} }
/** /**
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/ */
public void start(BundleContext context) throws Exception public void start(BundleContext context) throws Exception
{ {
super.start(context); super.start(context);
messageFile = getMessageFile("systemmessages.xml"); //$NON-NLS-1$ messageFile = getMessageFile("systemmessages.xml"); //$NON-NLS-1$
defaultMessageFile = getDefaultMessageFile("systemmessages.xml"); //$NON-NLS-1$ defaultMessageFile = getDefaultMessageFile("systemmessages.xml"); //$NON-NLS-1$
//Force load the SystemRegistry - TODO Is this really necessary? //Force load the SystemRegistry - TODO Is this really necessary?
RSECorePlugin.getTheSystemRegistry(); RSECorePlugin.getTheSystemRegistry();
IAdapterManager manager = Platform.getAdapterManager(); IAdapterManager manager = Platform.getAdapterManager();
// DKM // DKM
// for subsystem factories // for subsystem factories
SubSystemConfigurationAdapterFactory ssfaf = new SubSystemConfigurationAdapterFactory(); SubSystemConfigurationAdapterFactory ssfaf = new SubSystemConfigurationAdapterFactory();
ssfaf.registerWithManager(manager); ssfaf.registerWithManager(manager);
RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory(); RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory();
rseSysTypeFactory.registerWithManager(manager); rseSysTypeFactory.registerWithManager(manager);
manager.registerAdapters(new SubSystemConfigurationProxyAdapterFactory(), ISubSystemConfigurationProxy.class); manager.registerAdapters(new SubSystemConfigurationProxyAdapterFactory(), ISubSystemConfigurationProxy.class);
svaf = new SystemViewAdapterFactory(); svaf = new SystemViewAdapterFactory();
svaf.registerWithManager(manager); svaf.registerWithManager(manager);
svraf = new SystemTeamViewResourceAdapterFactory(); svraf = new SystemTeamViewResourceAdapterFactory();
svraf.registerWithManager(manager); svraf.registerWithManager(manager);
Job initJob = new RSEUIInitJob(); Job initJob = new RSEUIInitJob();
initJob.schedule(); initJob.schedule();
} }
/** /**
* For fastpath access to our adapters for non-local objects in our model. * For fastpath access to our adapters for non-local objects in our model.
* Exploits the knowledge we use singleton adapters. * Exploits the knowledge we use singleton adapters.
*/ *
* @since 3.0 returning IAdapterFactory rather than SystemViewAdapterFactory
*/
public IAdapterFactory getSystemViewAdapterFactory() public IAdapterFactory getSystemViewAdapterFactory()
{ {
return svaf; return svaf;
} }
/** /**
* Restart the whole thing after a team synchronization * Restart the whole thing after a team synchronization
*/ */
@ -428,7 +430,7 @@ public class RSEUIPlugin extends SystemBasePlugin
{ {
if (RSECorePlugin.isTheSystemRegistryActive()) { if (RSECorePlugin.isTheSystemRegistryActive()) {
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
// disconnect all active connections // disconnect all active connections
disconnectAll(false); // don't save ? disconnectAll(false); // don't save ?
// collapse and flush all nodes in all views // collapse and flush all nodes in all views
@ -436,7 +438,7 @@ public class RSEUIPlugin extends SystemBasePlugin
// allow child classes to override // allow child classes to override
closeViews(); closeViews();
// clear in-memory settings for all filter pools and subsystems // clear in-memory settings for all filter pools and subsystems
ISubSystemConfigurationProxy[] proxies = sr.getSubSystemConfigurationProxies(); ISubSystemConfigurationProxy[] proxies = sr.getSubSystemConfigurationProxies();
if (proxies != null) { if (proxies != null) {
@ -455,9 +457,9 @@ public class RSEUIPlugin extends SystemBasePlugin
for (int idx=0; idx < proxies.length; idx++) for (int idx=0; idx < proxies.length; idx++)
proxies[idx].restore(); proxies[idx].restore();
} }
// refresh GUIs // refresh GUIs
sr.fireEvent(new SystemResourceChangeEvent(sr, ISystemResourceChangeEvents.EVENT_REFRESH, null)); sr.fireEvent(new SystemResourceChangeEvent(sr, ISystemResourceChangeEvents.EVENT_REFRESH, null));
// allow child classes to override // allow child classes to override
openViews(); openViews();
@ -498,15 +500,15 @@ public class RSEUIPlugin extends SystemBasePlugin
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/ */
public void stop(BundleContext context) throws Exception { public void stop(BundleContext context) throws Exception {
// disconnect all active connections // disconnect all active connections
disconnectAll(true); disconnectAll(true);
// remove workspace listener for our project // remove workspace listener for our project
SystemResourceManager.endResourceEventListening(); SystemResourceManager.endResourceEventListening();
// call this last // call this last
super.stop(context); super.stop(context);
} }
@ -551,7 +553,7 @@ public class RSEUIPlugin extends SystemBasePlugin
} }
} }
} }
/** /**
* Test if the SystemRegistry has been instantiated already. * Test if the SystemRegistry has been instantiated already.
* Use this when you don't want to start the system registry as a side effect of retrieving it. * Use this when you don't want to start the system registry as a side effect of retrieving it.
@ -562,7 +564,7 @@ public class RSEUIPlugin extends SystemBasePlugin
{ {
return RSECorePlugin.isTheSystemRegistryActive(); return RSECorePlugin.isTheSystemRegistryActive();
} }
/** /**
* Return the persistence manager used for persisting RSE profiles. * Return the persistence manager used for persisting RSE profiles.
* @return the persistence manager used for persisting RSE profiles * @return the persistence manager used for persisting RSE profiles
@ -572,7 +574,7 @@ public class RSEUIPlugin extends SystemBasePlugin
{ {
return RSECorePlugin.getThePersistenceManager(); return RSECorePlugin.getThePersistenceManager();
} }
/** /**
* Return the SystemRegistryUI singleton. * Return the SystemRegistryUI singleton.
* @return the SystemRegistryUI singleton. * @return the SystemRegistryUI singleton.
@ -581,7 +583,7 @@ public class RSEUIPlugin extends SystemBasePlugin
{ {
return SystemRegistryUI.getInstance(); return SystemRegistryUI.getInstance();
} }
/** /**
* Return the master profile manager singleton. * Return the master profile manager singleton.
* @return the RSE Profile Manager Singleton. * @return the RSE Profile Manager Singleton.
@ -618,8 +620,8 @@ public class RSEUIPlugin extends SystemBasePlugin
*/ */
public SystemMessageFile getMessageFile(String messageFileName) public SystemMessageFile getMessageFile(String messageFileName)
{ {
return loadMessageFile(getBundle(), messageFileName); return loadMessageFile(getBundle(), messageFileName);
} }
/** /**
* Load a default message file for this plugin for cases where messages haven't been translated. * Load a default message file for this plugin for cases where messages haven't been translated.
@ -628,9 +630,9 @@ public class RSEUIPlugin extends SystemBasePlugin
*/ */
public SystemMessageFile getDefaultMessageFile(String messageFileName) public SystemMessageFile getDefaultMessageFile(String messageFileName)
{ {
return loadDefaultMessageFile(getBundle(), messageFileName); return loadDefaultMessageFile(getBundle(), messageFileName);
} }
/** /**
* Return this plugin's message file. Assumes it has already been loaded via a call to getMessageFile. * Return this plugin's message file. Assumes it has already been loaded via a call to getMessageFile.
*/ */
@ -638,12 +640,12 @@ public class RSEUIPlugin extends SystemBasePlugin
{ {
return messageFile; return messageFile;
} }
public SystemMessage getMessage(String msgId) public SystemMessage getMessage(String msgId)
{ {
return getPluginMessage(msgId); return getPluginMessage(msgId);
} }
/** /**
* Retrieve a message from this plugin's message file * Retrieve a message from this plugin's message file
* @param msgId - the ID of the message to retrieve. This is the concatenation of the * @param msgId - the ID of the message to retrieve. This is the concatenation of the
@ -716,5 +718,5 @@ public class RSEUIPlugin extends SystemBasePlugin
if (viewSuppliers.contains(vs)) if (viewSuppliers.contains(vs))
viewSuppliers.remove(vs); viewSuppliers.remove(vs);
} }
} }

View file

@ -22,15 +22,21 @@ public class DisplayHidableSystemMessageAction extends
{ {
protected IPreferenceStore _store; protected IPreferenceStore _store;
protected String _prefID; protected String _prefID;
/**
* @since 3.0
*/
protected boolean _showYesNo = true; protected boolean _showYesNo = true;
public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID) public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID)
{ {
super(message); super(message);
_store = prefStore; _store = prefStore;
_prefID = prefID; _prefID = prefID;
} }
/**
* @since 3.0
*/
public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID, boolean showYesNo) public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID, boolean showYesNo)
{ {
super(message); super(message);
@ -53,7 +59,7 @@ public class DisplayHidableSystemMessageAction extends
dialog.openQuestionNoException(_showYesNo); dialog.openQuestionNoException(_showYesNo);
rc = dialog.getButtonPressedId(); rc = dialog.getButtonPressedId();
finished = true; finished = true;
} }
} }
} }
} }

View file

@ -277,6 +277,7 @@ public abstract class SystemBaseCopyAction extends SystemBaseDialogAction
/** /**
* Called after all the copy/move operations end, be it successfully or not. * Called after all the copy/move operations end, be it successfully or not.
* Your opportunity to display completion or do post-copy selections/refreshes * Your opportunity to display completion or do post-copy selections/refreshes
* @since 3.0 taking String argument
*/ */
public void copyComplete(String operation) {} public void copyComplete(String operation) {}

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
*******************************************************************************/ *******************************************************************************/
@ -34,19 +34,19 @@ import org.eclipse.swt.widgets.Shell;
/** /**
* Our framework is designed to allow actions to be added to popup menus. * Our framework is designed to allow actions to be added to popup menus.
* Sometimes, we want an expandable or cascading menu item for an action. * Sometimes, we want an expandable or cascading menu item for an action.
* That is what this class is designed for. It represents a populated submenu. * That is what this class is designed for. It represents a populated submenu.
*/ */
public abstract class SystemBaseSubMenuAction public abstract class SystemBaseSubMenuAction
extends SystemBaseAction extends SystemBaseAction
{ {
private SystemSubMenuManager subMenu = null; private SystemSubMenuManager subMenu = null;
protected String actionLabel; protected String actionLabel;
protected String menuID; protected String menuID;
protected boolean createMenuEachTime = true; protected boolean createMenuEachTime = true;
protected boolean populateMenuEachTime = true; protected boolean populateMenuEachTime = true;
private boolean dontCascade = false; private boolean dontCascade = false;
private boolean test; private boolean test;
private static final IAction[] EMPTY_ACTION_ARRAY = new IAction[0]; private static final IAction[] EMPTY_ACTION_ARRAY = new IAction[0];
@ -57,14 +57,14 @@ public abstract class SystemBaseSubMenuAction
* @param tooltip * @param tooltip
* @param image The image to display for this action * @param image The image to display for this action
* @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later. * @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later.
* *
* @deprecated use fields from resource class directly now instead of via ResourceBundle * @deprecated use fields from resource class directly now instead of via ResourceBundle
*/ */
protected SystemBaseSubMenuAction(ResourceBundle rb, String label, String tooltip,ImageDescriptor image,Shell shell) protected SystemBaseSubMenuAction(ResourceBundle rb, String label, String tooltip,ImageDescriptor image,Shell shell)
{ {
super(label, tooltip, image, shell); super(label, tooltip, image, shell);
actionLabel = label; actionLabel = label;
//setTracing(true); //setTracing(true);
} }
@ -73,7 +73,7 @@ public abstract class SystemBaseSubMenuAction
* @param label the label to display. * @param label the label to display.
* @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later. * @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later.
*/ */
protected SystemBaseSubMenuAction(String label, Shell shell) protected SystemBaseSubMenuAction(String label, Shell shell)
{ {
super(label, shell); super(label, shell);
actionLabel = label; actionLabel = label;
@ -85,7 +85,7 @@ public abstract class SystemBaseSubMenuAction
* @param tooltip the tooltip to display. * @param tooltip the tooltip to display.
* @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later. * @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later.
*/ */
protected SystemBaseSubMenuAction(String label, String tooltip, Shell shell) protected SystemBaseSubMenuAction(String label, String tooltip, Shell shell)
{ {
super(label, tooltip, shell); super(label, tooltip, shell);
actionLabel = label; actionLabel = label;
@ -97,13 +97,13 @@ public abstract class SystemBaseSubMenuAction
* @param image the image descriptor for the action. * @param image the image descriptor for the action.
* @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later. * @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later.
*/ */
protected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell) protected SystemBaseSubMenuAction(String label, ImageDescriptor image, Shell shell)
{ {
super(label, image, shell); super(label, image, shell);
actionLabel = label; actionLabel = label;
//setTracing(true); //setTracing(true);
} }
/** /**
* Constructor for SystemBaseSubMenuAction when there is just a string and image * Constructor for SystemBaseSubMenuAction when there is just a string and image
* @param label the label to display. * @param label the label to display.
@ -111,7 +111,7 @@ public abstract class SystemBaseSubMenuAction
* @param image the image descriptor for the action. * @param image the image descriptor for the action.
* @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later. * @param shell the parent shell. If you pass <code>null</code> now, be sure to call {@link #setShell(Shell)} later.
*/ */
protected SystemBaseSubMenuAction(String label, String tooltip, ImageDescriptor image, Shell shell) protected SystemBaseSubMenuAction(String label, String tooltip, ImageDescriptor image, Shell shell)
{ {
super(label, tooltip, image, shell); super(label, tooltip, image, shell);
actionLabel = label; actionLabel = label;
@ -142,7 +142,7 @@ public abstract class SystemBaseSubMenuAction
{ {
this.populateMenuEachTime = eachTime; this.populateMenuEachTime = eachTime;
} }
/** /**
* Set test mode on * Set test mode on
*/ */
@ -151,7 +151,7 @@ public abstract class SystemBaseSubMenuAction
this.test = testMode; this.test = testMode;
} }
/** /**
* <i>Must be overridden</i> * <i>Must be overridden</i>
* <p>Example of this:<p> * <p>Example of this:<p>
@ -209,32 +209,32 @@ public abstract class SystemBaseSubMenuAction
//System.out.println("SubMenu's menu null? " + (m==null)); //System.out.println("SubMenu's menu null? " + (m==null));
//if (m != null) //if (m != null)
//m.addMenuListener(new SystemViewMenuListener()); //m.addMenuListener(new SystemViewMenuListener());
} }
else if (traceSelections) else if (traceSelections)
{ {
issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". SUBMENU ALREADY CREATED. "); //$NON-NLS-1$ //$NON-NLS-2$ issueTraceMessage("*** INSIDE GETSUBMENU for "+actionLabel+". SUBMENU ALREADY CREATED. "); //$NON-NLS-1$ //$NON-NLS-2$
} }
return subMenu; return subMenu;
} }
/** /**
* Creates the standard groups for the context sub-menu. * Creates the standard groups for the context sub-menu.
*/ */
protected void createStandardGroups(IMenuManager menu) protected void createStandardGroups(IMenuManager menu)
{ {
if (!menu.isEmpty()) if (!menu.isEmpty())
return; return;
// simply sets partitions in the menu, into which actions can be directed. // simply sets partitions in the menu, into which actions can be directed.
// Each partition can be delimited by a separator (new Separator) or not (new GroupMarker). // Each partition can be delimited by a separator (new Separator) or not (new GroupMarker).
// Deleted groups are not used yet. // Deleted groups are not used yet.
//... decided it is better to let this get created when needed, else will be at the top of the menu. //... decided it is better to let this get created when needed, else will be at the top of the menu.
//menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions //menu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
} }
/** /**
* Return the actions currently in the menu. * Return the actions currently in the menu.
* Never returns null, but may return an empty array. * Never returns null, but may return an empty array.
*/ */
public IAction[] getActions() public IAction[] getActions()
{ {
@ -264,17 +264,21 @@ public abstract class SystemBaseSubMenuAction
} }
/** /**
* Overridable method that instantiates the menu listener who job is to add mnemonics. * Overridable method that instantiates the menu listener who job is to add
* @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics need only be set once. False if it is dynamic * mnemonics.
*/ *
* @param setMnemonicsOnlyOnce true if the menu is static and so mnemonics
* need only be set once. False if it is dynamic
* @since 3.0 replaced SystemViewMenuListener by ISystemViewMenuListener
*/
protected ISystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce) protected ISystemViewMenuListener createMnemonicsListener(boolean setMnemonicsOnlyOnce)
{ {
return new SystemViewMenuListener(setMnemonicsOnlyOnce); return new SystemViewMenuListener(setMnemonicsOnlyOnce);
} }
/** /**
* Sets the parent shell for this action. This is an override of our parent's method so we can * Sets the parent shell for this action. This is an override of our parent's method so we can
* cascade it to each sub-action. * cascade it to each sub-action.
*/ */
@ -284,29 +288,29 @@ public abstract class SystemBaseSubMenuAction
if (!dontCascade) if (!dontCascade)
cascadeShell(); cascadeShell();
} }
/**
* This is called by the framework to set the selection input, just prior to showing the popup menu.
* We cascade this down to all of the actions added to this submenu.
*/
public void setSelection(ISelection selection)
{
super.setSelection(selection);
if (!dontCascade)
cascadeSelection(selection);
}
/** /**
* This is called by the framework to set the selection input, just prior to showing the popup menu. * This is called by the framework to set the selection input, just prior to showing the popup menu.
* We cascade this down to all of the actions added to this submenu. * We cascade this down to all of the actions added to this submenu.
*/ */
public void setViewer(Viewer v) public void setSelection(ISelection selection)
{ {
super.setSelection(selection);
if (!dontCascade)
cascadeSelection(selection);
}
/**
* This is called by the framework to set the selection input, just prior to showing the popup menu.
* We cascade this down to all of the actions added to this submenu.
*/
public void setViewer(Viewer v)
{
super.setViewer(v); super.setViewer(v);
if (!dontCascade) if (!dontCascade)
cascadeViewer(); cascadeViewer();
} }
/** /**
* Return the shell. If not set locally, queries it from the submenu, which is where it is set by the RSE framework * Return the shell. If not set locally, queries it from the submenu, which is where it is set by the RSE framework
*/ */
@ -343,7 +347,7 @@ public abstract class SystemBaseSubMenuAction
else else
return null; return null;
} }
/** /**
* Special method called by our submenu manager when from its setInputs method. No need to * Special method called by our submenu manager when from its setInputs method. No need to
* cascade as the menu manager will do it for us. * cascade as the menu manager will do it for us.
@ -352,9 +356,9 @@ public abstract class SystemBaseSubMenuAction
{ {
dontCascade = true; // so we don't redundantly do cascading. Phil dontCascade = true; // so we don't redundantly do cascading. Phil
super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer super.setInputs(shell, v, selection); // calls setSelection+Shell+Viewer
dontCascade = false; dontCascade = false;
} }
/** /**
* An optimization for performance reasons that allows all inputs to be set in one call. * An optimization for performance reasons that allows all inputs to be set in one call.
* Intercept of parent so we can cascade to sub-actions. Note however this won't really ever * Intercept of parent so we can cascade to sub-actions. Note however this won't really ever
@ -370,7 +374,7 @@ public abstract class SystemBaseSubMenuAction
issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS"); //$NON-NLS-1$ issueTraceMessage(" INSIDE SETINPUTS IN BASE ACTION CLASS"); //$NON-NLS-1$
cascadeAllInputs(); cascadeAllInputs();
} }
/** /**
* Cascade the current selection to all actions * Cascade the current selection to all actions
*/ */
@ -391,12 +395,12 @@ public abstract class SystemBaseSubMenuAction
{ {
if (actions[idx] instanceof ISystemAction) if (actions[idx] instanceof ISystemAction)
{ {
((ISystemAction)actions[idx]).setSelection(selection); ((ISystemAction)actions[idx]).setSelection(selection);
} }
} }
*/ */
} }
/** /**
* Cascade the current shell to all actions * Cascade the current shell to all actions
*/ */
@ -411,7 +415,7 @@ public abstract class SystemBaseSubMenuAction
/* /*
IAction[] items = subMenu.getActions(); IAction[] items = subMenu.getActions();
for (int idx=0; idx<items.length; idx++) for (int idx=0; idx<items.length; idx++)
if (items[idx] instanceof ISystemAction) if (items[idx] instanceof ISystemAction)
((ISystemAction)items[idx]).setShell(shell); ((ISystemAction)items[idx]).setShell(shell);
*/ */
} }
@ -430,7 +434,7 @@ public abstract class SystemBaseSubMenuAction
/* /*
IAction[] items = subMenu.getActions(); IAction[] items = subMenu.getActions();
for (int idx=0; idx<items.length; idx++) for (int idx=0; idx<items.length; idx++)
if (items[idx] instanceof ISystemAction) if (items[idx] instanceof ISystemAction)
((ISystemAction)items[idx]).setViewer(viewer); ((ISystemAction)items[idx]).setViewer(viewer);
*/ */
} }
@ -461,10 +465,10 @@ public abstract class SystemBaseSubMenuAction
ISystemAction action = (ISystemAction)actions[idx]; ISystemAction action = (ISystemAction)actions[idx];
action.setInputs(shell, viewer, selection); action.setInputs(shell, viewer, selection);
} }
} }
*/ */
} }
/** /**
* Enable/disable this menu action. This amounts to enabling/disabling the associated sub menu. * Enable/disable this menu action. This amounts to enabling/disabling the associated sub menu.
* Unfortunately, there is no way to do this! * Unfortunately, there is no way to do this!
@ -475,6 +479,6 @@ public abstract class SystemBaseSubMenuAction
if (subMenu!=null) if (subMenu!=null)
{ {
//subMenu.setEnabled(enable); //subMenu.setEnabled(enable);
} }
} }
} }

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [190442] made SystemActionViewerFilter API * Martin Oberhuber (Wind River) - [190442] made SystemActionViewerFilter API
@ -45,9 +45,12 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
//private IHost _outputConnection; //private IHost _outputConnection;
private SystemActionViewerFilter _customViewerFilter; private SystemActionViewerFilter _customViewerFilter;
private String _message, _tip; private String _message, _tip;
public SystemRemoteResourceDialog(Shell shell, String title, /**
* @since 3.0 replaced SystemResourceSelectionInputProvider by
* ISystemResourceSelectionInputProvider
*/
public SystemRemoteResourceDialog(Shell shell, String title,
ISystemResourceSelectionInputProvider inputProvider) ISystemResourceSelectionInputProvider inputProvider)
{ {
super(shell, title); super(shell, title);
@ -55,14 +58,14 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
} }
protected Control createInner(Composite parent) protected Control createInner(Composite parent)
{ {
_form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbiage(), _multipleSelectionMode, getMessageLine()); _form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbiage(), _multipleSelectionMode, getMessageLine());
initForm(); initForm();
_form.setPreSelection(_preSelection); _form.setPreSelection(_preSelection);
createMessageLine(parent); createMessageLine(parent);
return _form.getInitialFocusControl(); return _form.getInitialFocusControl();
} }
/** /**
* Create message line. Intercept so we can set msg line of form. * Create message line. Intercept so we can set msg line of form.
*/ */
@ -72,10 +75,10 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_form.setMessageLine(msgLine); _form.setMessageLine(msgLine);
return fMessageLine; return fMessageLine;
} }
public void initForm() public void initForm()
{ {
if (_customViewerFilter != null) if (_customViewerFilter != null)
{ {
_form.applyViewerFilter(_customViewerFilter); _form.applyViewerFilter(_customViewerFilter);
@ -85,7 +88,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_form.applyViewerFilter(getViewerFilter()); _form.applyViewerFilter(getViewerFilter());
} }
_form.setSelectionValidator(_selectionValidator); _form.setSelectionValidator(_selectionValidator);
_form.setPreSelection(_preSelection); _form.setPreSelection(_preSelection);
_form.setShowPropertySheet(_showPropertySheet); _form.setShowPropertySheet(_showPropertySheet);
_form.setSelectionTreeToolTipText(getTreeTip()); _form.setSelectionTreeToolTipText(getTreeTip());
if (_message != null) if (_message != null)
@ -98,17 +101,17 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
{ {
_inputProvider.setSystemConnection(connection, onlyConnection); _inputProvider.setSystemConnection(connection, onlyConnection);
} }
public void setSystemTypes(IRSESystemType[] types) public void setSystemTypes(IRSESystemType[] types)
{ {
_inputProvider.setSystemTypes(types); _inputProvider.setSystemTypes(types);
} }
protected Control getInitialFocusControl() protected Control getInitialFocusControl()
{ {
return _form.getInitialFocusControl(); return _form.getInitialFocusControl();
} }
public void setPreSelection(Object selection) public void setPreSelection(Object selection)
{ {
_preSelection = selection; _preSelection = selection;
@ -117,17 +120,17 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_form.setPreSelection(selection); _form.setPreSelection(selection);
} }
} }
public void setSelectionValidator(IValidatorRemoteSelection validator) public void setSelectionValidator(IValidatorRemoteSelection validator)
{ {
_selectionValidator = validator; _selectionValidator = validator;
} }
public void setCustomViewerFilter(SystemActionViewerFilter viewerFilter) public void setCustomViewerFilter(SystemActionViewerFilter viewerFilter)
{ {
_customViewerFilter = viewerFilter; _customViewerFilter = viewerFilter;
} }
/** /**
* Set multiple selection mode. Default is single selection mode * Set multiple selection mode. Default is single selection mode
* <p> * <p>
@ -137,16 +140,16 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
* Further, if you turn this on, it has the side effect of allowing the user * Further, if you turn this on, it has the side effect of allowing the user
* to select any remote object. The assumption being if you are prompting for * to select any remote object. The assumption being if you are prompting for
* files, you also want to allow the user to select a folder, with the meaning * files, you also want to allow the user to select a folder, with the meaning
* being that all files within the folder are implicitly selected. * being that all files within the folder are implicitly selected.
* *
* @see #getSelectedObjects() * @see #getSelectedObjects()
*/ */
public void setMultipleSelectionMode(boolean multiple) public void setMultipleSelectionMode(boolean multiple)
{ {
_multipleSelectionMode = multiple; _multipleSelectionMode = multiple;
} }
/** /**
* Set the message shown at the top of the form * Set the message shown at the top of the form
*/ */
@ -169,7 +172,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_form.setSelectionTreeToolTipText(tip); _form.setSelectionTreeToolTipText(tip);
} }
} }
/** /**
* Show the property sheet on the right hand side, to show the properties of the * Show the property sheet on the right hand side, to show the properties of the
* selected object. * selected object.
@ -187,7 +190,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
* selected object. * selected object.
* <p> * <p>
* This overload shows a Details>>> button so the user can decide if they want to see the * This overload shows a Details>>> button so the user can decide if they want to see the
* property sheet. * property sheet.
* <p> * <p>
* @param show True if show the property sheet within the dialog * @param show True if show the property sheet within the dialog
* @param initialState True if the property is to be initially displayed, false if it is not * @param initialState True if the property is to be initially displayed, false if it is not
@ -201,10 +204,10 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
setShowDetailsButton(true, !initialState); setShowDetailsButton(true, !initialState);
} }
} }
/** /**
* Return selected file or folder * Return selected file or folder
*/ */
public Object getSelectedObject() public Object getSelectedObject()
{ {
if (getOutputObject() instanceof Object[]) if (getOutputObject() instanceof Object[])
@ -216,7 +219,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
* Return all selected objects. This method will return an array of one * Return all selected objects. This method will return an array of one
* unless you have called setMultipleSelectionMode(true)! * unless you have called setMultipleSelectionMode(true)!
* @see #setMultipleSelectionMode(boolean) * @see #setMultipleSelectionMode(boolean)
*/ */
public Object[] getSelectedObjects() public Object[] getSelectedObjects()
{ {
if (getOutputObject() instanceof Object[]) if (getOutputObject() instanceof Object[])
@ -226,20 +229,20 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
else else
return null; return null;
} }
public IHost getSelectedConnection() public IHost getSelectedConnection()
{ {
return _form.getSelectedConnection(); return _form.getSelectedConnection();
} }
/** /**
* Private method. * Private method.
* <p> * <p>
* Called when user presses OK button. * Called when user presses OK button.
* Return true to close dialog. * Return true to close dialog.
* Return false to not close dialog. * Return false to not close dialog.
*/ */
protected boolean processOK() protected boolean processOK()
{ {
boolean closeDialog = _form.verify(); boolean closeDialog = _form.verify();
if (closeDialog) if (closeDialog)
@ -254,49 +257,54 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
setOutputObject(null); setOutputObject(null);
return closeDialog; return closeDialog;
} }
/** @since 3.0 */
public void setShowNewConnectionPrompt(boolean showNewConnectionPrompt) public void setShowNewConnectionPrompt(boolean showNewConnectionPrompt)
{ {
_inputProvider.setAllowNewConnection(showNewConnectionPrompt); _inputProvider.setAllowNewConnection(showNewConnectionPrompt);
} }
/** /**
* Private method. * Private method.
* <p> * <p>
* Called when user presses DETAILS button. * Called when user presses DETAILS button.
* <p> * <p>
* Note the text is automatically toggled for us! We need only * Note the text is automatically toggled for us! We need only
* do whatever the functionality is that we desire * do whatever the functionality is that we desire
* *
* @param hideMode the current state of the details toggle, prior to this request. If we return true from * @param hideMode the current state of the details toggle, prior to this request. If we return true from
* this method, this state and the button text will be toggled. * this method, this state and the button text will be toggled.
* *
* @return true if the details state toggle was successful, false if it failed. * @return true if the details state toggle was successful, false if it failed.
*/ */
protected boolean processDetails(boolean hideMode) protected boolean processDetails(boolean hideMode)
{ {
_form.toggleShowPropertySheet(getShell(), getContents()); _form.toggleShowPropertySheet(getShell(), getContents());
return true; return true;
} }
/** /**
* Returns the system tree * Returns the system tree
*
* @return the system tree * @return the system tree
* @since 3.0
*/ */
public ISystemTree getSystemTree() public ISystemTree getSystemTree()
{ {
return _form.getSystemTree(); return _form.getSystemTree();
} }
/** /**
* Indicates whether the page for the form is complete or not. * Indicates whether the page for the form is complete or not.
*
* @return true if the page associated with the form is complete * @return true if the page associated with the form is complete
* @since 3.0
*/ */
public boolean isPageComplete() public boolean isPageComplete()
{ {
return _form.isPageComplete(); return _form.isPageComplete();
} }
public abstract SystemActionViewerFilter getViewerFilter(); public abstract SystemActionViewerFilter getViewerFilter();
public abstract String getVerbiage(); public abstract String getVerbiage();
public abstract String getTreeTip(); public abstract String getTreeTip();

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Rupen Mardirossian (IBM) - [208435] When validating name, check for previously used names for multiple renaming instances * Rupen Mardirossian (IBM) - [208435] When validating name, check for previously used names for multiple renaming instances
@ -61,35 +61,35 @@ import org.eclipse.swt.widgets.Widget;
* Dialog for renaming a single resource. Used when only one item selected. * Dialog for renaming a single resource. Used when only one item selected.
* <p> * <p>
* This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction} * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction}
* action. * action.
* <p> * <p>
* To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed. * To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed.
* If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or * If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
* {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking. * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking.
* <p> * <p>
* If the input object does not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you * If the input object does not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you
* should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to * should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
* specify a validator that is called to verify the user-typed new name is valid. Further, to show the type value * specify a validator that is called to verify the user-typed new name is valid. Further, to show the type value
* of the input object, it should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}. * of the input object, it should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
* <p> * <p>
* This dialog does not do the actual renames. Rather, it will return the user-typed new name. This is * This dialog does not do the actual renames. Rather, it will return the user-typed new name. This is
* queriable via {@link #getNewName()}, after testing that {@link #wasCancelled()} is false. * queriable via {@link #getNewName()}, after testing that {@link #wasCancelled()} is false.
* *
* @see org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction * @see org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction
*/ */
public class SystemRenameSingleDialog extends SystemPromptDialog public class SystemRenameSingleDialog extends SystemPromptDialog
implements implements
Runnable Runnable
{ {
public static final boolean COLLISION_MODE = true; public static final boolean COLLISION_MODE = true;
private Button overwriteRadio; private Button overwriteRadio;
//private Button renameRadio; //private Button renameRadio;
private boolean overwriteMode = true; private boolean overwriteMode = true;
private Composite renameGroup; private Composite renameGroup;
private Text newName; private Text newName;
private String promptLabel; private String promptLabel;
private String promptTip; private String promptTip;
@ -98,29 +98,29 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
private Label resourceTypePrompt, resourceTypeValue, verbiageLabel, renameLabel; private Label resourceTypePrompt, resourceTypeValue, verbiageLabel, renameLabel;
private SystemMessage errorMessage; private SystemMessage errorMessage;
private ISystemValidator nameValidator; private ISystemValidator nameValidator;
private ValidatorUniqueString uniqueNameValidator; private ValidatorUniqueString uniqueNameValidator;
private boolean initialized = false; private boolean initialized = false;
private boolean copyCollisionMode = false; private boolean copyCollisionMode = false;
private boolean isRemote = true; private boolean isRemote = true;
private ISystemViewElementAdapter adapter = null; private ISystemViewElementAdapter adapter = null;
private Object inputElement = null; private Object inputElement = null;
private String description = null; private String description = null;
private List _namesInUse = new ArrayList(); private List _namesInUse = new ArrayList();
/** /**
* Constructor * Constructor
*/ */
public SystemRenameSingleDialog(Shell shell) public SystemRenameSingleDialog(Shell shell)
{ {
this(shell, SystemResources.RESID_RENAME_TITLE); this(shell, SystemResources.RESID_RENAME_TITLE);
String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE; String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE;
if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev //$NON-NLS-1$ if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev //$NON-NLS-1$
setTitle(singleTitle); setTitle(singleTitle);
} }
/** /**
* Constructor with a title * Constructor with a title
*/ */
public SystemRenameSingleDialog(Shell shell, String title) public SystemRenameSingleDialog(Shell shell, String title)
{ {
super(shell, title); super(shell, title);
@ -130,38 +130,45 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
} }
/** /**
* Constructor with an input object and validator * Constructor with an input object and validator
* This constructor is in copy/move dialogs when there is a collision * This constructor is in copy/move dialogs when there is a collision
* @param shell The parent dialog * @param shell The parent dialog
* @param copyCollisionMode true if this is being called because of a name collision on a copy or move operation * @param copyCollisionMode true if this is being called because of a name collision on a copy or move operation
* @param inputObject The object that is being renamed, or on a copy/move the object in the target container which already exists. Used to get the old name and the name validator * @param inputObject The object that is being renamed, or on a copy/move the object in the target container which already exists. Used to get the old name and the name validator
* @param nameValidator The name validator to use. Can be null, in which case it is queried from the adapter of the input object * @param nameValidator The name validator to use. Can be null, in which case it is queried from the adapter of the input object
*/ */
public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator) public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator)
{ {
this(shell); this(shell);
setInputObject(inputObject); setInputObject(inputObject);
setCopyCollisionMode(copyCollisionMode); setCopyCollisionMode(copyCollisionMode);
setNameValidator(nameValidator); setNameValidator(nameValidator);
} }
/** /**
* Constructor with an input object and validator * Constructor with an input object and validator This constructor is in
* This constructor is in copy/move dialogs when there is a collision * copy/move dialogs when there is a collision
*
* @param shell The parent dialog * @param shell The parent dialog
* @param copyCollisionMode true if this is being called because of a name collision on a copy or move operation * @param copyCollisionMode true if this is being called because of a name
* @param inputObject The object that is being renamed, or on a copy/move the object in the target container which already exists. Used to get the old name and the name validator * collision on a copy or move operation
* @param nameValidator The name validator to use. Can be null, in which case it is queried from the adapter of the input object * @param inputObject The object that is being renamed, or on a copy/move
* @param nameInUse the List of names that have been previously selected for other files that are to be renamed for multiple file renaming. * the object in the target container which already exists. Used
* to get the old name and the name validator
* @param nameValidator The name validator to use. Can be null, in which
* case it is queried from the adapter of the input object
* @param nameInUse the List of names that have been previously selected for
* other files that are to be renamed for multiple file renaming.
* @since 3.0 added nameInUse argument
*/ */
public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator, List nameInUse) public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator, List nameInUse)
{ {
this(shell); this(shell);
setInputObject(inputObject); setInputObject(inputObject);
setCopyCollisionMode(copyCollisionMode); setCopyCollisionMode(copyCollisionMode);
setNameValidator(nameValidator); setNameValidator(nameValidator);
_namesInUse = nameInUse; _namesInUse = nameInUse;
} }
/** /**
* Set the label and tooltip of the prompt. The default is "New name:" * Set the label and tooltip of the prompt. The default is "New name:"
@ -170,8 +177,8 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
this.promptLabel = label; this.promptLabel = label;
this.promptTip = tooltip; this.promptTip = tooltip;
} }
/** /**
* Indicate this dialog is the result of a copy/move name collision. * Indicate this dialog is the result of a copy/move name collision.
* Affects the title, verbiage at the top of the dialog, and context help. * Affects the title, verbiage at the top of the dialog, and context help.
@ -195,9 +202,9 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
setHelp(RSEUIPlugin.HELPPREFIX+"drns0000"); //$NON-NLS-1$ setHelp(RSEUIPlugin.HELPPREFIX+"drns0000"); //$NON-NLS-1$
String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE; String singleTitle = SystemResources.RESID_RENAME_SINGLE_TITLE;
if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev //$NON-NLS-1$ if (!singleTitle.startsWith("Missing")) // TODO: remove test after next mri rev //$NON-NLS-1$
setTitle(singleTitle); setTitle(singleTitle);
else else
setTitle(SystemResources.RESID_RENAME_TITLE); // older string we know exists setTitle(SystemResources.RESID_RENAME_TITLE); // older string we know exists
} }
this.copyCollisionMode = copyCollisionMode; this.copyCollisionMode = copyCollisionMode;
} }
@ -209,7 +216,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
return copyCollisionMode; return copyCollisionMode;
} }
/** /**
* Set the validator for the new name,as supplied by the adaptor for name checking. * Set the validator for the new name,as supplied by the adaptor for name checking.
@ -234,7 +241,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
/** /**
* @see SystemPromptDialog#getInitialFocusControl() * @see SystemPromptDialog#getInitialFocusControl()
*/ */
protected Control getInitialFocusControl() protected Control getInitialFocusControl()
{ {
//uSystem.out.println("here! " + (newName == null)); //uSystem.out.println("here! " + (newName == null));
return newName; return newName;
@ -243,13 +250,13 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
/** /**
* @see SystemPromptDialog#createInner(Composite) * @see SystemPromptDialog#createInner(Composite)
*/ */
protected Control createInner(Composite parent) protected Control createInner(Composite parent)
{ {
// Inner composite // Inner composite
int nbrColumns = 1; int nbrColumns = 1;
Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns); Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
Object inputObject = getInputObject(); Object inputObject = getInputObject();
if (copyCollisionMode) if (copyCollisionMode)
{ {
@ -263,14 +270,14 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
verbiageLabel = SystemWidgetHelpers.createLabel(composite, description, nbrColumns); verbiageLabel = SystemWidgetHelpers.createLabel(composite, description, nbrColumns);
SystemWidgetHelpers.createLabel(composite, " ", nbrColumns); //filler //$NON-NLS-1$ SystemWidgetHelpers.createLabel(composite, " ", nbrColumns); //filler //$NON-NLS-1$
} }
if (copyCollisionMode) if (copyCollisionMode)
{ {
overwriteRadio = SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_TOOLTIP); overwriteRadio = SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_OVERWRITE_TOOLTIP);
overwriteRadio.setSelection(true); overwriteRadio.setSelection(true);
/*renameRadio =*/ SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_TOOLTIP); /*renameRadio =*/ SystemWidgetHelpers.createRadioButton(composite, this, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_LABEL, SystemResources.RESID_SIMPLE_RENAME_RADIO_RENAME_TOOLTIP);
} }
int nbrRenameColumns = 2; int nbrRenameColumns = 2;
// BEGIN RENAME // BEGIN RENAME
renameGroup = SystemWidgetHelpers.createComposite(composite, nbrRenameColumns); renameGroup = SystemWidgetHelpers.createComposite(composite, nbrRenameColumns);
@ -279,37 +286,37 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
resourceTypePrompt = SystemWidgetHelpers.createLabel(renameGroup, SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_LABEL); resourceTypePrompt = SystemWidgetHelpers.createLabel(renameGroup, SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_LABEL);
resourceTypeValue = SystemWidgetHelpers.createLabel(renameGroup, ""); //$NON-NLS-1$ resourceTypeValue = SystemWidgetHelpers.createLabel(renameGroup, ""); //$NON-NLS-1$
resourceTypeValue.setToolTipText(SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_TOOLTIP); resourceTypeValue.setToolTipText(SystemResources.RESID_SIMPLE_RENAME_RESOURCEPROMPT_TOOLTIP);
// PROMPT // PROMPT
if (promptLabel == null) if (promptLabel == null)
{ {
String labelText = copyCollisionMode ? SystemResources.RESID_COLLISION_RENAME_LABEL : SystemResources.RESID_SIMPLE_RENAME_PROMPT_LABEL; String labelText = copyCollisionMode ? SystemResources.RESID_COLLISION_RENAME_LABEL : SystemResources.RESID_SIMPLE_RENAME_PROMPT_LABEL;
labelText = SystemWidgetHelpers.appendColon(labelText); labelText = SystemWidgetHelpers.appendColon(labelText);
renameLabel = SystemWidgetHelpers.createLabel(renameGroup, labelText); renameLabel = SystemWidgetHelpers.createLabel(renameGroup, labelText);
} }
else else
{ {
renameLabel = SystemWidgetHelpers.createLabel(renameGroup, promptLabel); renameLabel = SystemWidgetHelpers.createLabel(renameGroup, promptLabel);
} }
newName = SystemWidgetHelpers.createTextField(renameGroup, null); newName = SystemWidgetHelpers.createTextField(renameGroup, null);
((GridData)newName.getLayoutData()).widthHint = 300; // make this wider than usual so error messages are not truncated ((GridData)newName.getLayoutData()).widthHint = 300; // make this wider than usual so error messages are not truncated
if (promptTip != null) { if (promptTip != null) {
newName.setToolTipText(promptTip); newName.setToolTipText(promptTip);
} }
// END RENAME // END RENAME
if (inputObject != null) if (inputObject != null)
{ {
initializeInput(); initializeInput();
} }
// init ok to disabled, until they type a new name // init ok to disabled, until they type a new name
setPageComplete(false); setPageComplete(false);
// add keystroke listeners... // add keystroke listeners...
newName.addModifyListener( newName.addModifyListener(
new ModifyListener() { new ModifyListener() {
@ -317,17 +324,17 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
validateNameInput(); validateNameInput();
} }
} }
); );
if (copyCollisionMode) if (copyCollisionMode)
{ {
enableRename(false); enableRename(false);
} }
return composite; return composite;
} }
/** /**
* Override of parent. Must pass selected object onto the form for initializing fields. * Override of parent. Must pass selected object onto the form for initializing fields.
@ -342,7 +349,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
initializeInput(); initializeInput();
} }
} }
private void initializeInput() private void initializeInput()
{ {
if (!initialized) if (!initialized)
@ -354,18 +361,18 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
else if (inputElement instanceof ISystemTypedObject) else if (inputElement instanceof ISystemTypedObject)
inputName = ((ISystemTypedObject)inputElement).getName(); inputName = ((ISystemTypedObject)inputElement).getName();
else if (inputElement instanceof IResource) else if (inputElement instanceof IResource)
inputName = ((IResource)inputElement).getName(); inputName = ((IResource)inputElement).getName();
else if (inputElement instanceof String) else if (inputElement instanceof String)
inputName = (String)inputElement; inputName = (String)inputElement;
newName.setText(inputName); newName.setText(inputName);
if (copyCollisionMode) if (copyCollisionMode)
{ {
verbiageLabel.setText(SystemMessage.sub(SystemResources.RESID_COLLISION_RENAME_VERBIAGE, "&1", inputName)); //$NON-NLS-1$ verbiageLabel.setText(SystemMessage.sub(SystemResources.RESID_COLLISION_RENAME_VERBIAGE, "&1", inputName)); //$NON-NLS-1$
} }
if ((nameValidator == null) && (adapter != null)) if ((nameValidator == null) && (adapter != null))
nameValidator = adapter.getNameValidator(inputElement); nameValidator = adapter.getNameValidator(inputElement);
if (nameValidator != null) if (nameValidator != null)
@ -393,7 +400,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
if (adapter != null) if (adapter != null)
resourceTypeValue.setText(adapter.getType(inputElement)); resourceTypeValue.setText(adapter.getType(inputElement));
else if (inputElement instanceof ISystemTypedObject) else if (inputElement instanceof ISystemTypedObject)
resourceTypeValue.setText(((ISystemTypedObject)inputElement).getType()); resourceTypeValue.setText(((ISystemTypedObject)inputElement).getType());
else if (inputElement instanceof IResource) else if (inputElement instanceof IResource)
{ {
if ((inputElement instanceof IFolder) || (inputElement instanceof IProject)) if ((inputElement instanceof IFolder) || (inputElement instanceof IProject))
@ -401,21 +408,21 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
else else
resourceTypeValue.setText(SystemViewResources.RESID_PROPERTY_FILE_TYPE_FILE_VALUE); resourceTypeValue.setText(SystemViewResources.RESID_PROPERTY_FILE_TYPE_FILE_VALUE);
} }
initialized = true; initialized = true;
} }
} }
/** /**
* Runnable method * Runnable method
*/ */
public void run() public void run()
{ {
uniqueNameValidator = getUniqueNameValidator(inputElement, nameValidator); uniqueNameValidator = getUniqueNameValidator(inputElement, nameValidator);
} }
/** /**
* Given an input element and externally-suppplied name validator for it, determine if we * Given an input element and externally-suppplied name validator for it, determine if we
* need to augment that validator with one that will check for uniqueness, and if so * need to augment that validator with one that will check for uniqueness, and if so
* create and return that uniqueness validator * create and return that uniqueness validator
*/ */
protected ValidatorUniqueString getUniqueNameValidator(Object inputElement, ISystemValidator nameValidator) protected ValidatorUniqueString getUniqueNameValidator(Object inputElement, ISystemValidator nameValidator)
@ -438,12 +445,12 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
// Set the busy cursor to all shells. // Set the busy cursor to all shells.
super.setBusyCursor(true); super.setBusyCursor(true);
try { try {
Shell shell = getShell(); Shell shell = getShell();
IRunnableContext irc = RSEUIPlugin.getTheSystemRegistryUI().getRunnableContext(); IRunnableContext irc = RSEUIPlugin.getTheSystemRegistryUI().getRunnableContext();
RSEUIPlugin.getTheSystemRegistryUI().clearRunnableContext(); RSEUIPlugin.getTheSystemRegistryUI().clearRunnableContext();
names = ra.getRemoteParentNamesInUse(inputElement, null); names = ra.getRemoteParentNamesInUse(inputElement, null);
RSEUIPlugin.getTheSystemRegistryUI().setRunnableContext(shell, irc); RSEUIPlugin.getTheSystemRegistryUI().setRunnableContext(shell, irc);
} catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);} //$NON-NLS-1$ } catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);} //$NON-NLS-1$
if ((names != null) && (names.length>0)) if ((names != null) && (names.length>0))
{ {
@ -460,18 +467,18 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
// Restore cursor // Restore cursor
super.setBusyCursor(false); super.setBusyCursor(false);
} }
} }
else else
isRemote = false; isRemote = false;
newName.setFocus(); newName.setFocus();
return uniqueNameValidator; return uniqueNameValidator;
} }
/** /**
* Returns the selected element given the current input, which is * Returns the selected element given the current input, which is
* an IStructuredSelection. * an IStructuredSelection.
*/ */
protected Object getInputElement(Object inputObject) protected Object getInputElement(Object inputObject)
{ {
if (inputObject instanceof IStructuredSelection) if (inputObject instanceof IStructuredSelection)
{ {
@ -481,14 +488,14 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
inputObject = ((SystemSimpleContentElement)inputObject).getData(); inputObject = ((SystemSimpleContentElement)inputObject).getData();
} }
return inputObject; return inputObject;
} }
/** /**
* Returns the implementation of ISystemViewElement for the given * Returns the implementation of ISystemViewElement for the given
* object. Returns null if the adapter is not defined or the * object. Returns null if the adapter is not defined or the
* object is not adaptable. * object is not adaptable.
*/ */
protected ISystemViewElementAdapter getViewAdapter(Object o) protected ISystemViewElementAdapter getViewAdapter(Object o)
{ {
return SystemAdapterHelpers.getViewAdapter(o); return SystemAdapterHelpers.getViewAdapter(o);
} }
@ -496,17 +503,17 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
* Returns the implementation of ISystemRemoteElement for the given * Returns the implementation of ISystemRemoteElement for the given
* object. Returns null if this object does not adaptable to this. * object. Returns null if this object does not adaptable to this.
*/ */
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o) protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
{ {
return SystemAdapterHelpers.getRemoteAdapter(o); return SystemAdapterHelpers.getRemoteAdapter(o);
} }
/** /**
* Called when user presses OK button. * Called when user presses OK button.
* Return true to close dialog. * Return true to close dialog.
* Return false to not close dialog. * Return false to not close dialog.
*/ */
protected boolean processOK() protected boolean processOK()
{ {
newNameString = newName.getText(); newNameString = newName.getText();
if (!isRemote) if (!isRemote)
@ -528,7 +535,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
setOutputObject(newNameString); setOutputObject(newNameString);
} }
return closeDialog; return closeDialog;
} }
/** /**
* Trim leading blanks * Trim leading blanks
*/ */
@ -536,19 +543,19 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
return ("."+text).trim().substring(1); //$NON-NLS-1$ return ("."+text).trim().substring(1); //$NON-NLS-1$
} }
/** /**
* Verifies all input. * Verifies all input.
* @return true if there are no errors in the user input * @return true if there are no errors in the user input
*/ */
public boolean verify() public boolean verify()
{ {
if (copyCollisionMode && overwriteMode) if (copyCollisionMode && overwriteMode)
return true; return true;
SystemMessage errMsg = null; SystemMessage errMsg = null;
Control controlInError = null; Control controlInError = null;
clearErrorMessage(); clearErrorMessage();
errMsg = validateNameInput(newNameString); errMsg = validateNameInput(newNameString);
if (errMsg != null) { if (errMsg != null) {
controlInError = newName; controlInError = newName;
@ -559,7 +566,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
} }
return (errMsg == null); return (errMsg == null);
} }
/** /**
* If renaming a remote object, which is listed in a tree view under an expanded filter, * If renaming a remote object, which is listed in a tree view under an expanded filter,
* this tests to see if the rename will cause that object to suddenly not meet the filtering * this tests to see if the rename will cause that object to suddenly not meet the filtering
@ -572,7 +579,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
// after breaking my pick on this, I have decide it simply is too much work, and // after breaking my pick on this, I have decide it simply is too much work, and
// too error-prone, to do. The reason is that we really cannot accurately determine // too error-prone, to do. The reason is that we really cannot accurately determine
// if the new name will meet the criteria of the filter, short of re-resolving the // if the new name will meet the criteria of the filter, short of re-resolving the
// filter and looking for the new name. That is just too expensive, I think. Phil. // filter and looking for the new name. That is just too expensive, I think. Phil.
// See defect 42094. // See defect 42094.
return false; return false;
/* /*
@ -596,28 +603,28 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
return ok; return ok;
*/ */
} }
/** /**
* Called directly as user types. * Called directly as user types.
*/ */
protected SystemMessage validateNameInput() protected SystemMessage validateNameInput()
{ {
newNameString = newName.getText(); newNameString = newName.getText();
if (!isRemote) if (!isRemote)
newNameString = newNameString.trim(); newNameString = newNameString.trim();
else else
newNameString = trimTrailing(newNameString); // defect 43173 newNameString = trimTrailing(newNameString); // defect 43173
return validateNameInput(newNameString); return validateNameInput(newNameString);
} }
/** /**
* Called directly from verify. * Called directly from verify.
*/ */
protected SystemMessage validateNameInput(String theNewName) protected SystemMessage validateNameInput(String theNewName)
{ {
errorMessage= null; errorMessage= null;
if (theNewName == null) if (theNewName == null)
{ {
errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY); errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY);
@ -625,7 +632,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
else else
{ {
if (nameValidator != null) if (nameValidator != null)
errorMessage= nameValidator.validate(theNewName); errorMessage= nameValidator.validate(theNewName);
else if (theNewName.length() == 0) else if (theNewName.length() == 0)
errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY); errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY);
if (errorMessage == null) if (errorMessage == null)
@ -634,7 +641,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_RENAME_OLDEQUALSNEW).makeSubstitution(inputName); errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_RENAME_OLDEQUALSNEW).makeSubstitution(inputName);
} }
} }
if ((errorMessage == null) && (uniqueNameValidator != null)) if ((errorMessage == null) && (uniqueNameValidator != null))
errorMessage = uniqueNameValidator.validate(theNewName); errorMessage = uniqueNameValidator.validate(theNewName);
if(_namesInUse != null && _namesInUse.size()>0) if(_namesInUse != null && _namesInUse.size()>0)
@ -651,10 +658,10 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
setErrorMessage(errorMessage); setErrorMessage(errorMessage);
else else
clearErrorMessage(); clearErrorMessage();
setPageComplete(); setPageComplete();
return errorMessage; return errorMessage;
} }
/** /**
* This method can be called by the dialog or wizard page host, to decide whether to enable * This method can be called by the dialog or wizard page host, to decide whether to enable
* or disable the next, final or ok buttons. It returns true if the minimal information is * or disable the next, final or ok buttons. It returns true if the minimal information is
@ -663,13 +670,13 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
public boolean isPageComplete() public boolean isPageComplete()
{ {
boolean pageComplete = false; boolean pageComplete = false;
if (copyCollisionMode && overwriteMode) if (copyCollisionMode && overwriteMode)
{ {
return true; return true;
} }
if (errorMessage == null) if (errorMessage == null)
{ {
String theNewName = newName.getText().trim(); String theNewName = newName.getText().trim();
@ -678,12 +685,12 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
{ {
pageComplete = !adapter.namesAreEqual(inputElement, theNewName); pageComplete = !adapter.namesAreEqual(inputElement, theNewName);
//System.out.println("back from namesAreEqual: " + pageComplete); //System.out.println("back from namesAreEqual: " + pageComplete);
} }
} }
return pageComplete; return pageComplete;
} }
/** /**
* Inform caller of page-complete status of this form * Inform caller of page-complete status of this form
*/ */
@ -698,7 +705,7 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
public String getNewName() public String getNewName()
{ {
return newNameString; return newNameString;
} }
/** /**
* Returns the user-entered new name as an array for convenience to ISystemRenameTarget hosts. * Returns the user-entered new name as an array for convenience to ISystemRenameTarget hosts.
@ -708,40 +715,40 @@ public class SystemRenameSingleDialog extends SystemPromptDialog
String[] newNames = new String[1]; String[] newNames = new String[1];
newNames[0] = newNameString; newNames[0] = newNameString;
return newNames; return newNames;
} }
public void setDescription(String description) public void setDescription(String description)
{ {
this.description = description; this.description = description;
} }
public String getDescription() public String getDescription()
{ {
return this.description; return this.description;
} }
public void handleEvent(Event e) public void handleEvent(Event e)
{ {
Widget source = e.widget; Widget source = e.widget;
if (source == overwriteRadio) if (source == overwriteRadio)
{ {
enableRename(!overwriteRadio.getSelection()); enableRename(!overwriteRadio.getSelection());
} }
} }
private void enableRename(boolean flag) private void enableRename(boolean flag)
{ {
if (newName != null) if (newName != null)
{ {
renameLabel.setEnabled(flag); renameLabel.setEnabled(flag);
newName.setEnabled(flag); newName.setEnabled(flag);
resourceTypePrompt.setEnabled(flag); resourceTypePrompt.setEnabled(flag);
resourceTypeValue.setEnabled(flag); resourceTypeValue.setEnabled(flag);
overwriteMode = !flag; overwriteMode = !flag;
setPageComplete(); setPageComplete();
} }
} }
} }

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
@ -33,72 +33,75 @@ import org.eclipse.swt.widgets.Shell;
public class SystemSelectAnythingDialog extends SystemPromptDialog public class SystemSelectAnythingDialog extends SystemPromptDialog
implements ISelectionChangedListener implements ISelectionChangedListener
{ {
private SystemViewForm _view = null; private SystemViewForm _view = null;
private Object _selected = null; private Object _selected = null;
private SystemActionViewerFilter _filter = null; private SystemActionViewerFilter _filter = null;
public SystemSelectAnythingDialog(Shell shell, String title) public SystemSelectAnythingDialog(Shell shell, String title)
{ {
super(shell, title); super(shell, title);
} }
public Control createInner(Composite parent) public Control createInner(Composite parent)
{ {
_view = new SystemViewForm(getShell(), parent, SWT.NONE, getInputProvider(), true, this); _view = new SystemViewForm(getShell(), parent, SWT.NONE, getInputProvider(), true, this);
_view.getSystemTree().addSelectionChangedListener(this); _view.getSystemTree().addSelectionChangedListener(this);
if (_filter != null){ if (_filter != null){
_view.getSystemTree().addFilter(_filter); _view.getSystemTree().addFilter(_filter);
} }
return _view.getTreeControl(); return _view.getTreeControl();
} }
public boolean close() public boolean close()
{ {
_view.removeSelectionChangedListener(this); _view.removeSelectionChangedListener(this);
_view.dispose(); _view.dispose();
return super.close(); return super.close();
} }
/** /**
* Returns the initial input provider for the viewer. * Returns the initial input provider for the viewer.
* Tries to deduce the appropriate input provider based on current input. * Tries to deduce the appropriate input provider based on current input.
*/ */
protected ISystemViewInputProvider getInputProvider() protected ISystemViewInputProvider getInputProvider()
{ {
ISystemViewInputProvider inputProvider = RSECorePlugin.getTheSystemRegistry(); ISystemViewInputProvider inputProvider = RSECorePlugin.getTheSystemRegistry();
return inputProvider; return inputProvider;
} }
public Control getInitialFocusControl() public Control getInitialFocusControl()
{ {
return _view.getTreeControl(); return _view.getTreeControl();
} }
public Object getSelectedObject() public Object getSelectedObject()
{ {
//IStructuredSelection selection = (IStructuredSelection)_view.getSelection(); //IStructuredSelection selection = (IStructuredSelection)_view.getSelection();
//return selection.getFirstElement(); //return selection.getFirstElement();
return _selected; return _selected;
} }
public void selectionChanged(SelectionChangedEvent e) public void selectionChanged(SelectionChangedEvent e)
{ {
IStructuredSelection selection = (IStructuredSelection)e.getSelection(); IStructuredSelection selection = (IStructuredSelection)e.getSelection();
_selected = selection.getFirstElement(); _selected = selection.getFirstElement();
} }
/** /**
* Use this method to limit the objects that are seen in the view of this dialog. * Use this method to limit the objects that are seen in the view of this
* * dialog.
* @param filter the filter that limits the visible objects *
* @param filter the filter that limits the visible objects
* @since 3.0
*/ */
public void setViewerFilter(SystemActionViewerFilter filter) public void setViewerFilter(SystemActionViewerFilter filter)
{ {

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
*******************************************************************************/ *******************************************************************************/
@ -21,8 +21,10 @@ import org.eclipse.rse.ui.wizards.ISystemWizard;
/** /**
* An interface for filter pool wizards to implement * An interface for filter pool wizards to implement
*
* @since 3.0 moved from "internal" to API
*/ */
public interface SystemFilterPoolWizardInterface public interface SystemFilterPoolWizardInterface
extends ISystemWizard, SystemFilterPoolDialogInterface extends ISystemWizard, SystemFilterPoolDialogInterface
{ {
} }

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters * David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters
@ -55,7 +55,7 @@ import org.eclipse.swt.widgets.Shell;
* Base Wizard for users to define a new system filter. * Base Wizard for users to define a new system filter.
* While subsystem providers are free to offer their own wizards, this * While subsystem providers are free to offer their own wizards, this
* abstracts out much of it and makes it easy to simply override and * abstracts out much of it and makes it easy to simply override and
* supply a couple classes to offer a totally unique presentation to the * supply a couple classes to offer a totally unique presentation to the
* user. * user.
* <p> * <p>
* Some guiding design rules for this wizard: * Some guiding design rules for this wizard:
@ -65,7 +65,7 @@ import org.eclipse.swt.widgets.Shell;
* is created, only after via the change action. The wizard basically * is created, only after via the change action. The wizard basically
* prompts for the creation of a single new filter string. * prompts for the creation of a single new filter string.
* <li>Users are confused about "naming" a filter, so the name is not asked * <li>Users are confused about "naming" a filter, so the name is not asked
* for until the second page, and it is possible for subclasses to * for until the second page, and it is possible for subclasses to
* default that name to something intelligent based on the contents of * default that name to something intelligent based on the contents of
* the first page, such that users can press Finish and not think about * the first page, such that users can press Finish and not think about
* the name. * the name.
@ -74,12 +74,12 @@ import org.eclipse.swt.widgets.Shell;
* While this class can be subclassed, you should find all attributes can be * While this class can be subclassed, you should find all attributes can be
* configured via setters. * configured via setters.
*/ */
public class SystemNewFilterWizard public class SystemNewFilterWizard
extends AbstractSystemWizard extends AbstractSystemWizard
{ {
protected SystemNewFilterWizardMainPage mainPage; protected SystemNewFilterWizardMainPage mainPage;
private SystemNewFilterWizardNamePage namePage; private SystemNewFilterWizardNamePage namePage;
protected SystemNewFilterWizardInfoPage infoPage; protected SystemNewFilterWizardInfoPage infoPage;
protected ISystemFilterContainer filterContainer; protected ISystemFilterContainer filterContainer;
protected ISystemFilterPool parentPool; protected ISystemFilterPool parentPool;
protected ISystemFilterPool[] poolsToSelectFrom; protected ISystemFilterPool[] poolsToSelectFrom;
@ -93,13 +93,13 @@ public class SystemNewFilterWizard
protected boolean fromRSE = false; protected boolean fromRSE = false;
protected boolean page1DescriptionSet = false; protected boolean page1DescriptionSet = false;
protected ISystemFilter newFilter = null; protected ISystemFilter newFilter = null;
protected SystemFilterStringEditPane editPane; protected SystemFilterStringEditPane editPane;
protected ISystemFilterPoolReferenceManagerProvider provider; protected ISystemFilterPoolReferenceManagerProvider provider;
protected ISystemFilterPoolWrapperInformation poolWrapperInformation; protected ISystemFilterPoolWrapperInformation poolWrapperInformation;
protected ISystemFilterPoolSelectionValidator filterPoolSelectionValidator; protected ISystemFilterPoolSelectionValidator filterPoolSelectionValidator;
protected ISystemNewFilterWizardConfigurator configurator; protected ISystemNewFilterWizardConfigurator configurator;
/** /**
* Constructor when you want to supply your own title and image * Constructor when you want to supply your own title and image
* @param title - title to show for this wizard. This is used as the page title! The title is always "New"! * @param title - title to show for this wizard. This is used as the page title! The title is always "New"!
@ -111,16 +111,16 @@ public class SystemNewFilterWizard
this(new SystemNewFilterWizardConfigurator(title), wizardImage, parentPool); this(new SystemNewFilterWizardConfigurator(title), wizardImage, parentPool);
} }
/** /**
* Constructor when you want to use the default page title and image, or want to * Constructor when you want to use the default page title and image, or want to
* supply it via setWizardTitle and setWizardImage. * supply it via setWizardTitle and setWizardImage.
* @param parentPool - the filter pool we are to create this filter in. * @param parentPool - the filter pool we are to create this filter in.
*/ */
public SystemNewFilterWizard(ISystemFilterPool parentPool) public SystemNewFilterWizard(ISystemFilterPool parentPool)
{ {
this(new SystemNewFilterWizardConfigurator(), this(new SystemNewFilterWizardConfigurator(),
RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERWIZARD_ID), RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWFILTERWIZARD_ID),
parentPool); parentPool);
} }
/** /**
* Constructor when you want to supply all your own configuration data * Constructor when you want to supply all your own configuration data
* @param data - configuration data * @param data - configuration data
@ -137,36 +137,36 @@ public class SystemNewFilterWizard
setOutputObject(null); setOutputObject(null);
} }
// ----------------------------------- // -----------------------------------
// INPUT/CONFIGURATION METHODS... // INPUT/CONFIGURATION METHODS...
// ----------------------------------- // -----------------------------------
/** /**
* If you want to prompt the user for the parent filter pool to create this filter in, * If you want to prompt the user for the parent filter pool to create this filter in,
* call this with the list of filter pools. In this case, the filter pool passed into * call this with the list of filter pools. In this case, the filter pool passed into
* the constructor will be used as the initial selection. * the constructor will be used as the initial selection.
*/ */
public void setAllowFilterPoolSelection(ISystemFilterPool[] poolsToSelectFrom) public void setAllowFilterPoolSelection(ISystemFilterPool[] poolsToSelectFrom)
{ {
this.poolsToSelectFrom = poolsToSelectFrom; this.poolsToSelectFrom = poolsToSelectFrom;
} }
/** /**
* This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[])} * This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[])}
* <p> * <p>
* If you want to prompt the user for the parent filter pool to create this filter in, * If you want to prompt the user for the parent filter pool to create this filter in,
* but want to not use the term "pool" say, you can use an array of euphamisms. That is, * but want to not use the term "pool" say, you can use an array of euphamisms. That is,
* you can pass an array of objects that map to filter pools, but have a different * you can pass an array of objects that map to filter pools, but have a different
* display name that is shown in the dropdown. * display name that is shown in the dropdown.
* <p> * <p>
* Of course, if you want to do this, then you will likely want to offer a different * Of course, if you want to do this, then you will likely want to offer a different
* label and tooltip for the prompt, and different verbiage above the prompt. The * label and tooltip for the prompt, and different verbiage above the prompt. The
* object this method accepts as a parameter encapsulates all that information, and * object this method accepts as a parameter encapsulates all that information, and
* there is a default class you can use for this. * there is a default class you can use for this.
*/ */
public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolsToSelectFrom) public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolsToSelectFrom)
{ {
this.poolWrapperInformation = poolsToSelectFrom; this.poolWrapperInformation = poolsToSelectFrom;
} }
/** /**
* Set the type of filter we are creating. Results in a call to setType on the new filter. * Set the type of filter we are creating. Results in a call to setType on the new filter.
* Types are not used by the base filter framework but are a way for tools to create typed * Types are not used by the base filter framework but are a way for tools to create typed
@ -192,7 +192,7 @@ public class SystemNewFilterWizard
showFilterStrings = show; showFilterStrings = show;
} }
/** /**
* Call in order to not prompt the user for a filter name. This also implies we will not * Call in order to not prompt the user for a filter name. This also implies we will not
* be prompting for a parent filter pool! Default is true. * be prompting for a parent filter pool! Default is true.
* <p> * <p>
* This is used when creating temporary filters that won't be saved. In this case, on * This is used when creating temporary filters that won't be saved. In this case, on
@ -231,7 +231,7 @@ public class SystemNewFilterWizard
this.defaultFilterStrings = defaultFilterStrings; this.defaultFilterStrings = defaultFilterStrings;
} }
/** /**
* Set if we are creating a filter for use in the RSE or not. This affects the * Set if we are creating a filter for use in the RSE or not. This affects the
* tips and help. * tips and help.
* <p> * <p>
* This is set to true automatically by the subsystem factory base class in the RSE, * This is set to true automatically by the subsystem factory base class in the RSE,
@ -247,19 +247,19 @@ public class SystemNewFilterWizard
*/ */
public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator) public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator)
{ {
this.filterPoolSelectionValidator = validator; this.filterPoolSelectionValidator = validator;
} }
/** /**
* Set the contextual system filter pool reference manager provider. Eg, in the RSE, this * Set the contextual system filter pool reference manager provider. Eg, in the RSE, this
* will be the selected subsystem if the New Filter action is launched from there, or if * will be the selected subsystem if the New Filter action is launched from there, or if
* launched from a filter pool reference under there. * launched from a filter pool reference under there.
* <p> * <p>
* Will be non-null if the current selection is a reference to a filter pool or filter, * Will be non-null if the current selection is a reference to a filter pool or filter,
* or a reference manager provider. * or a reference manager provider.
* <p> * <p>
* This is passed into the filter and filter string wizards and dialogs in case it is needed * This is passed into the filter and filter string wizards and dialogs in case it is needed
* for context. * for context.
*/ */
public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider) public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
{ {
@ -287,7 +287,7 @@ public class SystemNewFilterWizard
{ {
super.setWizardPageTitle(pageTitle); super.setWizardPageTitle(pageTitle);
if (configurator instanceof SystemNewFilterWizardConfigurator) if (configurator instanceof SystemNewFilterWizardConfigurator)
((SystemNewFilterWizardConfigurator)configurator).setPageTitle(pageTitle); ((SystemNewFilterWizardConfigurator)configurator).setPageTitle(pageTitle);
} }
/** /**
* Set the description to display on the first page of the wizard * Set the description to display on the first page of the wizard
@ -298,7 +298,7 @@ public class SystemNewFilterWizard
((SystemNewFilterWizardConfigurator)configurator).setPage1Description(description); ((SystemNewFilterWizardConfigurator)configurator).setPage1Description(description);
page1DescriptionSet = true; page1DescriptionSet = true;
} }
/** /**
* Specify an edit pane that prompts the user for the contents of a filter string. * Specify an edit pane that prompts the user for the contents of a filter string.
*/ */
@ -307,15 +307,15 @@ public class SystemNewFilterWizard
this.editPane = editPane; this.editPane = editPane;
} }
// ----------------------------------- // -----------------------------------
// INTERNAL BUT OVERRIDABLE METHODS... // INTERNAL BUT OVERRIDABLE METHODS...
// ----------------------------------- // -----------------------------------
/** /**
* Extendable point for child classes. You don't need to override typically though... rather * Extendable point for child classes. You don't need to override typically though... rather
* you can simply supply your own filter string edit pane. * you can simply supply your own filter string edit pane.
* <p> * <p>
* By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor. * By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
* @return the primary page prompting for a single filter string. * @return the primary page prompting for a single filter string.
*/ */
protected SystemNewFilterWizardMainPage createMainPage() protected SystemNewFilterWizardMainPage createMainPage()
{ {
@ -327,8 +327,12 @@ public class SystemNewFilterWizard
return mainPage; return mainPage;
} }
/** /**
* By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor. * By default, this page uses the wizard page title as set in
* @return the wizard page prompting for the filter name and parent filter pool * setWizardPageTitle(...) or the constructor.
*
* @return the wizard page prompting for the filter name and parent filter
* pool
* @since 3.0 moved SystemNewFilterWizardNamePage from internal to API
*/ */
protected SystemNewFilterWizardNamePage createNamePage() protected SystemNewFilterWizardNamePage createNamePage()
{ {
@ -346,17 +350,17 @@ public class SystemNewFilterWizard
boolean showFilterPoolsTip = ((poolsToSelectFrom != null) || (poolWrapperInformation != null)); boolean showFilterPoolsTip = ((poolsToSelectFrom != null) || (poolWrapperInformation != null));
infoPage = new SystemNewFilterWizardInfoPage(this, showFilterPoolsTip, configurator); infoPage = new SystemNewFilterWizardInfoPage(this, showFilterPoolsTip, configurator);
return infoPage; return infoPage;
} }
/** /**
* Override of parent to do nothing * Override of parent to do nothing
*/ */
public void addPages() {} public void addPages() {}
/** /**
* Creates the wizard pages. * Creates the wizard pages.
* This method is an override from the parent Wizard class. * This method is an override from the parent Wizard class.
*/ */
public void createPageControls(Composite c) public void createPageControls(Composite c)
{ {
try { try {
// MAIN PAGE... // MAIN PAGE...
@ -381,7 +385,7 @@ public class SystemNewFilterWizard
ISystemValidator[] validators = new ISystemValidator[poolsToSelectFrom.length]; ISystemValidator[] validators = new ISystemValidator[poolsToSelectFrom.length];
for (int idx=0; idx<validators.length; idx++) for (int idx=0; idx<validators.length; idx++)
validators[idx] = getFilterNameValidator(poolsToSelectFrom[idx]); validators[idx] = getFilterNameValidator(poolsToSelectFrom[idx]);
namePage.setAllowFilterPoolSelection(poolsToSelectFrom, validators); namePage.setAllowFilterPoolSelection(poolsToSelectFrom, validators);
} }
else if (poolWrapperInformation != null) else if (poolWrapperInformation != null)
{ {
@ -389,19 +393,19 @@ public class SystemNewFilterWizard
ISystemValidator[] validators = new ISystemValidator[wrappers.length]; ISystemValidator[] validators = new ISystemValidator[wrappers.length];
for (int idx=0; idx<validators.length; idx++) for (int idx=0; idx<validators.length; idx++)
validators[idx] = getFilterNameValidator(wrappers[idx].getSystemFilterPool()); validators[idx] = getFilterNameValidator(wrappers[idx].getSystemFilterPool());
namePage.setAllowFilterPoolSelection(poolWrapperInformation, validators); namePage.setAllowFilterPoolSelection(poolWrapperInformation, validators);
} }
else else
{ {
ISystemValidator validator = getFilterNameValidator(getFilterContainer()); ISystemValidator validator = getFilterNameValidator(getFilterContainer());
namePage.setFilterNameValidator(validator); namePage.setFilterNameValidator(validator);
} }
if (!showFilterStrings && page1DescriptionSet) if (!showFilterStrings && page1DescriptionSet)
namePage.setDescription(configurator.getPage1Description()); namePage.setDescription(configurator.getPage1Description());
addPage(namePage); addPage(namePage);
} }
// INFO PAGE... // INFO PAGE...
if (showInfoPage) if (showInfoPage)
{ {
infoPage = createInfoPage(); infoPage = createInfoPage();
@ -435,7 +439,7 @@ public class SystemNewFilterWizard
* @return a name validator * @return a name validator
*/ */
public static ISystemValidator getFilterNameValidator(ISystemFilterContainer container, ISystemFilter filter) { public static ISystemValidator getFilterNameValidator(ISystemFilterContainer container, ISystemFilter filter) {
String[] names = container.getSystemFilterNames(); String[] names = container.getSystemFilterNames();
Vector v = new Vector(names.length); Vector v = new Vector(names.length);
v.addAll(Arrays.asList(names)); v.addAll(Arrays.asList(names));
if (filter != null) { if (filter != null) {
@ -443,7 +447,7 @@ public class SystemNewFilterWizard
} }
ValidatorFilterName filterNameValidator = new ValidatorFilterName(v); ValidatorFilterName filterNameValidator = new ValidatorFilterName(v);
return filterNameValidator; return filterNameValidator;
} }
/** /**
* Override if necessary. * Override if necessary.
@ -458,12 +462,12 @@ public class SystemNewFilterWizard
return fc.areStringsCaseSensitive(); return fc.areStringsCaseSensitive();
return false; return false;
} }
/** /**
* Completes processing of the wizard. If this * Completes processing of the wizard. If this
* method returns true, the wizard will close; * method returns true, the wizard will close;
* otherwise, it will stay active. * otherwise, it will stay active.
* This method is an override from the parent Wizard class. * This method is an override from the parent Wizard class.
* *
* @return whether the wizard finished successfully * @return whether the wizard finished successfully
*/ */
@ -486,7 +490,7 @@ public class SystemNewFilterWizard
filterParent = namePage.getParentSystemFilterPool(); filterParent = namePage.getParentSystemFilterPool();
if (namePage.getUniqueToThisConnection()) { if (namePage.getUniqueToThisConnection()) {
/* /*
* this means the user selected to create this filter in the filter pool that is unique to this connection. So now we * this means the user selected to create this filter in the filter pool that is unique to this connection. So now we
* must find, or create, that filter pool. * must find, or create, that filter pool.
*/ */
filterParent = provider.getUniqueOwningSystemFilterPool(true); // true -> create if not found filterParent = provider.getUniqueOwningSystemFilterPool(true); // true -> create if not found
@ -500,7 +504,7 @@ public class SystemNewFilterWizard
newFilter = createNewFilter(getShell(), filterParent, filterName, filterStrings, type); newFilter = createNewFilter(getShell(), filterParent, filterName, filterStrings, type);
if (newFilter == null) return false; if (newFilter == null) return false;
/* /*
* We allow users to select a profile to create their filter in. From this we * We allow users to select a profile to create their filter in. From this we
* select the default filter pool for the particular subsystem in that profile. * select the default filter pool for the particular subsystem in that profile.
* It is possible for the user to pick a profile that this subsystem does not yet reference. * It is possible for the user to pick a profile that this subsystem does not yet reference.
* To solve this we need to add a reference for them. This is only a possibility when called * To solve this we need to add a reference for them. This is only a possibility when called
@ -538,7 +542,7 @@ public class SystemNewFilterWizard
} }
} }
ok = (newFilter != null); ok = (newFilter != null);
} // end if showNamePrompt } // end if showNamePrompt
else { else {
ok = true; ok = true;
setOutputObject(filterStrings); setOutputObject(filterStrings);
@ -547,7 +551,7 @@ public class SystemNewFilterWizard
} }
return false; return false;
} }
/** /**
* Return the parent into which we are creating a filter. If filterContainer has been set, * Return the parent into which we are creating a filter. If filterContainer has been set,
* returns that, else returns getInputObject() which is set by the calling action. * returns that, else returns getInputObject() which is set by the calling action.
@ -564,7 +568,7 @@ public class SystemNewFilterWizard
*/ */
protected ISystemFilterContainer getFilterContainer() protected ISystemFilterContainer getFilterContainer()
{ {
//System.out.println("Old. inside getFilterContainer. " + filterContainer + ", " + getInputObject()); //System.out.println("Old. inside getFilterContainer. " + filterContainer + ", " + getInputObject());
if (filterContainer == null) if (filterContainer == null)
{ {
@ -583,9 +587,9 @@ public class SystemNewFilterWizard
else if (input instanceof ISystemFilterContainer) else if (input instanceof ISystemFilterContainer)
return (ISystemFilterContainer)input; return (ISystemFilterContainer)input;
else if (input instanceof ISystemFilterContainerReference) else if (input instanceof ISystemFilterContainerReference)
return ((ISystemFilterContainerReference)input).getReferencedSystemFilterContainer(); return ((ISystemFilterContainerReference)input).getReferencedSystemFilterContainer();
else if (input instanceof ISystemFilterPoolReference) else if (input instanceof ISystemFilterPoolReference)
return ((ISystemFilterPoolReference)input).getReferencedFilterPool(); return ((ISystemFilterPoolReference)input).getReferencedFilterPool();
else if (parentPool != null) else if (parentPool != null)
return parentPool; return parentPool;
else if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0)) else if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0))
@ -615,7 +619,7 @@ public class SystemNewFilterWizard
{ {
this.filterContainer = containerRef.getReferencedSystemFilterContainer(); this.filterContainer = containerRef.getReferencedSystemFilterContainer();
} }
/** /**
* Extendable point for child classes. * Extendable point for child classes.
* Override to create unique SystemFilter object. * Override to create unique SystemFilter object.
@ -637,7 +641,7 @@ public class SystemNewFilterWizard
newFilter = fpMgr.createSystemFilter(filterParent, aliasName, filterStringsVector, type); newFilter = fpMgr.createSystemFilter(filterParent, aliasName, filterStringsVector, type);
return newFilter; return newFilter;
} }
// ----------------------- // -----------------------
// CALLBACKS FROM PAGES... // CALLBACKS FROM PAGES...
// ----------------------- // -----------------------
@ -649,7 +653,7 @@ public class SystemNewFilterWizard
return fromRSE; return fromRSE;
} }
/** /**
* For page 2 of the New Filter wizard, if it is possible to * For page 2 of the New Filter wizard, if it is possible to
* deduce a reasonable default name from the user input here, * deduce a reasonable default name from the user input here,
* then return it here. Else, just return null. * then return it here. Else, just return null.
* <b> * <b>
@ -658,7 +662,7 @@ public class SystemNewFilterWizard
public String getDefaultFilterName() public String getDefaultFilterName()
{ {
return mainPage.getEditPane(null).getDefaultFilterName(); return mainPage.getEditPane(null).getDefaultFilterName();
} }
// ------ // ------
// OUTPUT // OUTPUT
// ------ // ------

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - [160403] filters should be connection private by default * David Dykstal (IBM) - [160403] filters should be connection private by default
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
@ -42,16 +42,18 @@ import org.eclipse.swt.widgets.Text;
/** /**
* Second page of the New Filter wizard that prompts for the name of the filter. * Second page of the New Filter wizard that prompts for the name of the filter.
*
* @since 3.0 moved from internal to API
*/ */
public class SystemNewFilterWizardNamePage public class SystemNewFilterWizardNamePage
extends AbstractSystemWizardPage extends AbstractSystemWizardPage
implements SelectionListener implements SelectionListener
{ {
protected Text nameText; protected Text nameText;
protected Button uniqueCB; protected Button uniqueCB;
protected Label poolVerbiage; protected Label poolVerbiage;
protected Label poolComboLabel; protected Label poolComboLabel;
protected Combo poolWrapperCombo; protected Combo poolWrapperCombo;
protected Combo poolCombo; protected Combo poolCombo;
protected SystemMessage errorMessage; protected SystemMessage errorMessage;
@ -66,8 +68,8 @@ public class SystemNewFilterWizardNamePage
protected ISystemFilterPoolWrapper[] poolWrappers = null; protected ISystemFilterPoolWrapper[] poolWrappers = null;
protected ISystemFilterPoolWrapperInformation poolWrapperInformation; protected ISystemFilterPoolWrapperInformation poolWrapperInformation;
protected ISystemFilterPool parentPool = null; protected ISystemFilterPool parentPool = null;
private ISystemNewFilterWizardConfigurator configurator; private ISystemNewFilterWizardConfigurator configurator;
/** /**
* Constructor. * Constructor.
*/ */
@ -106,42 +108,42 @@ public class SystemNewFilterWizardNamePage
{ {
this.poolsToSelectFrom = poolsToSelectFrom; this.poolsToSelectFrom = poolsToSelectFrom;
this.nameValidators = nameValidators; this.nameValidators = nameValidators;
if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0)) if ((poolsToSelectFrom != null) && (poolsToSelectFrom.length>0))
{ {
if (parentPool == null) if (parentPool == null)
parentPool = poolsToSelectFrom[0]; parentPool = poolsToSelectFrom[0];
} }
} }
/** /**
* This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[], ISystemValidator[])} * This is an alternative to {@link #setAllowFilterPoolSelection(ISystemFilterPool[], ISystemValidator[])}
* <p> * <p>
* If you want to prompt the user for the parent filter pool to create this filter in, * If you want to prompt the user for the parent filter pool to create this filter in,
* but want to not use the term "pool" say, you can use an array of euphamisms. That is, * but want to not use the term "pool" say, you can use an array of euphamisms. That is,
* you can pass an array of objects that map to filter pools, but have a different * you can pass an array of objects that map to filter pools, but have a different
* display name that is shown in the dropdown. * display name that is shown in the dropdown.
* <p> * <p>
* Of course, if you want to do this, then you will likely want to offer a different * Of course, if you want to do this, then you will likely want to offer a different
* label and tooltip for the prompt, and different verbiage above the prompt. The * label and tooltip for the prompt, and different verbiage above the prompt. The
* object this method accepts as a parameter encapsulates all that information, and * object this method accepts as a parameter encapsulates all that information, and
* there is a default class you can use for this. * there is a default class you can use for this.
*/ */
public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolWrappersToSelectFrom, public void setAllowFilterPoolSelection(ISystemFilterPoolWrapperInformation poolWrappersToSelectFrom,
ISystemValidator[] nameValidators) ISystemValidator[] nameValidators)
{ {
this.poolWrapperInformation = poolWrappersToSelectFrom; this.poolWrapperInformation = poolWrappersToSelectFrom;
this.nameValidators = nameValidators; this.nameValidators = nameValidators;
if (parentPool == null) if (parentPool == null)
parentPool = poolWrappersToSelectFrom.getPreSelectWrapper().getSystemFilterPool(); parentPool = poolWrappersToSelectFrom.getPreSelectWrapper().getSystemFilterPool();
} }
/** /**
* Set the validator to call when the user selects a filter pool. Optional. * Set the validator to call when the user selects a filter pool. Optional.
*/ */
public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator) public void setFilterPoolSelectionValidator(ISystemFilterPoolSelectionValidator validator)
{ {
filterPoolSelectionValidator = validator; filterPoolSelectionValidator = validator;
//System.out.println("Inside setFilterPoolSelectionValidator. Non null? " + (validator != null)); //System.out.println("Inside setFilterPoolSelectionValidator. Non null? " + (validator != null));
} }
// --------------------------------- // ---------------------------------
// LIFECYCLE METHODS... // LIFECYCLE METHODS...
// --------------------------------- // ---------------------------------
@ -154,13 +156,13 @@ public class SystemNewFilterWizardNamePage
int nbrColumns = 2; int nbrColumns = 2;
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2NameVerbiage(), nbrColumns, false, 200); SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2NameVerbiage(), nbrColumns, false, 200);
nameText = SystemWidgetHelpers.createLabeledTextField(composite_prompts, null, configurator.getPage2NamePromptLabel(), configurator.getPage2NamePromptTooltip()); nameText = SystemWidgetHelpers.createLabeledTextField(composite_prompts, null, configurator.getPage2NamePromptLabel(), configurator.getPage2NamePromptTooltip());
addSeparatorLine(composite_prompts, nbrColumns); addSeparatorLine(composite_prompts, nbrColumns);
addFillerLine(composite_prompts, nbrColumns); addFillerLine(composite_prompts, nbrColumns);
// allow the user to create this filter uniquely for this connection, which means putting it in a // allow the user to create this filter uniquely for this connection, which means putting it in a
// special filter pool we will create, just for this connection. This option is not shown if we are // special filter pool we will create, just for this connection. This option is not shown if we are
// already told which filter pool to create the filter in, such as in Show Filter Pools mode, when // already told which filter pool to create the filter in, such as in Show Filter Pools mode, when
@ -169,13 +171,13 @@ public class SystemNewFilterWizardNamePage
if ((poolsToSelectFrom!=null) || (poolWrapperInformation!=null)) if ((poolsToSelectFrom!=null) || (poolWrapperInformation!=null))
{ {
uniqueCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, configurator.getPage2UniqueToConnectionLabel(), null); uniqueCB = SystemWidgetHelpers.createCheckBox(composite_prompts, nbrColumns, configurator.getPage2UniqueToConnectionLabel(), null);
uniqueCB.setToolTipText(configurator.getPage2UniqueToConnectionToolTip()); uniqueCB.setToolTipText(configurator.getPage2UniqueToConnectionToolTip());
uniqueCB.addSelectionListener(this); uniqueCB.addSelectionListener(this);
uniqueCB.setSelection(true); // [160403] filters should be connection private by default uniqueCB.setSelection(true); // [160403] filters should be connection private by default
} }
addFillerLine(composite_prompts, nbrColumns); addFillerLine(composite_prompts, nbrColumns);
if (poolsToSelectFrom != null) if (poolsToSelectFrom != null)
{ {
poolVerbiage = SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2PoolVerbiage(), nbrColumns, false, 200); poolVerbiage = SystemWidgetHelpers.createVerbiage(composite_prompts, configurator.getPage2PoolVerbiage(), nbrColumns, false, 200);
@ -193,7 +195,7 @@ public class SystemNewFilterWizardNamePage
} }
if ((nameValidator == null) && (nameValidators!=null)) if ((nameValidator == null) && (nameValidators!=null))
nameValidator = nameValidators[filterPoolSelectionIndex]; nameValidator = nameValidators[filterPoolSelectionIndex];
poolCombo.setItems(poolNames); poolCombo.setItems(poolNames);
poolCombo.select(filterPoolSelectionIndex); poolCombo.select(filterPoolSelectionIndex);
poolCombo.addSelectionListener(this); poolCombo.addSelectionListener(this);
if ((uniqueCB!=null) && uniqueCB.getSelection()) if ((uniqueCB!=null) && uniqueCB.getSelection())
@ -220,7 +222,7 @@ public class SystemNewFilterWizardNamePage
} }
if ((nameValidator == null) && (nameValidators!=null)) if ((nameValidator == null) && (nameValidators!=null))
nameValidator = nameValidators[filterPoolSelectionIndex]; nameValidator = nameValidators[filterPoolSelectionIndex];
poolWrapperCombo.setItems(poolNames); poolWrapperCombo.setItems(poolNames);
poolWrapperCombo.select(filterPoolSelectionIndex); poolWrapperCombo.select(filterPoolSelectionIndex);
poolWrapperCombo.addSelectionListener(this); poolWrapperCombo.addSelectionListener(this);
if ((uniqueCB!=null) && uniqueCB.getSelection()) if ((uniqueCB!=null) && uniqueCB.getSelection())
@ -230,7 +232,7 @@ public class SystemNewFilterWizardNamePage
poolWrapperCombo.setEnabled(false); poolWrapperCombo.setEnabled(false);
} }
} }
// initialize inputs // initialize inputs
if (nameValidator != null) if (nameValidator != null)
{ {
@ -240,7 +242,7 @@ public class SystemNewFilterWizardNamePage
} }
if (inputFilterName != null) if (inputFilterName != null)
nameText.setText(inputFilterName); nameText.setText(inputFilterName);
// add keystroke listeners... // add keystroke listeners...
nameText.addModifyListener( nameText.addModifyListener(
new ModifyListener() { new ModifyListener() {
@ -251,12 +253,12 @@ public class SystemNewFilterWizardNamePage
validateNameInput(); validateNameInput();
} }
} }
); );
setPageComplete(); setPageComplete();
contentsCreated = true; contentsCreated = true;
return composite_prompts; return composite_prompts;
} }
/** /**
* Return the Control to be given initial focus. * Return the Control to be given initial focus.
* Override from parent. Return control to be given initial focus. * Override from parent. Return control to be given initial focus.
@ -265,16 +267,16 @@ public class SystemNewFilterWizardNamePage
{ {
return nameText; return nameText;
} }
/** /**
* Completes processing of the wizard. If this * Completes processing of the wizard. If this
* method returns true, the wizard will close; * method returns true, the wizard will close;
* otherwise, it will stay active. * otherwise, it will stay active.
* This method is an override from the parent Wizard class. * This method is an override from the parent Wizard class.
* *
* @return whether the wizard finished successfully * @return whether the wizard finished successfully
*/ */
public boolean performFinish() public boolean performFinish()
{ {
if (!contentsCreated) if (!contentsCreated)
return true; return true;
@ -292,14 +294,14 @@ public class SystemNewFilterWizardNamePage
pageComplete = (nameText.getText().trim().length() > 0); pageComplete = (nameText.getText().trim().length() > 0);
return pageComplete; return pageComplete;
} }
/** /**
* Inform caller of page-complete status of this page * Inform caller of page-complete status of this page
*/ */
public void setPageComplete() public void setPageComplete()
{ {
setPageComplete(isPageComplete()); setPageComplete(isPageComplete());
} }
/** /**
* User has selected something * User has selected something
*/ */
@ -308,13 +310,13 @@ public class SystemNewFilterWizardNamePage
Object src = e.getSource(); Object src = e.getSource();
if (src == poolCombo) if (src == poolCombo)
{ {
int selection = poolCombo.getSelectionIndex(); int selection = poolCombo.getSelectionIndex();
if ((selection >= 0) && (nameValidators!=null)) if ((selection >= 0) && (nameValidators!=null))
nameValidator = nameValidators[selection]; nameValidator = nameValidators[selection];
} }
else if (src == poolWrapperCombo) else if (src == poolWrapperCombo)
{ {
int selection = poolWrapperCombo.getSelectionIndex(); int selection = poolWrapperCombo.getSelectionIndex();
if ((selection >= 0) && (nameValidators!=null)) if ((selection >= 0) && (nameValidators!=null))
nameValidator = nameValidators[selection]; nameValidator = nameValidators[selection];
} }
@ -344,7 +346,7 @@ public class SystemNewFilterWizardNamePage
// --------------------------------- // ---------------------------------
/** /**
* Verify all contents * Verify all contents
*/ */
public SystemMessage verify() public SystemMessage verify()
{ {
errorMessage = null; errorMessage = null;
@ -357,12 +359,12 @@ public class SystemNewFilterWizardNamePage
controlInError = poolCombo; controlInError = poolCombo;
else if (poolWrapperCombo != null) else if (poolWrapperCombo != null)
controlInError = poolCombo; controlInError = poolCombo;
} }
if ((errorMessage == null) && (nameValidator != null)) if ((errorMessage == null) && (nameValidator != null))
{ {
errorMessage = nameValidator.validate(nameText.getText().trim()); errorMessage = nameValidator.validate(nameText.getText().trim());
controlInError = nameText; controlInError = nameText;
} }
if (errorMessage != null) if (errorMessage != null)
{ {
@ -373,40 +375,40 @@ public class SystemNewFilterWizardNamePage
else else
clearErrorMessage(); clearErrorMessage();
return errorMessage; return errorMessage;
} }
/** /**
* This hook method is called whenever the text changes in the filter name input field. * This hook method is called whenever the text changes in the filter name input field.
*/ */
protected SystemMessage validateNameInput() protected SystemMessage validateNameInput()
{ {
errorMessage= null; errorMessage= null;
if (nameValidator != null) if (nameValidator != null)
errorMessage = nameValidator.validate(nameText.getText().trim()); errorMessage = nameValidator.validate(nameText.getText().trim());
if ((errorMessage == null) && (filterPoolSelectionValidator != null)) if ((errorMessage == null) && (filterPoolSelectionValidator != null))
errorMessage = filterPoolSelectionValidator.validate(getParentSystemFilterPool()); errorMessage = filterPoolSelectionValidator.validate(getParentSystemFilterPool());
setPageComplete(); setPageComplete();
if (errorMessage != null) if (errorMessage != null)
setErrorMessage(errorMessage); setErrorMessage(errorMessage);
else else
clearErrorMessage(); clearErrorMessage();
return errorMessage; return errorMessage;
} }
// --------------------------------- // ---------------------------------
// METHODS FOR EXTRACTING USER DATA // METHODS FOR EXTRACTING USER DATA
// --------------------------------- // ---------------------------------
/** /**
* Return name of filter * Return name of filter
* Call this after finish ends successfully. * Call this after finish ends successfully.
*/ */
public String getFilterName() public String getFilterName()
{ {
if (nameText != null) if (nameText != null)
return nameText.getText().trim(); return nameText.getText().trim();
else else
return inputFilterName; return inputFilterName;
} }
/** /**
* Return the filter pool that was explicitly chosen by the user, * Return the filter pool that was explicitly chosen by the user,
* or implicitly set by the caller. * or implicitly set by the caller.
@ -438,8 +440,8 @@ public class SystemNewFilterWizardNamePage
pool = parentPool; pool = parentPool;
//System.out.println("Inside getParentSystemFilterPool. returning " + pool.getName()); //System.out.println("Inside getParentSystemFilterPool. returning " + pool.getName());
return pool; return pool;
} }
/** /**
* Return the user's decision whether to create this filter uniquely * Return the user's decision whether to create this filter uniquely
* for this connection, or for all applicable connections. * for this connection, or for all applicable connections.
@ -452,7 +454,7 @@ public class SystemNewFilterWizardNamePage
return false; return false;
} }
// ------------------------------- // -------------------------------
// INTERCEPT OF WIZARDPAGE METHODS // INTERCEPT OF WIZARDPAGE METHODS
// ------------------------------- // -------------------------------
/** /**
@ -478,8 +480,8 @@ public class SystemNewFilterWizardNamePage
} }
} }
// --------------------------------------------------------------
// ALL THE MRI ON THIS PAGE IS CONFIGURABLE. CALL HERE TO SET IT.
// -------------------------------------------------------------- // --------------------------------------------------------------
// ALL THE MRI ON THIS PAGE IS CONFIGURABLE. CALL HERE TO SET IT.
// --------------------------------------------------------------
} }

View file

@ -1,17 +1,17 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* David Dykstal (IBM) - [217556] remove service subsystem types * David Dykstal (IBM) - [217556] remove service subsystem types
* David Dykstal (IBM) - [231630] add help for services property page * David Dykstal (IBM) - [231630] add help for services property page
********************************************************************************/ ********************************************************************************/
@ -31,30 +31,30 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
public abstract class ServicesPropertyPage extends SystemBasePropertyPage public abstract class ServicesPropertyPage extends SystemBasePropertyPage
{ {
protected ServicesForm _form; protected ServicesForm _form;
protected String _hostname; protected String _hostname;
protected IRSESystemType _hosttype; protected IRSESystemType _hosttype;
protected ServiceElement _rootElement; protected ServiceElement _rootElement;
protected Control createContentArea(Composite parent) protected Control createContentArea(Composite parent)
{ {
_form = new ServicesForm(parent.getShell(), getMessageLine()); _form = new ServicesForm(parent.getShell(), getMessageLine());
_form.createContents(parent); _form.createContents(parent);
// init services // init services
initServices(); initServices();
SystemWidgetHelpers.setCompositeHelp(parent, "org.eclipse.rse.ui.ServicesPropertyPage"); //$NON-NLS-1$ SystemWidgetHelpers.setCompositeHelp(parent, "org.eclipse.rse.ui.ServicesPropertyPage"); //$NON-NLS-1$
return parent; return parent;
} }
protected boolean verifyPageContents() protected boolean verifyPageContents()
{ {
return _form.verify(); return _form.verify();
} }
protected void initServices() protected void initServices()
{ {
ServiceElement[] elements = getServiceElements(); ServiceElement[] elements = getServiceElements();
@ -62,13 +62,17 @@ public abstract class ServicesPropertyPage extends SystemBasePropertyPage
_form.init(_rootElement); _form.init(_rootElement);
} }
/**
* @since 3.0 returning ISubSystem rather than IServiceSubSystem
* @return
*/
protected ISubSystem getServiceSubSystem() protected ISubSystem getServiceSubSystem()
{ {
return (ISubSystem)getElement(); return (ISubSystem)getElement();
} }
protected abstract ServiceElement[] getServiceElements(); protected abstract ServiceElement[] getServiceElements();
/** /**
* @since 3.0 * @since 3.0
*/ */
@ -87,12 +91,12 @@ public abstract class ServicesPropertyPage extends SystemBasePropertyPage
return result; return result;
} }
} }
protected void commitChanges() protected void commitChanges()
{ {
_rootElement.commit(); _rootElement.commit();
} }
protected void revertChanges() protected void revertChanges()
{ {
_rootElement.revert(); _rootElement.revert();
@ -100,10 +104,10 @@ public abstract class ServicesPropertyPage extends SystemBasePropertyPage
public boolean applyValues(IConnectorService connectorService) public boolean applyValues(IConnectorService connectorService)
{ {
FactoryServiceElement selectedService = (FactoryServiceElement)_form.getSelectedService(); FactoryServiceElement selectedService = (FactoryServiceElement)_form.getSelectedService();
ISubSystemConfiguration factory = selectedService.getFactory(); ISubSystemConfiguration factory = selectedService.getFactory();
ISubSystemConfiguration currentFactory = getCurrentSubSystemConfiguration(); ISubSystemConfiguration currentFactory = getCurrentSubSystemConfiguration();
if (factory != currentFactory) if (factory != currentFactory)
{ {
getServiceSubSystem().switchServiceFactory(factory); getServiceSubSystem().switchServiceFactory(factory);
} }
@ -114,17 +118,17 @@ public abstract class ServicesPropertyPage extends SystemBasePropertyPage
{ {
_hostname = hostname; _hostname = hostname;
} }
public void setSystemType(IRSESystemType systemType) public void setSystemType(IRSESystemType systemType)
{ {
_hosttype = systemType; _hosttype = systemType;
} }
public String getHostname() public String getHostname()
{ {
return _hostname; return _hostname;
} }
public IRSESystemType getSystemType() public IRSESystemType getSystemType()
{ {
return _hosttype; return _hosttype;

View file

@ -8,7 +8,7 @@
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight. * component that contains this file: David McKnight.
* *
* Contributors: * Contributors:
* David McKnight (IBM) - [187711] IViewLinker to be API that system view part calls when link with editor * David McKnight (IBM) - [187711] IViewLinker to be API that system view part calls when link with editor
*******************************************************************************/ *******************************************************************************/
@ -17,19 +17,22 @@ package org.eclipse.rse.ui.view;
import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPage;
/**
* @since 3.0
*/
public interface IViewLinker { public interface IViewLinker {
/** /**
* System View part calls link when using Link With Editor. Provider of action supplies this implementation. * System View part calls link when using Link With Editor. Provider of action supplies this implementation.
* @param editor the active editor * @param editor the active editor
* @param systemTree the view to link * @param systemTree the view to link
*/ */
public void linkEditorToView(IEditorPart editor, ISystemTree systemTree); public void linkEditorToView(IEditorPart editor, ISystemTree systemTree);
/** /**
* System View part calls link when using Link With Editor. Provider of action supplies this implementation. * System View part calls link when using Link With Editor. Provider of action supplies this implementation.
* @param editor the active editor * @param editor the active editor
* @param page the active workbench page * @param page the active workbench page
*/ */
public void linkViewToEditor(Object remoteObject, IWorkbenchPage page); public void linkViewToEditor(Object remoteObject, IWorkbenchPage page);

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
@ -100,9 +100,9 @@ import org.eclipse.ui.dialogs.PropertyPage;
public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAdapter, ISystemNewFilterActionConfigurator public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAdapter, ISystemNewFilterActionConfigurator
{ {
protected Hashtable imageTable = null; protected Hashtable imageTable = null;
// actions stuff... // actions stuff...
private IAction[] subSystemActions = null; private IAction[] subSystemActions = null;
private IAction[] filterPoolActions = null; private IAction[] filterPoolActions = null;
@ -111,17 +111,17 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
public SubSystemConfigurationAdapter() public SubSystemConfigurationAdapter()
{ {
} }
/** /**
* Returns any framework-supplied actions remote objects that should be contributed to the popup menu * Returns any framework-supplied actions remote objects that should be contributed to the popup menu
* for the given selection list. This does nothing if this adapter does not implement ISystemRemoteElementAdapter, * for the given selection list. This does nothing if this adapter does not implement ISystemRemoteElementAdapter,
* else it potentially adds menu items for "User Actions" and Compile", for example. It queries the subsystem * else it potentially adds menu items for "User Actions" and Compile", for example. It queries the subsystem
* configuration of the selected objects to determine if these actions are appropriate to add. * configuration of the selected objects to determine if these actions are appropriate to add.
* *
* <p> * <p>
* No need to override. * No need to override.
* *
* @param menu The menu to contribute actions to * @param menu The menu to contribute actions to
* @param selection The window's current selection. * @param selection The window's current selection.
* @param shell of viewer calling this. Most dialogs require a shell. * @param shell of viewer calling this. Most dialogs require a shell.
@ -193,6 +193,8 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
* interrogate them for the user-entered data and use it when creating the default subsystem instance. * interrogate them for the user-entered data and use it when creating the default subsystem instance.
* </ul> * </ul>
* Tip: consider extending {@link org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage} for your wizard page class. * Tip: consider extending {@link org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage} for your wizard page class.
*
* @since 3.0 ISystemNewConnectionWizardPage moved from Core to UI
*/ */
public ISystemNewConnectionWizardPage[] getNewConnectionWizardPages(ISubSystemConfiguration config, IWizard wizard) public ISystemNewConnectionWizardPage[] getNewConnectionWizardPages(ISubSystemConfiguration config, IWizard wizard)
{ {
@ -206,14 +208,14 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// { // {
// List pages = getSubSystemPropertyPages(config); // List pages = getSubSystemPropertyPages(config);
// if (pages != null && pages.size() > 0) // if (pages != null && pages.size() > 0)
// { // {
// SystemSubSystemsPropertiesWizardPage page = new SystemSubSystemsPropertiesWizardPage(wizard, config, pages); // SystemSubSystemsPropertiesWizardPage page = new SystemSubSystemsPropertiesWizardPage(wizard, config, pages);
// return new ISystemNewConnectionWizardPage[] {page}; // return new ISystemNewConnectionWizardPage[] {page};
// } // }
// } // }
return new ISystemNewConnectionWizardPage[0]; return new ISystemNewConnectionWizardPage[0];
} }
/* /*
* Return the form used in the subsystem property page. This default implementation returns Syste * Return the form used in the subsystem property page. This default implementation returns Syste
*/ */
@ -221,8 +223,8 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
return new SystemSubSystemPropertyPageCoreForm(msgLine, caller); return new SystemSubSystemPropertyPageCoreForm(msgLine, caller);
} }
// FIXME - UDAs no longer coupled with config in core // FIXME - UDAs no longer coupled with config in core
// // --------------------------------- // // ---------------------------------
@ -238,7 +240,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// * <p> // * <p>
// * Do not override this, as the implementation is complete. However, // * Do not override this, as the implementation is complete. However,
// * you must override createActionSubSystem. // * you must override createActionSubSystem.
// * // *
// * @see #supportsUserDefinedActions() // * @see #supportsUserDefinedActions()
// * @see #createActionSubSystem() // * @see #createActionSubSystem()
// */ // */
@ -257,7 +259,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// /** // /**
// * Overridable method to instantiate the SystemUDActionSubsystem. // * Overridable method to instantiate the SystemUDActionSubsystem.
// * You must override this if you return true to supportsUserActions. // * You must override this if you return true to supportsUserActions.
// * // *
// * @see #supportsUserDefinedActions() // * @see #supportsUserDefinedActions()
// * @see #getActionSubSystem(ISubSystem) // * @see #getActionSubSystem(ISubSystem)
// */ // */
@ -278,8 +280,8 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// SystemUDACascadeAction act = new SystemUDACascadeAction(userActionSubSystem, selection); // SystemUDACascadeAction act = new SystemUDACascadeAction(userActionSubSystem, selection);
// menu.add(menuGroup, act); // menu.add(menuGroup, act);
// } // }
// --------------------------------- // ---------------------------------
// COMPILE ACTIONS METHODS... // COMPILE ACTIONS METHODS...
// --------------------------------- // ---------------------------------
@ -310,7 +312,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
ImageDescriptor result = adapter.getImageDescriptor(); ImageDescriptor result = adapter.getImageDescriptor();
return result; return result;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter#getGraphicsImage(org.eclipse.rse.core.subsystems.ISubSystemConfiguration) * @see org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter#getGraphicsImage(org.eclipse.rse.core.subsystems.ISubSystemConfiguration)
@ -382,7 +384,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// --------------------------------- // ---------------------------------
// SUBSYSTEM METHODS... // SUBSYSTEM METHODS...
// --------------------------------- // ---------------------------------
/** /**
@ -391,7 +393,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
* Override if additional actions needs to be contributed. * Override if additional actions needs to be contributed.
* <p> * <p>
* @see #getSubSystemNewFilterPoolActions(SystemMenuManager, IStructuredSelection, Shell, String, ISubSystemConfiguration, ISubSystem) * @see #getSubSystemNewFilterPoolActions(SystemMenuManager, IStructuredSelection, Shell, String, ISubSystemConfiguration, ISubSystem)
* *
* @param selectedSubSystem the currently selected subsystem * @param selectedSubSystem the currently selected subsystem
* @param shell The Shell of the view where this action was launched from * @param shell The Shell of the view where this action was launched from
* @return array of IAction objects to contribute to the popup menu * @return array of IAction objects to contribute to the popup menu
@ -411,7 +413,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
for (int idx = 0; idx < newFPActions.length; idx++) for (int idx = 0; idx < newFPActions.length; idx++)
{ {
// special case handling... // special case handling...
// set input subsystem for new filter pool actions... // set input subsystem for new filter pool actions...
if (newFPActions[idx] instanceof SystemFilterAbstractFilterPoolAction) if (newFPActions[idx] instanceof SystemFilterAbstractFilterPoolAction)
{ {
SystemFilterAbstractFilterPoolAction fpAction = (SystemFilterAbstractFilterPoolAction) newFPActions[idx]; SystemFilterAbstractFilterPoolAction fpAction = (SystemFilterAbstractFilterPoolAction) newFPActions[idx];
@ -449,7 +451,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
} // end if newFilterActions != null } // end if newFilterActions != null
} // end if !showFilterPools } // end if !showFilterPools
} // end if supportsFilters() } // end if supportsFilters()
// FIXME - UDAs moved out of here // FIXME - UDAs moved out of here
// // if user defined actions are supported, add an action to work with them... // // if user defined actions are supported, add an action to work with them...
// if (config.supportsUserDefinedActions()) // if (config.supportsUserDefinedActions())
@ -461,11 +463,11 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// if (config.supportsCompileActions()) // if (config.supportsCompileActions())
// childActions.addElement(new SystemWorkWithCompileCommandsAction(shell, false)); // childActions.addElement(new SystemWorkWithCompileCommandsAction(shell, false));
if (config.supportsSubSystemConnect()) if (config.supportsSubSystemConnect())
{ {
// MJB: RE defect 40854 // MJB: RE defect 40854
addConnectOrDisconnectAction(childActions, shell, selectedSubSystem); addConnectOrDisconnectAction(childActions, shell, selectedSubSystem);
} }
@ -475,7 +477,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
int nbrBaseActions = 0; int nbrBaseActions = 0;
if (config.supportsSubSystemConnect()) if (config.supportsSubSystemConnect())
{ {
//nbrBaseActions += 2; // 4; MJB: RE defect 50854 //nbrBaseActions += 2; // 4; MJB: RE defect 50854
if (selectedSubSystem.getConnectorService().supportsUserId()) if (selectedSubSystem.getConnectorService().supportsUserId())
nbrBaseActions += 1; nbrBaseActions += 1;
} }
@ -485,10 +487,10 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
int ssIdx = 0; int ssIdx = 0;
if (config.supportsSubSystemConnect()) if (config.supportsSubSystemConnect())
{ {
// MJB: RE defect 40854 // MJB: RE defect 40854
//subSystemActions[ssIdx++] = new SystemConnectAction(shell); //subSystemActions[ssIdx++] = new SystemConnectAction(shell);
//subSystemActions[ssIdx++] = new SystemDisconnectAction(shell); //subSystemActions[ssIdx++] = new SystemDisconnectAction(shell);
if (selectedSubSystem.getConnectorService().supportsUserId()) if (selectedSubSystem.getConnectorService().supportsUserId())
subSystemActions[ssIdx++] = new SystemClearPasswordAction(shell); subSystemActions[ssIdx++] = new SystemClearPasswordAction(shell);
} }
@ -503,12 +505,12 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
return allActions; return allActions;
} }
/** /**
* Overridable method to add the connect or disconnect action. * Overridable method to add the connect or disconnect action.
* *
* @param actions The list of child actions. Add the connect/disconnect action to this vector is applicable. * @param actions The list of child actions. Add the connect/disconnect action to this vector is applicable.
* @param shell The shell. * @param shell The shell.
* @param selectedSS The selected subsystem. * @param selectedSS The selected subsystem.
*/ */
protected void addConnectOrDisconnectAction(Vector actions, Shell shell, ISubSystem selectedSS) protected void addConnectOrDisconnectAction(Vector actions, Shell shell, ISubSystem selectedSS)
@ -523,11 +525,11 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
actions.addElement(new SystemConnectAction(shell)); actions.addElement(new SystemConnectAction(shell));
} }
} }
/** /**
* There is a reasonable amount of processing needed to configure filter wizards. To aid * There is a reasonable amount of processing needed to configure filter wizards. To aid
* in performance and memory usage, we extract that processing into this method, and then * in performance and memory usage, we extract that processing into this method, and then
* use a callback contract with the filter wizard to call us back to do this processing * use a callback contract with the filter wizard to call us back to do this processing
* only at the time the action is actually selected to be run. * only at the time the action is actually selected to be run.
* <p> * <p>
* The processing we do here is to specify the filter pools to prompt the user for, in the * The processing we do here is to specify the filter pools to prompt the user for, in the
@ -540,7 +542,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
//System.out.println("Inside configureNewFilterAction! It worked!"); //System.out.println("Inside configureNewFilterAction! It worked!");
newFilterAction.setFromRSE(true); newFilterAction.setFromRSE(true);
boolean showFilterPools = config.showFilterPools(); boolean showFilterPools = config.showFilterPools();
// It does not make sense, when invoked from a filterPool, to ask the user // It does not make sense, when invoked from a filterPool, to ask the user
// for the parent filter pool, or to ask the user whether the filter is connection // for the parent filter pool, or to ask the user whether the filter is connection
// specific, as they user has explicitly chosen their pool... // specific, as they user has explicitly chosen their pool...
@ -552,7 +554,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// For a new user we simply want to ask them whether this filter is to be team sharable or private, // For a new user we simply want to ask them whether this filter is to be team sharable or private,
// and based on that, we will place the filter in the default filter pool for the appropriate profile. // and based on that, we will place the filter in the default filter pool for the appropriate profile.
// For an advanced user who has simply turned show filter pools back off, we want to let them choose // For an advanced user who has simply turned show filter pools back off, we want to let them choose
// explicitly which filter pool they want to place the filter in. // explicitly which filter pool they want to place the filter in.
// To approximate the decision, we will define an advanced user as someone who already has a reference // To approximate the decision, we will define an advanced user as someone who already has a reference
// to a filter pool other than the default pools in the active profiles. // to a filter pool other than the default pools in the active profiles.
boolean advancedUser = false; boolean advancedUser = false;
@ -584,7 +586,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
for (int idx = 0; idx < activeProfiles.length; idx++) for (int idx = 0; idx < activeProfiles.length; idx++)
{ {
ISystemFilterPool defaultPool = getDefaultSystemFilterPool(config, activeProfiles[idx]); ISystemFilterPool defaultPool = getDefaultSystemFilterPool(config, activeProfiles[idx]);
if (defaultPool != null) if (defaultPool != null)
{ {
poolWrapperInfo.addWrapper(activeProfiles[idx].getName(), defaultPool, (activeProfiles[idx] == activeProfile)); // display name, pool to wrap, whether to preselect poolWrapperInfo.addWrapper(activeProfiles[idx].getName(), defaultPool, (activeProfiles[idx] == activeProfile)); // display name, pool to wrap, whether to preselect
@ -596,7 +598,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
} }
} }
} }
/** /**
* Given a profile, return the first (hopefully only) default pool for this * Given a profile, return the first (hopefully only) default pool for this
* profile. * profile.
@ -608,14 +610,15 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
pool = mgr.getFirstDefaultSystemFilterPool(); // RETURN FIRST pool = mgr.getFirstDefaultSystemFilterPool(); // RETURN FIRST
return pool; return pool;
} }
/** /**
* Overridable entry for child classes to supply their own flavour of ISystemFilterPoolWrapperInformation for * Overridable entry for child classes to supply their own flavour of ISystemFilterPoolWrapperInformation for
* the new filter wizards. * the new filter wizards.
* @since 3.0 replaced SystemFilterPoolWrapperInformation by ISystemFilterPoolWrapperInformation
*/ */
protected ISystemFilterPoolWrapperInformation getNewFilterWizardPoolWrapperInformation() protected ISystemFilterPoolWrapperInformation getNewFilterWizardPoolWrapperInformation()
{ {
return new SystemFilterPoolWrapperInformation(SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_LABEL, SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_TOOLTIP, return new SystemFilterPoolWrapperInformation(SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_LABEL, SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_TOOLTIP,
SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_VERBIAGE); SystemResources.RESID_NEWFILTER_PAGE2_PROFILE_VERBIAGE);
} }
/** /**
@ -636,7 +639,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
((ISystemAction) actions[1]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0041"); //$NON-NLS-1$ ((ISystemAction) actions[1]).setHelp(RSEUIPlugin.HELPPREFIX + "actn0041"); //$NON-NLS-1$
return actions; return actions;
} }
/** /**
* Supply the image to be used for filter pool managers, within actions. * Supply the image to be used for filter pool managers, within actions.
* REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
@ -661,7 +664,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID); return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_FILTER_ID);
} }
/** /**
* Supply the image to be used for filter pool references. This implementation * Supply the image to be used for filter pool references. This implementation
* just gets the referenced filter pool and calls the method * just gets the referenced filter pool and calls the method
@ -674,7 +677,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
} }
/** /**
* Supply the image to be used for filter references. This implementation * Supply the image to be used for filter references. This implementation
* just gets the referenced filter and calls the method * just gets the referenced filter and calls the method
* getSystemFilterImage(ISystemFile) on it. * getSystemFilterImage(ISystemFile) on it.
* Override this method to provide custom images for filter references. * Override this method to provide custom images for filter references.
@ -683,8 +686,8 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
return getSystemFilterImage(filterRef.getReferencedFilter()); return getSystemFilterImage(filterRef.getReferencedFilter());
} }
/* /*
* Supply the image to be used for the given filter string, within actions. * Supply the image to be used for the given filter string, within actions.
* REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
@ -693,7 +696,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
return getSystemFilterStringImage(filterString.getString()); return getSystemFilterStringImage(filterString.getString());
} }
/* /*
* Supply the image to be used for the given filter string string, within actions. * Supply the image to be used for the given filter string string, within actions.
* REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE * REQUIRED BY SYSTEMFILTERPOOLMANAGERPROVIDER INTERFACE
@ -708,7 +711,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
// HELPER METHODS TO SIMPLY EVENT FIRING... // HELPER METHODS TO SIMPLY EVENT FIRING...
// ------------------------------------------------ // ------------------------------------------------
// ------------------------------------------------ // ------------------------------------------------
// FILTER POOL MANAGER PROVIDER CALLBACK METHODS... // FILTER POOL MANAGER PROVIDER CALLBACK METHODS...
@ -739,7 +742,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
for (int idx = 0; idx < newActions.length; idx++) for (int idx = 0; idx < newActions.length; idx++)
{ {
childActions.addElement(newActions[idx]); childActions.addElement(newActions[idx]);
//if (newActions[idx] instanceof SystemNewFilterAction) //if (newActions[idx] instanceof SystemNewFilterAction)
// ((SystemNewFilterAction) newActions[idx]).setCallBackConfigurator(this, null); // ((SystemNewFilterAction) newActions[idx]).setCallBackConfigurator(this, null);
} }
@ -820,7 +823,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
* Overridable method to return the action for changing an existing filter. * Overridable method to return the action for changing an existing filter.
* By default returns new SystemChangeFilterAction, unless the filter's isSingleFilterStringOnly() * By default returns new SystemChangeFilterAction, unless the filter's isSingleFilterStringOnly()
* returns true, in which case null is returned. * returns true, in which case null is returned.
* *
* @param selectedFilter the currently selected filter * @param selectedFilter the currently selected filter
* @param shell parent shell of viewer where the popup menu is being constructed * @param shell parent shell of viewer where the popup menu is being constructed
*/ */
@ -846,7 +849,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
* <p> * <p>
* By default, this method will call {@link #getChangeFilterAction(ISubSystemConfiguration, ISystemFilter, Shell)} to get * By default, this method will call {@link #getChangeFilterAction(ISubSystemConfiguration, ISystemFilter, Shell)} to get
* your change filter action, and will configure the given page from the dialog created by your * your change filter action, and will configure the given page from the dialog created by your
* change filter action. * change filter action.
* <p> * <p>
* If your filter uses its own Change Filter dialog, versus subclassing or configuring * If your filter uses its own Change Filter dialog, versus subclassing or configuring
* {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to override this method * {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to override this method
@ -873,7 +876,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
if (changeAction instanceof SystemChangeFilterAction) if (changeAction instanceof SystemChangeFilterAction)
{ {
SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction; SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction;
changeFilterAction.setSelection(new StructuredSelection(selectedFilter)); changeFilterAction.setSelection(new StructuredSelection(selectedFilter));
org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell); org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell);
if (dlg instanceof SystemChangeFilterDialog) if (dlg instanceof SystemChangeFilterDialog)
{ {
@ -886,30 +889,30 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
page.setParentPoolPromptLabel(changeFilterDlg.getParentPoolPromptLabel(), changeFilterDlg.getParentPoolPromptTip()); page.setParentPoolPromptLabel(changeFilterDlg.getParentPoolPromptLabel(), changeFilterDlg.getParentPoolPromptTip());
page.setNamePromptLabel(changeFilterDlg.getNamePromptLabel(), changeFilterDlg.getNamePromptTip()); page.setNamePromptLabel(changeFilterDlg.getNamePromptLabel(), changeFilterDlg.getNamePromptTip());
page.setNewListItemText(changeFilterDlg.getNewListItemText()); page.setNewListItemText(changeFilterDlg.getNewListItemText());
page.setDescription(changeFilterDlg.getTitle()); page.setDescription(changeFilterDlg.getTitle());
} }
} }
if (selectedFilter.isNonChangable()) if (selectedFilter.isNonChangable())
page.setEditable(false); page.setEditable(false);
//System.out.println("Selected filter: "+selectedFilter.getName()+", isSingleFilterStringOnly: "+selectedFilter.isSetSingleFilterStringOnly()); //System.out.println("Selected filter: "+selectedFilter.getName()+", isSingleFilterStringOnly: "+selectedFilter.isSetSingleFilterStringOnly());
boolean singleFilterString = selectedFilter.isSingleFilterStringOnly() || (selectedFilter.isNonChangable() && (selectedFilter.getFilterStringCount() == 1)); boolean singleFilterString = selectedFilter.isSingleFilterStringOnly() || (selectedFilter.isNonChangable() && (selectedFilter.getFilterStringCount() == 1));
if (singleFilterString) if (singleFilterString)
page.setSupportsMultipleStrings(false); page.setSupportsMultipleStrings(false);
} }
/** /**
* In addition to a change filter action, we now also support the same functionality * In addition to a change filter action, we now also support the same functionality
* via a Properties page for filter strings, in the Team View. When this page is activated, * via a Properties page for filter strings, in the Team View. When this page is activated,
* this method is called to enable customization of the page, given the selected filter string. * this method is called to enable customization of the page, given the selected filter string.
* *
* <p> * <p>
* By default, this method will call {@link #getChangeFilterAction(ISubSystemConfiguration, ISystemFilter, Shell)} to get * By default, this method will call {@link #getChangeFilterAction(ISubSystemConfiguration, ISystemFilter, Shell)} to get
* your change filter action, and will configure the given page from the dialog created by your * your change filter action, and will configure the given page from the dialog created by your
* change filter action. * change filter action.
* <p> * <p>
* If your filter uses its own Change Filter dialog, versus subclassing or configuring * If your filter uses its own Change Filter dialog, versus subclassing or configuring
* {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to * {@link org.eclipse.rse.ui.filters.dialogs.SystemChangeFilterDialog} you will have to
* override this method and specify the following information for the supplied page (via its setters): * override this method and specify the following information for the supplied page (via its setters):
* <ul> * <ul>
* <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)} * <li>{@link org.eclipse.rse.ui.propertypages.SystemFilterStringPropertyPage#setDuplicateFilterStringErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)}
@ -929,7 +932,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
if (changeAction instanceof SystemChangeFilterAction) if (changeAction instanceof SystemChangeFilterAction)
{ {
SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction; SystemChangeFilterAction changeFilterAction = (SystemChangeFilterAction)changeAction;
changeFilterAction.setSelection(new StructuredSelection(selectedFilter)); changeFilterAction.setSelection(new StructuredSelection(selectedFilter));
org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell); org.eclipse.jface.dialogs.Dialog dlg = changeFilterAction.createDialog(shell);
if (dlg instanceof SystemChangeFilterDialog) if (dlg instanceof SystemChangeFilterDialog)
{ {
@ -937,18 +940,18 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
//changeFilterAction.callConfigureFilterDialog(changeFilterDlg); createDialog calls this! //changeFilterAction.callConfigureFilterDialog(changeFilterDlg); createDialog calls this!
page.setDuplicateFilterStringErrorMessage(changeFilterDlg.getDuplicateFilterStringErrorMessage()); page.setDuplicateFilterStringErrorMessage(changeFilterDlg.getDuplicateFilterStringErrorMessage());
page.setFilterStringEditPane(changeFilterDlg.getFilterStringEditPane(shell)); page.setFilterStringEditPane(changeFilterDlg.getFilterStringEditPane(shell));
page.setFilterStringValidator(changeFilterDlg.getFilterStringValidator()); page.setFilterStringValidator(changeFilterDlg.getFilterStringValidator());
page.setDescription(changeFilterDlg.getTitle()); page.setDescription(changeFilterDlg.getTitle());
} }
} }
if (selectedFilter.isNonChangable()) if (selectedFilter.isNonChangable())
page.setEditable(false); page.setEditable(false);
} }
// --------------------------------- // ---------------------------------
// FILTER POOL REFERENCE METHODS... // FILTER POOL REFERENCE METHODS...
// --------------------------------- // ---------------------------------
/** /**
* Returns a list of actions for the popup menu when user right clicks on a * Returns a list of actions for the popup menu when user right clicks on a
@ -1050,8 +1053,8 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
if (ourChildActions.elementAt(idx) instanceof SystemPasteFromClipboardAction) pasteIndex = idx; if (ourChildActions.elementAt(idx) instanceof SystemPasteFromClipboardAction) pasteIndex = idx;
else childActions.addElement(ourChildActions.elementAt(idx)); else childActions.addElement(ourChildActions.elementAt(idx));
} }
// Add our static default-supplied actions // Add our static default-supplied actions
if (filterActions == null) if (filterActions == null)
{ {
int additionalActions = 4; int additionalActions = 4;
@ -1070,7 +1073,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
{ {
filterActions[fsIdx++] = (IAction) ourChildActions.elementAt(pasteIndex); filterActions[fsIdx++] = (IAction) ourChildActions.elementAt(pasteIndex);
} }
SystemFilterMoveFilterAction moveAction = new SystemFilterMoveFilterAction(shell); SystemFilterMoveFilterAction moveAction = new SystemFilterMoveFilterAction(shell);
moveAction.setPromptString(SystemResources.RESID_MOVE_TARGET_FILTERPOOL_PROMPT); moveAction.setPromptString(SystemResources.RESID_MOVE_TARGET_FILTERPOOL_PROMPT);
moveAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0083"); //$NON-NLS-1$ moveAction.setHelp(RSEUIPlugin.HELPPREFIX + "actn0083"); //$NON-NLS-1$
@ -1089,7 +1092,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
if (newNestedFilterAction != null) if (newNestedFilterAction != null)
childActions.addElement(newNestedFilterAction); childActions.addElement(newNestedFilterAction);
} }
// IAction chgFilterAction = getChangeFilterAction(config, selectedFilter, shell); // IAction chgFilterAction = getChangeFilterAction(config, selectedFilter, shell);
// if (chgFilterAction != null) // if (chgFilterAction != null)
// childActions.addElement(chgFilterAction); // childActions.addElement(chgFilterAction);
@ -1155,7 +1158,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
/** /**
* Return the form used in the property page, etc for this server launcher. * Return the form used in the property page, etc for this server launcher.
* Only called if {@link ISubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.core.model.IHost)} returns true. * Only called if {@link ISubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.core.model.IHost)} returns true.
* <p> * <p>
* Override if appropriate. * Override if appropriate.
* @return the UI form for the server launcher. * @return the UI form for the server launcher.
@ -1198,7 +1201,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
false, false,
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_NOTVALID), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_NOTVALID),
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY)); RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY));
// false => allow empty? No. // false => allow empty? No.
return userIdValidator; return userIdValidator;
} }

View file

@ -366,6 +366,10 @@ public class SystemTableView
_downI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID); _downI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_ARROW_DOWN_ID);
} }
/**
* @since 3.0 Moved SystemTableViewProvider from internal to API
* @return
*/
protected SystemTableViewProvider getProvider() protected SystemTableViewProvider getProvider()
{ {
if (_provider == null) if (_provider == null)
@ -495,6 +499,11 @@ public class SystemTableView
return new IPropertyDescriptor[0]; return new IPropertyDescriptor[0];
} }
/**
* @since 3.0 replaced SystemTableViewColumnManager by
* ISystemTableViewColumnManager
* @return
*/
public ISystemTableViewColumnManager getColumnManager() public ISystemTableViewColumnManager getColumnManager()
{ {
return _columnManager; return _columnManager;
@ -1412,10 +1421,13 @@ public class SystemTableView
_refreshAction = new SystemRefreshAction(getShell()); _refreshAction = new SystemRefreshAction(getShell());
return _refreshAction; return _refreshAction;
} }
/** /**
* Rather than pre-defining this common action we wait until it is first needed, * Rather than pre-defining this common action we wait until it is first
* for performance reasons. * needed, for performance reasons.
*
* @since 3.0
*/ */
public IAction getNewConnectionAction() { public IAction getNewConnectionAction() {
if (_newConnectionAction == null) _newConnectionAction = new SystemNewConnectionAction(getShell(), true, this); // true=>from popup menu if (_newConnectionAction == null) _newConnectionAction = new SystemNewConnectionAction(getShell(), true, this); // true=>from popup menu
@ -1432,10 +1444,10 @@ public class SystemTableView
_importConnectionAction.setShell(getShell()); _importConnectionAction.setShell(getShell());
_importConnectionAction.setText(SystemResources.RESID_IMPORT_CONNECTION_LABEL_LONG); _importConnectionAction.setText(SystemResources.RESID_IMPORT_CONNECTION_LABEL_LONG);
} }
return _importConnectionAction; return _importConnectionAction;
} }
/* /*
* Get the common "Open to->" action for opening a new Remote System Explorer view, * Get the common "Open to->" action for opening a new Remote System Explorer view,
* scoped to the currently selected object. * scoped to the currently selected object.
@ -1700,6 +1712,8 @@ public class SystemTableView
/** /**
* Get the specific "Renaming %1..." * Get the specific "Renaming %1..."
*
* @since 3.0
*/ */
protected SystemMessage getRenamingMessage(String oldName) protected SystemMessage getRenamingMessage(String oldName)
{ {
@ -1829,7 +1843,7 @@ public class SystemTableView
menu.add(getImportConnectionAction()); menu.add(getImportConnectionAction());
menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions menu.add(new GroupMarker(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions
} }
else else
{ {
SystemView.createStandardGroups(menu); SystemView.createStandardGroups(menu);
// ADD COMMON ACTIONS... // ADD COMMON ACTIONS...

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* David McKnight (IBM) - [216161] table view needs to handle context when filter reference is input * David McKnight (IBM) - [216161] table view needs to handle context when filter reference is input
@ -46,10 +46,11 @@ import org.eclipse.ui.views.properties.IPropertyDescriptor;
/** /**
* This is the content and label provider for the SystemTableView. * This is the content and label provider for the SystemTableView. This class is
* This class is used both to populate the SystemTableView but also * used both to populate the SystemTableView but also to resolve the icon and
* to resolve the icon and labels for the cells in the table. * labels for the cells in the table.
* *
* @since 3.0 Moved from internal to API
*/ */
public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvider, ITreeContentProvider public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvider, ITreeContentProvider
{ {
@ -135,11 +136,11 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
protected ISystemViewElementAdapter getAdapterFor(Object object) protected ISystemViewElementAdapter getAdapterFor(Object object)
{ {
ISystemViewElementAdapter result = null; ISystemViewElementAdapter result = null;
if (_viewer != null) if (_viewer != null)
{ {
result = SystemAdapterHelpers.getViewAdapter(object, _viewer); result = SystemAdapterHelpers.getViewAdapter(object, _viewer);
} }
else else
{ {
result = SystemAdapterHelpers.getViewAdapter(object); result = SystemAdapterHelpers.getViewAdapter(object);
} }
@ -164,17 +165,17 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
if (adapter != null) if (adapter != null)
{ {
adapter.setViewer(_viewer); adapter.setViewer(_viewer);
// do we have context? // do we have context?
if (object instanceof ISystemFilterReference) { if (object instanceof ISystemFilterReference) {
ISubSystem ss = adapter.getSubSystem(object); ISubSystem ss = adapter.getSubSystem(object);
ContextObject context = new ContextObject(object, ss, (ISystemFilterReference)object); ContextObject context = new ContextObject(object, ss, (ISystemFilterReference)object);
results = adapter.getChildren(context, new NullProgressMonitor()); results = adapter.getChildren(context, new NullProgressMonitor());
} }
else { else {
results = adapter.getChildren((IAdaptable)object, new NullProgressMonitor()); results = adapter.getChildren((IAdaptable)object, new NullProgressMonitor());
} }
if (adapter instanceof SystemViewRootInputAdapter) if (adapter instanceof SystemViewRootInputAdapter)
{ {
@ -185,12 +186,12 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
ISystemViewElementAdapter cadapter = getAdapterFor(result); ISystemViewElementAdapter cadapter = getAdapterFor(result);
if (!(cadapter instanceof SystemViewPromptableAdapter)) if (!(cadapter instanceof SystemViewPromptableAdapter))
{ {
filterredResults.add(result); filterredResults.add(result);
} }
} }
results = filterredResults.toArray(); results = filterredResults.toArray();
} }
_lastResults = results; _lastResults = results;
_lastObject = object; _lastObject = object;
} }
@ -204,7 +205,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
} }
public String getText(Object object) public String getText(Object object)
{ {
String result = getAdapterFor(object).getText(object); String result = getAdapterFor(object).getText(object);
int len = result.length(); int len = result.length();
if (len > _maxCharsInColumnZero) if (len > _maxCharsInColumnZero)
@ -213,7 +214,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
} }
return result; return result;
} }
public int getMaxCharsInColumnZero() public int getMaxCharsInColumnZero()
{ {
return _maxCharsInColumnZero; return _maxCharsInColumnZero;
@ -239,7 +240,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
} }
return image; return image;
} }
public String getColumnText(Object obj, int index) public String getColumnText(Object obj, int index)
{ {
if (index == 0) if (index == 0)
@ -256,7 +257,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
IPropertyDescriptor[] descriptors = null; IPropertyDescriptor[] descriptors = null;
if (_columnManager != null) if (_columnManager != null)
{ {
descriptors = _columnManager.getVisibleDescriptors(adapter); descriptors = _columnManager.getVisibleDescriptors(adapter);
} }
else else
{ {
@ -279,7 +280,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
} }
else if (propertyValue instanceof Date) else if (propertyValue instanceof Date)
{ {
return _dateFormat.format((Date)propertyValue); return _dateFormat.format((Date)propertyValue);
} }
else else
if (propertyValue != null) if (propertyValue != null)
@ -324,7 +325,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
{ {
listeners.remove(listener); listeners.remove(listener);
} }
/** /**
* Cache the objects for the given parent. * Cache the objects for the given parent.
* @param parent the parent object. * @param parent the parent object.
@ -333,7 +334,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
public void setCachedObjects(Object parent, Object[] children) { public void setCachedObjects(Object parent, Object[] children) {
cache.put(parent, children); cache.put(parent, children);
} }
/** /**
* Returns the cached objects for the given parent. * Returns the cached objects for the given parent.
* @param parent the parent object. * @param parent the parent object.
@ -342,7 +343,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
public Object[] getCachedObjects(Object parent) { public Object[] getCachedObjects(Object parent) {
return (Object[])(cache.get(parent)); return (Object[])(cache.get(parent));
} }
public void setCache(Object[] newCache) public void setCache(Object[] newCache)
{ {
@ -364,7 +365,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
{ {
// ((ISystemContainer)_lastObject).markStale(true); // ((ISystemContainer)_lastObject).markStale(true);
} }
_lastResults = null; _lastResults = null;
return true; return true;
} }
@ -372,6 +373,6 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
public void dispose() public void dispose()
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
} }

View file

@ -1,18 +1,18 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Uwe Stieber (Wind River) - Reworked new connection wizard extension point.
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Javier Montalvo Orus (Symbian) - [188146] Incorrect "FTP Settings" node in Property Sheet for Linux connection * Javier Montalvo Orus (Symbian) - [188146] Incorrect "FTP Settings" node in Property Sheet for Linux connection
@ -59,7 +59,7 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
private ISubSystemConfiguration _selectedConfiguration; private ISubSystemConfiguration _selectedConfiguration;
private ServiceElement _root; private ServiceElement _root;
private ServiceElement[] _serviceElements; private ServiceElement[] _serviceElements;
public SubSystemServiceWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageName, String pageTitle, String pageDescription) public SubSystemServiceWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, String pageName, String pageTitle, String pageDescription)
{ {
super(wizard, parentFactory, pageName, pageTitle, pageDescription); super(wizard, parentFactory, pageName, pageTitle, pageDescription);
@ -80,26 +80,26 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
SystemWidgetHelpers.setHelp(parent, "org.eclipse.rse.ui.ServiceSubsystemWizardPage"); //$NON-NLS-1$ SystemWidgetHelpers.setHelp(parent, "org.eclipse.rse.ui.ServiceSubsystemWizardPage"); //$NON-NLS-1$
_form = new ServicesForm(parent.getShell(), getMessageLine()); _form = new ServicesForm(parent.getShell(), getMessageLine());
Control control = _form.createContents(parent); Control control = _form.createContents(parent);
ServiceElement[] elements = getServiceElements(); ServiceElement[] elements = getServiceElements();
_root = new RootServiceElement(elements); _root = new RootServiceElement(elements);
_form.init(_root); _form.init(_root);
return control; return control;
} }
protected ServiceElement[] getServiceElements() protected ServiceElement[] getServiceElements()
{ {
if (_serviceElements == null) if (_serviceElements == null)
{ {
ISubSystemConfiguration currentFactory = getSubSystemConfiguration(); ISubSystemConfiguration currentFactory = getSubSystemConfiguration();
IRSESystemType systemType = getMainPage() != null && getMainPage().getWizard() instanceof RSEDefaultNewConnectionWizard ? ((RSEDefaultNewConnectionWizard)getMainPage().getWizard()).getSystemType() : null; IRSESystemType systemType = getMainPage() != null && getMainPage().getWizard() instanceof RSEDefaultNewConnectionWizard ? ((RSEDefaultNewConnectionWizard)getMainPage().getWizard()).getSystemType() : null;
ISubSystemConfiguration[] factories = getServiceSubSystemConfigurations(systemType, currentFactory.getServiceType()); ISubSystemConfiguration[] factories = getServiceSubSystemConfigurations(systemType, currentFactory.getServiceType());
IHost dummyHost = null; IHost dummyHost = null;
if (getWizard() instanceof RSEDefaultNewConnectionWizard) if (getWizard() instanceof RSEDefaultNewConnectionWizard)
{ {
@ -109,32 +109,39 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
wizard.getSystemType()); wizard.getSystemType());
} }
} }
// create elements for each // create elements for each
_serviceElements = new ServiceElement[factories.length]; _serviceElements = new ServiceElement[factories.length];
for (int i = 0; i < factories.length; i++) for (int i = 0; i < factories.length; i++)
{ {
ISubSystemConfiguration factory = factories[i]; ISubSystemConfiguration factory = factories[i];
_serviceElements[i] = new FactoryServiceElement(dummyHost, factory); _serviceElements[i] = new FactoryServiceElement(dummyHost, factory);
//if (factory == currentFactory) //if (factory == currentFactory)
if (i == 0) // use first if (i == 0) // use first
{ {
_serviceElements[i].setSelected(true); _serviceElements[i].setSelected(true);
} }
} }
} }
return _serviceElements; return _serviceElements;
} }
/**
* @param systemType
* @param serviceType
* @return
* @since 3.0 returning ISubSystemConfiguration instead of
* IServiceSubSystemConfiguration
*/
protected ISubSystemConfiguration[] getServiceSubSystemConfigurations(IRSESystemType systemType, Class serviceType) protected ISubSystemConfiguration[] getServiceSubSystemConfigurations(IRSESystemType systemType, Class serviceType)
{ {
List results = new ArrayList(); List results = new ArrayList();
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystemConfiguration[] configs = sr.getSubSystemConfigurationsBySystemType(systemType, false); ISubSystemConfiguration[] configs = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < configs.length; i++) for (int i = 0; i < configs.length; i++)
{ {
ISubSystemConfiguration config = configs[i]; ISubSystemConfiguration config = configs[i];
@ -143,10 +150,10 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
results.add(config); results.add(config);
} }
} }
return (ISubSystemConfiguration[])results.toArray(new ISubSystemConfiguration[results.size()]); return (ISubSystemConfiguration[])results.toArray(new ISubSystemConfiguration[results.size()]);
} }
public boolean isPageComplete() public boolean isPageComplete()
{ {
return true; return true;
@ -157,12 +164,12 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
if (_root != null) if (_root != null)
{ {
_root.commit(); _root.commit();
_selectedConfiguration = ((FactoryServiceElement)_form.getSelectedService()).getFactory(); _selectedConfiguration = ((FactoryServiceElement)_form.getSelectedService()).getFactory();
} }
return true; return true;
} }
protected ServerLauncherPropertiesServiceElement[] getPropertiesServiceElement() protected ServerLauncherPropertiesServiceElement[] getPropertiesServiceElement()
{ {
List results = new ArrayList(); List results = new ArrayList();
@ -181,7 +188,7 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
if (child instanceof ConnectorServiceElement) if (child instanceof ConnectorServiceElement)
{ {
ServiceElement[] cch = child.getChildren(); ServiceElement[] cch = child.getChildren();
if (cch != null && cch.length > 0) if (cch != null && cch.length > 0)
{ {
if(cch[0] instanceof ServerLauncherPropertiesServiceElement) if(cch[0] instanceof ServerLauncherPropertiesServiceElement)
{ {
@ -238,11 +245,11 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
} }
return true; return true;
} }
/** /**
* Returns the list of connector service elements from a given service element. * Returns the list of connector service elements from a given service element.
* @param root The root element from which to search * @param root The root element from which to search
* @return A list of all found connector service elements. The list will be empty if non * @return A list of all found connector service elements. The list will be empty if non
* are found. * are found.
*/ */
private List getConnectorServiceElements(ServiceElement root) { private List getConnectorServiceElements(ServiceElement root) {
@ -252,7 +259,7 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
if (root instanceof ConnectorServiceElement) { if (root instanceof ConnectorServiceElement) {
result.add(root); result.add(root);
} }
ServiceElement[] children = root.getChildren(); ServiceElement[] children = root.getChildren();
if (children != null) { if (children != null) {
for (int i = 0; i < children.length; i++) { for (int i = 0; i < children.length; i++) {
@ -263,7 +270,11 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
} }
return result; return result;
} }
/**
* @since 3.0 taking ISubSystemConfiguration instead of
* IServiceSubSystemConfiguration
*/
protected IConnectorService getCustomConnectorService(ISubSystemConfiguration config) protected IConnectorService getCustomConnectorService(ISubSystemConfiguration config)
{ {
ServiceElement[] children = _root.getChildren(); ServiceElement[] children = _root.getChildren();
@ -279,13 +290,13 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
} }
} }
} }
return null; return null;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/ */
public void handleVerifyComplete() public void handleVerifyComplete()
{ {
boolean complete = isPageComplete(); boolean complete = isPageComplete();
clearErrorMessage(); clearErrorMessage();

View file

@ -17,13 +17,13 @@ import org.eclipse.rse.core.model.ISubSystemConfigurator;
/** /**
* Interface that all subsystem configuration supplied pages contributed to the * Interface that all subsystem configuration supplied pages contributed to the
* New Connection wizard must implement. Moved from Core to UI in RSE 3.0 * New Connection wizard must implement. Moved from Core to UI in RSE 3.0
* *
* @see org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage * @see org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage
* @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter# * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#
* getNewConnectionWizardPages * getNewConnectionWizardPages
* (org.eclipse.rse.core.subsystems.ISubSystemConfiguration, * (org.eclipse.rse.core.subsystems.ISubSystemConfiguration,
* org.eclipse.jface.wizard.IWizard) * org.eclipse.jface.wizard.IWizard)
* @since 3.0 * @since 3.0 moved from Core to UI and extends ISubSystemConfigurator
*/ */
public interface ISystemNewConnectionWizardPage extends ISubSystemConfigurator { public interface ISystemNewConnectionWizardPage extends ISubSystemConfigurator {

View file

@ -56,6 +56,7 @@ import org.eclipse.ui.IWorkbench;
public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, ISelectionProvider { public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, ISelectionProvider {
/** /**
* Dialog settings slot id: Last selected system type id within the wizard. * Dialog settings slot id: Last selected system type id within the wizard.
* @since 3.0 made protected String public
*/ */
public static final String LAST_SELECTED_SYSTEM_TYPE_ID = "lastSelectedSystemTypeId"; //$NON-NLS-1$ public static final String LAST_SELECTED_SYSTEM_TYPE_ID = "lastSelectedSystemTypeId"; //$NON-NLS-1$

View file

@ -191,6 +191,7 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
* Returns the list of system types the page is restricted to. * Returns the list of system types the page is restricted to.
* *
* @return The list of system types the page is restricted to or <code>null</code>. * @return The list of system types the page is restricted to or <code>null</code>.
* @since 3.0 made protected method public
*/ */
public IRSESystemType[] getRestrictToSystemTypes() { public IRSESystemType[] getRestrictToSystemTypes() {
return restrictedSystemTypes; return restrictedSystemTypes;

View file

@ -541,10 +541,9 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
system.clearCredentials(); system.clearCredentials();
} }
/* /**
* (non-Javadoc) * @{inheritDoc
* * @since 3.0
* @see org.eclipse.rse.core.subsystems.ISubSystem#checkIsConnected(org.eclipse.core.runtime.IProgressMonitor)
*/ */
public void checkIsConnected(IProgressMonitor monitor) throws SystemMessageException public void checkIsConnected(IProgressMonitor monitor) throws SystemMessageException
{ {
@ -2180,7 +2179,7 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
{ {
// for bug 233435, implicit connect if the connection is not connected // for bug 233435, implicit connect if the connection is not connected
checkIsConnected(monitor); checkIsConnected(monitor);
if (isConnected()) if (isConnected())
{ {
if (!supportsConnecting && !_isInitialized) { if (!supportsConnecting && !_isInitialized) {
@ -3237,7 +3236,7 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
* the subsystem is compatible with the suggested configuration. If it is * the subsystem is compatible with the suggested configuration. If it is
* the switch will be performed and internalSwitchSubSystemConfiguration * the switch will be performed and internalSwitchSubSystemConfiguration
* will be called. * will be called.
* *
* @see ISubSystem#switchServiceFactory(ISubSystemConfiguration) * @see ISubSystem#switchServiceFactory(ISubSystemConfiguration)
* @see #internalSwitchSubSystemConfiguration(ISubSystemConfiguration) * @see #internalSwitchSubSystemConfiguration(ISubSystemConfiguration)
* @since 3.0 * @since 3.0

View file

@ -553,7 +553,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
* from static declaration in the * from static declaration in the
* <tt>org.eclipse.rse.core.subsystemConfigurations</tt> and * <tt>org.eclipse.rse.core.subsystemConfigurations</tt> and
* <tt>org.eclipse.rse.core.systemTypes</tt> extension points. * <tt>org.eclipse.rse.core.systemTypes</tt> extension points.
* *
* @nooverride This method is not intended to be re-implemented or extended * @nooverride This method is not intended to be re-implemented or extended
* by clients. It will likely be declared <tt>final</tt> in the next * by clients. It will likely be declared <tt>final</tt> in the next
* release in order to ensure consistency with static xml markup in the * release in order to ensure consistency with static xml markup in the
@ -1605,8 +1605,9 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
return getFilterPoolManager(profile, false); return getFilterPoolManager(profile, false);
} }
/* (non-Javadoc) /**
* @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getFilterPoolManager(org.eclipse.rse.core.model.ISystemProfile, boolean) * {@inheritDoc}
* @since 3.0 added boolean argument
*/ */
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force) { public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force) {
// it is important to key by profile object not profile name, since that name can change but the object never should for any one session. // it is important to key by profile object not profile name, since that name can change but the object never should for any one session.