it.amattioli.applicate.commands
Class NullListEditor<T>

Show UML class diagram
java.lang.Object
  extended by it.amattioli.applicate.commands.NullListEditor<T>
All Implemented Interfaces:
ListEditor<T>, Selector<T>, it.amattioli.dominate.util.PropertyChangeEmitter

public class NullListEditor<T>
extends Object
implements ListEditor<T>


Constructor Summary
NullListEditor()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 T addRow(Object... param)
          Create a new object (and a corresponding editor) at the end of the list.
 void addSelectionListener(SelectionListener listener)
          Register a listener for the object selection.
 boolean canDeleteRow()
          Check if the currently selected object can be deleted.
 T deleteRow()
          Delete from the list the object (and the corresponding editor) currently selected.
 List<T> getEditingList()
          Retrieve the list that is being edited by this editor.
 BeanEditor<T> getElementEditor(int index)
          Retrieves the editor for the entity with the given index.
 Integer getSelectedIndex()
          Retrieves the index of the currently selected object.
 T getSelectedObject()
          Retrieves the currently selected object.
 boolean isEmptyRow()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removeSelectionListener(SelectionListener listener)
          Remove a listener from the collection of the listeners that will be notified when an object is slected in this browser.
 void select(int idx)
          Selected the object with the given index.
 void setEditingList(List<T> editingList)
          Set the list that has to be edited by this editor.
 void setEmptyRow(boolean emptyRow)
          Set the behavior of this editor when the editing list is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullListEditor

public NullListEditor()
Method Detail

addRow

public T addRow(Object... param)
Description copied from interface: ListEditor
Create a new object (and a corresponding editor) at the end of the list.

Specified by:
addRow in interface ListEditor<T>
Parameters:
param - a list of param that can be necessary for building a new entity instance
Returns:
the new entity

deleteRow

public T deleteRow()
Description copied from interface: ListEditor
Delete from the list the object (and the corresponding editor) currently selected.

Specified by:
deleteRow in interface ListEditor<T>
Returns:

canDeleteRow

public boolean canDeleteRow()
Description copied from interface: ListEditor
Check if the currently selected object can be deleted.

Specified by:
canDeleteRow in interface ListEditor<T>
Returns:
true if the currently selected object can be deleted, false otherwise

getEditingList

public List<T> getEditingList()
Description copied from interface: ListEditor
Retrieve the list that is being edited by this editor.

Specified by:
getEditingList in interface ListEditor<T>
Returns:
the list that is being edited by this editor

getElementEditor

public BeanEditor<T> getElementEditor(int index)
Description copied from interface: ListEditor
Retrieves the editor for the entity with the given index.

Specified by:
getElementEditor in interface ListEditor<T>
Returns:

getSelectedIndex

public Integer getSelectedIndex()
Description copied from interface: ListEditor
Retrieves the index of the currently selected object.

Specified by:
getSelectedIndex in interface ListEditor<T>
Returns:
the index of the currently selected object or null if no object is selected

getSelectedObject

public T getSelectedObject()
Description copied from interface: ListEditor
Retrieves the currently selected object.

Specified by:
getSelectedObject in interface ListEditor<T>
Specified by:
getSelectedObject in interface Selector<T>
Returns:
the currently selected object or null if no object is selected

isEmptyRow

public boolean isEmptyRow()
Specified by:
isEmptyRow in interface ListEditor<T>

select

public void select(int idx)
Description copied from interface: ListEditor
Selected the object with the given index.

Specified by:
select in interface ListEditor<T>
Parameters:
idx - the index of the object to be selected

setEditingList

public void setEditingList(List<T> editingList)
Description copied from interface: ListEditor
Set the list that has to be edited by this editor.

Specified by:
setEditingList in interface ListEditor<T>
Parameters:
editingList - the list that has to be edited by this editor

setEmptyRow

public void setEmptyRow(boolean emptyRow)
Description copied from interface: ListEditor
Set the behavior of this editor when the editing list is empty. If the emptyRow property is set to true the editor will automatically create a new row so the list will never be empty. If the property is set to false the list can be empty, so no new entity is created.

Specified by:
setEmptyRow in interface ListEditor<T>

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitter

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitter

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Description copied from interface: Selector
Register a listener for the object selection. Every time an object is selected in this browser all the registered objects will be notified.

Specified by:
addSelectionListener in interface Selector<T>
Parameters:
listener - the listener to be registered

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Description copied from interface: Selector
Remove a listener from the collection of the listeners that will be notified when an object is slected in this browser.

Specified by:
removeSelectionListener in interface Selector<T>
Parameters:
listener - the listener to be removed


Copyright © 2011. All Rights Reserved.