com.starteam.viewcomparemerge
Class Options

java.lang.Object
  extended by com.starteam.viewcomparemerge.Options

public class Options
extends java.lang.Object

A set of user preferences that guide a view compare/merge operation. For any invocation of view compare and/or merge, these preferences may be overridden. The intent is that this set of preferences can be stored persistently and retrieved when setting up a view compare/merge operation, and that the set of options reflects what this user will usually want for the operation.


Constructor Summary
Options()
          Constructs a set of Options with default values.
Options(Options theOther)
          Create an Options instance by copying the contents of another
 
Method Summary
 void excludePropertyFromMerge(Property p)
          Specify a property to exclude from a VCM compare & merge Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session.
 ActionOverride[] getActionOverrides()
          An array of ActionOverride's, in the order in which they have been set
 boolean getAutoMergeFiles()
          Returns true if file pairs that have no conflicts will be automatically merged.
 boolean getAutoMergeProperties()
          Returns true if property pairs that have no conflicts will be automatically merged.
 boolean getBreakLocksAutomatically()
          Returns true if locks will automatically be broken as needed to check in merged revisions.
 CheckinOptions getCheckinOptions()
          Returns the CheckinOptions to be used for committing the workspace session
 CheckoutOptions getCheckoutOptions()
          Returns the CheckoutOptions to be used for committing the workspace session
 boolean getCheckTargetFoldersForFloatingShares()
          Determines whether or not VCM will check target folders for floating child shares, and fail if any are found.
static Options getCustomOptions(Server s, java.lang.String name)
          Look for a custom merge type by name on the specified server, return a fully configured set of options after parsing the .xml.
static PropertyCollection getExcludablePropertiesForMerge(Item.Type type)
          returns the set of properties (of a specified type) that may be excluded from a VCM compare & merge Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session.
 boolean getFindNotInViewFolders()
          Returns true if not in view folders should be considered during a workspace compare
 boolean getFixFloatingChildShares()
          Indicates whether or not shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit.
 boolean getIgnoreMergePoints()
          Returns true if all merge points should be ignored for comparisons.
 boolean getLockSourceForDifference()
          Returns true if a source item will be locked when a difference is detected.
 boolean getLockTargetForDifference()
          Returns true if a target item will be locked when a difference is detected.
 boolean getMatchFilesByFileName()
          Returns true if files (or folders) with the same name are to be considered matched, even if their object and/or item ids do not match.
 PropertyCollection getPropertiesExcludedForMerge()
          Returns the set of properties excluded from a VCM Merge Only user modifiable &/or attachment properties may be excluded
 java.lang.String getProperty(java.lang.String key)
          Searches for the property with the specified key in this property list.
 java.lang.String[] getPropertyNames()
          Returns an array of all the keys in this property list,
 boolean getTreatFileNamesAsCaseSensitive()
          Returns true if file (or folder) names are compared in a case-sensitive manner.
 boolean getVerboseDifferences(Item.Type type)
          Determines whether or not a difference is generated for every matched pair of source and target items, whether or not the match is considered a difference.
 boolean getVerboseProcessLinks()
          Determines whether or not a commit operation should create process links for all file and folder operations that add or modify target items.
