Example usage for org.eclipse.jface.preference IPreferenceStore setDefault

List of usage examples for org.eclipse.jface.preference IPreferenceStore setDefault

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore setDefault.

Prototype

void setDefault(String name, boolean value);

Source Link

Document

Sets the default value for the boolean-valued preference with the given name.

Usage

From source file:net.sf.guavaeclipse.preferences.PreferenceInitializer.java

License:Apache License

@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(SUPERCALL_STRATEGY_PREFERENCE, SMART_OPTION.name());
    store.setDefault(INSTANCEOF_CLASSEQUALS_PREFERENCE, INSTANCEOF.name());
    store.setDefault(FIELDS_GETTER_PREFERENCE, FIELDS.name());
    store.setDefault(HASH_CODE_STRATEGY_PREFERENCE, SMART_HASH_CODE.name());
    store.setDefault(HIDE_COMPARE_TO_PREFERENCE, Boolean.FALSE.toString());
}

From source file:net.sf.j2s.ui.preferences.PreferenceInitializer.java

License:Open Source License

public void initializeDefaultPreferences() {
    IPreferenceStore store = Java2ScriptUIPlugin.getDefault().getPreferenceStore();
    store.setDefault(PreferenceConstants.INNER_CONSOLE, true);
    store.setDefault(PreferenceConstants.ADDON_COMPATIABLE, true);
    //      store.setDefault(PreferenceConstants.P_STRING,
    //            "Default value");
}

From source file:net.sf.jmoney.preferences.PreferencePage.java

License:Open Source License

/**
 * Sets the default values of the preferences.
 *///w ww  . j  a v a 2 s .c o  m
private void initializeDefaults() {
    IPreferenceStore store = getPreferenceStore();
    store.setDefault("booleanPreference", true); //$NON-NLS-1$
    store.setDefault("dateFormat", "yyyy-MM-dd"); //$NON-NLS-1$ //$NON-NLS-2$
    store.setDefault("stringPreference", "Default value"); //$NON-NLS-1$ //$NON-NLS-2$
}

From source file:net.sf.smbt.ui.ableton.preferences.PreferenceInitializer.java

License:LGPL

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(PreferenceConstants.P_ABLETON_INPUT_PORT, 9001);
    store.setDefault(PreferenceConstants.P_ABLETON_IP_ADDRESS, "localhost");
    store.setDefault(PreferenceConstants.P_ABLETON_OUTPUT_PORT, 9000);
}

From source file:net.sf.smbt.ui.btc.prefs.BlockchainWalletPreferenceInitializer.java

License:LGPL

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_CONNECT_KEY, "rpc.blockchain.info");
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_PASSWORD_KEY, "");
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_USER_KEY, "");
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_PORT_KEY, 443);
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_SSL_KEY, true);
    store.setDefault(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_WALLET_ADDR_KEY, "");

}

From source file:net.sf.smbt.ui.btc.prefs.MtGoxWalletPreferenceInitializer.java

License:LGPL

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(MtGoxWalletPreferenceConstants.P_MTGOX_API_KEY, "");
    store.setDefault(MtGoxWalletPreferenceConstants.P_MTGOX_SECRET_KEY, "");
}

From source file:net.sf.smbt.ui.lemur.ui.prefs.JZMUIPreferenceInitializer.java

License:LGPL

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    store.setDefault(LemurPreferences.LEMUR_OSC0_TARGET_PREF.getLiteral(), "localhost:8000");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC0_PORT_IN_PREF.getLiteral(), "8001");
    store.setDefault(LemurPreferences.LEMUR_OSC1_TARGET_PREF.getLiteral(), "localhost:8100");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC1_PORT_IN_PREF.getLiteral(), "8101");
    store.setDefault(LemurPreferences.LEMUR_OSC2_TARGET_PREF.getLiteral(), "localhost:8200");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC2_PORT_IN_PREF.getLiteral(), "8201");
    store.setDefault(LemurPreferences.LEMUR_OSC3_TARGET_PREF.getLiteral(), "localhost:8300");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC3_PORT_IN_PREF.getLiteral(), "8301");
    store.setDefault(LemurPreferences.LEMUR_OSC4_TARGET_PREF.getLiteral(), "localhost:8400");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC4_PORT_IN_PREF.getLiteral(), "8401");
    store.setDefault(LemurPreferences.LEMUR_OSC5_TARGET_PREF.getLiteral(), "localhost:8500");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC5_PORT_IN_PREF.getLiteral(), "8501");
    store.setDefault(LemurPreferences.LEMUR_OSC6_TARGET_PREF.getLiteral(), "localhost:8600");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC6_PORT_IN_PREF.getLiteral(), "8601");
    store.setDefault(LemurPreferences.LEMUR_OSC7_TARGET_PREF.getLiteral(), "localhost:8700");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC7_PORT_IN_PREF.getLiteral(), "8701");
    store.setDefault(LemurPreferences.LEMUR_OSC8_TARGET_PREF.getLiteral(), "localhost:8800");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC8_PORT_IN_PREF.getLiteral(), "8801");
    store.setDefault(LemurPreferences.LEMUR_OSC9_TARGET_PREF.getLiteral(), "localhost:8900");
    store.setDefault(LemurIncomingPorts.LEMUR_OSC9_PORT_IN_PREF.getLiteral(), "8901");
}

From source file:net.sf.smbt.ui.lemur.ui.prefs.JZMUIPreferencePage.java

License:LGPL

public boolean performOk() {
    IPreferenceStore prefs = getPreferenceStore();
    prefs.setValue(LemurPreferences.LEMUR_OSC0_TARGET_PREF.getLiteral(), fieldEditorOSC0.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC0_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC0Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC1_TARGET_PREF.getLiteral(), fieldEditorOSC1.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC1_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC1Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC2_TARGET_PREF.getLiteral(), fieldEditorOSC2.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC2_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC2Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC3_TARGET_PREF.getLiteral(), fieldEditorOSC3.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC3_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC3Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC4_TARGET_PREF.getLiteral(), fieldEditorOSC4.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC4_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC4Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC5_TARGET_PREF.getLiteral(), fieldEditorOSC5.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC5_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC5Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC6_TARGET_PREF.getLiteral(), fieldEditorOSC6.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC6_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC6Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC7_TARGET_PREF.getLiteral(), fieldEditorOSC7.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC7_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC7Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC8_TARGET_PREF.getLiteral(), fieldEditorOSC8.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC8_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC8Ports.getStringValue());
    prefs.setValue(LemurPreferences.LEMUR_OSC9_TARGET_PREF.getLiteral(), fieldEditorOSC9.getStringValue());
    prefs.setDefault(LemurIncomingPorts.LEMUR_OSC9_PORT_IN_PREF.getLiteral(),
            fieldEditorOSC9Ports.getStringValue());
    return super.performOk();
}

From source file:net.sf.solareclipse.ui.preferences.ChainedPreferenceStore.java

License:Open Source License

public static void startPropagating(final IPreferenceStore source, final IPreferenceStore target,
        final Set keys) {
    for (Iterator i = keys.iterator(); i.hasNext();) {
        String key = (String) i.next();
        target.setDefault(key, source.getString(key));
    }//from w w w.  j  a v a 2  s  .co m

    source.addPropertyChangeListener(new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            String key = event.getProperty();

            if (keys.contains(key)) {
                target.setDefault(key, source.getString(key));
                if (target.isDefault(key)) {
                    target.firePropertyChangeEvent(key, event.getOldValue(), event.getNewValue());
                }
            }
        }
    });
}

From source file:net.sf.solareclipse.ui.preferences.OverlayPreferenceStore.java

License:Open Source License

private void loadProperty(IPreferenceStore orgin, PreferenceDescriptor key, IPreferenceStore target,
        boolean forceInitialization) {
    PreferenceDescriptor.Type d = key.type;
    if (PreferenceDescriptor.BOOLEAN == d) {
        if (forceInitialization) {
            target.setValue(key.key, true);
        }/* w  w w . j a v a  2s .c  o m*/
        target.setValue(key.key, orgin.getBoolean(key.key));
        target.setDefault(key.key, orgin.getDefaultBoolean(key.key));
    } else if (PreferenceDescriptor.DOUBLE == d) {
        if (forceInitialization) {
            target.setValue(key.key, 1.0D);
        }
        target.setValue(key.key, orgin.getDouble(key.key));
        target.setDefault(key.key, orgin.getDefaultDouble(key.key));
    } else if (PreferenceDescriptor.FLOAT == d) {
        if (forceInitialization) {
            target.setValue(key.key, 1.0F);
        }
        target.setValue(key.key, orgin.getFloat(key.key));
        target.setDefault(key.key, orgin.getDefaultFloat(key.key));
    } else if (PreferenceDescriptor.INT == d) {
        if (forceInitialization) {
            target.setValue(key.key, 1);
        }
        target.setValue(key.key, orgin.getInt(key.key));
        target.setDefault(key.key, orgin.getDefaultInt(key.key));
    } else if (PreferenceDescriptor.LONG == d) {
        if (forceInitialization) {
            target.setValue(key.key, 1L);
        }
        target.setValue(key.key, orgin.getLong(key.key));
        target.setDefault(key.key, orgin.getDefaultLong(key.key));
    } else if (PreferenceDescriptor.STRING == d) {
        if (forceInitialization) {
            target.setValue(key.key, "1"); //$NON-NLS-1$
        }
        target.setValue(key.key, orgin.getString(key.key));
        target.setDefault(key.key, orgin.getDefaultString(key.key));
    }
}