/** * Makes the bar visible and sensitive to * LogOutoutListener events that should deliver * actual content to be displayed. */ public void annotate() { annotated = true; elementAnnotations = Collections.<Element, AnnotateLine>emptyMap(); doc.addDocumentListener(this); textComponent.addComponentListener(this); editorUI.addPropertyChangeListener(this); revalidate(); // resize the component }
/** 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); } }
/** 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 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); } }
public void setParent(View parent) { if (parent != null) { // start listening JTextComponent component = (JTextComponent)parent.getContainer(); foldHierarchy = FoldHierarchy.get(component); foldHierarchy.addFoldHierarchyListener(this); TextUI tui = component.getUI(); if (tui instanceof BaseTextUI){ editorUI = ((BaseTextUI)tui).getEditorUI(); if (editorUI!=null){ editorUI.addPropertyChangeListener(this); } } } super.setParent(parent); if (parent == null) { foldHierarchy.removeFoldHierarchyListener(this); foldHierarchy = null; if (editorUI!=null){ editorUI.removePropertyChangeListener(this); editorUI = null; } } }
/** Called when UI is being installed into JTextComponent */ public void install(JTextComponent c) { component = c; component.addPropertyChangeListener(this); focusListener = new FocusHandler(this); component.addFocusListener(focusListener); component.addMouseListener(this); component.addMouseMotionListener(this); EditorUI editorUI = Utilities.getEditorUI(component); editorUI.addLayer(new DrawLayerFactory.CaretLayer(), DrawLayerFactory.CARET_LAYER_VISIBILITY); caretMark.setEditorUI(editorUI); selectionMark.setEditorUI(editorUI); editorUI.addPropertyChangeListener(this); BaseDocument doc = Utilities.getDocument(c); if (doc != null) { modelChanged(null, doc); } if (component.hasFocus()) { focusGained(null); // emulate focus gained if (debugCaretFocus) { System.err.println("Component has focus, calling focusGained() on doc=" + component.getDocument().getProperty(Document.TitleProperty)); } } }
caretMark.setEditorUI(editorUI); selectionMark.setEditorUI(editorUI); editorUI.addPropertyChangeListener( this );
public GlyphGutter(EditorUI editorUI) { super(); this.editorUI = editorUI; init = false; doc = editorUI.getDocument(); annos = doc.getAnnotations(); // Annotations class is model for this view, so the listener on changes in // Annotations must be added here annos.addAnnotationsListener(this); // do initialization init(); update(); Settings.addSettingsChangeListener(this); setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); foldHierarchy = FoldHierarchy.get(editorUI.getComponent()); glyphGutterFoldHierarchyListener = new GlyphGutterFoldHierarchyListener(); foldHierarchy.addFoldHierarchyListener(glyphGutterFoldHierarchyListener); editorUIListener = new EditorUIListener(); editorUI.addPropertyChangeListener(editorUIListener); updateRenderingHints(); setOpaque (true); }