/***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
****************************************************/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* CredentialsOptionsPanel.java
*
* Created on 28.10.2009, 14:08:29
*/
package de.cismet.lookupoptions.options;
import org.openide.util.lookup.ServiceProvider;
import javax.swing.JOptionPane;
import de.cismet.lookupoptions.AbstractOptionsPanel;
import de.cismet.lookupoptions.OptionsPanelController;
import de.cismet.security.WebAccessManager;
import de.cismet.tools.gui.StaticSwingTools;
/**
* DOCUMENT ME!
*
* @author jruiz
* @version $Revision$, $Date$
*/
@ServiceProvider(service = OptionsPanelController.class)
public class CredentialsOptionsPanel extends AbstractOptionsPanel implements OptionsPanelController {
//~ Static fields/initializers ---------------------------------------------
private static final String OPTION_NAME = org.openide.util.NbBundle.getMessage(
CredentialsOptionsPanel.class,
"CredentialsOptionsPanel.OptionController.name");
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnReset;
private javax.swing.JLabel jLabel1;
// End of variables declaration//GEN-END:variables
//~ Constructors -----------------------------------------------------------
/**
* Creates new form CredentialsOptionsPanel.
*/
public CredentialsOptionsPanel() {
super(OPTION_NAME, SecurityOptionsCategory.class);
initComponents();
}
//~ Methods ----------------------------------------------------------------
/**
* 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() {
btnReset = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
btnReset.setText(org.openide.util.NbBundle.getMessage(
CredentialsOptionsPanel.class,
"CredentialsOptionsPanel.btnReset.text")); // NOI18N
btnReset.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
btnResetActionPerformed(evt);
}
});
jLabel1.setText(org.openide.util.NbBundle.getMessage(
CredentialsOptionsPanel.class,
"CredentialsOptionsPanel.jLabel1.text")); // NOI18N
final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED,
221,
Short.MAX_VALUE).addComponent(btnReset).addContainerGap()));
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
layout.createSequentialGroup().addContainerGap().addGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
.addComponent(btnReset)).addContainerGap(259, Short.MAX_VALUE)));
} // </editor-fold>//GEN-END:initComponents
/**
* DOCUMENT ME!
*
* @param evt DOCUMENT ME!
*/
private void btnResetActionPerformed(final java.awt.event.ActionEvent evt) { //GEN-FIRST:event_btnResetActionPerformed
WebAccessManager.getInstance().resetCredentials();
JOptionPane.showMessageDialog(StaticSwingTools.getParentFrame(this),
org.openide.util.NbBundle.getMessage(
CredentialsOptionsPanel.class,
"CredentialsOptionsPanel.OptionController.success_message"));
} //GEN-LAST:event_btnResetActionPerformed
@Override
public int getOrder() {
return 2;
}
@Override
public String getTooltip() {
return org.openide.util.NbBundle.getMessage(
CredentialsOptionsPanel.class,
"CredentialsOptionsPanel.OptionController.tooltip");
}
}