Eclipse add file plugin - set content type for java files

I am writing an eclipse plugin that whenever you enter a line like "/ usr / share" and press ctrl + space, it will open content support and prompt you to populate files for that folder (similar to other editors.)

In my plugin xml under plugin> .... extension> I have

<contentType id="org.eclipse.core.runtime.xml"/>            

      

If I understand correctly this means that the plugin will work with files with contentType org.eclipse.core.runtime.xml - which means xml files. I want my suggestions to appear on .java files, or better, any type of file. How can i do this?

---- EDIT ---- Here is the complete plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

    <extension
        id="completionproposal.demo.yuval"
        point="org.eclipse.wst.sse.ui.completionProposal">         

        <proposalCategory 
            id="completionproposal.demo.yuval.category"
            name="Yuval completion proposals">
        </proposalCategory>

        <proposalComputer
            activate="true"
            categoryId="completionproposal.demo.yuval.category"
            class="xmlproposals.YuvalCompletionProposalComputer"
            id="completionproposal.demo.yuval.proposalcomputer">

            <contentType id="org.eclipse.core.runtime.xml"/>            
        </proposalComputer>
    </extension>

</plugin>

      

+3
java eclipse xml eclipse-plugin content-assist


source to share


No one has answered this question yet

Check out similar questions:

1858
"Debug certificate expired" error in Android Eclipse plugins
1571
How to avoid Java code in JSP files?
1376
How to create Java string from file content?
1315
How do I create a file and write it in Java?
935
Eclipse Cannot Start - Java was started but exit code returned = 13
475
Eclipse / Java shutdown not working
3
How can I access the default JDT completion clauses in a custom Eclipse plugin?
1
WSO2 how to change response from string to xml
0
Unwanted Elements in Eclipse XML Content
0
Specifying the eclipse version in the plugin.xml file



All Articles
Loading...
X
Show
Funny
Dev
Pics