Custom Property Editors
Three kinds of editors
Text
Finite set of choices
Arbitrary painting and editing
Implement
PropertyEditor
interface
Or extend
PropertyEditorSupport
class
Editing Text Properties
Convert between your type and
String
Define two methods
public String getAsText() public void setAsText(String s)
Property sheet uses text field
Editing Choice Properties
Your type has finite set of string choices
E.g.
DrawMode.DRAW
,
DrawMode.FILL
String[] getTags()
returns array of choices
Also need to define
getAsText/setAsText
Property sheet uses combo box
previous
|
start
|
next
.... [Slide 67] ....