mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
5657 initial change of FileDiscoveryDialog to top component
This commit is contained in:
parent
f46229f4db
commit
f8c82a6170
@ -1,5 +1,6 @@
|
|||||||
CTL_FileDiscoveryTestAction=Test file discovery
|
CTL_FileDiscoveryTestAction=Test file discovery
|
||||||
CTL_FileSearchTestAction=Test file search
|
CTL_FileSearchTestAction=Test file search
|
||||||
|
DiscoveryTopComponent.name=\ File Discovery
|
||||||
# {0} - Data source name
|
# {0} - Data source name
|
||||||
# {1} - Data source ID
|
# {1} - Data source ID
|
||||||
FileSearch.DataSourceGroupKey.datasourceAndID={0}(ID: {1})
|
FileSearch.DataSourceGroupKey.datasourceAndID={0}(ID: {1})
|
||||||
|
@ -1,16 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[1100, 700]"/>
|
<Dimension value="[1100, 700]"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
|
||||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
|
||||||
</SyntheticProperties>
|
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
@ -18,16 +18,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.filequery;
|
package org.sleuthkit.autopsy.filequery;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import java.awt.KeyboardFocusManager;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
import org.openide.explorer.ExplorerManager;
|
import org.openide.explorer.ExplorerManager;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.windows.RetainLocation;
|
||||||
|
import org.openide.windows.TopComponent;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataContentPanel;
|
import org.sleuthkit.autopsy.corecomponents.DataContentPanel;
|
||||||
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
@ -35,7 +39,11 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
/**
|
/**
|
||||||
* Create a dialog for displaying the file discovery tool
|
* Create a dialog for displaying the file discovery tool
|
||||||
*/
|
*/
|
||||||
class FileDiscoveryDialog extends javax.swing.JDialog {
|
@TopComponent.Description(preferredID = "DiscoveryTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER)
|
||||||
|
@TopComponent.Registration(mode = "discovery", openAtStartup = false)
|
||||||
|
@RetainLocation("discovery")
|
||||||
|
@NbBundle.Messages("DiscoveryTopComponent.name= File Discovery")
|
||||||
|
public final class DiscoveryTopComponent extends TopComponent {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final FileSearchPanel fileSearchPanel;
|
private final FileSearchPanel fileSearchPanel;
|
||||||
@ -47,9 +55,10 @@ class FileDiscoveryDialog extends javax.swing.JDialog {
|
|||||||
/**
|
/**
|
||||||
* Creates new form FileDiscoveryDialog
|
* Creates new form FileDiscoveryDialog
|
||||||
*/
|
*/
|
||||||
FileDiscoveryDialog(java.awt.Frame parent, boolean modal, SleuthkitCase caseDb, EamDb centralRepoDb) {
|
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
||||||
super((JFrame) WindowManager.getDefault().getMainWindow(), Bundle.FileSearchPanel_dialogTitle_text(), modal);
|
public DiscoveryTopComponent(SleuthkitCase caseDb, EamDb centralRepoDb) {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
setName(Bundle.DiscoveryTopComponent_name());
|
||||||
explorerManager = new ExplorerManager();
|
explorerManager = new ExplorerManager();
|
||||||
fileSearchPanel = new FileSearchPanel(caseDb, centralRepoDb);
|
fileSearchPanel = new FileSearchPanel(caseDb, centralRepoDb);
|
||||||
dataContentPanel = DataContentPanel.createInstance();
|
dataContentPanel = DataContentPanel.createInstance();
|
||||||
@ -100,21 +109,19 @@ class FileDiscoveryDialog extends javax.swing.JDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Show the dialog
|
public void componentOpened() {
|
||||||
*/
|
super.componentOpened();
|
||||||
void display() {
|
WindowManager.getDefault().setTopComponentFloating(this, true);
|
||||||
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
|
|
||||||
setVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
protected void componentClosed() {
|
||||||
fileSearchPanel.cancelSearch();
|
fileSearchPanel.cancelSearch();
|
||||||
FileSearch.clearCache();
|
FileSearch.clearCache();
|
||||||
DiscoveryEvents.getDiscoveryEventBus().unregister(groupListPanel);
|
DiscoveryEvents.getDiscoveryEventBus().unregister(groupListPanel);
|
||||||
DiscoveryEvents.getDiscoveryEventBus().unregister(resultsPanel);
|
DiscoveryEvents.getDiscoveryEventBus().unregister(resultsPanel);
|
||||||
super.dispose();
|
super.componentClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,8 +137,8 @@ class FileDiscoveryDialog extends javax.swing.JDialog {
|
|||||||
leftSplitPane = new javax.swing.JSplitPane();
|
leftSplitPane = new javax.swing.JSplitPane();
|
||||||
rightSplitPane = new javax.swing.JSplitPane();
|
rightSplitPane = new javax.swing.JSplitPane();
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
|
||||||
setPreferredSize(new java.awt.Dimension(1100, 700));
|
setPreferredSize(new java.awt.Dimension(1100, 700));
|
||||||
|
setLayout(new java.awt.BorderLayout());
|
||||||
|
|
||||||
mainSplitPane.setDividerLocation(550);
|
mainSplitPane.setDividerLocation(550);
|
||||||
mainSplitPane.setResizeWeight(0.2);
|
mainSplitPane.setResizeWeight(0.2);
|
||||||
@ -147,9 +154,7 @@ class FileDiscoveryDialog extends javax.swing.JDialog {
|
|||||||
rightSplitPane.setResizeWeight(0.5);
|
rightSplitPane.setResizeWeight(0.5);
|
||||||
mainSplitPane.setRightComponent(rightSplitPane);
|
mainSplitPane.setRightComponent(rightSplitPane);
|
||||||
|
|
||||||
getContentPane().add(mainSplitPane, java.awt.BorderLayout.CENTER);
|
add(mainSplitPane, java.awt.BorderLayout.CENTER);
|
||||||
|
|
||||||
pack();
|
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
@ -65,9 +65,9 @@ public final class FileDiscoveryTestAction extends CallableSystemAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//modal set to true currently to prevent multiple dialogs being opened because messaging uses a shared eventbus
|
//modal set to true currently to prevent multiple dialogs being opened because messaging uses a shared eventbus
|
||||||
FileDiscoveryDialog dialog = new FileDiscoveryDialog(WindowManager.getDefault().getMainWindow(), true, Case.getCurrentCase().getSleuthkitCase(), crDb);
|
DiscoveryTopComponent discoveryTc = new DiscoveryTopComponent(Case.getCurrentCase().getSleuthkitCase(), crDb);
|
||||||
// Display the dialog
|
// Display the dialog
|
||||||
dialog.display();
|
discoveryTc.open();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user