wt.clients.vc
Class CheckInDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended bywt.clients.vc.CheckInDialog
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class CheckInDialog
extends Dialog

Class CheckInDialog provides a dialog for checking in checked out Workable objects. This dialog has a text area for capturing comments to be associated with the check-in. If the Workable object being checked in is also a FormatContentHolder, this dialog will allow the user to choose to upload a new content file.

Example:

    CheckInDialog checkin_dialog = new CheckInDialog( parent_frame, true );
    checkin_dialog.setParentApplet( getParentApplet() );
    checkin_dialog.setCheckInItem( checkinItem );
    checkin_dialog.show();
  


Supported API: true

Extendable: false

See Also:
CheckInTask, FormatContentHolder, Workable, Serialized Form

Nested Class Summary
(package private)  class CheckInDialog.SymAction
           
(package private)  class CheckInDialog.SymKey
           
(package private)  class CheckInDialog.SymWindow
           
(package private)  class CheckInDialog.WorkableHandle
           
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Cabinet[] allowedCabinets
           
(package private)  Button browseButton
           
(package private)  Panel buttonPanel
           
static int CANCEL
          Upload status indicator, indicates that user decided to cancel out of upload operation.
(package private)  Button cancelButton
           
(package private)  Label checkedOutByLabel
           
(package private)  Label checkedOutByValue
           
private  Folder checkInFolder
           
private  CheckInDialog.WorkableHandle checkInItemHandle
           
(package private)  Label commentLabel
           
(package private)  TextArea commentTextArea
           
private static String CONTENT_RESOURCES
           
private static ResourceBundle contentResources
           
private  ThreadGroup contextGroup
           
(package private)  Button continueButton
           
private  boolean continueIfFileNotFound
           
private  boolean continueIfFileUnchanged
           
private static boolean DEBUG
           
static int DO_UPLOAD
          Target type indicator, indicates that upload should be attempted.
private  WTPreferences downloadPreferences
           
(package private)  boolean fComponentsAdjusted
           
private  boolean firstCheckIn
           
private static String HELP_TARGET
           
(package private)  Button helpButton
           
private  HelpContext helpContext
           
private  HelpSystem helpSystem
           
(package private)  symantec.itools.awt.shape.HorizontalLine horizontalLine1
           
(package private)  HTTPUploadDownloadPanel hTTPUploadDownloadPanel1
           
(package private)  Label locationLabel
           
(package private)  TextField locationTextField
           
static int NO_UPLOAD
          Upload status indicator, indicates that upload should be skipped.
private  Applet parentApplet
           
private static String PREF_KEY_FILECHANGED
           
private static String PREF_KEY_FILENOTFOUND
           
private static String PREF_KEY_FILEUNCHANGED
           
private static String PREF_KEY_WORKSPACEPATH
           
private static String PREF_NODE
           
private static int PREFERRED_BUTTON_WIDTH
           
private static ResourceBundle resources
           
private static String RESOURCES
           
private static boolean SHOW_CONTENTS
           
static int UNKNOWN
          Upload status indicator, indicates that whether or not to upload is unknown.
private  boolean uploadIfFileChanged
           
private static String versionID
           
(package private)  Label workableNameLabel
           
(package private)  Label workableNameValue
           
private  String workspacePath
           
 
Fields inherited from class java.awt.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CheckInDialog(Frame parent, boolean modal)
          Constructor for CheckInDialog
CheckInDialog(Frame parent, String title, boolean modal)
          Constructor for CheckInDialog
 
Method Summary
 void addNotify()
           
(package private)  void browseButton_ActionPerformed(ActionEvent event)
           
private  void browseForFolder()
           
(package private)  void cancelButton_Action(ActionEvent event)
           
(package private)  void cancelButton_KeyPressed(KeyEvent event)
           
 boolean checksumsMatch()
           
(package private)  void continueButton_Action(ActionEvent event)
           
(package private)  void continueButton_KeyPressed(KeyEvent event)
           
(package private)  void Dialog1_WindowClosing(WindowEvent event)
           
private  void dispatchRefresh(int action, Object obj)
           
 void dispose()
          Override the dispose method to work around a bug in the JDK.
private  void enableActions(boolean enable)
           
 Cabinet[] getAllowedCabinets()
          Returns an array of cabinets from which the user can choose the location in which to place the object being checked in on a first-time check-in.
 Folder getCheckInFolder()
          Returns the folder in which the item being checked in currently is located.
 Workable getCheckInItem()
          Returns the Workable object to be checked in by this dialog.
