当前位置: 首页>>代码示例>>Java>>正文


Java JTextComponent.removeCaretListener方法代码示例

本文整理汇总了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();

}
 
开发者ID:Thecarisma,项目名称:powertext,代码行数:22,代码来源:ParameterizedCompletionContext.java

示例2: unregister

import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
private void unregister() {
    JTextComponent comp = getComponent(); 
    if (comp == null) {
        return;
    }
    comp.removeKeyListener (this);
    comp.removeCaretListener(this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:HintsUI.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:POMModelPanel.java

示例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);
                }
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:EventSupport.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:NavigatorContent.java

示例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;

}
 
开发者ID:Thecarisma,项目名称:powertext,代码行数:41,代码来源:AutoCompletePopupWindow.java

示例7: onDispose

import javax.swing.text.JTextComponent; //导入方法依赖的package包/类
@Override
protected void onDispose(JTextComponent w) {
    w.removeCaretListener(this);
}
 
开发者ID:akarnokd,项目名称:RxJava2Swing,代码行数:5,代码来源:CaretEventObservable.java


注:本文中的javax.swing.text.JTextComponent.removeCaretListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。