本文整理匯總了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(" ");
}
示例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;
}
示例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);
}
示例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;
}
示例5: setPreferences
import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
/**
* @see #preferences
*/
public FormatterRequest setPreferences(ITypedPreferenceValues preferenceValues) {
this.preferences = preferenceValues;
return this;
}
示例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;
}
示例7: getPreferences
import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
public ITypedPreferenceValues getPreferences() {
return getFormatter().getPreferences();
}
示例8: getPreferences
import org.eclipse.xtext.preferences.ITypedPreferenceValues; //導入依賴的package包/類
/**
* @return the preferences from the {@link FormatterRequest}
*/
public ITypedPreferenceValues getPreferences() {
return request.getPreferences();
}