Primefaces component library in IntelliJ IDEA 11 - jsf

Is it possible to add the Primefaces component library to IntelliJ IDEA 11 so I can use autocompletion on those tags too? In Eclipse it automatically supports this, but I don't know why it does so or how it works so I am not able to fix this.
Here are two images on how it looks:
UPDATE and FIX
In order to fix this you have to go to project settings | libraries and then add the component library.

Set your cursor on the "http://primefaces.org/ui" text and ATL+ENTER. Choose 'Manually setup external resource'. 'Map External Resources' popup will appear. Choose 'Explorer' tab and select 'primefaces-p.taglib.xml' from primefaces.jar file.

You need to add a technology (I think it's called - might be a facet).
When you create a Web Module Project, you have the option of selecting additional technologies. JSF is an option for Web. Under the JSF node is a sub-node with 4 faces technologies - one of which is Primefaces (others are IronFaces, RichFaces, and another).
When you select the required support option, IntelliJ IDEA will download the required libraries and add them to an existing or new lib.
I believe this functionality is only available in the full version; i.e., not Community Edition.

To add primefaces to your project in Intellij, add the dependency i.e
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>4.0</version>
</dependency>
to your pom.xml. and compile your project.
After that, add primefaces URI to the list of tags usable on that page such as xmlns:p="http://primefaces.org/ui" and you will be fine.

Related

How to use different primefaces versions in one project?

In my project I have to implement a page which use primefaces v6.1 but other pages are written in primefaces version 3.
Its hard to update versions for other pages, on the other hand i dont want to use v3 for the new page.
First i have a idea; manipulating primefaces-p.taglib.xml which is in META-INF,
<namespace>http://primefaces6version.org/ui</namespace> . Try to use in the xhtml page:
xmlns:p="http://primefaces6version.org/ui" and components now can be in primefaces 6 versions! But its not worked, i dont know why.
Is there any idea how to use different primefaces versions in same project?
This is not easily possible and would require a lot of work. It would e.g. require fully refactored (classes renamed etc) version of PrimeFaces including everything in the taglibs and more. You could try just creating a customized PF version for just the datatable, but personally I'd bite the apple and upgrade the application.

Netbeans JSF Palette

Ok, I have been trying to find answer for two days now. I created new Web Application and added JSF framework to it. But when I opened a palette I can see only few tags to be dragged and dropped. I can see HTML, HTML Forms and JSF categories with only about five tags in each. Do I have to add some library or something? Thank you for help.
You better get rid of Netbeans JSF palette when adding components to your page. Writing directly on the page you will be more productive because you have code completion assistance. If you look at the JSF palette it is like a set of squeleton generators more than an exhaustive components set. So basically I would use, perhaps, only the JSF Data Table [From Entity] palette item.

Arrow and tab navigation on Primefaces Tree Component

To make our application WAI-ARIA conformant, i would like to enable the users to be able to navigate, expand, close nodes on a Primefaces tree compoponent using the arrows, tabs and enter keys. On the PF showcase, I see that the tree is navigable using these keys but when I implement my own, I cant. Could anybody enlighten me how I could achieve this.
Can someone also confirm to me that this feature is only available in the Elite version of Primefaces 5.1.X? If so does anyone know when it would be available on the community version?
I am using the PF 5.1 community version on tomcat 7 container.
Easy to find in the PF issuelist and blog
Answer: Yes, since 5.1.3,
Answer 2: So it will be in a community version for 5.2
How to do this yourself? I'd try to download the tree.js source from PrimeFaces SVN from 5.1 and trunk, compare and try to patch the existing code

How do you create your own ADF Faces skin?

We are using the default Oracle ADF Faces 10g default skin. It looks super nice, but we want to make tweaks to it (changing the CSS and also how certain components are rendered -- for example the table component will place buttons above and below the table component-- we want them only on the bottom-- this appears to require a programmatic change in order to change this behavior).
Has anyone had success creating their own ADF Faces skin? Please post what you had to do to change component behavior.
we followed this documentation for webcenter spaces:
http://www.oracle.com/technetwork/middleware/webcenter/owcs-r11-extend-spaces-wp-132596.pdf
The documentation makes use of an already existing oracle extension (how to download the source is in the document).
Once we add the application, we simply added a new entry in the META-INF\trinidad-skins.xml :
<?xml version="1.0" encoding="ISO-8859-1"?>
<skins xmlns="http://myfaces.apache.org/trinidad/skin">
<!-- Previous skins here ... -->
<skin>
<id>myskin.custom.desktop</id>
<family>My Skin</family>
<render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
<style-sheet-name>custom/spaces/skins/myskin/myskin.css</style-sheet-name>
<extends>default.desktop</extends>
</skin>
</skins>
and added the css and img files inside the MET-INF directory in the specified paths (e.g. META-INF/custom/spaces/skins/myskin/myskin.css).
For custom applications on ADF the procedure should be the same.
Since Oracle 11g, Oracle prodives the so called 'skin editor' for your ADF applications.
Until 11.1.7.0, the skin editor was only available as an external application. In the current versions, you can choose for which application version you want to create the skin for your ADF Application (the wizard will give you an option for that when creating a new skin project).
Download Skin Editor:
http://www.oracle.com/technetwork/developer-tools/adf/downloads/index.html
Install instructions:
https://docs.oracle.com/middleware/1212/skineditor/ADFSI/adfsi.htm#ADFSI102
However, since 11.1.7.0 the skin editor is integrated with the Oracle JDeveloper IDE. I already used it for a couple of projects. Although it is easy to get into it and to configure your custom skin, you have to keep in mind that you have to do a lot of manual work to "fully" replace the default skin. There are some components which rely on icons - therefore you have to replace them one by one, using graphical editors (e.g. adobe photoshop or another comparable editor that suits you).

Specifying Source for Debugging using Netbeans

Using the debugger in Netbeans 6.1, I'd like to step into a method of the JSF library (specifically method saveSerializedView of class StateManager), but I cannot figure out how to specify through the IDE the location of the source code for the JSF library. I'm even having trouble determining which jar file or files Netbeans is using for JSF.
This answer applies to Netbeans 6.1 circa September 2008:
It sounds as if you need to explore the "Libraries" dialog. Select "Tools" from the menu bar and "Libraries" from the menu. If you select "JSF" on the left, you'll see an association of jar files, sources (currently none in my Netbeans 6.1) and javadoc (which shows javaee5-doc-api.zip in my Netbeans).
What you need to do is add a new zip or jar of source files under the "Sources" tag.
An example of a fully populated library is the "Swing Layout Extensions" which has a jar file, sources and javadoc.
I take it your jars don't include the source, since you can't "step into."
In cases like these what I do is find the appropriate source (just StateManager.java in this case, if it's available, or jars that include source), taking care that it is the version I'm using. Inside my project tree, I create the package hierarchy to that specific class, and put that source in there. Even if the class exists in a jar, I can use this source to set breakpoints, etc.
Example for Netbeans7 and Mojarra 2.0.3
Create a new library(Tools->Libraries), call it for example Mojarra-2.0.3.
In the classpath tab add the 2 mojarra jars:
jsf-api.jar
jsf-impl.jar
In the sources tab, add two paths:
..\mojarra-2.0.3-FCS-source\jsf-api\src\main\java\
..\mojarra-2.0.3-FCS-source\jsf-ri\src\main\java\
Add the new created library to the project
download the jsf source and point to the working folder for source lookup..
It will dig into the code

Resources