本文整理了Java中org.eclipse.xtext.util.Wrapper.set()
方法的一些代码示例,展示了Wrapper.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.set()
方法的具体详情如下:
包路径:org.eclipse.xtext.util.Wrapper
类名称:Wrapper
方法名:set
暂无
代码示例来源:origin: org.eclipse.xtext/ui
public void run() {
try {
resultWrapper.set(DisplayRunnableWithResult.this.run());
} catch (Exception e) {
exceptionWrapper.set(e);
}
}
});
代码示例来源:origin: org.eclipse.xtext/junit4
protected int parseText(String text, int offset, Wrapper<String> value) {
int i = offset;
while (i < text.length())
switch (text.charAt(i)) {
case ' ':
case '\t':
case '\r':
case '\n':
value.set(text.substring(offset, i));
return i;
default:
i++;
}
value.set(text.substring(offset, i));
return i;
}
代码示例来源:origin: org.eclipse.xtext/junit4
protected int parseString(String text, int offset, Wrapper<String> value) {
if (offset < text.length() && text.charAt(offset) == '"') {
int i = offset + 1;
while (offset < text.length() && text.charAt(i - 1) == '\\' || text.charAt(i) != '"')
i++;
if (text.charAt(i) == '"') {
value.set(text.substring(offset + 1, i - 1));
return i;
}
}
return -1;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
protected boolean accept(LightweightTypeReference synonym, int flags) {
if (declaringTypeReference.isAssignableFrom(synonym, rawConformanceCheck)) {
expectedReceiverTypeWrapper.set(synonym);
return false;
}
return true;
}
});
代码示例来源:origin: org.eclipse.xtext/ui
public void run() {
try {
DisplayRunnable.this.run();
} catch (Exception e) {
exceptionWrapper.set(e);
}
}
});
代码示例来源:origin: org.eclipse.xtext/junit4
protected int parseXpectSLExpectation(INode node, String text, int offset, Wrapper<Expectation> expectation) {
if (offset + 3 < text.length() && text.substring(offset, offset + 3).equals("-->")) {
int begin = offset + 3;
if (text.charAt(begin) == '\r' || text.charAt(begin) == '\n') {
expectation.set(new Expectation(node.getOffset() + begin, 0, ""));
return begin;
} else if (Character.isWhitespace(text.charAt(begin)))
begin++;
int end = text.indexOf('\n', begin);
if (end < 0)
end = text.length();
String exp = text.substring(begin, end);
expectation.set(new Expectation(node.getOffset() + begin, exp.length(), exp));
return end;
}
return -1;
}
代码示例来源:origin: org.eclipse.xtext/junit4
protected int parseXpectMLExpectation(INode node, String text, int offset, Wrapper<Expectation> expectation) {
if (offset + 3 < text.length() && text.substring(offset, offset + 3).equals("---")) {
String indentation = getIndentation(node, node.getOffset() + offset);
int start = text.indexOf('\n', offset + 3);
int end = text.indexOf("---", offset + 3);
if (start >= 0 && end >= 0) {
String substring = text.substring(start + 1, end);
end = substring.lastIndexOf('\n');
if (end >= 0) {
String exp = substring.substring(0, end);
int len = exp.length();
if (exp.startsWith(indentation))
exp = exp.substring(indentation.length());
exp = exp.replace("\n" + indentation, "\n");
expectation.set(new Expectation(node.getOffset() + start + 1, len, exp, indentation));
return end + start + 1;
}
}
}
return -1;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.util
protected <STATE> Node createNodes(Nfa<STATE> nfa, STATE state, Map<STATE, Integer> names,
Wrapper<Integer> lastName) {
Integer name = names.get(state);
if (name != null)
return new Node(String.valueOf(name), true);
lastName.set(lastName.get() + 1);
names.put(state, lastName.get());
Node node = new Node(String.valueOf(lastName.get()), false);
for (STATE follower : nfa.getFollowers(state))
node.children.add(createNodes(nfa, follower, names, lastName));
return node;
}
}
代码示例来源:origin: org.eclipse.xtext/util
protected <STATE> Node createNodes(Nfa<STATE> nfa, STATE state, Map<STATE, Integer> names,
Wrapper<Integer> lastName) {
Integer name = names.get(state);
if (name != null)
return new Node(String.valueOf(name), true);
lastName.set(lastName.get() + 1);
names.put(state, lastName.get());
Node node = new Node(String.valueOf(lastName.get()), false);
for (STATE follower : nfa.getFollowers(state))
node.children.add(createNodes(nfa, follower, names, lastName));
return node;
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
protected boolean accept(LightweightTypeReference synonym, int hints) {
if (declaringTypeReference.isAssignableFrom(synonym, rawConformanceCheck)) {
receiverTypeParameterMapping.set(new DeclaratorTypeArgumentCollector().getTypeParameterMapping(synonym));
return false;
}
return true;
}
});
代码示例来源:origin: org.eclipse.xtext/util
modified.set(newModified);
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.util
modified.set(newModified);
代码示例来源:origin: org.eclipse.xtext/ui
public boolean visit(IResourceDelta delta) throws CoreException {
if (clear.get().booleanValue())
return false;
if (delta.getResource() != null && isIgnoredResource(delta.getResource()))
return false;
if (isAffectingContainerState(delta)) {
clear.set(Boolean.TRUE);
return false;
}
return true;
}
});
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.web
@Override
public FormattingResult exec(final IXtextWebDocument it, final CancelIndicator cancelIndicator) throws Exception {
if ((FormattingService.this.formatter2Provider != null)) {
textWrapper.set(FormattingService.this.format2(it.getResource(), selection, preferences));
if ((selection != null)) {
int _offset = selection.getOffset();
int _length = selection.getLength();
TextRegion _textRegion = new TextRegion(_offset, _length);
regionWrapper.set(_textRegion);
}
} else {
if ((FormattingService.this.formatter1 != null)) {
final INodeModelFormatter.IFormattedRegion formattedRegion = FormattingService.this.format1(it.getResource(), selection);
textWrapper.set(formattedRegion.getFormattedText());
int _offset_1 = formattedRegion.getOffset();
int _length_1 = formattedRegion.getLength();
TextRegion _textRegion_1 = new TextRegion(_offset_1, _length_1);
regionWrapper.set(_textRegion_1);
} else {
throw new IllegalStateException("No formatter is available in the language configuration.");
}
}
it.setDirty(true);
it.createNewStateId();
String _stateId = it.getStateId();
String _get = textWrapper.get();
TextRegion _get_1 = regionWrapper.get();
return new FormattingResult(_stateId, _get, _get_1);
}
};
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
protected boolean accept(LightweightTypeReference synonymType, int flags) {
List<JvmType> rawTypes = synonymType.getRawTypes();
ConformanceFlags.sanityCheck(flags);
SynonymTypeBucket bucket = new SynonymTypeBucket(id++, rawTypes, resolvedFeaturesProvider, flags);
CompoundTypeReference compoundTypeReference = synonymType.getOwner().newCompoundTypeReference(true);
compoundTypeReference.addComponent(featureDeclarator);
compoundTypeReference.addComponent(synonymType);
wrapper.set(createReceiverFeatureScope(featureCall, receiver, compoundTypeReference, receiverFeature, implicit, validStaticScope, bucket, wrapper.get(), session));
return true;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator
HashSet<Grammar> _hashSet = new HashSet<Grammar>();
this.addAllGrammarsToResource(resource, copy, _hashSet);
isSaving.set(Boolean.valueOf(true));
final Map<String, Object> saveOptions = CollectionLiterals.<String, Object>newHashMap();
if ((resource instanceof XMLResource)) {
isSaving.set(Boolean.valueOf(false));
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
final TypeConformanceComputationArgument rawConformanceCheck = new TypeConformanceComputationArgument(true, false, false, false, false, false);
if (declaringTypeReference.isAssignableFrom(receiverType, rawConformanceCheck)) {
receiverTypeParameterMapping.set(new DeclaratorTypeArgumentCollector().getTypeParameterMapping(receiverType));
} else {
CommonTypeComputationServices services = receiverType.getOwner().getServices();
receiverTypeParameterMapping.set(new DeclaratorTypeArgumentCollector().getTypeParameterMapping(receiverType));
内容来源于网络,如有侵权,请联系作者删除!