private boolean isTransient(FeatureDescriptor fd) { return Boolean.TRUE.equals(fd.getValue(TRANSIENT)); }
private boolean isTransient(FeatureDescriptor fd) { return Boolean.TRUE.equals(fd.getValue(TRANSIENT)); }
/** * @param descriptor A method or property descriptor. * @return The descriptor's associated visibility modifier. */ public static IScriptabilityModifier getVisibilityModifier( FeatureDescriptor descriptor ) { return (IScriptabilityModifier)descriptor.getValue( BeanInfoUtil.SCRIPT_VISIBILITY_MODIFIERS ); }
/** * @param descriptor A method or property descriptor. * @return The descriptor's associated visibility modifier. */ public static IScriptabilityModifier getVisibilityModifier( FeatureDescriptor descriptor ) { return (IScriptabilityModifier)descriptor.getValue( BeanInfoUtil.SCRIPT_VISIBILITY_MODIFIERS ); }
/** * Retrieves the value of the named FeatureDescriptor attribute. * * @return The value of the attribute. May be null if the attribute * is unknown. */ public Object getAttributeValue(FeatureDescriptor feature, String attributeName) { if (feature == null || attributeName == null) { return null; } return feature.getValue(attributeName); }
private boolean isTransient(FeatureDescriptor fd) { return Boolean.TRUE.equals(fd.getValue(TRANSIENT)); }
protected void attachEnvImpl(org.openide.explorer.propertysheet.PropertyEnv env) { stringValues = (String[]) env.getFeatureDescriptor().getValue( "stringValues"); //NOI18N }
final void readEnv (FeatureDescriptor d) { if (d instanceof Node.Property) { editable = ((Node.Property)d).canWrite(); } else if (d instanceof PropertyDescriptor) { editable = ((PropertyDescriptor)d).getWriteMethod() != null; } else { editable = true; } Object v = d.getValue ("item.separator"); // NOI18N if (v instanceof String) { separator = (String)v; } } }
/** Check the myriad ways in which a property may be non-editable */ static boolean checkEnabled(Component c, PropertyEditor editor, PropertyEnv env) { if (editor instanceof NoPropertyEditorEditor) { return false; } if (env != null) { Boolean canEditAsText = (Boolean) env.getFeatureDescriptor().getValue("canEditAsText"); // NOI18N if (!env.isEditable() || Boolean.FALSE.equals(canEditAsText)) { return false; } } return true; }
static boolean supportsValueIncrement( PropertyEnv env ) { if( null == env || null == env.getFeatureDescriptor() ) return false; Object o = env.getFeatureDescriptor().getValue( IncrementPropertyValueSupport.KEY_INCREMENT_VALUE_SUPPORT ); return o instanceof SpinnerModel; }
static void notifyEditingCancelled( PropertyEnv env ) { if( null == env || null == env.getFeatureDescriptor() ) return; Object o = env.getFeatureDescriptor().getValue( "nb.property.editor.callback" ); //NOI18N if( o instanceof PropertyChangeListener ) { ((PropertyChangeListener)o).propertyChange( new PropertyChangeEvent( env.getFeatureDescriptor(), "editingCancelled", null, Boolean.TRUE) ); //NOI18N } }
private TableCellRenderer getCustomRenderer( int row ) { FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row); if (fd instanceof PropertySet) return null; Object res = fd.getValue( "custom.cell.renderer"); //NOI18N if( res instanceof TableCellRenderer ) { prepareCustomEditor( res ); return ( TableCellRenderer ) res; } return null; }
private TableCellEditor getCustomEditor( int row ) { FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row); if (fd instanceof PropertySet) return null; Object res = fd.getValue( "custom.cell.editor"); //NOI18N if( res instanceof TableCellEditor ) { prepareCustomEditor( res ); return ( TableCellEditor ) res; } return null; }
private void updateIcon() { if (env != null) { Icon ic=null; FeatureDescriptor fd = env.getFeatureDescriptor(); if (env.getState() == env.STATE_INVALID) { ic = new ImageIcon( Utilities.loadImage ( "org/openide/resources/propertysheet/invalid.gif")); //NOI18N } else if (fd != null) { ic = (Icon) fd.getValue("valueIcon"); //NOI18N } setIcon(ic); needLayout=true; } }
private void updateIcon() { if (env != null) { Icon ic=null; FeatureDescriptor fd = env.getFeatureDescriptor(); if (env.getState() == env.STATE_INVALID) { ic = new ImageIcon( Utilities.loadImage ( "org/openide/resources/propertysheet/invalid.gif")); //NOI18N } else if (fd != null) { ic = (Icon) fd.getValue("valueIcon"); //NOI18N } setIcon(ic); needLayout=true; } }
/** Creates a new instance of ModelProperty */ private ModelProperty(PropertyModel pm) { super(pm.getPropertyType()); this.mdl = pm; if (mdl instanceof ExPropertyModel) { FeatureDescriptor fd = ((ExPropertyModel) mdl).getFeatureDescriptor(); Boolean result = (Boolean) fd.getValue("canEditAsText"); // NOI18N if (result != null) { this.setValue("canEditAsText", result); } } //System.err.println( //"Created ModelProperty wrapper for mystery PropertyModel " + pm); }
static Object getNextValue( PropertyEnv env, boolean increment ) { Object res = null; if( null != env && null != env.getFeatureDescriptor() ) { Object obj = env.getFeatureDescriptor().getValue( IncrementPropertyValueSupport.KEY_INCREMENT_VALUE_SUPPORT ); if( obj instanceof SpinnerModel ) { SpinnerModel spinner = ( SpinnerModel ) obj; res = increment ? spinner.getNextValue() : spinner.getPreviousValue(); } } return res; }
private void updateIcon() { if (env != null) { Icon ic = null; FeatureDescriptor fd = env.getFeatureDescriptor(); if (env.getState() == env.STATE_INVALID) { ic = ImageUtilities.loadImageIcon("org/openide/resources/propertysheet/invalid.gif", false); //NOI18N } else if (fd != null) { ic = (Icon) fd.getValue("valueIcon"); //NOI18N } setIcon(ic); needLayout = true; } }
@Override public void reset() { String targetValue = null; if (editor != null) { log("Combo editor reset setting selected item to " + editor.getAsText()); targetValue = editor.getAsText(); //issue 26367, form editor needs ability to set a custom value //when editing is initiated (event handler combos, part of them //cleaning up their EnhancedPropertyEditors). } if ((getClass() == ComboInplaceEditor.class) && (env != null) && (env.getFeatureDescriptor() != null)) { String initialEditValue = (String) env.getFeatureDescriptor().getValue("initialEditValue"); //NOI18N if (initialEditValue != null) { targetValue = initialEditValue; } } setSelectedItem(targetValue); }