1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[216252][api][breaking] Rename canceledObject -> cancelledObject

This commit is contained in:
Martin Oberhuber 2008-04-17 10:03:00 +00:00
parent 8a9b6c2e00
commit 05b8a3f991
3 changed files with 486 additions and 407 deletions

View file

@ -580,7 +580,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
children = subsystem.resolveFilterString(filterString, new NullProgressMonitor()); children = subsystem.resolveFilterString(filterString, new NullProgressMonitor());
} catch (InterruptedException exc) } catch (InterruptedException exc)
{ {
if (canceledObject == null) if (cancelledObject == null)
children = getCancelledMessageObject(); children = getCancelledMessageObject();
} catch (Exception exc) } catch (Exception exc)
{ {

View file

@ -1,18 +1,18 @@
/******************************************************************************** /********************************************************************************
* 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
* Tobias Schwarz (Wind River) - [173267] "empty list" should not be displayed * Tobias Schwarz (Wind River) - [173267] "empty list" should not be displayed
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
* Martin Oberhuber (Wind River) - [218524][api] Remove deprecated ISystemViewInputProvider#getShell() * Martin Oberhuber (Wind River) - [218524][api] Remove deprecated ISystemViewInputProvider#getShell()
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
@ -37,32 +37,48 @@ import org.eclipse.rse.ui.RSEUIPlugin;
* This is a base class that a provider of root nodes to the remote systems tree viewer part can * This is a base class that a provider of root nodes to the remote systems tree viewer part can
* use as a parent class. * use as a parent class.
*/ */
public abstract class SystemAbstractAPIProvider public abstract class SystemAbstractAPIProvider
implements ISystemViewInputProvider implements ISystemViewInputProvider
{ {
protected Viewer viewer; protected Viewer viewer;
/**
* @deprecated don't use this field
*/
protected ISystemRegistry sr; protected ISystemRegistry sr;
/**
* @deprecated don't use this field
*/
protected Object[] emptyList = new Object[0]; protected Object[] emptyList = new Object[0];
/**
* @deprecated don't use this field
*/
protected Object[] msgList = new Object[1]; protected Object[] msgList = new Object[1];
/** /**
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead. * @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
*/ */
protected SystemMessageObject nullObject = null; protected SystemMessageObject nullObject = null;
protected SystemMessageObject canceledObject = null;
protected SystemMessageObject errorObject = null;
private Preferences fPrefStore = null;
/** /**
* Constructor * @since org.eclipse.rse.ui 3.0 renamed from canceledObject
* @deprecated don't use this field
*/
protected SystemMessageObject cancelledObject = null;
/**
* @deprecated don't use this field
*/
protected SystemMessageObject errorObject = null;
private Preferences fPrefStore = null;
/**
* Constructor
*/ */
public SystemAbstractAPIProvider() public SystemAbstractAPIProvider()
{ {
super(); super();
sr = RSECorePlugin.getTheSystemRegistry(); sr = RSECorePlugin.getTheSystemRegistry();
} }
/** /**
* This is the method required by the IAdaptable interface. * This is the method required by the IAdaptable interface.
* Given an adapter class type, return an object castable to the type, or * Given an adapter class type, return an object castable to the type, or
@ -70,8 +86,8 @@ public abstract class SystemAbstractAPIProvider
*/ */
public Object getAdapter(Class adapterType) public Object getAdapter(Class adapterType)
{ {
return Platform.getAdapterManager().getAdapter(this, adapterType); return Platform.getAdapterManager().getAdapter(this, adapterType);
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -81,7 +97,7 @@ public abstract class SystemAbstractAPIProvider
{ {
this.viewer = (Viewer)viewer; this.viewer = (Viewer)viewer;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer() * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer()
@ -94,22 +110,26 @@ public abstract class SystemAbstractAPIProvider
protected final void initMsgObjects() protected final void initMsgObjects()
{ {
nullObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),ISystemMessageObject.MSGTYPE_EMPTY, null); nullObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),ISystemMessageObject.MSGTYPE_EMPTY, null);
canceledObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LIST_CANCELLED),ISystemMessageObject.MSGTYPE_CANCEL, null); cancelledObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LIST_CANCELLED),ISystemMessageObject.MSGTYPE_CANCEL, null);
errorObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),ISystemMessageObject.MSGTYPE_ERROR, null); errorObject = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),ISystemMessageObject.MSGTYPE_ERROR, null);
} }
/** /**
* <i>Callable by subclasses. Do not override</i><br> * <i>Callable by subclasses. Do not override.</i><br>
* In getChildren, return <samp>checkForEmptyList(children, parent, true/false)<.samp> * In getChildren, return <samp>checkForEmptyList(children, parent,
* versus your array directly. This method checks for a null array which is * true/false)</samp> versus your array directly. This method checks for a
* not allowed and replaces it with an empty array. * null array which is not allowed and replaces it with an empty array. If
* If true is passed then it returns the "Empty list" message object if the array is null or empty * true is passed then it returns the "Empty list" message object if the
* * array is null or empty
* @param children The list of children. *
* @param parent The parent for the children. * @param children The list of children.
* @param returnNullMsg <code>true</code> if an "Empty List" message should be returned. * @param parent The parent for the children.
* @return The list of children, a list with the "Empty List" message object or an empty list. * @param returnNullMsg <code>true</code> if an "Empty List" message
*/ * should be returned.
* @return The list of children, a list with the "Empty List" message object
* or an empty list.
* @noextend This method is not intended to be extended by clients.
*/
protected Object[] checkForEmptyList(Object[] children, Object parent, boolean returnNullMsg) { protected Object[] checkForEmptyList(Object[] children, Object parent, boolean returnNullMsg) {
if ((children == null) || (children.length == 0)) { if ((children == null) || (children.length == 0)) {
if (fPrefStore == null) { if (fPrefStore == null) {
@ -123,18 +143,18 @@ public abstract class SystemAbstractAPIProvider
return new Object[] { return new Object[] {
new SystemMessageObject( new SystemMessageObject(
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),
ISystemMessageObject.MSGTYPE_EMPTY, ISystemMessageObject.MSGTYPE_EMPTY,
parent)}; parent)};
} }
} }
return children; return children;
} }
/** /**
* In getChildren, return checkForNull(children, true/false) vs your array directly. * In getChildren, return checkForNull(children, true/false) vs your array directly.
* This method checks for a null array which not allow and replaces it with an empty array. * This method checks for a null array which not allow and replaces it with an empty array.
* If true is passed then it returns the "Empty list" message object if the array is null or empty * If true is passed then it returns the "Empty list" message object if the array is null or empty
* *
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead. * @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
*/ */
protected Object[] checkForNull(Object[] children, boolean returnNullMsg) protected Object[] checkForNull(Object[] children, boolean returnNullMsg)
@ -159,26 +179,26 @@ public abstract class SystemAbstractAPIProvider
* Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren() * Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()
*/ */
protected Object[] getCancelledMessageObject() protected Object[] getCancelledMessageObject()
{ {
if (canceledObject == null) if (cancelledObject == null)
initMsgObjects(); initMsgObjects();
msgList[0] = canceledObject; msgList[0] = cancelledObject;
return msgList; return msgList;
} }
/** /**
* Return the "Operation failed" msg as an object array so can be used to answer getChildren() * Return the "Operation failed" msg as an object array so can be used to answer getChildren()
*/ */
protected Object[] getFailedMessageObject() protected Object[] getFailedMessageObject()
{ {
if (errorObject == null) if (errorObject == null)
initMsgObjects(); initMsgObjects();
msgList[0] = errorObject; msgList[0] = errorObject;
return msgList; return msgList;
} }
/** /**
* Return true if we are listing connections or not, so we know whether we are interested in * Return true if we are listing connections or not, so we know whether we are interested in
* connection-add events * connection-add events
*/ */
public boolean showingConnections() public boolean showingConnections()
@ -188,22 +208,22 @@ public abstract class SystemAbstractAPIProvider
// ------------------ // ------------------
// HELPER METHODS... // HELPER METHODS...
// ------------------ // ------------------
/** /**
* 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);
} }
/** /**
* 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);
} }