static Options getWorkstationDefault()
          Returns the default Options for this workstation
 boolean isExcludedFromMerge(Property p)
          returns true if the specified property has been excluded from the merge
 void setAutoMergeFiles(boolean bAutoMerge)
          Set whether file pairs that have no conflicts should be automatically merged.
 void setAutoMergeProperties(boolean bAutoMerge)
          Set whether property pairs that have no conflicts should be automatically merged.
 void setBreakLocksAutomatically(boolean bBreakLocks)
          Set whether to automatically break locks as necessary to check in merged revisions.
 void setCheckinOptions(CheckinOptions options)
          Sets the CheckinOptions to be used for committing the workspace session
 void setCheckoutOptions(CheckoutOptions options)
          Sets the CheckoutOptions to be used for committing the workspace session
 void setCheckTargetFoldersForFloatingShares(boolean bEnabled)
          Determines whether or not VCM will check target folders for floating child shares, and fail if any are found.
 void setDefaultAction(DifferenceType type, MergeAction action)
          Changes the default action in a given situation.
 void setDefaultAction(MatchState state, MergeAction action)
          Changes the default action in a given situation.
 void setExcludePropertyFromMerge(Property p, boolean exclude)
          Specify a property to exclude from a VCM compare & merge (or to re-include it once again) Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session.
 void setFindNotInViewFolders(boolean bFindNotInViewFolders)
          Sets whether to consider Not In View Folders when running a workspace compare.
 void setFixFloatingChildShares(boolean bFix)
          Determines whether or not shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit.
 void setIgnoreMergePoints(boolean bIgnoreMergePoints)
          Set whether all merge points should be ignored for comparisons.
 void setLockSourceForDifference(boolean bLock)
          Set whether to lock the source item when a difference is detected.
 void setLockTargetForDifference(boolean bLock)
          Set whether to lock the target item when a difference is detected.
 void setMatchFilesByFileName(boolean bMatchFilesByFileName)
          Set whether files (or folders) with the same name are to be considered matched, even when their object and/or item ids do not match.
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Sets a value for the property identified by the specified key
 void setTreatFileNamesAsCaseSensitive(boolean bCaseSensitive)
          Set whether file (or folder) names should be compared in a case-sensitive manner.
 void setVerboseDifferences(Item.Type type, boolean bVerbose)
          Determines whether or not a difference is generated for every matched pair of source and target items of a given type, whether or not the match is considered a difference.
 void setVerboseProcessLinks(boolean bEnabled)
          Determines whether or not a commit operation should create process links for all file and folder operations that add or modify target items.
 void setWorkstationDefault()
          Saves the current set of options as the defaults for this workstation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Options

public Options()
Constructs a set of Options with default values.


Options

public Options(Options theOther)
Create an Options instance by copying the contents of another

Parameters:
theOther - Options the other Options instance
Method Detail

getCustomOptions

public static Options getCustomOptions(Server s,
                                       java.lang.String name)
Look for a custom merge type by name on the specified server, return a fully configured set of options after parsing the .xml.

Parameters:
s - the logged in server on which to find the custom vcm .xml in the StarFlow Extensions Project
name - the name of a custom merge type to lookup
Returns:
a fully configured set of options for the specified custom merge or NULL if the name cannot be found. The caller can then apply the defaults specified in the returned options to a vcm session. Useful for vcmutility where the default actions per difference type should be overridden to support ui free command line merges

getWorkstationDefault

public static Options getWorkstationDefault()
Returns the default Options for this workstation

Returns:
the default Options for this workstation

setWorkstationDefault

public void setWorkstationDefault()
                           throws java.io.IOException
Saves the current set of options as the defaults for this workstation.

Throws:
java.io.IOException

getCheckinOptions

public CheckinOptions getCheckinOptions()
Returns the CheckinOptions to be used for committing the workspace session

Returns:
the CheckinOptions to be used for committing the workspace session

setCheckinOptions

public void setCheckinOptions(CheckinOptions options)
Sets the CheckinOptions to be used for committing the workspace session

Parameters:
options - the CheckinOptions to be used for committing the workspace session

getCheckoutOptions

public CheckoutOptions getCheckoutOptions()
Returns the CheckoutOptions to be used for committing the workspace session

Returns:
the CheckoutOptions to be used for committing the workspace session

setCheckoutOptions

public void setCheckoutOptions(CheckoutOptions options)
Sets the CheckoutOptions to be used for committing the workspace session

Parameters:
options - the CheckoutOptions to be used for committing the workspace session

setFindNotInViewFolders

public void setFindNotInViewFolders(boolean bFindNotInViewFolders)
Sets whether to consider Not In View Folders when running a workspace compare. The default value is true

Parameters:
bFindNotInViewFolders - true to consider Not In View folders

getFindNotInViewFolders

public boolean getFindNotInViewFolders()
Returns true if not in view folders should be considered during a workspace compare

Returns:
true if not in view folders should be considered during a workspace compare

setMatchFilesByFileName

public void setMatchFilesByFileName(boolean bMatchFilesByFileName)
Set whether files (or folders) with the same name are to be considered matched, even when their object and/or item ids do not match. The default value is false.

Parameters:
bMatchFilesByFileName - true to match on name.

getMatchFilesByFileName

public boolean getMatchFilesByFileName()
Returns true if files (or folders) with the same name are to be considered matched, even if their object and/or item ids do not match. The default value is false.

Returns:
true if files (or folders) with the same name are to be considered matched, even if their object and/or item ids do not match.

setTreatFileNamesAsCaseSensitive

public void setTreatFileNamesAsCaseSensitive(boolean bCaseSensitive)
Set whether file (or folder) names should be compared in a case-sensitive manner. The default value is false.

