mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
undo paging for report viewer
This commit is contained in:
parent
6f29df7762
commit
39a7d8442d
@ -8,9 +8,3 @@ reportFilter.jButton1.text=Generate Report
|
||||
Toolbars/Reports/org-sleuthkit-autopsy-report-reportAction.shadow=Reports
|
||||
reportPanel.jEditorPane1.contentType=text/html
|
||||
reportPanel.jButton1.text=Close
|
||||
reportPanel.prevButton.text=prev
|
||||
reportPanel.nextButton.text=next
|
||||
reportPanel.totalLabel.text=total
|
||||
reportPanel.ofLabel.text=of
|
||||
reportPanel.currentLabel.text=current
|
||||
reportPanel.pageLabel.text=Page:
|
||||
|
@ -4,10 +4,15 @@
|
||||
<folder name="Services"/>
|
||||
<folder name="Toolbars">
|
||||
|
||||
<folder name="Reports">
|
||||
<folder name="File">
|
||||
<file name="sep2.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JToolBar$Separator"/>
|
||||
<attr name="position" intvalue="600"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-report-reportAction.shadow">
|
||||
<attr name="displayName" bundlevalue="org.sleuthkit.autopsy.report.Bundle#Toolbars/Reports/org-sleuthkit-autopsy-report-reportAction.shadow"/>
|
||||
<attr name="originalFile" stringvalue="Actions/Tools/org-sleuthkit-autopsy-report-reportAction.instance"/>
|
||||
<attr name="position" intvalue="650"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-report-reportFilterAction.shadow_hidden"/>
|
||||
</folder>
|
||||
|
@ -110,7 +110,7 @@ public final class reportAction extends CallableSystemAction implements Presente
|
||||
public Component getToolbarPresenter() {
|
||||
//ImageIcon icon = new ImageIcon(getClass().getResource("close-icon.png"));
|
||||
//toolbarButton.setIcon(icon);
|
||||
toolbarButton.setText(this.getName());
|
||||
toolbarButton.setText("Generate Report");
|
||||
return toolbarButton;
|
||||
}
|
||||
|
||||
|
@ -27,19 +27,8 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" alignment="0" pref="811" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="prevButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="nextButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="204" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="320" max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="291" max="32767" attributes="0"/>
|
||||
<Component id="pageLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="currentLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="ofLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="totalLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -52,19 +41,7 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" min="-2" pref="599" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="prevButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="nextButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="totalLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ofLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="currentLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="pageLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -95,53 +72,5 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="prevButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.prevButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="prevButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="nextButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.nextButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="nextButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="totalLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.totalLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="ofLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.ofLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="currentLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.currentLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="pageLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="reportPanel.pageLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -18,26 +18,10 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class reportPanel extends javax.swing.JPanel {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(reportPanel.class.getName());
|
||||
int page;
|
||||
int offset;
|
||||
int numPages;
|
||||
final int PAGE_SIZE = 25000;
|
||||
String report;
|
||||
/** Creates new form reportPanel */
|
||||
public reportPanel(String report) {
|
||||
initComponents();
|
||||
page = 0;
|
||||
offset = 0;
|
||||
numPages = report.length()/PAGE_SIZE;
|
||||
this.totalLabel.setText(Integer.toString(numPages));
|
||||
this.report = report;
|
||||
setReportWindow(offset);
|
||||
setPage(page);
|
||||
}
|
||||
|
||||
private void setPage(int page) {
|
||||
this.currentLabel.setText(Integer.toString(page));
|
||||
setReportWindow(report);
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
@ -52,12 +36,6 @@ public class reportPanel extends javax.swing.JPanel {
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
jEditorPane1 = new javax.swing.JEditorPane();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
prevButton = new javax.swing.JButton();
|
||||
nextButton = new javax.swing.JButton();
|
||||
totalLabel = new javax.swing.JLabel();
|
||||
ofLabel = new javax.swing.JLabel();
|
||||
currentLabel = new javax.swing.JLabel();
|
||||
pageLabel = new javax.swing.JLabel();
|
||||
|
||||
jEditorPane1.setContentType(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.jEditorPane1.contentType")); // NOI18N
|
||||
jEditorPane1.setEditable(false);
|
||||
@ -65,28 +43,6 @@ public class reportPanel extends javax.swing.JPanel {
|
||||
|
||||
jButton1.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.jButton1.text")); // NOI18N
|
||||
|
||||
prevButton.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.prevButton.text")); // NOI18N
|
||||
prevButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
prevButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
nextButton.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.nextButton.text")); // NOI18N
|
||||
nextButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
nextButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
totalLabel.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.totalLabel.text")); // NOI18N
|
||||
|
||||
ofLabel.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.ofLabel.text")); // NOI18N
|
||||
|
||||
currentLabel.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.currentLabel.text")); // NOI18N
|
||||
|
||||
pageLabel.setText(org.openide.util.NbBundle.getMessage(reportPanel.class, "reportPanel.pageLabel.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@ -96,19 +52,8 @@ public class reportPanel extends javax.swing.JPanel {
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 811, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(prevButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(nextButton)
|
||||
.addGap(204, 204, 204)
|
||||
.addComponent(jButton1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 291, Short.MAX_VALUE)
|
||||
.addComponent(pageLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(currentLabel)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(ofLabel)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(totalLabel)))
|
||||
.addGap(320, 320, 320)
|
||||
.addComponent(jButton1)))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
@ -117,40 +62,13 @@ public class reportPanel extends javax.swing.JPanel {
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 599, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jButton1)
|
||||
.addComponent(prevButton)
|
||||
.addComponent(nextButton))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(totalLabel)
|
||||
.addComponent(ofLabel)
|
||||
.addComponent(currentLabel)
|
||||
.addComponent(pageLabel)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
getAccessibleContext().setAccessibleName("");
|
||||
getAccessibleContext().setAccessibleParent(this);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void prevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prevButtonActionPerformed
|
||||
if(page > 0){
|
||||
page -= 1;
|
||||
offset -= PAGE_SIZE;
|
||||
setReportWindow(offset);
|
||||
setPage(page);
|
||||
}
|
||||
}//GEN-LAST:event_prevButtonActionPerformed
|
||||
|
||||
private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
|
||||
if(page < numPages) {
|
||||
page += 1;
|
||||
offset += PAGE_SIZE;
|
||||
setReportWindow(offset);
|
||||
setPage(page);
|
||||
}
|
||||
}//GEN-LAST:event_nextButtonActionPerformed
|
||||
/**
|
||||
* Sets the listener for the OK button
|
||||
*
|
||||
@ -159,22 +77,16 @@ public class reportPanel extends javax.swing.JPanel {
|
||||
public void setjButton1ActionListener(ActionListener e){
|
||||
jButton1.addActionListener(e);
|
||||
}
|
||||
private void setReportWindow(int offset)
|
||||
private void setReportWindow(String report)
|
||||
{
|
||||
jEditorPane1.setText(report.substring(offset, offset+PAGE_SIZE));
|
||||
jEditorPane1.setText(report);
|
||||
}
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel currentLabel;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JEditorPane jEditorPane1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JButton nextButton;
|
||||
private javax.swing.JLabel ofLabel;
|
||||
private javax.swing.JLabel pageLabel;
|
||||
private javax.swing.JButton prevButton;
|
||||
private javax.swing.JLabel totalLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user