當前位置: 首頁>>代碼示例>>Java>>正文


Java ITypedPreferenceValues類代碼示例

本文整理匯總了Java中org.eclipse.xtext.preferences.ITypedPreferenceValues的典型用法代碼示例。如果您正苦於以下問題:Java ITypedPreferenceValues類的具體用法?Java ITypedPreferenceValues怎麽用?Java ITypedPreferenceValues使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ITypedPreferenceValues類屬於org.eclipse.xtext.preferences包,在下文中一共展示了ITypedPreferenceValues類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
@Override
public void apply(final IHiddenRegionFormatter it) {
  final ITypedPreferenceValues preferences = it.getRequest().getPreferences();
  final Boolean newLine = preferences.<Boolean>getPreference(this);
  final Boolean preserve = preferences.<Boolean>getPreference(XbaseFormatterPreferenceKeys.preserveNewLines);
  int _xifexpression = (int) 0;
  if ((newLine).booleanValue()) {
    _xifexpression = 1;
  } else {
    _xifexpression = 0;
  }
  final int min = _xifexpression;
  int _xifexpression_1 = (int) 0;
  if (((preserve).booleanValue() || (newLine).booleanValue())) {
    _xifexpression_1 = 1;
  } else {
    _xifexpression_1 = 0;
  }
  final int max = _xifexpression_1;
  it.setNewLines(min, min, max);
  it.setSpace(" ");
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:23,代碼來源:NewLineOrPreserveKey.java

示例2: format2

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
protected List<ITextReplacement> format2(final XtextResource resource, final ITextRegion selection, final ITypedPreferenceValues preferences) {
  final FormatterRequest request = this.formatterRequestProvider.get();
  request.setAllowIdentityEdits(false);
  request.setFormatUndefinedHiddenRegionsOnly(false);
  if ((selection != null)) {
    request.setRegions(Collections.<ITextRegion>unmodifiableList(CollectionLiterals.<ITextRegion>newArrayList(selection)));
  }
  if ((preferences != null)) {
    request.setPreferences(preferences);
  }
  final ITextRegionAccess regionAccess = this.regionBuilder.forNodeModel(resource).create();
  request.setTextRegionAccess(regionAccess);
  final IFormatter2 formatter2 = this.formatter2Provider.get();
  final List<ITextReplacement> replacements = formatter2.format(request);
  return replacements;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:17,代碼來源:FormattingService.java

示例3: apply

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
@Override
public void apply(final IHiddenRegionFormatter it) {
  final ITypedPreferenceValues preferences = it.getRequest().getPreferences();
  final Integer blankline = preferences.<Integer>getPreference(this);
  final Integer preserve = preferences.<Integer>getPreference(XbaseFormatterPreferenceKeys.preserveBlankLines);
  final int min = ((blankline).intValue() + 1);
  final int max = Math.max(((preserve).intValue() + 1), min);
  it.setNewLines(min, min, max);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:10,代碼來源:BlankLineKey.java

示例4: getOrCreateMapBasedPreferences

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
public MapBasedPreferenceValues getOrCreateMapBasedPreferences() {
	ITypedPreferenceValues preferences = request.getPreferences();
	if (preferences instanceof MapBasedPreferenceValues)
		return (MapBasedPreferenceValues) preferences;
	LinkedHashMap<String, String> newMap = Maps.<String, String> newLinkedHashMap();
	MapBasedPreferenceValues result = new MapBasedPreferenceValues(preferences, newMap);
	request.setPreferences(result);
	return result;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:10,代碼來源:FormatterTestRequest.java

示例5: setPreferences

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
/**
 * @see #preferences
 */
public FormatterRequest setPreferences(ITypedPreferenceValues preferenceValues) {
	this.preferences = preferenceValues;
	return this;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:8,代碼來源:FormatterRequest.java

示例6: getPreferences

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
/**
 * @see #preferences
 */
public ITypedPreferenceValues getPreferences() {
	if (preferences == null)
		preferences = new MapBasedPreferenceValues(Maps.<String, String> newLinkedHashMap());
	return preferences;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:9,代碼來源:FormatterRequest.java

示例7: getPreferences

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
public ITypedPreferenceValues getPreferences() {
	return getFormatter().getPreferences();
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:4,代碼來源:FormattableDocument.java

示例8: getPreferences

import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
/**
 * @return the preferences from the {@link FormatterRequest}
 */
public ITypedPreferenceValues getPreferences() {
	return request.getPreferences();
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:7,代碼來源:AbstractFormatter2.java


注:本文中的org.eclipse.xtext.preferences.ITypedPreferenceValues類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。