本文整理汇总了Java中org.eclipse.core.runtime.Preferences.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.getBoolean方法的具体用法?Java Preferences.getBoolean怎么用?Java Preferences.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.Preferences
的用法示例。
在下文中一共展示了Preferences.getBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCurrentSettings
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
private TFSGlobalProxySettings getCurrentSettings() {
final Preferences preferences = TFSCommonUIClientPlugin.getDefault().getPluginPreferences();
final boolean useHttpProxy = preferences.getBoolean(HTTP_PROXY_ENABLED);
final String httpProxyUrl = preferences.getString(HTTP_PROXY_URL);
final boolean useHttpProxyDefaultCredentials = preferences.getBoolean(HTTP_PROXY_DEFAULT_CREDENTIALS);
final String httpProxyUsername = preferences.getString(HTTP_PROXY_USERNAME);
final String httpProxyDomain = preferences.getString(HTTP_PROXY_DOMAIN);
final String httpProxyPassword = preferences.getString(HTTP_PROXY_PASSWORD);
final boolean useTfProxy = preferences.getBoolean(TFS_PROXY_ENABLED);
final String tfProxyUrl = preferences.getString(TFS_PROXY_URL);
return new TFSGlobalProxySettings(
useHttpProxy,
httpProxyUrl,
useHttpProxyDefaultCredentials,
httpProxyUsername,
httpProxyDomain,
httpProxyPassword,
useTfProxy,
tfProxyUrl);
}
示例2: initialize
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
*
*/
private void initialize() {
Preferences prefs = JSONCorePlugin.getDefault().getPluginPreferences();
// fIdentCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_IDENTIFIER));
// fPropNameCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME));
// fPropValueCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE));
// fSelectorTagCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_SELECTOR));
// fIdCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_ID_SELECTOR));
// fClassCase = getCleanupCaseValue(prefs
// .getInt(JSONCorePreferenceNames.CLEANUP_CASE_CLASS_SELECTOR));
fQuoteValues = prefs
.getBoolean(JSONCorePreferenceNames.QUOTE_ATTR_VALUES);
fFormatSource = prefs.getBoolean(JSONCorePreferenceNames.FORMAT_SOURCE);
}
示例3: shouldAcceptUntrustedCertificates
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
@Override
protected boolean shouldAcceptUntrustedCertificates(final ConnectionInstanceData connectionInstanceData) {
final Preferences preferences = TFSCommonUIClientPlugin.getDefault().getPluginPreferences();
if (preferences.getBoolean(UIPreferenceConstants.ACCEPT_UNTRUSTED_CERTIFICATES)) {
return true;
}
// Let the base class test for environment variables, sysprops, etc.
return super.shouldAcceptUntrustedCertificates(connectionInstanceData);
}
示例4: formatBefore
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
*
*/
protected void formatBefore(IJSONNode node, IJSONNode child,
IRegion region, String toAppend, StringBuilder source) {
IJSONCleanupStrategy stgy = getCleanupStrategy(node);
IJSONModel cssModel = node.getOwnerDocument().getModel();
// BUG202615 - it is possible to have a style declaration
// with no model associated with it
if (cssModel != null) {
IStructuredDocument structuredDocument = cssModel
.getStructuredDocument();
if (structuredDocument != null) {
CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(
structuredDocument, region, stgy);
CompoundRegion[] outside = getOutsideRegions(
structuredDocument, region);
for (int i = 0; i < regions.length; i++) {
if (i != 0 || needS(outside[0]))
appendSpaceBefore(node, regions[i], source);
source.append(decoratedRegion(regions[i], 0, stgy)); // must
// be
// comments
}
Preferences preferences = JSONCorePlugin.getDefault()
.getPluginPreferences();
if (needS(outside[1])) {
if (((IndexedRegion) child).getStartOffset() == region
.getOffset() + region.getLength()
&& preferences
.getBoolean(JSONCorePreferenceNames.WRAPPING_ONE_PER_LINE)
&& (node.getOwnerDocument() != node || !preferences
.getBoolean(JSONCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR))) {
appendDelimBefore(node, null, source);
} else
appendSpaceBefore(node, toAppend, source);
}
}
}
}
示例5: getBoolean
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
public boolean getBoolean( String name )
{
if ( this.preferenceType == SPECIAL_TYPE && project != null )
{
Preferences preference = prefs.getReportPreference( project );
if ( preference != null && preference.contains( name ) )
return preference.getBoolean( name );
}
return prefsStore.getBoolean( name );
}
示例6: createAdvancedControls
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
* Creates the widget for advanced options.
*
* @param parent
* the parent composite
*/
protected void createAdvancedControls(Composite parent) {
Preferences preferences = ResourcesPlugin.getPlugin()
.getPluginPreferences();
if (preferences.getBoolean(ResourcesPlugin.PREF_DISABLE_LINKING) == false) {
linkedResourceParent = new Composite(parent, SWT.NONE);
linkedResourceParent.setFont(parent.getFont());
linkedResourceParent.setLayoutData(new GridData(
GridData.FILL_HORIZONTAL));
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
linkedResourceParent.setLayout(layout);
advancedButton = new Button(linkedResourceParent, SWT.PUSH);
advancedButton.setFont(linkedResourceParent.getFont());
advancedButton.setText(IDEWorkbenchMessages.showAdvanced);
GridData data = setButtonLayoutData(advancedButton);
data.horizontalAlignment = GridData.BEGINNING;
advancedButton.setLayoutData(data);
advancedButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleAdvancedButtonSelect();
}
});
}
linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FILE,
new Listener() {
public void handleEvent(Event e) {
setPageComplete(validatePage());
firstLinkCheck = false;
}
}, new CreateLinkedResourceGroup.IStringValue() {
public void setValue(String string) {
resourceGroup.setResource(string);
}
public String getValue() {
return resourceGroup.getResource();
}
public IResource getResource() {
IPath path = resourceGroup.getContainerFullPath();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace()
.getRoot();
IResource resource = root.findMember(path);
if (resource != null && resource instanceof IContainer) {
String resourceName = resourceGroup.getResource();
if (resourceName.length() > 0) {
try {
return ((IContainer) resource).getFile(Path
.fromOSString(resourceName));
} catch (IllegalArgumentException e) {
// continue below.
}
}
return resource;
}
return resource;
}
});
}
示例7: isShowPopup
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
* Return {@code true} if the notification popup should be shown when
* tasks fail.
*/
public static boolean isShowPopup() {
Preferences prefs = getPreferences();
return prefs.getBoolean(IMechanicPreferences.SHOW_POPUP_PREF);
}
示例8: appendSpaceBefore
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
*
*/
protected void appendSpaceBefore(IJSONNode node, CompoundRegion toAppend,
StringBuilder source) {
if (node == null || toAppend == null || source == null)
return;
if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
return; // for not formatting case on cleanup action
String type = toAppend.getType();
Preferences preferences = JSONCorePlugin.getDefault()
.getPluginPreferences();
boolean needIndent = !(node instanceof IJSONDocument);
/*if (type == JSONRegionContexts.JSON_COMMENT) {
// check whether previous region is 'S' and has CR-LF
String delim = getLineDelimiter(node);
RegionIterator it = new RegionIterator(
toAppend.getDocumentRegion(), toAppend.getTextRegion());
it.prev();
ITextRegion prev = it.prev();
// bug390904
if (prev.getType() == JSONRegionContexts.JSON_LBRACE
&& TextUtilities
.indexOf(DefaultLineTracker.DELIMITERS,
it.getStructuredDocumentRegion()
.getFullText(prev), 0)[0] > 0) {
source.append(delim);
source.append(getIndent(node));
source.append(getIndentString());
} else if (prev.getType() == JSONRegionContexts.WHITE_SPACE
&& TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it
.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0) {
source.append(delim);
source.append(getIndent(node));
if (needIndent)
source.append(getIndentString());
} else {
appendSpaceBefore(node, toAppend.getText(), source);
}
}*/
if ((type == JSONRegionContexts.JSON_OBJECT_OPEN || type == JSONRegionContexts.JSON_ARRAY_OPEN)
&& preferences
.getBoolean(JSONCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {
String delim = getLineDelimiter(node);
source.append(delim);
source.append(getIndent(node));
// } else if (type == JSONRegionContexts.JSON_CURLY_BRACE_CLOSE) {
// } else if (type == JSONRegionContexts.JSON_INCLUDES || type ==
// JSONRegionContexts.JSON_DASHMATCH) {
/*} else if (type == JSONRegionContexts.JSON_DECLARATION_SEPARATOR
&& node instanceof IJSONStyleDeclItem) {
int n = preferences
.getInt(JSONCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
// no delimiter case
while (n-- > 0)
source.append(" ");//$NON-NLS-1$
} else if (type == JSONRegionContexts.JSON_DECLARATION_VALUE_OPERATOR
|| type == JSONRegionContexts.JSON_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
if (preferences.getInt(JSONCorePreferenceNames.LINE_WIDTH) > 0
&& (!preferences
.getBoolean(JSONCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node
.getOwnerDocument().getNodeType() != IJSONNode.STYLEDECLARATION_NODE)) {
int length = getLastLineLength(node, source);
int append = 1;
if (length + append > preferences
.getInt(JSONCorePreferenceNames.LINE_WIDTH)) {
source.append(getLineDelimiter(node));
source.append(getIndent(node));
if (needIndent)
source.append(getIndentString());
}
}
} else if (JSONRegionContexts.JSON_FOREIGN_ELEMENT == type
|| JSONRegionContexts.JSON_DECLARATION_DELIMITER == type) {
return;
*/
} else
appendSpaceBefore(node, toAppend.getText(), source);
}
示例9: createAdvancedControls
import org.eclipse.core.runtime.Preferences; //导入方法依赖的package包/类
/**
* Creates the widget for advanced options.
*
* @param parent the parent composite
*/
protected void createAdvancedControls(Composite parent) {
Preferences preferences = ResourcesPlugin.getPlugin()
.getPluginPreferences();
if (preferences.getBoolean(ResourcesPlugin.PREF_DISABLE_LINKING) == false
&& isValidContainer()) {
linkedResourceParent = new Composite(parent, SWT.NONE);
linkedResourceParent.setFont(parent.getFont());
linkedResourceParent.setLayoutData(new GridData(
GridData.FILL_HORIZONTAL));
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
linkedResourceParent.setLayout(layout);
advancedButton = new Button(linkedResourceParent, SWT.PUSH);
advancedButton.setFont(linkedResourceParent.getFont());
advancedButton.setText(IDEWorkbenchMessages.showAdvanced);
setButtonLayoutData(advancedButton);
GridData data = (GridData) advancedButton.getLayoutData();
data.horizontalAlignment = GridData.BEGINNING;
advancedButton.setLayoutData(data);
advancedButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleAdvancedButtonSelect();
}
});
}
linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FOLDER,
new Listener() {
public void handleEvent(Event e) {
validateLinkedResource();
firstLinkCheck = false;
}
}, new CreateLinkedResourceGroup.IStringValue() {
public void setValue(String string) {
folderNameField.setText(string);
}
public String getValue() {
return folderNameField.getText();
}
public IResource getResource() {
return container;
}
});
}