private boolean setNextValue( boolean increment ) { if( !PropUtils.supportsValueIncrement( env ) ) return false; Object nextValue = PropUtils.getNextValue( env, increment ); if( null == nextValue ) return true; setValue( nextValue ); return PropUtils.updateProp( this ); }
@Override public void setSelectedItem(Object o) { try { if(in_setSelectedItem) { in_setSelectedItem = false; if(PropUtils.supportsValueIncrement(env)) { //return only when we are in the hack mode return ; } } in_setSelectedItem = true; //Some property editors (i.e. IMT's choice editor) treat //null as 0. Probably not the right way to do it, but needs to //be handled. if ((o == null) && (editor != null) && (editor.getTags() != null) && (editor.getTags().length > 0)) { o = editor.getTags()[0]; } if (o != null) { super.setSelectedItem(o); } } finally { in_setSelectedItem = false; } }
private boolean setNextValue( boolean increment ) { try { suppressFireActionEvent = true; if( isPopupVisible() ) { return false; } if( !PropUtils.supportsValueIncrement( env ) ) return false; Object nextValue = PropUtils.getNextValue( env, increment ); if( null == nextValue ) return true; setValue( nextValue ); return PropUtils.updateProp( this ); } finally { suppressFireActionEvent = false; } }
if(PropUtils.supportsValueIncrement(env)) { PropUtils.wrapUpDownArrowActions(this, this); PropUtils.wrapUpDownArrowActions(((JComponent)getEditor().getEditorComponent()), this);
@Override public void connect(PropertyEditor p, PropertyEnv env) { setActionCommand(COMMAND_SUCCESS); this.env = env; if(PropUtils.supportsValueIncrement( env ) ) { PropUtils.wrapUpDownArrowActions( this, this ); } if (editor == p) { return; } editor = p; boolean editable = PropUtils.checkEnabled(this, p, env); setEnabled(editable); //Undocumented, but in NB 3.5 and earlier, getAsText() returning null for //paintable editors was yet another way to disable a property editor if ((p.getTags() == null) && (p.getAsText() == null) && p.isPaintable()) { editable = false; } setEditable(editable); reset(); added = false; }