|
|||||||||
| 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.threerings.admin.client.DSetEditor<E>
public class DSetEditor<E extends DSet.Entry>
Allows simple editing of DSets within a distributed object.
| Nested Class Summary | |
|---|---|
static interface |
DSetEditor.Accessor<F extends DSet.Entry>
An interface for a plugin defining how the editor interacts with its underlying data. |
protected class |
DSetEditor.DObjectAccessor<F extends E>
|
| 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 DSetEditor.Accessor<E> |
_accessor
Provides access to our data we're editing. |
protected String[] |
_displayFields
|
protected String[] |
_editableFields
|
protected Class<?> |
_entryClass
|
protected Predicate<E> |
_entryFilter
An optional predicate to decide whether actually care about displaying a given entry. |
protected ObjectEditorTable.FieldInterpreter |
_interp
|
protected ComparableArrayList<Comparable<Object>> |
_keys
An array we use to track our entries' positions by key. |
protected String |
_setName
The name of the set in that object. |
protected ObjectEditorTable |
_table
The table used to edit. |
protected static int |
MIN_HEIGHT
The minimum height for our editor UI. |
| 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 | |
|---|---|
DSetEditor(DObject setter,
String setName,
Class<?> entryClass)
Construct a DSet editor to merely display the specified set. |
|
DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields)
Construct a DSetEditor, allowing the specified fields to be edited. |
|
DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields,
ObjectEditorTable.FieldInterpreter interp)
Construct a DSetEditor with a custom FieldInterpreter. |
|
DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields,
ObjectEditorTable.FieldInterpreter interp,
String[] displayFields,
Predicate<E> entryFilter)
Construct a DSetEditor that only displays entries that match the given Predicate. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent event)
|
protected void |
addEntry(E entry)
Handles the addition of an entry, assuming our filter allows it. |
void |
addNotify()
|
Predicate<E> |
getFilter()
|
protected static Comparable<Object> |
getKey(DSet.Entry entry)
|
Dimension |
getPreferredSize()
|
DSet.Entry |
getSelectedEntry()
Get the currently selected entry. |
String |
getSetName()
|
JTable |
getTable()
Get the table being used to display the set. |
protected void |
removeKey(Comparable<?> key)
Takes care of removing a key from |
void |
removeNotify()
|
void |
setAccessor(DSetEditor.Accessor<E> accessor)
Sets the logic for how this editor interacts with its underlying data. |
void |
setData(ComparableArrayList<Comparable<Object>> keys,
Collection<?> data)
|
| 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 String _setName
protected Predicate<E extends DSet.Entry> _entryFilter
protected DSetEditor.Accessor<E extends DSet.Entry> _accessor
protected ObjectEditorTable _table
protected ComparableArrayList<Comparable<Object>> _keys
protected Class<?> _entryClass
protected String[] _editableFields
protected ObjectEditorTable.FieldInterpreter _interp
protected String[] _displayFields
protected static final int MIN_HEIGHT
| Constructor Detail |
|---|
public DSetEditor(DObject setter,
String setName,
Class<?> entryClass)
setter - The object that contains the set.setName - The name of the set in the object.entryClass - The Class of the DSet.Entry elements contained in the set.
public DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields)
setter - The object that contains the set.setName - The name of the set in the object.entryClass - The Class of the DSet.Entry elements contained in the set.editableFields - the names of the fields in the entryClass that should be editable.
public DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields,
ObjectEditorTable.FieldInterpreter interp)
setter - The object that contains the set.setName - The name of the set in the object.entryClass - the Class of the DSet.Entry elements contained in the set.editableFields - The names of the fields in the entryClass that should be editable.interp - The FieldInterpreter to use.
public DSetEditor(DObject setter,
String setName,
Class<?> entryClass,
String[] editableFields,
ObjectEditorTable.FieldInterpreter interp,
String[] displayFields,
Predicate<E> entryFilter)
setter - The object that contains the set.setName - The name of the set in the object.entryClass - The Class of the DSet.Entry elements contained in the set.editableFields - The names of the fields in the entryClass that should be editable.interp - The FieldInterpreter to use.displayFields - The fields to display, or null for all.entryFilter - The Predicate to use.| Method Detail |
|---|
public void setAccessor(DSetEditor.Accessor<E> accessor)
public JTable getTable()
public DSet.Entry getSelectedEntry()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void addNotify()
addNotify in class JComponentpublic void removeNotify()
removeNotify in class JComponentprotected void addEntry(E entry)
protected void removeKey(Comparable<?> key)
public void actionPerformed(ActionEvent event)
actionPerformed in interface ActionListener
public void setData(ComparableArrayList<Comparable<Object>> keys,
Collection<?> data)
public Predicate<E> getFilter()
public String getSetName()
protected static Comparable<Object> getKey(DSet.Entry entry)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||