/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.netbeans.modules.payara.common.ui;

import java.awt.Component;
import java.util.Arrays;
import java.util.List;

public class ConnectionPoolAdvancedAttributesCustomizer extends BasePanel {

    /**
     * Creates new form ConnectionPoolAdvancedAttributesCustomizer
     */
    public ConnectionPoolAdvancedAttributesCustomizer() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        rootPanel = new javax.swing.JPanel();
        slowQueryLogThresholdLayeredPane = new javax.swing.JPanel();
        slowQueryLogThresholdLabel = new javax.swing.JLabel();
        slowQueryLogThresholdLayeredPane2 = new javax.swing.JLayeredPane();
        slowQueryLogThresholdTextField = new javax.swing.JTextField();
        secondsLabel = new javax.swing.JLabel();
        logJDBCCallsLayeredPane = new javax.swing.JPanel();
        logJDBCCallsLabel = new javax.swing.JLabel();
        logJDBCCallsCheckBox = new javax.swing.JCheckBox();
        sqlTraceListenersLayeredPane = new javax.swing.JPanel();
        sqlTraceListenersLabel = new javax.swing.JLabel();
        sqlTraceListenersLayeredPane2 = new javax.swing.JLayeredPane();
        sqlTraceListenersTextField = new javax.swing.JTextField();

        rootPanel.setLayout(new java.awt.GridLayout(3, 1, 0, 5));

