Package systeminformationmonitor.swing

Source Code of systeminformationmonitor.swing.SystemEnvDialog

/*
*  Copyright 2009 Leo Xu.
*
*  Licensed 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.
*  under the License.
*/

/*
* SystemEnvDialog.java
*
* Created on Nov 14, 2009, 3:04:36 AM
*/
package systeminformationmonitor.swing;

import org.jdesktop.application.Action;
import systeminformationmonitor.swing.model.SystemEnvTableModel;
import systeminformationmonitor.system.SystemInformationEnv;

/**
* System Environment Dialog
* @author Leo Xu
*/
public class SystemEnvDialog extends javax.swing.JDialog {

    private SystemEnvTableModel tableModel;

    /** Creates new form SystemEnvDialog */
    public SystemEnvDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        tableModel =
                new SystemEnvTableModel(SystemInformationEnv.getSystemEnv());
        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() {

        closeButton = new javax.swing.JButton();
        envTableScrollPane = new javax.swing.JScrollPane();
        systemEnvTable = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systeminformationmonitor.SystemInformationMonitorApp.class).getContext().getResourceMap(SystemEnvDialog.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(systeminformationmonitor.SystemInformationMonitorApp.class).getContext().getActionMap(SystemEnvDialog.class, this);
        closeButton.setAction(actionMap.get("closeDialog")); // NOI18N
        closeButton.setText(resourceMap.getString("closeButton.text")); // NOI18N
        closeButton.setToolTipText(resourceMap.getString("closeButton.toolTipText")); // NOI18N
        closeButton.setName("closeButton"); // NOI18N

        envTableScrollPane.setName("envTableScrollPane"); // NOI18N

        systemEnvTable.setModel(tableModel);
        systemEnvTable.setName("systemEnvTable"); // NOI18N
        envTableScrollPane.setViewportView(systemEnvTable);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(154, 154, 154)
                .addComponent(closeButton)
                .addContainerGap(187, Short.MAX_VALUE))
            .addComponent(envTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(envTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(closeButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    @Action
    public void closeDialog() {
        this.setVisible(false);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton closeButton;
    private javax.swing.JScrollPane envTableScrollPane;
    private javax.swing.JTable systemEnvTable;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of systeminformationmonitor.swing.SystemEnvDialog

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.