19 package org.sleuthkit.autopsy.modules.fileextmismatch;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.HashMap;
24 import java.util.HashSet;
26 import java.util.logging.Level;
27 import javax.swing.JOptionPane;
28 import javax.swing.ListSelectionModel;
29 import javax.swing.event.ListSelectionEvent;
30 import javax.swing.event.ListSelectionListener;
31 import javax.swing.table.AbstractTableModel;
32 import org.netbeans.spi.options.OptionsPanelController;
33 import org.openide.util.NbBundle;
43 @SuppressWarnings(
"PMD.SingularField")
44 final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
46 private static final Logger logger = Logger.getLogger(FileExtMismatchSettingsPanel.class.getName());
47 private HashMap<String, Set<String>> editableMap =
new HashMap<>();
48 private ArrayList<String> mimeList = null;
49 private ArrayList<String> currentExtensions = null;
50 private MimeTableModel mimeTableModel;
51 private ExtTableModel extTableModel;
52 private final String EXT_HEADER_LABEL = NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
53 "AddFileExtensionAction.extHeaderLbl.text");
54 private String selectedMime =
"";
55 private String selectedExt =
"";
56 ListSelectionModel lsm = null;
57 private FileTypeDetector fileTypeDetector;
59 public FileExtMismatchSettingsPanel() {
60 mimeTableModel =
new MimeTableModel();
61 extTableModel =
new ExtTableModel();
64 fileTypeDetector =
new FileTypeDetector();
65 }
catch (FileTypeDetector.FileTypeDetectorInitException ex) {
66 logger.log(Level.SEVERE,
"Failed to create file type detector", ex);
67 fileTypeDetector = null;
71 customizeComponents();
74 @NbBundle.Messages({
"FileExtMismatchSettingsPanel.Title=Global File Extension Mismatch Identification Settings"})
75 private void customizeComponents() {
76 setName(Bundle.FileExtMismatchSettingsPanel_Title());
79 lsm = mimeTable.getSelectionModel();
80 lsm.addListSelectionListener(
new ListSelectionListener() {
82 public void valueChanged(ListSelectionEvent e) {
83 ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource();
84 if (!listSelectionModel.isSelectionEmpty()) {
85 int index = listSelectionModel.getMinSelectionIndex();
86 listSelectionModel.setSelectionInterval(index, index);
88 selectedMime = mimeList.get(index);
89 String labelStr = EXT_HEADER_LABEL + selectedMime +
":";
90 if (labelStr.length() > 80) {
91 labelStr = labelStr.substring(0, 80);
93 extHeaderLabel.setText(labelStr);
96 extTableModel.resync();
97 removeTypeButton.setEnabled(
true);
98 newExtButton.setEnabled(
true);
102 currentExtensions = null;
103 removeTypeButton.setEnabled(
false);
104 newExtButton.setEnabled(
false);
105 extTableModel.resync();
111 ListSelectionModel extLsm = extTable.getSelectionModel();
112 extLsm.addListSelectionListener(
new ListSelectionListener() {
114 public void valueChanged(ListSelectionEvent e) {
115 ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource();
116 if (!listSelectionModel.isSelectionEmpty()) {
117 int index = listSelectionModel.getMinSelectionIndex();
118 listSelectionModel.setSelectionInterval(index, index);
120 selectedExt = currentExtensions.get(index);
121 removeExtButton.setEnabled(
true);
124 removeExtButton.setEnabled(
false);
129 removeExtButton.setEnabled(
false);
130 removeTypeButton.setEnabled(
false);
131 newExtButton.setEnabled(
false);
140 private void initComponents() {
142 jPanel1 =
new javax.swing.JPanel();
143 jScrollPane1 =
new javax.swing.JScrollPane();
144 jSplitPane1 =
new javax.swing.JSplitPane();
145 mimePanel =
new javax.swing.JPanel();
146 jLabel1 =
new javax.swing.JLabel();
147 jScrollPane2 =
new javax.swing.JScrollPane();
148 mimeTable =
new javax.swing.JTable();
149 newTypeButton =
new javax.swing.JButton();
150 removeTypeButton =
new javax.swing.JButton();
151 extensionPanel =
new javax.swing.JPanel();
152 newExtButton =
new javax.swing.JButton();
153 jScrollPane3 =
new javax.swing.JScrollPane();
154 extTable =
new javax.swing.JTable();
155 removeExtButton =
new javax.swing.JButton();
156 extHeaderLabel =
new javax.swing.JLabel();
158 setPreferredSize(
new java.awt.Dimension(718, 430));
160 jPanel1.setPreferredSize(
new java.awt.Dimension(718, 430));
162 jScrollPane1.setRequestFocusEnabled(
false);
164 jSplitPane1.setDividerLocation(365);
165 jSplitPane1.setDividerSize(1);
167 mimePanel.setPreferredSize(
new java.awt.Dimension(369, 424));
168 mimePanel.setRequestFocusEnabled(
false);
170 jLabel1.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.jLabel1.text"));
172 mimeTable.setModel(mimeTableModel);
173 jScrollPane2.setViewportView(mimeTable);
175 newTypeButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
176 newTypeButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newTypeButton.text"));
177 newTypeButton.setMaximumSize(
new java.awt.Dimension(111, 25));
178 newTypeButton.setMinimumSize(
new java.awt.Dimension(111, 25));
179 newTypeButton.addActionListener(
new java.awt.event.ActionListener() {
180 public void actionPerformed(java.awt.event.ActionEvent evt) {
181 newTypeButtonActionPerformed(evt);
185 removeTypeButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
186 removeTypeButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeTypeButton.text"));
187 removeTypeButton.setToolTipText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeTypeButton.toolTipText"));
188 removeTypeButton.addActionListener(
new java.awt.event.ActionListener() {
189 public void actionPerformed(java.awt.event.ActionEvent evt) {
190 removeTypeButtonActionPerformed(evt);
194 javax.swing.GroupLayout mimePanelLayout =
new javax.swing.GroupLayout(mimePanel);
195 mimePanel.setLayout(mimePanelLayout);
196 mimePanelLayout.setHorizontalGroup(
197 mimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
198 .addGroup(mimePanelLayout.createSequentialGroup()
200 .addGroup(mimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
201 .addGroup(mimePanelLayout.createSequentialGroup()
202 .addGap(0, 0, Short.MAX_VALUE)
203 .addComponent(jLabel1)
204 .addGap(286, 286, 286))
205 .addGroup(mimePanelLayout.createSequentialGroup()
206 .addGroup(mimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
207 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE)
208 .addGroup(mimePanelLayout.createSequentialGroup()
209 .addComponent(newTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
211 .addComponent(removeTypeButton)))
212 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
214 mimePanelLayout.setVerticalGroup(
215 mimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
216 .addGroup(mimePanelLayout.createSequentialGroup()
218 .addComponent(jLabel1)
219 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
220 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
221 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
222 .addGroup(mimePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
223 .addComponent(newTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
224 .addComponent(removeTypeButton))
228 jSplitPane1.setLeftComponent(mimePanel);
230 extensionPanel.setPreferredSize(
new java.awt.Dimension(344, 424));
232 newExtButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/add16.png")));
233 newExtButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtButton.text"));
234 newExtButton.setMaximumSize(
new java.awt.Dimension(111, 25));
235 newExtButton.setMinimumSize(
new java.awt.Dimension(111, 25));
236 newExtButton.addActionListener(
new java.awt.event.ActionListener() {
237 public void actionPerformed(java.awt.event.ActionEvent evt) {
238 newExtButtonActionPerformed(evt);
242 extTable.setModel(extTableModel);
243 jScrollPane3.setViewportView(extTable);
245 removeExtButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/delete16.png")));
246 removeExtButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeExtButton.text"));
247 removeExtButton.addActionListener(
new java.awt.event.ActionListener() {
248 public void actionPerformed(java.awt.event.ActionEvent evt) {
249 removeExtButtonActionPerformed(evt);
253 extHeaderLabel.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.extHeaderLabel.text"));
255 javax.swing.GroupLayout extensionPanelLayout =
new javax.swing.GroupLayout(extensionPanel);
256 extensionPanel.setLayout(extensionPanelLayout);
257 extensionPanelLayout.setHorizontalGroup(
258 extensionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
259 .addGroup(extensionPanelLayout.createSequentialGroup()
261 .addGroup(extensionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
262 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
263 .addGroup(extensionPanelLayout.createSequentialGroup()
264 .addGroup(extensionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
265 .addComponent(extHeaderLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
266 .addGroup(extensionPanelLayout.createSequentialGroup()
267 .addComponent(newExtButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
268 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
269 .addComponent(removeExtButton)))
270 .addGap(0, 0, Short.MAX_VALUE)))
273 extensionPanelLayout.setVerticalGroup(
274 extensionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
275 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, extensionPanelLayout.createSequentialGroup()
277 .addComponent(extHeaderLabel)
278 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
279 .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE)
280 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
281 .addGroup(extensionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
282 .addComponent(newExtButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
283 .addComponent(removeExtButton))
287 jSplitPane1.setRightComponent(extensionPanel);
289 jScrollPane1.setViewportView(jSplitPane1);
291 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
292 jPanel1.setLayout(jPanel1Layout);
293 jPanel1Layout.setHorizontalGroup(
294 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
295 .addGroup(jPanel1Layout.createSequentialGroup()
297 .addComponent(jScrollPane1)
300 jPanel1Layout.setVerticalGroup(
301 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
302 .addGroup(jPanel1Layout.createSequentialGroup()
304 .addComponent(jScrollPane1)
308 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
309 this.setLayout(layout);
310 layout.setHorizontalGroup(
311 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
312 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
314 layout.setVerticalGroup(
315 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
316 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
321 private void newExtButtonActionPerformed(java.awt.event.ActionEvent evt) {
322 String newExt = (String) JOptionPane.showInputDialog(
this, NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.message"),
323 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.title"), JOptionPane.PLAIN_MESSAGE, null, null,
"");
325 if (newExt == null) {
328 if (newExt.isEmpty()) {
329 JOptionPane.showMessageDialog(
this,
330 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.empty.message"),
331 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.empty.title"),
332 JOptionPane.ERROR_MESSAGE);
335 if (selectedMime.isEmpty()) {
336 JOptionPane.showMessageDialog(
this,
337 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.noMimeType.message"),
338 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.noMimeType.title"),
339 JOptionPane.ERROR_MESSAGE);
342 if (currentExtensions.contains(newExt)) {
343 JOptionPane.showMessageDialog(
this,
344 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.extExists.message"),
345 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newExtPrompt.extExists.title"),
346 JOptionPane.ERROR_MESSAGE);
350 Set<String> editedExtensions = editableMap.get(selectedMime);
351 editedExtensions.add(newExt);
354 editableMap.put(selectedMime, editedExtensions);
358 extTableModel.resync();
359 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
362 private void removeExtButtonActionPerformed(java.awt.event.ActionEvent evt) {
363 if (selectedExt.isEmpty()) {
364 JOptionPane.showMessageDialog(
this,
365 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeExtButton.noneSelected.message"),
366 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeExtButton.noneSelected.title"),
367 JOptionPane.ERROR_MESSAGE);
371 if (selectedMime.isEmpty()) {
372 JOptionPane.showMessageDialog(
this,
373 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeExtButton.noMimeTypeSelected.message"),
374 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeExtButton.noMimeTypeSelected.title"),
375 JOptionPane.ERROR_MESSAGE);
379 Set<String> editedExtensions = editableMap.get(selectedMime);
380 editedExtensions.remove(selectedExt);
381 String deadExt = selectedExt;
384 editableMap.put(selectedMime, editedExtensions);
388 extTableModel.resync();
389 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
392 private void removeTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {
393 if (selectedMime.isEmpty()) {
394 JOptionPane.showMessageDialog(
this,
395 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeTypeButton.noneSelected.message"),
396 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.removeTypeButton.noneSelected.title"),
397 JOptionPane.ERROR_MESSAGE);
401 editableMap.remove(selectedMime);
405 mimeTableModel.resync();
406 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
409 private void newTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {
410 String newMime = (String) JOptionPane.showInputDialog(
this, NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.message"),
411 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.title"), JOptionPane.PLAIN_MESSAGE, null, null,
"");
413 if (newMime == null) {
416 if (newMime.isEmpty()) {
417 JOptionPane.showMessageDialog(
this,
418 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.emptyMime.message"),
419 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.emptyMime.title"),
420 JOptionPane.ERROR_MESSAGE);
423 if (newMime.equals(
"application/octet-stream")) {
424 JOptionPane.showMessageDialog(
this,
425 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotSupported.message"),
426 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotSupported.title"),
427 JOptionPane.ERROR_MESSAGE);
430 if (mimeList.contains(newMime)) {
431 JOptionPane.showMessageDialog(
this,
432 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeExists.message"),
433 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeExists.title"),
434 JOptionPane.ERROR_MESSAGE);
438 FileTypeDetector detector;
440 detector =
new FileTypeDetector();
441 }
catch (FileTypeDetector.FileTypeDetectorInitException ex) {
442 logger.log(Level.WARNING,
"Couldn't create file type detector for file ext mismatch settings.", ex);
445 boolean mimeTypeDetectable = (null != detector) ? detector.isDetectable(newMime) :
false;
446 if (!mimeTypeDetectable) {
447 JOptionPane.showMessageDialog(
this,
448 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotDetectable.message"),
449 NbBundle.getMessage(FileExtMismatchSettingsPanel.class,
"FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotDetectable.title"),
450 JOptionPane.ERROR_MESSAGE);
454 editableMap.put(newMime,
new HashSet<String>());
458 mimeTableModel.resync();
459 firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
462 private void updateMimeList() {
463 mimeList =
new ArrayList<>(editableMap.keySet());
464 if (mimeList.size() > 0) {
465 Collections.sort(mimeList);
469 private void updateExtList() {
470 Set<String> temp = editableMap.get(selectedMime);
472 currentExtensions =
new ArrayList<>(temp);
473 if (temp.size() > 0) {
474 Collections.sort(currentExtensions);
477 currentExtensions = null;
482 public void saveSettings() {
484 FileExtMismatchSettings.writeSettings(
new FileExtMismatchSettings(editableMap));
485 }
catch (FileExtMismatchSettings.FileExtMismatchSettingsException ex) {
487 JOptionPane.showMessageDialog(
this,
488 NbBundle.getMessage(
this.getClass(),
489 "FileExtMismatchConfigPanel.store.msgDlg.msg"),
490 NbBundle.getMessage(
this.getClass(),
491 "FileExtMismatchConfigPanel.save.msgDlg.title"),
492 JOptionPane.ERROR_MESSAGE);
501 editableMap = FileExtMismatchSettings.readSettings().getMimeTypeToExtsMap();
503 }
catch (FileExtMismatchSettings.FileExtMismatchSettingsException ex) {
505 JOptionPane.showMessageDialog(
this,
506 NbBundle.getMessage(
this.getClass(),
507 "AddFileExtensionAction.msgDlg.msg2"),
508 NbBundle.getMessage(
this.getClass(),
509 "FileExtMismatchConfigPanel.save.msgDlg.title"),
510 JOptionPane.ERROR_MESSAGE);
517 public void store() {
521 public void cancel() {
534 private javax.swing.JLabel extHeaderLabel;
535 private javax.swing.JTable extTable;
536 private javax.swing.JPanel extensionPanel;
537 private javax.swing.JLabel jLabel1;
538 private javax.swing.JPanel jPanel1;
539 private javax.swing.JScrollPane jScrollPane1;
540 private javax.swing.JScrollPane jScrollPane2;
541 private javax.swing.JScrollPane jScrollPane3;
542 private javax.swing.JSplitPane jSplitPane1;
543 private javax.swing.JPanel mimePanel;
544 private javax.swing.JTable mimeTable;
545 private javax.swing.JButton newExtButton;
546 private javax.swing.JButton newTypeButton;
547 private javax.swing.JButton removeExtButton;
548 private javax.swing.JButton removeTypeButton;
560 return editableMap == null ? 0 : editableMap.size();
565 String colName = null;
572 if ((mimeList == null) || (rowIndex > mimeList.size())) {
575 String word = mimeList.get(rowIndex);
576 switch (columnIndex) {
581 logger.log(Level.SEVERE,
"Invalid table column index: {0}", columnIndex);
593 public void setValueAt(Object aValue,
int rowIndex,
int columnIndex) {
598 return getValueAt(0, c).getClass();
602 fireTableDataChanged();
615 return currentExtensions == null ? 0 : currentExtensions.size();
620 String colName = null;
628 if ((currentExtensions == null) || (currentExtensions.isEmpty()) || (rowIndex > currentExtensions.size())) {
631 String word = currentExtensions.get(rowIndex);
632 switch (columnIndex) {
637 logger.log(Level.SEVERE,
"Invalid table column index: {0}", columnIndex);
649 public void setValueAt(Object aValue,
int rowIndex,
int columnIndex) {
654 return getValueAt(0, c).getClass();
658 fireTableDataChanged();
String getColumnName(int column)
boolean isCellEditable(int rowIndex, int columnIndex)
Class<?> getColumnClass(int c)
void setValueAt(Object aValue, int rowIndex, int columnIndex)
Class<?> getColumnClass(int c)
void setValueAt(Object aValue, int rowIndex, int columnIndex)
boolean isCellEditable(int rowIndex, int columnIndex)
Object getValueAt(int rowIndex, int columnIndex)
Object getValueAt(int rowIndex, int columnIndex)
String getColumnName(int column)