org.netbeans.modules.jellytools.platform/3 3.13

org.netbeans.jellytools.properties
Class Property

java.lang.Object
  extended by org.netbeans.jellytools.properties.Property
Direct Known Subclasses:
ClasspathProperty, ColorProperty, DimensionProperty, FileProperty, FontProperty, PointProperty, ProcessDescriptorProperty, RectangleProperty, StringArrayProperty, StringProperty

public class Property
extends Object

Handles properties in IDE property sheets. Properties are grouped in property sheet. Their are identified by their display names. Once you have created a Property instance you can get value, set a new text value, set a new value by index of possible options or open custom editor.

Usage:

        PropertySheetOperator pso = new PropertySheetOperator("Properties of MyClass");
        Property p = new Property(pso, "Name");
        System.out.println("\nProperty name="+p.getName());
        System.out.println("\nProperty value="+p.getValue());
        p.setValue("ANewValue");
        // set a new value by index where it is applicable
        //p.setValue(2);
        // open custom editor where it is applicable
        //p.openEditor();
 

See Also:
PropertySheetOperator

Field Summary
static String CHECKBOX_RENDERER
          Class name of check box renderer.
static String COMBOBOX_RENDERER
          Class name of combo box renderer.
protected  Node.Property property
          Instance of Node.Property.
protected  PropertySheetOperator propertySheetOper
          Property sheet where this property resides.
static String RADIOBUTTON_RENDERER
          Class name of radio button renderer.
static String SET_RENDERER
          Class name of set renderer.
static String STRING_RENDERER
          Class name of string renderer.
 
Constructor Summary
Property(PropertySheetOperator propertySheetOper, int index)
          Waits for index-th property in specified property sheet.
Property(PropertySheetOperator propertySheetOper, String name)
          Waits for property with given name in specified property sheet.
 
Method Summary
 boolean canEditAsText()
          Returns true if this property can be edited as text by inplace text field.
 String getName()
          Gets display name of this property.
 String getRendererName()
          Returns class name of renderer used to render this property.
 int getRow()
           
 String getShortDescription()
          Gets short description for this property.
 String getValue()
          Gets string representation of property value.
 boolean isEnabled()
          Returns true if this property is enabled in property sheet, that means it is possible to change its value by inplace editor.
 void openEditor()
          Opens custom property editor for the property by click on "..." button.
 void setDefaultValue()
          Sets default value for this property.
 void setValue(int index)
          Sets value of this property by given index.
 void setValue(String textValue)
          Sets value of this property to specified text.
 boolean supportsCustomEditor()
          Checks whether this property supports custom editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_RENDERER

public static final String STRING_RENDERER
Class name of string renderer.

See Also:
Constant Field Values

CHECKBOX_RENDERER

public static final String CHECKBOX_RENDERER
Class name of check box renderer.

See Also:
Constant Field Values

COMBOBOX_RENDERER

public static final String COMBOBOX_RENDERER
Class name of combo box renderer.

See Also:
Constant Field Values

RADIOBUTTON_RENDERER

public static final String RADIOBUTTON_RENDERER
Class name of radio button renderer.

See Also:
Constant Field Values

SET_RENDERER

public static final String SET_RENDERER
Class name of set renderer.

See Also:
Constant Field Values

property

protected Node.Property property
Instance of Node.Property.


propertySheetOper

protected PropertySheetOperator propertySheetOper
Property sheet where this property resides.

Constructor Detail

Property

public Property(PropertySheetOperator propertySheetOper,
                String name)
Waits for property with given name in specified property sheet.

Parameters:
propertySheetOper - PropertySheetOperator where to find property.
name - property display name

Property

public Property(PropertySheetOperator propertySheetOper,
                int index)
Waits for index-th property in specified property sheet.

Parameters:
propertySheetOper - PropertySheetOperator where to find property.
index - index (row number) of property inside property sheet (starts at 0). If there categories shown in property sheet, rows occupied by their names must by added to index.
Method Detail

getName

public String getName()
Gets display name of this property. It can differ from name given in constructor when only substring of property name is used there.

Returns:
display name of property

getValue

public String getValue()
Gets string representation of property value.

Returns:
value of property

setValue

public void setValue(String textValue)
Sets value of this property to specified text. If a new value is not accepted, an information or error dialog is displayed by IDE. If property is not writable JemmyException is thrown.

Parameters:
textValue - text to be set in property (e.g. "a new value", "a new item from list", "false", "TRUE")

setValue

public void setValue(int index)
Sets value of this property by given index. It is applicable for properties which can be changed by combo box. If property doesn't support changing value by index JemmyException is thrown.

Parameters:
index - index of item to be selected from possible options

openEditor

public void openEditor()
Opens custom property editor for the property by click on "..." button. It checks whether this property supports custom editor by method supportsCustomEditor().


supportsCustomEditor

public boolean supportsCustomEditor()
Checks whether this property supports custom editor.

Returns:
true is property supports custom editor, false otherwise

setDefaultValue

public void setDefaultValue()
Sets default value for this property. If default value is not available, it does nothing.


isEnabled

public boolean isEnabled()
Returns true if this property is enabled in property sheet, that means it is possible to change its value by inplace editor.

Returns:
true if this property is enabled, false otherwise

canEditAsText

public boolean canEditAsText()
Returns true if this property can be edited as text by inplace text field. It can be both for string renderer or combo box renderer.

Returns:
true if this property can be edited, false otherwise

getRendererName

public String getRendererName()
Returns class name of renderer used to render this property. It can be used to determine whether correct renderer is used. Possible values are defined in constants STRING_RENDERER, CHECKBOX_RENDERER, COMBOBOX_RENDERER, RADIOBUTTON_RENDERER, SET_RENDERER.

Returns:
class name of renderer used to render this property:
  • org.openide.explorer.propertysheet.RendererFactory$StringRenderer
  • org.openide.explorer.propertysheet.RendererFactory$CheckboxRenderer
  • org.openide.explorer.propertysheet.RendererFactory$ComboboxRenderer
  • org.openide.explorer.propertysheet.RendererFactory$RadioButtonRenderer
  • org.openide.explorer.propertysheet.RendererFactory$SetRenderer
See Also:
STRING_RENDERER, CHECKBOX_RENDERER, COMBOBOX_RENDERER, RADIOBUTTON_RENDERER, SET_RENDERER

getShortDescription

public String getShortDescription()
Gets short description for this property. Short description is also used in tooltip.

Returns:
short description for this property.

getRow

public int getRow()

org.netbeans.modules.jellytools.platform/3 3.13

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.