Parameters:
bCaseSensitive - true if file (or folder) names are case sensitive.

getTreatFileNamesAsCaseSensitive

public boolean getTreatFileNamesAsCaseSensitive()
Returns true if file (or folder) names are compared in a case-sensitive manner. The default value is false.

Returns:
true if file (or folder) names are compared in a case-sensitive manner.

setIgnoreMergePoints

public void setIgnoreMergePoints(boolean bIgnoreMergePoints)
Set whether all merge points should be ignored for comparisons. The default value is false.

Parameters:
bIgnoreMergePoints - true to ignore merge points.

getIgnoreMergePoints

public boolean getIgnoreMergePoints()
Returns true if all merge points should be ignored for comparisons. The default value is false.

Returns:
true if all merge points should be ignored for comparisons, false if merge points should be used.

setAutoMergeFiles

public void setAutoMergeFiles(boolean bAutoMerge)
Set whether file pairs that have no conflicts should be automatically merged. The default value is false.

Parameters:
bAutoMerge - true if file pairs that have no conflicts should be automatically merged.

getAutoMergeFiles

public boolean getAutoMergeFiles()
Returns true if file pairs that have no conflicts will be automatically merged. The default value is false.

Returns:
true if file pairs that have no conflicts will be automatically merged.

setAutoMergeProperties

public void setAutoMergeProperties(boolean bAutoMerge)
Set whether property pairs that have no conflicts should be automatically merged. The default value is false.

Parameters:
bAutoMerge - true if property pairs that have no conflicts should be automatically merged.

getAutoMergeProperties

public boolean getAutoMergeProperties()
Returns true if property pairs that have no conflicts will be automatically merged. The default value is false.

Returns:
true if property pairs that have no conflicts will be automatically merged.

getExcludablePropertiesForMerge

public static PropertyCollection getExcludablePropertiesForMerge(Item.Type type)
returns the set of properties (of a specified type) that may be excluded from a VCM compare & merge Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session.

Parameters:
type - the Type whose subset of properties may be excluded
Returns:
the set of properties that may be excluded from the VCM compare & merge

getPropertiesExcludedForMerge

public PropertyCollection getPropertiesExcludedForMerge()
Returns the set of properties excluded from a VCM Merge Only user modifiable &/or attachment properties may be excluded

Returns:
The set of properties excluded from a VCM Merge

excludePropertyFromMerge

public void excludePropertyFromMerge(Property p)
Specify a property to exclude from a VCM compare & merge Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session. Excluded properties will not be compared, merged or overwritten Only user modifiable &/or attachment properties can be excluded from the merge

Parameters:
p - A user modifiable or attachment property that must be excludes from the VCM

setExcludePropertyFromMerge

public void setExcludePropertyFromMerge(Property p,
                                        boolean exclude)
Specify a property to exclude from a VCM compare & merge (or to re-include it once again) Excluding properties allows an application fine grained control over which properties should be considered relevant to a VCM View Compare Merge Session. Excluded properties will not be compared, merged or overwritten Only user modifiable &/or attachment properties can be excluded from the merge

Parameters:
p - A user modifiable or attachment property that must be excludes from the VCM
exclude - true to exclude it from the merge, false to include it once again

isExcludedFromMerge

public boolean isExcludedFromMerge(Property p)
returns true if the specified property has been excluded from the merge

Parameters:
p - a property to test
Returns:
true if the specified property has been excluded from the merge

setBreakLocksAutomatically

public void setBreakLocksAutomatically(boolean bBreakLocks)
Set whether to automatically break locks as necessary to check in merged revisions. The default value is false.

Parameters:
bBreakLocks - true to automatically break locks as needed.

getBreakLocksAutomatically

public boolean getBreakLocksAutomatically()
Returns true if locks will automatically be broken as needed to check in merged revisions. The default value is false.

Returns:
true if locks will automatically be broken as needed to check in merged revisions.

setLockSourceForDifference

public void setLockSourceForDifference(boolean bLock)
Set whether to lock the source item when a difference is detected. The default value is false.

Parameters:
bLock - true to to lock the source item when a difference is detected.

getLockSourceForDifference

public boolean getLockSourceForDifference()
Returns true if a source item will be locked when a difference is detected. The default value is false.

Returns:
true if a source item will be locked when a difference is detected.

setLockTargetForDifference

public void setLockTargetForDifference(boolean bLock)
Set whether to lock the target item when a difference is detected. The default value is false.

Parameters:
bLock - true to to lock the target item when adDifference is detected.

