4 Replies Latest reply on Aug 13, 2009 6:43 PM by kragoth

    Code Assist for Custom Components

    kragoth

      Hey guys,

      I'm working on a project where we heavily utilise custom components. And by following the instructions provided in the documentation I have been able to get custom code assist to work for us :D (Very happy).

      Relevant doco section: 3.1.2.5. Adding dynamic code assist to custom components that were added to JBoss Tools Palette


      However, this solution is rather limiting because if I have multiple workspaces my code assist is the same between both of them. So if I'm working on a branch of my code base I'm still getting the autocomplete that is set up for the head of my code base.
      The step that causes this limitation is this:

      Add information on your xml file in <JBDS_home>/studio/eclipse/plugins/org.jboss.common.kb_***/plugin.xml
       <tld
       jsf="true"
       name="Jenia Faces"
       schema-location="schemas/tld/myJSF.xml"
       uri="http://www.jenia.org/jsf/dataTools"/>
      



      Is there any chance that sometime in the future this could be changed so that each workspace can setup the tld/xsd file associations seperately?

        • 1. Re: Code Assist for Custom Components
          akazakov

          Hi,
          You don't have to add such xmls to workspace in JBossTools 3.1 M3 (coming soon) anymore.
          If there is proper TLD in class path of your project then we use it in Code Assist. Facelets tag libs descriptors are used too but there is not information about component's attributes.
          See https://jira.jboss.org/jira/browse/JBIDE-2808

          • 2. Re: Code Assist for Custom Components
            akazakov

            BTW if the version of your TLDs are different in brunch and head code then you can use attribute. Please make sure you have defferent versions in *.tld. And then you will be able set up proper tld's varion in plug-in.xml.
            For example:
            *.tld from head code:

            ...
            1.0.1
            ...

            *.tld from brunch code:

            ...
            1.0.2
            ...

            plugin.xml :
            <tld
            jsf="true"
            name="Jenia Faces 1.0.1"
            schema-location="schemas/tld/myJSF1.0.1.xml"
            uri="http://www.jenia.org/jsf/dataTools"
            version="1.0.1"/>
            <tld
            jsf="true"
            name="Jenia Faces 1.0.2"
            schema-location="schemas/tld/myJSF1.0.2.xml"
            uri="http://www.jenia.org/jsf/dataTools"
            version="1.0.2"/>

            • 3. Re: Code Assist for Custom Components
              akazakov

               

              *.tld from head code:
              <tld>
              ...
              <version>1.0.1</version>
              ...
              
              *.tld from brunch code:
              <tld>
              ...
              <version>1.0.2</version>
              ...
              
              plugin.xml :
              <tld
               jsf="true"
               name="Jenia Faces 1.0.1"
               schema-location="schemas/tld/myJSF1.0.1.xml"
               uri="http://www.jenia.org/jsf/dataTools"
               version="1.0.1"/>
              <tld
               jsf="true"
               name="Jenia Faces 1.0.2"
               schema-location="schemas/tld/myJSF1.0.2.xml"
               uri="http://www.jenia.org/jsf/dataTools"
               version="1.0.2"/>


              • 4. Re: Code Assist for Custom Components
                kragoth

                Hi akazakov,

                Thank you for the information and ideas :)

                I look forward to M3 release to see if that helps.

                The idea of versioning the tld I hadn't even thought of! Thanks for that :D