com.starbase.starteam
Class CheckoutOptions

java.lang.Object
  |
  +--com.starbase.starteam.CheckoutOptions

public class CheckoutOptions
extends java.lang.Object

Maintains the checkout options used by CheckoutManager.

See Also:
CheckoutManager

Field Summary
static int EOL_CR
          Carriage-return
static int EOL_CRLF
          Carriage-return + Line-feed end-of-line sequence.
static int EOL_LF
          Line-feed end-of-line
 
Constructor Summary
CheckoutOptions(CheckoutOptions options)
          Construct a CheckoutOptions object with the same options as the given one.
CheckoutOptions(StarTeamClientOptions options)
          Construct a CheckoutOptions object with default options from a StarTeamClientOptions object.
CheckoutOptions(View view)
          Construct a CheckoutOptions object with default options from the View.
 
Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 OLEDate getCheckoutDate()
          Get OLEDate value for "checkout by date" option.
 int getCheckoutLabelID()
          Get Label ID for "checkout by Label" option.
 ContentFilter getContentFilter()
          Get the hook to be inserted after performing keyword expansion, eol conversion, etc.
 int getEOLChars()
          Get the contant value that represents the actual end-of-line sequence to be in EOL conversion.
 boolean getEOLConversionEnabled()
          Return whether EOL conversion is enabled when checking out text files.
 java.lang.String getFileEncoding()
          Returns the "File Encoding" option value.
 boolean getForceCheckout()
          Returns the "Force Checkout" option value.
 boolean getKeywordExpansionEnabled()
          Determin whether keyword expansion in text files is enabled.
 int getLockType()
          Return the type of lock to be used when checking out.
 boolean getMarkUnlockedFilesReadOnly()
          Returns the "Mark Unlocked Files ReadOnly" option value.
 boolean getOptimizeForSlowConnections()
          Determine whether to optimize for slow connections, when possible.
 int getPromotionStateID()
          Get the PromotionState ID for "checkout by PromotionState" option.
 boolean getRestoreFileOnError()
          Determine whether to restore previous working file if an error occurs during a checkout.
 boolean getTimeStampNow()
          Return whether the current time is used as the last modified time.
 boolean getUpdateStatus()
          Determine whether to update status information after a successful checkout.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isByDate()
          Determines whether "checkout by date" option is used.
 boolean isByLabel()
          Determines whether "checkout by Label" option is used.
 boolean isByPromotionState()
          Determines whether "checkout by PromotionState" option is used.
 boolean isByTips()
          Determine which file revision is checked out.
 boolean isFileSkipped()
          Returns whether to skip checking out files or the file associated with this CheckoutOptions object.
 void setCheckoutDate(OLEDate d)
          Set to "checkout by date" on the given OLEDate value.
 void setCheckoutLabelID(int labelID)
          Set to "checkout by Label" on the given Label ID.
 void setContentFilter(ContentFilter filter)
          Set the hook inserted after performing keyword expansion, eol conversion, etc.
 void setEOLChars(int eol)
          The end-of-line sequence to use when EOL conversion is enabled.
 void setEOLConversionEnabled(boolean bEnabled)
          Set to enable EOL conversion when checking out text files.
 void setFileEncoding(java.lang.String sEncoding)
          Sets the "File Encoding" option value.
 void setFileSkipped(boolean bFileSkipped)
          Sets whether to skip checking out files or the file associated with this CheckoutOptions object.
 void setForceCheckout(boolean bForceCheckout)
          Sets the "Force Checkout" option value.
 void setKeywordExpansionEnabled(boolean bEnabled)
          Set to enable keyword expansion in text files.
 void setLockType(int lockType)
          Set the type of lock to be used when checking out.
 void setMarkUnlockedFilesReadOnly(boolean bMarkUnlockedFilesReadOnly)
          Sets the "Mark Unlocked Files ReadOnly" option value.
 void setOptimizeForSlowConnections(boolean bEnabled)
          Set whether to optimize for slow connections, when possible.
 void setPromotionStateID(int stateID)
          Set to "checkout by PromotionState" on the given PromotionState ID.
 void setRestoreFileOnError(boolean bEnabled)
          Set to restore previous working file if an error occurs during a checkout.
 void setTimeStampNow(boolean bTimeStampNow)
          Set to use the current time as the last modified time.
 void setTips()
          Determines which file revision is checked out.
 void setUpdateStatus(boolean bEnabled)
          Set to whether to update status information after a successful checkout.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL_CR