        slowQueryLogThresholdLayeredPane.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.slowQueryLogThresholdLayeredPane.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(slowQueryLogThresholdLabel, org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.slowQueryLogThresholdLabel.text")); // NOI18N

        slowQueryLogThresholdLayeredPane2.setLayout(new java.awt.BorderLayout());

        slowQueryLogThresholdTextField.setText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.slowQueryLogThresholdTextField.text")); // NOI18N
        slowQueryLogThresholdTextField.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.slowQueryLogThresholdLayeredPane.toolTipText")); // NOI18N
        slowQueryLogThresholdTextField.setName("slow-query-threshold-in-seconds"); // NOI18N
        slowQueryLogThresholdLayeredPane2.add(slowQueryLogThresholdTextField, java.awt.BorderLayout.CENTER);

        secondsLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        secondsLabel.setText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.secondUnitLabel.text")); // NOI18N
        secondsLabel.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
        secondsLabel.setPreferredSize(new java.awt.Dimension(65, 14));
        slowQueryLogThresholdLayeredPane2.add(secondsLabel, java.awt.BorderLayout.LINE_END);

        javax.swing.GroupLayout slowQueryLogThresholdLayeredPaneLayout = new javax.swing.GroupLayout(slowQueryLogThresholdLayeredPane);
        slowQueryLogThresholdLayeredPane.setLayout(slowQueryLogThresholdLayeredPaneLayout);
        slowQueryLogThresholdLayeredPaneLayout.setHorizontalGroup(
            slowQueryLogThresholdLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(slowQueryLogThresholdLayeredPaneLayout.createSequentialGroup()
                .addComponent(slowQueryLogThresholdLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(slowQueryLogThresholdLayeredPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                .addContainerGap())
        );
        slowQueryLogThresholdLayeredPaneLayout.setVerticalGroup(
            slowQueryLogThresholdLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(slowQueryLogThresholdLayeredPaneLayout.createSequentialGroup()
                .addGroup(slowQueryLogThresholdLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(slowQueryLogThresholdLayeredPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, Short.MAX_VALUE)
                    .addComponent(slowQueryLogThresholdLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        rootPanel.add(slowQueryLogThresholdLayeredPane);

        logJDBCCallsLayeredPane.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsLayeredPane.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(logJDBCCallsLabel, org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsLabel.text")); // NOI18N

        logJDBCCallsCheckBox.setText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsCheckbox.text")); // NOI18N
        logJDBCCallsCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsLayeredPane.toolTipText")); // NOI18N
        logJDBCCallsCheckBox.setName("log-jdbc-calls"); // NOI18N

        javax.swing.GroupLayout logJDBCCallsLayeredPaneLayout = new javax.swing.GroupLayout(logJDBCCallsLayeredPane);
        logJDBCCallsLayeredPane.setLayout(logJDBCCallsLayeredPaneLayout);
        logJDBCCallsLayeredPaneLayout.setHorizontalGroup(
            logJDBCCallsLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(logJDBCCallsLayeredPaneLayout.createSequentialGroup()
                .addComponent(logJDBCCallsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(logJDBCCallsCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        logJDBCCallsLayeredPaneLayout.setVerticalGroup(
            logJDBCCallsLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(logJDBCCallsLayeredPaneLayout.createSequentialGroup()
                .addGroup(logJDBCCallsLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(logJDBCCallsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(logJDBCCallsCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        rootPanel.add(logJDBCCallsLayeredPane);

        sqlTraceListenersLayeredPane.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersLayeredPane.toolTipText")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(sqlTraceListenersLabel, org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersLabel.text")); // NOI18N

        sqlTraceListenersLayeredPane2.setLayout(new java.awt.BorderLayout());

        sqlTraceListenersTextField.setText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersTextField.text")); // NOI18N
        sqlTraceListenersTextField.setToolTipText(org.openide.util.NbBundle.getMessage(ConnectionPoolAdvancedAttributesCustomizer.class, "ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersLayeredPane.toolTipText")); // NOI18N
        sqlTraceListenersTextField.setName("sql-trace-listeners"); // NOI18N
        sqlTraceListenersLayeredPane2.add(sqlTraceListenersTextField, java.awt.BorderLayout.CENTER);

        javax.swing.GroupLayout sqlTraceListenersLayeredPaneLayout = new javax.swing.GroupLayout(sqlTraceListenersLayeredPane);
        sqlTraceListenersLayeredPane.setLayout(sqlTraceListenersLayeredPaneLayout);
        sqlTraceListenersLayeredPaneLayout.setHorizontalGroup(
            sqlTraceListenersLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sqlTraceListenersLayeredPaneLayout.createSequentialGroup()
                .addComponent(sqlTraceListenersLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(sqlTraceListenersLayeredPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                .addContainerGap())
        );
        sqlTraceListenersLayeredPaneLayout.setVerticalGroup(
            sqlTraceListenersLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sqlTraceListenersLayeredPaneLayout.createSequentialGroup()
                .addGroup(sqlTraceListenersLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(sqlTraceListenersLayeredPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, Short.MAX_VALUE)
                    .addComponent(sqlTraceListenersLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        rootPanel.add(sqlTraceListenersLayeredPane);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rootPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rootPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 107, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox logJDBCCallsCheckBox;
    private javax.swing.JLabel logJDBCCallsLabel;
    private javax.swing.JPanel logJDBCCallsLayeredPane;
    private javax.swing.JPanel rootPanel;
    private javax.swing.JLabel secondsLabel;
    private javax.swing.JLabel slowQueryLogThresholdLabel;
    private javax.swing.JPanel slowQueryLogThresholdLayeredPane;
    private javax.swing.JLayeredPane slowQueryLogThresholdLayeredPane2;
    private javax.swing.JTextField slowQueryLogThresholdTextField;
    private javax.swing.JLabel sqlTraceListenersLabel;
    private javax.swing.JPanel sqlTraceListenersLayeredPane;
    private javax.swing.JLayeredPane sqlTraceListenersLayeredPane2;
    private javax.swing.JTextField sqlTraceListenersTextField;
    // End of variables declaration//GEN-END:variables

    @Override
    protected String getPrefix() {
        return "resources.jdbc-connection-pool."; // NOI18N
    }

    @Override
    protected List<Component> getDataComponents() {
        return Arrays.asList(new Component[] {slowQueryLogThresholdTextField, logJDBCCallsCheckBox, sqlTraceListenersTextField});
    }
}
