Skip to main content

NetBeans Visual Web Components: Override styleClass

4 replies [Last post]
chris55
Offline
Joined: 2007-12-08
Points: 0

[Note that this is a cross-post from the Java Development Tools forum]

First off, I would like to commend the NetBeans Team on the outstanding job they have done in making NetBeans a 'first class' IDE for web development. As a 12 year MS Visual Studio developer, I don't say this lightly. OK, on to my question... I authored a global header Page Fragment and associated style sheet. When I select a visual component (Basic) and set its styleClass from the StyleClass Window, the rendered page never applies the css class:

<span class="searchbox" id="tbsearch"><input class="TxtFld_sun4" id="tbsearch_field" name="tbsearch_field" size="20" type="text" value="" />
</span>

My css class is 'searchbox'. The textbox input element constantly defaults to the 'TxtFld_sun4' css class. So to check if I was going crazy I renamed my 'searchbox' class to the 'TxtFld_sun4' class. At this point the textbox rendered as I wanted. But the problem is if I have to override this 'TxtFld_sun4' global class all visual components that use this css class name will render the same (i.e. like a header search box). Can I apply a custom class to a specific visual component without affecting its default global class?

Thanks,

Chris

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chris55
Offline
Joined: 2007-12-08
Points: 0

Wow, is this something no one has encountered or is everyone simply developing Java 'class 101' web apps. Anyway, for those that may encounter this issue I have been able to discover that the ability to update the look of a web project under NetBeans lies in /Libraries/Web UI Default Theme (webui-jsf-suntheme.jar)/[package]. It should be noted that the documentation states that setting css style classes resides in the style sheets AND client-side Javascript. Definitely a mess and poorly designed theme strategy. I will attempt to implement some non-default themes on the VWP components I am using in my web app. I'll post my results here. Please feel free to add to this thread if you have any experience beyond accepting the theme defaults. Thanks.

chris55
Offline
Joined: 2007-12-08
Points: 0

OK, I found a potential solution... On the blog site of a Sun software engineer (Winston Prakash), who serves a role on the NetBeans Design Time Team, lies the potential answer. He has authored a plug-in called 'Woodstcok Components Theme Builder'. This can be found at http://blogs.sun.com/winston/entry/theme_builder. Using this non-QA'ed plug-in you should be able to create your own theme and add it to the web application as a newly applied theme. Note that this plug-in has not graduated to the NetBeans Plug-in directory and the latest version of this plug-in was targeted for NetBeans 6, Beta 2. I plan on downloading it tonight and assessing if it is a solution for applying custom styling to the default Woodstock visual components. Stay tuned...

chris55
Offline
Joined: 2007-12-08
Points: 0

Well, the installation was smooth but after editing one style class and compiling the build bombed with the following console output (the '...' abbreviates the posting):

...
images-uptodate:
combineImages:
CombineImages: WARNING: key == LOGIN_PRODNAME has no path value.
CombineImages: WARNING: key == TABS_LEVEL2_SELECTED has no path value.
CombineImages: WARNING: key == LOGIN_BACKGROUND has no path value.
CombineImages: WARNING: key == ACCORDION_COLLAPSE_ALL_ALT has no path value.
CombineImages: WARNING: key == TABS_MINITAB_BACKGROUND has no path value.
CombineImages: WARNING: key == MASTHEAD_CORPNAME has no path value.
CombineImages: WARNING: key == FC_COLUMN_HEADER_SORT_GRADIENT_ALT has no path value.
CombineImages: WARNING: key == TABS_LEVEL1_SELECTED has no path value.
CombineImages: WARNING: key == LEFT_PANE_GRADIENT has no path value.
CombineImages: WARNING: key == ACCORDION_EXPANDED_ALT has no path value.
CombineImages: WARNING: key == MASTHEAD_CORPLOGO has no path value.
CombineImages: WARNING: key == TABS_LEVEL3_DESELECT has no path value.
CombineImages: WARNING: key == FC_COLUMN_HEADER_HOV_GRADIENT_ALT has no path value.
CombineImages: WARNING: key == ACCORDION_EXPAND_ALL_ALT has no path value.
CombineImages: WARNING: key == TABS_LEVEL1_SELECTED_1LEV has no path value.
CombineImages: WARNING: key == TABS_LEVEL1_BACKGROUND has no path value.
CombineImages: WARNING: key == TABS_LEVEL2_BACKGROUND has no path value.
CombineImages: WARNING: key == TABS_LEVEL3_BACKGROUND has no path value.
CombineImages: WARNING: key == TABS_LEVEL2_DESELECT has no path value.
CombineImages: WARNING: key == ACCORDION_TAB_MENU_ICON has no path value.
CombineImages: WARNING: key == OK_ALARM_INDICATOR_ALT has no path value.
CombineImages: WARNING: key == VERSION_CORPLOGO has no path value.
CombineImages: WARNING: key == FAVICON_IMAGE has no path value.
CombineImages: WARNING: key == ACCORDION_REFRESH_ALT has no path value.
CombineImages: WARNING: key == OK_ALARM_INDICATOR_WIDTH has no path value.
CombineImages: WARNING: key == HELP_BTNNAV_GRADIENT has no path value.
CombineImages: WARNING: key == WIZARD_SUBTITLE_BACKGROUND has no path value.
CombineImages: WARNING: key == ACCORDION_TAB_MENU_ICON_ALT has no path value.
CombineImages: WARNING: key == MASTHEAD_STATUS_AREA_SEPARATOR has no path value.
CombineImages: WARNING: key == CORPLOGO has no path value.
CombineImages: WARNING: key == ACCORDION_COLLAPSED_ALT has no path value.
CombineImages: WARNING: key == FC_COLUMN_HEADER_SORT_HOV_GRADIENT_ALT has no path value.
CombineImages: WARNING: key == OK_ALARM_INDICATOR_HEIGHT has no path value.
CombineImages: WARNING: key == FC_COLUMN_HEADER_GRADIENT_ALT has no path value.
Created dir: /home/chris/NetBeansProjects/bcntheme/dist
/home/chris/NetBeansProjects/bcntheme/nbproject/build-impl.xml:227: Manifest file: /home/chris/NetBeansProjects/bcntheme/META-INF/MANIFEST.MF does not exist.
BUILD FAILED (total time: 2 minutes 36 seconds)

If anyone knows a fix/work around please let the community know. Thanks.

kenneth_suter
Offline
Joined: 2004-09-13
Points: 0

I was able to get my theme project to build by copying the
/META-INF/manifest.mf to
/META-INF/MANIFEST.MF. I suppose you could also change the build-impl.xml file's '-do-jar' target.