public static final int EOL_CR
Carriage-return

See Also:
Constant Field Values

EOL_LF

public static final int EOL_LF
Line-feed end-of-line

See Also:
Constant Field Values

EOL_CRLF

public static final int EOL_CRLF
Carriage-return + Line-feed end-of-line sequence.

See Also:
Constant Field Values
Constructor Detail

CheckoutOptions

public CheckoutOptions(View view)
Construct a CheckoutOptions object with default options from the View.

Parameters:
view - a View object where the values of the options are picked up.
See Also:
CheckoutManager.getOptions(), View

CheckoutOptions

public CheckoutOptions(StarTeamClientOptions options)
Construct a CheckoutOptions object with default options from a StarTeamClientOptions object.

Parameters:
options - a StarTeamClientOptions where the values of the options are picked up.
See Also:
CheckoutManager.getOptions(), StarTeamClientOptions.loadDefault()

CheckoutOptions

public CheckoutOptions(CheckoutOptions options)
Construct a CheckoutOptions object with the same options as the given one.

Parameters:
options - a CheckoutOptions where the values of the options are picked up.
See Also:
CheckoutManager.getOptions()
Method Detail

setLockType

public void setLockType(int lockType)
Set the type of lock to be used when checking out. Default is UNCHANGED. It may be one of these values: UNLOCKED, EXCLUSIVE, NONEXCLUSIVE, UNCHANGED, and BREAK_FLAG.

Parameters:
lockType - the type of lock to be used when checking out.
See Also:
Item.LockType

getLockType

public int getLockType()
Return the type of lock to be used when checking out. Default is UNCHANGED. It may be one of these values: UNLOCKED, EXCLUSIVE, NONEXCLUSIVE, UNCHANGED, and BREAK_FLAG.

Returns:
Return the type of lock to be used when checking out.

setTimeStampNow

public void setTimeStampNow(boolean bTimeStampNow)
Set to use the current time as the last modified time. True to set last modified time of working files to current time; false to set last modified time of working files to match revision time in repository. Default is true.

Parameters:
bTimeStampNow - if true will use current time.

getTimeStampNow

public boolean getTimeStampNow()
Return whether the current time is used as the last modified time.

Returns:
Return true if current time is used as the last modified time; false, otherwise.

setEOLConversionEnabled

public void setEOLConversionEnabled(boolean bEnabled)
Set to enable EOL conversion when checking out text files. True to enable end-of-line conversion on text files. Default is true.

Parameters:
bEnabled - if true will enable EOL conversion.

getEOLConversionEnabled

public boolean getEOLConversionEnabled()
Return whether EOL conversion is enabled when checking out text files.

Returns:
Return true if EOL conversion is enabled; false, otherwise.

setEOLChars

public void setEOLChars(int eol)
The end-of-line sequence to use when EOL conversion is enabled. Default is obtained from the current ClientContext.

Parameters:
eol - the value that represents an end-of-line sequence. It may be one of these values: EOL_CRLF, EOL_CR, and EOL_LF.
See Also:
CheckoutOptions.getEOLChars(), CheckoutOptions.EOL_CRLF, CheckoutOptions.EOL_CR, CheckoutOptions.EOL_LF

getEOLChars

public int getEOLChars()
Get the contant value that represents the actual end-of-line sequence to be in EOL conversion. One of these values may be returned: EOL_CRLF, EOL_CR, and EOL_LF. The default value is EOL_CRLF when setEOLChars() is not called.

