diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetAllFilesContentVisitor.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetAllFilesContentVisitor.java deleted file mode 100755 index c13a291c83..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetAllFilesContentVisitor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.datamodel.File; -import org.sleuthkit.datamodel.FileSystem; -import org.sleuthkit.datamodel.FsContent; -import org.sleuthkit.datamodel.SleuthkitCase; -import org.sleuthkit.datamodel.TskData; -import org.sleuthkit.datamodel.TskData.FileKnown; - -/** - * Visitor for getting all the files to try to index from any Content object. - * Currently gets all non-zero files. - * TODO should be moved to utility module (needs resolve cyclic deps) - */ -class GetAllFilesContentVisitor extends GetFilesContentVisitor { - - private static final Logger logger = Logger.getLogger(GetAllFilesContentVisitor.class.getName()); - - @Override - public Collection visit(File file) { - return Collections.singleton((FsContent) file); - } - - @Override - public Collection visit(FileSystem fs) { - // Files in the database have a filesystem field, so it's quick to - // get all the matching files for an entire filesystem with a query - - SleuthkitCase sc = Case.getCurrentCase().getSleuthkitCase(); - - String query = "SELECT * FROM tsk_files WHERE fs_obj_id = " + fs.getId() - + " AND (meta_type = " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getMetaType() - + ") AND (known != " + FileKnown.KNOWN.toLong() + ") AND (size > 0)"; - try { - ResultSet rs = sc.runQuery(query); - List contents = sc.resultSetToFsContents(rs); - Statement s = rs.getStatement(); - rs.close(); - if (s != null) { - s.close(); - } - return contents; - } catch (SQLException ex) { - logger.log(Level.WARNING, "Couldn't get all files in FileSystem", ex); - return Collections.EMPTY_SET; - } - } -} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetFilesContentVisitor.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetFilesContentVisitor.java deleted file mode 100644 index 465a1319ba..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetFilesContentVisitor.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.sleuthkit.datamodel.Content; -import org.sleuthkit.datamodel.ContentVisitor; -import org.sleuthkit.datamodel.Directory; -import org.sleuthkit.datamodel.File; -import org.sleuthkit.datamodel.FileSystem; -import org.sleuthkit.datamodel.FsContent; -import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.TskException; -import org.sleuthkit.datamodel.Volume; -import org.sleuthkit.datamodel.VolumeSystem; - -/** - * Abstract visitor for getting all the files from content - * TODO should be moved to utility module (needs resolve cyclic deps) - */ -public abstract class GetFilesContentVisitor implements ContentVisitor> { - - private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName()); - - @Override - public abstract Collection visit(File file); - - @Override - public abstract Collection visit(FileSystem fs); - - @Override - public Collection visit(Directory drctr) { - return getAllFromChildren(drctr); - } - - @Override - public Collection visit(Image image) { - return getAllFromChildren(image); - } - - @Override - public Collection visit(Volume volume) { - return getAllFromChildren(volume); - } - - @Override - public Collection visit(VolumeSystem vs) { - return getAllFromChildren(vs); - } - - /** - * Aggregate all the matches from visiting the children Content objects of the - * one passed - * @param parent - * @return - */ - protected Collection getAllFromChildren(Content parent) { - Collection all = new ArrayList(); - - try { - for (Content child : parent.getChildren()) { - all.addAll(child.accept(this)); - } - } catch (TskException ex) { - logger.log(Level.SEVERE, "Error getting Content children", ex); - } - - return all; - } - - /** - * Get the part of a file name after (not including) the last '.' and - * coerced to lowercase. - * @param fileName - * @return the file extension, or an empty string if there is none - */ - protected static String getExtension(String fileName) { - int lastDot = fileName.lastIndexOf("."); - - if (lastDot >= 0) { - return fileName.substring(lastDot + 1, fileName.length()).toLowerCase(); - } else { - return ""; - } - } -} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetIngestableFilesContentVisitor.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetIngestableFilesContentVisitor.java deleted file mode 100755 index 30ac84c89f..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetIngestableFilesContentVisitor.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.datamodel.File; -import org.sleuthkit.datamodel.FileSystem; -import org.sleuthkit.datamodel.FsContent; -import org.sleuthkit.datamodel.SleuthkitCase; -import org.sleuthkit.datamodel.TskData.FileKnown; -import org.sleuthkit.datamodel.TskData; - -/** - * Visitor for getting all the files to try to index from any Content object. - * Currently gets all the non-zero sized files with a file extensions that match a list of - * document types that Tika/Solr-Cell supports. - */ -class GetIngestableFilesContentVisitor extends GetFilesContentVisitor { - - private static final Logger logger = Logger.getLogger(GetIngestableFilesContentVisitor.class.getName()); - - private static final String[] supportedExtensions = KeywordSearchIngestService.ingestibleExtensions; - // the full predicate of a SQLite statement to match supported extensions - private static final String extensionsLikePredicate; - - static { - // build the query fragment for matching file extensions - - StringBuilder likes = new StringBuilder("0"); - - for (String ext : supportedExtensions) { - likes.append(" OR (name LIKE '%."); - likes.append(ext); - likes.append("')"); - } - - extensionsLikePredicate = likes.toString(); - } - - @Override - public Collection visit(File file) { - String extension = getExtension(file.getName()); - if (Arrays.asList(supportedExtensions).contains(extension)) { - return Collections.singleton((FsContent) file); - } else { - return Collections.EMPTY_LIST; - } - } - - @Override - public Collection visit(FileSystem fs) { - // Files in the database have a filesystem field, so it's quick to - // get all the matching files for an entire filesystem with a query - - SleuthkitCase sc = Case.getCurrentCase().getSleuthkitCase(); - - String query = "SELECT * FROM tsk_files WHERE fs_obj_id = " + fs.getId() - + " AND (" + extensionsLikePredicate + ")" - + " AND (known != " + FileKnown.KNOWN.toLong() + ")" - + " AND (meta_type = " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getMetaType() + ")" - + " AND (size > 0)"; - try { - ResultSet rs = sc.runQuery(query); - List contents = sc.resultSetToFsContents(rs); - final Statement s = rs.getStatement(); - rs.close(); - if (s != null) { - s.close(); - } - return contents; - } catch (SQLException ex) { - logger.log(Level.WARNING, "Couldn't get all files in FileSystem", ex); - return Collections.EMPTY_SET; - } - } -} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexContentFilesAction.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexContentFilesAction.java deleted file mode 100755 index daab674705..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexContentFilesAction.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.JDialog; -import javax.swing.JFrame; -import javax.swing.JOptionPane; -import javax.swing.SwingWorker; -import org.apache.solr.client.solrj.SolrServerException; -import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.casemodule.AddImageAction; -import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; -import org.sleuthkit.datamodel.Content; -import org.sleuthkit.datamodel.FsContent; -import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.TskException; - -/** - * Action adds all supported files from the given Content object and its - * children to the Solr index. - */ -public class IndexContentFilesAction extends AbstractAction { - - private static final Logger logger = Logger.getLogger(IndexContentFilesAction.class.getName()); - private static final int MAX_STRING_EXTRACT_SIZE = 10 * (1 << 10) * (1 << 10); - private Content c; - private String name; - private Server.Core solrCore; - - public enum IngestStatus { - - NOT_INGESTED, INGESTED, EXTRACTED_INGESTED, SKIPPED_EXTRACTION,}; - //keep track of ingest status for various types of content - //could also be useful for reporting - private Map ingestStatus; - private int problemFilesCount; - - /** - * New action - * @param c source Content object to get files from - * @param name name to refer to the source by when displaying progress - */ - public IndexContentFilesAction(Content c, String name) { - this(c, name, KeywordSearch.getServer().getCore()); - } - - IndexContentFilesAction(Content c, String name, Server.Core solrCore) { - super("Index files..."); - this.c = c; - this.name = name; - this.solrCore = solrCore; - ingestStatus = new HashMap(); - } - - @Override - public void actionPerformed(ActionEvent e) { - - // create the popUp window to display progress - String title = "Indexing files in " + name; - - final JFrame frame = new JFrame(title); - final JDialog popUpWindow = new JDialog(frame, title, true); // to make the popUp Window modal - - // initialize panel - final IndexProgressPanel panel = new IndexProgressPanel(); - - final SwingWorker task = new SwingWorker() { - - @Override - protected Integer doInBackground() throws Exception { - Ingester ingester = solrCore.getIngester(); - - this.publish("Categorizing files to index. "); - - GetFilesContentVisitor ingestableV = new GetIngestableFilesContentVisitor(); - GetFilesContentVisitor allV = new GetAllFilesContentVisitor(); - - Collection ingestableFiles = c.accept(ingestableV); - Collection allFiles = c.accept(allV); - - //calculate non ingestable Collection (complement of allFiles / ingestableFiles - //TODO implement a facility that selects different categories of FsContent - Collection nonIngestibleFiles = new LinkedHashSet(); - - for (FsContent fs : allFiles) { - if (! ingestableFiles.contains(fs) ) { - nonIngestibleFiles.add(fs); - } - } - - // track number complete or with errors - problemFilesCount = 0; - ingestStatus.clear(); - - //work on known files first - Collection ingestFailedFiles = processIngestible(ingester, ingestableFiles); - nonIngestibleFiles.addAll(ingestFailedFiles); - - //work on unknown files - //TODO should be an option somewhere in GUI (known vs unknown files) - processNonIngestible(ingester, nonIngestibleFiles); - - ingester.commit(); - - //signal a potential change in number of indexed files - try { - final int numIndexedFiles = KeywordSearch.getServer().getCore().queryNumIndexedFiles(); - KeywordSearch.changeSupport.firePropertyChange(KeywordSearch.NUM_FILES_CHANGE_EVT, null, new Integer(numIndexedFiles)); - } catch (SolrServerException se) { - logger.log(Level.SEVERE, "Error executing Solr query to check number of indexed files: ", se); - } - - return problemFilesCount; - } - - private Collection processIngestible(Ingester ingester, Collection fscc) { - Collection ingestFailedCol = new ArrayList(); - - setProgress(0); - int finishedFiles = 0; - final int totalFilesCount = fscc.size(); - for (FsContent f : fscc) { - if (isCancelled()) { - return ingestFailedCol; - } - this.publish("Indexing " + (finishedFiles + 1) + "/" + totalFilesCount + ": " + f.getName()); - try { - ingester.ingest(f); - ingestStatus.put(f.getId(), IngestStatus.INGESTED); - } catch (IngesterException ex) { - ingestFailedCol.add(f); - ingestStatus.put(f.getId(), IngestStatus.NOT_INGESTED); - logger.log(Level.INFO, "Ingester failed with file '" + f.getName() + "' (id: " + f.getId() + ").", ex); - } - setProgress(++finishedFiles * 100 / totalFilesCount); - } - return ingestFailedCol; - } - - private void processNonIngestible(Ingester ingester, Collection fscc) { - setProgress(0); - int finishedFiles = 0; - final int totalFilesCount = fscc.size(); - - for (FsContent f : fscc) { - if (isCancelled()) { - return; - } - this.publish("String extracting/Indexing " + (finishedFiles + 1) + "/" + totalFilesCount + ": " + f.getName()); - - if (f.getSize() < MAX_STRING_EXTRACT_SIZE) { - if (!extractAndIngest(ingester, f)) { - ingestStatus.put(f.getId(), IngestStatus.NOT_INGESTED); - problemFilesCount++; - logger.log(Level.INFO, "Failed to extract strings and ingest, file '" + f.getName() + "' (id: " + f.getId() + ")."); - } else { - ingestStatus.put(f.getId(), IngestStatus.EXTRACTED_INGESTED); - } - } else { - ingestStatus.put(f.getId(), IngestStatus.SKIPPED_EXTRACTION); - } - - setProgress(++finishedFiles * 100 / totalFilesCount); - } - } - - @Override - protected void done() { - int problemFiles = 0; - - try { - if (!this.isCancelled()) { - problemFiles = get(); - } - - } catch (InterruptedException ex) { - // shouldn't be interrupted except by cancel - throw new RuntimeException(ex); - } catch (ExecutionException ex) { - logger.log(Level.SEVERE, "Fatal error during ingest.", ex); - } finally { - popUpWindow.setVisible(false); - popUpWindow.dispose(); - - // notify user if there were problem files - if (problemFiles > 0) { - displayProblemFilesDialog(problemFiles); - } - } - } - - @Override - protected void process(List messages) { - - // display the latest message - if (!messages.isEmpty()) { - panel.setStatusText(messages.get(messages.size() - 1)); - } - - panel.setProgressBar(getProgress()); - } - }; - - panel.addCancelButtonActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - task.cancel(true); - } - }); - - popUpWindow.add(panel); - popUpWindow.pack(); - popUpWindow.setResizable(false); - - // set the location of the popUp Window on the center of the screen - Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); - double w = popUpWindow.getSize().getWidth(); - double h = popUpWindow.getSize().getHeight(); - popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); - - popUpWindow.addWindowListener(new WindowAdapter() { - - @Override - public void windowClosing(WindowEvent e) { - // deal with being Xed out of - if (!task.isDone()) { - task.cancel(true); - } - } - }); - - - task.execute(); - // display the window - popUpWindow.setVisible(true); - } - - private boolean extractAndIngest(Ingester ingester, FsContent f) { - boolean success = false; - FsContentStringStream fscs = new FsContentStringStream(f, FsContentStringStream.Encoding.ASCII); - try { - fscs.convert(); - ingester.ingest(fscs); - success = true; - } catch (TskException tskEx) { - logger.log(Level.INFO, "Problem extracting string from file: '" + f.getName() + "' (id: " + f.getId() + ").", tskEx); - } catch (IngesterException ingEx) { - logger.log(Level.INFO, "Ingester had a problem with extracted strings from file '" + f.getName() + "' (id: " + f.getId() + ").", ingEx); - } - return success; - } - - private void displayProblemFilesDialog(int problemFiles) { - final Component parentComponent = null; // Use default window frame. - final String message = "Had trouble indexing " + problemFiles + " of the files. See the log for details."; - final String title = "Problem indexing some files"; - final int messageType = JOptionPane.WARNING_MESSAGE; - JOptionPane.showMessageDialog( - parentComponent, - message, - title, - messageType); - } - - @ServiceProvider(service = AddImageAction.IndexImageTask.class) - public static class IndexImageTask implements AddImageAction.IndexImageTask { - - @Override - public void runTask(Image newImage) { - (new IndexContentFilesAction(newImage, "new image")).actionPerformed(null); - } - } -} \ No newline at end of file diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.form deleted file mode 100644 index bed4cafbe3..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.form +++ /dev/null @@ -1,62 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.java deleted file mode 100644 index 6150d17d3d..0000000000 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexProgressPanel.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.awt.event.ActionListener; - -/** - * Displays progress as files are indexed - */ -class IndexProgressPanel extends javax.swing.JPanel { - - /** Creates new form IndexProgressPanel */ - IndexProgressPanel() { - initComponents(); - progressBar.setMinimum(0); - progressBar.setMaximum(100); - progressBar.setIndeterminate(true); - statusText.setText("Starting..."); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - progressBar = new javax.swing.JProgressBar(); - statusText = new javax.swing.JLabel(); - cancelButton = new javax.swing.JButton(); - - statusText.setText(org.openide.util.NbBundle.getMessage(IndexProgressPanel.class, "IndexProgressPanel.statusText.text")); // NOI18N - - cancelButton.setText(org.openide.util.NbBundle.getMessage(IndexProgressPanel.class, "IndexProgressPanel.cancelButton.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(statusText) - .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE) - .addComponent(cancelButton, javax.swing.GroupLayout.Alignment.TRAILING)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(statusText) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton cancelButton; - private javax.swing.JProgressBar progressBar; - private javax.swing.JLabel statusText; - // End of variables declaration//GEN-END:variables - - /** - * Sets a listener for the Cancel button - * @param e The action listener - */ - void addCancelButtonActionListener(ActionListener e) { - this.cancelButton.addActionListener(e); - } - - void setProgressBar(int percent) { - progressBar.setIndeterminate(false); - progressBar.setValue(percent); - } - - void setStatusText(String text) { - statusText.setText(text); - } -}