use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class DeedsExplorerWindowController method initDeedsTable.
private void initDeedsTable() {
TypedProperties prefs = GlobalPreferences.getGlobalProperties("DeedsExplorer");
_tableController = new DeedsTableController(prefs, _filter);
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
String action = event.getActionCommand();
if (DeedsTableController.DOUBLE_CLICK.equals(action)) {
DeedDescription deed = (DeedDescription) event.getSource();
DeedDisplayWindowController window = new DeedDisplayWindowController(DeedsExplorerWindowController.this);
window.setDeed(deed);
window.show(false);
}
}
};
_tableController.addActionListener(al);
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class CharacterUiUtils method buildServerCombo.
/**
* Build a server combobox.
* @return a server combobox.
*/
public static ComboBoxController<String> buildServerCombo() {
ComboBoxController<String> ctrl = new ComboBoxController<String>();
List<String> servers = Config.getInstance().getServerNames();
for (String server : servers) {
ctrl.addItem(server, server);
}
TypedProperties props = Config.getInstance().getParameters();
String defaultServer = props.getStringProperty("default.server", null);
ctrl.selectItem(defaultServer);
return ctrl;
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class DeedsManagementController method buildDeedsTable.
private DeedsTableController buildDeedsTable() {
TypedProperties prefs = GlobalPreferences.getGlobalProperties("DeedsEditor");
DeedsTableController tableController = new DeedsTableController(prefs, null);
tableController.addActionListener(this);
return tableController;
}
use of delta.common.utils.misc.TypedProperties 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;
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class CharacterPreferencesManager method getUserProperties.
/**
* Get the preferences for a character.
* @param toonFile Character file.
* @param id Identifier of the preferences set.
* @return Some properties or <code>null</code> if not managed.
*/
public static TypedProperties getUserProperties(CharacterFile toonFile, String id) {
TypedProperties props = null;
if (id.startsWith(ItemChoiceWindowController.ITEM_CHOOSER_PROPERTIES_ID)) {
if (toonFile != null) {
Preferences prefs = toonFile.getPreferences();
props = prefs.getPreferences(id);
List<String> columnIds = props.getStringList(ItemChoiceWindowController.COLUMNS_PROPERTY);
if (columnIds == null) {
String slotKey = id.substring(id.indexOf("#") + 1);
EQUIMENT_SLOT slot = EQUIMENT_SLOT.valueOf(slotKey);
CharacterClass characterClass = toonFile.getSummary().getCharacterClass();
ItemChoiceTableColumnsManager mgr = new ItemChoiceTableColumnsManager();
columnIds = mgr.getItemChoiceColumns(characterClass, slot);
props.setStringList(ItemChoiceWindowController.COLUMNS_PROPERTY, columnIds);
prefs.savePreferences(props);
}
}
} else if (ItemChoiceWindowController.ESSENCE_CHOOSER_PROPERTIES_ID.equals(id)) {
Preferences prefs = toonFile.getPreferences();
props = prefs.getPreferences(id);
List<String> columnIds = props.getStringList(ItemChoiceWindowController.COLUMNS_PROPERTY);
if (columnIds == null) {
CharacterClass characterClass = toonFile.getSummary().getCharacterClass();
ItemChoiceTableColumnsManager mgr = new ItemChoiceTableColumnsManager();
columnIds = mgr.getEssenceChoiceColumns(characterClass);
props.setStringList(ItemChoiceWindowController.COLUMNS_PROPERTY, columnIds);
prefs.savePreferences(props);
}
}
return props;
}
Aggregations