Returns:
Return the contant value that represents the actual end-of-line sequence to be in EOL conversion. One of these values may be returned: EOL_CRLF, EOL_CR, and EOL_LF. The default value is EOL_CRLF when setEOLChars() is not called.
See Also:
CheckoutOptions.setEOLChars(int), CheckoutOptions.EOL_CRLF, CheckoutOptions.EOL_CR, CheckoutOptions.EOL_LF

setUpdateStatus

public void setUpdateStatus(boolean bEnabled)
Set to whether to update status information after a successful checkout. Default is true.

Parameters:
bEnabled - True to update status information after a successful checkout; false, otherwise.

getMarkUnlockedFilesReadOnly

public boolean getMarkUnlockedFilesReadOnly()
Returns the "Mark Unlocked Files ReadOnly" option value.

Returns:
option value. Default if not defined: false

setMarkUnlockedFilesReadOnly

public void setMarkUnlockedFilesReadOnly(boolean bMarkUnlockedFilesReadOnly)
Sets the "Mark Unlocked Files ReadOnly" option value.

Parameters:
bMarkUnlockedFilesReadOnly - the "Mark Unlocked Files ReadOnly" option value.
See Also:
CheckoutListener.onStartFile(com.starbase.starteam.CheckoutEvent)

getForceCheckout

public boolean getForceCheckout()
Returns the "Force Checkout" option value. When "Force Checkout" is true, the operation will check out files that might not otherwise be checked out, for example files that have a status of "modified", "merge" or "unknown".

Returns:
the "Force Checkout" option value, whose default value is true.

setForceCheckout

public void setForceCheckout(boolean bForceCheckout)
Sets the "Force Checkout" option value. When "Force Checkout" is true, the operation will check out files that might not otherwise be checked out, for example files that have a status of "modified", "merge" or "unknown".

Parameters:
bForceCheckout - the "Force Checkout" option value.

getFileEncoding

public java.lang.String getFileEncoding()
Returns the "File Encoding" option value.

Returns:
the "File Encoding" option value. Default if not defined: the value of the system property "file.encoding"

setFileEncoding

public void setFileEncoding(java.lang.String sEncoding)
Sets the "File Encoding" option value.

Parameters:
sEncoding - the "File Encoding" option value.
See Also:
CheckoutListener.onStartFile(com.starbase.starteam.CheckoutEvent)

isFileSkipped

public boolean isFileSkipped()
Returns whether to skip checking out files or the file associated with this CheckoutOptions object.

Returns:
whether to skip checking out files or the file associated with this CheckoutOptions object.

setFileSkipped

public void setFileSkipped(boolean bFileSkipped)
Sets whether to skip checking out files or the file associated with this CheckoutOptions object. Calling setFileSkipped(true) in the CheckoutListener.onStartFile() event handler will cause CheckoutManager to leave the working file for this file unchanged. Calling setFileSkipped() outside of the onStartFile() handler has no effect.

Parameters:
bFileSkipped - whether to skip checking out files or the file associated with this CheckoutOptions object.
See Also:
CheckoutListener.onStartFile(com.starbase.starteam.CheckoutEvent)

getUpdateStatus

public boolean getUpdateStatus()
Determine whether to update status information after a successful checkout.

Returns:
Return true if status information is to be updated after a successful checkout.

setKeywordExpansionEnabled

public void setKeywordExpansionEnabled(boolean bEnabled)
Set to enable keyword expansion in text files. Default uses setting from the Project properties.

Parameters:
bEnabled - True to use keyword expand in text files; false, otherwise.

getKeywordExpansionEnabled

public boolean getKeywordExpansionEnabled()
Determin whether keyword expansion in text files is enabled.

Returns:
Return true if keyword expansion in text files is enabled; false, otherwise.

setTips

public void setTips()
Determines which file revision is checked out. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

See Also:
CheckoutOptions.isByTips(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

isByTips

public boolean isByTips()
Determine which file revision is checked out. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

Returns:
Return true if the tip is used; false, otherwise.
See Also:
CheckoutOptions.setTips()

setCheckoutDate

public void setCheckoutDate(OLEDate d)
Set to "checkout by date" on the given OLEDate value. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., didn't have it on that date) are skipped.

Parameters:
d - the OLEDate value to be used for the "checkout by date" option.
See Also:
CheckoutOptions.isByDate(), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

isByDate

public boolean isByDate()
Determines whether "checkout by date" option is used.

Returns:
Return true if "checkout by date" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

getCheckoutDate

public OLEDate getCheckoutDate()
Get OLEDate value for "checkout by date" option. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

Returns:
Return the OLEDate value to be used for the "checkout by date" option.
See Also:
CheckoutOptions.isByDate(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

setCheckoutLabelID

public void setCheckoutLabelID(int labelID)
Set to "checkout by Label" on the given Label ID. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given Label attached) are skipped.

Parameters:
labelID - the Label ID to be used for the "checkout by Label" option.
See Also:
CheckoutOptions.isByLabel(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setPromotionStateID(int)

isByLabel

public boolean isByLabel()
Determines whether "checkout by Label" option is used.

Returns:
Return true if "checkout by Label" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

getCheckoutLabelID

public int getCheckoutLabelID()
Get Label ID for "checkout by Label" option. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given Label attached) are skipped.

Returns:
Return the Label ID value to be used for the "checkout by Label" option.
See Also:
CheckoutOptions.isByLabel(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

setPromotionStateID

public void setPromotionStateID(int stateID)
Set to "checkout by PromotionState" on the given PromotionState ID. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given PromotionState attached) are skipped.

Parameters:
stateID - the PromotionState ID to be used for the "checkout by PromotionState" option.
See Also:
CheckoutOptions.isByPromotionState(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int)

isByPromotionState

public boolean isByPromotionState()
Determines whether "checkout by PromotionState" option is used.

Returns:
Return true if "checkout by PromotionState" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

getPromotionStateID

public int getPromotionStateID()
Get the PromotionState ID for "checkout by PromotionState" option. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given PromotionState attached) are skipped.

Returns:
Return the PromotionState ID value to be used for the "checkout by PromotionState" option.
See Also:
CheckoutOptions.isByPromotionState(), CheckoutOptions.setCheckoutDate(com.starbase.util.OLEDate), CheckoutOptions.setCheckoutLabelID(int), CheckoutOptions.setPromotionStateID(int)

setOptimizeForSlowConnections

public void setOptimizeForSlowConnections(boolean bEnabled)
Set whether to optimize for slow connections, when possible. Default is false.

Parameters:
bEnabled - True to optimize for slow connections, when possible; false, otherwise.

getOptimizeForSlowConnections

public boolean getOptimizeForSlowConnections()
Determine whether to optimize for slow connections, when possible.

Returns:
Return true if it is optimized for slow connections, when possible; false, otherwise.

setRestoreFileOnError

public void setRestoreFileOnError(boolean bEnabled)
Set to restore previous working file if an error occurs during a checkout. If true, then file content is streamed to a temporary file, which requires more disk space. Default is true.

Parameters:
bEnabled - True if the previous working file should be restored if an error occurs during a checkout; otherwise, false.

getRestoreFileOnError

public boolean getRestoreFileOnError()
Determine whether to restore previous working file if an error occurs during a checkout.

Returns:
Return True if the previous working file should be restored if an error occurs during a checkout; otherwise, false.

setContentFilter

public void setContentFilter(ContentFilter filter)
Set the hook inserted after performing keyword expansion, eol conversion, etc.

Parameters:
filter - The ContentFilter object to be used after performing keyword expansion, eol conversion, etc.

getContentFilter

public ContentFilter getContentFilter()
Get the hook to be inserted after performing keyword expansion, eol conversion, etc.

Returns:
Return the ContentFilter object to be used after performing keyword expansion, eol conversion, etc.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.