com.starteam.viewcomparemerge
Class FolderScope

java.lang.Object
  extended by com.starteam.viewcomparemerge.Scope
      extended by com.starteam.viewcomparemerge.FolderScope

public class FolderScope
extends Scope

Allows folders to be included or excluded from the scope of the view compare/merge operation in a flexible way.

See Also:
Session.setScope(com.starteam.viewcomparemerge.Scope), Scope

Constructor Summary
FolderScope(Folder f)
          Creates a new FolderScope that includes the files in the given source folder.
FolderScope(Folder f, boolean bIncludeSubfolders)
          Creates a new FolderScope that includes the files in the given source folder, and optionally in all of its child folders at any depth.
FolderScope(Folder f, boolean bIncludeSubfolders, Item.Type type)
          Creates a new FolderScope that includes the files in the given source folder, and optionally in all of its child folders at any depth.
FolderScope(Folder f, boolean bIncludeSubfolders, TypeCollection tc)
          Construct a folder scope
FolderScope(Folder f, Item.Type type)
          Creates a new FolderScope that includes the items of the given type in the given source folder.
FolderScope(FolderListManager folders)
          Creates a new FolderScope that includes all of the folders indicated by the given FolderListManager.
FolderScope(FolderListManager folders, Item.Type type)
          Creates a new FolderScope that includes all of the folders indicated by the given FolderListManager.
FolderScope(FolderListManager folders, TypeCollection tc)
          Construct a Folder Scope
FolderScope(Folder f, TypeCollection types)
          Creates a new FolderScope that includes the items of all of the given types in the given source folder.
 
Method Summary
 java.lang.String getDescription()
          Return a description of this scope.
 Item getIncludedRevision(Item item)
          Determines whether or not the given source item is in scope for the current view compare/merge operation, and, if so, returns the item revision that should be used for comparision.
 TypeCollection getItemTypes()
          Get the list of item types that are included in this scope.
 boolean isFullScope(Item.Type type)
          Determines whether or not this represents a "Full Scope" operation for the given item type.
 void refresh(Session session)
          Provides a scope the opportunity to initialize or refresh its state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderScope

public FolderScope(Folder f)
Creates a new FolderScope that includes the files in the given source folder.

Parameters:
f - A folder in the source view.

FolderScope

public FolderScope(Folder f,
                   Item.Type type)
Creates a new FolderScope that includes the items of the given type in the given source folder.

Parameters:
f - A folder in the source view.
type - An item type.

FolderScope

public FolderScope(Folder f,
                   TypeCollection types)
Creates a new FolderScope that includes the items of all of the given types in the given source folder.

Parameters:
f - A folder in the source view.
types - A list of item types.

FolderScope

public FolderScope(Folder f,
                   boolean bIncludeSubfolders)
Creates a new FolderScope that includes the files in the given source folder, and optionally in all of its child folders at any depth.

Parameters:
f - A folder in the source view.
bIncludeSubfolders - true to include files in child folders; false to include only the files in the folder itself.

FolderScope

public FolderScope(Folder f,
                   boolean bIncludeSubfolders,
                   Item.Type type)
Creates a new FolderScope that includes the files in the given source folder, and optionally in all of its child folders at any depth.

Parameters:
f - A folder in the source view.
bIncludeSubfolders - true to include files in child folders;
type - the type of the items included in scope false to include only the files in the folder itself.

FolderScope

public FolderScope(Folder f,
                   boolean bIncludeSubfolders,
                   TypeCollection tc)
Construct a folder scope

Parameters:
f - the folder to include
bIncludeSubfolders - true to include sub folders
tc - the types of the items included in scope

FolderScope

public FolderScope(FolderListManager folders)
Creates a new FolderScope that includes all of the folders indicated by the given FolderListManager.

The client application is free to include or exclude folders from the FolderListManager at any time. Changes will be reflected in the scope after the next refresh().

Parameters:
folders - The FolderListManager that describes the scope.
See Also:
FolderListManager

FolderScope

public FolderScope(FolderListManager folders,
                   Item.Type type)
Creates a new FolderScope that includes all of the folders indicated by the given FolderListManager.

The client application is free to include or exclude folders from the FolderListManager at any time. Changes will be reflected in the scope after the next refresh().

Parameters:
folders - The FolderListManager that describes the scope.
type - the type to include
See Also:
FolderListManager

FolderScope

public FolderScope(FolderListManager folders,
                   TypeCollection tc)
Construct a Folder Scope

Parameters:
folders - the folders to include
tc - the types to include
Method Detail

getDescription

public java.lang.String getDescription()
Return a description of this scope. The description has this form: - if only one folder is found, its display name is used. - if two or more folders are found, two are used: 'name1, name2 ... etc.'.

Specified by:
getDescription in class Scope
Returns:
a description of the scope

isFullScope

public boolean isFullScope(Item.Type type)
Description copied from class: Scope
Determines whether or not this represents a "Full Scope" operation for the given item type. If a scope restricts anything other than the item type, it is not considered a full scope operation.

Specified by:
isFullScope in class Scope
Parameters:
type - the item type to test
Returns:
true if the item type is at full scope
See Also:
Scope.isFullScope(com.starteam.Item.Type)

refresh

public void refresh(Session session)
Description copied from class: Scope
Provides a scope the opportunity to initialize or refresh its state. As a result, some Items that were previously in scope may now be out of scope, and vice versa.

The view compare/merge engine calls refresh() once at the start of Session.compare(), and once for each call to Session.refresh().

Specified by:
refresh in class Scope
Parameters:
session - the session to be refreshed
See Also:
Scope.refresh(com.starteam.viewcomparemerge.Session)

getItemTypes

public TypeCollection getItemTypes()
Description copied from class: Scope
Get the list of item types that are included in this scope. Note that folders are always processed, whether or not the scope indicates that they should be included.

Specified by:
getItemTypes in class Scope
Returns:
a collection of included types
See Also:
Scope.getItemTypes()

getIncludedRevision

public Item getIncludedRevision(Item item)
Description copied from class: Scope
Determines whether or not the given source item is in scope for the current view compare/merge operation, and, if so, returns the item revision that should be used for comparision.

During a compare operation, the getIncludedRevision() method is called for every source folder whose parent is in scope, and for every item whose type and parent folder are in scope.

Each implementation of Scope must guarantee that if getIncludedRevision() is called again on the same item, without an intervening call to refresh(), the result is the same between calls. That is, until a refresh() is called, a given item must be consistently in scope or out of scope.

Scope implementations may assume that getIncludedRevision() is called only for types that are in scope (and folders).

Specified by:
getIncludedRevision in class Scope
Parameters:
item - the item to be tested for inclusion
Returns:
the included revision of the item if any
See Also:
Scope.getIncludedRevision(com.starteam.Item)


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