|
|
||
Edgar Silva's Blog
«NetBeans Plugin Dev : Listing all packages from default main project |
Main
| Simple Project Creator command line for Maven2 »
Using the Java Source Editor and Syntax highlight in any JEditorPanePosted by edgars on January 17, 2007 at 10:52 AM | Comments (2) On the my new JSF Palette Components I've been doing, It allows users get any BackingBean (bean) from the Project, to make it possible, I was looking for on NetBeans Dev Wiki. And I get this entry: http://wiki.netbeans.org/wiki/view/DevFaqEditorJEPForMimeType . However, I think this might works on NetBeans 6.0, cause doing like this entry says ...
EditorKit kit = CloneableEditorSupport.getEditorKit("text/x-java");
JEditorPane jep = new JEditorPane();
jep.setEditorKit(kit);
I in fact did not have success. But, NetBeans Platform, offers great resources, as I did something similar to Greenbox for NetBeans , I did the following code for what I was needing:
/** Creates new form JavaCodePanel */
public JavaCodePanel() {
initComponents();
beanCode.setContentType("text/x-java");
EditorKit kit = JEditorPane.createEditorKitForContentType("text/x-java");
kit.install(beanCode);
beanCode.setEditorKit(kit);
}
On the code the beanCode is a JEditorPane, and now this will have the same actions you can see on default Java Editor.
Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment
| ||
|
|