[jbosstools-dev] Configure the Visual Page Editor palette in JBoss Tools

Slava Kabanovich vkabanovich at exadel.com
Tue Feb 24 15:39:57 EST 2015


Hi,

Contributions to this Palette are added with extension point 
"org.jboss.tools.common.model.preferences".
As an example, see 
jbosstools-javaee/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf-palette.xml

If you are ok with a default "Insert Tag" drop wizard, then no Java 
programming is needed.

In xml, you should wrap your contribution as in the example

<XStudio model-entity="SharableXStudio" NAME="XStudio" SCOPE="project">
     <Palette NAME="Palette" SCOPE="project" model-entity="SharablePalette">
        ...
     </Palette>
</XStudio>

and put inside your <PageTabHTML>, <GroupHTML>, <MacroHTML> nodes.

You may use Palette Editor instead of writing all xml manually.
Open an .xhtml file and push toolbar button 'Palette Editor' in Palette 
View. In Palette Editor, on node 'Palette' create your new group, fill 
it with sub-groups, and fill sub-groups with macro items.

When you save and close Eclipse, modified Palette will be saved as 
%workspace%/.metadata/.plugins/org.jboss.tools.common.model/Palette.xml. 
You will have to find your group <PageTabHTML> in the complete list of 
groups and copy it to contribution file to be registered with extension 
point "org.jboss.tools.common.model.preferences".

Best regards,
Viacheslav Kabanovich

On 02/24/2015 12:01 PM, Gayard, Leonel wrote:
>
> Hi,
>
> I am investigating the internal code in JBoss Tools, in particular, 
> the pieces that fill up the Palette view.
>
> I have checked out the source code of the plugins, but I am having a 
> hard time finding out how the Palette view is filled with the 
> different options. For instance, when running an Eclipse instance with 
> JBoss Tools, I can see the palette view is filled with the same 
> options expected from the manual page at [1]
>
> But I’m having a hard time to find in the source code how the data to 
> fill this tree of categories is found.
>
> I have traced the code, and I see that the categories are fetched as 
> an XModel / Preference Model [2]. So, if the palette view shows the 
> categories HTML, JBoss, JSF, Oracle ADF and others, I would expect to 
> find an XML or Properties file that described those.
>
> Can someone give me any pointers on how the current code finds those 
> categories ?
>
> Another question is, I’m currently checking if we can extend the 
> plugin to add new categories and items in the Palette; can you give me 
> some hint on how to approach this task ?
>
>   [1]: https://docs.jboss.org/tools/4.0.1.Final/en/jsf/html/palette.html
>
>   [2]: 
> https://github.com/jbosstools/jbosstools-base/blob/jbosstools-4.0.0.Final/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java#L64
>
> *Leonel Gayard*/
> /_______________________________________
>
> *GFT Brasil Consultoria Informática Ltda.*
> Av. Sao Francisco, 98
> 18.095-450 Sorocaba, Brasil
>
> T      +55 15 3332 9731
> F
> Leonel.Gayard at gft.com
> www.gft.com <http://www.gft.com/br>/br <http://www.gft.com/br>
> www.gft-blog.com.br <http://www.gft-blog.com.br>
> www.twitter.com/gft_br <http://www.twitter.com/gft_br>
> ______________________________________
>
>
>
>
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20150224/e44fe1df/attachment-0001.html 


More information about the jbosstools-dev mailing list