本文整理汇总了Java中org.eclipse.jface.preference.IPreferenceStore.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java IPreferenceStore.getBoolean方法的具体用法?Java IPreferenceStore.getBoolean怎么用?Java IPreferenceStore.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.preference.IPreferenceStore
的用法示例。
在下文中一共展示了IPreferenceStore.getBoolean方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openContentStream
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* Returns the content of the .editorconfig file to generate.
*
* @param container
*
* @return the content of the .editorconfig file to generate.
*/
private InputStream openContentStream(IContainer container) {
IPreferenceStore store = EditorsUI.getPreferenceStore();
boolean spacesForTabs = store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS);
int tabWidth = store.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
String lineDelimiter = getLineDelimiter(container);
String endOfLine = org.ec4j.core.model.PropertyType.EndOfLineValue.ofEndOfLineString(lineDelimiter).name();
StringBuilder content = new StringBuilder("# EditorConfig is awesome: http://EditorConfig.org");
content.append(lineDelimiter);
content.append(lineDelimiter);
content.append("[*]");
content.append(lineDelimiter);
content.append("indent_style = ");
content.append(spacesForTabs ? "space" : "tab");
content.append(lineDelimiter);
content.append("indent_size = ");
content.append(tabWidth);
if (endOfLine != null) {
content.append(lineDelimiter);
content.append("end_of_line = ");
content.append(endOfLine);
}
return new ByteArrayInputStream(content.toString().getBytes());
}
示例2: bind
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* Binding plugin settings to python.
*
* @param engine
* PyEngine
*/
public void bind(PyEngine engine) {
IPreferenceStore store = UroborosqlFormatterPlugin.getDefault().getPreferenceStore();
engine.eval("config = LocalConfig()");
if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
engine.eval("config.set_case('lower')");
} else if (CaseType.UPPER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
engine.eval("config.set_case('upper')");
} else if (CaseType.CAPITALIZE.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
engine.eval("config.set_case('capitalize')");
}
if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
engine.eval("config.set_reserved_case('lower')");
} else if (CaseType.UPPER.name()
.equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
engine.eval("config.set_reserved_case('upper')");
} else if (CaseType.CAPITALIZE.name()
.equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
engine.eval("config.set_reserved_case('capitalize')");
}
if (store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS) != null) {
String inputReservedWords = store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS);
String[] reservedWords = inputReservedWords.split(",", 0);
List<String> reservedWordsList = new ArrayList<String>();
for (int i = 0; i < reservedWords.length; i++) {
reservedWordsList.add(reservedWords[i]);
}
engine.put("input_reserved_words", reservedWordsList);
engine.eval("config.set_input_reserved_words(input_reserved_words)");
}
if (CommentSyntaxType.Doma2.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.COMMENT_SYNTAX_TYPE))) {
engine.eval("config.set_commentsyntax(Doma2CommentSyntax())");
}
if (store.getBoolean(UroborosqlFormatterPreferenceInitializer.USE_BACKSLASH)) {
engine.eval("uroborosqlfmt.config.glb.escape_sequence_u005c = True");
}
}
示例3: fromDbInfo
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public static DbSource fromDbInfo(DbInfo dbinfo, IPreferenceStore prefs,
boolean forceUnixNewlines, String charset, String timezone) {
if (prefs.getBoolean(PREF.PGDUMP_SWITCH)) {
return DbSource.fromDb(forceUnixNewlines,
prefs.getString(PREF.PGDUMP_EXE_PATH),
prefs.getString(PREF.PGDUMP_CUSTOM_PARAMS),
dbinfo.getDbHost(), dbinfo.getDbPort(),
dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
charset, timezone);
} else {
return DbSource.fromJdbc(dbinfo.getDbHost(), dbinfo.getDbPort(),
dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
timezone, forceUnixNewlines);
}
}
示例4: toStyledText
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* Creates and returns with a new {@link StyledText styled text} instance hooked up to the given parent composite.
*
* @param parent
* the parent of the styled text control.
* @param style
* style bits for the new text control.
* @return a new styled text control initialized from the descriptor.
*/
default StyledText toStyledText(final Composite parent, final int style) {
final StyledText text = new StyledText(parent, READ_ONLY | style);
text.setText(getText());
text.setStyleRanges(getRanges());
text.setFont(getFont());
text.setEditable(false);
text.setEnabled(false);
final AtomicReference<Color> colorRef = new AtomicReference<>();
final IPreferenceStore prefStore = EditorsUI.getPreferenceStore();
if (null == prefStore
|| prefStore.getBoolean(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {
colorRef.set(getDefault().getSystemColor(COLOR_LIST_BACKGROUND));
} else {
RGB rgb = null;
if (prefStore.contains(PREFERENCE_COLOR_BACKGROUND)) {
if (prefStore.isDefault(PREFERENCE_COLOR_BACKGROUND)) {
rgb = getDefaultColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
} else {
rgb = getColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
}
if (rgb != null) {
colorRef.set(new Color(text.getDisplay(), rgb));
}
}
}
if (null != colorRef.get()) {
text.setBackground(colorRef.get());
text.addDisposeListener(e -> {
if (!colorRef.get().isDisposed()) {
colorRef.get().dispose();
}
});
}
text.pack();
return text;
}
示例5: rebuildOutline
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
* Does rebuild the outline - this is done asynchronous
*/
public void rebuildOutline() {
String text = getDocumentText();
IPreferenceStore store = BashEditorUtil.getPreferences().getPreferenceStore();
boolean validateBlocks = store.getBoolean(VALIDATE_BLOCK_STATEMENTS.getId());
boolean validateDo = store.getBoolean(VALIDATE_DO_STATEMENTS.getId());
boolean validateIf = store.getBoolean(VALIDATE_IF_STATEMENTS.getId());
boolean validateFunctions = store.getBoolean(VALIDATE_FUNCTION_STATEMENTS.getId());
String errorLevelId = store.getString(VALIDATE_ERROR_LEVEL.getId());
BashEditorValidationErrorLevel errorLevel = BashEditorValidationErrorLevel.fromId(errorLevelId);
boolean debugMode = Boolean.parseBoolean(System.getProperty("basheditor.debug.enabled"));
modelBuilder.setIgnoreBlockValidation(!validateBlocks);
modelBuilder.setIgnoreDoValidation(!validateDo);
modelBuilder.setIgnoreIfValidation(!validateIf);
modelBuilder.setIgnoreFunctionValidation(!validateFunctions);
modelBuilder.setDebug(debugMode);
EclipseUtil.safeAsyncExec(new Runnable() {
@Override
public void run() {
BashEditorUtil.removeScriptErrors(BashEditor.this);
BashScriptModel model;
try {
model = modelBuilder.build(text);
} catch (BashScriptModelException e) {
BashEditorUtil.logError("Was not able to build validation model", e);
model = FALLBACK_MODEL;
}
getOutlinePage().rebuild(model);
if (model.hasErrors()) {
int severity;
if (BashEditorValidationErrorLevel.INFO.equals(errorLevel)) {
severity = IMarker.SEVERITY_INFO;
} else if (BashEditorValidationErrorLevel.WARNING.equals(errorLevel)) {
severity = IMarker.SEVERITY_WARNING;
} else {
severity = IMarker.SEVERITY_ERROR;
}
addErrorMarkers(model, severity);
}
}
});
}
示例6: openSharedGraphmlFile
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public static boolean openSharedGraphmlFile () {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
return store.getBoolean(P_OPEN_SHARED_GRAPHML_FILE);
}
示例7: isAutomaticResizingOn
import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public static boolean isAutomaticResizingOn () {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
return store.getBoolean(P_AUTO_RESIZING);
}