de.esprit.common.gui.comp

## Class CurrentFileHolder

- java.lang.Object
- - de.esprit.common.gui.comp.CurrentFileHolder

- All Implemented Interfaces:
    FileChangeEvent.Source

      public class CurrentFileHolder
      extends java.lang.Object
      implements FileChangeEvent.Source

  This is a container for a File object currently being edited in a TextEditor.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CurrentFileHolder()`
    `CurrentFileHolder(java.io.File file)`
    `CurrentFileHolder(java.lang.String baseDir)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFileChangeListener(FileChangeEvent.Listener l)` Register as a listener for this event type.
    `java.io.File` | `getDirectory()` Returns the current base directory, is never null.
    `java.io.File` | `getFile()` Return the current file, null if no fileName is set.
    `java.io.File` | `getHomeDir()` Returns the homeDir of the user
    `void` | `removeFileChangeListener(FileChangeEvent.Listener l)` Deregister the listener.
    `void` | `setDirectory(java.io.File dir)` Sets the current base directory.
    `void` | `setDirectory(java.lang.String dir)` Sets the current base directory If set to null, then the users homeDir is used.
    `void` | `setFile(java.io.File file)` Sets both the current base directory and the current fileName
    `void` | `setFileName(java.lang.String fileName)` Sets the current fileName

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CurrentFileHolder

          public CurrentFileHolder()

    - #### CurrentFileHolder

          public CurrentFileHolder(java.lang.String baseDir)

    - #### CurrentFileHolder

          public CurrentFileHolder(java.io.File file)

  - ### Method Detail

    - #### getFile

          public java.io.File getFile()

      Return the current file, null if no fileName is set.

    - #### getHomeDir

          public java.io.File getHomeDir()

      Returns the homeDir of the user

    - #### getDirectory

          public java.io.File getDirectory()

      Returns the current base directory, is never null.

    - #### setDirectory

          public void setDirectory(java.lang.String dir)

      Sets the current base directory If set to null, then the users homeDir is used.

    - #### setDirectory

          public void setDirectory(java.io.File dir)

      Sets the current base directory. If set to null, then the users homeDir is used.

    - #### setFile

          public void setFile(java.io.File file)

      Sets both the current base directory and the current fileName

    - #### setFileName

          public void setFileName(java.lang.String fileName)

      Sets the current fileName

    - #### addFileChangeListener

          public void addFileChangeListener(FileChangeEvent.Listener l)

      Description copied from interface: `FileChangeEvent.Source`
      Register as a listener for this event type.
      Specified by:
        `addFileChangeListener` in interface `FileChangeEvent.Source`

    - #### removeFileChangeListener

          public void removeFileChangeListener(FileChangeEvent.Listener l)

      Description copied from interface: `FileChangeEvent.Source`
      Deregister the listener.
      Specified by:
        `removeFileChangeListener` in interface `FileChangeEvent.Source`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.