Search in sources :

Example 11 with ItemSelectionListener

use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.

the class DeedFilterController method buildSkillsCombobox.

private ComboBoxController<String> buildSkillsCombobox() {
    ComboBoxController<String> combo = DeedUiUtils.buildSkillsCombo();
    ItemSelectionListener<String> listener = new ItemSelectionListener<String>() {

        @Override
        public void itemSelected(String skill) {
            SkillRewardFilter filter = _filter.getSkillFilter();
            filter.setSkill(skill);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) SkillRewardFilter(delta.games.lotro.common.rewards.filters.SkillRewardFilter)

Example 12 with ItemSelectionListener

use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.

the class DeedFilterController method buildDeedPanel.

private JPanel buildDeedPanel() {
    JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
    int y = 0;
    JPanel line1Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
    // Label filter
    {
        JPanel containsPanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
        containsPanel.add(GuiFactory.buildLabel("Name filter:"));
        _contains = GuiFactory.buildTextField("");
        _contains.setColumns(20);
        containsPanel.add(_contains);
        TextListener listener = new TextListener() {

            @Override
            public void textChanged(String newText) {
                if (newText.length() == 0)
                    newText = null;
                DeedNameFilter nameFilter = _filter.getNameFilter();
                nameFilter.setPattern(newText);
                filterUpdated();
            }
        };
        _textController = new DynamicTextEditionController(_contains, listener);
        line1Panel.add(containsPanel);
    }
    GridBagConstraints c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
    panel.add(line1Panel, c);
    y++;
    JPanel line2Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
    // Type
    {
        JLabel label = GuiFactory.buildLabel("Type:");
        line2Panel.add(label);
        _type = DeedUiUtils.buildDeedTypeCombo();
        ItemSelectionListener<DeedType> typeListener = new ItemSelectionListener<DeedType>() {

            @Override
            public void itemSelected(DeedType type) {
                DeedTypeFilter typeFilter = _filter.getTypeFilter();
                typeFilter.setDeedType(type);
                filterUpdated();
            }
        };
        _type.addListener(typeListener);
        line2Panel.add(_type.getComboBox());
    }
    // Category
    {
        JLabel label = GuiFactory.buildLabel("Category:");
        line2Panel.add(label);
        _category = DeedUiUtils.buildCategoryCombo();
        ItemSelectionListener<String> categoryListener = new ItemSelectionListener<String>() {

            @Override
            public void itemSelected(String category) {
                DeedCategoryFilter categoryFilter = _filter.getCategoryFilter();
                categoryFilter.setDeedCategory(category);
                filterUpdated();
            }
        };
        _category.addListener(categoryListener);
        line2Panel.add(_category.getComboBox());
    }
    c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
    panel.add(line2Panel, c);
    y++;
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) JLabel(javax.swing.JLabel) TextListener(delta.common.ui.swing.text.TextListener) DeedTypeFilter(delta.games.lotro.lore.deeds.filters.DeedTypeFilter) DynamicTextEditionController(delta.common.ui.swing.text.DynamicTextEditionController) DeedCategoryFilter(delta.games.lotro.lore.deeds.filters.DeedCategoryFilter) DeedNameFilter(delta.games.lotro.lore.deeds.filters.DeedNameFilter) DeedType(delta.games.lotro.lore.deeds.DeedType)

Example 13 with ItemSelectionListener

use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.

the class DeedFilterController method buildTraitsCombobox.

private ComboBoxController<String> buildTraitsCombobox() {
    ComboBoxController<String> combo = DeedUiUtils.buildTraitsCombo();
    ItemSelectionListener<String> listener = new ItemSelectionListener<String>() {

        @Override
        public void itemSelected(String trait) {
            TraitRewardFilter filter = _filter.getTraitFilter();
            filter.setTrait(trait);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : TraitRewardFilter(delta.games.lotro.common.rewards.filters.TraitRewardFilter) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener)

Example 14 with ItemSelectionListener

use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.

the class DeedFilterController method buildItemsCombobox.

private ComboBoxController<Integer> buildItemsCombobox() {
    ComboBoxController<Integer> combo = DeedUiUtils.buildItemsCombo();
    ItemSelectionListener<Integer> listener = new ItemSelectionListener<Integer>() {

        @Override
        public void itemSelected(Integer itemId) {
            ItemRewardFilter filter = _filter.getItemFilter();
            filter.setItemId(itemId);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) ItemRewardFilter(delta.games.lotro.common.rewards.filters.ItemRewardFilter)

Example 15 with ItemSelectionListener

use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.

the class DeedFilterController method buildVirtuesCombobox.

private ComboBoxController<VirtueId> buildVirtuesCombobox() {
    ComboBoxController<VirtueId> combo = DeedUiUtils.buildVirtueCombo();
    ItemSelectionListener<VirtueId> listener = new ItemSelectionListener<VirtueId>() {

        @Override
        public void itemSelected(VirtueId virtueId) {
            VirtueRewardFilter filter = _filter.getVirtueFilter();
            filter.setVirtueId(virtueId);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : VirtueId(delta.games.lotro.common.VirtueId) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) VirtueRewardFilter(delta.games.lotro.common.rewards.filters.VirtueRewardFilter)

Aggregations

ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)23 JPanel (javax.swing.JPanel)10 FlowLayout (java.awt.FlowLayout)8 GridBagConstraints (java.awt.GridBagConstraints)7 GridBagLayout (java.awt.GridBagLayout)7 Insets (java.awt.Insets)7 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)2 DynamicTextEditionController (delta.common.ui.swing.text.DynamicTextEditionController)2 TextListener (delta.common.ui.swing.text.TextListener)2 Race (delta.games.lotro.common.Race)2 Profession (delta.games.lotro.lore.crafting.Profession)2 JLabel (javax.swing.JLabel)2 IntegerEditionController (delta.common.ui.swing.text.IntegerEditionController)1 DateEditionController (delta.common.ui.swing.text.dates.DateEditionController)1 TypedProperties (delta.common.utils.misc.TypedProperties)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1 LogItemType (delta.games.lotro.character.log.CharacterLogItem.LogItemType)1 CharacterClass (delta.games.lotro.common.CharacterClass)1 Size (delta.games.lotro.common.Size)1 VirtueId (delta.games.lotro.common.VirtueId)1