本文整理汇总了Java中org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor.accept方法的典型用法代码示例。如果您正苦于以下问题:Java ICompletionProposalAcceptor.accept方法的具体用法?Java ICompletionProposalAcceptor.accept怎么用?Java ICompletionProposalAcceptor.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor
的用法示例。
在下文中一共展示了ICompletionProposalAcceptor.accept方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: complete_WebDriverAction
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_WebDriverAction(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
acceptor.accept(this.createCompletionProposal("click on element with css selector \'selector\'", context));
acceptor.accept(this.createCompletionProposal("type text \'text\' in element with css selector \'selector\'", context));
acceptor.accept(this.createCompletionProposal("load page \'subpath\'", context));
acceptor.accept(this.createCompletionProposal("click on element with class \'class\' and text \'text\'", context));
super.complete_WebDriverAction(model, ruleCall, context, acceptor);
}
示例2: complete_Severity
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_Severity(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_Severity");
super.complete_Severity(model, ruleCall, context, acceptor);
acceptor.accept(this.createCompletionProposal("I", context));
acceptor.accept(this.createCompletionProposal("W", context));
acceptor.accept(this.createCompletionProposal("E", context));
}
示例3: complete_ModelName
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_ModelName(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_ModelName");
File file = EditorHelper.getEditedFile();
IFile ifile = ResourceManager.toIFile(file);
List<String> files = BuildPolicyManager.getMissingModelFiles(ifile);
for (final String f : files) {
acceptor.accept(this.createCompletionProposal(f, context));
}
}
示例4: complete_WS
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_WS(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_WS");
super.complete_PathGeneratorStopCondition(model, ruleCall, context, acceptor);
acceptor.accept(this.createCompletionProposal(";", context));
for (final String elt : this.proposals) {
acceptor.accept(this.createCompletionProposal((" " + elt), context));
}
}
示例5: complete_PathGeneratorStopCondition
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_PathGeneratorStopCondition(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_PathGeneratorStopCondition");
super.complete_PathGeneratorStopCondition(model, ruleCall, context, acceptor);
for (final String elt : this.proposals) {
acceptor.accept(this.createCompletionProposal(elt, context));
}
}
示例6: complete_PercentageCondition
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_PercentageCondition(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_PercentageCondition");
acceptor.accept(this.createCompletionProposal("edge_coverage(100)", context));
acceptor.accept(this.createCompletionProposal("vertex_coverage(100)", context));
acceptor.accept(this.createCompletionProposal("requirement_coverage(100)", context));
}
示例7: complete_GraphElement
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_GraphElement(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
try {
System.out.println("---> complete_GraphElement");
StopCondition condition = ((StopCondition) model);
GraphElement ge = condition.getGraphelement();
if ((ge != null)) {
File folder = EditorHelper.getEditedFileFolder();
if ((folder == null)) {
return;
}
String modelFile = EditorHelper.getModelFileName(condition);
File f = new File(folder, modelFile);
System.out.println(("---> complete_GraphElement " + f));
boolean _equals = "reached_vertex".equals(condition.getPathtype());
if (_equals) {
List<String> vertices = GraphWalkerFacade.getVertices(f);
for (final String vertex : vertices) {
acceptor.accept(this.createCompletionProposal(vertex, context));
}
}
boolean _equals_1 = "reached_edge".equals(condition.getPathtype());
if (_equals_1) {
List<String> edges = GraphWalkerFacade.getEdges(f);
for (final String edge : edges) {
acceptor.accept(this.createCompletionProposal(edge, context));
}
}
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例8: complete_Percent
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_Percent(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
System.out.println("---> complete_Percent");
for (int i = 1; (i <= 10); i++) {
String _plus = (Integer.valueOf((10 * i)) + "");
acceptor.accept(this.createCompletionProposal(_plus, context));
}
acceptor.accept(this.createCompletionProposal("<a_percentage_value>", context));
}
示例9: completeIngrediente_Name
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
public void completeIngrediente_Name(final Ingrediente i, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
super.completeIngrediente_Name(i, assignment, context, acceptor);
EObject _eContainer = i.eContainer();
Restaurante r = ((Restaurante) _eContainer);
int _size = IterableExtensions.size(Iterables.<Ingrediente>filter(r.getIngredientes(), Ingrediente.class));
String id = ("CODI" + Integer.valueOf(_size));
ICompletionProposal propuesta = this.createCompletionProposal(id, context);
acceptor.accept(propuesta);
}
示例10: completeRestaurante_Fecha
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
public void completeRestaurante_Fecha(final Restaurante r, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
super.completeRestaurante_Fecha(r, assignment, context, acceptor);
SimpleDateFormat formateadorFecha = new SimpleDateFormat("dd-MM-yyyy");
Calendar calendario = Calendar.getInstance();
final String fecha = formateadorFecha.format(calendario.getTime());
ICompletionProposal propuesta = this.createCompletionProposal(fecha, context);
acceptor.accept(propuesta);
}
示例11: completePrincipal_Foto
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
public void completePrincipal_Foto(final Principal p, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
super.completePrincipal_Foto(p, assignment, context, acceptor);
String _lowerCase = p.getNombre().replace(" ", "_").toLowerCase();
String nombreFoto = ("\'producto_" + _lowerCase);
nombreFoto = (nombreFoto + ".png\'");
ICompletionProposal propuesta = this.createCompletionProposal(nombreFoto, context);
acceptor.accept(propuesta);
}
示例12: completePrincipal_Name
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
public void completePrincipal_Name(final Principal p, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
super.completePrincipal_Name(p, assignment, context, acceptor);
EObject _eContainer = p.eContainer();
Restaurante r = ((Restaurante) _eContainer);
int _size = IterableExtensions.size(Iterables.<Principal>filter(r.getProductos(), Principal.class));
String id = ("CODP" + Integer.valueOf(_size));
ICompletionProposal propuesta = this.createCompletionProposal(id, context);
acceptor.accept(propuesta);
}
示例13: lookupCrossReference
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
/**
* Retrieves possible reference targets from scope, including erroneous solutions (e.g., not visible targets). This
* list is further filtered here. This is a general pattern: Do not change or modify scoping for special content
* assist requirements, instead filter here.
*
* @param proposalFactory
* usually this will be an instance of
* {@link AbstractJavaBasedContentProposalProvider.DefaultProposalCreator DefaultProposalCreator}.
* @param filter
* by default an instance of {@link N4JSCandidateFilter} will be provided here.
*/
@SuppressWarnings("javadoc")
public void lookupCrossReference(
EObject model,
EReference reference,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor,
Predicate<IEObjectDescription> filter,
Function<IEObjectDescription, ICompletionProposal> proposalFactory) {
if (model != null) {
final IScope scope = ((IContentAssistScopeProvider) scopeProvider).getScopeForContentAssist(model,
reference);
// iterate over candidates, filter them, and create ICompletionProposals for them
final Iterable<IEObjectDescription> candidates = scope.getAllElements();
// don't use candidates.forEach since we want an early exit
for (IEObjectDescription candidate : candidates) {
if (!acceptor.canAcceptMoreProposals())
return;
if (filter.apply(candidate)) {
QualifiedName qfn = candidate.getQualifiedName();
String tmodule = null;
if (qfn.getSegmentCount() >= 2) {
tmodule = qfn.getSegment(qfn.getSegmentCount() - 2);
}
// In case of main module, adjust the qualified name, e.g. index.Element -> react.Element
IN4JSProject project = n4jsCore.findProject(candidate.getEObjectURI()).orNull();
QualifiedName candidateName;
if (project != null && tmodule != null && tmodule.equals(project.getMainModule())) {
candidateName = QualifiedName.create(project.getProjectId(),
candidate.getQualifiedName().getLastSegment().toString());
} else {
candidateName = candidate.getQualifiedName();
}
final ICompletionProposal proposal = getProposal(candidate,
model,
scope,
reference,
context,
filter,
proposalFactory);
if (proposal instanceof ConfigurableCompletionProposal
&& candidate.getName().getSegmentCount() > 1) {
ConfigurableCompletionProposal castedProposal = (ConfigurableCompletionProposal) proposal;
castedProposal.setAdditionalData(FQNImporter.KEY_QUALIFIED_NAME,
candidateName);
// Original qualified name is the qualified name before adjustment
castedProposal.setAdditionalData(FQNImporter.KEY_ORIGINAL_QUALIFIED_NAME,
candidate.getQualifiedName());
}
acceptor.accept(proposal);
}
}
}
}
示例14: complete_Postcondition
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_Postcondition(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
acceptor.accept(this.createCompletionProposal("then make sure", context));
super.complete_Precondition(model, ruleCall, context, acceptor);
}
示例15: complete_WebDriverActionCondition
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; //导入方法依赖的package包/类
@Override
public void complete_WebDriverActionCondition(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
acceptor.accept(this.createCompletionProposal("element with css selector \'selector\' is present", context));
acceptor.accept(this.createCompletionProposal("element with css selector \'cssSelector\' has text \'text\'", context));
super.complete_WebDriverActionCondition(model, ruleCall, context, acceptor);
}