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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations