Search in sources :

Example 1 with JDateTimeChooserCellEditor

use of net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor 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)

Example 2 with JDateTimeChooserCellEditor

use of net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor in project processdash by dtuma.

the class TaskScheduleDialog method configureEditor.

protected void configureEditor(JTable table) {
    JDateTimeChooserCellEditor editor = new JDateTimeChooserCellEditor(DATE_FORMAT);
    editor.setClickCountToStart(2);
    table.setDefaultEditor(Date.class, editor);
}
Also used : JDateTimeChooserCellEditor(net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor)

Aggregations

JDateTimeChooserCellEditor (net.sourceforge.processdash.ui.lib.JDateTimeChooserCellEditor)2 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