de.uni_paderborn.fujaba.mpEdit
Interface DocInterface


public interface DocInterface

No comment provided by developer, please add a comment to improve documentation.

Version:
$Revision: 1.14 $
Author:
$Author: schneider $

Method Summary
 boolean addLine(TagLine tag, java.lang.String text)
          Insert a line of text before the TagLine.
 void closeDoc(boolean bail)
          Closes this document.
 boolean deleteLine(TagLine tag)
          Delete a line.
 javax.swing.text.Document getDocument()
          Copies the content of this doc into a swing-Document.
 java.lang.String getFilename()
          Returns the filename (no path) for this document.
 java.lang.String getLine(TagLine tag)
          Get the text for a line.
 int getLineCount()
          Get the line count for a document.
 java.lang.String getPathname()
          Returns the full path to this document.
 boolean isDirty()
          Fetch the dirty flag.
 int lineFromTag(TagLine tag)
          Get the current line number for a TagLine.
 void saveAsDoc(java.lang.String pathname)
          Writes out this document.
 void saveDoc()
          Writes out this document.
 void setDirty(boolean d)
          This sets the dirty flag.
 void setFilename(java.lang.String fileName)
          Sets the filename for this document.
 boolean setLine(TagLine tag, java.lang.String text)
          Set the text for a line.
 boolean showLine(TagLine tag)
          Bring forward any view window and scroll to the desired line.
 TagLine tagLine(int lineNo)
          Set a TagLine, used to track lines even when lines have been inserted or deleted elsewhere in the document.
 TagLine tagLine(int lineNo, java.awt.Color color)
          Set a TagLine (including a tag color), used to track lines even when lines have been inserted or deleted elsewhere in the document.
 

Method Detail

closeDoc

public void closeDoc(boolean bail)
Closes this document. If the "bail" flag is true changes will be discarded, otherwise the user will be queried.

Parameters:
bail - Exit immediately, discarding changes.

saveDoc

public void saveDoc()
Writes out this document.


saveAsDoc

public void saveAsDoc(java.lang.String pathname)
Writes out this document.

Parameters:
pathname - New document name (full path).

getPathname

public java.lang.String getPathname()
Returns the full path to this document.

Returns:
Document name (full path).

getFilename

public java.lang.String getFilename()
Returns the filename (no path) for this document.

Returns:
Document name (no path).

setFilename

public void setFilename(java.lang.String fileName)
Sets the filename for this document.

Parameters:
fileName - Document name .

isDirty

public boolean isDirty()
Fetch the dirty flag.

Returns:
True if the file has been changed since being written.

setDirty

public void setDirty(boolean d)
This sets the dirty flag. Use this method with special care, if the flag is set to false, there will be no question about saving.

Parameters:
d - The new dirty value

getLineCount

public int getLineCount()
Get the line count for a document.

Returns:
The line count.

tagLine

public TagLine tagLine(int lineNo)
Set a TagLine, used to track lines even when lines have been inserted or deleted elsewhere in the document.

Parameters:
lineNo - No description provided
Returns:
The TagLine for a given line.

tagLine

public TagLine tagLine(int lineNo,
                       java.awt.Color color)
Set a TagLine (including a tag color), used to track lines even when lines have been inserted or deleted elsewhere in the document.

Parameters:
color - The Color to display (pass null to clear).
lineNo - No description provided
Returns:
The TagLine for a given line.

lineFromTag

public int lineFromTag(TagLine tag)
Get the current line number for a TagLine.

Parameters:
tag - No description provided
Returns:
The line for a given tag.

showLine

public boolean showLine(TagLine tag)
Bring forward any view window and scroll to the desired line.

Parameters:
tag - The line to display.
Returns:
Success.

getLine

public java.lang.String getLine(TagLine tag)
Get the text for a line.

Parameters:
tag - The line to get.
Returns:
The text for the line (null if TagLine not found).

setLine

public boolean setLine(TagLine tag,
                       java.lang.String text)
Set the text for a line.

Parameters:
tag - The line to set.
text - The text to set.
Returns:
Success.

addLine

public boolean addLine(TagLine tag,
                       java.lang.String text)
Insert a line of text before the TagLine.

Parameters:
tag - The line to set.
text - The text to set.
Returns:
Success.

deleteLine

public boolean deleteLine(TagLine tag)
Delete a line.

Parameters:
tag - The line to delete.
Returns:
Success.

getDocument

public javax.swing.text.Document getDocument()
Copies the content of this doc into a swing-Document.

Returns:
The document value