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());
} catch (InterruptedException exc)
{
if (canceledObject == null)
if (cancelledObject == null)
children = getCancelledMessageObject();
} catch (Exception exc)
{

View file

@ -111,7 +111,7 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
//protected boolean isEditable = false;
protected String filterString = null;
private String filterString = null;
/**
* Current viewer. Set by content provider
@ -138,21 +138,30 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
*/
protected Object[] emptyList = new Object[0];
/**
* For returning a msg object from getChildren. Will be an array with one item,
* one of nullObject, canceledObject or errorObject
* For returning a message object from getChildren. Will be an array with
* one item, one of nullObject, cancelledObject or errorObject
*/
protected Object[] msgList = new Object[1];
/**
* Frequently returned msg object from getChildren: "empty list"
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
* Frequently returned message object from getChildren: "empty list"
*
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)}
* instead.
*/
protected SystemMessageObject nullObject = null;
/**
* Frequently returned msg object from getChildren: "operation cancelled"
* Frequently returned message object from getChildren: "operation
* cancelled"
*
* @since org.eclipse.rse.ui 3.0 renamed from canceledObject
* @deprecated don't use this field.
*/
protected SystemMessageObject canceledObject = null;
protected SystemMessageObject cancelledObject = null;
/**
* Frequently returned msg object from getChildren: "operation ended in error"
* Frequently returned message object from getChildren: "operation ended in
* error"
*
* @deprecated don't use this field.
*/
protected SystemMessageObject errorObject = null;
@ -209,16 +218,18 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
// ------------------------------------------------------------------
/**
* <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
* Set the viewer that is driving this adapter
* Called by label and content provider.
* <i>Configuration method. Typically called by content provider, viewer or
* action. Do not override.</i><br>
* Set the viewer that is driving this adapter Called by label and content
* provider.
*/
public final void setViewer(Viewer viewer)
{
this.viewer = viewer;
}
/**
* <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
* <i>Configuration method. Typically called by content provider, viewer or
* action. Do not override.</i><br>
* Set the shell to be used by any method that requires it.
*/
public final void setShell(Shell shell)
@ -226,10 +237,11 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
this.shell = shell;
}
/**
* <i>Configuration method. Typically called by content provider, viewer or action. Do not override.</i><br>
* Set the input object used to populate the viewer with the roots.
* May be used by an adapter to retrieve context-sensitive information.
* This is set by the Label and Content providers that retrieve this adapter.
* <i>Configuration method. Typically called by content provider, viewer or
* action. Do not override.</i><br>
* Set the input object used to populate the viewer with the roots. May be
* used by an adapter to retrieve context-sensitive information. This is set
* by the Label and Content providers that retrieve this adapter.
*/
public final void setInput(ISystemViewInputProvider input)
{
@ -243,6 +255,8 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i>Getter method. Callable by subclasses. Do not override.</i><br>
* Get the shell currently hosting the objects in this adapter
*
* @noextend This method is not intended to be extended by clients.
*/
public Shell getShell()
{
@ -268,6 +282,8 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
* <i>Getter method. Callable by subclasses. Do not override.</i><br>
* Return the current viewer, as set via setViewer or its deduced from the
* setInput input object if set. May be null so test it.
*
* @noextend This method is not intended to be extended by clients.
*/
public Viewer getViewer()
{
@ -292,7 +308,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Getter method. Callable by subclasses. Do not override.</i><br>
* Return the current viewer as an ISystemTree if it is one, or null otherwise
* Return the current viewer as an ISystemTree if it is one, or null
* otherwise
*
* @noextend This method is not intended to be extended by clients.
*/
protected ISystemTree getCurrentTreeView()
{
@ -305,8 +324,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i>Getter method. Callable by subclasses. Do not override.</i><br>
* Get the input object used to populate the viewer with the roots.
* May be used by an adapter to retrieve context-sensitive information.
* Get the input object used to populate the viewer with the roots. May be
* used by an adapter to retrieve context-sensitive information.
*
* @noextend This method is not intended to be extended by clients.
*/
public ISystemViewInputProvider getInput()
{
@ -669,13 +690,17 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i>Callable by subclasses. Do not override.</i><br>
* Returns the list of property descriptors that are unique for this
* particular adapter - that is the difference between the default
* property descriptors and the total list of property descriptors.
* particular adapter - that is the difference between the default property
* descriptors and the total list of property descriptors.
* <p>
* If internalGetPropertyDescriptors() returns non-null, then returns that,
* else computes the difference.
* <p>
* This is called by the table views like {@link org.eclipse.rse.ui.view.SystemTableView}.
* This is called by the table views like
* {@link org.eclipse.rse.ui.view.SystemTableView}.
* </p>
*
* @noextend This method is not intended to be extended by clients.
*/
public IPropertyDescriptor[] getUniquePropertyDescriptors()
{
@ -893,8 +918,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i>Called from adapter factories. Do not override.</i><br>
* Set input object for property source queries. This <b>must</b> be called by your
* XXXAdaptorFactory before returning this adapter object.
* Set input object for property source queries. This <b>must</b> be called
* by your XXXAdaptorFactory before returning this adapter object.
*
* @noextend This method is not intended to be extended by clients.
*/
public void setPropertySourceInput(Object propertySourceInput)
{
@ -941,9 +968,11 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i><b>Overridable</b> by subclasses, and usually is.</i><br>
* Perform the delete action. By default does nothing. Override if your object is deletable.
* Return true if this was successful. Return false if it failed and you issued a msg.
* Throw an exception if it failed and you want to use the generic msg.
* Perform the delete action. By default does nothing. Override if your
* object is deletable. Return true if this was successful. Return false if
* it failed and you issued a message. Throw an exception if it failed and
* you want to use the generic message.
*
* @see #showDelete(Object)
* @see #canDelete(Object)
*/
@ -954,10 +983,11 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i><b>Overridable</b> by subclasses, and usually is.</i><br>
* Perform the delete action. By default just calls the doDelete method for each item in the resourceSet.
* Override if you wish to perform some sort of optimization for the batch delete.
* Return true if this was successful. Return false if ANY delete op failed and a msg was issued.
* Throw an exception if ANY failed and you want to use the generic msg.
* Perform the delete action. By default just calls the doDelete method for
* each item in the resourceSet. Override if you wish to perform some sort
* of optimization for the batch delete. Return true if this was successful.
* Return false if ANY delete op failed and a message was issued. Throw an
* exception if ANY failed and you want to use the generic message.
*/
public boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor) throws Exception
{
@ -1006,9 +1036,11 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i><b>Overridable</b> by subclasses, and usually is.</i><br>
* Perform the rename action. By default does nothing. Override if your object is renamable.
* Return true if this was successful. Return false if it failed and you issued a msg.
* Throw an exception if it failed and you want to use the generic msg.
* Perform the rename action. By default does nothing. Override if your
* object is renamable. Return true if this was successful. Return false if
* it failed and you issued a message. Throw an exception if it failed and
* you want to use the generic message.
*
* @return true if the rename was successful
* @see #showRename(Object)
* @see #canRename(Object)
@ -1763,9 +1795,11 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* Return the current viewer as an ISystemTree if the viewer is set and
* it implements this interface (SystemView does). May be null so test it.
* <i>Callable by subclasses. Do not override.</i><br>
* Return the current viewer as an ISystemTree if the viewer is set and it
* implements this interface (SystemView does). May be null so test it.
*
* @noextend This method is not intended to be extended by clients.
*/
protected ISystemTree getSystemTree()
{
@ -1779,6 +1813,8 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
/**
* <i>Callable by subclasses. Do not override</i><br>
* Return "Yes" translated
*
* @noextend This method is not intended to be extended by clients.
*/
public String getTranslatedYes()
{
@ -1788,8 +1824,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Return "No" translated
*
* @noextend This method is not intended to be extended by clients.
*/
protected String getTranslatedNo()
{
@ -1799,8 +1837,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Return "True" translated
*
* @noextend This method is not intended to be extended by clients.
*/
protected String getTranslatedTrue()
{
@ -1809,8 +1849,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
return xlatedTrue;
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Return "False" translated
*
* @noextend This method is not intended to be extended by clients.
*/
protected String getTranslatedFalse()
{
@ -1819,8 +1861,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
return xlatedFalse;
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Return "Not application" translated
*
* @noextend This method is not intended to be extended by clients.
*/
protected String getTranslatedNotApplicable()
{
@ -1829,8 +1873,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
return xlatedNotApplicable;
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Return "Not available" translated
*
* @noextend This method is not intended to be extended by clients.
*/
protected String getTranslatedNotAvailable()
{
@ -1840,26 +1886,30 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Internal use. Do not override</i><br>
* <i>Internal use. Do not override.</i>
*/
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
* 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.
* @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)) {
@ -1882,12 +1932,15 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* In getChildren, return <samp>checkForNull(children, 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
* <i>Callable by subclasses. Do not override.</i><br>
* In getChildren, return <samp>checkForNull(children, 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
*
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)}
* instead.
* @noextend This method is not intended to be extended by clients.
*/
protected Object[] checkForNull(Object[] children, boolean returnNullMsg)
{
@ -1908,19 +1961,21 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* Return the "Operation cancelled by user" msg as an object array so can be used to answer getChildren()
* <i>Callable by subclasses. Do not override.</i><br>
* Return the "Operation cancelled by user" message as an object array so
* can be used to answer getChildren()
*/
protected final Object[] getCancelledMessageObject()
{
if (canceledObject == null)
if (cancelledObject == null)
initMsgObjects();
msgList[0] = canceledObject;
msgList[0] = cancelledObject;
return msgList;
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* Return the "Operation failed" msg as an object array so can be used to answer getChildren()
* <i>Callable by subclasses. Do not override.</i><br>
* Return the "Operation failed" message as an object array so can be used
* to answer getChildren()
*/
protected final Object[] getFailedMessageObject()
{
@ -1930,10 +1985,12 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
return msgList;
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* Return the "Empty list" msg as an object array so can be used to answer getChildren()
* <i>Callable by subclasses. Do not override.</i><br>
* Return the "Empty list" message as an object array so can be used to
* answer getChildren()
*
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)} instead.
* @deprecated Use {@link #checkForEmptyList(Object[], Object, boolean)}
* instead.
*/
protected final Object[] getEmptyMessageObject()
{
@ -1944,8 +2001,10 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
}
/**
* <i>Callable by subclasses. Do not override</i><br>
* <i>Callable by subclasses. Do not override.</i><br>
* Get the first selected object of the given selection
*
* @noextend This method is not intended to be extended by clients.
*/
protected Object getFirstSelection(IStructuredSelection selection)
{

View file

@ -41,15 +41,31 @@ 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;
/**
* @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;
@ -94,21 +110,25 @@ 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
* <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.
* @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)) {
@ -160,9 +180,9 @@ public abstract class SystemAbstractAPIProvider
*/
protected Object[] getCancelledMessageObject()
{
if (canceledObject == null)
if (cancelledObject == null)
initMsgObjects();
msgList[0] = canceledObject;
msgList[0] = cancelledObject;
return msgList;
}