|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
mars.venus.EditPane
public class EditPane
Represents one file opened for editing. Maintains required internal structures. Before Mars 4.0, there was only one editor pane, a tab, and only one file could be open at a time. With 4.0 came the multifile (pane, tab) editor, and existing duties were split between EditPane and the new EditTabbedPane class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
EditPane(VenusUI appFrame)
Constructor for the EditPane class. |
Method Summary | |
---|---|
int |
convertLineColumnToStreamPosition(int line,
int column)
Given line and column (position in the line) numbers, calculate its byte stream position in text being edited. |
Point |
convertStreamPositionToLineColumn(int position)
|
void |
copyText()
copy currently-selected text into clipboard |
void |
cutText()
cut currently-selected text into clipboard |
void |
discardAllUndoableEdits()
Get rid of any accumulated undoable edits. |
void |
displayCaretPosition(int pos)
Update the caret position label on the editor's border to display the current line and column. |
void |
displayCaretPosition(Point p)
Display cursor coordinates |
int |
doFindText(String find,
boolean caseSensitive)
Finds next occurrence of text in a forward search of a string. |
int |
doReplace(String find,
String replace,
boolean caseSensitive)
Finds and replaces next occurrence of text in a string in a forward search. |
int |
doReplaceAll(String find,
String replace,
boolean caseSensitive)
Finds and replaces ALL occurrences of text in a string in a forward search. |
String |
getFilename()
Delegates to corresponding FileStatus method |
int |
getFileStatus()
Get the editing status for this EditPane's associated document. |
String |
getLineNumbersList(Document doc)
|
String |
getPathname()
Delegates to corresponding FileStatus method |
String |
getSource()
Get source code text |
int |
getSourceLineCount()
Calculate and return number of lines in source code text. |
UndoManager |
getUndoManager()
get the manager in charge of Undo and Redo operations |
boolean |
hasUnsavedEdits()
Delegates to corresponding FileStatus method |
boolean |
isNew()
Delegates to corresponding FileStatus method |
void |
pasteText()
paste clipboard contents at cursor position |
void |
redo()
Redo previous edit |
void |
selectAllText()
select all text |
void |
selectLine(int line)
Select the specified editor text line. |
void |
selectLine(int line,
int column)
Select the specified editor text line. |
void |
setFileStatus(int fileStatus)
Set the editing status for this EditPane's associated document. |
void |
setPathname(String pathname)
Delegates to corresponding FileStatus method |
void |
setShowLineNumbersEnabled(boolean enabled)
enable or disable checkbox that controls display of line numbers |
void |
setSourceCode(String s,
boolean editable)
For initalizing the source code when opening an ASM file |
boolean |
showingLineNumbers()
get editor's line number display status |
void |
tellEditingComponentToRequestFocusInWindow()
Delegates to text area's requestFocusInWindow method. |
void |
undo()
Undo previous edit |
void |
update(Observable fontChanger,
Object arg)
Update, if source code is visible, when Font setting changes. |
void |
updateRedoState()
Update state of Edit menu's Redo menu item. |
void |
updateStaticFileStatus()
Delegates to corresponding FileStatus method |
void |
updateUndoState()
Update state of Edit menu's Undo menu item. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EditPane(VenusUI appFrame)
Method Detail |
---|
public void setSourceCode(String s, boolean editable)
s
- String containing texteditable
- set true if code is editable else falsepublic void discardAllUndoableEdits()
public String getLineNumbersList(Document doc)
public int getSourceLineCount()
public String getSource()
public void setFileStatus(int fileStatus)
FileStatus
- the status constant from class FileStatuspublic int getFileStatus()
public String getFilename()
public String getPathname()
public void setPathname(String pathname)
public boolean hasUnsavedEdits()
public boolean isNew()
public void tellEditingComponentToRequestFocusInWindow()
public void updateStaticFileStatus()
public UndoManager getUndoManager()
public void copyText()
public void cutText()
public void pasteText()
public void selectAllText()
public void undo()
public void redo()
public void updateUndoState()
public void updateRedoState()
public boolean showingLineNumbers()
public void setShowLineNumbersEnabled(boolean enabled)
enable
- True to enable box, false to disable.public void displayCaretPosition(int pos)
pos
- Offset into the text stream of caret.public void displayCaretPosition(Point p)
p
- Point object with x-y (column, line number) coordinates of cursorpublic Point convertStreamPositionToLineColumn(int position)
public int convertLineColumnToStreamPosition(int line, int column)
line
- Line number in file (starts with 1)column
- Position within that line (starts with 1)
public void selectLine(int line)
line
- The desired line number of this TextPane's text. Numbering starts at 1, and
nothing will happen if the parameter value is less than 1public void selectLine(int line, int column)
line
- The desired line number of this TextPane's text. Numbering starts at 1, and
nothing will happen if the parameter value is less than 1column
- Desired column at which to place the cursor.public int doFindText(String find, boolean caseSensitive)
find
- the text to locate in the stringcaseSensitive
- true if search is to be case-sensitive, false otherwise
public int doReplace(String find, String replace, boolean caseSensitive)
find
- the text to locate in the stringreplace
- the text to replace the find text with - if the find text existscaseSensitive
- true for case sensitive. false to ignore case
public int doReplaceAll(String find, String replace, boolean caseSensitive)
find
- the text to locate in the stringreplace
- the text to replace the find text with - if the find text existscaseSensitive
- true for case sensitive. false to ignore case
public void update(Observable fontChanger, Object arg)
update
in interface Observer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |