|
|||||||||
| 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.text.JTextComponent
javax.swing.JEditorPane
javax.swing.JTextPane
org.rosuda.JGR.toolkit.SyntaxArea
public class SyntaxArea
SyntaxArea - extends JTextPane and provides bracketmatching.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JEditorPane |
|---|
JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding |
| 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JEditorPane |
|---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| 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 | |
|---|---|
SyntaxArea()
SyntaxArea, with highlighting matching brackets |
|
| Method Summary | |
|---|---|
void |
append(String str)
Append text. |
void |
append(String str,
AttributeSet attr)
Append text with supplied attributeset. |
void |
caretUpdate(CaretEvent e)
caretUpdate: handle caret event: if it was a bracket, highlight the matching one if there is one. |
void |
copy()
Copy text. |
void |
cut()
Cut text. |
void |
dragEnter(DropTargetDragEvent evt)
dragEnter: handle drag event. |
void |
dragExit(DropTargetEvent evt)
dragExit: handle drag event. |
void |
dragOver(DropTargetDragEvent evt)
dragOver: handle drag event. |
void |
drop(DropTargetDropEvent evt)
drop: handle drop target event: insert string representation of dragged object. |
void |
dropActionChanged(DropTargetDragEvent evt)
dropActionChanged: handle drop event. |
int |
getLineCount()
Get amount of lines. |
int |
getLineEndOffset(int line)
|
int |
getLineOfOffset(int offset)
|
int |
getLineStartOffset(int line)
|
boolean |
getScrollableTracksViewportWidth()
|
String |
getText()
Get text. |
String |
getText(int offs,
int len)
Get text from offset with supplied length. |
boolean |
getWordWrap()
Set word wrap behavior. |
void |
highlight(JTextComponent textComp,
String pattern,
int pos,
org.rosuda.JGR.toolkit.SyntaxArea.HighlightPainter hipainter)
Highlight pattern at position. |
void |
highlightParanthesisBackward(String par,
int pos)
Highlight the corresponding brackets (backward). |
void |
highlightParanthesisForward(String par,
int pos)
Highlight the corresponding brackets (forward). |
void |
insertAt(int offset,
String str)
Insert text at position. |
boolean |
isEscaped(int pos)
Checks wether character is escaped. |
boolean |
lastChar(int pos,
String cont)
Check wether last character matches cont. |
void |
paste()
Paste from clipboard. |
void |
removeHighlights()
Remove current highlights. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setText(String str)
Set text. |
void |
setWordWrap(boolean wrap)
Set word wrap behavior. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SyntaxArea()
| Method Detail |
|---|
public void append(String str)
public void append(String str,
AttributeSet attr)
public void insertAt(int offset,
String str)
public String getText()
getText in class JEditorPane
public String getText(int offs,
int len)
getText in class JTextComponentpublic void setText(String str)
setText in class JEditorPanepublic void cut()
cut in class JTextComponentpublic void copy()
copy in class JTextComponentpublic void paste()
paste in class JTextComponentpublic int getLineCount()
public int getLineStartOffset(int line)
throws BadLocationException
BadLocationException
public int getLineEndOffset(int line)
throws BadLocationException
BadLocationException
public int getLineOfOffset(int offset)
throws BadLocationException
BadLocationExceptionpublic void setWordWrap(boolean wrap)
wrap - true if wrap, false if notpublic boolean getWordWrap()
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface ScrollablegetScrollableTracksViewportWidth in class JEditorPane
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class Componentpublic boolean isEscaped(int pos)
pos - postion where to check
public boolean lastChar(int pos,
String cont)
pos - postioncont - pattern
public void highlightParanthesisForward(String par,
int pos)
throws BadLocationException
par - String which bracketpos - int current position
BadLocationException
public void highlightParanthesisBackward(String par,
int pos)
throws BadLocationException
par - String which bracketpos - int current position
BadLocationException
public void highlight(JTextComponent textComp,
String pattern,
int pos,
org.rosuda.JGR.toolkit.SyntaxArea.HighlightPainter hipainter)
textComp - textcomponentpattern - patternpos - positionhipainter - highlightpainterpublic void removeHighlights()
public void caretUpdate(CaretEvent e)
caretUpdate in interface CaretListenerpublic void dragEnter(DropTargetDragEvent evt)
dragEnter in interface DropTargetListenerpublic void dragOver(DropTargetDragEvent evt)
dragOver in interface DropTargetListenerpublic void dragExit(DropTargetEvent evt)
dragExit in interface DropTargetListenerpublic void dropActionChanged(DropTargetDragEvent evt)
dropActionChanged in interface DropTargetListenerpublic void drop(DropTargetDropEvent evt)
drop in interface DropTargetListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||