Package com.dubture.symfony.core.codeassist.contexts

Examples of com.dubture.symfony.core.codeassist.contexts.ServiceContainerContext


    }

    @Override
    public void apply(ICompletionReporter reporter) throws BadLocationException {

        ServiceContainerContext context = (ServiceContainerContext) getContext();
        IScriptProject project = context.getSourceModule().getScriptProject();

        SymfonyModelAccess model= SymfonyModelAccess.getDefault();
        List<Service> services = model.findServices(project.getPath());
        SourceRange range = getReplacementRange(context);

        String prefix = context.getPrefix();

        if (services == null) {
            return;
        }

        for(Service service : services) {
            if (CodeAssistUtils.startsWithIgnoreCase(service.getId(), prefix)) {
             
                IType[] serviceTypes = model.findServiceTypes(service, project);
                ModelElement parent = null;
               
                if (serviceTypes.length > 0) {
                    parent = (ModelElement) serviceTypes[0];
                } else {
                    parent = (ModelElement) context.getSourceModule();
                }

                Service s = new Service(parent, service.getElementName());
                s.setId(service.getId());
                reporter.reportType(s, "", range);
View Full Code Here


  @Override
  public ICompletionContext[] createContexts() {

    return new ICompletionContext[] {
        new AnnotationCompletionContext(),
        new ServiceContainerContext(),
        new TemplateVariableContext(),
        new RouteCompletionContext(),
        new ViewPathArgumentContext(),
        new EntityCompletionContext(),
        new TransUnitCompletionContext(),
View Full Code Here

TOP

Related Classes of com.dubture.symfony.core.codeassist.contexts.ServiceContainerContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.