@Override public void windowLostFocus(WindowEvent e) { ft.possiblyDisposeOfTipWindow(); } });
private void handleComponentEvent(ComponentEvent e) { possiblyDisposeOfTipWindow(); }
@Override public void keyPressed(KeyEvent e) { if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { TipWindow.this.ft.possiblyDisposeOfTipWindow(); } } };
@Override public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType()==HyperlinkEvent.EventType.ACTIVATED) { TipWindow.this.ft.possiblyDisposeOfTipWindow(); } } });
@Override public void mouseMoved(MouseEvent e) { if (tipVisibleBounds==null || !tipVisibleBounds.contains(e.getPoint())) { possiblyDisposeOfTipWindow(); } }
public void toolTipRequested(MouseEvent e, String text) { if (text==null || text.length()==0) { possiblyDisposeOfTipWindow(); lastText = text; return; } if (lastText==null || text.length()!=lastText.length() || !text.equals(lastText)) { possiblyDisposeOfTipWindow(); createAndShowTipWindow(e, text); } }
@Override public void caretUpdate(CaretEvent e) { Object source = e.getSource(); if (source == textArea) { possiblyDisposeOfTipWindow(); } }
@Override public void focusLost(FocusEvent e) { // Only dispose of tip if it wasn't the TipWindow that was clicked // "c" can be null, at least on OS X, so we must check that before // calling SwingUtilities.getWindowAncestor() to guard against an // NPE. Component c = e.getOppositeComponent(); boolean tipClicked = (c instanceof TipWindow) || (c!=null && SwingUtilities.getWindowAncestor(c) instanceof TipWindow); if (!tipClicked) { possiblyDisposeOfTipWindow(); } }
@Override public void mouseExited(MouseEvent e) { // Since we registered this listener on the child components of // the JWindow, not the JWindow iteself, we have to be careful. Component source = (Component)e.getSource(); Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, source); if (!TipWindow.this.getBounds().contains(p)) { ft.possiblyDisposeOfTipWindow(); } }
@Override public void keyPressed(KeyEvent e) { if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { possiblyDisposeOfTipWindow(); } else if (e.getKeyCode()==KeyEvent.VK_F2) { if (tipWindow!=null && !tipWindow.getFocusableWindowState()) { tipWindow.actionPerformed(null); e.consume(); // Don't do bookmarking stuff } } }
@Override public void windowLostFocus(WindowEvent e) { ft.possiblyDisposeOfTipWindow(); } });
@Override public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType()==HyperlinkEvent.EventType.ACTIVATED) { TipWindow.this.ft.possiblyDisposeOfTipWindow(); } } });
public void keyPressed(KeyEvent e) { if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { TipWindow.this.ft.possiblyDisposeOfTipWindow(); } } };
@Override public void keyPressed(KeyEvent e) { if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { TipWindow.this.ft.possiblyDisposeOfTipWindow(); } } };
focusableTip.possiblyDisposeOfTipWindow();
public void mouseMoved(MouseEvent e) { if (tipVisibleBounds==null || !tipVisibleBounds.contains(e.getPoint())) { possiblyDisposeOfTipWindow(); } }
public void toolTipRequested(MouseEvent e, String text) { if (text==null || text.length()==0) { possiblyDisposeOfTipWindow(); lastText = text; return; } if (lastText==null || text.length()!=lastText.length() || !text.equals(lastText)) { possiblyDisposeOfTipWindow(); createAndShowTipWindow(e, text); } }
public void toolTipRequested(MouseEvent e, String text) { if (text==null || text.length()==0) { possiblyDisposeOfTipWindow(); lastText = text; return; } if (lastText==null || text.length()!=lastText.length() || !text.equals(lastText)) { possiblyDisposeOfTipWindow(); createAndShowTipWindow(e, text); } }
@Override public void keyPressed(KeyEvent e) { if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { possiblyDisposeOfTipWindow(); } else if (e.getKeyCode()==KeyEvent.VK_F2) { if (tipWindow!=null && !tipWindow.getFocusableWindowState()) { tipWindow.actionPerformed(null); e.consume(); // Don't do bookmarking stuff } } }
@Override public void mouseExited(MouseEvent e) { // Since we registered this listener on the child components of // the JWindow, not the JWindow iteself, we have to be careful. Component source = (Component)e.getSource(); Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, source); if (!TipWindow.this.getBounds().contains(p)) { ft.possiblyDisposeOfTipWindow(); } }