Package fr.adrienbrault.idea.symfony2plugin.dic

Examples of fr.adrienbrault.idea.symfony2plugin.dic.XmlEventParser


        if(!Symfony2ProjectComponent.isEnabled(completionParameters.getPosition())) {
            return;
        }

        XmlEventParser xmlEventParser = ServiceXmlParserFactory.getInstance(completionParameters.getPosition().getProject(), XmlEventParser.class);
        for(Map.Entry<String, String> event : xmlEventParser.get().entrySet()) {
            completionResultSet.addElement(LookupElementBuilder.create(event.getKey()).withTypeText(event.getValue(), true).withIcon(Symfony2Icons.EVENT));
        }

        for(EventDispatcherSubscribedEvent event: EventDispatcherSubscriberUtil.getSubscribedEvents(completionParameters.getPosition().getProject())) {
            completionResultSet.addElement(LookupElementBuilder.create(event.getStringValue()).withTypeText("EventSubscriber", true).withIcon(Symfony2Icons.EVENT));
View Full Code Here


    public static ArrayList<PsiElement> getEventPsiElements(Project project, String eventName) {

        ArrayList<PsiElement> psiElements = new ArrayList<PsiElement>();

        XmlEventParser xmlEventParser = ServiceXmlParserFactory.getInstance(project, XmlEventParser.class);
        for(EventDispatcherSubscribedEvent event : xmlEventParser.getEventSubscribers(eventName)) {
            PhpClass phpClass = PhpElementsUtil.getClass(project, event.getFqnClassName());
            if(phpClass != null) {
                psiElements.add(phpClass);
            }
        }
View Full Code Here

    @Override
    public Object[] getVariants() {

        List<LookupElement> results = new ArrayList<LookupElement>();

        XmlEventParser xmlEventParser = ServiceXmlParserFactory.getInstance(getElement().getProject(), XmlEventParser.class);
        for(EventDispatcherSubscribedEvent event : xmlEventParser.getEvents()) {
            results.add(LookupElementBuilder.create(event.getStringValue()).withTypeText(event.getType(), true).withIcon(Symfony2Icons.EVENT));
        }

        for(EventDispatcherSubscribedEvent event: EventDispatcherSubscriberUtil.getSubscribedEvents(getElement().getProject())) {
            results.add(LookupElementBuilder.create(event.getStringValue()).withTypeText(event.getType(), true).withIcon(Symfony2Icons.EVENT));
View Full Code Here

    @Test
    public void testParse() throws Exception {

        File testFile = new File(this.getClass().getResource("appDevDebugProjectContainer.xml").getFile());

        XmlEventParser serviceMapParser = new XmlEventParser();
        serviceMapParser.parser(testFile);
        Map<String, String> tags = serviceMapParser.get();

        assertTrue(tags.containsKey("kernel.controller"));
        assertEquals("kernel.event_listener", tags.get("kernel.controller"));

        assertTrue(serviceMapParser.getEventSubscribers("kernel.controller").size() > 0);
        assertEquals("Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector", serviceMapParser.getEventSubscribers("kernel.controller").get(0).getFqnClassName());
    }
View Full Code Here

TOP

Related Classes of fr.adrienbrault.idea.symfony2plugin.dic.XmlEventParser

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.