setExtraFields(extraFields);
if (QUERY_VALUE_ROLE.equals(valueRole))
{
comboBox.setModel(new DefaultComboBoxModel(getQueryNames()));
comboBox.setRenderer(new EmptyValueListCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);
comboBoxActive = true;
}
else if (FIELD_VALUE_ROLE.equals(valueRole))
{
comboBox.setModel(new DefaultComboBoxModel(getFields()));
comboBox.setRenderer(new FieldDefinitionCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);
comboBoxActive = true;
}
else if (GROUP_VALUE_ROLE.equals(valueRole))
{
comboBox.setModel(new DefaultComboBoxModel(getGroups()));
comboBox.setRenderer(new EmptyValueListCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);
comboBoxActive = true;
}
else if (NUMBER_FORMAT_VALUE_ROLE.equals(valueRole))
{
comboBox.setModel(new DefaultComboBoxModel(new NumberFormatModel().getNumberFormats()));
comboBox.setRenderer(new EmptyValueListCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);
comboBoxActive = true;
}
else if (DATE_FORMAT_VALUE_ROLE.equals(valueRole))
{
comboBox.setModel(new DefaultComboBoxModel(new DateFormatModel().getNumberFormats()));
comboBox.setRenderer(new EmptyValueListCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);
comboBoxActive = true;
}
else if (FORMULA_VALUE_ROLE.equals(valueRole))
{
final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
final FieldDefinition[] definitions = getFields();
for (int i = 0; i < definitions.length; i++)
{
final FieldDefinition fieldDefinition = definitions[i];
comboBoxModel.addElement("=" + FormulaUtil.quoteReference(fieldDefinition.getName()));
}
comboBox.setModel(comboBoxModel);
comboBox.setRenderer(new EmptyValueListCellRenderer());
comboBox.setEditable(true);
add(comboBox, BorderLayout.CENTER);
add(ellipsisButton, BorderLayout.EAST);
comboBox.requestFocus();
setValueRole(valueRole);