de.hunsicker.jalopy.plugin
Interface ProjectFile


public interface ProjectFile

Represents a Java source file that is part of a project.

Version:
$Revision: 1.2 $
Author:
Marco Hunsicker

Method Summary
 Editor getEditor()
          Returns an editor view to modify the file.
 java.lang.String getEncoding()
          Returns the encoding used to read and write this file.
 java.io.File getFile()
          Returns the underlying physical file.
 java.lang.String getName()
          Returns the name of the file.
 Project getProject()
          Returns the project this file is attached to.
 boolean isOpened()
          Determines whether the file is currently opened.
 boolean isReadOnly()
          Determines whether the file can be changed.
 

Method Detail

getEditor

public Editor getEditor()
Returns an editor view to modify the file. One may check if the file is actually opened in the editor prior to call this method:
 if (projectFile.isOpened())
 {
     return projectFile.getEditor();
 }
 else
 {
     // do whatever you want ...
 }
 

Returns:
the editor to modify the contents of the file. Returns null if the file is currently closed.
See Also:
isOpened()

getEncoding

public java.lang.String getEncoding()
Returns the encoding used to read and write this file.

Returns:
A Java encoding name. May be null to indicate the platform's default encoding.

getFile

public java.io.File getFile()
Returns the underlying physical file. Note that if the application uses virtual files this method should create an intermediate representation but never return null.

Returns:
the physical file.

getName

public java.lang.String getName()
Returns the name of the file.

Returns:
the file name.

isOpened

public boolean isOpened()
Determines whether the file is currently opened. That means an editor view exists.

Returns:
true if the file is currently opened, i.e. has an editor to modify its contents.
See Also:
getEditor()

getProject

public Project getProject()
Returns the project this file is attached to.

Returns:
the containing project.

isReadOnly

public boolean isReadOnly()
Determines whether the file can be changed.

Returns:
true if the file can be changed by the user.


Copyright © 1997-2005 Jalopy. All Rights Reserved.