private final void installInner(JComponent c) { synchronized (getTreeLock()) { if (inner != null) { remove(inner); } inner = c; if (inner != null) { c.setBounds(0, 0, getWidth(), getHeight()); add(c); } } }
public boolean isTitleDisplayed() { if (isUseLabels()) { InplaceEditor inp = null; if (inplace != null) { inp = inplace; } else { inp = createInplaceEditor(); } InplaceEditor most = PropUtils.findInnermostInplaceEditor(inp); return (most instanceof RadioInplaceEditor || most instanceof CheckboxInplaceEditor); } return false; }
boolean hadFocus = isEnabled() && ((focusOwner == this) || isAncestorOf(focusOwner) || ((getInplaceEditor() != null) && getInplaceEditor().isKnownComponent(focusOwner))); setInplaceEditor(createInplaceEditor()); requestFocus(); revalidate(); repaint(); } catch (Exception e) { e.printStackTrace();
private InplaceEditor createInplaceEditor() { PropertyEnv env = new PropertyEnv(); env.setFeatureDescriptor(findFeatureDescriptor(this)); InplaceEditor innermost = result = factory(this).getInplaceEditor(getProperty(), env, true); if (isShowCustomEditorButton() && innermost.getPropertyEditor().supportsCustomEditor()) { ButtonPanel bp = new ButtonPanel(); bp.setInplaceEditor(innermost); configureButtonPanel(bp); result = bp; } else if (getProperty().getValue("valueIcon") != null) { //NOI18N Object o = getProperty().getValue("valueIcon"); //NOI18N setPropertyEnv(env);
protected void prepareComponent(InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } if( comp instanceof ComboInplaceEditor ) comp.setEnabled( isEnabled() && getPropertyEnv().isEditable() ); else comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
public final void setRadioButtonMax(int max) { if (max != radioButtonMax) { int old = radioButtonMax; boolean needChange = false; if (inplace != null) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); if (innermost instanceof JComboBox || innermost instanceof RadioInplaceEditor) { PropertyEditor ped = innermost.getPropertyEditor(); int tagCount = (ped.getTags() == null) ? (-1) : ped.getTags().length; needChange = (old <= tagCount) != (max <= tagCount); } } radioButtonMax = max; if (needChange && (inner != null)) { replaceInner(); firePropertyChange("preferredSize", null, null); //NOI18N } } }
private void attachToEnv(PropertyEnv env) { env.addPropertyChangeListener(getEnvListener()); env.addVetoableChangeListener(getEnvListener()); env.setBeans(EditorPropertyDisplayer.findBeans(this)); }
public String getBeanName() { if (modelRef != null) { PropertyModel pm = modelRef.get(); if (pm instanceof NodePropertyModel) { return ((NodePropertyModel) pm).getBeanName(); } } if (getProperty() instanceof ModelProperty.DPMWrapper) { return ((ModelProperty.DPMWrapper) getProperty()).getBeanName(); } return findFeatureDescriptor(EditablePropertyDisplayer.this).getDisplayName(); }
try { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); boolean hadFocus = isEnabled() && (focusOwner == this || isAncestorOf(focusOwner) || (getInplaceEditor() != null && getInplaceEditor().isKnownComponent(focusOwner))); setInplaceEditor(createInplaceEditor()); requestFocus(); revalidate(); repaint(); } catch (Exception e) { e.printStackTrace();
private InplaceEditor createInplaceEditor () { PropertyEnv env = new PropertyEnv(); env.setFeatureDescriptor(findFeatureDescriptor(this)); InplaceEditor innermost = result = factory(this).getInplaceEditor(getProperty(), env, true); if (isShowCustomEditorButton() && innermost.getPropertyEditor().supportsCustomEditor()) { bp.setInplaceEditor(innermost); configureButtonPanel(bp); result = bp; ic = new ImageIcon(Utilities.loadImage ( "org/openide/resources/propertysheet/invalid.gif")); //NOI18N } else if (getProperty().getValue("valueIcon") != null) { //NOI18N Object o = getProperty().getValue("valueIcon"); //NOI18N if (o instanceof Image) { ic = new ImageIcon((Image) o); setPropertyEnv(env); return result;
protected void prepareComponent (InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
public final void setRadioButtonMax(int max) { if (max != radioButtonMax) { int old = radioButtonMax; boolean needChange=false; if (inplace != null) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); if (innermost instanceof JComboBox || innermost instanceof RadioInplaceEditor) { PropertyEditor ped = innermost.getPropertyEditor(); int tagCount = ped.getTags() == null ? -1 : ped.getTags().length; needChange = old <= tagCount != max <= tagCount; } } radioButtonMax = max; if (needChange && inner != null) { replaceInner(); firePropertyChange("preferredSize", null, null); //NOI18N } } }
private void attachToEnv(PropertyEnv env) { env.addPropertyChangeListener(getEnvListener()); env.addVetoableChangeListener(getEnvListener()); env.setBeans(EditorPropertyDisplayer.findBeans(this)); }
public String getBeanName() { if (modelRef != null) { PropertyModel pm = (PropertyModel)modelRef.get(); if (pm instanceof NodePropertyModel) { return ((NodePropertyModel)pm).getBeanName(); } } if (getProperty() instanceof ModelProperty.DPMWrapper) { return ((ModelProperty.DPMWrapper) getProperty()).getBeanName(); } return findFeatureDescriptor(EditablePropertyDisplayer.this).getDisplayName(); }
try { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); boolean hadFocus = isEnabled() && (focusOwner == this || isAncestorOf(focusOwner) || (getInplaceEditor() != null && getInplaceEditor().isKnownComponent(focusOwner))); setInplaceEditor(createInplaceEditor()); requestFocus(); revalidate(); repaint(); } catch (Exception e) { e.printStackTrace();
private InplaceEditor createInplaceEditor () { PropertyEnv env = new PropertyEnv(); env.setFeatureDescriptor(findFeatureDescriptor(this)); InplaceEditor innermost = result = factory(this).getInplaceEditor(getProperty(), env, true); if (isShowCustomEditorButton() && innermost.getPropertyEditor().supportsCustomEditor()) { bp.setInplaceEditor(innermost); configureButtonPanel(bp); result = bp; ic = new ImageIcon(Utilities.loadImage ( "org/openide/resources/propertysheet/invalid.gif")); //NOI18N } else if (getProperty().getValue("valueIcon") != null) { //NOI18N Object o = getProperty().getValue("valueIcon"); //NOI18N if (o instanceof Image) { ic = new ImageIcon((Image) o); setPropertyEnv(env); return result;
private final void installInner (JComponent c) { synchronized (getTreeLock()) { if (inner != null) { if (c != null) { // System.err.println("REPLACING INNER COMPONENT"); } remove(inner); } inner = c; if (inner != null) { c.setBounds(0,0,getWidth(),getHeight()); add(c); } } }
protected void prepareComponent (InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
public boolean isTitleDisplayed() { if (isUseLabels()) { InplaceEditor inp = null; if (inplace != null) { inp = inplace; } else { inp = createInplaceEditor(); } InplaceEditor most = PropUtils.findInnermostInplaceEditor(inp); return (most instanceof RadioInplaceEditor || most instanceof CheckboxInplaceEditor); } return false; }
public final void setRadioButtonMax(int max) { if (max != radioButtonMax) { int old = radioButtonMax; boolean needChange=false; if (inplace != null) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); if (innermost instanceof JComboBox || innermost instanceof RadioInplaceEditor) { PropertyEditor ped = innermost.getPropertyEditor(); int tagCount = ped.getTags() == null ? -1 : ped.getTags().length; needChange = old <= tagCount != max <= tagCount; } } radioButtonMax = max; if (needChange && inner != null) { replaceInner(); firePropertyChange("preferredSize", null, null); //NOI18N } } }