private UIFacade getUIFacade() {
return myUIFacade;
}
private Component getComponent() {
OptionsPageBuilder builder = new OptionsPageBuilder();
OptionsPageBuilder.I18N i18n = new OptionsPageBuilder.I18N() {
public String getOptionLabel(GPOption option) {
if (option==myDefaultValue) {
return language.getText("defaultValue");
}
if (option==myDate) {
return "";
}
return super.getOptionLabel(option);
}
};
builder.setI18N(i18n);
{
// Text
textArea = new JTextArea();
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
textArea.setColumns(25);
textArea.setRows(5);
JScrollPane jsp = new JScrollPane(textArea);
panelText = new JPanel(new BorderLayout());
panelText.add(jsp, BorderLayout.CENTER);
}
{
// Boolean
radioTrue = new JRadioButton(language.getText("yes"));
radioFalse = new JRadioButton(language.getText("no"));
ButtonGroup group = new ButtonGroup();
group.add(radioFalse);
group.add(radioTrue);
radioTrue.setSelected(true);
Box box = Box.createVerticalBox();
box.add(radioTrue);
box.add(radioFalse);
panelBoolean = box;
}
{
// Integer
fieldInteger = new GTextField();
fieldInteger.setPattern(GTextField.PATTERN_INTEGER);
fieldInteger.setColumns(10);
fieldInteger.setText("0");
panelInteger = new JPanel(new BorderLayout());
panelInteger.add(fieldInteger, BorderLayout.NORTH);
}
{
// Double
fieldDouble = new GTextField();
fieldDouble.setPattern(GTextField.PATTERN_DOUBLE);
fieldDouble.setColumns(10);
fieldDouble.setText("0.0");
panelDouble = new JPanel(new BorderLayout());
panelDouble.add(fieldDouble, BorderLayout.NORTH);
}
{
panelDate = builder.createStandaloneOptionPanel(myDate);
cardLayoutDefaultValue = new CardLayout();
panelDefaultValue = new JPanel(cardLayoutDefaultValue);
panelDefaultValue.add(cardText, panelText);
panelDefaultValue.add(cardBoolean, panelBoolean);
panelDefaultValue.add(cardInteger, panelInteger);
panelDefaultValue.add(cardDouble, panelDouble);
panelDefaultValue.add(cardDate, panelDate);
}
Component optionsComponent = builder.createGroupComponent(myOptionGroup);
Box result = Box.createVerticalBox();
result.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
//result.setLayout(new BorderLayout());
result.add(optionsComponent);
result.add(Box.createVerticalStrut(10));
result.add(builder.createGroupComponent(myDefaultValueOptionGroup));
result.add(panelDefaultValue);
setDefaultValuePanelEnabled(false);
return result;
} // TODO change the default value for custom columns.