Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_SYNTAX_INLINE_HELP.get())};
add(basicLabels, basicComps, basicInlineHelp, c, gbc);
BasicExpander[] expanders = new BasicExpander[] {
new BasicExpander(INFO_CTRL_PANEL_EXTRA_OPTIONS_EXPANDER.get()),
new BasicExpander(
INFO_CTRL_PANEL_ATTRIBUTE_TYPE_OPTIONS_EXPANDER.get()),
new BasicExpander(INFO_CTRL_PANEL_MATCHING_RULE_OPTIONS_EXPANDER.get())
};
Component[][] comps = {{parent, aliases, origin, file},
{usage, singleValued, nonModifiable, collective, obsolete},
{approximate, equality, ordering, substring}};
JLabel[][] labels = {{lSuperior, lAliases, lOrigin, lFile},
{lUsage, lType, null, null, null},
{lApproximate, lEquality, lOrdering, lSubstring}};
JLabel[][] inlineHelps = {{null,
Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_SEPARATED_WITH_COMMAS_HELP.get()), null,
Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_SCHEMA_FILE_ATTRIBUTE_HELP.get(File.separator))},
{null, null, null, null, null, null},
{Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_MATCHING_RULE_APPROXIMATE_HELP.get()),
Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_MATCHING_RULE_EQUALITY_HELP.get()),
Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_MATCHING_RULE_ORDERING_HELP.get()),
Utilities.createInlineHelpLabel(
INFO_CTRL_PANEL_MATCHING_RULE_SUBSTRING_HELP.get())
}
};
for (int i=0; i<expanders.length; i++)
{
gbc.gridwidth = 2;
gbc.gridx = 0;
gbc.insets.left = 0;
c.add(expanders[i], gbc);
final JPanel p = new JPanel(new GridBagLayout());
gbc.insets.left = 15;
gbc.gridy ++;
c.add(p, gbc);
gbc.gridy ++;
p.setOpaque(false);
GridBagConstraints gbc1 = new GridBagConstraints();
gbc1.fill = GridBagConstraints.HORIZONTAL;
gbc1.gridy = 0;
add(labels[i], comps[i], inlineHelps[i], p, gbc1);
final BasicExpander expander = expanders[i];
ChangeListener changeListener = new ChangeListener()
{
/**
* {@inheritDoc}
*/
public void stateChanged(ChangeEvent e)
{
p.setVisible(expander.isSelected());
}
};
expander.addChangeListener(changeListener);
expander.setSelected(false);
changeListener.stateChanged(null);
}
ItemListener itemListener = new ItemListener()
{