当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceStore.save方法代码示例

本文整理汇总了Java中org.eclipse.jface.preference.PreferenceStore.save方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceStore.save方法的具体用法?Java PreferenceStore.save怎么用?Java PreferenceStore.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.preference.PreferenceStore的用法示例。


在下文中一共展示了PreferenceStore.save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateNewPingId

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Generates a new random ping ID and saves it in the preference store.
 *
 * @return The new ping ID.
 */
public long generateNewPingId() {
    PreferenceStore prefs = getPreferenceStore();

    Random rnd = new Random();
    long id = rnd.nextLong();

    synchronized (DdmsPreferenceStore.class) {
        prefs.setValue(PING_ID, id);
        try {
            prefs.save();
        } catch (IOException e) {
            /* ignore exceptions while saving preferences */
        }
    }

    return id;
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:23,代码来源:DdmsPreferenceStore.java

示例2: save

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Save the prefs to the config file.
 */
public void save() {
    PreferenceStore prefs = getPreferenceStore();
    synchronized (DdmsPreferenceStore.class) {
        try {
            prefs.save();
        }
        catch (IOException ioe) {
            // FIXME com.android.dmmlib.Log.w("ddms", "Failed saving prefs file: " + ioe.getMessage());
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:15,代码来源:DdmsPreferenceStore.java

示例3: setPingOptIn

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Saves the "ping opt in" value in the preference store.
 *
 * @param optIn The new user opt-in value.
 */
public void setPingOptIn(boolean optIn) {
    PreferenceStore prefs = getPreferenceStore();

    synchronized (DdmsPreferenceStore.class) {
        prefs.setValue(PING_OPT_IN, optIn);
        try {
            prefs.save();
        } catch (IOException e) {
            /* ignore exceptions while saving preferences */
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:18,代码来源:DdmsPreferenceStore.java

示例4: setPingTime

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Sets the ping time for the given app from the preference store.
 * Callers should use {@link System#currentTimeMillis()} for time stamps.
 *
 * @param app The app name identifier.
 * @param timeStamp The time stamp from the store.
 *                   0L is a special value that should not be used.
 */
public void setPingTime(String app, long timeStamp) {
    PreferenceStore prefs = getPreferenceStore();
    String timePref = PING_TIME + "." + app;  //$NON-NLS-1$
    synchronized (DdmsPreferenceStore.class) {
        prefs.setValue(timePref, timeStamp);
        try {
            prefs.save();
        } catch (IOException ioe) {
            /* ignore exceptions while saving preferences */
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:21,代码来源:DdmsPreferenceStore.java

示例5: setAdtUsed

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Sets whether the ADT startup wizard has been shown.
 * ADT sets first to false once the welcome wizard has been shown once.
 *
 * @param used true if ADT has been used
 */
public void setAdtUsed(boolean used) {
    PreferenceStore prefs = getPreferenceStore();
    synchronized (DdmsPreferenceStore.class) {
        prefs.setValue(ADT_USED, used);
        try {
            prefs.save();
        } catch (IOException ioe) {
            /* ignore exceptions while saving preferences */
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:18,代码来源:DdmsPreferenceStore.java

示例6: setLastSdkPath

import org.eclipse.jface.preference.PreferenceStore; //导入方法依赖的package包/类
/**
 * Sets the last SDK OS path.
 *
 * @param osSdkPath The SDK OS Path. Can be null or empty.
 */
public void setLastSdkPath(String osSdkPath) {
    PreferenceStore prefs = getPreferenceStore();
    synchronized (DdmsPreferenceStore.class) {
        prefs.setValue(LAST_SDK_PATH, osSdkPath);
        try {
            prefs.save();
        } catch (IOException ioe) {
            /* ignore exceptions while saving preferences */
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:17,代码来源:DdmsPreferenceStore.java


注:本文中的org.eclipse.jface.preference.PreferenceStore.save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。