Author rules
A web component is provided with a set of predefined ‘user agent rules’. You can override these predefined rules with a set of author rules.
These rules are defined in the CSS ruleset returned by the getUserAgentRules method. For example, the user agent rules for the combination box component are defined in the /ilog/webui/dhtml/resources/IlxWComboBox.css resource file, as follows:
// IlxWComboBox.css
ComboBox
{
font-family: helvetica;
font-size: x-small;
cursor:hand;
}
...
ComboBox List Cell:hover
{
color:highlighttext;
background-color:highlight;
}
...
You can override these predefined rules with a set of author rules, by using the setAuthorRules method.
For example:
. . .
IlxWComboBox myCombo = new IlxWComboBox(myComboBoxModel);
. . .
InputStream stream = application.getResourceAsStream("/myresources/mycombo.css");
Reader reader = new InputStreamReader(stream);
IlxWCSSRuleset ruleset = new IlxWCSSRuleset(reader);
myCombo.setAuthorRules(ruleset);
. . .
Where mycombo.css can be defined as follows:
// mycombo.css
ComboBox List Cell:hover
{
color:yellow;
background-color:blue;
}
When you define author rules and set them through IlxWContainer.setAuthorRules, the rules apply to all the children of the container hierarchy. Therefore, if you can define the rules of the manager itself, they apply to all the child components contained in it.