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

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

Introduction

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

Prototype

void setValue(String name, boolean value);

Source Link

Document

Sets the current value of the boolean-valued preference with the given name.

Usage

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

public void setLintOnSave(boolean on) {
    mLintOnSave = on;/*from w w w.j  av a 2s.  com*/
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_LINT_ON_SAVE, on);
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

public void setLintOnExport(boolean on) {
    mLintOnExport = on;/* w ww .ja va2s .c o  m*/
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_LINT_ON_EXPORT, on);
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Sets whether the layout editor should share a single editor for all variations
 * of a single resource/*from  www  .  j  a  v a2 s  .c  o  m*/
 *
 * @param on if true, use a single editor
 */
public void setSharedLayoutEditor(boolean on) {
    mSharedLayoutEditor = on;
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_SHARED_LAYOUT_EDITOR, on);

    // TODO: If enabling a shared editor, go and close all editors that are aliasing
    // the same resource except for one of them.
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

public void setPaletteModes(String palette) {
    mPalette = palette;/* w  w w  .  j av  a2  s . c  o  m*/

    // need to save this new value to the store
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_PALETTE_MODE, palette);
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

public void setMonitorDensity(float density) {
    mMonitorDensity = density;/* www . ja  va2  s  . c  o m*/

    // need to save this new value to the store
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_MONITOR_DENSITY, density);
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Sets the new location of the SDK/*  w  w  w .  j ava  2s.com*/
 *
 * @param location the location of the SDK
 */
public void setSdkLocation(File location) {
    mOsSdkLocation = location != null ? location.getPath() : null;

    // TODO: Also store this location in the .android settings directory
    // such that we can support using multiple workspaces without asking
    // over and over.
    if (mOsSdkLocation != null && mOsSdkLocation.length() > 0) {
        DdmsPreferenceStore ddmsStore = new DdmsPreferenceStore();
        ddmsStore.setLastSdkPath(mOsSdkLocation);
    }

    // need to save this new value to the store
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    store.setValue(PREFS_SDK_DIR, mOsSdkLocation);
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Set whether the most recent page switch for a given editor type was to
 * XML/*from   ww  w  .  java 2  s .  c o  m*/
 *
 * @param editorType the editor to check a preference for; corresponds to
 *            one of the persistence class ids returned by
 *            {@link AndroidXmlEditor#getPersistenceCategory}
 * @param xml whether the last manual page switch in the given editor type
 *            was to XML
 */
public void setXmlEditorPreferred(int editorType, boolean xml) {
    if (xml != isXmlEditorPreferred(editorType)) {
        if (xml) {
            mPreferXmlEditor |= editorType;
        } else {
            mPreferXmlEditor &= ~editorType;
        }
        assert ((mPreferXmlEditor & editorType) != 0) == xml;
        IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
        store.setValue(PREFS_PREFER_XML, xml);
    }
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Sets the {@link RenderPreviewMode}//from ww  w  .j  a  v a2  s  .co m
 *
 * @param previewMode the preview mode
 */
public void setPreviewMode(@NonNull RenderPreviewMode previewMode) {
    mPreviewMode = previewMode;
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    if (previewMode != RenderPreviewMode.NONE) {
        store.setValue(PREFS_PREVIEWS, previewMode.name().toLowerCase(Locale.US));
    } else {
        store.setToDefault(PREFS_PREVIEWS);
    }
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Sets whether auto-pick render target mode is enabled.
 *
 * @param autoPick if true, auto pick the best render target in the layout editor
 *//*  w  w  w  .  ja  v a2s  .  co  m*/
public void setAutoPickRenderTarget(boolean autoPick) {
    mAutoPickTarget = autoPick;
    IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
    if (autoPick) {
        store.setToDefault(PREFS_AUTO_PICK_TARGET);
    } else {
        store.setValue(PREFS_AUTO_PICK_TARGET, autoPick);
    }
}

From source file:com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.java

License:Open Source License

/**
 * Sets whether libraries should be excluded when running lint on a project
 *
 * @param exclude if true, exclude library projects
 *//*from   ww w.j  a va  2 s . c  o  m*/
public void setSkipLibrariesFromLint(boolean exclude) {
    if (exclude != mSkipLibrariesFromLint) {
        mSkipLibrariesFromLint = exclude;
        IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
        if (exclude) {
            store.setValue(PREFS_SKIP_LINT_LIBS, true);
        } else {
            store.setToDefault(PREFS_SKIP_LINT_LIBS);
        }
    }
}