|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.externaltools.ExternalToolset
public final class ExternalToolset
An ordered collection of ExternalToolAssociation
s, with some handy
methods to find the association that's most appropriate for a given file or
directory name. Searches are linear from the start of the list; if an
ExternalToolset
contains multiple ExternalToolAssociation
s
that have overlapping extensions, the first in the set will match when the
set is searched for an extension.
Field Summary | |
---|---|
static java.lang.String |
DIRECTORY_EXTENSION
The extension string to use to make a tool association for directories. |
static java.lang.String |
WILDCARD_EXTENSION
The extension string to use to make a fall-back tool association, which matches all file extensions as long as a more specific extension does not exist in the set. |
Constructor Summary | |
---|---|
ExternalToolset()
Creates an empty ExternalToolset . |
Method Summary | |
---|---|
void |
addAssociation(ExternalToolAssociation association)
|
void |
clear()
|
ExternalTool |
findTool(java.io.File file)
Finds the appropriate ExternalToolAssociation in this
ExternalToolset to handle the given File , which can be a
directory or a file. |
ExternalTool |
findTool(java.lang.String path)
Finds the appropriate ExternalTool in this
ExternalToolset to handle the given path, which can be a file or
a directory. |
ExternalTool |
findToolForDirectory()
Finds the right ExternalTool for any directory. |
ExternalTool |
findToolForExtension(java.lang.String extension)
Finds the right ExternalTool using only the file extension. |
ExternalToolAssociation |
get(int index)
|
ExternalToolAssociation |
getDirectoryAssociation()
|
ExternalToolAssociation[] |
getFileAssociations()
|
boolean |
isEmpty()
|
static ExternalToolset |
loadFromMemento(Memento memento)
Loads toolset state from the given Memento , which can have any
name. |
boolean |
remove(ExternalToolAssociation association)
|
ExternalToolAssociation |
remove(int index)
|
void |
saveToMemento(Memento memento)
Saves this toolset's state to the given Memento , which should
have a name (of the caller's choice) but no other data. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DIRECTORY_EXTENSION
"/"
public static final java.lang.String WILDCARD_EXTENSION
"*"
Constructor Detail |
---|
public ExternalToolset()
ExternalToolset
.
Method Detail |
---|
public ExternalTool findTool(java.io.File file)
ExternalToolAssociation
in this
ExternalToolset
to handle the given File
, which can be a
directory or a file.
file
- the File (file or directory) to get the tool for (must not be
null
)
ExternalToolAssociation
or null if none
was appropriatepublic ExternalTool findTool(java.lang.String path)
ExternalTool
in this
ExternalToolset
to handle the given path, which can be a file or
a directory. It can be relative or absolute.
path
- the name of the file or directory (relative or absolute) to get
the tool for (must not be null
)
ExternalTool
or null if none was
appropriatepublic ExternalTool findToolForDirectory()
ExternalTool
for any directory.
ExternalTool
, or null if no directory
tool is configuredpublic ExternalTool findToolForExtension(java.lang.String extension)
ExternalTool
using only the file extension. Do
not call this with the special
DIRECTORY_EXTENSION
.
extension
- the file extension (not the full path, not
DIRECTORY_EXTENSION
) (must not be null
)
ExternalTool
or null if no appropriate
tool is found (no extension match and no wildcard configured)public void addAssociation(ExternalToolAssociation association)
public final void clear()
public ExternalToolAssociation get(int index)
public final boolean isEmpty()
public ExternalToolAssociation remove(int index)
public boolean remove(ExternalToolAssociation association)
public final int size()
public ExternalToolAssociation[] getFileAssociations()
ExternalToolAssociation
s for filespublic ExternalToolAssociation getDirectoryAssociation()
ExternalToolAssociation
for directories, if there is
one, otherwise nullpublic void saveToMemento(Memento memento)
Memento
, which should
have a name (of the caller's choice) but no other data.
memento
- the Memento
to save this toolset's state to (must not be
null
)public static ExternalToolset loadFromMemento(Memento memento)
Memento
, which can have any
name.
memento
- the Memento
to load state from. If null, an empty
ExternalToolset
is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |