2512 resizable scrollable profile creation panel

This commit is contained in:
William Schaefer 2017-04-03 16:23:03 -04:00
parent d43e586e97
commit 0174a2fa6a
3 changed files with 166 additions and 110 deletions

View File

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[625, 450]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -21,44 +16,76 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="639" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="profileDescLabel" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="591" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[650, 323]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="profileDescLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="profileNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="480" max="32767" attributes="0"/>
</Group>
<Component id="jPanel1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="profileDescPane" alignment="0" max="32767" attributes="0"/>
<Component id="profileNameField" max="32767" attributes="0"/>
</Group>
<Component id="jPanel1" alignment="0" pref="637" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="profileNameField" max="32767" attributes="0"/>
<Component id="profileDescPane" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="profileNameLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="profileNameField" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Component id="profileDescLabel" min="-2" pref="15" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="profileDescPane" pref="67" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" pref="328" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Component id="profileDescPane" pref="56" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="jPanel1" pref="480" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="profileNameField">
</Component>
<Component class="javax.swing.JLabel" name="profileDescLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/profiles/Bundle.properties" key="ProfilePanel.profileDescLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="profileDescPane">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
@ -76,6 +103,9 @@
<Dimension value="[104, 22]"/>
</Property>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[164, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
@ -87,13 +117,6 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="profileDescLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/profiles/Bundle.properties" key="ProfilePanel.profileDescLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@ -106,7 +129,9 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Component class="javax.swing.JTextField" name="profileNameField">
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@ -96,14 +96,18 @@ class ProfilePanel extends IngestModuleGlobalSettingsPanel {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jPanel2 = new javax.swing.JPanel();
profileNameField = new javax.swing.JTextField();
profileDescLabel = new javax.swing.JLabel();
profileDescPane = new javax.swing.JScrollPane();
profileDescArea = new javax.swing.JTextArea();
profileNameLabel = new javax.swing.JLabel();
profileDescLabel = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
profileNameField = new javax.swing.JTextField();
setMaximumSize(new java.awt.Dimension(625, 450));
jScrollPane1.setPreferredSize(new java.awt.Dimension(650, 323));
org.openide.awt.Mnemonics.setLocalizedText(profileDescLabel, org.openide.util.NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.profileDescLabel.text")); // NOI18N
profileDescArea.setColumns(20);
profileDescArea.setLineWrap(true);
@ -111,48 +115,58 @@ class ProfilePanel extends IngestModuleGlobalSettingsPanel {
profileDescArea.setWrapStyleWord(true);
profileDescArea.setMinimumSize(new java.awt.Dimension(104, 22));
profileDescArea.setName(""); // NOI18N
profileDescPane.setViewportView(profileDescArea);
profileDescArea.setPreferredSize(new java.awt.Dimension(164, 30));
org.openide.awt.Mnemonics.setLocalizedText(profileNameLabel, org.openide.util.NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.profileNameLabel.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(profileDescLabel, org.openide.util.NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.profileDescLabel.text")); // NOI18N
jPanel1.setMinimumSize(new java.awt.Dimension(625, 450));
jPanel1.setPreferredSize(new java.awt.Dimension(625, 450));
jPanel1.setLayout(new java.awt.BorderLayout());
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(profileDescLabel)
.addComponent(profileNameLabel))
.addContainerGap(480, Short.MAX_VALUE))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(profileDescPane, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(profileNameField))
.addGap(6, 6, 6))
.addComponent(profileNameLabel)))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 637, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(profileNameField)
.addComponent(profileDescPane))
.addGap(5, 5, 5))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(1, 1, 1)
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(profileNameLabel)
.addGap(0, 0, 0)
.addComponent(profileNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(profileDescLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(profileDescPane, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
.addComponent(profileDescPane, javax.swing.GroupLayout.DEFAULT_SIZE, 56, Short.MAX_VALUE)
.addGap(0, 0, 0)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
jScrollPane1.setViewportView(jPanel2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
@Override
@ -166,6 +180,8 @@ class ProfilePanel extends IngestModuleGlobalSettingsPanel {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea profileDescArea;
private javax.swing.JLabel profileDescLabel;
private javax.swing.JScrollPane profileDescPane;

View File

@ -19,14 +19,19 @@
package org.sleuthkit.autopsy.ingest;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Level;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
@ -54,7 +59,7 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
private Map<String, IngestProfile> profiles;
private ProfilePanel panel;
private boolean canBeEnabled; //if something can be enabled ingest is not running
private int option = JOptionPane.CANCEL_OPTION;
/**
* Creates new form ProfileOptionsPanel
*/
@ -368,6 +373,7 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
*/
private void doProfileDialog(IngestProfile selectedProfile) {
// Create a files set defintion panel.
final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true);
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//start wait cursor for ingest job settings construction
if (selectedProfile != null) {
@ -377,12 +383,21 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
// Creating a new set definition.
panel = new ProfilePanel();
}
dialog.addApplyButtonListener(
(ActionEvent e) -> {
panel.store();
option = JOptionPane.OK_OPTION;
dialog.close();
}
);
//end wait Cursor for ingest job settings construction
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
// Do a dialog box with the profilePanel till the user enters a name or chooses cancel
int option = JOptionPane.OK_OPTION;
do {
option = JOptionPane.showConfirmDialog(null, panel, Bundle.ProfileSettingsPanel_title(), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
option = JOptionPane.CANCEL_OPTION;
dialog.display(panel);
} while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
if (option == JOptionPane.OK_OPTION) {