|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FEEDS SEARCH LINKS CONTACT poting Today's Page Hits: 39 |
Wednesday May 14, 2008
Use Facelets Support Modules on NetBeans 6.1
To use the Facelets support modules that we have downloaded or built from the source in my pervious blog, 'Build and Install Facelets Support Modules on NetBeans 6.1', I will briefly describe how these support modules will help your development works here. Create Facelets Support Web Project After installed the Facelets Support, you will find a new entry 'Facelets' in
the Frameworks panel when you create a new web project. Select and check this
entry before clicking on Finish. Multiple frameworks selection should work but
is not a supported feature as there is no much testing has been done here.
To see what you have for the new Facelets project, expand the folder nodes under the Project panel. The IDE recognizes a file as a Facelets file if:
Add more Facelets Pages and Contents Now we are going to add more interesting contents to our Facelets project. When you focus on the Facelets .xhtml editor, you will notice that there are extra palettes available for your Facelets pages. Let's add more JSF components into our boring welcome page by drag-n-drop the palette to the .xhtml editor. I have done here by just drag-n-drop an outputText and a commandButton to the editor and change their values to something meaningful.
Click on the Run button and you will see the following contents appear in your browser: To add more Facelets files to your project, right click on the Web Pages node and select New -> Other... to invoke the New File dialog. Select the JavaServer Faces category and you will see there are 3 templates for the Facelets support:
Use Code Completion The IDE provides tag code completion for all Facelets tag libraries that are included in the web project. The IDE scans the tag libraries definition file in the same way as Facelets does. These XML files can be referenced in the following two ways:
By default code completion offers the tags with default prefixes. Developers can add extra namespace definition or modify the default prefix. The code completion will adjust to include the new prefixes in the list. The default prefixes are: More available prefixes are also available when drag-n-drop components from the Palette: By default, the Facelets tag code completion provides tag attributes for the following standard Facelets libraries:
classpath for all tld files. The code completion
will provide extra attribute support if the tld file defines the Facelets Tag
library. Their associate dynamic help will also be provided.
Use Hyperlink By using the Hyperlink, developers can fast navigate from one source to another reference.
You can visualize the link by holding down the
Refactoring Support The refactoring support processes all files in the list of JSF configuration files. Bean and
Java class/method usages are found in bean and alias elements and their subelements, as well as
elements in the util namespace. In the following examples, it creates 2 managed beans,
Move support associate with the refactoring is also provided. The following example shows the
preview of moving Save Delete support associate with the refactoring is also provided which will search the usage with preview. Find usages The Facelets support will plug into the Java find usages to show JSF beans definitions which
refer to Java elements (classes, methods, fields, properties). The Find Usages action will be
available for bean definitions as well, to show beans used by other beans. The following example
shows how the managed bean file,
Create Sample Projects There are two sample projects included in these modules. The first one is
Facelets Template Examples that shows the example of layouts usage. The second
one is the well known Number Guess Example by using the Facelets. You may simply
create the project and deploy to see the Facelets in your browser. Posted at 01:30PM May 14, 2008 by poting in Sun | Comments[3]
Thursday May 08, 2008
Build and Install Facelets Support Modules on NetBeans 6.1
There are lots of requests that asking when and how the Facelets support be available on NetBeans 6.1. Yes, there is plan to officially release the support NBMs by the update center for NetBeans 6.1. We are currently working on that to resolve several compatible issues and migrate the internal APIs usage to NetBeans 6.1. When it is ready for the final release, we will announce it and make it available and show them under the Available Plugins list of NetBeans 6.1. Build from Sources According to the Open Sources concept, any users or developers can always pre-build their latest binaries and try/test before the official releases. This is also true for the Facelets plugin and believe me, it's very simple and can be done in just minutes! We have already done many tasks for the NetBeans 6.1 migration to ease the build requirement.
Install the Facelets Support NBMs The next step is to install the Facelets NBMs that we have just created into
the IDE. You can invoke the Plugins dialog by menu Tools -> Plugins, select the
Downloaded tab and click on Add Plugins... to open these 4 NBMs. Uninstall the Facelets Support In case you need to uninstall the Facelets Support for any reason, use the
menu Tools -> Plugins to get the dialog, select the Installed tab and choose
'Facelets Support', 'Simple JSF/Facelets Snippets', and 'Facelets Library
1.1.14', then click on Uninstall to uninstall the support. Posted at 02:34PM May 08, 2008 by poting in Sun | Comments[27] |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||