1 2 3 Previous Next 32 Replies Latest reply on Feb 2, 2010 4:09 PM by dgolovin Go to original post
      • 15. Re: Enabling code assist in xhtml files
        asookazian

        I created a new workspace and another new JSF project.  still doesn't work.

         

        Why is the typing so slow now?  Is this a side-effect of using JSF project (jsfnature?)


        • 16. Re: Enabling code assist in xhtml files
          asookazian

          I just noticed that the Person class is not a Seam JavaBean component (so I added the @Name):

           

          @Name("person")
          public class Person {
              private String name;

           

              public Person() {
              }

           

              public String getName() {
                  return name;
              }

           

              public void setName(String name) {
                  this.name = name;
              }
          }

           

          perhaps this was the issue?

          • 17. Re: Enabling code assist in xhtml files
            asookazian

            Is there a simple JSF project that I can drop in Eclipse and see the code assist work immediately?

             

            This should not be so complicated.  No wonder everybody uses .NET and RoR!

            • 18. Re: Enabling code assist in xhtml files
              dgolovin

              Create JSF Project using "New JSF Project Wizard"

              1. Select "File->New-Project..."

              2. Select "JSF Project" like it shown on screen-shot below

              jsf-project-new1.png

              3. Then configureJSF environment and template like it shown below

              jsf-project2.png

              4. Use any available servlet container, I used tomcat like

              jsf-project3.png

              5. Finish wizard and open WebContent/pages/greeting.xhtml or WebContent/pages/inputname.xhtml to test.

              • 19. Re: Enabling code assist in xhtml files
                asookazian

                thanks for the detailed response.  but that's exactly what I did with the exception of using JBoss 4.2 rather than Tomcat.  Code assist doesn't work (at least not in the sample facelets that are generated).

                 

                now I'm wondering if the hotel booking Seam example project or any others in the Seam distro have the jsfnature setup that I could test out??

                • 20. Re: Enabling code assist in xhtml files
                  asookazian

                  I just installed the 3.1.0.CR1 JBT plugins into my Eclipse Galileo at home.

                   

                  I created a java project for the Seam 2.2.0.GA booking example.  I right-clicked the project, selected configure, selected add JSF capabilities and the code assist does not work in the main.xhtml or book.xhtml facelets (the popup does happen when I type a Seam component name and then "." but no methods to choose from).

                   

                  Here is the .project file contents:

                   

                  <?xml version="1.0" encoding="UTF-8"?>
                  <projectDescription>
                      <name>booking</name>
                      <comment></comment>
                      <projects>
                      </projects>
                      <buildSpec>
                          <buildCommand>
                              <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                          <buildCommand>
                              <name>org.eclipse.wst.common.project.facet.core.builder</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                          <buildCommand>
                              <name>org.eclipse.jdt.core.javabuilder</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                          <buildCommand>
                              <name>org.eclipse.wst.validation.validationbuilder</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                          <buildCommand>
                              <name>org.jboss.tools.common.verification.verifybuilder</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                          <buildCommand>
                              <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
                              <arguments>
                              </arguments>
                          </buildCommand>
                      </buildSpec>
                      <natures>
                          <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
                          <nature>org.eclipse.jdt.core.javanature</nature>
                          <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
                          <nature>org.jboss.tools.jsf.jsfnature</nature>
                          <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
                          <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
                          <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
                      </natures>
                      <linkedResources>
                          <link>
                              <name>WEB-ROOT</name>
                              <type>2</type>
                              <location>C:/java/jboss-seam-2.2.0.GA/examples/booking/resources</location>
                          </link>
                      </linkedResources>
                  </projectDescription>

                   

                  What am I doing wrong?!

                  • 21. Re: Enabling code assist in xhtml files
                    maxandersen

                    you can use Eclipse's update manager to upgrade/downgrade.

                     

                    btw. please stop using mvn eclipse:eclipse and install something like m2eclipse + our maven integration plugins and then do Import > Maven project instead.

                     

                    eclipse:eclipse is and has always been non-sufficient for anything beyond setting up the classpath.

                    • 22. Re: Enabling code assist in xhtml files
                      asookazian

                      Yes!  It works now!

                       

                      thanks.  I had to remove JSF capabilities, add JSF capabilities, add Seam support, add Seam facet.

                       

                      Is this what I will always have to do if I run 'mvn eclipse:clean'?

                       

                      I'm assuming you don't want us to run 'mvn eclipse:clean' or 'mvn eclipse:eclipse' from cmd line.

                      • 23. Re: Enabling code assist in xhtml files
                        asookazian

                        There are many extra files now in my web project after enabling Seam setup and/or Seam facet.

                         

                        example:

                         

                        @Name("authenticator")
                        public class Authenticator
                        {
                            @Logger private Log log;

                         

                            @In Identity identity;
                            @In Credentials credentials;

                         

                            public boolean authenticate()
                            {
                                log.info("authenticating {0}", credentials.getUsername());
                                //write your authentication logic here,
                                //return true if the authentication was
                                //successful, false otherwise
                                if ("admin".equals(credentials.getUsername()))
                                {
                                    identity.addRole("admin");
                                    return true;
                                }
                                return false;
                            }

                         

                        }

                         

                        Also, *.css files that I don't want.

                         

                        How do I prevent this from happening (i.e. I don't need the extra files)?

                        • 24. Re: Enabling code assist in xhtml files
                          maxandersen
                          Arbi - please report these in jira. This should not be happening if you just enable Seam on a standard java project!
                          • 25. Re: Enabling code assist in xhtml files
                            maxandersen

                            mvn eclipse:eclipse / eclipse:clean basically removes all configuration you have done inside eclipse - so yes, if you use that then you will have to do additional configuration.

                             

                            Try using m2eclipse instead.

                            • 26. Re: Enabling code assist in xhtml files
                              akazakov

                              I guess Arbi got a lot of new files after installing Seam facet. Enabling Seam (Project properties->Seam settings OR Configure...->Add Seam support) doesn't add any new resources.

                               

                              Arbi you didn't have to add Seam Facet to enable Seam support.

                              And we have an issue in JIRA to have an option to avoid adding new resources to a project when a user installs Seam facet. See https://jira.jboss.org/jira/browse/JBIDE-2927

                              • 27. Re: Enabling code assist in xhtml files
                                dgolovin

                                Would be good to extend this not just give a way to skip copy operation for several resources but also provide more detailed review for changes, like for example Refactoring->Move does for Java Class.

                                move-example.png

                                It gives you many adwantages:

                                1. It shows what files are going to be alerted

                                2. It gives you a way to control what changes do you accept and what you don't

                                3. It lets you learn have should be altered to enable this technology for your project

                                4. And it could be Undoable, couldn't it?

                                 

                                If you're not intresting in all of this, just hit Finish because this step is optional.

                                • 28. Re: Enabling code assist in xhtml files
                                  asookazian

                                  So I guess the problem is understanding the differences b/n Seam facet and Seam support.  Which now I know I only need to add JSF capabilities and Seam support to my project.  I'll try that next time.

                                   

                                  Is all of this documented clearly somewhere for Seam projects using JBT + CA specifically?

                                   

                                  Actually, it does not let me uncheck the Seam facet.  Now I must manually delete/edit the extra changes/files generated by Seam facet....

                                  • 29. Re: Enabling code assist in xhtml files
                                    dgolovin

                                    asookazian wrote:

                                     

                                    Is all of this documented clearly somewhere for Seam projects using JBT + CA specifically?

                                    Some info you can find on JBossTools documentation site http://download.jboss.org/jbosstools/nightly-docs/, but I'm not sure it contains such a specific info you got here.