Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
NewKeywordPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.keywordsearch;
20 
27 class NewKeywordPanel extends javax.swing.JPanel {
28 
32  public NewKeywordPanel() {
33  initComponents();
34  }
35 
39  String getKeywordText() {
40  return keywordTextField.getText();
41  }
42 
46  boolean isKeywordRegex() {
47  return regexButton.isSelected();
48  }
49 
53  boolean isKeywordExact() {
54  return exactButton.isSelected();
55  }
56 
62  @SuppressWarnings("unchecked")
63  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
64  private void initComponents() {
65 
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();
72 
73  keywordTextField.setText(org.openide.util.NbBundle.getMessage(NewKeywordPanel.class, "NewKeywordPanel.keywordTextField.text")); // NOI18N
74  keywordTextField.addAncestorListener(new javax.swing.event.AncestorListener() {
75  public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
76  }
77  public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
78  keywordTextFieldAncestorAdded(evt);
79  }
80  public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
81  }
82  });
83 
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")); // NOI18N
87 
88  keywordTypeButtonGroup.add(substringButton);
89  org.openide.awt.Mnemonics.setLocalizedText(substringButton, org.openide.util.NbBundle.getMessage(NewKeywordPanel.class, "NewKeywordPanel.substringButton.text")); // NOI18N
90 
91  keywordTypeButtonGroup.add(regexButton);
92  org.openide.awt.Mnemonics.setLocalizedText(regexButton, org.openide.util.NbBundle.getMessage(NewKeywordPanel.class, "NewKeywordPanel.regexButton.text")); // NOI18N
93 
94  org.openide.awt.Mnemonics.setLocalizedText(newKeywordLabel, org.openide.util.NbBundle.getMessage(NewKeywordPanel.class, "NewKeywordPanel.newKeywordLabel.text")); // NOI18N
95 
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()
101  .addContainerGap()
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))
112  );
113  layout.setVerticalGroup(
114  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115  .addGroup(layout.createSequentialGroup()
116  .addContainerGap()
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))
126  );
127  }// </editor-fold>//GEN-END:initComponents
128 
129  private void keywordTextFieldAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_keywordTextFieldAncestorAdded
130  evt.getComponent().requestFocusInWindow();
131  }//GEN-LAST:event_keywordTextFieldAncestorAdded
132 
133 
134  // Variables declaration - do not modify//GEN-BEGIN:variables
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;
141  // End of variables declaration//GEN-END:variables
142 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon Apr 24 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.