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


Java IPreference类代码示例

本文整理汇总了Java中it.albertus.jface.preference.IPreference的典型用法代码示例。如果您正苦于以下问题:Java IPreference类的具体用法?Java IPreference怎么用?Java IPreference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createFieldEditors

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
	// Header
	header = createHeader();
	if (header != null) {
		GridDataFactory.fillDefaults().span(Short.MAX_VALUE, 1).applyTo(header);
		addSeparator();
	}

	// Fields
	for (final IPreference preference : preferences) {
		if (pageDefinition.equals(preference.getPageDefinition())) {
			if (preference.isSeparate()) {
				addSeparator();
			}
			final Composite fieldEditorParent = getFieldEditorParent();
			final FieldEditor fieldEditor = createFieldEditor(preference, fieldEditorParent);
			addField(fieldEditor);
			fieldEditorMap.put(preference, new FieldEditorWrapper(fieldEditor, fieldEditorParent));
		}
	}
	universe.putAll(fieldEditorMap);
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:24,代码来源:BasePreferencePage.java

示例2: propertyChange

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
@Override
public void propertyChange(final PropertyChangeEvent event) {
	super.propertyChange(event);
	if (event.getSource() instanceof BooleanFieldEditor) {
		final BooleanFieldEditor changedBooleanFieldEditor = (BooleanFieldEditor) event.getSource();
		final Boolean parentEnabled = (Boolean) event.getNewValue();
		for (final Entry<IPreference, FieldEditorWrapper> entry : fieldEditorMap.entrySet()) {
			if (entry.getValue().getFieldEditor().equals(changedBooleanFieldEditor)) {
				// Found!
				for (final IPreference childPreference : entry.getKey().getChildren()) {
					updateChildrenStatus(childPreference, parentEnabled);
				}
				break; // Done!
			}
		}
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:18,代码来源:BasePreferencePage.java

示例3: getParentsEnabled

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected boolean getParentsEnabled(final IPreference preference) {
	final FieldEditorWrapper fieldEditorWrapper = universe.get(preference);
	boolean parentEnabled;
	if (fieldEditorWrapper == null) { // Field belongs to a not-yet-created page.
		parentEnabled = getBooleanFromStore(preference);
	}
	else {
		try {
			parentEnabled = ((BooleanFieldEditor) fieldEditorWrapper.getFieldEditor()).getBooleanValue();
		}
		catch (final NullPointerException e) { // Uninitialized field.
			logger.log(Level.FINE, e.toString(), e);
			parentEnabled = getPreferenceStore().getBoolean(preference.getName());
		}
	}

	if (preference.getParent() != null) {
		return parentEnabled && getParentsEnabled(preference.getParent());
	}
	else {
		return parentEnabled;
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:24,代码来源:BasePreferencePage.java

示例4: updateCrossChildrenStatus

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
public void updateCrossChildrenStatus() {
	for (final IPreference preference : fieldEditorMap.keySet()) { // iterate over all the preferences on the current page
		IPreference parentPreference = preference.getParent();
		if (parentPreference != null && !fieldEditorMap.containsKey(parentPreference)) { // if the parent is on another page
			final Set<IPreference> parents = new HashSet<IPreference>();

			while (parentPreference != null) {
				parents.add(parentPreference);
				parentPreference = parentPreference.getParent();
			}

			final boolean parentsEnabled = checkParentsEnabled(parents);
			updateChildrenStatus(preference, parentsEnabled);
		}
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:17,代码来源:BasePreferencePage.java

示例5: checkParentsEnabled

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected boolean checkParentsEnabled(final Set<IPreference> parents) {
	boolean parentEnabled = true;
	for (final IPreference preference : parents) {
		final FieldEditorWrapper fieldEditorWrapper = universe.get(preference);
		if (fieldEditorWrapper == null) {
			parentEnabled = getBooleanFromStore(preference);
		}
		else {
			final FieldEditor fieldEditor = fieldEditorWrapper.getFieldEditor();
			if (fieldEditor instanceof BooleanFieldEditor) {
				try {
					parentEnabled = ((BooleanFieldEditor) fieldEditor).getBooleanValue();
				}
				catch (final NullPointerException e) {
					logger.log(Level.FINE, e.toString(), e);
					parentEnabled = getBooleanFromStore(preference);
				}
			}
		}
		if (!parentEnabled) {
			break; // don't waste time
		}
	}
	return parentEnabled;
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:26,代码来源:BasePreferencePage.java

示例6: updateChildrenStatus

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected void updateChildrenStatus(final IPreference childPreference, final Boolean parentEnabled) {
	final FieldEditorWrapper childFieldEditor = fieldEditorMap.get(childPreference);
	updateChildStatus(childFieldEditor, parentEnabled);
	// Recurse descendants...
	if (childFieldEditor != null && childFieldEditor.getFieldEditor() instanceof BooleanFieldEditor) {
		final BooleanFieldEditor childBooleanFieldEditor = (BooleanFieldEditor) childFieldEditor.getFieldEditor();
		for (final IPreference descendantPreference : childPreference.getChildren()) { // Exit condition
			final boolean childEnabled = childBooleanFieldEditor.getBooleanValue();
			updateChildrenStatus(descendantPreference, childEnabled && parentEnabled);
		}
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:13,代码来源:BasePreferencePage.java

示例7: updateFieldsStatus

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected void updateFieldsStatus() {
	for (final Entry<IPreference, FieldEditorWrapper> entry : fieldEditorMap.entrySet()) {
		if (entry.getValue().getFieldEditor() instanceof BooleanFieldEditor) {
			final boolean parentsEnabled = getParentsEnabled(entry.getKey());
			for (final IPreference childPreference : entry.getKey().getChildren()) {
				updateChildStatus(fieldEditorMap.get(childPreference), parentsEnabled);
			}
		}
	}
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:11,代码来源:BasePreferencePage.java

示例8: getPreferences

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
public IPreference[] getPreferences() {
	return preferences;
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:4,代码来源:BasePreferencePage.java

示例9: setPreferences

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
public void setPreferences(final IPreference[] preferences) {
	this.preferences = preferences;
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:4,代码来源:BasePreferencePage.java

示例10: createFieldEditor

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected FieldEditor createFieldEditor(final IPreference preference, final Composite parent) {
	return preference.createFieldEditor(parent);
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:4,代码来源:BasePreferencePage.java

示例11: getBooleanFromStore

import it.albertus.jface.preference.IPreference; //导入依赖的package包/类
protected boolean getBooleanFromStore(final IPreference preference) {
	return getPreferenceStore().getBoolean(preference.getName());
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:4,代码来源:BasePreferencePage.java


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