Search in sources :

Example 1 with ItemFilterConfiguration

use of delta.games.lotro.gui.items.ItemFilterConfiguration in project lotro-companion by dmorcellet.

the class EquipmentPanelController method chooseItem.

private Item chooseItem(EQUIMENT_SLOT slot, List<Item> items) {
    ItemsManager itemsManager = new ItemsManager(items);
    List<Item> selectedItems = itemsManager.getItems(_toonData, slot);
    ItemFilterConfiguration cfg = new ItemFilterConfiguration();
    cfg.initFromItems(selectedItems);
    ItemFilterController filterController = new ItemFilterController(cfg);
    Filter<Item> filter = filterController.getFilter();
    String id = ItemChoiceWindowController.ITEM_CHOOSER_PROPERTIES_ID + "#" + slot.name();
    TypedProperties props = _parentWindow.getUserProperties(id);
    ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(_parentWindow, props, selectedItems, filter, filterController);
    Item ret = choiceCtrl.editModal();
    return ret;
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) ItemsManager(delta.games.lotro.lore.items.ItemsManager) ItemChoiceWindowController(delta.games.lotro.gui.items.ItemChoiceWindowController) ItemFilterController(delta.games.lotro.gui.items.ItemFilterController) TypedProperties(delta.common.utils.misc.TypedProperties) ItemFilterConfiguration(delta.games.lotro.gui.items.ItemFilterConfiguration)

Aggregations

TypedProperties (delta.common.utils.misc.TypedProperties)1 ItemChoiceWindowController (delta.games.lotro.gui.items.ItemChoiceWindowController)1 ItemFilterConfiguration (delta.games.lotro.gui.items.ItemFilterConfiguration)1 ItemFilterController (delta.games.lotro.gui.items.ItemFilterController)1 Item (delta.games.lotro.lore.items.Item)1 ItemsManager (delta.games.lotro.lore.items.ItemsManager)1 JMenuItem (javax.swing.JMenuItem)1