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


Java IPreferenceStore.setValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:29,代码来源:JPFParentRepositoriesPage.java

示例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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:28,代码来源:JPFRepositoryPage.java

示例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;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:18,代码来源:DbStorePicker.java

示例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);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:N4JSBuilderPreferenceAccess.java

示例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);
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:35,代码来源:Config.java

示例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();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:DbToolPreferencePage.java

示例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();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:11,代码来源:DbToolPreferencePage.java

示例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;
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:16,代码来源:DatabaseAction.java

示例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);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:5,代码来源:ConvertigoPlugin.java

示例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);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:7,代码来源:DifferTest.java

示例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);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:6,代码来源:DifferTest.java

示例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, "");
			}
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:46,代码来源:Preference.java


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