Search in sources :

Example 1 with FieldChooserDialog

use of com.cosylab.logging.settings.FieldChooserDialog in project ACS by ACS-Community.

the class ErrorTab method showFieldChooser.

/**
	 * Show the dialog to set the visible columns
	 * <P>
	 * The first time this class is called, the dialog is created.
	 */
private void showFieldChooser() {
    if (fieldChooser == null) {
        fieldChooser = new FieldChooserDialog(ErrorTab.this);
    }
    String[] colNames = new String[LogField.values().length];
    boolean[] colVisible = new boolean[colNames.length];
    for (int t = 0; t < colNames.length; t++) {
        colNames[t] = LogField.values()[t].getName();
        try {
            TableColumn tc = table.getColumn(LogField.values()[t]);
            colVisible[t] = true;
        } catch (IllegalArgumentException e) {
            colVisible[t] = false;
        }
    }
    fieldChooser.setupFields(colNames, colVisible);
    fieldChooser.setVisible(true);
    if (fieldChooser.getModalResult() == DialogExitAction.OK) {
        setupTableCols(fieldChooser.getFields());
    }
}
Also used : FieldChooserDialog(com.cosylab.logging.settings.FieldChooserDialog) TableColumn(javax.swing.table.TableColumn)

Example 2 with FieldChooserDialog

use of com.cosylab.logging.settings.FieldChooserDialog in project ACS by ACS-Community.

the class LogEntryTable method showFieldChooser.

/**
	 * Displays the field chooser dialog.
	 * <p>
	 * Creation date: (1/2/2002 23:20:27)
	 */
public void showFieldChooser() {
    String[] fieldNames = new String[LogField.values().length];
    int t = 0;
    for (LogField f : LogField.values()) {
        fieldNames[t++] = f.getName();
    }
    boolean[] fieldVisible = getVisibleColumns(true);
    if (fieldChooser == null) {
        fieldChooser = new FieldChooserDialog(loggingClient);
    }
    fieldChooser.setupFields(fieldNames, fieldVisible);
    fieldChooser.setVisible(true);
    if (fieldChooser.getModalResult() == DialogExitAction.CANCEL) {
        return;
    }
    boolean[] newFields = fieldChooser.getFields();
    for (int i = 0; i < LogField.values().length; i++) {
        if (newFields[i] != fieldVisible[i]) {
            if (newFields[i])
                showColumn(i + 1);
            else
                hideColumn(i + 1);
        }
    }
}
Also used : FieldChooserDialog(com.cosylab.logging.settings.FieldChooserDialog) LogField(com.cosylab.logging.engine.log.LogField)

Aggregations

FieldChooserDialog (com.cosylab.logging.settings.FieldChooserDialog)2 LogField (com.cosylab.logging.engine.log.LogField)1 TableColumn (javax.swing.table.TableColumn)1