Package com.luciad.lucy.model
Class TLcyCompositeFileTypeDescriptor
java.lang.Object
com.luciad.lucy.model.ALcyFileTypeDescriptor
com.luciad.lucy.model.TLcyCompositeFileTypeDescriptor
Composite implementation (see composite design pattern) of
ALcyFileTypeDescriptor
.
It keeps a list of associated ALcyFileTypeDescriptor
s. When it is asked if it includes a
filename, it loops over its associated ALcyFileTypeDescriptor
s to find a suitable
ALcyFileTypeDescriptor
.-
Constructor Summary
ConstructorDescriptionTLcyCompositeFileTypeDescriptor
(String aDisplayName) Creates a new TLcyCompositeFileTypeDescriptor with the given display name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFileTypeDescriptor
(ALcyFileTypeDescriptor aDescriptor) Adds the givenALcyFileTypeDescriptor
to this composite descriptor.Returns null.Returns the display name of this file type descriptor.getFileTypeDescriptor
(int aIndex) Gets theALcyFileTypeDescriptor
at the given position in the list.int
Gets the number ofALcyFileTypeDescriptor
s in this composite descriptor.boolean
Returns true if the given filename is included in this file type descriptor.void
removeFileTypeDescriptor
(ALcyFileTypeDescriptor aDescriptor) Removes the givenALcyFileTypeDescriptor
from this composite descriptor.Methods inherited from class com.luciad.lucy.model.ALcyFileTypeDescriptor
toString
-
Constructor Details
-
TLcyCompositeFileTypeDescriptor
Creates a new TLcyCompositeFileTypeDescriptor with the given display name.- Parameters:
aDisplayName
- The display name for this descriptor.
-
-
Method Details
-
addFileTypeDescriptor
Adds the givenALcyFileTypeDescriptor
to this composite descriptor.- Parameters:
aDescriptor
- The descriptor to be added.- See Also:
-
removeFileTypeDescriptor
Removes the givenALcyFileTypeDescriptor
from this composite descriptor.- Parameters:
aDescriptor
- The descriptor to be removed.- See Also:
-
getFileTypeDescriptorCount
public int getFileTypeDescriptorCount()Gets the number ofALcyFileTypeDescriptor
s in this composite descriptor.- Returns:
- the number of
ALcyFileTypeDescriptor
s in this composite descriptor. - See Also:
-
getFileTypeDescriptor
Gets theALcyFileTypeDescriptor
at the given position in the list.- Parameters:
aIndex
- the index to retrieve theALcyFileTypeDescriptor
for.- Returns:
- the
ALcyFileTypeDescriptor
at the given position in the list. - See Also:
-
getDisplayName
Description copied from class:ALcyFileTypeDescriptor
Returns the display name of this file type descriptor. This message will be displayed to a user, f.i. in a file type combo box of a file chooser.- Specified by:
getDisplayName
in classALcyFileTypeDescriptor
- Returns:
- The display name.
-
includes
Description copied from class:ALcyFileTypeDescriptor
Returns true if the given filename is included in this file type descriptor. Most likely, implementations will check if the given filename ends with a known extension (f.i. if it ends with '.txt' or so)- Specified by:
includes
in classALcyFileTypeDescriptor
- Parameters:
aFileName
- The filename to test for validity.- Returns:
- True if the filename is accepted, false otherwise.
-
getDefaultExtension
Returns null.- Specified by:
getDefaultExtension
in classALcyFileTypeDescriptor
- Returns:
- null.
-