Package org.openstreetmap.josm.data.Preferences

Examples of org.openstreetmap.josm.data.Preferences.StringSetting


        PrefEntry pe = null;
        boolean ok = false;
        if (dlg.getValue() == 1) {
            if (rbString.isSelected()) {
                StringSetting sSetting = new StringSetting(null);
                pe = new PrefEntry(tkey.getText(), sSetting, sSetting, false);
                StringEditor sEditor = new StringEditor(gui, pe, sSetting);
                sEditor.showDialog();
                if (sEditor.getValue() == 1) {
                    String data = sEditor.getData();
                    if (!Objects.equals(sSetting.getValue(), data)) {
                        pe.setValue(new StringSetting(data));
                        ok = true;
                    }
                }
            } else if (rbList.isSelected()) {
                ListSetting lSetting = new ListSetting(null);
View Full Code Here


        @Override
        public void setValueAt(Object o, int row, int column) {
            PrefEntry pe = displayData.get(row);
            String s = (String) o;
            if (!s.equals(pe.getValue().getValue())) {
                pe.setValue(new StringSetting(s));
                fireTableCellUpdated(row, column);
            }
        }
View Full Code Here

        }

        @Override
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            PrefEntry pe = (PrefEntry) value;
            StringSetting stg = (StringSetting) pe.getValue();
            String s = stg.getValue() == null ? "" : stg.getValue();
            return super.getTableCellEditorComponent(table, s, isSelected, row, column);
        }
View Full Code Here

        private static void deletePreferenceValues(Preferences fragment, Preferences mainpref) {

            for (Entry<String, Setting<?>> entry : fragment.settingsMap.entrySet()) {
                String key = entry.getKey();
                if (entry.getValue() instanceof StringSetting) {
                    StringSetting sSetting = (StringSetting) entry.getValue();
                    // if mentioned value found, delete it
                    if (sSetting.equals(mainpref.settingsMap.get(key))) {
                        mainpref.put(key, null);
                    }
                } else if (entry.getValue() instanceof ListSetting) {
                    ListSetting lSetting = (ListSetting) entry.getValue();
                    Collection<String> newItems = getCollection(mainpref, key, true);
View Full Code Here

        tmpPref.settingsMap.clear();

        Map<String, Setting<?>> tmp = new HashMap<>();
        for (Entry<String, String> e : stringMap.entrySet()) {
            tmp.put(e.getKey(), new StringSetting(e.getValue()));
        }
        for (Entry<String, List<String>> e : listMap.entrySet()) {
            tmp.put(e.getKey(), new ListSetting(e.getValue()));
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.Preferences.StringSetting

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.