private  WTContext getContext()
           
protected  String getDisplayIdentity(Object obj)
           
private  String getLocalizedMessage(String key, Object[] params)
          Deprecated.  
 Applet getParentApplet()
          Method getParentApplet returns the Applet which is used to provide context to this dialog.
 Frame getParentFrame()
          Returns the Frame which is parenting this dialog.
private  String getPreferenceValue(String key, String defaultValue)
           
private  PropertyDescriptor getReadPropertyDescriptor(String attribute)
           
 String getTarget()
          Return the target path or url.
private  String getType()
           
(package private)  void helpButton_Action(ActionEvent event)
           
(package private)  void helpButton_KeyPressed(KeyEvent event)
           
private  void initButtonSizes()
          Initializes the sizes of the buttons displayed on this panel.
private  void initializeHelp()
          Initialize the help system used in displaying tooltips and online help.
private  void initPrimaryContentsPanel(boolean firstCheckIn)
           
private  void initResources()
           
 boolean isValidTarget()
           
 boolean isValidTarget(String target)
           
private  void localize()
           
(package private)  void locationTextField_KeyTyped(KeyEvent event)
           
private  void processCancelCommand()
           
private  void processCheckIn()
           
private  void processContinueCommand()
           
private  void processFirstTimeCheckin()
          Places the given Workable item in the vault to be subjected to version control.
private  void processHelpCommand()
           
private  boolean replacePrimaryContent()
           
private  WTPreferences retrievePreferences(String node)
           
 void setAllowedCabinets(Cabinet[] cabinets)
          Method which sets the cabinets into which a user can check an object.
 void setCheckInFolder(Folder folder)
          Sets the Folder in which the given object is to be checked in to.
 void setCheckInItem(Workable item)
          Sets the Workable object to be checked in.
 void setCheckInItem(Workable item, boolean first_time)
          Sets the Workable object to be checked in and specifies whether or not this is the first time the given object is being placed under revision control.
private  void setContext(boolean context_on)
           
protected  void setDisplayLocation()
           
protected  void setItem(Workable workable)
           
 void setParentApplet(Applet parent_applet)
          Method setParentApplet sets the applet which is used to provide context for this dialog.
 void setTarget(String target)
          Set the target path or url.
 void show()
           
private  void showMessageDialog(String message)
           
private  int validateTarget()
          If target is not valid, attempts to identify valid target through combinations of workspace, target filename, and persisted filename.
 
Methods inherited from class java.awt.Dialog
getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Upload status indicator, indicates that whether or not to upload is unknown.

See Also:
Constant Field Values

CANCEL

public static final int CANCEL
Upload status indicator, indicates that user decided to cancel out of upload operation.

See Also:
Constant Field Values

NO_UPLOAD

public static final int NO_UPLOAD
Upload status indicator, indicates that upload should be skipped.

See Also:
Constant Field Values

DO_UPLOAD

public static final int DO_UPLOAD
Target type indicator, indicates that upload should be attempted.

See Also:
Constant Field Values

PREF_NODE

private static String PREF_NODE

PREF_KEY_FILENOTFOUND

private static String PREF_KEY_FILENOTFOUND

PREF_KEY_FILEUNCHANGED

private static String PREF_KEY_FILEUNCHANGED

PREF_KEY_FILECHANGED

private static String PREF_KEY_FILECHANGED

PREF_KEY_WORKSPACEPATH

private static String PREF_KEY_WORKSPACEPATH

downloadPreferences

private WTPreferences downloadPreferences

continueIfFileNotFound

private boolean continueIfFileNotFound

continueIfFileUnchanged

private boolean continueIfFileUnchanged

uploadIfFileChanged

private boolean uploadIfFileChanged

workspacePath

private String workspacePath

fComponentsAdjusted

boolean fComponentsAdjusted

workableNameLabel

Label workableNameLabel

workableNameValue

Label workableNameValue

checkedOutByLabel

Label checkedOutByLabel

checkedOutByValue

Label checkedOutByValue

hTTPUploadDownloadPanel1

HTTPUploadDownloadPanel hTTPUploadDownloadPanel1

locationLabel

Label locationLabel

locationTextField

TextField locationTextField

browseButton

Button browseButton

commentLabel

Label commentLabel

commentTextArea

TextArea commentTextArea

horizontalLine1

symantec.itools.awt.shape.HorizontalLine horizontalLine1

buttonPanel

Panel buttonPanel

continueButton

Button continueButton

cancelButton

Button cancelButton

helpButton

Button helpButton

checkInItemHandle

private CheckInDialog.WorkableHandle checkInItemHandle

checkInFolder

private Folder checkInFolder

parentApplet

private Applet parentApplet

firstCheckIn

private boolean firstCheckIn

contextGroup

private ThreadGroup contextGroup

helpSystem

private HelpSystem helpSystem

helpContext

private HelpContext helpContext

allowedCabinets

private Cabinet[] allowedCabinets

HELP_TARGET

private static final String HELP_TARGET
See Also:
Constant Field Values

PREFERRED_BUTTON_WIDTH

private static int PREFERRED_BUTTON_WIDTH

resources

private static ResourceBundle resources

contentResources

private static ResourceBundle contentResources

RESOURCES

private static String RESOURCES

CONTENT_RESOURCES

private static String CONTENT_RESOURCES

DEBUG

private static boolean DEBUG

SHOW_CONTENTS

private static boolean SHOW_CONTENTS
Constructor Detail

CheckInDialog

public CheckInDialog(Frame parent,
                     boolean modal)
Constructor for CheckInDialog

Parameters:
parent - the Frame owner of this dialog
modal - if true, dialog blocks input to the parent window when shown

CheckInDialog

public CheckInDialog(Frame parent,
                     String title,
                     boolean modal)
Constructor for CheckInDialog

Parameters:
parent - the Frame owner of this dialog
title - the String to display as the title of this dialog
modal - if true, dialog blocks input to the parent window when shown
Method Detail

initResources

private void initResources()

initializeHelp

private void initializeHelp()
Initialize the help system used in displaying tooltips and online help. The help system is initialized so that all online help files are displayed in the same browser window.

See Also:
HelpContext, HelpSystem

localize

private void localize()

addNotify

public void addNotify()

show

public void show()

setDisplayLocation

protected void setDisplayLocation()

dispose

public void dispose()
Override the dispose method to work around a bug in the JDK. See the javadoc for ContainerUtility for more information.

See Also:
ContainerUtility

getContext

private WTContext getContext()

setContext

private void setContext(boolean context_on)

Dialog1_WindowClosing

void Dialog1_WindowClosing(WindowEvent event)

cancelButton_Action

void cancelButton_Action(ActionEvent event)

processCancelCommand

private void processCancelCommand()

setCheckInItem

public void setCheckInItem(Workable item)
                    throws NotCheckedOutException,
                           WTException
Sets the Workable object to be checked in. When the object to be checked in is set, this dialog is updated to display the identity of the Workable item.

Parameters:
item - the Workable object to be checked in
Throws:
NotCheckedOutException
WTException
See Also:
getCheckInItem()

setItem

protected void setItem(Workable workable)

setCheckInItem

public void setCheckInItem(Workable item,
                           boolean first_time)
                    throws NotCheckedOutException,
                           WTException
Sets the Workable object to be checked in and specifies whether or not this is the first time the given object is being placed under revision control. If this is the first time the given Workable is to be checked in, then the fields to display and choose the location in which to place the given Workable is made visible.

Parameters:
item - the Workable item to be checked in
first_time - a boolean value specifying whether or not this is the first time the given Workable is being checked in; if true, the given Workable is being checked in for the first time, and support for choosing the check-in location is made visible.
Throws:
NotCheckedOutException
WTException
See Also:
setCheckInItem(wt.vc.wip.Workable), Workable

getCheckInItem

public Workable getCheckInItem()
Returns the Workable object to be checked in by this dialog.

Returns:
the Workable object to be checked in
See Also:
setCheckInItem(wt.vc.wip.Workable)

setCheckInFolder

public void setCheckInFolder(Folder folder)
Sets the Folder in which the given object is to be checked in to. Note that the check-in folder is used when an object is first being put into the vault. This method sets the folder in the vault in which the given item is to be added.

Parameters:
folder - the Folder in which the new item is to be vaulted
See Also:
getCheckInFolder(), Folder

getCheckInFolder

public Folder getCheckInFolder()
                        throws WTException
Returns the folder in which the item being checked in currently is located.

Returns:
the Folder in which the original copy of the item being checked in is located.
Throws:
WTException
See Also:
setCheckInFolder(wt.folder.Folder), Folder

getParentApplet

public Applet getParentApplet()
Method getParentApplet returns the Applet which is used to provide context to this dialog.

Returns:
the Applet which gives context to this dialog
See Also:
setParentApplet(java.applet.Applet)

