Search in sources :

Example 1 with TimeLogTableModel

use of net.sourceforge.processdash.log.time.TimeLogTableModel in project processdash by dtuma.

the class TimeLogEditor method constructEditPanel.

private JPanel constructEditPanel() {
    JPanel retPanel = new JPanel(false);
    retPanel.setLayout(new BorderLayout());
    tableModel = new TimeLogTableModel();
    if (Settings.isReadOnly() || forceReadOnly)
        tableModel.setEditable(false);
    tableModel.setApprover(approver);
    tableModel.addTableModelListener(this);
    table = new TimeLogJTable(tableModel);
    TableUtils.configureTable(table, TimeLogTableModel.COLUMN_WIDTHS, TimeLogTableModel.COLUMN_TOOLTIPS);
    TableColumn startTimeCol = table.getColumnModel().getColumn(TimeLogTableModel.COL_START_TIME);
    startTimeCol.setCellEditor(new JDateTimeChooserCellEditor(Settings.getVal("timelog.dateTimeEditFormat", DATE_TIME_FORMAT)));
    retPanel.add("Center", new JScrollPane(table));
    JPanel btnPanel = new JPanel(false);
    addButton = createButton(btnPanel, "Add", "addRow");
    createButton(btnPanel, "Delete", "deleteSelectedRow");
    createButton(btnPanel, "Summarize_Button", "summarizeWarning");
    if (Settings.isReadWrite() && !forceReadOnly)
        retPanel.add("South", btnPanel);
    return retPanel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) TimeLogTableModel(net.sourceforge.processdash.log.time.TimeLogTableModel) JDateTimeChooserCellEditor(net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor) TableColumn(javax.swing.table.TableColumn)

Aggregations

BorderLayout (java.awt.BorderLayout)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 TableColumn (javax.swing.table.TableColumn)1 TimeLogTableModel (net.sourceforge.processdash.log.time.TimeLogTableModel)1 JDateTimeChooserCellEditor (net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor)1