|
||||||||||
| 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
org.nuiton.widget.editor.DefaultEditor
public class DefaultEditor
Default editor, can open of kind of file behaviour:
| 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 | |
|---|---|
protected JEditorPane |
editor
|
protected boolean |
isModified
|
protected JScrollPane |
scrollPane
|
| 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 | |
|---|---|
DefaultEditor()
|
|
| Method Summary | |
|---|---|
boolean |
accept(File file)
If return true, this editor support this file type. |
void |
addCaretListener(CaretListener listener)
Add caret listener. |
void |
addDocumentListener(DocumentListener listener)
Add document listener. |
void |
changedUpdate(DocumentEvent e)
|
void |
copy()
Copy current current selection into system clipboard. |
void |
cut()
Cut current editor selection into system clipboard. |
String |
getText()
Return the current content text of the editor as String. |
void |
insertUpdate(DocumentEvent e)
|
boolean |
isModified()
Indicate if current opened file has been modified. |
boolean |
open(File file)
Replace the current edited file by file passed in argument. |
void |
paste()
Paste current clicboard content into editor at caret position. |
void |
removeCaretListener(CaretListener listener)
Remove caret listener. |
void |
removeDocumentListener(DocumentListener listener)
Remove document listener. |
void |
removeUpdate(DocumentEvent e)
|
boolean |
saveAs(File file)
Replace the current edited file by file passed in argument. |
void |
setText(String text)
Set all text with text in argument. |
| 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 |
| Methods inherited from interface org.nuiton.widget.editor.EditorInterface |
|---|
setEnabled |
| Field Detail |
|---|
protected JEditorPane editor
protected JScrollPane scrollPane
protected boolean isModified
| Constructor Detail |
|---|
public DefaultEditor()
| Method Detail |
|---|
public void addDocumentListener(DocumentListener listener)
EditorInterface
addDocumentListener in interface EditorInterfacelistener - listenerpublic void removeDocumentListener(DocumentListener listener)
EditorInterface
removeDocumentListener in interface EditorInterfacelistener - listenerpublic void addCaretListener(CaretListener listener)
EditorInterface
addCaretListener in interface EditorInterfacelistener - listenerpublic void removeCaretListener(CaretListener listener)
EditorInterface
removeCaretListener in interface EditorInterfacelistener - listenerpublic boolean accept(File file)
EditorInterfacetrue.
accept in interface EditorInterfacefile - file to test
true, this editor support this file type.public boolean isModified()
EditorInterface
isModified in interface EditorInterfacetrue if current file is modifiedpublic boolean open(File file)
EditorInterface
open in interface EditorInterfacefile - the file to open
public boolean saveAs(File file)
EditorInterface
saveAs in interface EditorInterfacefile - the file to open
public String getText()
EditorInterfaceString.
getText in interface EditorInterfaceStringpublic void setText(String text)
EditorInterface
setText in interface EditorInterfacetext - test to setpublic void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListenerpublic void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenerpublic void copy()
EditorInterface
copy in interface EditorInterfacepublic void cut()
EditorInterface
cut in interface EditorInterfacepublic void paste()
EditorInterface
paste in interface EditorInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||