All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.mevenide.hints.ui.customizers.SearchDependencyCustomizer Maven / Gradle / Ivy

The newest version!
/*
 *  Copyright 2008 Mevenide Team.
 * 
 *  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.
 */
package org.codehaus.mevenide.hints.ui.customizers;

import java.util.prefs.Preferences;
import org.codehaus.mevenide.hints.errors.SearchClassDependencyHint;

/**
 *
 * @author  Anuradha G
 */
public class SearchDependencyCustomizer extends javax.swing.JPanel {

    private Preferences p;

    /** Creates new form SearchDependencyCustomizer */
    public SearchDependencyCustomizer(Preferences p) {
        this.p = p;
        initComponents();
        boolean b = p.getBoolean(SearchClassDependencyHint.OPTION_DIALOG, true);
        if (b) {
            jrOptionDialog.setSelected(true);
        }else{
            jrOptionInplace.setSelected(true);
        }
    }

    /** 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")
    // //GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        lblHeader = new javax.swing.JLabel();
        jrOptionDialog = new javax.swing.JRadioButton();
        jrOptionInplace = new javax.swing.JRadioButton();

        setOpaque(false);

        lblHeader.setText(org.openide.util.NbBundle.getMessage(SearchDependencyCustomizer.class, "LBL_Header")); // NOI18N

        buttonGroup1.add(jrOptionDialog);
        jrOptionDialog.setText(org.openide.util.NbBundle.getMessage(SearchDependencyCustomizer.class, "LBL_Option_Dialog")); // NOI18N
        jrOptionDialog.setOpaque(false);
        jrOptionDialog.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrOptionDialogActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrOptionInplace);
        jrOptionInplace.setText(org.openide.util.NbBundle.getMessage(SearchDependencyCustomizer.class, "LBL_Option_InPlace")); // NOI18N
        jrOptionInplace.setOpaque(false);
        jrOptionInplace.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrOptionInplaceActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(lblHeader, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
                    .add(layout.createSequentialGroup()
                        .add(10, 10, 10)
                        .add(jrOptionInplace, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE))
                    .add(layout.createSequentialGroup()
                        .add(10, 10, 10)
                        .add(jrOptionDialog, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(lblHeader)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jrOptionDialog)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jrOptionInplace)
                .addContainerGap(219, Short.MAX_VALUE))
        );
    }// //GEN-END:initComponents

private void jrOptionDialogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrOptionDialogActionPerformed
    p.putBoolean(SearchClassDependencyHint.OPTION_DIALOG, jrOptionDialog.isSelected());
}//GEN-LAST:event_jrOptionDialogActionPerformed

private void jrOptionInplaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrOptionInplaceActionPerformed
    p.putBoolean(SearchClassDependencyHint.OPTION_DIALOG, !jrOptionInplace.isSelected());
}//GEN-LAST:event_jrOptionInplaceActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JRadioButton jrOptionDialog;
    private javax.swing.JRadioButton jrOptionInplace;
    private javax.swing.JLabel lblHeader;
    // End of variables declaration//GEN-END:variables
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy