use of net.sourceforge.processdash.ev.EVSnapshot.Metadata in project processdash by dtuma.
the class TaskScheduleSnapshotManager method createGui.
private void createGui(List<Metadata> snapshots) {
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(layout);
int activePos = -1;
snapshotModel = new DefaultListModel();
for (Metadata snap : snapshots) {
if (snap.getId().equals(activeSnapshotId))
activePos = snapshotModel.getSize();
snapshotModel.addElement(snap);
}
snapshotList = new JList(snapshotModel);
snapshotList.setCellRenderer(new CellRenderer());
if (activePos != -1)
snapshotList.setSelectedIndex(activePos);
c.gridx = c.gridy = 0;
c.gridheight = 3;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(0, 0, 0, 10);
add(new JScrollPane(snapshotList), c);
c.gridx = c.gridheight = 1;
c.weighty = c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.CENTER;
c.insets = new Insets(0, 0, 0, 0);
add(new JButton(new EditAction()), c);
c.weighty = c.gridy = 1;
add(new JButton(new DeleteAction()), c);
c.weighty = 0;
c.gridy = 2;
add(new JButton(new SelectAction()), c);
}
Aggregations