diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java index 27198f8160f..8bcdba38617 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/ISystemViewElementAdapter.java @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core * David McKnight (IBM) - [208803] add exists() method * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread + * David Dykstal (IBM) - [234215] improve API documentation for doDelete and doDeleteBatch *******************************************************************************/ package org.eclipse.rse.ui.view; @@ -31,6 +32,8 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.rse.core.model.ISystemViewInputProvider; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter; +import org.eclipse.rse.services.clientserver.messages.ICommonMessageIds; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.SystemMenuManager; import org.eclipse.rse.ui.validators.ISystemValidator; @@ -310,19 +313,34 @@ public interface ISystemViewElementAdapter extends IPropertySource, ISystemDragD /** - * Perform the delete on the given item. This is after the user has been asked to confirm deletion. + * Perform the delete action on single item. + * Implement if the object is deletable. + * If the operation is cancelled, the progress monitor will indicate this and a + * {@link SystemMessageException} with a message id of {@link ICommonMessageIds#MSG_OPERATION_CANCELLED} + * should be thrown if the generic message is desired. + * @param shell The shell that can act as a parent for an adapter-issued message dialog. + * @param element The element that should be deleted. + * @param monitor The progress monitor for progress and cancellation. May be null. + * @return true indicates that the deletion succeeded, false indicates that the deletion failed and that a message dialog has been shown. + * @throws Exception if the deletion failed and the adapter did not show a message dialog. + * @see #showDelete(Object) + * @see #canDelete(Object) */ - public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) - throws Exception; + public boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception; /** - * Perform the delete on the given set of items. This is after the user has been asked to confirm deletion. Should throw an exception - * if some elements were deleted and others were not due to an exception during the operation. Without an exception - * thrown in such cases, views may not be refreshed correctly to account for deleted resources. - * @return true if the delete was successful, false if it was not. + * Perform the delete on the given set of items. + * If the operation is cancelled, the progress monitor will indicate this and a + * {@link SystemMessageException} with a message id of {@link ICommonMessageIds#MSG_OPERATION_CANCELLED} + * should be thrown if the generic message is desired. + * @param shell the shell that can act as a parent for an adapter-issued message dialog. + * @param resourceSet a list of resources that should be deleted. + * @param monitor The progress monitor for progress and cancellation. May be null. + * @return true if all deletions were successful, false if any deletion was not successful and that a message dialog has been shown. + * @throws Exception if any deletion was not successful and the adapter did not show a message dialog. + * If this is a {@link SystemMessageException} then the caller should examine the results and fire any necessary events. */ - public boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor) - throws Exception; + public boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor) throws Exception; // ------------------------------------------ // METHODS TO SUPPORT COMMON RENAME ACTION...