mFavorite = fav;
mFavoriteConfigurator = mFavorite.createConfigurator();
setTitle(mLocalizer.msg("title", "Edit Favorite"));
ScrollableJPanel rootPn = new ScrollableJPanel();
rootPn.setLayout(new BorderLayout());
rootPn.setBorder(Borders.DLU4_BORDER);
JPanel content = new JPanel(new TabLayout(1));
content.setBorder(new EmptyBorder(10, 10, 10, 10));
content.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("section.head", "Favorite")));
content.add(createTitleChangePanel());
content.add(mFavoriteConfigurator.createConfigurationPanel());
content.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("section.details", "Details")));
content.add(createLimitPanel());
content.add(DefaultComponentFactory.getInstance().createSeparator(
mLocalizer.msg("section.exclusions", "Exclusion Criteria")));
content.add(mExclusionPanel = new ExclusionPanel(mFavorite.getExclusions(),this,mFavorite)/*createExclusionPanel()*/);
content.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("section.reminder", "Reminder")));
content.add(createReminderPanel());
content.add(DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("section.extras", "Extras")));
content.add(createExtrasPanel());
JButton cancelBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
JButton okBtn = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
cancelBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
okBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
saveAndClose();
}
});
ButtonBarBuilder2 buttons = new ButtonBarBuilder2();
buttons.addGlue();
buttons.addButton(new JButton[] { okBtn, cancelBtn });
rootPn.add(BorderLayout.NORTH, content);
rootPn.add(BorderLayout.SOUTH, buttons.getPanel());
getRootPane().setDefaultButton(okBtn);
JScrollPane scrollPane = new JScrollPane(rootPn);
scrollPane.setBorder(null);