wt.clients.vc
Class UndoCheckoutTask

java.lang.Object
  extended bywt.clients.vc.UndoCheckoutTask

public class UndoCheckoutTask
extends Object

Class UndoCheckoutTask is a generic task class which performs the undoing of the check-out of a checked out object. To perform an undoing of a check-out, this class only needs to be given a parent Applet, which provides context, a Frame to parent dialogs launched in this undo task and the Workable object for which the check-out is to be undone:

       UndoCheckoutTask undo_checkout_task = 
                     new UndoCheckoutTask( my_applet, my_frame, checked_out_obj );
       undo_checkout_task.undoCheckout();
  


Supported API: true

Extendable: false

See Also:
Workable

Field Summary
private  ThreadGroup contextGroup
           
private  Workable originalObject
           
private  Applet parentApplet
           
private  Frame parentFrame
           
private  boolean prompt
           
private static ResourceBundle resources
           
private static String RESOURCES
           
private  Workable undoItem
           
private static String versionID
           
 
Constructor Summary
UndoCheckoutTask(Applet parent_applet, Frame parent_frame, Workable undo_item)
          Construct an UndoCheckoutTask to handle the undoing of a check-out of a Workable object.
 
Method Summary
private  void dispatchRefreshEvent(Object obj, int action)
           
private  WTContext getContext()
           
 Workable getOriginalObject()
          Returns the Workable object after the check-out is undone by this task.
 Applet getParentApplet()
          Returns the parent Applet which provides context to this task.
 Frame getParentFrame()
          Returns the Frame which is used as the owner of dialogs launched in this task.
 Workable getUndoItem()
          Returns the Workable item whose check-out is undone by this task.
private  void initResources()
           
private  void setContext(boolean set)
           
 void setOriginalObject(Workable orig_object)
          Sets the Workable object after the check-out is undone.
 void setParentApplet(Applet parent_applet)
          Sets the parent Applet which provides context to this task.
 void setParentFrame(Frame parent_frame)
          Sets the Frame to be used as the owner of dialogs launched in this task.
 void setPromptOnUndo(boolean prompt)
          Set whether or not a prompt should be displayed before performing the undo check-out.
 void setUndoItem(Workable undo_item)
          Sets the Workable item for which the check-out is to be undone.
private  void showMessageDialog(String message)
           
 Workable undoCheckout()
          Performs the actual undoing of the check-out of the given checked out item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

RESOURCES

private static String RESOURCES

resources

private static ResourceBundle resources

parentApplet

private Applet parentApplet

parentFrame

private Frame parentFrame

undoItem

private Workable undoItem

contextGroup

private ThreadGroup contextGroup

prompt

private boolean prompt

originalObject

private Workable originalObject
Constructor Detail

UndoCheckoutTask

public UndoCheckoutTask(Applet parent_applet,
                        Frame parent_frame,
                        Workable undo_item)
Construct an UndoCheckoutTask to handle the undoing of a check-out of a Workable object.

Parameters:
parent_applet - The parent Applet from which this task gets its context.
parent_frame - The parent Frame which is used to provide a Frame for launching dialogs. If no frame is provided, the applet is used in launching dialogs.
undo_item - The workable item to undo the checkout for.
Method Detail

setParentApplet

public void setParentApplet(Applet parent_applet)
Sets the parent Applet which provides context to this task. The parent Applet is used to get the appropriate WTContext object for this task.

Parameters:
parent_applet - the Applet to be used for context
See Also:
getParentApplet(), WTContext

getParentApplet

public Applet getParentApplet()
Returns the parent Applet which provides context to this task. The parent Applet is used to get the appropriate WTContext object for this task.

Returns:
the Applet used for providing context
See Also:
setParentApplet(java.applet.Applet), WTContext

setParentFrame

public void setParentFrame(Frame parent_frame)
Sets the Frame to be used as the owner of dialogs launched in this task. Since a Dialog requires a Frame to be constructed, this task must be given a frame to use.

Parameters:
parent_frame - the Frame used for launching dialogs from this task
See Also:
getParentFrame(), Dialog

getParentFrame

public Frame getParentFrame()
Returns the Frame which is used as the owner of dialogs launched in this task. If the parent frame has not been explicitly set (via setParentFrame), this method will try to retrieve a frame by traversing the parent hierarchy of the parent applet, if the parent applet has been given.

Returns:
the parent Frame used for launching dialogs from this task
See Also:
setParentFrame(java.awt.Frame), setParentApplet(java.applet.Applet)

setPromptOnUndo

public void setPromptOnUndo(boolean prompt)
Set whether or not a prompt should be displayed before performing the undo check-out. The prompt will warn the user that all changes to the working copy will be lost. If the given boolean is true, the user will be prompted on the undo check-out.

Parameters:
prompt - if true, the user will be prompted on the undo.

setUndoItem

public void setUndoItem(Workable undo_item)
Sets the Workable item for which the check-out is to be undone. This method does not verify that the given Workable corresponds to an object that is currently checked out.

Parameters:
undo_item - the Workable object to for which the check-out is undone
See Also:
getUndoItem(), Workable

getUndoItem

public Workable getUndoItem()
Returns the Workable item whose check-out is undone by this task.

Returns:
the Workable item whose check-out is undone
See Also:
setUndoItem(wt.vc.wip.Workable), Workable

setOriginalObject

public void setOriginalObject(Workable orig_object)
Sets the Workable object after the check-out is undone.

Parameters:
orig_object - the Workable object after the check-out is undone
See Also:
#getOriginaObject, Workable

getOriginalObject

public Workable getOriginalObject()
Returns the Workable object after the check-out is undone by this task.

Returns:
the Workable object after the check-out is undone
See Also:
setOriginalObject(wt.vc.wip.Workable), Workable

undoCheckout

public Workable undoCheckout()
Performs the actual undoing of the check-out of the given checked out item. This method first verifies that the object is currently checked out to the current user.

Returns:
the Workable object for which the check-out was undone
See Also:
Workable

initResources

private void initResources()

getContext

private WTContext getContext()

setContext

private void setContext(boolean set)

showMessageDialog

private void showMessageDialog(String message)

dispatchRefreshEvent

private void dispatchRefreshEvent(Object obj,
                                  int action)