getLockTargetForDifference

public boolean getLockTargetForDifference()
Returns true if a target item will be locked when a difference is detected. The default value is false.

Returns:
true if a target item will be locked when a difference is detected.

setFixFloatingChildShares

public void setFixFloatingChildShares(boolean bFix)
Determines whether or not shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit. By default, floating child shares are neither detected nor fixed.

Parameters:
bFix - true if shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit.

getFixFloatingChildShares

public boolean getFixFloatingChildShares()
Indicates whether or not shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit.

Returns:
true if shares that float from the source view to the target view will automatically be detected during the compare phase and fixed during the commit; false otherwise.

setVerboseDifferences

public void setVerboseDifferences(Item.Type type,
                                  boolean bVerbose)
Determines whether or not a difference is generated for every matched pair of source and target items of a given type, whether or not the match is considered a difference. The default value is false.

Verbose differences are off by default. If you change the scope of a session, then verbose differences are enabled for all types that are in scope, but not fully in scope.

Parameters:
type - An item type.
bVerbose - True to generate an ItemDifference for every matched pair of source and target items of the given type; false to generate an ItemDifference only when a true difference is detected.

getVerboseDifferences

public boolean getVerboseDifferences(Item.Type type)
Determines whether or not a difference is generated for every matched pair of source and target items, whether or not the match is considered a difference. The default value is false.

Verbose differences are off by default, but are enabled for sessions whose scope is not the entire source view.

Parameters:
type - the type for which verbose differences are being set
Returns:
True to generate an ItemDifference for every matched pair of source and target items; false to generate an ItemDifference only when a true difference is detected.
See Also:
Session.setScope(com.starteam.viewcomparemerge.Scope)

getVerboseProcessLinks

public boolean getVerboseProcessLinks()
Determines whether or not a commit operation should create process links for all file and folder operations that add or modify target items.

Returns:
true if commit operations should create process links for all file and folder operations that add or modify target items; false if process links are created only for file checkins (which is consistent with the rest of StarTeam). Verbose process links are enabled by default.

setVerboseProcessLinks

public void setVerboseProcessLinks(boolean bEnabled)
Determines whether or not a commit operation should create process links for all file and folder operations that add or modify target items.

Parameters:
bEnabled - true if commit operations should create process links for all file and folder operations that add or modify target items; false if process links are created only for file checkins (which is consistent with the rest of StarTeam). Verbose process links are enabled by default.

getCheckTargetFoldersForFloatingShares

public boolean getCheckTargetFoldersForFloatingShares()
Determines whether or not VCM will check target folders for floating child shares, and fail if any are found.

Returns:
true if VCM will check target folders for floating child shares, and fail if any are found. Enabled by default.

setCheckTargetFoldersForFloatingShares

public void setCheckTargetFoldersForFloatingShares(boolean bEnabled)
Determines whether or not VCM will check target folders for floating child shares, and fail if any are found.

Parameters:
bEnabled - true if VCM will check target folders for floating child shares, and fail if any are found. Enabled by default.

getActionOverrides

public ActionOverride[] getActionOverrides()
An array of ActionOverride's, in the order in which they have been set

Returns:
ActionOverride[] An array of ActionOverride's, returned in the order in which they were entered

setDefaultAction

public void setDefaultAction(DifferenceType type,
                             MergeAction action)
Changes the default action in a given situation.

Note that there may be one and only one default action for a given DifferenceType

Parameters:
type - The DifferenceType for which the default action is to be changed.
action - The new default action for the given DifferenceType, or null to restore the default action to the engine's default value.
See Also:
MergeAction

setDefaultAction

public void setDefaultAction(MatchState state,
                             MergeAction action)
Changes the default action in a given situation.

Note that if multiple calls to setDefaultAction() are made, the order is significant. If two overrides are both relevant to a given ItemDifference, the most recently specified one takes precedence.

Parameters:
state - The MatchState for which the default action is to be changed.
action - The new default action for the given MatchState, or null to restore the default action to the engine's default value.
See Also:
MergeAction

getProperty

public java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in this property list.

Parameters:
key - String the key to search for
Returns:
String the stored property value for the specified key

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
Sets a value for the property identified by the specified key

Parameters:
key - String the key for which a value needs to be set
value - String the value to set
Returns:
Object he previous value of the specified key in this property list, or null if it did not have one.

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns an array of all the keys in this property list,

Returns:
String[] the array of all the keys in this property list


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.