本文整理了Java中javax.swing.text.StyledDocument.addDocumentListener()
方法的一些代码示例,展示了StyledDocument.addDocumentListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StyledDocument.addDocumentListener()
方法的具体详情如下:
包路径:javax.swing.text.StyledDocument
类名称:StyledDocument
方法名:addDocumentListener
暂无
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-insync
private void addDocumentListener() {
if (styledDocument != null && documentListenerAdded.compareAndSet(false, true)) {
styledDocument.addDocumentListener(this);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf
public void propertyChange(PropertyChangeEvent evt) {
StyledDocument doc = getDocument();
if (EditorCookie.Observable.PROP_DOCUMENT.equals(evt.getPropertyName())
&& isDocumentLoaded() && doc != null) {
doc.addDocumentListener(docListener);
}
}
});
代码示例来源:origin: ontop/ontop
private void prepareTextPane() {
resetStyles();
parent.setBorder(null);
parent.getStyledDocument().addDocumentListener(
new DocumentListener() {
@Override public void insertUpdate(DocumentEvent e) { handleDocumentUpdated(); }
@Override public void removeUpdate(DocumentEvent e) { handleDocumentUpdated(); }
@Override public void changedUpdate(DocumentEvent e) { /* NO-OP */ }
}
);
}
代码示例来源:origin: org.netbeans.api/org-openide-text
/** Creates new LineListener */
public LineListener(StyledDocument doc, CloneableEditorSupport support) {
this.struct = new LineStruct();
root = NbDocument.findLineRootElement(doc);
orig = lines = root.getElementCount();
this.support = support;
doc.addDocumentListener(WeakListeners.document(this, doc));
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/** Creates new LineListener */
public LineListener (StyledDocument doc, CloneableEditorSupport support) {
this.doc = doc;
this.struct = new LineStruct ();
root = NbDocument.findLineRootElement (doc);
orig = lines = root.getElementCount ();
this.support = support;
doc.addDocumentListener(org.openide.util.WeakListeners.document (this, doc));
}
代码示例来源:origin: Wimmics/corese
@Override
public void redo()
{
editor.getStyledDocument().addDocumentListener( this );
super.redo();
editor.getStyledDocument().removeDocumentListener( this );
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/** Creates new LineListener */
public LineListener (StyledDocument doc, CloneableEditorSupport support) {
this.doc = doc;
this.struct = new LineStruct ();
root = NbDocument.findLineRootElement (doc);
orig = lines = root.getElementCount ();
this.support = support;
doc.addDocumentListener(org.openide.util.WeakListeners.document (this, doc));
}
代码示例来源:origin: fr.inria.wimmics/kggui
@Override
public void redo()
{
editor.getStyledDocument().addDocumentListener( this );
super.redo();
editor.getStyledDocument().removeDocumentListener( this );
}
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
doc.addDocumentListener(new DocumentListener()
代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing
doc.addDocumentListener(new DocumentListener()
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public void run() {
try {
doc.removeDocumentListener(getListener());
doc.remove(0, doc.getLength()); // remove all text
doc.addDocumentListener(getListener());
} catch(BadLocationException ble) {
ErrorManager.getDefault().notify(
ErrorManager.INFORMATIONAL, ble);
}
}
});
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
public void run() {
try {
doc.removeDocumentListener(getListener());
doc.remove(0, doc.getLength()); // remove all text
doc.addDocumentListener(getListener());
} catch(BadLocationException ble) {
ErrorManager.getDefault().notify(
ErrorManager.INFORMATIONAL, ble);
}
}
});
代码示例来源:origin: ontop/ontop
public SQLQueryPainter(JTextPane parent) {
this.doc = parent.getStyledDocument();
this.parent = parent;
prepareStyles();
setupFont();
prepareTextPane();
docListener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
handleDocumentUpdated();
}
@Override
public void removeUpdate(DocumentEvent e) {
handleDocumentUpdated();
}
@Override
public void changedUpdate(DocumentEvent e) {
// NO-OP
}
};
parent.getStyledDocument().addDocumentListener(docListener);
timer = new Timer(200, new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleTimer();
}
});
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
doc.addDocumentListener(getListener());
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
doc.addDocumentListener(getListener());
代码示例来源:origin: mars-sim/mars-sim
terminal.getDocument().addDocumentListener(new DocumentListener() {
@Override public void removeUpdate(DocumentEvent e) {choiceIndex = -1;}
@Override public void insertUpdate(DocumentEvent e) {choiceIndex = -1;}
代码示例来源:origin: com.davidbracewell/hermes-core
lines.setDisabledTextColor(Color.DARK_GRAY);
lines.setFont(new Font(Font.MONOSPACED, Font.PLAIN, editorPane.getFont().getSize()));
editorPane.getStyledDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent de) {
代码示例来源:origin: org.netbeans.api/org-openide-text
NbDocument.markError(doc, pos.getOffset());
doc.addDocumentListener(docL = org.openide.util.WeakListeners.document(listener, doc));
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/** Refreshes the current line.
*
* @deprecated since 1.20. */
synchronized void refreshState () {
StyledDocument doc = pos.getCloneableEditorSupport ().getDocument ();
if (doc != null) {
// the document is in memory, mark the state
if (docL != null) {
doc.removeDocumentListener (docL);
}
// error line
if (error) {
NbDocument.markError (doc, pos.getOffset ());
doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc));
return;
}
// current line
if (current) {
NbDocument.markCurrent (doc, pos.getOffset ());
return;
}
// breakpoint line
if (breakpoint) {
NbDocument.markBreakpoint (doc, pos.getOffset ());
return;
}
NbDocument.markNormal (doc, pos.getOffset ());
return;
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/** Refreshes the current line.
*
* @deprecated since 1.20. */
synchronized void refreshState () {
StyledDocument doc = pos.getCloneableEditorSupport ().getDocument ();
if (doc != null) {
// the document is in memory, mark the state
if (docL != null) {
doc.removeDocumentListener (docL);
}
// error line
if (error) {
NbDocument.markError (doc, pos.getOffset ());
doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc));
return;
}
// current line
if (current) {
NbDocument.markCurrent (doc, pos.getOffset ());
return;
}
// breakpoint line
if (breakpoint) {
NbDocument.markBreakpoint (doc, pos.getOffset ());
return;
}
NbDocument.markNormal (doc, pos.getOffset ());
return;
}
}
内容来源于网络,如有侵权,请联系作者删除!