javax.swing.text.StyledDocument.removeDocumentListener()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中javax.swing.text.StyledDocument.removeDocumentListener()方法的一些代码示例,展示了StyledDocument.removeDocumentListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StyledDocument.removeDocumentListener()方法的具体详情如下:
包路径:javax.swing.text.StyledDocument
类名称:StyledDocument
方法名:removeDocumentListener

StyledDocument.removeDocumentListener介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-insync

  1. private void removeDocumentListener() {
  2. if (styledDocument != null && documentListenerAdded.compareAndSet(true, false)) {
  3. styledDocument.removeDocumentListener(this);
  4. }
  5. }

代码示例来源:origin: Wimmics/corese

  1. @Override
  2. public void redo()
  3. {
  4. editor.getStyledDocument().addDocumentListener( this );
  5. super.redo();
  6. editor.getStyledDocument().removeDocumentListener( this );
  7. }

代码示例来源:origin: fr.inria.wimmics/kggui

  1. @Override
  2. public void redo()
  3. {
  4. editor.getStyledDocument().addDocumentListener( this );
  5. super.redo();
  6. editor.getStyledDocument().removeDocumentListener( this );
  7. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public void run() {
  2. try {
  3. doc.removeDocumentListener(getListener());
  4. doc.remove(0, doc.getLength()); // remove all text
  5. doc.addDocumentListener(getListener());
  6. } catch(BadLocationException ble) {
  7. ErrorManager.getDefault().notify(
  8. ErrorManager.INFORMATIONAL, ble);
  9. }
  10. }
  11. });

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public void run() {
  2. try {
  3. doc.removeDocumentListener(getListener());
  4. doc.remove(0, doc.getLength()); // remove all text
  5. doc.addDocumentListener(getListener());
  6. } catch(BadLocationException ble) {
  7. ErrorManager.getDefault().notify(
  8. ErrorManager.INFORMATIONAL, ble);
  9. }
  10. }
  11. });

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. doc.removeDocumentListener(getListener());
  2. try {
  3. loadExc = null;

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. doc.removeDocumentListener(getListener());
  2. try {
  3. loadExc = null;

代码示例来源:origin: org.netbeans.api/org-openide-text

  1. doc.removeDocumentListener(docL);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** Is called under getLock () to close the document.
  2. */
  3. private void doCloseDocument () {
  4. prepareTask = null;
  5. // notifies the support that
  6. env ().removePropertyChangeListener(getListener());
  7. notifyUnmodified ();
  8. if (doc != null) {
  9. doc.removeUndoableEditListener (getUndoRedo ());
  10. doc.removeDocumentListener(getListener());
  11. }
  12. if (positionManager != null) {
  13. positionManager.documentClosed ();
  14. documentStatus = DOCUMENT_NO;
  15. fireDocumentChange(doc, true);
  16. }
  17. documentStatus = DOCUMENT_NO;
  18. doc = null;
  19. kit = null;
  20. getUndoRedo().discardAllEdits();
  21. updateLineSet (true);
  22. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** Is called under getLock () to close the document.
  2. */
  3. private void doCloseDocument () {
  4. prepareTask = null;
  5. // notifies the support that
  6. env ().removePropertyChangeListener(getListener());
  7. notifyUnmodified ();
  8. if (doc != null) {
  9. doc.removeUndoableEditListener (getUndoRedo ());
  10. doc.removeDocumentListener(getListener());
  11. }
  12. if (positionManager != null) {
  13. positionManager.documentClosed ();
  14. documentStatus = DOCUMENT_NO;
  15. fireDocumentChange(doc, true);
  16. }
  17. documentStatus = DOCUMENT_NO;
  18. doc = null;
  19. kit = null;
  20. getUndoRedo().discardAllEdits();
  21. updateLineSet (true);
  22. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** Refreshes the current line.
  2. *
  3. * @deprecated since 1.20. */
  4. synchronized void refreshState () {
  5. StyledDocument doc = pos.getCloneableEditorSupport ().getDocument ();
  6. if (doc != null) {
  7. // the document is in memory, mark the state
  8. if (docL != null) {
  9. doc.removeDocumentListener (docL);
  10. }
  11. // error line
  12. if (error) {
  13. NbDocument.markError (doc, pos.getOffset ());
  14. doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc));
  15. return;
  16. }
  17. // current line
  18. if (current) {
  19. NbDocument.markCurrent (doc, pos.getOffset ());
  20. return;
  21. }
  22. // breakpoint line
  23. if (breakpoint) {
  24. NbDocument.markBreakpoint (doc, pos.getOffset ());
  25. return;
  26. }
  27. NbDocument.markNormal (doc, pos.getOffset ());
  28. return;
  29. }
  30. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** Refreshes the current line.
  2. *
  3. * @deprecated since 1.20. */
  4. synchronized void refreshState () {
  5. StyledDocument doc = pos.getCloneableEditorSupport ().getDocument ();
  6. if (doc != null) {
  7. // the document is in memory, mark the state
  8. if (docL != null) {
  9. doc.removeDocumentListener (docL);
  10. }
  11. // error line
  12. if (error) {
  13. NbDocument.markError (doc, pos.getOffset ());
  14. doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc));
  15. return;
  16. }
  17. // current line
  18. if (current) {
  19. NbDocument.markCurrent (doc, pos.getOffset ());
  20. return;
  21. }
  22. // breakpoint line
  23. if (breakpoint) {
  24. NbDocument.markBreakpoint (doc, pos.getOffset ());
  25. return;
  26. }
  27. NbDocument.markNormal (doc, pos.getOffset ());
  28. return;
  29. }
  30. }

相关文章