public void removeNotify() { super.removeNotify(); setInplaceEditor(null); reusableEnv.clear(); }
/** Uses the <code>NODE</code> field to supply the beans - if it is an instance * of ProxyNode (multi-selection), returns the nodes that ProxyNode represents. */ public Object[] getBeans() { if (ReusablePropertyModel.DEBUG) ReusablePropertyModel.checkThread(); if (getNode() instanceof ProxyNode) { return ((ProxyNode) getNode()).getOriginalNodes(); } else if (getNode() instanceof Object[]) { return (Object[]) getNode(); } else { return new Object[] { getNode() }; } }
public void reset() { setEditable(true); setState(STATE_NEEDS_VALIDATION); }
Invoker(Node.Property prop, Object[] beans) { property = prop; this.beans = beans; propertyEnv = new ReusablePropertyEnv(); ReusablePropertyModel rpm = new ReusablePropertyModel(propertyEnv); rpm.setProperty(prop); propertyEnv.setNode(beans); // will unwrap as needed }
env.reset(); (env.getFeatureDescriptor().getValue("stringValues") != null); //NOI18N ((env.getState() == env.STATE_INVALID) || (prop.getValue("valueIcon") != null))
@Override public void removeNotify() { Node lastSel = null; if (pclistener != null) { //Save the last selection - if we're being transiently removed, //i.e. because of drag and drop, we'll want to reset it on the //next addNotify if it hasn't disappeared lastSel = pclistener.detach(); } doSetNodes(null); if (lastSel != null) { //Save the selected node in case we're re-added to a container storedNode = new WeakReference<Node>(lastSel); } super.removeNotify(); table.getReusablePropertyEnv().setBeans(null); table.getReusablePropertyEnv().setNode(null); table.getReusablePropertyModel().setProperty(null); }
public void paintComponent(Graphics g) { //Hack for issue 38132 - Beans are set via TTVBridge as a package //private property on the parent PropertyPanel (if there is one). //FindBeans() will locate the beans either in the model or as a //property of the PropertyPanel (if an esoteric undocumented client property //is set on the PropertyPanel). RendererFactory will set the env //value (if there is an env) to the value of ReusablePropertyEnv.NODE //(a performance hack to avoid creating 1 property env for each property //painted each time we paint). Cool, huh? reusableEnv.setNode(EditorPropertyDisplayer.findBeans(this)); JComponent comp = getRenderer(this); prepareRenderer(comp); comp.setBounds(0,0,getWidth(),getHeight()); if (comp instanceof InplaceEditor) { Component inner = findInnermostRenderer(comp); SwingUtilities.paintComponent (g, comp, this, 0, 0, getWidth(), getHeight()); return; } comp.paint(g); }
/** Factory method that returns an appropriate inplace * editor for an object. Special handling is provided for * instances of Node.Property which can provide hints or * even their own legacy inplace editor implementation. * <P>The returned instance will be connected to the * object (the component provided by getComponent() will * render the property object correctly with no additional * intervention needed. If <code>newInstance</code> is * true, will create a new instance of the inplace editor * component (for use with PropertyPanel and other cases * where multiple inplace esditors can be displayed at the * same time); otherwise a shared instance will be configured * and returned.<P> Note that for the case of unknown object * types (non Node.Property objects), the returned InplaceEditor * will have no way of knowing how to update the object with * a new value, and client code must listen for actions on * the InplaceEditor and do this manually - the update method * of the InplaceEditor will do nothing. */ public InplaceEditor getInplaceEditor (Property p, boolean newInstance) { PropertyEnv env = new PropertyEnv(); env.setBeans (reusableEnv.getBeans()); return getInplaceEditor(p, env, newInstance); }
RendererFactory rfactory(final PropertyDisplayer_Inline inline) { RendererFactory factory; if (inline.isTableUI()) { if (rendererFactory1 == null) { rendererFactory1 = new RendererFactory(inline.isTableUI(), inline.getReusablePropertyEnv(), inline.getReusablePropertyEnv().getReusablePropertyModel()); } factory = rendererFactory1; } else { if (rendererFactory2 == null) { rendererFactory2 = new RendererFactory(inline.isTableUI(), inline.getReusablePropertyEnv(), inline.getReusablePropertyEnv().getReusablePropertyModel()); } factory = rendererFactory2; } factory.setUseRadioBoolean(inline.isRadioBoolean()); factory.setUseLabels(inline.isUseLabels()); factory.setRadioButtonMax(inline.getRadioButtonMax()); return factory; }
/** Getter for the state of the property editor. The editor can be in * not valid states just if it implements the <link>ExPropertyEditor</link> * and changes state by the <code>setState</code> method of the <link>PropertyEnv</link> * environment. * <P> * @return <code>PropertyEnv.STATE_VALID</code> if the editor is not the <code>ExPropertyEditor</code> * one or other constant from <code>PropertyEnv.STATE_*</code> that was assigned to <code>PropertyEnv</code> * @since 2.20 */ public final Object getState() { if ((displayer != null) && displayer instanceof PropertyDisplayer_Editable) { return ((PropertyDisplayer_Editable) displayer).getPropertyEnv().getState(); } else { PropertyEditor ed = propertyEditor(); if (ed instanceof ExPropertyEditor) { //XXX until we kill ReusablePropertyModel, anyway ReusablePropertyEnv env = reusableEnv; reusableModel.setProperty(prop); ((ExPropertyEditor) ed).attachEnv(env); return env.getState(); } } return PropertyEnv.STATE_VALID; }
env.reset(); PropertyEditor editor = preparePropertyEditor (mdl, env); env.getFeatureDescriptor().getValue( "stringValues") != null; //NOI18N prop.getValue("suppressCustomEditor")); //NOI18N if (!(result instanceof JLabel) && (env.getState() == env.STATE_INVALID || prop.getValue("valueIcon") != null)) {//NOI18N result = prepareIconPanel(editor, env, (InplaceEditor) result);
public void removeNotify() { Node lastSel = null; if (pclistener != null) { //Save the last selection - if we're being transiently removed, //i.e. because of drag and drop, we'll want to reset it on the //next addNotify if it hasn't disappeared lastSel = pclistener.detach(); } doSetNodes(null); if (lastSel != null) { //Save the selected node in case we're re-added to a container storedNode = new WeakReference(lastSel); } super.removeNotify(); table.getReusablePropertyEnv().setBeans(null); table.getReusablePropertyEnv().setNode(null); table.getReusablePropertyModel().setProperty(null); }
public void paintComponent(Graphics g) { //Hack for issue 38132 - Beans are set via TTVBridge as a package //private property on the parent PropertyPanel (if there is one). //FindBeans() will locate the beans either in the model or as a //property of the PropertyPanel (if an esoteric undocumented client property //is set on the PropertyPanel). RendererFactory will set the env //value (if there is an env) to the value of ReusablePropertyEnv.NODE //(a performance hack to avoid creating 1 property env for each property //painted each time we paint). Cool, huh? reusableEnv.setNode(EditorPropertyDisplayer.findBeans(this)); JComponent comp = getRenderer(this); prepareRenderer(comp); comp.setBounds(0,0,getWidth(),getHeight()); if (comp instanceof InplaceEditor) { Component inner = findInnermostRenderer(comp); SwingUtilities.paintComponent (g, comp, this, 0, 0, getWidth(), getHeight()); return; } comp.paint(g); }
/** Factory method that returns an appropriate inplace * editor for an object. Special handling is provided for * instances of Node.Property which can provide hints or * even their own legacy inplace editor implementation. * <P>The returned instance will be connected to the * object (the component provided by getComponent() will * render the property object correctly with no additional * intervention needed. If <code>newInstance</code> is * true, will create a new instance of the inplace editor * component (for use with PropertyPanel and other cases * where multiple inplace esditors can be displayed at the * same time); otherwise a shared instance will be configured * and returned.<P> Note that for the case of unknown object * types (non Node.Property objects), the returned InplaceEditor * will have no way of knowing how to update the object with * a new value, and client code must listen for actions on * the InplaceEditor and do this manually - the update method * of the InplaceEditor will do nothing. */ public InplaceEditor getInplaceEditor(Property p, boolean newInstance) { PropertyEnv env = new PropertyEnv(); env.setBeans(reusableEnv.getBeans()); return getInplaceEditor(p, env, newInstance); }
RendererFactory rfactory(final PropertyDisplayer_Inline inline) { RendererFactory factory; if (inline.isTableUI()) { if (rendererFactory1 == null) { rendererFactory1 = new RendererFactory(inline.isTableUI(), inline.getReusablePropertyEnv(), inline.getReusablePropertyEnv().getReusablePropertyModel()); } factory = rendererFactory1; } else { if (rendererFactory2 == null) { rendererFactory2 = new RendererFactory(inline.isTableUI(), inline.getReusablePropertyEnv(), inline.getReusablePropertyEnv().getReusablePropertyModel()); } factory = rendererFactory2; } factory.setUseRadioBoolean(inline.isRadioBoolean()); factory.setUseLabels(inline.isUseLabels()); factory.setRadioButtonMax(inline.getRadioButtonMax()); return factory; }
/** Getter for the state of the property editor. The editor can be in * not valid states just if it implements the <link>ExPropertyEditor</link> * and changes state by the <code>setState</code> method of the <link>PropertyEnv</link> * environment. * <P> * @return <code>PropertyEnv.STATE_VALID</code> if the editor is not the <code>ExPropertyEditor</code> * one or other constant from <code>PropertyEnv.STATE_*</code> that was assigned to <code>PropertyEnv</code> * @since 2.20 */ public final Object getState () { if (displayer != null && displayer instanceof PropertyDisplayer_Editable) { return ((PropertyDisplayer_Editable) displayer).getPropertyEnv().getState(); } else { PropertyEditor ed = propertyEditor(); if (ed instanceof ExPropertyEditor) { //XXX until we kill ReusablePropertyModel, anyway ReusablePropertyEnv env = reusableEnv; reusableModel.setProperty(prop); ((ExPropertyEditor) ed).attachEnv(env); return env.getState(); } } return PropertyEnv.STATE_VALID; }
env.reset(); PropertyEditor editor = preparePropertyEditor (mdl, env); env.getFeatureDescriptor().getValue( "stringValues") != null; //NOI18N prop.getValue("suppressCustomEditor")); //NOI18N if (!(result instanceof JLabel) && (env.getState() == env.STATE_INVALID || prop.getValue("valueIcon") != null)) {//NOI18N result = prepareIconPanel(editor, env, (InplaceEditor) result);
public void reset() { setEditable(true); setState(STATE_NEEDS_VALIDATION); }
public void removeNotify() { Node lastSel = null; if (pclistener != null) { //Save the last selection - if we're being transiently removed, //i.e. because of drag and drop, we'll want to reset it on the //next addNotify if it hasn't disappeared lastSel = pclistener.detach(); } doSetNodes(null); if (lastSel != null) { //Save the selected node in case we're re-added to a container storedNode = new WeakReference(lastSel); } super.removeNotify(); table.getReusablePropertyEnv().setBeans(null); table.getReusablePropertyEnv().setNode(null); table.getReusablePropertyModel().setProperty(null); }
public void removeNotify() { super.removeNotify(); setInplaceEditor(null); reusableEnv.clear(); }