setParentApplet

public void setParentApplet(Applet parent_applet)
Method setParentApplet sets the applet which is used to provide context for this dialog.

See Also:
getParentApplet()

continueButton_Action

void continueButton_Action(ActionEvent event)

processContinueCommand

private void processContinueCommand()

dispatchRefresh

private void dispatchRefresh(int action,
                             Object obj)

enableActions

private void enableActions(boolean enable)

replacePrimaryContent

private boolean replacePrimaryContent()

getPreferenceValue

private String getPreferenceValue(String key,
                                  String defaultValue)

retrievePreferences

private WTPreferences retrievePreferences(String node)

checksumsMatch

public boolean checksumsMatch()

isValidTarget

public boolean isValidTarget()

isValidTarget

public boolean isValidTarget(String target)

getTarget

public String getTarget()
Return the target path or url.


setTarget

public void setTarget(String target)
Set the target path or url.

Parameters:
target - The target path, e.g. "E:\abcd\test.txt" or "E:\abcd\*.txt", or url.

validateTarget

private int validateTarget()
If target is not valid, attempts to identify valid target through combinations of workspace, target filename, and persisted filename. Depending on continueIfFileNotFound preference value, may prompt user for what to do if file not found. Returns HTTPUploadDownloadPanel.UNKNOWN if upload intentions unknown NO_UPLOAD if user wants to skip upload CANCEL if user wants to cancel entire operation


showMessageDialog

private void showMessageDialog(String message)

getType

private String getType()

getReadPropertyDescriptor

private PropertyDescriptor getReadPropertyDescriptor(String attribute)

helpButton_Action

void helpButton_Action(ActionEvent event)

processHelpCommand

private void processHelpCommand()

continueButton_KeyPressed

void continueButton_KeyPressed(KeyEvent event)

cancelButton_KeyPressed

void cancelButton_KeyPressed(KeyEvent event)

helpButton_KeyPressed

void helpButton_KeyPressed(KeyEvent event)

initButtonSizes

private void initButtonSizes()
Initializes the sizes of the buttons displayed on this panel. When the button labels are localized via the localize method, the width of the buttons could be affected, potentially causing the widths of the buttons to be different from one another.


locationTextField_KeyTyped

void locationTextField_KeyTyped(KeyEvent event)

browseButton_ActionPerformed

void browseButton_ActionPerformed(ActionEvent event)

browseForFolder

private void browseForFolder()

processCheckIn

private void processCheckIn()
                     throws PropertyVetoException,
                            WorkInProgressException,
                            InterruptedException,
                            WTException
Throws:
PropertyVetoException
WorkInProgressException
InterruptedException
WTException

processFirstTimeCheckin

private void processFirstTimeCheckin()
                              throws WTPropertyVetoException,
                                     VersionControlException,
                                     WTException
Places the given Workable item in the vault to be subjected to version control.

Throws:
WTPropertyVetoException
VersionControlException
WTException

getParentFrame

public Frame getParentFrame()
Returns the Frame which is parenting this dialog. If the immediate parent of this dialog is not a frame, and the parent applet of this dialog has been set, then the parent hierarchy of the parent applet is traversed until a frame is found.


getLocalizedMessage

private String getLocalizedMessage(String key,
                                   Object[] params)
Deprecated.  

Returns the localized messages from the Messages ResourceBundle which corresponds to the given key. Replaced by wt.util.WTMessage

Parameters:
key - the String key of the message in the resource bundle
params - if not null, this array is passed along with the resource bundle string to MessageFormat to create a formatted message
Returns:
the String message

getDisplayIdentity

protected String getDisplayIdentity(Object obj)

initPrimaryContentsPanel

private void initPrimaryContentsPanel(boolean firstCheckIn)

setAllowedCabinets

public void setAllowedCabinets(Cabinet[] cabinets)
Method which sets the cabinets into which a user can check an object. The array of cabinets given in this method are used only if the check-in is a first time check-in. If the check-in is a first time check-in, and the user chooses to browse for a location in which to place the object, only the cabinets in the given array of cabinets are shown.

Parameters:
cabinets - the array of cabinets from which the user can choose the location in which to place the object on a first-time check-in

getAllowedCabinets

public Cabinet[] getAllowedCabinets()
Returns an array of cabinets from which the user can choose the location in which to place the object being checked in on a first-time check-in. If the allowed cabinets from which the user can choose the location has not been explicitly set, this method will return null.

Returns:
the list of cabinets from which the user can choose the location on a first-time check-in