Java Code Examples for javax.swing.text.JTextComponent#removeMouseListener()

The following examples show how to use javax.swing.text.JTextComponent#removeMouseListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditorCaret.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void deinstall(JTextComponent c) {
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("EditorCaret.deinstall: Deinstalling from " + s2s(c) + "\n"); //NOI18N
    }
    
    synchronized (listenerList) {
        if (blinkTimer != null) {
            setBlinkRate(0);
        }
    }
    
    c.removeComponentListener(listenerImpl);
    c.removePropertyChangeListener(listenerImpl);
    c.removeFocusListener(listenerImpl);
    c.removeMouseListener(listenerImpl);
    c.removeMouseMotionListener(listenerImpl);
    ViewHierarchy.get(c).removeViewHierarchyListener(listenerImpl);

    
    modelChanged(activeDoc, null);
}
 
Example 2
Source File: DarkTextFieldUI.java    From darklaf with MIT License 5 votes vote down vote up
@Override
protected void uninstallListeners() {
    JTextComponent c = getComponent();
    c.removeMouseListener(this);
    c.removeMouseMotionListener(mouseMotionListener);
    c.removeKeyListener(keyListener);
}
 
Example 3
Source File: BaseCaret.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Called when UI is being removed from JTextComponent */
@Override
@SuppressWarnings("NestedSynchronizedStatement")
public void deinstall(JTextComponent c) {
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Deinstalling from " + s2s(c)); //NOI18N
    }
    
    component = null; // invalidate
    caretBounds = null;

    // No idea why the sync is done the way how it is, but the locks must
    // always be acquired in the same order otherwise the code will deadlock
    // sooner or later. See #100734
    synchronized (this) {
        synchronized (listenerImpl) {
            if (flasher != null) {
                setBlinkRate(0);
            }
        }
    }
    
    c.removeComponentListener(listenerImpl);
    c.removePropertyChangeListener(this);
    c.removeFocusListener(listenerImpl);
    c.removeMouseListener(this);
    c.removeMouseMotionListener(this);
    ViewHierarchy.get(c).removeViewHierarchyListener(listenerImpl);

    
    EditorUI editorUI = Utilities.getEditorUI(c);
    editorUI.removePropertyChangeListener(this);

    modelChanged(listenDoc, null);
}
 
Example 4
Source File: DarculaTextFieldUI.java    From Darcula with Apache License 2.0 5 votes vote down vote up
@Override
protected void uninstallListeners() {
  final JTextComponent c = getComponent();
  c.removeMouseListener(myMouseListener);
  c.removeMouseMotionListener(myMouseMotionListener);
  c.removeFocusListener(myFocusListener);
  super.uninstallListeners();
}
 
Example 5
Source File: CurrentLineHighlighter.java    From nextreports-designer with Apache License 2.0 5 votes vote down vote up
public static void uninstall(JTextComponent c) { 
    c.putClientProperty(LINE_HIGHLIGHT, null); 
    c.putClientProperty(PREVIOUS_CARET, null); 
    c.removeCaretListener(caretListener); 
    c.removeMouseListener(mouseListener); 
    c.removeMouseMotionListener(mouseListener); 
}
 
Example 6
Source File: CaretFloatingPointAPITest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void deinstall(JTextComponent c) {
    c.removeMouseListener(mouseListener);
    this.component = null;
}
 
Example 7
Source File: CaretFloatingPointAPITest.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void deinstall(JTextComponent c) {
    c.removeMouseListener(mouseListener);
    this.component = null;
}
 
Example 8
Source File: TextComponentPopupMenu.java    From xtunnel with GNU General Public License v2.0 4 votes vote down vote up
public static void uninstallFromComponent(JTextComponent c) {
	if (c instanceof JTextField && !(c instanceof JPasswordField)) {
		c.removeMouseListener(getSharedInstance());
	}
}