19 package com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud;
21 import java.util.regex.Pattern;
22 import javax.swing.event.DocumentEvent;
23 import javax.swing.event.DocumentListener;
24 import org.apache.commons.lang3.StringUtils;
25 import org.openide.util.NbBundle.Messages;
32 private static final Pattern
LICENSE_PATTERN = Pattern.compile(
"^\\s*[a-zA-Z0-9\\-]+?\\s*$");
44 public void changedUpdate(DocumentEvent e) {
49 public void insertUpdate(DocumentEvent e) {
54 public void removeUpdate(DocumentEvent e) {
65 "CTLicenseDialog_verifyInput_licenseNumberError=<html>Please verify license number format of 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'</html>"
69 if (LICENSE_PATTERN.matcher(licenseInput).matches()) {
73 this.
warningLabel.setText(Bundle.CTLicenseDialog_verifyInput_licenseNumberError());
83 @SuppressWarnings(
"unchecked")
86 java.awt.GridBagConstraints gridBagConstraints;
88 javax.swing.JLabel licenseNumberLabel =
new javax.swing.JLabel();
90 javax.swing.JPanel buttonPadding =
new javax.swing.JPanel();
91 okButton =
new javax.swing.JButton();
95 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
96 setTitle(
org.openide.util.NbBundle.getMessage(
CTLicenseDialog.class,
"CTLicenseDialog.title"));
99 getContentPane().setLayout(
new java.awt.GridBagLayout());
101 org.openide.awt.Mnemonics.setLocalizedText(licenseNumberLabel,
org.openide.util.NbBundle.getMessage(
CTLicenseDialog.class,
"CTLicenseDialog.licenseNumberLabel.text"));
102 gridBagConstraints =
new java.awt.GridBagConstraints();
103 gridBagConstraints.gridx = 0;
104 gridBagConstraints.gridy = 0;
105 gridBagConstraints.gridwidth = 3;
106 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
107 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
108 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
109 getContentPane().add(licenseNumberLabel, gridBagConstraints);
113 warningLabel.setMaximumSize(
new java.awt.Dimension(419, 36));
114 warningLabel.setMinimumSize(
new java.awt.Dimension(419, 36));
115 warningLabel.setPreferredSize(
new java.awt.Dimension(419, 36));
116 gridBagConstraints =
new java.awt.GridBagConstraints();
117 gridBagConstraints.gridx = 0;
118 gridBagConstraints.gridy = 2;
119 gridBagConstraints.gridwidth = 3;
120 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
121 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
124 javax.swing.GroupLayout buttonPaddingLayout =
new javax.swing.GroupLayout(buttonPadding);
125 buttonPadding.setLayout(buttonPaddingLayout);
126 buttonPaddingLayout.setHorizontalGroup(
127 buttonPaddingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
128 .addGap(0, 0, Short.MAX_VALUE)
130 buttonPaddingLayout.setVerticalGroup(
131 buttonPaddingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132 .addGap(0, 0, Short.MAX_VALUE)
135 gridBagConstraints =
new java.awt.GridBagConstraints();
136 gridBagConstraints.gridx = 0;
137 gridBagConstraints.gridy = 3;
138 gridBagConstraints.weightx = 1.0;
139 getContentPane().add(buttonPadding, gridBagConstraints);
141 org.openide.awt.Mnemonics.setLocalizedText(
okButton,
org.openide.util.NbBundle.getMessage(
CTLicenseDialog.class,
"CTLicenseDialog.okButton.text"));
142 okButton.addActionListener(
new java.awt.event.ActionListener() {
143 public void actionPerformed(java.awt.event.ActionEvent evt) {
147 gridBagConstraints =
new java.awt.GridBagConstraints();
148 gridBagConstraints.gridx = 2;
149 gridBagConstraints.gridy = 3;
150 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
151 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
152 getContentPane().add(
okButton, gridBagConstraints);
155 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
156 public void actionPerformed(java.awt.event.ActionEvent evt) {
160 gridBagConstraints =
new java.awt.GridBagConstraints();
161 gridBagConstraints.gridx = 1;
162 gridBagConstraints.gridy = 3;
163 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
164 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
168 gridBagConstraints =
new java.awt.GridBagConstraints();
169 gridBagConstraints.gridx = 0;
170 gridBagConstraints.gridy = 1;
171 gridBagConstraints.gridwidth = 3;
172 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
173 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
185 this.licenseString = null;
CTLicenseDialog(java.awt.Frame parent, boolean modal)
javax.swing.JLabel warningLabel
javax.swing.JTextField licenseNumberTextField
static final Pattern LICENSE_PATTERN
javax.swing.JButton cancelButton
void okButtonActionPerformed(java.awt.event.ActionEvent evt)
void cancelButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton okButton