本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.putLong方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.putLong方法的具体用法?Java IEclipsePreferences.putLong怎么用?Java IEclipsePreferences.putLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.preferences.IEclipsePreferences
的用法示例。
在下文中一共展示了IEclipsePreferences.putLong方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFilePermissions
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Sets the specific permissions used for new files created when transferring.
*
* @param permissions
* permissions in decimal form
* @param direction
* indicates if this is for upload or download permissions
*/
public static void setFilePermissions(long permissions, PermissionDirection direction)
{
IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(CoreIOPlugin.PLUGIN_ID);
switch (direction)
{
case UPLOAD:
prefs.putLong(IPreferenceConstants.UPLOAD_FILE_PERMISSION, permissions);
break;
case DOWNLOAD:
prefs.putLong(IPreferenceConstants.DOWNLOAD_FILE_PERMISSION, permissions);
break;
}
try
{
prefs.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CoreIOPlugin.getDefault(), e);
}
}
示例2: setFolderPermissions
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Sets the specific permissions used for new folders created when transferring.
*
* @param permissions
* permissions in decimal form
* @param direction
* indicates if this is for upload or download permissions
*/
public static void setFolderPermissions(long permissions, PermissionDirection direction)
{
IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(CoreIOPlugin.PLUGIN_ID);
switch (direction)
{
case UPLOAD:
prefs.putLong(IPreferenceConstants.UPLOAD_FOLDER_PERMISSION, permissions);
break;
case DOWNLOAD:
prefs.putLong(IPreferenceConstants.DOWNLOAD_FOLDER_PERMISSION, permissions);
break;
}
try
{
prefs.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CoreIOPlugin.getDefault(), e);
}
}
示例3: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES);
// auto-refresh default
node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, PREF_AUTO_REFRESH_DEFAULT);
node.putBoolean(
ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, PREF_LIGHTWEIGHT_AUTO_REFRESH_DEFAULT);
// linked resources default
node.putBoolean(ResourcesPlugin.PREF_DISABLE_LINKING, PREF_DISABLE_LINKING_DEFAULT);
// build manager defaults
node.putBoolean(ResourcesPlugin.PREF_AUTO_BUILDING, PREF_AUTO_BUILDING_DEFAULT);
node.put(ResourcesPlugin.PREF_BUILD_ORDER, PREF_BUILD_ORDER_DEFAULT);
node.putInt(ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS, PREF_MAX_BUILD_ITERATIONS_DEFAULT);
node.putBoolean(ResourcesPlugin.PREF_DEFAULT_BUILD_ORDER, PREF_DEFAULT_BUILD_ORDER_DEFAULT);
// history store defaults
node.putBoolean(
ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY, PREF_APPLY_FILE_STATE_POLICY_DEFAULT);
node.putLong(ResourcesPlugin.PREF_FILE_STATE_LONGEVITY, PREF_FILE_STATE_LONGEVITY_DEFAULT);
node.putLong(ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE, PREF_MAX_FILE_STATE_SIZE_DEFAULT);
node.putInt(ResourcesPlugin.PREF_MAX_FILE_STATES, PREF_MAX_FILE_STATES_DEFAULT);
// save manager defaults
node.putLong(ResourcesPlugin.PREF_SNAPSHOT_INTERVAL, PREF_SNAPSHOT_INTERVAL_DEFAULT);
node.putInt(PREF_OPERATIONS_PER_SNAPSHOT, PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT);
node.putLong(PREF_DELTA_EXPIRATION, PREF_DELTA_EXPIRATION_DEFAULT);
// encoding defaults
node.put(ResourcesPlugin.PREF_ENCODING, PREF_ENCODING_DEFAULT);
}
示例4: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences()
{
IEclipsePreferences prefs = EclipseUtil.defaultScope().getNode(CoreIOPlugin.PLUGIN_ID);
prefs.putBoolean(IPreferenceConstants.UPLOAD_UPDATE_PERMISSIONS, true);
prefs.putBoolean(IPreferenceConstants.UPLOAD_SPECIFIC_PERMISSIONS, true);
prefs.putLong(IPreferenceConstants.UPLOAD_FILE_PERMISSION, DEFAULT_FILE_PERMISSIONS);
prefs.putLong(IPreferenceConstants.UPLOAD_FOLDER_PERMISSION, DEFAULT_DIRECTORY_PERMISSIONS);
prefs.putBoolean(IPreferenceConstants.DOWNLOAD_UPDATE_PERMISSIONS, true);
prefs.putBoolean(IPreferenceConstants.DOWNLOAD_SPECIFIC_PERMISSIONS, true);
prefs.putLong(IPreferenceConstants.DOWNLOAD_FILE_PERMISSION, DEFAULT_FILE_PERMISSIONS);
prefs.putLong(IPreferenceConstants.DOWNLOAD_FOLDER_PERMISSION, DEFAULT_DIRECTORY_PERMISSIONS);
prefs.put(IPreferenceConstants.GLOBAL_CLOAKING_EXTENSIONS, DEFAULT_CLOAK_EXPRESSIONS);
}
示例5: notifyThemeChangeListeners
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Set specific pref values that we use to listen for when the theme has changed across our plugins. This ignals to
* them the theme has been changed and they need to update their settings to match.
*
* @param theme
*/
private void notifyThemeChangeListeners(Theme theme)
{
IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID);
prefs.put(IPreferenceConstants.ACTIVE_THEME, theme.getName());
prefs.putLong(THEME_CHANGED, System.currentTimeMillis());
try
{
prefs.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(ThemePlugin.getDefault(), e);
}
}
示例6: setPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void setPreferences(IEclipsePreferences prefs, Map<String, ? extends Object> preferences)
{
if (CollectionsUtil.isEmpty(preferences))
{
return;
}
for (Map.Entry<String, ? extends Object> entry : preferences.entrySet())
{
Object value = entry.getValue();
if (value instanceof Boolean)
{
prefs.putBoolean(entry.getKey(), (Boolean) value);
}
else if (value instanceof Long)
{
prefs.putLong(entry.getKey(), (Long) value);
}
else if (value instanceof Integer)
{
prefs.putInt(entry.getKey(), (Integer) value);
}
else if (value instanceof Double)
{
prefs.putDouble(entry.getKey(), (Double) value);
}
else if (value != null)
{
prefs.put(entry.getKey(), value.toString());
}
}
}
示例7: setLastUpdateTimeMillis
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Sets the last update time in milliseconds.
*
* @param lastUpdateTimeMillis
* date of the last update time in milliseconds
*/
public static void setLastUpdateTimeMillis(long lastUpdateTimeMillis) {
IEclipsePreferences configurationPreferences = getConfigurationPreferences();
configurationPreferences.putLong(LAST_UPDATE_TIME_MILLIS, lastUpdateTimeMillis);
flushPreferences(configurationPreferences);
}