本文整理汇总了Java中javax.swing.text.JTextComponent.removeCaretListener方法的典型用法代码示例。如果您正苦于以下问题:Java JTextComponent.removeCaretListener方法的具体用法?Java JTextComponent.removeCaretListener怎么用?Java JTextComponent.removeCaretListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.text.JTextComponent
的用法示例。
在下文中一共展示了JTextComponent.removeCaretListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: uninstall
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
/**
* Uninstalls this listener from the current text component.
*/
public void uninstall() {
JTextComponent tc = ac.getTextComponent();
tc.removeCaretListener(this);
tc.removeFocusListener(this);
tc.getDocument().removeDocumentListener(this);
uninstallKeyBindings();
if (markOccurrencesEnabled) {
((RSyntaxTextArea)tc).setMarkOccurrences(markOccurrencesEnabled);
}
// Remove WeakReferences in javax.swing.text.
maxPos = null;
minPos = -1;
removeParameterHighlights();
}
示例2: unregister
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
private void unregister() {
JTextComponent comp = getComponent();
if (comp == null) {
return;
}
comp.removeKeyListener (this);
comp.removeCaretListener(this);
}
示例3: cleanup
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
void cleanup() {
if (current != null) {
current.getPrimaryFile().removeFileChangeListener(adapter);
}
JTextComponent cc = currentComponent != null ? currentComponent.get() : null;
if (cc != null) {
cc.removeCaretListener(this);
}
}
示例4: editorRegistryChanged
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
private void editorRegistryChanged() {
final JTextComponent editor = EditorRegistry.lastFocusedComponent();
final JTextComponent lastEditor = lastEditorRef == null ? null : lastEditorRef.get();
if (lastEditor != editor && (editor == null || editor.getClientProperty("AsTextField") == null)) {
if (lastEditor != null) {
lastEditor.removeCaretListener(this);
lastEditor.removePropertyChangeListener(this);
k24.set(false);
}
lastEditorRef = new WeakReference<JTextComponent>(editor);
if (editor != null) {
editor.addCaretListener(this);
editor.addPropertyChangeListener(this);
}
final JTextComponent focused = EditorRegistry.focusedComponent();
if (focused != null) {
final Document doc = editor.getDocument();
final String mimeType = DocumentUtilities.getMimeType (doc);
if (doc != null && mimeType != null) {
final Source source = Source.create (doc);
if (source != null) {
((EventSupport)SourceEnvironment.forSource(source)).resetState(true, false, -1, -1, true);
}
}
}
}
}
示例5: editorReleased
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
private void editorReleased() {
Reference<JTextComponent> jte = activeEditor;
if (jte == null) {
return;
}
JTextComponent c = jte.get();
if (c == null) {
return;
}
c.removeCaretListener(wCaretL);
wCaretL = null;
}
示例6: uninstallKeyBindings
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
/**
* Stops intercepting certain keystrokes from the text component.
*
* @see #installKeyBindings()
*/
private void uninstallKeyBindings() {
if (AutoCompletion.getDebug()) {
System.out.println("PopupWindow: Removing keybindings");
}
if (!keyBindingsInstalled) {
return;
}
JTextComponent comp = ac.getTextComponent();
InputMap im = comp.getInputMap();
ActionMap am = comp.getActionMap();
putBackAction(im, am, KeyEvent.VK_ESCAPE, oldEscape);
putBackAction(im, am, KeyEvent.VK_UP, oldUp);
putBackAction(im, am, KeyEvent.VK_DOWN, oldDown);
putBackAction(im, am, KeyEvent.VK_LEFT, oldLeft);
putBackAction(im, am, KeyEvent.VK_RIGHT, oldRight);
putBackAction(im, am, KeyEvent.VK_ENTER, oldEnter);
putBackAction(im, am, KeyEvent.VK_TAB, oldTab);
putBackAction(im, am, KeyEvent.VK_HOME, oldHome);
putBackAction(im, am, KeyEvent.VK_END, oldEnd);
putBackAction(im, am, KeyEvent.VK_PAGE_UP, oldPageUp);
putBackAction(im, am, KeyEvent.VK_PAGE_DOWN, oldPageDown);
// Ctrl+C
KeyStroke ks = getCopyKeyStroke();
am.put(im.get(ks), oldCtrlC.action); // Original action
im.put(ks, oldCtrlC.key); // Original key
comp.removeCaretListener(this);
keyBindingsInstalled = false;
}
示例7: onDispose
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
@Override
protected void onDispose(JTextComponent w) {
w.removeCaretListener(this);
}