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" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <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> <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"/>
@ -21,92 +16,122 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Component id="jScrollPane1" alignment="0" pref="639" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="profileDescLabel" 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>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Component id="jScrollPane1" pref="591" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Component id="profileNameLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" 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"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="profileDescPane"> <Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues> <Properties>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
</AuxValues> <Dimension value="[650, 323]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents> <SubComponents>
<Component class="javax.swing.JTextArea" name="profileDescArea"> <Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="columns" type="int" value="20"/> <Layout>
<Property name="lineWrap" type="boolean" value="true"/> <DimensionLayout dim="0">
<Property name="rows" type="int" value="5"/> <Group type="103" groupAlignment="0" attributes="0">
<Property name="wrapStyleWord" type="boolean" value="true"/> <Group type="102" attributes="0">
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Dimension value="[104, 22]"/> <Group type="103" groupAlignment="0" attributes="0">
</Property> <Component id="profileDescLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/> <Component id="profileNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Properties> </Group>
</Component> </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="0" max="-2" attributes="0"/>
<Component id="profileNameLabel" min="-2" 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="-2" pref="0" 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"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="profileDescArea">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="5"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<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>
</Container>
<Component class="javax.swing.JLabel" name="profileNameLabel">
<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.profileNameLabel.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">
<Dimension value="[625, 450]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[625, 450]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</SubComponents>
</Container>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="javax.swing.JLabel" name="profileNameLabel">
<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.profileNameLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</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">
<Dimension value="[625, 450]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[625, 450]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Component class="javax.swing.JTextField" name="profileNameField">
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

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

View File

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