@Override public void run() { tts.setToolTipVisible(false); } }
public void run() { String oldText = toolTipText; toolTipText = text; firePropertyChange(PROP_TOOL_TIP_TEXT, oldText, toolTipText); if (toolTipText != null) { JTextArea ta = createTextToolTip(); ta.setText(toolTipText); setToolTip(ta); } else { // null text if (status == STATUS_TEXT_VISIBLE) { setToolTipVisible(false); } } } });
public ToolTipSupport getToolTipSupport() { if (toolTipSupport == null) { toolTipSupport = new ToolTipSupport(this); } return toolTipSupport; }
/** * @return the component that either contains the tooltip or is responsible * for displaying of text tooltips. */ public final JComponent getToolTip() { if (toolTip == null) { setToolTip(createDefaultToolTip()); } return toolTip; }
public void setToolTip(JComponent toolTip, PopupManager.HorizontalBounds horizontalBounds, PopupManager.Placement placement, int horizontalAdjustment, int verticalAdjustment) { JComponent oldToolTip = this.toolTip; this.toolTip = toolTip; this.horizontalBounds = horizontalBounds; this.placement = placement; this.horizontalAdjustment = horizontalAdjustment; this.verticalAdjustment = verticalAdjustment; if (status >= STATUS_VISIBILITY_ENABLED) { ensureVisibility(); } firePropertyChange(PROP_TOOL_TIP, oldToolTip, this.toolTip); }
/** Set whether the tooltip support is enabled. If it's * disabled the tooltip does not become visible. * @param enabled whether the tooltip will be enabled or not. */ public void setEnabled(boolean enabled) { if (enabled != this.enabled) { this.enabled = enabled; firePropertyChange(PROP_ENABLED, enabled ? Boolean.FALSE : Boolean.TRUE, enabled ? Boolean.TRUE : Boolean.FALSE ); if (!enabled) { setToolTipVisible(false); } } }
/** * Set the tooltip text to make the tooltip to be shown on the screen. * * @param text * tooltip text to be displayed. */ public void setToolTipText(String text) { String oldText = toolTipText; toolTipText = text; firePropertyChange(PROP_TOOL_TIP_TEXT, oldText, toolTipText); applyToolTipText(); if (toolTipText != null) { if (status >= STATUS_VISIBILITY_ENABLED) { ensureVisibility(); } } else { // null text if (status == STATUS_TEXT_VISIBLE) { setToolTipVisible(false); } } }
disableSwingToolTip(component); focusGained(new FocusEvent(component, FocusEvent.FOCUS_GAINED)); gg.removeMouseMotionListener(this); setToolTipVisible(false); disableSwingToolTip(component); componentToolTipTextChanged(evt);
@Override protected void handleToolTipClose(DebuggerEngine engine, ToolTipSupport tts) { JPDADebugger d = engine.lookupFirst(null, JPDADebugger.class); if (d == null) { return ; } PropertyChangeListener l = (PropertyChangeEvent evt) -> { int state = ((Integer) evt.getNewValue()); if (JPDADebugger.STATE_DISCONNECTED == state || JPDADebugger.STATE_RUNNING == state) { SwingUtilities.invokeLater(() -> tts.setToolTipVisible(false) ); } }; d.addPropertyChangeListener(JPDADebugger.PROP_STATE, l); tts.addPropertyChangeListener(pl -> { if (ToolTipSupport.PROP_STATUS.equals(pl.getPropertyName()) && !tts.isToolTipVisible()) { d.removePropertyChangeListener(JPDADebugger.PROP_STATE, l); } }); }
public void setToolTip(JComponent toolTip, PopupManager.HorizontalBounds horizontalBounds, PopupManager.Placement placement) { setToolTip(toolTip, PopupManager.ViewPortBounds, PopupManager.AbovePreferred, 0, 0); }
public void propertyChange(PropertyChangeEvent evt) { String propName = evt.getPropertyName(); if (extEditorUI.COMPONENT_PROPERTY.equals(propName)) { JTextComponent component = (JTextComponent) evt.getNewValue(); if (component != null) { // just installed component.addPropertyChangeListener(this); component.addComponentListener(componentL); checkAddToPane(); disableSwingToolTip(component); component.addFocusListener(this); if (component.hasFocus()) { focusGained(new FocusEvent(component, FocusEvent.FOCUS_GAINED)); } } else { // just deinstalled component = (JTextComponent) evt.getOldValue(); component.removeFocusListener(this); component.removePropertyChangeListener(this); component.removeComponentListener(componentL); checkRemoveFromPane(component); } } if (JComponent.TOOL_TIP_TEXT_KEY.equals(propName)) { JComponent component = (JComponent) evt.getSource(); disableSwingToolTip(component); componentToolTipTextChanged(evt); } }
/** * Set the tooltip component. It can be called either to set the custom * component that will display the text tooltips or to display the generic * component with the tooltip after the tooltip timer has fired. * * @param toolTip * component that either contains the tooltip or that will * display a text tooltip. */ public void setToolTip(JComponent toolTip) { if (this.toolTip != toolTip) { JComponent oldToolTip = this.toolTip; checkRemoveFromPane(extEditorUI.getComponent()); this.toolTip = toolTip; checkAddToPane(); if (status >= STATUS_VISIBILITY_ENABLED) { ensureVisibility(); } firePropertyChange(PROP_TOOL_TIP, oldToolTip, this.toolTip); } }
private void setStatus(int status) { if (this.status != status) { int oldStatus = this.status; this.status = status; firePropertyChange(PROP_STATUS, new Integer(oldStatus), new Integer(this.status)); } }
static void attach(JPDADebugger d, ToolTipSupport tts) { DebuggerStateChangeListener dscl = new DebuggerStateChangeListener(tts); d.addPropertyChangeListener(JPDADebugger.PROP_STATE, dscl); tts.addPropertyChangeListener(propListener -> { if (ToolTipSupport.PROP_STATUS.equals(propListener.getPropertyName()) && !tts.isToolTipVisible()) { d.removePropertyChangeListener(JPDADebugger.PROP_STATE, dscl); } }); }
/** * Set whether the tooltip support is enabled. If it's disabled the tooltip * does not become visible. * * @param enabled * whether the tooltip will be enabled or not. */ public void setEnabled(boolean enabled) { if (enabled != this.enabled) { this.enabled = enabled; firePropertyChange(PROP_ENABLED, enabled ? Boolean.FALSE : Boolean.TRUE, enabled ? Boolean.TRUE : Boolean.FALSE); if (!enabled) { setToolTipVisible(false); } } }
/** Set the tooltip component. * It can be called either to set the custom component * that will display the text tooltips or to display * the generic component with the tooltip after * the tooltip timer has fired. * @param toolTip component that either contains the tooltip * or that will display a text tooltip. */ public void setToolTip(JComponent toolTip) { setToolTip(toolTip, PopupManager.ViewPortBounds, PopupManager.AbovePreferred); }
/** @return the component that either contains the tooltip * or is responsible for displaying of text tooltips. */ public final JComponent getToolTip() { if (toolTip == null) { setToolTip(createDefaultToolTip()); } return toolTip; }
private void setStatus(int status) { if (this.status != status) { int oldStatus = this.status; this.status = status; firePropertyChange(PROP_STATUS, new Integer(oldStatus), new Integer(this.status)); } }
public void mousePressed(MouseEvent evt) { lastMouseEvent = evt; setToolTipVisible(false); }
public void showTooltip() { final JEditorPane ep = EditorContextDispatcher.getDefault().getMostRecentEditor(); final EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(ep); final ToolTipSupport toolTipSupport = eui.getToolTipSupport(); toolTipSupport.setToolTip(this, PopupManager.ViewPortBounds, PopupManager.AbovePreferred, 0, 0, ToolTipSupport.FLAGS_HEAVYWEIGHT_TOOLTIP); }