Example usage for com.jgoodies.validation.view ValidationResultViewFactory createReportTextArea

List of usage examples for com.jgoodies.validation.view ValidationResultViewFactory createReportTextArea

Introduction

In this page you can find the example usage for com.jgoodies.validation.view ValidationResultViewFactory createReportTextArea.

Prototype

public static JTextArea createReportTextArea(ValidationResultModel model) 

Source Link

Document

Creates and returns a text area that is intended to show validation messages.

Usage

From source file:org.epri.pt2.dnp3proxy.DNP3ProxyConfigurationPanel.java

License:Open Source License

private void initComponents() {
    // TODO initialize form components
    proxyEnabledLabel = new JLabel("Enable Proxy:");
    proxyEnabled = new JCheckBox();
    proxyEnabled.setSelected(controller.isEnabled());
    proxyEnabled.addActionListener(this);

    proxyAddressLabel = new JLabel("Proxy Address:");
    proxyAddress = new JTextField(controller.getListenAddress());

    proxyPortLabel = new JLabel("Proxy Port:");
    proxyPort = new JTextField(String.format("%d", controller.getListenPort()));

    JPanel proxyConfigPanel = new JPanel();

    proxyConfigPanel.setLayout(new MigLayout("wrap 2", "[right,60]10[fill,200]"));

    proxyConfigPanel.add(proxyEnabledLabel);
    proxyConfigPanel.add(proxyEnabled);/*w  w w.j  a  va2 s . c  o  m*/
    proxyConfigPanel.add(proxyAddressLabel);
    proxyConfigPanel.add(proxyAddress);
    proxyConfigPanel.add(proxyPortLabel);
    proxyConfigPanel.add(proxyPort);

    JComponent validationResultsComponent = ValidationResultViewFactory
            .createReportTextArea(validationResultModel);
    add(validationResultsComponent, "span 2");

    setLayout(new MigLayout());

    // TODO add filter configuration panel if it makes sense

    add(proxyConfigPanel, "dock north");
}

From source file:org.epri.pt2.proxy.ProxyConfigurationPanel.java

License:Open Source License

private void initComponents() {
    proxyEnabledLabel = new JLabel("Enable Proxy:");
    // filtersEnabledLabel = new JLabel("Enable Filters:");

    proxyAddressLabel = new JLabel("Proxy Address:");
    proxyAddress = new JTextField(controller.getListenAddress());

    proxyPortLabel = new JLabel("Proxy Port:");
    proxyPort = new JTextField(String.format("%d", controller.getListenPort()));

    proxyEnabled = new JCheckBox();
    proxyEnabled.setSelected(controller.isEnabled());
    proxyEnabled.addActionListener(this);

    // filtersEnabled = new JCheckBox();
    // filtersEnabled.setSelected(controller.isFilteringEnabled());
    // filtersEnabled.addActionListener(this);

    sslEnabledLabel = new JLabel("Enable SSL:");
    sslEnabled = new JCheckBox();
    sslEnabled.addActionListener(this);

    proxyFilters = new ProxyFiltersPanel();

    JPanel proxyConfigPanel = new JPanel();

    proxyConfigPanel.setLayout(new MigLayout("wrap 2", "[right,60]10[fill,200]"));

    // proxyConfigPanel.add(filtersEnabledLabel);
    // proxyConfigPanel.add(filtersEnabled);
    proxyConfigPanel.add(proxyEnabledLabel);
    proxyConfigPanel.add(proxyEnabled);/* w w w.j  a  va2s . c  o m*/
    proxyConfigPanel.add(sslEnabledLabel);
    proxyConfigPanel.add(sslEnabled);
    proxyConfigPanel.add(proxyAddressLabel);
    proxyConfigPanel.add(proxyAddress);
    proxyConfigPanel.add(proxyPortLabel);
    proxyConfigPanel.add(proxyPort);

    JComponent validationResultsComponent = ValidationResultViewFactory
            .createReportTextArea(validationResultModel);
    proxyConfigPanel.add(validationResultsComponent, "span 2");

    setLayout(new MigLayout());

    add(proxyConfigPanel, "dock north");
    add(proxyFilters, "dock center");
}

From source file:org.epri.pt2.proxy.ProxyFiltersPanel.java

License:Open Source License

private void initComponents() {
    controller = ProxyController.getInstance();

    validation = new FilterValidation();

    enableFilters = new JToggleButton("Enable Filters");
    enableFilters.setSelected(controller.isFilteringEnabled());
    enableFilters.addActionListener(this);

    selectTypeLabel = new JLabel("Type:");
    typeComboBox = new JComboBox(FilterType.values());
    replacementRuleLabel = new JLabel("Match Rule:");
    replacementRule = new JTextField();

    replacementValueLabel = new JLabel("Replace Text:");
    replacementValue = new JTextField();

    JPanel filterAddPanel = new JPanel();
    filterAddPanel.setLayout(new MigLayout("wrap 2", "[right,60]10[fill,200]"));
    filterAddPanel.add(enableFilters, "span 2, align left");
    filterAddPanel.add(selectTypeLabel);
    filterAddPanel.add(typeComboBox);/*from  www  .j  a v  a 2s.  c om*/
    filterAddPanel.add(replacementRuleLabel);
    filterAddPanel.add(replacementRule);
    filterAddPanel.add(replacementValueLabel);
    filterAddPanel.add(replacementValue);

    addFilter = new JButton("Add");
    addFilter.addActionListener(this);

    removeFilter = new JButton("Remove");
    removeFilter.addActionListener(this);

    raisePriority = new JButton("Raise Priority");
    raisePriority.addActionListener(this);
    lowerPriority = new JButton("Lower Priority");
    lowerPriority.addActionListener(this);
    JPanel filterButtonPanel = new JPanel();
    filterButtonPanel.setLayout(new MigLayout());
    //filterButtonPanel.add(enableFilters);
    filterButtonPanel.add(addFilter);
    filterButtonPanel.add(removeFilter);
    filterButtonPanel.add(raisePriority);
    filterButtonPanel.add(lowerPriority);

    JPanel filterPanel = new JPanel();
    filterPanel.setLayout(new MigLayout("wrap 1"));
    filterPanel.add(filterAddPanel);
    filterPanel.add(filterButtonPanel);

    filterModel = FilterTableModel.getInstance();
    filterTable = new JTable(filterModel);
    filterTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

    JScrollPane scrollPane = new JScrollPane(filterTable);
    setLayout(new MigLayout());

    add(filterPanel, "dock north");
    add(scrollPane, "dock center");

    JComponent validationResultsComponent = ValidationResultViewFactory
            .createReportTextArea(validation.validationResultModel);

    add(validationResultsComponent, "dock south");
}