Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
GlobalEditListPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 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 
21 import java.awt.EventQueue;
22 import java.beans.PropertyChangeEvent;
23 import java.beans.PropertyChangeListener;
24 import java.util.Arrays;
25 import java.util.List;
26 import java.util.logging.Level;
27 import java.util.regex.Pattern;
28 import java.util.regex.PatternSyntaxException;
29 import javax.swing.JTable;
30 import javax.swing.ListSelectionModel;
31 import javax.swing.event.ListSelectionEvent;
32 import javax.swing.event.ListSelectionListener;
33 import javax.swing.table.AbstractTableModel;
34 import javax.swing.table.TableColumn;
35 import org.netbeans.spi.options.OptionsPanelController;
36 import org.openide.util.NbBundle;
40 
44 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
45 class GlobalEditListPanel extends javax.swing.JPanel implements ListSelectionListener, OptionsPanel {
46 
47  private static final Logger logger = Logger.getLogger(GlobalEditListPanel.class.getName());
48  private static final long serialVersionUID = 1L;
49  private final KeywordTableModel tableModel;
50  private KeywordList currentKeywordList;
51 
55  GlobalEditListPanel() {
56  tableModel = new KeywordTableModel();
57  initComponents();
58  customizeComponents();
59  }
60 
61  private void customizeComponents() {
62  newKeywordsButton.setToolTipText((NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.customizeComponents.addWordToolTip")));
63  deleteWordButton.setToolTipText(NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.customizeComponents.removeSelectedMsg"));
64 
65  keywordTable.getParent().setBackground(keywordTable.getBackground());
66  final int width = jScrollPane1.getPreferredSize().width;
67  keywordTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
68  TableColumn column;
69  for (int i = 0; i < keywordTable.getColumnCount(); i++) {
70  column = keywordTable.getColumnModel().getColumn(i);
71  if (i == 0) {
72  column.setPreferredWidth(((int) (width * 0.90)));
73  } else {
74  column.setPreferredWidth(((int) (width * 0.10)));
75  }
76  }
77  keywordTable.setCellSelectionEnabled(false);
78  keywordTable.setRowSelectionAllowed(true);
79 
80  final ListSelectionModel lsm = keywordTable.getSelectionModel();
81  lsm.addListSelectionListener(new ListSelectionListener() {
82  @Override
83  public void valueChanged(ListSelectionEvent e) {
84  boolean canDelete = !(lsm.isSelectionEmpty() || currentKeywordList.isEditable() || IngestManager.getInstance().isIngestRunning());
85  boolean canEdit = canDelete && (lsm.getMaxSelectionIndex() == lsm.getMinSelectionIndex()); //edit only enabled with single selection
86  deleteWordButton.setEnabled(canDelete);
87  editWordButton.setEnabled(canEdit);
88  }
89  });
90 
91  setButtonStates();
92 
93  IngestManager.getInstance().addIngestJobEventListener(new PropertyChangeListener() {
94  @Override
95  public void propertyChange(PropertyChangeEvent evt) {
96  Object source = evt.getSource();
97  if (source instanceof String && ((String) source).equals("LOCAL")) { //NON-NLS
98  EventQueue.invokeLater(() -> {
99  setButtonStates();
100  });
101  }
102  }
103  });
104  }
105 
109  void setButtonStates() {
110  boolean isIngestRunning = IngestManager.getInstance().isIngestRunning();
111  boolean isListSelected = currentKeywordList != null;
112 
113  // items that only need a selected list
114  boolean canEditList = isListSelected && !isIngestRunning;
115  ingestMessagesCheckbox.setEnabled(canEditList);
116  ingestMessagesCheckbox.setSelected(currentKeywordList != null && currentKeywordList.getIngestMessages());
117 
118  // items that need an unlocked list w/out ingest running
119  boolean canAddWord = canEditList && !currentKeywordList.isEditable();
120  newKeywordsButton.setEnabled(canAddWord);
121 
122  // items that need a non-empty list
123  if ((currentKeywordList == null) || (currentKeywordList.getKeywords().isEmpty())) {
124  deleteWordButton.setEnabled(false);
125  editWordButton.setEnabled(false);
126  }
127  }
128 
129  @NbBundle.Messages({"GlobalEditListPanel.editKeyword.title=Edit Keyword",
130  "GlobalEditListPanel.warning.title=Warning",
131  "GlobalEditListPanel.warning.text=Boundary characters ^ and $ do not match word boundaries. Consider\nreplacing with an explicit list of boundary characters, such as [ \\.,]"})
132 
139  private boolean addKeywordsAction(String existingKeywords, boolean isLiteral, boolean isWholeWord) {
140  String keywordsToRedisplay = existingKeywords;
141  AddKeywordsDialog dialog = new AddKeywordsDialog();
142 
143  int goodCount = 0;
144  int dupeCount = 0;
145  int badCount = 1; // Default to 1 so we enter the loop the first time
146 
147  if (!existingKeywords.isEmpty()) { //if there is an existing keyword then this action was called by the edit button
148  dialog.setTitle(NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.editKeyword.title"));
149  }
150  while (badCount > 0) {
151  dialog.setInitialKeywordList(keywordsToRedisplay, isLiteral, isWholeWord);
152  dialog.display();
153 
154  goodCount = 0;
155  dupeCount = 0;
156  badCount = 0;
157  keywordsToRedisplay = "";
158  boolean displayedBoundaryWarning = false;
159 
160  if (!dialog.getKeywords().isEmpty()) {
161 
162  for (String newWord : dialog.getKeywords()) {
163  if (newWord.isEmpty()) {
164  continue;
165  }
166 
167  final Keyword keyword = new Keyword(newWord, !dialog.isKeywordRegex(), dialog.isKeywordExact(), currentKeywordList.getName(), newWord);
168  if (currentKeywordList.hasKeyword(keyword)) {
169  dupeCount++;
170  continue;
171  }
172 
173  // Check if it is a regex and starts or ends with a boundary character
174  if (( ! displayedBoundaryWarning) && dialog.isKeywordRegex()) {
175  if(newWord.startsWith("^") ||
176  (newWord.endsWith("$") && ! newWord.endsWith("\\$"))) {
177 
178  KeywordSearchUtil.displayDialog(NbBundle.getMessage(this.getClass(), "GlobalEditListPanel.warning.title"),
179  NbBundle.getMessage(this.getClass(), "GlobalEditListPanel.warning.text"),
180  KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN);
181  // Only display the warning once
182  displayedBoundaryWarning = true;
183  }
184  }
185 
186  //check if valid
187  boolean valid = true;
188  try {
189  Pattern.compile(newWord);
190  } catch (PatternSyntaxException ex1) {
191  valid = false;
192  } catch (IllegalArgumentException ex2) {
193  valid = false;
194  }
195  if (!valid) {
196 
197  // Invalid keywords will reappear in the UI
198  keywordsToRedisplay += newWord + "\n";
199  badCount++;
200  continue;
201  }
202 
203  // Add the new keyword
204  tableModel.addKeyword(keyword);
205  goodCount++;
206  }
207  XmlKeywordSearchList.getCurrent().addList(currentKeywordList);
208  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
209 
210  if ((badCount > 0) || (dupeCount > 0)) {
211  // Display the error counts to the user
212  // The add keywords dialog will pop up again if any were invalid with any
213  // invalid entries (valid entries and dupes will disappear)
214 
215  String summary = "";
216  KeywordSearchUtil.DIALOG_MESSAGE_TYPE level = KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO;
217  if (goodCount > 0) {
218  if (goodCount > 1) {
219  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordsAddedPlural.text", goodCount) + "\n";
220  } else {
221  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordsAdded.text", goodCount) + "\n";
222  }
223  }
224  if (dupeCount > 0) {
225  if (dupeCount > 1) {
226  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordDupesSkippedPlural.text", dupeCount) + "\n";
227  } else {
228  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordDupesSkipped.text", dupeCount) + "\n";
229  }
230  level = KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN;
231  }
232  if (badCount > 0) {
233  if (badCount > 1) {
234  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordErrorsPlural.text", badCount) + "\n";
235  } else {
236  summary += NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.keywordErrors.text", badCount) + "\n";
237  }
238  level = KeywordSearchUtil.DIALOG_MESSAGE_TYPE.ERROR;
239  }
240  KeywordSearchUtil.displayDialog(NbBundle.getMessage(this.getClass(), "GlobalEditListPanel.addKeywordResults.text"),
241  summary, level);
242  }
243  }
244  }
245  setFocusOnKeywordTextBox();
246  setButtonStates();
247  return (goodCount >= 1 && dupeCount == 0);
248  }
249 
256  private void deleteKeywordAction(int[] selectedKeywords) {
257  tableModel.deleteSelected(selectedKeywords);
258  XmlKeywordSearchList.getCurrent().addList(currentKeywordList);
259  setButtonStates();
260  }
261 
267  @SuppressWarnings("unchecked")
268  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
269  private void initComponents() {
270 
271  listEditorPanel = new javax.swing.JPanel();
272  jScrollPane1 = new javax.swing.JScrollPane();
273  keywordTable = new javax.swing.JTable();
274  ingestMessagesCheckbox = new javax.swing.JCheckBox();
275  keywordsLabel = new javax.swing.JLabel();
276  newKeywordsButton = new javax.swing.JButton();
277  deleteWordButton = new javax.swing.JButton();
278  editWordButton = new javax.swing.JButton();
279 
280  setMinimumSize(new java.awt.Dimension(0, 0));
281 
282  listEditorPanel.setMinimumSize(new java.awt.Dimension(0, 0));
283 
284  jScrollPane1.setPreferredSize(new java.awt.Dimension(340, 300));
285 
286  keywordTable.setModel(tableModel);
287  keywordTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
288  keywordTable.setGridColor(new java.awt.Color(153, 153, 153));
289  keywordTable.setMaximumSize(new java.awt.Dimension(30000, 30000));
290  keywordTable.getTableHeader().setReorderingAllowed(false);
291  jScrollPane1.setViewportView(keywordTable);
292 
293  ingestMessagesCheckbox.setSelected(true);
294  ingestMessagesCheckbox.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.ingestMessagesCheckbox.text")); // NOI18N
295  ingestMessagesCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText")); // NOI18N
296  ingestMessagesCheckbox.addActionListener(new java.awt.event.ActionListener() {
297  public void actionPerformed(java.awt.event.ActionEvent evt) {
298  ingestMessagesCheckboxActionPerformed(evt);
299  }
300  });
301 
302  keywordsLabel.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.keywordsLabel.text")); // NOI18N
303 
304  newKeywordsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/add16.png"))); // NOI18N
305  newKeywordsButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.newKeywordsButton.text")); // NOI18N
306  newKeywordsButton.addActionListener(new java.awt.event.ActionListener() {
307  public void actionPerformed(java.awt.event.ActionEvent evt) {
308  newKeywordsButtonActionPerformed(evt);
309  }
310  });
311 
312  deleteWordButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/delete16.png"))); // NOI18N
313  deleteWordButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "KeywordSearchEditListPanel.deleteWordButton.text")); // NOI18N
314  deleteWordButton.addActionListener(new java.awt.event.ActionListener() {
315  public void actionPerformed(java.awt.event.ActionEvent evt) {
316  deleteWordButtonActionPerformed(evt);
317  }
318  });
319 
320  editWordButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/edit16.png"))); // NOI18N
321  editWordButton.setText(org.openide.util.NbBundle.getMessage(GlobalEditListPanel.class, "GlobalEditListPanel.editWordButton.text")); // NOI18N
322  editWordButton.addActionListener(new java.awt.event.ActionListener() {
323  public void actionPerformed(java.awt.event.ActionEvent evt) {
324  editWordButtonActionPerformed(evt);
325  }
326  });
327 
328  javax.swing.GroupLayout listEditorPanelLayout = new javax.swing.GroupLayout(listEditorPanel);
329  listEditorPanel.setLayout(listEditorPanelLayout);
330  listEditorPanelLayout.setHorizontalGroup(
331  listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
332  .addGroup(listEditorPanelLayout.createSequentialGroup()
333  .addContainerGap()
334  .addGroup(listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
335  .addGroup(listEditorPanelLayout.createSequentialGroup()
336  .addComponent(keywordsLabel)
337  .addGap(0, 0, Short.MAX_VALUE))
338  .addGroup(listEditorPanelLayout.createSequentialGroup()
339  .addGap(10, 10, 10)
340  .addGroup(listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
341  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
342  .addGroup(listEditorPanelLayout.createSequentialGroup()
343  .addGroup(listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
344  .addComponent(ingestMessagesCheckbox)
345  .addGroup(listEditorPanelLayout.createSequentialGroup()
346  .addComponent(newKeywordsButton)
347  .addGap(14, 14, 14)
348  .addComponent(editWordButton)
349  .addGap(14, 14, 14)
350  .addComponent(deleteWordButton)))
351  .addGap(0, 0, Short.MAX_VALUE)))))
352  .addContainerGap())
353  );
354 
355  listEditorPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteWordButton, editWordButton, newKeywordsButton});
356 
357  listEditorPanelLayout.setVerticalGroup(
358  listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
359  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, listEditorPanelLayout.createSequentialGroup()
360  .addContainerGap()
361  .addComponent(keywordsLabel)
362  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
363  .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
364  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
365  .addGroup(listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
366  .addComponent(deleteWordButton)
367  .addComponent(newKeywordsButton)
368  .addComponent(editWordButton))
369  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
370  .addComponent(ingestMessagesCheckbox)
371  .addGap(9, 9, 9))
372  );
373 
374  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
375  this.setLayout(layout);
376  layout.setHorizontalGroup(
377  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
378  .addComponent(listEditorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
379  );
380  layout.setVerticalGroup(
381  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
382  .addGroup(layout.createSequentialGroup()
383  .addComponent(listEditorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
384  .addGap(5, 5, 5))
385  );
386  }// </editor-fold>//GEN-END:initComponents
387 
388  private void deleteWordButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteWordButtonActionPerformed
389  if (KeywordSearchUtil.displayConfirmDialog(NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.removeKwMsg"),
390  NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.deleteWordButtonActionPerformed.delConfirmMsg"),
391  KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN)) {
392  deleteKeywordAction(keywordTable.getSelectedRows());
393  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
394  }
395  }//GEN-LAST:event_deleteWordButtonActionPerformed
396 
397  private void ingestMessagesCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ingestMessagesCheckboxActionPerformed
398  currentKeywordList.setIngestMessages(ingestMessagesCheckbox.isSelected());
399  XmlKeywordSearchList updater = XmlKeywordSearchList.getCurrent();
400  updater.addList(currentKeywordList);
401  firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
402  }//GEN-LAST:event_ingestMessagesCheckboxActionPerformed
403 
404  private void newKeywordsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newKeywordsButtonActionPerformed
405  addKeywordsAction("", true, true);
406  }//GEN-LAST:event_newKeywordsButtonActionPerformed
407 
408  private void editWordButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editWordButtonActionPerformed
409  int[] selectedKeywords = keywordTable.getSelectedRows();
410  if (selectedKeywords.length == 1) {
411  Keyword currentKeyword = currentKeywordList.getKeywords().get(selectedKeywords[0]);
412  if (addKeywordsAction(currentKeyword.getSearchTerm(), currentKeyword.searchTermIsLiteral(), currentKeyword.searchTermIsWholeWord())) {
413  deleteKeywordAction(selectedKeywords);
414  }
415  }
416  }//GEN-LAST:event_editWordButtonActionPerformed
417 
418  // Variables declaration - do not modify//GEN-BEGIN:variables
419  private javax.swing.JButton deleteWordButton;
420  private javax.swing.JButton editWordButton;
421  private javax.swing.JCheckBox ingestMessagesCheckbox;
422  private javax.swing.JScrollPane jScrollPane1;
423  private javax.swing.JTable keywordTable;
424  private javax.swing.JLabel keywordsLabel;
425  private javax.swing.JPanel listEditorPanel;
426  private javax.swing.JButton newKeywordsButton;
427  // End of variables declaration//GEN-END:variables
428 
429  @Override
430  public void valueChanged(ListSelectionEvent e) {
431  //respond to list selection changes in KeywordSearchListManagementPanel
432  ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource();
433  currentKeywordList = null;
434  if (!listSelectionModel.isSelectionEmpty()) {
435  XmlKeywordSearchList loader = XmlKeywordSearchList.getCurrent();
436  if (listSelectionModel.getMinSelectionIndex() == listSelectionModel.getMaxSelectionIndex()) {
437  currentKeywordList = loader.getListsL(false).get(listSelectionModel.getMinSelectionIndex());
438  }
439  }
440  tableModel.resync();
441  setButtonStates();
442  }
443 
444  @Override
445  public void store() {
446  // Implemented by parent panel
447  }
448 
449  @Override
450  public void load() {
451  // Implemented by parent panel
452  }
453 
454  KeywordList getCurrentKeywordList() {
455  return currentKeywordList;
456  }
457 
458  void setCurrentKeywordList(KeywordList list) {
459  currentKeywordList = list;
460  }
461 
462  private class KeywordTableModel extends AbstractTableModel {
463 
464  @Override
465  public int getColumnCount() {
466  return 2;
467  }
468 
469  @Override
470  public int getRowCount() {
471  return currentKeywordList == null ? 0 : currentKeywordList.getKeywords().size();
472  }
473 
474  @Override
475  public String getColumnName(int column) {
476  String colName = null;
477 
478  switch (column) {
479  case 0:
480  colName = NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.kwColName");
481  break;
482  case 1:
483  colName = NbBundle.getMessage(this.getClass(), "KeywordSearch.typeColLbl");
484  break;
485  default:
486  ;
487  }
488  return colName;
489  }
490 
491  @Override
492  public Object getValueAt(int rowIndex, int columnIndex) {
493  Object ret = null;
494  if (currentKeywordList == null) {
495  return "";
496  }
497  Keyword word = currentKeywordList.getKeywords().get(rowIndex);
498  switch (columnIndex) {
499  case 0:
500  ret = word.getSearchTerm();
501  break;
502  case 1:
503  ret = word.getSearchTermType();
504  break;
505  default:
506  logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); //NON-NLS
507  break;
508  }
509  return ret;
510  }
511 
512  @Override
513  public boolean isCellEditable(int rowIndex, int columnIndex) {
514  return false;
515  }
516 
517  @Override
518  public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
519  }
520 
521  @Override
522  public Class<?> getColumnClass(int c) {
523  return getValueAt(0, c).getClass();
524  }
525 
526  void addKeyword(Keyword keyword) {
527  if (!currentKeywordList.hasKeyword(keyword)) {
528  currentKeywordList.getKeywords().add(keyword);
529  }
530  fireTableDataChanged();
531  }
532 
533  void resync() {
534  fireTableDataChanged();
535  }
536 
537  //delete selected from handle, events are fired from the handle
538  void deleteSelected(int[] selected) {
539  List<Keyword> words = currentKeywordList.getKeywords();
540  Arrays.sort(selected);
541  for (int arrayi = selected.length - 1; arrayi >= 0; arrayi--) {
542  words.remove(selected[arrayi]);
543  }
544  resync();
545  }
546  }
547 
551  void setFocusOnKeywordTextBox() {
552  newKeywordsButton.requestFocus();
553  }
554 }

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