mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
[216252][api][breaking] Rename canceledObject -> cancelledObject
This commit is contained in:
parent
8a9b6c2e00
commit
05b8a3f991
3 changed files with 486 additions and 407 deletions
|
@ -580,7 +580,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
|
|||
children = subsystem.resolveFilterString(filterString, new NullProgressMonitor());
|
||||
} catch (InterruptedException exc)
|
||||
{
|
||||
if (canceledObject == null)
|
||||
if (cancelledObject == null)
|
||||
children = getCancelledMessageObject();
|
||||
} catch (Exception exc)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,18 +1,18 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following IBM employees contributed to the Remote System Explorer
|
||||
* component that contains this file: David McKnight, Kushal Munir,
|
||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||
* component that contains this file: David McKnight, Kushal Munir,
|
||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* 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) - [218524][api] Remove deprecated ISystemViewInputProvider#getShell()
|
||||
* 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
|
||||
* use as a parent class.
|
||||
*/
|
||||
public abstract class SystemAbstractAPIProvider
|
||||
public abstract class SystemAbstractAPIProvider
|
||||
implements ISystemViewInputProvider
|
||||
{
|
||||
protected Viewer viewer;
|
||||
/**
|
||||
* @deprecated don't use this field
|
||||
*/
|
||||
protected ISystemRegistry sr;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated don't use this field
|
||||
*/
|
||||
protected Object[] emptyList = new Object[0];
|
||||
/**
|
||||
* @deprecated don't use this field
|
||||
*/
|
||||
protected Object[] msgList = new Object[1];
|
||||
/**
|
||||
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super();
|
||||
sr = RSECorePlugin.getTheSystemRegistry();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is the method required by the IAdaptable interface.
|
||||
* 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)
|
||||
{
|
||||
return Platform.getAdapterManager().getAdapter(this, adapterType);
|
||||
}
|
||||
return Platform.getAdapterManager().getAdapter(this, adapterType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -81,7 +97,7 @@ public abstract class SystemAbstractAPIProvider
|
|||
{
|
||||
this.viewer = (Viewer)viewer;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer()
|
||||
|
@ -94,22 +110,26 @@ public abstract class SystemAbstractAPIProvider
|
|||
protected final void initMsgObjects()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* <i>Callable by subclasses. Do not override</i><br>
|
||||
* In getChildren, return <samp>checkForEmptyList(children, parent, true/false)<.samp>
|
||||
* versus your array directly. This method checks for a null array which is
|
||||
* not allowed 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
|
||||
*
|
||||
* @param children The list of children.
|
||||
* @param parent The parent for the children.
|
||||
* @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.
|
||||
*/
|
||||
* <i>Callable by subclasses. Do not override.</i><br>
|
||||
* In getChildren, return <samp>checkForEmptyList(children, parent,
|
||||
* true/false)</samp> versus your array directly. This method checks for a
|
||||
* null array which is not allowed 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
|
||||
*
|
||||
* @param children The list of children.
|
||||
* @param parent The parent for the children.
|
||||
* @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) {
|
||||
if ((children == null) || (children.length == 0)) {
|
||||
if (fPrefStore == null) {
|
||||
|
@ -123,18 +143,18 @@ public abstract class SystemAbstractAPIProvider
|
|||
return new Object[] {
|
||||
new SystemMessageObject(
|
||||
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_EMPTY),
|
||||
ISystemMessageObject.MSGTYPE_EMPTY,
|
||||
ISystemMessageObject.MSGTYPE_EMPTY,
|
||||
parent)};
|
||||
}
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
protected Object[] getCancelledMessageObject()
|
||||
{
|
||||
if (canceledObject == null)
|
||||
{
|
||||
if (cancelledObject == null)
|
||||
initMsgObjects();
|
||||
msgList[0] = canceledObject;
|
||||
msgList[0] = cancelledObject;
|
||||
return msgList;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the "Operation failed" msg as an object array so can be used to answer getChildren()
|
||||
*/
|
||||
protected Object[] getFailedMessageObject()
|
||||
{
|
||||
{
|
||||
if (errorObject == null)
|
||||
initMsgObjects();
|
||||
msgList[0] = errorObject;
|
||||
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
|
||||
*/
|
||||
public boolean showingConnections()
|
||||
|
@ -188,22 +208,22 @@ public abstract class SystemAbstractAPIProvider
|
|||
|
||||
// ------------------
|
||||
// HELPER METHODS...
|
||||
// ------------------
|
||||
// ------------------
|
||||
/**
|
||||
* Returns the implementation of ISystemViewElement for the given
|
||||
* object. Returns null if the adapter is not defined or the
|
||||
* object is not adaptable.
|
||||
*/
|
||||
protected ISystemViewElementAdapter getViewAdapter(Object o)
|
||||
protected ISystemViewElementAdapter getViewAdapter(Object o)
|
||||
{
|
||||
return SystemAdapterHelpers.getViewAdapter(o);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the implementation of ISystemRemoteElement for the given
|
||||
* 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue