mSettings = settings;
setLayout(new FormLayout("200dlu:grow","fill:150dlu:grow"));
setBorder(Borders.createEmptyBorder(Sizes.DLUY5,Sizes.DLUX5,Sizes.DLUY5,Sizes.DLUX5));
JTabbedPane tabbedPane = new JTabbedPane();
/* level list pane */
CellConstraints cc = new CellConstraints();
EnhancedPanelBuilder levelList = new EnhancedPanelBuilder("5dlu,default:grow");
levelList.setDefaultDialogBorder();
levelList.addRow();
levelList.addSeparator(mLocalizer.msg("downloadLevel", "Download this data"), cc.xyw(1,levelList.getRow(),2));
TvDataLevel[] levelArr = DayProgramFile.getLevels();
String[] levelIds = settings.getLevelIds();
mLevelCheckboxes = new JCheckBox[levelArr.length];
for (int i = 0; i < levelArr.length; i++) {
mLevelCheckboxes[i] = new JCheckBox(levelArr[i].getDescription());
levelList.addRow();
levelList.add(mLevelCheckboxes[i], cc.xy(2,levelList.getRow()));
if (levelArr[i].isRequired()) {
mLevelCheckboxes[i].setSelected(true);
mLevelCheckboxes[i].setEnabled(false);
} else {
for (String levelId : levelIds) {
if (levelId.equals(levelArr[i].getId())) {
mLevelCheckboxes[i].setSelected(true);
}
}
}
}
/* group list pane */
EnhancedPanelBuilder groupListPanel = new EnhancedPanelBuilder("5dlu,0dlu:grow");
groupListPanel.setDefaultDialogBorder();
JTextArea ta = UiUtilities.createHelpTextArea(mLocalizer.msg("channelgroup.description","description"));
groupListPanel.addRow();
groupListPanel.add(ta, cc.xyw(1,groupListPanel.getRow(),2));
JPanel panel2 = new JPanel(new BorderLayout(10, 0));
mGroupListModel = new DefaultListModel();
mGroupList = new JList(mGroupListModel);
mGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
panel2.add(new JScrollPane(mGroupList), BorderLayout.CENTER);
JPanel panel3 = new JPanel(new BorderLayout());
JPanel btnPn = new JPanel();
btnPn.setLayout(new GridLayout(0, 1, 0, 4));
mAddBtn = new JButton(Localizer.getLocalization(Localizer.I18N_ADD),
TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
mRemoveBtn = new JButton(mLocalizer.msg("remove", "Remove"),
TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
mInfoBtn = new JButton("Information", AbstractTvDataService
.getPluginManager().getIconFromTheme(null, "actions", "help-browser",
16));
mAddBtn.setHorizontalAlignment(SwingConstants.LEFT);
mRemoveBtn.setHorizontalAlignment(SwingConstants.LEFT);
mInfoBtn.setHorizontalAlignment(SwingConstants.LEFT);
btnPn.add(mAddBtn);
btnPn.add(mRemoveBtn);
btnPn.add(mInfoBtn);
mAddBtn.addActionListener(this);
mRemoveBtn.addActionListener(this);
mInfoBtn.addActionListener(this);
panel3.add(btnPn, BorderLayout.NORTH);
panel2.add(panel3, BorderLayout.EAST);
JPanel groupInfoPanel = new JPanel(new BorderLayout(3, 0));
JPanel westPn = new JPanel(new BorderLayout());
westPn.add(new JLabel(mLocalizer.msg("description", "Description:")), BorderLayout.NORTH);
groupInfoPanel.add(westPn, BorderLayout.WEST);
mGroupDescriptionTA = UiUtilities.createHelpTextArea("");
mGroupDescriptionTA.setPreferredSize(new Dimension(0, 40));
groupInfoPanel.add(mGroupDescriptionTA, BorderLayout.CENTER);
groupListPanel.addGrowingRow();
groupListPanel.add(panel2, cc.xy(2,groupListPanel.getRow()));
groupListPanel.addRow();
groupListPanel.add(groupInfoPanel, cc.xy(2,groupListPanel.getRow()));
tabbedPane.add(mLocalizer.msg("datalevel", "data level"), levelList.getPanel());
tabbedPane.add(mLocalizer.msg("channelgroups", "channel groups"), groupListPanel.getPanel());
add(tabbedPane, cc.xy(1,1));
mGroupList.addListSelectionListener(new ListSelectionListener() {