/** Connect to the underlying property editor. Will add the component * to this WrapperInplaceEditor's component hierarchy and start listening * on it for action and focus events */ public void connect(java.beans.PropertyEditor pe, PropertyEnv env) { if (legacy != null) { //Should never be called twice without a clear(), but just in case clear(); } if (pe != enh) { enh = (EnhancedPropertyEditor) pe; } Component comp = getLegacyInplaceEditor(); add(comp, BorderLayout.CENTER); listenerAdded = tryAddActionListener(comp); comp.addFocusListener(this); }
/** Action listener implementation. The WarpperInplaceEditor is added * as an action listener to the legacy inplace editor component. Any * action event coming from the legacy component will trigger refiring as * InplaceEditor.ACTION_SUCCESS indicating a completed edit. */ public void actionPerformed(ActionEvent ae) { fireAction(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); }
/** Create a new instance */ WrapperInplaceEditor(EnhancedPropertyEditor enh) { this.enh = enh; setLayout(new BorderLayout()); getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter"); //NOI18N getActionMap().put("enter", new EnterKbdAction()); //NOI18N }
/** Will check if the underlying component is a combo box, and if so * suppress the arrow keys. Doesn't try to do anything special for * other components. */ public KeyStroke[] getKeyStrokes() { if (getLegacyInplaceEditor() instanceof JComboBox) { return ComboInplaceEditor.cbKeyStrokes; } else { return null; } }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusGained(FocusEvent e) { e.setSource(this); fireFocusGained(e); }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusLost(FocusEvent e) { e.setSource(this); fireFocusLost(e); }
public boolean isKnownComponent(Component c) { return isAncestorOf(c); }
result = new WrapperInplaceEditor(enh);
/** Will check if the underlying component is a combo box, and if so * suppress the arrow keys. Doesn't try to do anything special for * other components. */ public KeyStroke[] getKeyStrokes() { if (getLegacyInplaceEditor() instanceof JComboBox) { return ComboInplaceEditor.cbKeyStrokes; } else { return null; } }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusGained(FocusEvent e) { e.setSource(this); fireFocusGained(e); }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusLost(FocusEvent e) { e.setSource(this); fireFocusLost(e); }
public boolean isKnownComponent(Component c) { return isAncestorOf(c); }
if (enh.hasInPlaceCustomEditor()) { result = new WrapperInplaceEditor (enh);
/** Connect to the underlying property editor. Will add the component * to this WrapperInplaceEditor's component hierarchy and start listening * on it for action and focus events */ public void connect(java.beans.PropertyEditor pe, PropertyEnv env) { if (legacy != null) { //Should never be called twice without a clear(), but just in case clear(); } if (pe != enh) { enh = (EnhancedPropertyEditor) pe; } Component comp = getLegacyInplaceEditor(); add(comp, BorderLayout.CENTER); listenerAdded = tryAddActionListener(comp); comp.addFocusListener(this); }
/** Create a new instance */ WrapperInplaceEditor(EnhancedPropertyEditor enh) { this.enh = enh; setLayout(new BorderLayout()); getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter"); //NOI18N getActionMap().put("enter", new EnterKbdAction()); //NOI18N }
/** Action listener implementation. The WarpperInplaceEditor is added * as an action listener to the legacy inplace editor component. Any * action event coming from the legacy component will trigger refiring as * InplaceEditor.ACTION_SUCCESS indicating a completed edit. */ public void actionPerformed(ActionEvent ae) { fireAction(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); }
/** Will check if the underlying component is a combo box, and if so * suppress the arrow keys. Doesn't try to do anything special for * other components. */ public KeyStroke[] getKeyStrokes() { if (getLegacyInplaceEditor() instanceof JComboBox) { return ComboInplaceEditor.cbKeyStrokes; } else { return null; } }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusGained(FocusEvent e) { e.setSource(this); fireFocusGained(e); }
/** Forward focus events from within the legacy component to the * infrastructure, so editor will be properly removed if focus changes */ public void focusLost(FocusEvent e) { e.setSource(this); fireFocusLost(e); }
public boolean isKnownComponent(Component c) { return isAncestorOf(c); }