dispatchEvent(new FocusEvent(FocusEvent.FOCUS_IN, true, false));
private void fireGainedFocus() { FocusEvent evt = new FocusEvent(this, FocusEvent.FOCUS_GAINED); for (FocusListener l : this.listeners) { l.focusGained(evt); } }
public void run() { FocusEvent ev = new FocusEvent(source, FocusEvent.FOCUS_GAINED); target.dispatchEvent(ev); } });
public void focusLost() { for (FocusListener listener : jLabel.getFocusListeners()) { listener.focusLost(new FocusEvent(jLabel, 0)); } }
public void focusLost() { for (FocusListener listener : jTextComponent.getFocusListeners()) { listener.focusLost(new FocusEvent(jTextComponent, 0)); } } }
protected final void postFocusEvent(CacioComponent source, int id, boolean temporary, CacioComponent opposite) { Component awtComponent = null; if (opposite != null) { awtComponent = opposite.getAWTComponent(); } FocusEvent ev = new FocusEvent(source.getAWTComponent(), id, temporary, awtComponent); postEvent(source, ev); }
void handleFocus(FocusEvent event) // @C2A { // @C2A // Can not call this directly from inner @C2A // class, since it is protected. @C2A processFocusEvent(new FocusEvent(this, event.getID(), event.isTemporary())); // @C2A } // @C2A
public void widgetActivated(WidgetEvent evt) { Window window = SwingUtilities.windowForComponent(ObjectTreeInternalFrame.this.getObjectTreePanel()); Component focusOwner = (window != null) ? window.getFocusOwner() : null; if (focusOwner != null) { FocusEvent lost = new FocusEvent(focusOwner, FocusEvent.FOCUS_LOST); FocusEvent gained = new FocusEvent(focusOwner, FocusEvent.FOCUS_GAINED); window.dispatchEvent(lost); window.dispatchEvent(gained); window.dispatchEvent(lost); focusOwner.requestFocus(); } } });
private void focusLost(ManagedWindow w, ManagedWindow lostTo) { if (w != null) { CacioComponent cacioComp = w.getCacioComponent(); Component c = cacioComp.getAWTComponent(); Component opposite = getAWTComponent(lostTo); FocusEvent fe = new FocusEvent(c, FocusEvent.FOCUS_LOST, false, opposite); cacioComp.handlePeerEvent(fe); } }
private void focusGained(ManagedWindow w, ManagedWindow lost) { if (w != null) { CacioComponent cacioComp = w.getCacioComponent(); Component c = cacioComp.getAWTComponent(); Component opposite = getAWTComponent(lost); FocusEvent fe = new FocusEvent(c, FocusEvent.FOCUS_GAINED, false, opposite); cacioComp.handlePeerEvent(fe); } }
public void widgetActivated(WidgetEvent evt) { Window window = SwingUtilities.windowForComponent(ObjectTreeInternalFrame.this.getObjectTreePanel()); Component focusOwner = (window != null) ? window.getFocusOwner() : null; if (focusOwner != null) { FocusEvent lost = new FocusEvent(focusOwner, FocusEvent.FOCUS_LOST); FocusEvent gained = new FocusEvent(focusOwner, FocusEvent.FOCUS_GAINED); window.dispatchEvent(lost); window.dispatchEvent(gained); window.dispatchEvent(lost); focusOwner.requestFocus(); } } });
@Override public void focusLost(FocusEvent e) { FocusEvent fe = new FocusEvent(ModelGrid.this, e.getID(), e.isTemporary(), e.getOppositeComponent()); for (FocusListener l : getFocusListeners()) { l.focusLost(fe); } }
@Override public void focusGained(FocusEvent e) { FocusEvent fe = new FocusEvent(ModelGrid.this, e.getID(), e.isTemporary(), e.getOppositeComponent()); for (FocusListener l : getFocusListeners()) { l.focusGained(fe); } }
AWTEvent copyEvent(Component src, AWTEvent evt) { if(evt instanceof MouseEvent) { MouseEvent mev=(MouseEvent)evt; return new MouseEvent(src, evt.getID(), mev.getWhen(), mev.getModifiers(), mev.getX(), mev.getY(), mev.getClickCount(), mev.isPopupTrigger()); } if(evt instanceof KeyEvent) { KeyEvent kev=(KeyEvent)evt; return new KeyEvent(src, evt.getID(), kev.getWhen(), kev.getModifiers(), kev.getKeyCode(), kev.getKeyChar()); } if(evt instanceof ActionEvent) return new ActionEvent(src, evt.getID(), ((ActionEvent)evt).getActionCommand(), ((ActionEvent)evt).getModifiers()); if(evt instanceof PaintEvent) return new PaintEvent(src, evt.getID(), ((PaintEvent)evt).getUpdateRect()); if(evt instanceof FocusEvent) return new FocusEvent(src, evt.getID(), ((FocusEvent)evt).isTemporary()); if(evt instanceof ComponentEvent) return new ComponentEvent(src, evt.getID()); return null; }
AWTEvent copyEvent(Component src, AWTEvent evt) { if(evt instanceof MouseEvent) { MouseEvent mev=(MouseEvent)evt; return new MouseEvent(src, evt.getID(), mev.getWhen(), mev.getModifiers(), mev.getX(), mev.getY(), mev.getClickCount(), mev.isPopupTrigger()); } if(evt instanceof KeyEvent) { KeyEvent kev=(KeyEvent)evt; return new KeyEvent(src, evt.getID(), kev.getWhen(), kev.getModifiers(), kev.getKeyCode(), kev.getKeyChar()); } if(evt instanceof ActionEvent) return new ActionEvent(src, evt.getID(), ((ActionEvent)evt).getActionCommand(), ((ActionEvent)evt).getModifiers()); if(evt instanceof PaintEvent) return new PaintEvent(src, evt.getID(), ((PaintEvent)evt).getUpdateRect()); if(evt instanceof FocusEvent) return new FocusEvent(src, evt.getID(), ((FocusEvent)evt).isTemporary()); if(evt instanceof ComponentEvent) return new ComponentEvent(src, evt.getID()); return null; }
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); } }
for (int i = 0; i < focusListenersList.size(); i++) { FocusListener focusListener = focusListenersList.get(i); focusListener.focusGained(new FocusEvent( VersionTextField.this, e.getID(), for (int i = 0; i < focusListenersList.size(); i++) { FocusListener focusListener = focusListenersList.get(i); focusListener.focusLost(new FocusEvent( VersionTextField.this, e.getID(),
focusGained(new FocusEvent(component, FocusEvent.FOCUS_GAINED));