本文整理汇总了Java中org.eclipse.jface.preference.IPreferenceStore.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java IPreferenceStore.setValue方法的具体用法?Java IPreferenceStore.setValue怎么用?Java IPreferenceStore.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.preference.IPreferenceStore
的用法示例。
在下文中一共展示了IPreferenceStore.setValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOk
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* @see PreferencePage#performOk
*/
@Override
public boolean performOk()
{
if( !modified )
{
return true;
}
IPath path = Path.EMPTY;
Object[] checked = listViewer.getCheckedElements();
for( Object elements : checked )
{
path = path.append(((IProject) elements).getName());
}
IPreferenceStore prefs = getPreferenceStore();
prefs.setValue(JPFClasspathPlugin.PREF_PARENT_REGISTRIES, path.toString());
try
{
((IPersistentPreferenceStore) prefs).save();
}
catch( IOException e )
{
JPFClasspathLog.logError(e);
}
return true;
}
示例2: performOk
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* @see PreferencePage#performOk
*/
@Override
public boolean performOk()
{
if( !modified )
{
return true;
}
StructuredSelection selection = (StructuredSelection) listViewer.getSelection();
IProject project = (IProject) selection.getFirstElement();
if( project != null )
{
IPreferenceStore prefs = getPreferenceStore();
prefs.setValue(JPFClasspathPlugin.PREF_REGISTRY_NAME, project.getName());
try
{
((IPersistentPreferenceStore) prefs).save();
}
catch( IOException e )
{
JPFClasspathLog.logError(e);
}
}
return true;
}
示例3: chooseDbSource
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public static File chooseDbSource(Shell shell, IPreferenceStore prefStore, boolean dir) {
String pathToDump = dir ? getDirPath(shell, prefStore) : getFilePath(shell, prefStore);
if (pathToDump == null) {
return null;
}
File dumpFile = new File(pathToDump);
Deque<File> dumpHistory = stringToDumpFileHistory(prefStore.getString(PREF.DB_STORE_FILES));
dumpHistory.addFirst(dumpFile);
while (dumpHistory.size() > MAX_FILES_HISTORY) {
dumpHistory.removeLast();
}
prefStore.setValue(PREF.DB_STORE_FILES, dumpFileHistoryToPreference(dumpHistory));
prefStore.setValue(PREF.LAST_OPENED_LOCATION,
dir ? dumpFile.getAbsolutePath() : dumpFile.getParent());
return dumpFile;
}
示例4: setAutoBuildEnabled
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@Override
public void setAutoBuildEnabled(Object context, boolean enabled) {
IPreferenceStore preferenceStore = preferenceStoreAccess.getWritablePreferenceStore(context);
String key = null;
for (CompilerDescriptor compilerDescriptor : compositeGenerator.getCompilerDescriptors()) {
key = CompilerProperties.IS_ACTIVE.getKey(compilerDescriptor.getIdentifier());
preferenceStore.setValue(key, enabled);
}
}
示例5: doStore
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@Override
protected void doStore() {
if (!character.getText().equals("[space]")
&& character.getText().length() > 1) {
MessageDialog
.openError(
Display.getCurrent().getActiveShell(),
"Error",
"The key "
+ character.getText()
+ " is not supported as a shortcut. Please use another one.");
doLoadDefault();
return;
}
String c = character.getText().equals("[space]") ? " " : character
.getText();
IPreferenceStore ps = getPreferenceStore();
updateAccelerators();
accelerators = accelerators.replace(ps.getString(keyConst), "");
if (accelerators.contains(c)) {
MessageDialog
.openError(
Display.getCurrent().getActiveShell(),
"Error",
"The key "
+ c
+ " is already used as a shortcut. Please use another one.");
doLoad();
updateAccelerators();
return;
}
ps.setValue(keyConst, c);
}
示例6: backwardCompatibility
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* For backward compatibility
* Read the .prefs file and if the .prefs file contains the previous version settings,
* rewrite the setings to new settings to keep compatibility.
*
* @param store IPreferenceStore
* @param configUseUppercase The configuration setting of UseUppercase
* @param configHasBackwardCompatibilityDone The configuration setting of backward compatibility
*/
public void backwardCompatibility(IPreferenceStore store, String configUseUppercase,
String configHasBackwardCompatibilityDone) {
if (configHasBackwardCompatibilityDone.equals("false")) {
if (configUseUppercase.equals("false")) {
store.setValue(UroborosqlFormatterPreferenceInitializer.CASE, CaseType.NOCHANGE.name());
store.setValue(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE, CaseType.NOCHANGE.name());
}
store.setValue(UroborosqlFormatterPreferenceInitializer.HAS_BACKWARD_COMPATIBILITY_DONE, "true");
}
}
开发者ID:future-architect,项目名称:eclipse-uroborosql-formatter,代码行数:20,代码来源:UroborosqlFormatterPlugin.java
示例7: performOk
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@Override
public boolean performOk() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
for (DbDriverMetaData dbDriverMetaData : dbDriverMetaDataList) {
store.setValue(dbDriverMetaData.getDbType(), dbDriverMetaData.getDriverLocation());
}
return super.performOk();
}
示例8: performDefaults
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@Override
protected void performDefaults() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
for (DbDriverMetaData dbDriverMetaData : dbDriverMetaDataList) {
dbDriverMetaData.setDriverLocation("");
store.setValue(dbDriverMetaData.getDbType(), "");
}
tableViewer.refresh();
super.performDefaults();
}
示例9: openDbDriverLocationDialog
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
private int openDbDriverLocationDialog(String dbType, String driverName, String driverLocation) {
DbDriverMetaData dbDriverMetaData = new DbDriverMetaData();
dbDriverMetaData.setDbNmae(dbType);
dbDriverMetaData.setDriverClassName(driverName);
dbDriverMetaData.setDriverLocation(driverLocation);
DbDriverLocationDialog dialog = new DbDriverLocationDialog("请先配置数据库驱动", getWorkbenchPart().getSite().getShell(), dbDriverMetaData);
if (dialog.open() == Dialog.OK) {
dbDriverMetaData.setDriverLocation(dialog.getDriverLocation());
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setValue(dbType, dialog.getDriverLocation());
return attemptTestJdbcDriver(dbType, driverName, dbDriverMetaData.getDriverLocation());
} else {
return Dialog.CANCEL;
}
}
示例10: setProperty
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public static void setProperty(String key, String value) {
IPreferenceStore preferenceStore = ConvertigoPlugin.getDefault().getPreferenceStore();
preferenceStore.setValue(key, value);
}
示例11: beforeClass
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
defaultCheckBodies = prefs.getDefaultBoolean(DB_UPDATE_PREF.CHECK_FUNCTION_BODIES);
prefs.setValue(DB_UPDATE_PREF.CHECK_FUNCTION_BODIES, true);
}
示例12: afterClass
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
@AfterClass
public static void afterClass() {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
prefs.setValue(DB_UPDATE_PREF.CHECK_FUNCTION_BODIES, defaultCheckBodies);
}
示例13: storeToPreference
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public void storeToPreference(IPreferenceStore store){
store.setValue(bdfVersionKey, bdfVersion);
if(this.customBorderColor!=null){
String customBorderColorStr=this.customBorderColor.red+","+this.customBorderColor.green+","+this.customBorderColor.blue;
store.setValue(customBorderColorStoreKey, customBorderColorStr);
}else{
if(store.contains(customBorderColorStoreKey)){
store.setValue(customBorderColorStoreKey, "");
}
}
if(this.customBackgroundColor!=null){
String customBackgroundColorStr=this.customBackgroundColor.red+","+this.customBackgroundColor.green+","+this.customBackgroundColor.blue;
store.setValue(customBackgroundColorStoreKey, customBackgroundColorStr);
}else{
if(store.contains(customBackgroundColorStoreKey)){
store.setValue(customBackgroundColorStoreKey, "");
}
}
if(this.customTransitionColor!=null){
String customTransitionColorStr=this.customTransitionColor.red+","+this.customTransitionColor.green+","+this.customTransitionColor.blue;
store.setValue(customTransitionColorStoreKey, customTransitionColorStr);
}else{
if(store.contains(customTransitionColorStoreKey)){
store.setValue(customTransitionColorStoreKey, "");
}
}
for(NodeImageConfig config:this.nodeImageConfigs){
String key=config.getNodeName()+this.nodeImageKey;
if(config.getCustomImage()!=null && config.getCustomImagePath()!=null){
store.setValue(key, config.getCustomImagePath());
}else{
if(store.contains(key)){
store.setValue(key, "");
}
}
key=config.getNodeName()+this.nodeSmallImageKey;
if(config.getCustomSmallImage()!=null && config.getCustomSmallImagePath()!=null){
store.setValue(key, config.getCustomSmallImagePath());
}else{
if(store.contains(key)){
store.setValue(key, "");
}
}
}
}