|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.gui.viewer.ViewerManager
public class ViewerManager
This class keeps track of the installed viewers and their handled file
extensions. It follows the singleton pattern.
ListListener
s can be notified of additions or removals of viewers.
Method Summary | |
---|---|
void |
addListListener(ListListener listener)
|
Viewer |
getDefaultViewer(java.io.File file)
Returns the Viewer object that is registered to handle
file . |
static ViewerManager |
getInstance()
|
Viewer[] |
getViewers()
Returns an array of all registered vierwers. |
Viewer[] |
getViewers(java.io.File file)
Returns array of all viewers registered for this type of file. |
void |
register(java.lang.String[] extensions,
Viewer viewer)
Registers viewer to handle files with extension
extensions . |
void |
register(java.lang.String extension,
Viewer viewer)
Registers viewer to handle files with extension
extension . |
void |
register(Viewer viewer)
Registers viewer to handle files with any extension. |
void |
removeListListener(ListListener listener)
|
void |
setDefaultViewer(java.io.File file,
Viewer viewer)
|
void |
unregister(java.lang.String[] extensions,
Viewer viewer)
Registers viewer to handle files with extension
extensions . |
void |
unregister(java.lang.String extension,
Viewer viewer)
Unregisters viewer to handle files with extension
extensions . |
void |
unregister(Viewer viewer)
Unregisters viewer to handle files with any extension. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ViewerManager getInstance()
public void addListListener(ListListener listener)
public void removeListListener(ListListener listener)
public Viewer getDefaultViewer(java.io.File file)
Viewer
object that is registered to handle
file
.
public Viewer[] getViewers(java.io.File file)
file
- the file's extension is used to determine the viewers
public Viewer[] getViewers()
public void register(java.lang.String extension, Viewer viewer)
viewer
to handle files with extension
extension
.
public void register(Viewer viewer)
viewer
to handle files with any extension.
public void register(java.lang.String[] extensions, Viewer viewer)
viewer
to handle files with extension
extensions
.
public void unregister(java.lang.String extension, Viewer viewer)
viewer
to handle files with extension
extensions
.
public void unregister(Viewer viewer)
viewer
to handle files with any extension.
public void unregister(java.lang.String[] extensions, Viewer viewer)
viewer
to handle files with extension
extensions
.
public void setDefaultViewer(java.io.File file, Viewer viewer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |