Example usage for org.eclipse.jface.preference PreferenceStore load

List of usage examples for org.eclipse.jface.preference PreferenceStore load

Introduction

In this page you can find the example usage for org.eclipse.jface.preference PreferenceStore load.

Prototype

public void load() throws IOException 

Source Link

Document

Loads this preference store from the file established in the constructor PreferenceStore(java.lang.String) (or by setFileName).

Usage

From source file:org.evosuite.eclipse.properties.EvoSuitePreferencePage.java

License:Open Source License

@Override
public void init(IWorkbench arg0) {
    try {//from w  ww. ja  v  a 2 s. co  m
        PreferenceStore prefStore = getPreferenceStore();
        prefStore.load();
    } catch (FileNotFoundException e) {
        // ignore if there is no file
    } catch (IOException e) {
        e.printStackTrace();
    }
    getPreferenceStore().setDefault(MARKERS_ENABLED, false);
    getPreferenceStore().setDefault(RUNTIME, 30);
    getPreferenceStore().setDefault(ROAMTIME, 240);
    getPreferenceStore().setDefault(UNCOVERED_MARKER, false);
    getPreferenceStore().setDefault(REMOVED_MARKER, false);
    getPreferenceStore().setDefault(AUTOMATIC_TEST_ON_SAVE, false);
    getPreferenceStore().setDefault(ORGANIZE_IMPORTS, true);
    getPreferenceStore().setDefault(TEST_COMMENTS, false);

    storeDefaults();
    //getPreferenceStore().
}

From source file:tarlog.encoder.tool.ui.EncoderUI.java

License:Apache License

private void initEncodersStore() {
    try {//from  w  w  w  .j  a  va2 s. c  o  m
        IPreferenceStore preferenceStore;
        if (standalone) {
            PreferenceStore store = new PreferenceStore(EncoderTool.ENCODER_PROPERTIES);
            store.load();
            preferenceStore = store;
        } else {
            preferenceStore = Activator.getDefault().getPreferenceStore();
        }
        propertiesStore = new PropertiesStore(preferenceStore, false);
    } catch (MalformedURLException e) {
        Utils.showException(shell, e);
    } catch (IOException e) {
        Utils.showException(shell, e);
    }
}