19 package org.sleuthkit.autopsy.keywordsearch;
27 class NewKeywordPanel
extends javax.swing.JPanel {
32 public NewKeywordPanel() {
39 String getKeywordText() {
40 return keywordTextField.getText();
46 boolean isKeywordRegex() {
47 return regexButton.isSelected();
53 boolean isKeywordExact() {
54 return exactButton.isSelected();
62 @SuppressWarnings(
"unchecked")
64 private
void initComponents() {
66 keywordTypeButtonGroup =
new javax.swing.ButtonGroup();
67 keywordTextField =
new javax.swing.JTextField();
68 exactButton =
new javax.swing.JRadioButton();
69 substringButton =
new javax.swing.JRadioButton();
70 regexButton =
new javax.swing.JRadioButton();
71 newKeywordLabel =
new javax.swing.JLabel();
73 keywordTextField.setText(
org.openide.util.NbBundle.getMessage(NewKeywordPanel.class,
"NewKeywordPanel.keywordTextField.text"));
74 keywordTextField.addAncestorListener(
new javax.swing.event.AncestorListener() {
75 public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
77 public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
78 keywordTextFieldAncestorAdded(evt);
80 public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
84 keywordTypeButtonGroup.add(exactButton);
85 exactButton.setSelected(
true);
86 org.openide.awt.Mnemonics.setLocalizedText(exactButton,
org.openide.util.NbBundle.getMessage(NewKeywordPanel.class,
"NewKeywordPanel.exactButton.text"));
88 keywordTypeButtonGroup.add(substringButton);
89 org.openide.awt.Mnemonics.setLocalizedText(substringButton,
org.openide.util.NbBundle.getMessage(NewKeywordPanel.class,
"NewKeywordPanel.substringButton.text"));
91 keywordTypeButtonGroup.add(regexButton);
92 org.openide.awt.Mnemonics.setLocalizedText(regexButton,
org.openide.util.NbBundle.getMessage(NewKeywordPanel.class,
"NewKeywordPanel.regexButton.text"));
94 org.openide.awt.Mnemonics.setLocalizedText(newKeywordLabel,
org.openide.util.NbBundle.getMessage(NewKeywordPanel.class,
"NewKeywordPanel.newKeywordLabel.text"));
96 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
97 this.setLayout(layout);
98 layout.setHorizontalGroup(
99 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 .addGroup(layout.createSequentialGroup()
102 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103 .addGroup(layout.createSequentialGroup()
104 .addComponent(exactButton)
105 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
106 .addComponent(substringButton)
107 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
108 .addComponent(regexButton))
109 .addComponent(newKeywordLabel)
110 .addComponent(keywordTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))
111 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
113 layout.setVerticalGroup(
114 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115 .addGroup(layout.createSequentialGroup()
117 .addComponent(newKeywordLabel)
118 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
119 .addComponent(keywordTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
120 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
121 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
122 .addComponent(exactButton)
123 .addComponent(substringButton)
124 .addComponent(regexButton))
125 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
129 private void keywordTextFieldAncestorAdded(javax.swing.event.AncestorEvent evt) {
130 evt.getComponent().requestFocusInWindow();
135 private javax.swing.JRadioButton exactButton;
136 private javax.swing.JTextField keywordTextField;
137 private javax.swing.ButtonGroup keywordTypeButtonGroup;
138 private javax.swing.JLabel newKeywordLabel;
139 private javax.swing.JRadioButton regexButton;
140 private javax.swing.JRadioButton substringButton;