4

I want to write a plugin which will give me content assist support and work in JSF. I want it to work like the sample below :

  • I'll type "p:button action="#{
  • Then I'll press "Ctrl+Shift+Space" (for example)
  • It'll read the classes in my project and show them as a list in a pop-up window
  • Then I'll select one class. It'll be like below
  • h:button action="#{MyClass
  • When I type "." , It'll read the methods in my selected class and show them as a list in a pop-up window.
  • Then I'll select a method
  • Finally, It'll end like this "h:button action="#{MyClass.MyMethod}

Do you have any idea, how can i do this? Any suggestions?

tshepang
  • 12,111
  • 21
  • 91
  • 136

2 Answers2

2

One place to look for an example of content assist is to look at XText which already has this feature for DSL-like languages.

XText content assist

See the XText sources in its Git repository: by looking work the log message 'assist', you will have a list of commits all related to content assist implementation, like the XbaseProposalProvider.java class.

Sk8erPeter
  • 6,899
  • 9
  • 48
  • 67
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

The following are both screenshots from the Web Page Editor which comes with the Java EE edition of Eclipse.

wtp editor 1

enter image description here

You can install it by adding the following mirror to your Eclipse repository. Change the name depending on what version you use. For Helios it is http://download.eclipse.org/webtools/repository/helios.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
unR
  • 1,298
  • 14
  • 21
  • Thank you for your answers. I download and imported Web Page Editor. I can write my managed beans, It supports. But not all classes, there are some classes which are not managed beans. By the way when i use CTRL+SPace in "action" attritube, It just brings me managed beans , not the methods. – Birayalp SEN Aug 25 '11 at 07:35
  • you can also try [JBoos Tools](http://www.jboss.org/tools) which has some of the features of JBoss Developer Studio. It also has a page editor (the frist one I've seen with a working preview mode for JSF that understands templates), JBoss Tools also work good for richfaces development. Installation procedure is the same http://download.jboss.org/jbosstools/updates/stable/helios/ though it comes with many many tools and you should try to select only the stuff you need. I'm also looking for a JSF editor that 'just works'. But I'm too lazy to put effort in my search. – unR Aug 25 '11 at 09:49