Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.navigator
Class DeleteActionHandler<T extends Element>

java.lang.Object
  extended by oracle.ide.navigator.DeleteActionHandler<T>
Direct Known Subclasses:
CompositeDeleteHandler

public abstract class DeleteActionHandler<T extends Element>
extends java.lang.Object

Helps implements progressive disclosure deletion for Node. Extending the class and registering it with DeleteHandlerService Designed for inheritance.


Nested Class Summary
static class DeleteActionHandler.DeleteOption
           
static class DeleteActionHandler.DeleteStrategy<E extends Element>
          A delete strategy base class that users can use to define what "delete a node" is in the user's domain.
static class DeleteActionHandler.DetailsTextConfig
           
static class DeleteActionHandler.DetailsTextConfigBuilder
           
static interface DeleteActionHandler.LookupHelper
          A lookup strategy class that will help clients identify a delete action handler for the selection they have have received.
static class DeleteActionHandler.NodeDeleteStrategy
          A simple node delete implementation that simply deletes the file, pointed to by the node's URL on the file system.
static interface DeleteActionHandler.SelectedNodesProvider<ElementType extends Element>
          A provider class that will return uniform node type selection.
 
Constructor Summary
DeleteActionHandler(Context context)
           
DeleteActionHandler(java.util.List<T> nodes)
           
 
Method Summary
 boolean askToConfirm(java.awt.Component windowParent)
           
 DeleteActionHandler.DeleteOption clarifyToDeleteOrToRemoveFromParentContainer(java.awt.Component dialogOwner)
           
 void clearStatus()
           
 DetailDialog createDeleteConfirmationDialog(java.awt.Component dialogOwner)
           
protected abstract  java.awt.Component createDeleteDetailsComponent()
           
protected  void deleteDetailsAvailable(boolean detailsAvailable)
          To be called by clients, whenever details become available.
 void doit()
          Performs the actual delete operation.
 Context getContext()
           
static DeleteActionHandler.DeleteStrategy<Node> getDefaultDeleteStrategy()
           
 DeleteActionHandler.DeleteStrategy getDeleteStrategy()
           
protected abstract  DeleteActionHandler.DetailsTextConfig getDetailsTextConfig()
           
protected  java.util.List<T> getNodes()
           
 DeleteActionHandler.DeleteOption getSelectedDeleteOption()
           
protected  void handleNonDeletedURLs(java.util.List<java.net.URL> urls)
          Displays feedback to the user as to which URLs weren't deleted.
protected  boolean hasOptions()
          Whether or not the delete operation has any options.
 boolean isSilent()
           
protected  void preLaunchDialog()
           
 boolean requireConfirm()
          Whether or not to ask for confirmation.
 boolean runDialog()
           
protected  DeleteActionHandler.DeleteOption selectedOption(int optionIndex)
           
protected  void selectedOptionChanged(DeleteActionHandler.DeleteOption deleteOption)
          Invoked every time the user changes selected option.
 void setContext(Context context)
           
 void setDeleteStrategy(DeleteActionHandler.DeleteStrategy deleteStrategy)
           
 void setSelectedOption(int index)
          Set the selected option.
 void setSilentMode(boolean silent)
           
 void setStatus(java.lang.String text, javax.swing.Icon icon)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteActionHandler

public DeleteActionHandler(Context context)

DeleteActionHandler

public DeleteActionHandler(java.util.List<T> nodes)
Method Detail

setSilentMode

public final void setSilentMode(boolean silent)

isSilent

public final boolean isSilent()

getContext

public final Context getContext()

setContext

public final void setContext(Context context)

getNodes

protected final java.util.List<T> getNodes()

getDetailsTextConfig

protected abstract DeleteActionHandler.DetailsTextConfig getDetailsTextConfig()

createDeleteDetailsComponent

protected abstract java.awt.Component createDeleteDetailsComponent()

preLaunchDialog

protected void preLaunchDialog()

doit

public void doit()
Performs the actual delete operation. The default implementation
  1. Closes all oracle.ide.model.Nodes returned from getNodes()
  2. Invokes getDeleteStrategy().delete(node) for every node returned from getNodes()
  3. For every node that failed to be deleted, add it to the non-deleted nodes of the current DeleteStrategy
  4. Invoke handleNonDeletedURLs() for all non-deleted nodes in the DeleteStrategy


handleNonDeletedURLs

protected void handleNonDeletedURLs(java.util.List<java.net.URL> urls)
Displays feedback to the user as to which URLs weren't deleted. The default implementation display an simple non-actionable dialog listing all URLs that were not deleted, for whatever reason.

Parameters:
urls - the URLs the we failed to delete.

requireConfirm

public boolean requireConfirm()
Whether or not to ask for confirmation. Specifically, when this method returns true, askToConfirm() is invoked.

Returns:
whether to require confirmation before performing the delete operation.

hasOptions

protected boolean hasOptions()
Whether or not the delete operation has any options. Two possible options might be to delete a file from its container or erase it from disk.

Returns:
true if the subclass of DeleteActionHandler has any delete options.

selectedOption

protected DeleteActionHandler.DeleteOption selectedOption(int optionIndex)

setSelectedOption

public final void setSelectedOption(int index)
Set the selected option. Requires that hasOptions() returns true.

Parameters:
index - the index of the selected optin..

setStatus

public final void setStatus(java.lang.String text,
                            javax.swing.Icon icon)

clearStatus

public final void clearStatus()

selectedOptionChanged

protected void selectedOptionChanged(DeleteActionHandler.DeleteOption deleteOption)
Invoked every time the user changes selected option.

Parameters:
deleteOption -

deleteDetailsAvailable

protected final void deleteDetailsAvailable(boolean detailsAvailable)
To be called by clients, whenever details become available.

Parameters:
detailsAvailable -

createDeleteConfirmationDialog

public DetailDialog createDeleteConfirmationDialog(java.awt.Component dialogOwner)

runDialog

public boolean runDialog()

clarifyToDeleteOrToRemoveFromParentContainer

public DeleteActionHandler.DeleteOption clarifyToDeleteOrToRemoveFromParentContainer(java.awt.Component dialogOwner)

askToConfirm

public boolean askToConfirm(java.awt.Component windowParent)

getSelectedDeleteOption

public DeleteActionHandler.DeleteOption getSelectedDeleteOption()

getDefaultDeleteStrategy

public static final DeleteActionHandler.DeleteStrategy<Node> getDefaultDeleteStrategy()

setDeleteStrategy

public void setDeleteStrategy(DeleteActionHandler.DeleteStrategy deleteStrategy)

getDeleteStrategy

public DeleteActionHandler.DeleteStrategy getDeleteStrategy()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.