6773 adjust comments remove unnecessary code

This commit is contained in:
William Schaefer 2020-10-27 13:08:18 -04:00
parent 377eae9750
commit f6fa07b5d5
5 changed files with 12 additions and 13 deletions

View File

@ -92,6 +92,10 @@ class ArtifactsListPanel extends JPanel {
return tableModel.getRowCount() <= 0; return tableModel.getRowCount() <= 0;
} }
/**
* Select the first available artifact in the list if it is not empty to
* populate the panel to the right.
*/
void selectFirst() { void selectFirst() {
if (!isEmpty()) { if (!isEmpty()) {
jTable1.setRowSelectionInterval(0, 0); jTable1.setRowSelectionInterval(0, 0);

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy * Autopsy
* *
* Copyright 2019-2020 Basis Technology Corp. * Copyright 2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -50,7 +50,6 @@
</Properties> </Properties>
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new AnimatedSplitPane()"/> <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new AnimatedSplitPane()"/>
<AuxValue name="JavaCodeGenerator_LayoutCodePost" type="java.lang.String" value="setDetailsVisible(false);"/>
</AuxValues> </AuxValues>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">

View File

@ -149,7 +149,6 @@ public final class DiscoveryTopComponent extends TopComponent {
DiscoveryEventUtils.getDiscoveryEventBus().unregister(groupListPanel); DiscoveryEventUtils.getDiscoveryEventBus().unregister(groupListPanel);
DiscoveryEventUtils.getDiscoveryEventBus().unregister(resultsPanel); DiscoveryEventUtils.getDiscoveryEventBus().unregister(resultsPanel);
DiscoveryEventUtils.getDiscoveryEventBus().unregister(rightSplitPane.getBottomComponent()); DiscoveryEventUtils.getDiscoveryEventBus().unregister(rightSplitPane.getBottomComponent());
setDetailsVisible(false);
super.componentClosed(); super.componentClosed();
} }
@ -180,9 +179,6 @@ public final class DiscoveryTopComponent extends TopComponent {
rightSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); rightSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
rightSplitPane.setResizeWeight(1.0); rightSplitPane.setResizeWeight(1.0);
rightSplitPane.setPreferredSize(new java.awt.Dimension(800, 700)); rightSplitPane.setPreferredSize(new java.awt.Dimension(800, 700));
setDetailsVisible(false);
mainSplitPane.setRightComponent(rightSplitPane); mainSplitPane.setRightComponent(rightSplitPane);
add(mainSplitPane, java.awt.BorderLayout.CENTER); add(mainSplitPane, java.awt.BorderLayout.CENTER);
@ -293,11 +289,6 @@ public final class DiscoveryTopComponent extends TopComponent {
progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchInProgress_text(searchType.name())); progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchInProgress_text(searchType.name()));
} }
private void setDetailsVisible(boolean isVisible) {
rightSplitPane.getComponent(1).setVisible(isVisible);
rightSplitPane.getComponent(2).setVisible(isVisible);
}
/** /**
* Subscribe to the SearchCompleteEvent for updating the UI accordingly. * Subscribe to the SearchCompleteEvent for updating the UI accordingly.
* *
@ -324,7 +315,6 @@ public final class DiscoveryTopComponent extends TopComponent {
} else { } else {
rightSplitPane.setBottomComponent(new FileDetailsPanel()); rightSplitPane.setBottomComponent(new FileDetailsPanel());
} }
setDetailsVisible(true);
DiscoveryEventUtils.getDiscoveryEventBus().register(rightSplitPane.getBottomComponent()); DiscoveryEventUtils.getDiscoveryEventBus().register(rightSplitPane.getBottomComponent());
descriptionText += searchCompleteEvent.getFilters().stream().map(AbstractFilter::getDesc).collect(Collectors.joining("; ")); descriptionText += searchCompleteEvent.getFilters().stream().map(AbstractFilter::getDesc).collect(Collectors.joining("; "));
progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchComplete_text(descriptionText)); progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchComplete_text(descriptionText));

View File

@ -102,10 +102,16 @@ final class DomainArtifactsTabPanel extends JPanel {
void setStatus(ArtifactRetrievalStatus status) { void setStatus(ArtifactRetrievalStatus status) {
this.status = status; this.status = status;
if (status == ArtifactRetrievalStatus.UNPOPULATED && rightPanel != null) { if (status == ArtifactRetrievalStatus.UNPOPULATED && rightPanel != null) {
rightPanel.setArtifact(null); rightPanel.setArtifact(null);
} }
} }
/**
* Handle the event which indicates the artifacts have been retrieved.
*
* @param artifactListEvent The event which indicates the artifacts have
* been retrieved.
*/
@Subscribe @Subscribe
void handleArtifactListRetrievedEvent(DiscoveryEventUtils.ArtifactListRetrievedEvent artifactListEvent) { void handleArtifactListRetrievedEvent(DiscoveryEventUtils.ArtifactListRetrievedEvent artifactListEvent) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {