Esempio n. 1
0
 // msg from JTextfield
 public void focusLost(FocusEvent e) {
   if (e.getSource() == textField) {
     textField.setBackground(GUIGlobals.theme.InactiveTextField);
     this.fireFocusLost(e.isTemporary());
     this.repaint();
   }
 }
 public void focusLost(FocusEvent e) {
   // We will still paint focus even if lost temporarily
   focusLostTemporarily = e.isTemporary();
   if (!focusLostTemporarily) {
     comp.repaint();
   }
 }
 public void focusLost(FocusEvent e) {
   synchronized (this) {
     if (c != null) {
       c.getDocument().removeDocumentListener(d);
       c = null;
       d = null;
     }
   }
   if (!e.isTemporary()) parent.updateField(e.getSource());
 }
Esempio n. 4
0
 /*
  * diese Methode wird aufgerufen wenn das Feld den Focus verliert
  */
 @Override
 public void focusLost(final FocusEvent e) {
   if (e.isTemporary()) {
     return;
   } else {
     if (!checked()) {
       check();
     }
   }
 }
Esempio n. 5
0
 public void focusLost(java.awt.event.FocusEvent fe) {
   // On Windows (and perhaps Linux? not sure), putting
   // the focus elsewhere leaves the text selected in the
   // now-unfocused field.  This causes the text to be drawn
   // in different colors even though the selection isn't
   // visible.  I suppose we could make HighlightView smarter
   // about that, but instead let's just force the Mac-like
   // behavior and be done with it for now - ST 11/3/03
   if (!disableFocusTraversalKeys) {
     select(0, 0);
   }
   mouseEvent = fe.isTemporary();
   bracketMatcher.focusLost(this);
   colorizer.reset();
   if (!fe.isTemporary()) {
     Actions.setEnabled(false);
     UndoManager.setCurrentManager(null);
   }
 }
Esempio n. 6
0
 // msg from JTextfield
 public void focusGained(FocusEvent e) {
   if (e.getSource() == textField) {
     this.fireFocusGained(e.isTemporary());
   } else // if the label get's the focus then delegate it to textfield
   {
     textField.grabFocus();
     // !!! field could be not visible (scrollpane!)
     // insert mechanism to ensure visibility
   }
   textField.setBackground(GUIGlobals.theme.ActiveTextField);
 }
 @Override
 public void focusLost(FocusEvent e) {
   if (!e.isTemporary()) {
     final JTextComponent textComponent = (JTextComponent) e.getComponent();
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             textComponent.select(0, 0);
           }
         });
   }
 }
 public void focusGained(FocusEvent e) {
   if (!e.isTemporary()) {
     final JTextComponent textComponent = (JTextComponent) e.getComponent();
     // using invokeLater as fix for bug 4740914
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             textComponent.selectAll();
           }
         });
   }
 }
    public void eventDispatched(AWTEvent event) {
      if (event instanceof FocusEvent) {
        FocusEvent focusEvent = (FocusEvent) event;
        Component fromComponent = focusEvent.getComponent();
        Component oppositeComponent = focusEvent.getOppositeComponent();

        paintFocusBorders(true);

        switch (event.getID()) {
          case FocusEvent.FOCUS_GAINED:
            myCurrent = fromComponent;
            myPrevious = oppositeComponent;
            myTemporary = focusEvent.isTemporary();
            break;
          case FocusEvent.FOCUS_LOST:
            myTemporary = focusEvent.isTemporary();
          default:
            break;
        }
      }
    }
Esempio n. 10
0
 void canvasFocusLost(FocusEvent e) {
   if (isXEmbedActive() && !e.isTemporary()) {
     xembedLog.fine("Forwarding FOCUS_LOST");
     int num = 0;
     if (AccessController.doPrivileged(new GetBooleanAction("sun.awt.xembed.testing"))) {
       Component opp = e.getOppositeComponent();
       try {
         num = Integer.parseInt(opp.getName());
       } catch (NumberFormatException nfe) {
       }
     }
     xembed.sendMessage(xembed.handle, XEMBED_FOCUS_OUT, num, 0, 0);
   }
 }
Esempio n. 11
0
 @Override
 public void focusLost(final FocusEvent e) {
   if (!e.isTemporary() || e.getOppositeComponent() == null) {
     /*
      * we check for temporary , because a rightclick menu will cause focus lost but editing should not stop
      *
      * we also check for oppositeComponent to stopEditing when we click outside the window
      */
     ExtTextColumn.this.noset = true;
     try {
       ExtTextColumn.this.stopCellEditing();
     } finally {
       ExtTextColumn.this.noset = false;
     }
   }
 }
Esempio n. 12
0
  /**
   * Handles LOST_FOCUS event. When the component is about to loose the focus, this handler checks
   * if the date entered is valid.
   *
   * @param feKey event object
   */
  public void focusLost(FocusEvent feEvt) {
    Object oText = feEvt.getSource();
    String szText;

    if (oText instanceof JTextField) szText = ((JTextField) oText).getText();
    else if (oText instanceof TextField) szText = ((TextField) oText).getText();
    else return;

    // if( szText.trim().length() == 0 )	// Replace with this cond for JDK1.1 application
    if (feEvt.isTemporary() || szText.trim().length() == 0) return;

    Calendar cCalendar;
    String szTime;

    if ((cCalendar = TextConverter.getBase24Time(szText)) == null) {
      fireInvalidTimeEvent(new TimeEvent(oText, szText));
      szTime = "";
    } else szTime = TextConverter.toBase24String(cCalendar);

    if (oText instanceof JTextField) ((JTextField) oText).setText(szTime);
    else if (oText instanceof TextField) ((TextField) oText).setText(szTime);
  }
  private void processFocusLost(FocusEvent e) {
    final Component opposite = e.getOppositeComponent();

    if (myPanel.isInFloatingMode()
        && opposite != null
        && DialogWrapper.findInstance(opposite) != null) {
      myPanel.hideHint();
      return;
    }

    final boolean nodePopupInactive = !myPanel.isNodePopupActive();
    boolean childPopupInactive = !JBPopupFactory.getInstance().isChildPopupFocused(myPanel);
    if (nodePopupInactive && childPopupInactive) {
      if (opposite != null
          && opposite != myPanel
          && !myPanel.isAncestorOf(opposite)
          && !e.isTemporary()) {
        myPanel.setContextComponent(null);
        myPanel.hideHint();
      }
    }

    myPanel.updateItems();
  }
Esempio n. 14
0
 void forwardFocusLost(FocusEvent e) {
   isFocused = false;
   FocusEvent fe =
       new FocusEvent(this, e.getID(), e.isTemporary(), e.getOppositeComponent(), e.getCause());
   super.processFocusEvent(fe);
 }
Esempio n. 15
0
 /**
  * Focus Lost
  *
  * @param e
  */
 @Override
 public void focusLost(FocusEvent e) {
   if (e.isTemporary()) return;
   log.info(e.toString());
   findBPartner();
 } //	focusLost
Esempio n. 16
0
 public void focusGained(FocusEvent e) {
   if (!e.isTemporary()) focused = (Component) e.getSource();
 }