gui
Class EditorArray

java.lang.Object
  extended by gui.EditorArray

public class EditorArray
extends java.lang.Object

This class represents the editor within the editor panel. Each tab in the editor panel contains an EditorArray instance. EditorArray class cover all functionalities of a basic editor as well as advanced features such as highlighting.


Field Summary
 int arrayIndex
           
 java.util.ArrayList bpList
           
 int changeCount
           
 int changeFlag
           
 PMenuBar menuBar
           
 PFrame pFrame
           
 Scanner scanner
           
 java.util.ArrayList tempList
           
 int undoRedoFlag
           
 
Constructor Summary
EditorArray(EditorPane ePane, java.lang.String s, PMenuBar pm, PFrame p)
          Constructor for the EditorArray class.
 
Method Summary
 javax.swing.JTextPane getEditFieldEditorPane()
          This method initializes and returns the text field of the EditorArray object.
 javax.swing.JScrollPane getEditScrollPane()
          This method initializes and returns the scroll panel under the text field.
 java.lang.String getFileName()
          This method returns the name of the file opened by the editor instance.
 java.lang.String getFilePath()
          This method returns the relative file path
static int getLineAtCaret(javax.swing.text.JTextComponent component)
          Return the current line number at the Caret position.
 javax.swing.JMenuItem getSelectAllMenuItem()
          This method initializes and returns menu item which selects all text content in the text field
 void setFileName(java.lang.String fileName)
          This method changes the name of the file opened by the editor instance.
 void setFilePath(java.lang.String filePath)
          This method changes the file path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changeFlag

public int changeFlag

arrayIndex

public int arrayIndex

changeCount

public int changeCount

undoRedoFlag

public int undoRedoFlag

scanner

public Scanner scanner

menuBar

public PMenuBar menuBar

pFrame

public PFrame pFrame

bpList

public java.util.ArrayList bpList

tempList

public java.util.ArrayList tempList
Constructor Detail

EditorArray

public EditorArray(EditorPane ePane,
                   java.lang.String s,
                   PMenuBar pm,
                   PFrame p)
Constructor for the EditorArray class. The constructor initializes the file name which appears as tab name. The class needs the main editor panel and the associated menu bar object, as well.

Parameters:
ePane -
s -
pm -
Method Detail

getFilePath

public java.lang.String getFilePath()
This method returns the relative file path

Returns:
file path

setFilePath

public void setFilePath(java.lang.String filePath)
This method changes the file path

Parameters:
filePath -

getEditFieldEditorPane

public javax.swing.JTextPane getEditFieldEditorPane()
This method initializes and returns the text field of the EditorArray object. The text field has syntax highlihter, copy/paste and undo/redio listeners attached.

Returns:
JTextPane

getEditScrollPane

public javax.swing.JScrollPane getEditScrollPane()
This method initializes and returns the scroll panel under the text field.

Returns:
JScrollPane

getFileName

public java.lang.String getFileName()
This method returns the name of the file opened by the editor instance.

Returns:
String

setFileName

public void setFileName(java.lang.String fileName)
This method changes the name of the file opened by the editor instance.

Parameters:
fileName -

getSelectAllMenuItem

public javax.swing.JMenuItem getSelectAllMenuItem()
This method initializes and returns menu item which selects all text content in the text field

Returns:
JMenuItem

getLineAtCaret

public static int getLineAtCaret(javax.swing.text.JTextComponent component)
Return the current line number at the Caret position.