java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 3947
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to add your Custom Controls into Eclipse Palette E-mail
User Rating: / 23
PoorBest 

Sometimes you need to customize the widgets. To use the drag-drop facility with these custom widgets, they need to be added to the Eclipse palette.


Image

To do this, two files are needed to be changed in Eclipse:

  1. eclipse\plugins\org.eclipse.ve.swt_1.1.0.1\palette\palette.properties:
  2. First of all make a Category of the Controls like in-built “SWT Controls, SWT Containers”. E.g. if you want to make the category of MyControl then add the following line in the palette.properties file:

       Palette.Category.MyControls = MyControls

  3. eclipse\plugins\org.eclipse.ve.swt_1.1.0.1\palette\ swtpalette.xmi:
  4. Now Custom Control can be added to the Category that you have made with the help of the swtpalette.xmi file. E.g. you can add “TextWithLabel” Widget to MyControl category by adding the following lines in the swtpalette.xmi file:

    <org.eclipse.ve.internal.cde.palette:Drawer>

      <entryLabel xsi:type="org.eclipse.ve.internal.cde.utility:TranslatableString" 
        key="Palette.Category.MyControls" bundle="#bundle"/>
      
      <children xsi:type="org.eclipse.ve.internal.cde.palette:EMFCreationToolEntry" 
      icon16Name="platform:/plugin/org.eclipse.ve.swt/icons/full/clcl16/text_obj.gif" 
      creationClassURI="java:/CustomWidgets#TextWithLabel">

      <entryLabel xsi:type="org.eclipse.ve.internal.cde.utility:ConstantString" 
        string="TextWithLabel"/>

      <keyedValues xsi:type="ecore:EStringToStringMapEntry" 
        key="org.eclipse.ve.internal.cde.core.nameincomposition" 
        value="TextWithLabel"/>

      </children>

    </org.eclipse.ve.internal.cde.palette:Drawer>

     Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.