|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.samskivert.swing.CollapsiblePanel
com.threerings.editor.swing.BasePropertyEditor
com.threerings.editor.swing.PropertyEditor
public abstract class PropertyEditor
Edits a single object property.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static HashMap<String,Class<? extends PropertyEditor>> |
_classesByName
Maps names to editor classes. |
protected static HashMap<Class<?>,Class<? extends PropertyEditor>> |
_classesByType
Maps types to editor classes. |
protected EditorContext |
_ctx
Provides access to common services. |
protected Property[] |
_lineage
The ancestors of the property (if any), followed by the property itself. |
protected Object |
_object
The object being edited. |
protected Property |
_property
The property being edited. |
| Fields inherited from class com.threerings.editor.swing.BasePropertyEditor |
|---|
_collapseIcon, _expandIcon, _highlight, _highlighted, _highlightIcon, _msgmgr, _msgs, BASE_BACKGROUND, DEFAULT_BACKGROUND, PANEL_BUTTON_SIZE, SHADE_DECREMENT |
| Fields inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
_content, _downIcon, _trigger, _upIcon |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PropertyEditor()
|
|
| Method Summary | |
|---|---|
static PropertyEditor |
createEditor(EditorContext ctx,
Property property,
Property[] ancestors)
Creates a property editor for the specified object property. |
protected void |
didInit()
Override to perform custom initialization. |
protected static Object |
getDefaultInstance(Class<?> type,
Object outer)
Returns a default instance for the supplied type, either by instantiating it with its no-arg constructor or by obtaining some type-specific default; |
protected double |
getMaximum()
Gets the maximum value by walking up the lineage. |
protected int |
getMaxSize()
Gets the maximum size by walking up the lineage. |
protected double |
getMinimum()
Gets the minimum value by walking up the lineage. |
protected int |
getMinSize()
Gets the minimum size by walking up the lineage. |
protected String |
getMode()
Gets the mode string by walking up the lineage. |
Object |
getObject()
Returns a reference to the object being edited. |
Property |
getProperty()
Returns a reference to the edited property. |
protected int |
getPropertyColor()
Returns the base color for this property. |
protected String |
getPropertyLabel()
Returns the name of the property, translating it if a translation exists. |
protected double |
getScale()
Gets the scale by walking up the lineage. |
protected double |
getStep()
Gets the step by walking up the lineage. |
protected String |
getUnits()
Gets the units string by walking up the lineage. |
void |
init(EditorContext ctx,
Property property,
Property[] ancestors)
Initializes the editor with its object and property references. |
protected static boolean |
isTableCellType(Class<?> type)
Checks whether the supplied type can be edited in the cell of a table. |
static void |
registerEditorClass(Class<?> type,
Class<? extends PropertyEditor> clazz)
Adds a custom editor class for properties of the given type. |
static void |
registerEditorClass(String name,
Class<? extends PropertyEditor> clazz)
Adds a custom editor by name. |
void |
setObject(Object object)
Sets the object being edited. |
abstract void |
update()
Updates the state of the editor from the object. |
| Methods inherited from class com.threerings.editor.swing.BasePropertyEditor |
|---|
actionPerformed, addChangeListener, copyPropertyPath, createButton, darkenColor, fireStateChanged, getBackgroundColor, getColor, getColor, getColor, getDarkerBackground, getLabel, getLabel, getLabel, getLabel, getLabels, getLabels, getLabels, getMousePath, getMousePath, getPropertyColor, loadIcon, makeCollapsible, removeChangeListener, updateBorder |
| Methods inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
getContent, isCollapsed, setCollapsed, setGap, setTrigger, setTriggerContainer, setTriggerContainer, setTriggerContainer |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EditorContext _ctx
protected Property _property
protected Property[] _lineage
protected Object _object
protected static HashMap<String,Class<? extends PropertyEditor>> _classesByName
protected static HashMap<Class<?>,Class<? extends PropertyEditor>> _classesByType
| Constructor Detail |
|---|
public PropertyEditor()
| Method Detail |
|---|
public static PropertyEditor createEditor(EditorContext ctx,
Property property,
Property[] ancestors)
ancestors - the ancestor properties from which to inherit constraints, if any.
public static void registerEditorClass(Class<?> type,
Class<? extends PropertyEditor> clazz)
public static void registerEditorClass(String name,
Class<? extends PropertyEditor> clazz)
public void init(EditorContext ctx,
Property property,
Property[] ancestors)
public Property getProperty()
public void setObject(Object object)
public Object getObject()
public abstract void update()
protected void didInit()
protected String getPropertyLabel()
protected int getPropertyColor()
protected String getMode()
protected String getUnits()
protected double getMinimum()
protected double getMaximum()
protected double getStep()
protected double getScale()
protected int getMinSize()
protected int getMaxSize()
protected static boolean isTableCellType(Class<?> type)
protected static Object getDefaultInstance(Class<?> type,
Object outer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||