Package org.nuiton.jaxx.widgets.select
Class BeanDoubleListHandler<O>
- java.lang.Object
-
- org.nuiton.jaxx.widgets.select.BeanDoubleListHandler<O>
-
- Type Parameters:
O- the type of the objects contained in the list.
- All Implemented Interfaces:
PropertyChangeListener,EventListener,UIHandler<BeanDoubleList<O>>
public class BeanDoubleListHandler<O> extends Object implements PropertyChangeListener, UIHandler<BeanDoubleList<O>>
The handler of aBeanDoubleList.- Since:
- 2.5.8
- Author:
- Kevin Morin - kmorin@codelutin.com
- See Also:
BeanDoubleList
-
-
Constructor Summary
Constructors Constructor Description BeanDoubleListHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilter(Predicate<O> filter)voidafterInit(BeanDoubleList<O> ui)voidbeforeInit(BeanDoubleList<O> ui)voidclearFilters()protected voidfireSelectionUpdate()Class<O>getBeanType()io.ultreia.java4all.decoration.DecoratorgetDecorator()MethodgetMutator()JPopupMenugetSelectedListPopup(boolean showIt)voidinit(io.ultreia.java4all.decoration.Decorator decorator, io.ultreia.java4all.decoration.Decorator decorator2, List<O> universe, List<O> selected)Initializes the handler of the UIvoidinit(io.ultreia.java4all.decoration.Decorator decorator, List<O> universe, List<O> selected)Initializes the handler of the UIvoidmoveDownSelected(O item)Move down a selected item.voidmoveUpSelected(O item)Move up a selected item.voidonKeyPressedOnSelectedList(KeyEvent e)voidonKeyPressedOnUniverseList(KeyEvent e)voidonSelectedListClicked(MouseEvent event)When selected list was double clicked, move selected items to universe list.voidonUniverseListClicked(MouseEvent event)When universe list was double clicked, move selected items to selected list.voidpropertyChange(PropertyChangeEvent evt)voidrecomputeButtonStates()voidrefreshFilteredElements()voidremoveFilter(Predicate<O> filter)voidselect()When add button was hit, move selected items (from universe list) to selected list.voidselectFirstRowIfNoSelection(FocusEvent e)protected voidsetHighlightFilterText(Boolean newValue)protected voidsetIndex(Integer oldValue, Integer newValue)Modifie l'index du décorateurvoidsetSelected(List<O> selection)protected voidsetSortOrder(Boolean oldValue, Boolean newValue)Modifie l'index du décorateurvoidsetUniverse(List<O> selection)voidsortData()Sort data of the model.voidtogglePopup()Toggle the popup visible state.voidunselect()When remove button was hit, move selected items (from selected list) to universe list.protected voidupdateUI(int index, boolean reversesort)
-
-
-
Field Detail
-
mutator
protected Method mutator
the mutator method on the property of boxed bean in the ui
-
ui
protected BeanDoubleList<O> ui
-
decorator
protected io.ultreia.java4all.decoration.Decorator decorator
the decorator of data
-
-
Method Detail
-
getSelectedListPopup
public JPopupMenu getSelectedListPopup(boolean showIt)
-
init
public void init(io.ultreia.java4all.decoration.Decorator decorator, List<O> universe, List<O> selected)Initializes the handler of the UI- Parameters:
decorator- the decorator to use to display the data nicelyuniverse- the list of all the available itemsselected- the list of selected items
-
init
public void init(io.ultreia.java4all.decoration.Decorator decorator, io.ultreia.java4all.decoration.Decorator decorator2, List<O> universe, List<O> selected)Initializes the handler of the UI- Parameters:
decorator- the decorator to use to display the data nicelydecorator2- the selected decorator to use to display the selected data nicely (if none, then reuse the first one)universe- the list of all the available itemsselected- the list of selected items
-
recomputeButtonStates
public void recomputeButtonStates()
-
togglePopup
public void togglePopup()
Toggle the popup visible state.
-
sortData
public void sortData()
Sort data of the model.- Since:
- 2.5.10
-
moveUpSelected
public void moveUpSelected(O item)
Move up a selected item.- Parameters:
item- the selected item- Since:
- 2.5.26
-
moveDownSelected
public void moveDownSelected(O item)
Move down a selected item.- Parameters:
item- the selected item- Since:
- 2.5.26
-
setIndex
protected void setIndex(Integer oldValue, Integer newValue)
Modifie l'index du décorateur- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
setSortOrder
protected void setSortOrder(Boolean oldValue, Boolean newValue)
Modifie l'index du décorateur- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
setHighlightFilterText
protected void setHighlightFilterText(Boolean newValue)
-
updateUI
protected void updateUI(int index, boolean reversesort)
-
onUniverseListClicked
public void onUniverseListClicked(MouseEvent event)
When universe list was double clicked, move selected items to selected list.- Parameters:
event- mouse event
-
onSelectedListClicked
public void onSelectedListClicked(MouseEvent event)
When selected list was double clicked, move selected items to universe list.- Parameters:
event- mouse event
-
select
public void select()
When add button was hit, move selected items (from universe list) to selected list.
-
unselect
public void unselect()
When remove button was hit, move selected items (from selected list) to universe list.
-
fireSelectionUpdate
protected void fireSelectionUpdate()
-
getMutator
public Method getMutator()
-
getDecorator
public io.ultreia.java4all.decoration.Decorator getDecorator()
-
getBeanType
public Class<O> getBeanType()
- Returns:
- get the type of objects contained in the comboBox model.
- Since:
- 2.5.9
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacePropertyChangeListener
-
clearFilters
public void clearFilters()
-
refreshFilteredElements
public void refreshFilteredElements()
-
onKeyPressedOnUniverseList
public void onKeyPressedOnUniverseList(KeyEvent e)
-
onKeyPressedOnSelectedList
public void onKeyPressedOnSelectedList(KeyEvent e)
-
selectFirstRowIfNoSelection
public void selectFirstRowIfNoSelection(FocusEvent e)
-
beforeInit
public void beforeInit(BeanDoubleList<O> ui)
- Specified by:
beforeInitin interfaceUIHandler<O>
-
afterInit
public void afterInit(BeanDoubleList<O> ui)
-
-