/** Construct new word match over given view manager */ public WordMatch(EditorUI editorUI) { this.editorUI = editorUI; Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
public Abbrev(EditorUI editorUI, boolean checkDocText, boolean checkTextDelimiter) { this.editorUI = editorUI; this.checkDocText = checkDocText; this.checkTextDelimiter = checkTextDelimiter; Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
/** Construct new word match over given view manager */ public WordMatch(EditorUI editorUI) { this.editorUI = editorUI; Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
public Abbrev(EditorUI editorUI, boolean checkDocText, boolean checkTextDelimiter) { this.editorUI = editorUI; this.checkDocText = checkDocText; this.checkTextDelimiter = checkTextDelimiter; Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
public StatusBar(EditorUI editorUI) { this.editorUI = editorUI; caretDelay = 10; caretL = new CaretListener(caretDelay); insText = LocaleSupport.getString(INSERT_LOCALE); ovrText = LocaleSupport.getString(OVERWRITE_LOCALE); Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
public StatusBar(EditorUI editorUI) { this.editorUI = editorUI; caretDelay = 10; caretL = new CaretListener(caretDelay); insText = LocaleSupport.getString(INSERT_LOCALE); ovrText = LocaleSupport.getString(OVERWRITE_LOCALE); caretPositionLocaleString = LocaleSupport.getString("status-bar-caret-position"); //NOI18N insertModeLocaleString = LocaleSupport.getString("status-bar-insert-mode"); //NOI18N overwriteModeLocaleString = LocaleSupport.getString("status-bar-overwrite-mode"); //NOI18N Settings.addSettingsChangeListener(this); synchronized (editorUI.getComponentLock()) { // if component already installed in EditorUI simulate installation JTextComponent component = editorUI.getComponent(); if (component != null) { propertyChange(new PropertyChangeEvent(editorUI, EditorUI.COMPONENT_PROPERTY, null, component)); } editorUI.addPropertyChangeListener(this); } }
/** * Called when the <tt>BaseTextUI</tt> is being uninstalled from the * component. */ protected void uninstallUI(JTextComponent c) { synchronized (getComponentLock()) { // fix for issue 12996 if (component != null) { // stop listening on caret Caret caret = component.getCaret(); if (caret != null) { caret.removeChangeListener(this); } // stop listening on component component.removePropertyChangeListener(this); component.removeFocusListener(focusL); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(doc, null); } component = null; putProperty(COMPONENT_PROPERTY, null); // Clear the font-metrics cache FontMetricsCache.clear(); } }
/** Called when the <tt>BaseTextUI</tt> is being uninstalled * from the component. */ protected void uninstallUI(JTextComponent c) { synchronized (getComponentLock()) { // fix for issue 12996 if (component != null) { // stop listening on caret Caret caret = component.getCaret(); if (caret != null) { caret.removeChangeListener(this); } // stop listening on component component.removePropertyChangeListener(this); component.removeFocusListener(focusL); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(doc, null); } component = null; putProperty(COMPONENT_PROPERTY, null); // Clear the font-metrics cache FontMetricsCache.clear(); } }
/** Called when the <tt>BaseTextUI</tt> is being installed * into the component. */ protected void installUI(JTextComponent c) { synchronized (getComponentLock()) { this.component = c; putProperty(COMPONENT_PROPERTY, c); // listen on component component.addPropertyChangeListener(this); component.addFocusListener(focusL); // listen on caret Caret caret = component.getCaret(); if (caret != null) { caret.addChangeListener(this); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(null, doc); } } // Make sure all the things depending on non-null component will be updated settingsChange(null); // fix for issue #16352 getDefaultColoring().apply(component); }
/** * Called when the <tt>BaseTextUI</tt> is being installed into the * component. */ protected void installUI(JTextComponent c) { synchronized (getComponentLock()) { this.component = c; putProperty(COMPONENT_PROPERTY, c); // listen on component component.addPropertyChangeListener(this); component.addFocusListener(focusL); // listen on caret Caret caret = component.getCaret(); if (caret != null) { caret.addChangeListener(this); } BaseDocument doc = getDocument(); if (doc != null) { modelChanged(null, doc); } } // Make sure all the things depending on non-null component will be // updated settingsChange(null); // fix for issue #16352 getDefaultColoring().apply(component); }