2934 changes to Central Repo Options panel and config dialog

This commit is contained in:
William Schaefer 2017-08-11 13:58:16 -04:00
parent 2ec2c4a929
commit c6c5acba0f
5 changed files with 503 additions and 823 deletions

View File

@ -13,7 +13,7 @@ EamSqliteSettingsDialog.bnCancel.text=Cancel
EamSqliteSettingsDialog.lbTestDatabase.text= EamSqliteSettingsDialog.lbTestDatabase.text=
EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection
EamSqliteSettingsDialog.lbTestDatabaseWarning.text= EamSqliteSettingsDialog.lbTestDatabaseWarning.text=
EamSqliteSettingsDialog.bnDatabasePathFileOpen.text=Open... EamSqliteSettingsDialog.bnDatabasePathFileOpen.text=Browse...
EamSqliteSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file EamSqliteSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file
EamSqliteSettingsDialog.tfDatabasePath.text= EamSqliteSettingsDialog.tfDatabasePath.text=
EamSqliteSettingsDialog.lbDatabasePath.text=Database Path : EamSqliteSettingsDialog.lbDatabasePath.text=Database Path :
@ -52,24 +52,16 @@ ManageTagsDialog.cancelButton.text=Cancel
ManageArtifactTypesDialog.taInstructionsMsg.text=Enable one or more correlation properties to use for correlation during ingest. Note, these properties are global and impact all users of the central repository. ManageArtifactTypesDialog.taInstructionsMsg.text=Enable one or more correlation properties to use for correlation during ingest. Note, these properties are global and impact all users of the central repository.
EamSqliteSettingsDialog.bnOk.text=OK EamSqliteSettingsDialog.bnOk.text=OK
EamPostgresSettingsDialog.bnSave.text=Save EamPostgresSettingsDialog.bnSave.text=Save
EamDbSettingsDialog.pnDatabaseConnectionSettings.border.title=Database Settings EamDbSettingsDialog.bnDatabasePathFileOpen.text=Browse...
EamDbSettingsDialog.rdioBnPostgreSQL.text=PostgreSQL
EamDbSettingsDialog.rdioBnSQLite.text=SQLite
EamDbSettingsDialog.bnDatabasePathFileOpen.text=Open...
EamDbSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file EamDbSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file
EamDbSettingsDialog.tfDatabasePath.text= EamDbSettingsDialog.tfDatabasePath.text=
EamDbSettingsDialog.lbDatabasePath.text=Database Path : EamDbSettingsDialog.lbDatabasePath.text=Database Path :
EamDbSettingsDialog.rdioBnDisabled.text=Disabled
EamDbSettingsDialog.bnCancel.text=Cancel EamDbSettingsDialog.bnCancel.text=Cancel
EamDbSettingsDialog.bnOk.text=OK EamDbSettingsDialog.bnOk.text=OK
EamDbSettingsDialog.bnTest.text=Test
EamDbSettingsDialog.lbHostName.text=Host Name / IP : EamDbSettingsDialog.lbHostName.text=Host Name / IP :
EamDbSettingsDialog.lbDatabaseName.text=Database name :
EamDbSettingsDialog.lbUserPassword.text=User Password : EamDbSettingsDialog.lbUserPassword.text=User Password :
EamDbSettingsDialog.lbUserName.text=User Name : EamDbSettingsDialog.lbUserName.text=User Name :
EamDbSettingsDialog.lbPort.text=Port : EamDbSettingsDialog.lbPort.text=Port :
EamDbSettingsDialog.bnCreateDb.text=Create
EamDbSettingsDialog.pnSetupGuidance.border.title=Setup Guidance
GlobalSettingsPanel.pnDatabaseConfiguration.title=Database Configuration GlobalSettingsPanel.pnDatabaseConfiguration.title=Database Configuration
GlobalSettingsPanel.lbDbPlatformTypeLabel.text=Type: GlobalSettingsPanel.lbDbPlatformTypeLabel.text=Type:
GlobalSettingsPanel.lbDbNameLabel.text=Name: GlobalSettingsPanel.lbDbNameLabel.text=Name:
@ -82,3 +74,6 @@ GlobalSettingsPanel.bnManageProperties.text=Manage Correlation Properties
ImportHashDatabaseDialog.lbInstructions.text=Choose an .idx file to import into the central repository. ImportHashDatabaseDialog.lbInstructions.text=Choose an .idx file to import into the central repository.
ImportHashDatabaseDialog.lbFilePath.text=File Path: ImportHashDatabaseDialog.lbFilePath.text=File Path:
ImportHashDatabaseDialog.tfFilePath.text= ImportHashDatabaseDialog.tfFilePath.text=
EamDbSettingsDialog.jLabel1.text=SQLite should only be used by one examiner at a time.
EamDbSettingsDialog.jLabel2.text=Database type:
GlobalSettingsPanel.jCheckBox1.text=Use a Central Repository

View File

@ -29,12 +29,11 @@
<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" alignment="1" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="pnSetupGuidance" max="32767" attributes="0"/> <Component id="pnButtons" max="32767" attributes="0"/>
<Component id="pnDatabaseConnectionSettings" alignment="0" max="32767" attributes="0"/> <Component id="pnSQLiteSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnButtons" alignment="1" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -43,73 +42,66 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="pnSetupGuidance" min="-2" max="-2" attributes="0"/> <Component id="pnSQLiteSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="pnDatabaseConnectionSettings" min="-2" pref="348" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnButtons" min="-2" max="-2" attributes="0"/> <Component id="pnButtons" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnButtons">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="bnOk" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/> <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="pnDatabaseConnectionSettings"> <Component class="javax.swing.JButton" name="bnCancel">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnCancel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<TitledBorder title="Database Settings">
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.pnDatabaseConnectionSettings.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Font PropertyName="font" name="Tahoma" size="12" style="0"/>
</TitledBorder>
</Border>
</Property> </Property>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties> </Properties>
<Events>
<Layout> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
<DimensionLayout dim="0"> </Events>
<Group type="103" groupAlignment="0" attributes="0"> </Component>
<Group type="102" alignment="0" attributes="0"> <Component class="javax.swing.JButton" name="bnOk">
<Component id="rdioBnPostgreSQL" min="-2" max="-2" attributes="0"/> <Properties>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
</Group> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnOk.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Group type="102" attributes="0"> </Property>
<Group type="103" groupAlignment="0" attributes="0"> </Properties>
<Component id="rdioBnSQLite" alignment="0" min="-2" max="-2" attributes="0"/> <Events>
<Component id="rdioBnDisabled" alignment="0" min="-2" max="-2" attributes="0"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnOkActionPerformed"/>
</Group> </Events>
<EmptySpace max="32767" attributes="0"/> </Component>
</Group> </SubComponents>
<Group type="102" alignment="0" attributes="0"> </Container>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="pnSQLiteSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnPostgreSQLSettings" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="rdioBnDisabled" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Component id="rdioBnSQLite" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnSQLiteSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Component id="rdioBnPostgreSQL" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnPostgreSQLSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="329" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnSQLiteSettings"> <Container class="javax.swing.JPanel" name="pnSQLiteSettings">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@ -124,25 +116,88 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="lbDatabasePath" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/> <Group type="102" attributes="0">
<Component id="tfDatabasePath" min="-2" pref="343" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/> <Component id="lbHostName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" min="-2" max="-2" attributes="0"/> <Component id="lbPort" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" pref="82" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lbDatabasePath" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserPassword" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="14" pref="14" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" pref="467" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="tfDatabasePath" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbDbHostname" max="32767" attributes="0"/>
<Component id="jpDbPassword" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbUsername" alignment="1" max="32767" attributes="0"/>
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</Group> </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" alignment="0" 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">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="lbDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/> <Component id="lbDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="tfDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/> <Component id="tfDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="bnDatabasePathFileOpen" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbHostname" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbHostName" alignment="3" min="-2" pref="22" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbPort" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbPort" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbUsername" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lbUserPassword" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jpDbPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -178,75 +233,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDatabasePathFileOpenActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDatabasePathFileOpenActionPerformed"/>
</Events> </Events>
</Component> </Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnPostgreSQLSettings">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lbHostName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbPort" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbDatabaseName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserPassword" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbUsername" alignment="0" pref="439" max="32767" attributes="0"/>
<Component id="tbDbName" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbHostname" max="32767" attributes="0"/>
<Component id="jpDbPassword" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="tbDbHostname" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="lbHostName" alignment="1" min="-2" pref="22" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
<Component id="lbPort" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbName" alignment="0" max="32767" attributes="0"/>
<Component id="lbDatabaseName" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbUsername" alignment="0" max="32767" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lbUserPassword" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jpDbPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="19" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="lbHostName"> <Component class="javax.swing.JLabel" name="lbHostName">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -254,6 +240,8 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JTextField" name="tbDbHostname">
</Component>
<Component class="javax.swing.JLabel" name="lbPort"> <Component class="javax.swing.JLabel" name="lbPort">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -261,6 +249,8 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JTextField" name="tbDbPort">
</Component>
<Component class="javax.swing.JLabel" name="lbUserName"> <Component class="javax.swing.JLabel" name="lbUserName">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -268,6 +258,8 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JTextField" name="tbDbUsername">
</Component>
<Component class="javax.swing.JLabel" name="lbUserPassword"> <Component class="javax.swing.JLabel" name="lbUserPassword">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -275,215 +267,36 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="lbDatabaseName">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbDatabaseName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="tbDbHostname">
</Component>
<Component class="javax.swing.JTextField" name="tbDbPort">
</Component>
<Component class="javax.swing.JTextField" name="tbDbName">
</Component>
<Component class="javax.swing.JTextField" name="tbDbUsername">
</Component>
<Component class="javax.swing.JPasswordField" name="jpDbPassword"> <Component class="javax.swing.JPasswordField" name="jpDbPassword">
</Component> </Component>
</SubComponents> <Component class="javax.swing.JComboBox" name="jComboBox1">
</Container>
<Component class="javax.swing.JRadioButton" name="rdioBnSQLite">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnSQLite.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <Connection code="new javax.swing.DefaultComboBoxModel&lt;&gt;(new EamDbPlatformEnum[]{EamDbPlatformEnum.POSTGRESQL, EamDbPlatformEnum.SQLITE})" type="code"/>
</Property> </Property>
</Properties> </Properties>
<Events> <Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnSQLiteActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox1ActionPerformed"/>
</Events> </Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;EamDbPlatformEnum&gt;"/>
</AuxValues>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="rdioBnPostgreSQL"> <Component class="javax.swing.JLabel" name="jLabel1">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnPostgreSQL.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnPostgreSQLActionPerformed"/>
</Events>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="rdioBnDisabled"> <Component class="javax.swing.JLabel" name="jLabel2">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnDisabled.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnDisabledActionPerformed"/>
</Events>
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="pnButtons">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="bnTest" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbTestIcon" min="-2" pref="20" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="bnCreateDb" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbCreateIcon" min="-2" pref="21" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="bnOk" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lbCreateIcon" max="32767" attributes="0"/>
<Component id="lbTestIcon" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnTest" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnCreateDb" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="bnCancel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnCancel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnOk">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnOk.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnOkActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnTest">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnTest.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnTestActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnCreateDb">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnCreateDb.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCreateDbActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lbTestIcon">
</Component>
<Component class="javax.swing.JLabel" name="lbCreateIcon">
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnSetupGuidance">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Setup Guidance">
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.pnSetupGuidance.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Font PropertyName="font" name="Tahoma" size="12" style="0"/>
</TitledBorder>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="taSetupGuidance">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="f0" green="f0" red="f0" type="rgb"/>
</Property>
<Property name="columns" type="int" value="20"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Monospaced" size="12" style="0"/>
</Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="rows" type="int" value="3"/>
<Property name="tabSize" type="int" value="4"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -25,6 +25,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import org.netbeans.spi.options.OptionsPanelController; import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.ImageUtilities; import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
@ -32,6 +33,7 @@ import org.sleuthkit.autopsy.corecomponents.TextPrompt;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum;
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum.SQLITE;
import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings;
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
@ -40,7 +42,10 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
* @author nick * @author nick
*/ */
public class EamDbSettingsDialog extends JDialog { public class EamDbSettingsDialog extends JDialog {
private static final Logger LOGGER = Logger.getLogger(EamDbSettingsDialog.class.getName()); private static final Logger LOGGER = Logger.getLogger(EamDbSettingsDialog.class.getName());
private static final String CENTRAL_REPO_DB_NAME = "central_repository";
private static final String CENTRAL_REPO_SQLITE_EXT = ".db";
private final Collection<JTextField> textBoxes; private final Collection<JTextField> textBoxes;
private final TextBoxChangedListener textBoxChangedListener; private final TextBoxChangedListener textBoxChangedListener;
private final ImageIcon goodIcon; private final ImageIcon goodIcon;
@ -64,15 +69,22 @@ public class EamDbSettingsDialog extends JDialog {
textBoxChangedListener = new TextBoxChangedListener(); textBoxChangedListener = new TextBoxChangedListener();
goodIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/good.png", false)); // NON-NLS goodIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/good.png", false)); // NON-NLS
badIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/bad.png", false)); // NON-NLS badIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/bad.png", false)); // NON-NLS
dbSettingsPostgres = new PostgresEamDbSettings(); dbSettingsPostgres = new PostgresEamDbSettings();
dbSettingsSqlite = new SqliteEamDbSettings(); dbSettingsSqlite = new SqliteEamDbSettings();
selectedPlatform = EamDbPlatformEnum.getSelectedPlatform(); selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
if (selectedPlatform == null || selectedPlatform.equals(EamDbPlatformEnum.DISABLED)) {
selectedPlatform = EamDbPlatformEnum.POSTGRESQL;
} else {
System.out.println("selectedPlatform = " + selectedPlatform);
}
initComponents(); initComponents();
fcDatabasePath.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
jComboBox1.setSelectedItem(selectedPlatform);
customizeComponents(); customizeComponents();
valid(); valid();
display(); display();
} }
/** /**
@ -86,40 +98,61 @@ public class EamDbSettingsDialog extends JDialog {
bnGrpDatabasePlatforms = new javax.swing.ButtonGroup(); bnGrpDatabasePlatforms = new javax.swing.ButtonGroup();
fcDatabasePath = new javax.swing.JFileChooser(); fcDatabasePath = new javax.swing.JFileChooser();
pnDatabaseConnectionSettings = new javax.swing.JPanel(); pnButtons = new javax.swing.JPanel();
bnCancel = new javax.swing.JButton();
bnOk = new javax.swing.JButton();
pnSQLiteSettings = new javax.swing.JPanel(); pnSQLiteSettings = new javax.swing.JPanel();
lbDatabasePath = new javax.swing.JLabel(); lbDatabasePath = new javax.swing.JLabel();
tfDatabasePath = new javax.swing.JTextField(); tfDatabasePath = new javax.swing.JTextField();
bnDatabasePathFileOpen = new javax.swing.JButton(); bnDatabasePathFileOpen = new javax.swing.JButton();
pnPostgreSQLSettings = new javax.swing.JPanel();
lbHostName = new javax.swing.JLabel(); lbHostName = new javax.swing.JLabel();
lbPort = new javax.swing.JLabel();
lbUserName = new javax.swing.JLabel();
lbUserPassword = new javax.swing.JLabel();
lbDatabaseName = new javax.swing.JLabel();
tbDbHostname = new javax.swing.JTextField(); tbDbHostname = new javax.swing.JTextField();
lbPort = new javax.swing.JLabel();
tbDbPort = new javax.swing.JTextField(); tbDbPort = new javax.swing.JTextField();
tbDbName = new javax.swing.JTextField(); lbUserName = new javax.swing.JLabel();
tbDbUsername = new javax.swing.JTextField(); tbDbUsername = new javax.swing.JTextField();
lbUserPassword = new javax.swing.JLabel();
jpDbPassword = new javax.swing.JPasswordField(); jpDbPassword = new javax.swing.JPasswordField();
rdioBnSQLite = new javax.swing.JRadioButton(); jComboBox1 = new javax.swing.JComboBox<>();
rdioBnPostgreSQL = new javax.swing.JRadioButton(); jLabel1 = new javax.swing.JLabel();
rdioBnDisabled = new javax.swing.JRadioButton(); jLabel2 = new javax.swing.JLabel();
pnButtons = new javax.swing.JPanel();
bnCancel = new javax.swing.JButton();
bnOk = new javax.swing.JButton();
bnTest = new javax.swing.JButton();
bnCreateDb = new javax.swing.JButton();
lbTestIcon = new javax.swing.JLabel();
lbCreateIcon = new javax.swing.JLabel();
pnSetupGuidance = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
taSetupGuidance = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
pnDatabaseConnectionSettings.setBorder(javax.swing.BorderFactory.createTitledBorder(null, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.pnDatabaseConnectionSettings.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(bnCancel, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnCancel.text")); // NOI18N
pnDatabaseConnectionSettings.setName(""); // NOI18N bnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnCancelActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnOk, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnOk.text")); // NOI18N
bnOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnOkActionPerformed(evt);
}
});
javax.swing.GroupLayout pnButtonsLayout = new javax.swing.GroupLayout(pnButtons);
pnButtons.setLayout(pnButtonsLayout);
pnButtonsLayout.setHorizontalGroup(
pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnButtonsLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnOk)
.addGap(11, 11, 11)
.addComponent(bnCancel)
.addContainerGap())
);
pnButtonsLayout.setVerticalGroup(
pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnButtonsLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bnOk)
.addComponent(bnCancel))
.addGap(0, 0, 0))
);
pnSQLiteSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder()); pnSQLiteSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
@ -140,32 +173,6 @@ public class EamDbSettingsDialog extends JDialog {
} }
}); });
javax.swing.GroupLayout pnSQLiteSettingsLayout = new javax.swing.GroupLayout(pnSQLiteSettings);
pnSQLiteSettings.setLayout(pnSQLiteSettingsLayout);
pnSQLiteSettingsLayout.setHorizontalGroup(
pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(lbDatabasePath)
.addGap(18, 18, 18)
.addComponent(tfDatabasePath, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnDatabasePathFileOpen)
.addContainerGap())
);
pnSQLiteSettingsLayout.setVerticalGroup(
pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbDatabasePath, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tfDatabasePath, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bnDatabasePathFileOpen))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pnPostgreSQLSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
org.openide.awt.Mnemonics.setLocalizedText(lbHostName, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbHostName.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(lbHostName, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbHostName.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(lbPort, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbPort.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(lbPort, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbPort.text")); // NOI18N
@ -174,265 +181,130 @@ public class EamDbSettingsDialog extends JDialog {
org.openide.awt.Mnemonics.setLocalizedText(lbUserPassword, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbUserPassword.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(lbUserPassword, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbUserPassword.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(lbDatabaseName, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.lbDatabaseName.text")); // NOI18N jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new EamDbPlatformEnum[]{EamDbPlatformEnum.POSTGRESQL, EamDbPlatformEnum.SQLITE}));
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
javax.swing.GroupLayout pnPostgreSQLSettingsLayout = new javax.swing.GroupLayout(pnPostgreSQLSettings); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.jLabel1.text")); // NOI18N
pnPostgreSQLSettings.setLayout(pnPostgreSQLSettingsLayout);
pnPostgreSQLSettingsLayout.setHorizontalGroup( org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.jLabel2.text")); // NOI18N
pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnPostgreSQLSettingsLayout.createSequentialGroup() javax.swing.GroupLayout pnSQLiteSettingsLayout = new javax.swing.GroupLayout(pnSQLiteSettings);
pnSQLiteSettings.setLayout(pnSQLiteSettingsLayout);
pnSQLiteSettingsLayout.setHorizontalGroup(
pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lbHostName) .addComponent(lbHostName)
.addComponent(lbPort) .addComponent(lbPort)
.addComponent(lbDatabaseName)
.addComponent(lbUserName) .addComponent(lbUserName)
.addComponent(lbUserPassword)) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18) .addGap(10, 10, 10))
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addComponent(tbDbUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbDbName) .addComponent(lbDatabasePath)
.addComponent(tbDbPort) .addComponent(lbUserPassword, javax.swing.GroupLayout.Alignment.TRAILING))
.addGap(14, 14, 14)))
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE)
.addGap(9, 9, 9))
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addComponent(tfDatabasePath)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bnDatabasePathFileOpen)
.addGap(11, 11, 11))
.addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbDbHostname) .addComponent(tbDbHostname)
.addComponent(jpDbPassword)) .addComponent(jpDbPassword)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(tbDbUsername, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(tbDbPort))
.addGap(10, 10, 10))))
); );
pnPostgreSQLSettingsLayout.setVerticalGroup( pnSQLiteSettingsLayout.setVerticalGroup(
pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnPostgreSQLSettingsLayout.createSequentialGroup() .addGroup(pnSQLiteSettingsLayout.createSequentialGroup()
.addContainerGap() .addGap(6, 6, 6)
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbDatabasePath, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tfDatabasePath, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bnDatabasePathFileOpen))
.addGap(0, 0, 0)
.addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tbDbHostname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tbDbHostname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbHostName, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(lbHostName, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tbDbPort) .addComponent(tbDbPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbPort, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(lbPort, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tbDbName) .addComponent(tbDbUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbDatabaseName, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(tbDbUsername)
.addComponent(lbUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(lbUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnPostgreSQLSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(pnSQLiteSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbUserPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbUserPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jpDbPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jpDbPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(19, Short.MAX_VALUE)) .addGap(10, 10, 10))
);
org.openide.awt.Mnemonics.setLocalizedText(rdioBnSQLite, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.rdioBnSQLite.text")); // NOI18N
rdioBnSQLite.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdioBnSQLiteActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(rdioBnPostgreSQL, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.rdioBnPostgreSQL.text")); // NOI18N
rdioBnPostgreSQL.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdioBnPostgreSQLActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(rdioBnDisabled, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.rdioBnDisabled.text")); // NOI18N
rdioBnDisabled.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdioBnDisabledActionPerformed(evt);
}
});
javax.swing.GroupLayout pnDatabaseConnectionSettingsLayout = new javax.swing.GroupLayout(pnDatabaseConnectionSettings);
pnDatabaseConnectionSettings.setLayout(pnDatabaseConnectionSettingsLayout);
pnDatabaseConnectionSettingsLayout.setHorizontalGroup(
pnDatabaseConnectionSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnDatabaseConnectionSettingsLayout.createSequentialGroup()
.addComponent(rdioBnPostgreSQL)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(pnDatabaseConnectionSettingsLayout.createSequentialGroup()
.addGroup(pnDatabaseConnectionSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(rdioBnSQLite)
.addComponent(rdioBnDisabled))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(pnDatabaseConnectionSettingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnDatabaseConnectionSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnSQLiteSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pnPostgreSQLSettings, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
pnDatabaseConnectionSettingsLayout.setVerticalGroup(
pnDatabaseConnectionSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDatabaseConnectionSettingsLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(rdioBnDisabled)
.addGap(13, 13, 13)
.addComponent(rdioBnSQLite)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnSQLiteSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(rdioBnPostgreSQL)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnPostgreSQLSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(329, 329, 329))
);
org.openide.awt.Mnemonics.setLocalizedText(bnCancel, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnCancel.text")); // NOI18N
bnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnCancelActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnOk, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnOk.text")); // NOI18N
bnOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnOkActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnTest, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnTest.text")); // NOI18N
bnTest.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnTestActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnCreateDb, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.bnCreateDb.text")); // NOI18N
bnCreateDb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnCreateDbActionPerformed(evt);
}
});
javax.swing.GroupLayout pnButtonsLayout = new javax.swing.GroupLayout(pnButtons);
pnButtons.setLayout(pnButtonsLayout);
pnButtonsLayout.setHorizontalGroup(
pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnButtonsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(bnTest)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbTestIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(bnCreateDb)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbCreateIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnOk)
.addGap(11, 11, 11)
.addComponent(bnCancel)
.addContainerGap())
);
pnButtonsLayout.setVerticalGroup(
pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnButtonsLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lbCreateIcon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lbTestIcon, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(pnButtonsLayout.createSequentialGroup()
.addGroup(pnButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bnOk)
.addComponent(bnCancel)
.addComponent(bnTest)
.addComponent(bnCreateDb))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
pnSetupGuidance.setBorder(javax.swing.BorderFactory.createTitledBorder(null, org.openide.util.NbBundle.getMessage(EamDbSettingsDialog.class, "EamDbSettingsDialog.pnSetupGuidance.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
jScrollPane1.setBorder(null);
taSetupGuidance.setEditable(false);
taSetupGuidance.setBackground(new java.awt.Color(240, 240, 240));
taSetupGuidance.setColumns(20);
taSetupGuidance.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
taSetupGuidance.setLineWrap(true);
taSetupGuidance.setRows(3);
taSetupGuidance.setTabSize(4);
taSetupGuidance.setWrapStyleWord(true);
taSetupGuidance.setAutoscrolls(false);
taSetupGuidance.setBorder(null);
taSetupGuidance.setRequestFocusEnabled(false);
taSetupGuidance.setVerifyInputWhenFocusTarget(false);
jScrollPane1.setViewportView(taSetupGuidance);
javax.swing.GroupLayout pnSetupGuidanceLayout = new javax.swing.GroupLayout(pnSetupGuidance);
pnSetupGuidance.setLayout(pnSetupGuidanceLayout);
pnSetupGuidanceLayout.setHorizontalGroup(
pnSetupGuidanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSetupGuidanceLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1)
.addContainerGap())
);
pnSetupGuidanceLayout.setVerticalGroup(
pnSetupGuidanceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnSetupGuidanceLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout); getContentPane().setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnSetupGuidance, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pnDatabaseConnectionSettings, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnSQLiteSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(pnButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addGap(10, 10, 10)
.addComponent(pnSetupGuidance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnSQLiteSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pnDatabaseConnectionSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)) .addGap(10, 10, 10))
); );
pack(); pack();
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void customizeComponents() { private void customizeComponents() {
bnGrpDatabasePlatforms.add(rdioBnDisabled); setTextPrompts();
bnGrpDatabasePlatforms.add(rdioBnPostgreSQL); setTextBoxListeners();
bnGrpDatabasePlatforms.add(rdioBnSQLite);
switch (selectedPlatform) { switch (selectedPlatform) {
case POSTGRESQL:
rdioBnPostgreSQL.setSelected(true);
testingStatus = DatabaseTestResult.UNTESTED;
updatePostgresFields(true);
updateSqliteFields(false);
break;
case SQLITE: case SQLITE:
rdioBnSQLite.setSelected(true);
testingStatus = DatabaseTestResult.UNTESTED; testingStatus = DatabaseTestResult.UNTESTED;
updatePostgresFields(false); updatePostgresFields(false);
updateSqliteFields(true); updateSqliteFields(true);
break; break;
default: default:
rdioBnDisabled.setSelected(true); POSTGRESQL:
testingStatus = DatabaseTestResult.TESTEDOK; testingStatus = DatabaseTestResult.UNTESTED;
updatePostgresFields(false); updatePostgresFields(true);
updateSqliteFields(false); updateSqliteFields(false);
break; break;
}
setTextPrompts(); }
setTextBoxListeners(); displayDatabaseSettings(selectedPlatform.equals(EamDbPlatformEnum.POSTGRESQL));
lbTestIcon.setIcon(null);
} }
private void display() { private void display() {
@ -440,18 +312,18 @@ public class EamDbSettingsDialog extends JDialog {
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2); setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
setVisible(true); setVisible(true);
} }
private void setGuidanceMessage(String message, boolean isError) { private void setGuidanceMessage(String message, boolean isError) {
taSetupGuidance.setText(message);
if (isError) { if (isError) {
taSetupGuidance.setForeground(new Color(255, 102, 102)); // light red color
} else { } else {
taSetupGuidance.setForeground(new Color(0, 0, 0)); // black color
} }
} }
private void clearIcons() { private void clearIcons() {
lbTestIcon.setIcon(null);
lbCreateIcon.setIcon(null);
} }
@Messages({"EamDbSettingsDialog.chooserPath.failedToGetDbPathMsg=Selected database path is invalid. Try again."}) @Messages({"EamDbSettingsDialog.chooserPath.failedToGetDbPathMsg=Selected database path is invalid. Try again."})
@ -461,11 +333,7 @@ public class EamDbSettingsDialog extends JDialog {
if (fcDatabasePath.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { if (fcDatabasePath.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
File databaseFile = fcDatabasePath.getSelectedFile(); File databaseFile = fcDatabasePath.getSelectedFile();
try { try {
String fullPath = databaseFile.getCanonicalPath(); tfDatabasePath.setText(databaseFile.getCanonicalPath());
if (!fullPath.endsWith(".db")) {
fullPath = fullPath + ".db"; // NON-NLS
}
tfDatabasePath.setText(fullPath);
valid(); valid();
} catch (IOException ex) { } catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS LOGGER.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS
@ -474,9 +342,7 @@ public class EamDbSettingsDialog extends JDialog {
} }
}//GEN-LAST:event_bnDatabasePathFileOpenActionPerformed }//GEN-LAST:event_bnDatabasePathFileOpenActionPerformed
private void bnTestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnTestActionPerformed private void testDbSettings() {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
switch (selectedPlatform) { switch (selectedPlatform) {
case POSTGRESQL: case POSTGRESQL:
if (dbSettingsPostgres.verifyConnection()) { if (dbSettingsPostgres.verifyConnection()) {
@ -504,19 +370,10 @@ public class EamDbSettingsDialog extends JDialog {
break; break;
} }
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
if (testingStatus == DatabaseTestResult.TESTEDOK) {
lbTestIcon.setIcon(goodIcon);
} else {
lbTestIcon.setIcon(badIcon);
}
valid(); valid();
}//GEN-LAST:event_bnTestActionPerformed }
@Messages({"EamDbSettingsDialog.creation.failed=Database initialization failed."}) private void createDb() {
private void bnCreateDbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCreateDbActionPerformed
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
clearIcons(); clearIcons();
boolean result = false; boolean result = false;
switch (selectedPlatform) { switch (selectedPlatform) {
@ -536,21 +393,40 @@ public class EamDbSettingsDialog extends JDialog {
&& dbSettingsSqlite.insertDefaultDatabaseContent(); && dbSettingsSqlite.insertDefaultDatabaseContent();
break; break;
} }
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
if (false == result) { if (false == result) {
setGuidanceMessage(Bundle.EamDbSettingsDialog_creation_failed(), true);
lbCreateIcon.setIcon(badIcon);
} else { } else {
testingStatus = DatabaseTestResult.TESTEDOK; testingStatus = DatabaseTestResult.TESTEDOK;
lbCreateIcon.setIcon(goodIcon);
valid(); valid();
} }
}//GEN-LAST:event_bnCreateDbActionPerformed }
@Messages({"EamDbSettingsDialog.okButton.errorTitle.text=Restart Required.", @Messages({"EamDbSettingsDialog.okButton.errorTitle.text=Restart Required.",
"EamDbSettingsDialog.okButton.errorMsg.text=Please restart Autopsy to begin using the new database platform.", "EamDbSettingsDialog.okButton.errorMsg.text=Please restart Autopsy to begin using the new database platform.",
"EamDbSettingsDialog.okButton.connectionErrorMsg.text=Failed to connect to Central Repository database."}) "EamDbSettingsDialog.okButton.connectionErrorMsg.text=Failed to connect to Central Repository database."})
private void bnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOkActionPerformed private void bnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOkActionPerformed
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
testDbSettings();
if (testingStatus == DatabaseTestResult.CONNECTION_FAILED) {
JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
"Connection to database failed, check your settings",
"Connection failed",
JOptionPane.OK_OPTION);
} else if (testingStatus == DatabaseTestResult.SCHEMA_INVALID) {
//database doesn't exist do you want to create
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
"DO YOU WANT TO CREATE DB",
"DB DOESNT EXIST",
JOptionPane.YES_NO_OPTION)) {
createDb();
}
}
if (testingStatus != DatabaseTestResult.TESTEDOK) {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
return;
}
/** /**
* We have to shutdown the previous platform's connection pool first; * We have to shutdown the previous platform's connection pool first;
* assuming it wasn't DISABLED. This will close any existing idle * assuming it wasn't DISABLED. This will close any existing idle
@ -592,6 +468,7 @@ public class EamDbSettingsDialog extends JDialog {
} catch (EamDbException ex) { } catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, "Failed to connect to Central Repository database.", ex); LOGGER.log(Level.SEVERE, "Failed to connect to Central Repository database.", ex);
setGuidanceMessage(Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), true); setGuidanceMessage(Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), true);
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
return; return;
} }
@ -606,6 +483,7 @@ public class EamDbSettingsDialog extends JDialog {
} catch (EamDbException ex) { } catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, "Failed to connect to Central Repository database.", ex); LOGGER.log(Level.SEVERE, "Failed to connect to Central Repository database.", ex);
setGuidanceMessage(Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), true); setGuidanceMessage(Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), true);
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
return; return;
} }
break; break;
@ -613,6 +491,7 @@ public class EamDbSettingsDialog extends JDialog {
break; break;
} }
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
dispose(); dispose();
}//GEN-LAST:event_bnOkActionPerformed }//GEN-LAST:event_bnOkActionPerformed
@ -620,31 +499,6 @@ public class EamDbSettingsDialog extends JDialog {
dispose(); dispose();
}//GEN-LAST:event_bnCancelActionPerformed }//GEN-LAST:event_bnCancelActionPerformed
private void rdioBnDisabledActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdioBnDisabledActionPerformed
selectedPlatform = EamDbPlatformEnum.DISABLED;
testingStatus = DatabaseTestResult.TESTEDOK;
updateSqliteFields(false);
updatePostgresFields(false);
}//GEN-LAST:event_rdioBnDisabledActionPerformed
private void rdioBnPostgreSQLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdioBnPostgreSQLActionPerformed
selectedPlatform = EamDbPlatformEnum.POSTGRESQL;
testingStatus = DatabaseTestResult.UNTESTED;
updateSqliteFields(false);
updatePostgresFields(true);
}//GEN-LAST:event_rdioBnPostgreSQLActionPerformed
private void rdioBnSQLiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdioBnSQLiteActionPerformed
selectedPlatform = EamDbPlatformEnum.SQLITE;
testingStatus = DatabaseTestResult.UNTESTED;
updateSqliteFields(true);
updatePostgresFields(false);
}//GEN-LAST:event_rdioBnSQLiteActionPerformed
private void tfDatabasePathFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfDatabasePathFocusLost private void tfDatabasePathFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfDatabasePathFocusLost
String fullPath = tfDatabasePath.getText(); String fullPath = tfDatabasePath.getText();
@ -654,35 +508,33 @@ public class EamDbSettingsDialog extends JDialog {
tfDatabasePath.setText(fullPath); tfDatabasePath.setText(fullPath);
}//GEN-LAST:event_tfDatabasePathFocusLost }//GEN-LAST:event_tfDatabasePathFocusLost
/** private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
* Update the fields for the Postgres platform depending on whether the selectedPlatform = (EamDbPlatformEnum) jComboBox1.getSelectedItem();
* Postgres radioButton is enabled. customizeComponents();
* //displayDatabaseSettings(selectedPlatform.equals(EamDbPlatformEnum.POSTGRESQL));
* @param enabled // toggleWaitCursor(jComboBox1.getSelectedItem().equals(EamDbPlatformEnum.POSTGRESQL));
*/ }//GEN-LAST:event_jComboBox1ActionPerformed
private void updatePostgresFields(boolean enabled) {
tbDbHostname.setText(enabled ? dbSettingsPostgres.getHost() : "");
tbDbHostname.setEnabled(enabled);
tbDbPort.setText(enabled ? Integer.toString(dbSettingsPostgres.getPort()) : "");
tbDbPort.setEnabled(enabled);
tbDbName.setText(enabled ? dbSettingsPostgres.getDbName() : "");
tbDbName.setEnabled(enabled);
tbDbUsername.setText(enabled ? dbSettingsPostgres.getUserName() : "");
tbDbUsername.setEnabled(enabled);
jpDbPassword.setText(enabled ? dbSettingsPostgres.getPassword() : "");
jpDbPassword.setEnabled(enabled);
}
/** // private void toggleWaitCursor(boolean off) {
* Update the fields for the SQLite platform depending on whether the // if (!off) {
* SQLite radioButton is enabled. // setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
* // } else {
* @param enabled // setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
*/ // }
private void updateSqliteFields(boolean enabled) { // }
tfDatabasePath.setText(enabled ? dbSettingsSqlite.getFileNameWithPath() : ""); private void displayDatabaseSettings(boolean isPostgres) {
tfDatabasePath.setEnabled(enabled); lbDatabasePath.setVisible(!isPostgres);
bnDatabasePathFileOpen.setEnabled(enabled); tfDatabasePath.setVisible(!isPostgres);
jLabel1.setVisible(!isPostgres);
bnDatabasePathFileOpen.setVisible(!isPostgres);
lbHostName.setVisible(isPostgres);
tbDbHostname.setVisible(isPostgres);
lbPort.setVisible(isPostgres);
tbDbPort.setVisible(isPostgres);
lbUserName.setVisible(isPostgres);
tbDbUsername.setVisible(isPostgres);
lbUserPassword.setVisible(isPostgres);
jpDbPassword.setVisible(isPostgres);
} }
/** /**
@ -697,11 +549,36 @@ public class EamDbSettingsDialog extends JDialog {
Collection<TextPrompt> textPrompts = new ArrayList<>(); Collection<TextPrompt> textPrompts = new ArrayList<>();
textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_hostnameOrIP(), tbDbHostname)); textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_hostnameOrIP(), tbDbHostname));
textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_port(), tbDbPort)); textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_port(), tbDbPort));
textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_dbName(), tbDbName)); // textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_dbName(), tbDbName));
textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_user(), tbDbUsername)); textPrompts.add(new TextPrompt(Bundle.EamDbSettingsDialog_textPrompt_user(), tbDbUsername));
configureTextPrompts(textPrompts); configureTextPrompts(textPrompts);
} }
private void updatePostgresFields(boolean enabled) {
tbDbHostname.setText(enabled ? dbSettingsPostgres.getHost() : "");
tbDbHostname.setEnabled(enabled);
tbDbPort.setText(enabled ? Integer.toString(dbSettingsPostgres.getPort()) : "");
tbDbPort.setEnabled(enabled);
// tbDbName.setText(enabled ? dbSettingsPostgres.getDbName() : "");
// tbDbName.setEnabled(enabled);
tbDbUsername.setText(enabled ? dbSettingsPostgres.getUserName() : "");
tbDbUsername.setEnabled(enabled);
jpDbPassword.setText(enabled ? dbSettingsPostgres.getPassword() : "");
jpDbPassword.setEnabled(enabled);
}
/**
* Update the fields for the SQLite platform depending on whether the SQLite
* radioButton is enabled.
*
* @param enabled
*/
private void updateSqliteFields(boolean enabled) {
tfDatabasePath.setText(enabled ? dbSettingsSqlite.getFileNameWithPath() : "");
tfDatabasePath.setEnabled(enabled);
bnDatabasePathFileOpen.setEnabled(enabled);
}
/** /**
* Register for notifications when the text boxes get updated. * Register for notifications when the text boxes get updated.
*/ */
@ -709,7 +586,7 @@ public class EamDbSettingsDialog extends JDialog {
textBoxes.add(tfDatabasePath); textBoxes.add(tfDatabasePath);
textBoxes.add(tbDbHostname); textBoxes.add(tbDbHostname);
textBoxes.add(tbDbPort); textBoxes.add(tbDbPort);
textBoxes.add(tbDbName); // textBoxes.add(tbDbName);
textBoxes.add(tbDbUsername); textBoxes.add(tbDbUsername);
textBoxes.add(jpDbPassword); textBoxes.add(jpDbPassword);
addDocumentListeners(textBoxes, textBoxChangedListener); addDocumentListeners(textBoxes, textBoxChangedListener);
@ -754,7 +631,7 @@ public class EamDbSettingsDialog extends JDialog {
case POSTGRESQL: case POSTGRESQL:
result = !tbDbHostname.getText().trim().isEmpty() result = !tbDbHostname.getText().trim().isEmpty()
&& !tbDbPort.getText().trim().isEmpty() && !tbDbPort.getText().trim().isEmpty()
&& !tbDbName.getText().trim().isEmpty() // && !tbDbName.getText().trim().isEmpty()
&& !tbDbUsername.getText().trim().isEmpty() && !tbDbUsername.getText().trim().isEmpty()
&& 0 < jpDbPassword.getPassword().length; && 0 < jpDbPassword.getPassword().length;
@ -808,7 +685,7 @@ public class EamDbSettingsDialog extends JDialog {
} }
try { try {
dbSettingsPostgres.setDbName(tbDbName.getText().trim()); dbSettingsPostgres.setDbName(CENTRAL_REPO_DB_NAME);
} catch (EamDbException ex) { } catch (EamDbException ex) {
guidanceText.append(ex.getMessage()); guidanceText.append(ex.getMessage());
result = false; result = false;
@ -831,7 +708,7 @@ public class EamDbSettingsDialog extends JDialog {
case SQLITE: case SQLITE:
try { try {
File databasePath = new File(tfDatabasePath.getText()); File databasePath = new File(tfDatabasePath.getText());
dbSettingsSqlite.setDbName(databasePath.getName()); dbSettingsSqlite.setDbName(CENTRAL_REPO_DB_NAME + CENTRAL_REPO_SQLITE_EXT);
dbSettingsSqlite.setDbDirectory(databasePath.getParent()); dbSettingsSqlite.setDbDirectory(databasePath.getParent());
} catch (EamDbException ex) { } catch (EamDbException ex) {
guidanceText.append(ex.getMessage()); guidanceText.append(ex.getMessage());
@ -850,63 +727,25 @@ public class EamDbSettingsDialog extends JDialog {
* @return true if it's okay, false otherwise. * @return true if it's okay, false otherwise.
*/ */
private boolean valid() { private boolean valid() {
taSetupGuidance.setText(""); return enableOkButton(checkFields());
return enableTestButton(checkFields())
&& enableCreateButton()
&& enableOkButton();
} }
/** /**
* Enable the "Test" button once all fields are valid. * Enable the "OK" button if the db test passed. Disabled defaults to db
* * test passed.
* @return true
*/
@Messages({"EamDbSettingsDialog.validation.mustTest=Once you are statisfied with the database settings, click the Test button to test the database connection, settings, and schema. SQLite should only be used by one examiner at a time.",
"EamDbSettingsDialog.validation.failedConnection=The connection to the database failed. Update the settings and try the Test again."})
private boolean enableTestButton(boolean isValidInput) {
if (selectedPlatform != EamDbPlatformEnum.DISABLED && isValidInput) {
bnTest.setEnabled(true);
if (testingStatus == DatabaseTestResult.UNTESTED) {
setGuidanceMessage(Bundle.EamDbSettingsDialog_validation_mustTest(), false);
} else if (testingStatus == DatabaseTestResult.CONNECTION_FAILED) {
setGuidanceMessage(Bundle.EamDbSettingsDialog_validation_failedConnection(), true);
}
} else {
bnTest.setEnabled(false);
}
return true;
}
/**
* Enable the "Create" button if the db is not created.
*
* @return true if db is created, else false
*/
@Messages({"EamDbSettingsDialog.validation.dbNotCreated=The database does not exist. Click the Create button to create and initialize the database."})
private boolean enableCreateButton() {
if (testingStatus == DatabaseTestResult.SCHEMA_INVALID) {
bnCreateDb.setEnabled(true);
setGuidanceMessage(Bundle.EamDbSettingsDialog_validation_dbNotCreated(), false);
} else {
bnCreateDb.setEnabled(false);
}
return true;
}
/**
* Enable the "OK" button if the db test passed. Disabled defaults to db test passed.
* *
* @return true * @return true
*/ */
@Messages({"EamDbSettingsDialog.validation.finished=Click OK to save your database settings and return to the Options. Or select a different database type."}) @Messages({"EamDbSettingsDialog.validation.finished=Click OK to save your database settings and return to the Options. Or select a different database type."})
private boolean enableOkButton() { private boolean enableOkButton(boolean isValidInput) {
if (testingStatus == DatabaseTestResult.TESTEDOK || selectedPlatform == EamDbPlatformEnum.DISABLED) { if (isValidInput) {
bnOk.setEnabled(true); bnOk.setEnabled(true);
setGuidanceMessage(Bundle.EamDbSettingsDialog_validation_finished(), false); setGuidanceMessage(Bundle.EamDbSettingsDialog_validation_finished(), false);
} else { } else {
bnOk.setEnabled(false); bnOk.setEnabled(false);
} }
return true; return true;
} }
/** /**
@ -937,6 +776,7 @@ public class EamDbSettingsDialog extends JDialog {
clearIcons(); clearIcons();
testingStatus = DatabaseTestResult.UNTESTED; testingStatus = DatabaseTestResult.UNTESTED;
valid(); valid();
} }
} }
@ -949,33 +789,22 @@ public class EamDbSettingsDialog extends JDialog {
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bnCancel; private javax.swing.JButton bnCancel;
private javax.swing.JButton bnCreateDb;
private javax.swing.JButton bnDatabasePathFileOpen; private javax.swing.JButton bnDatabasePathFileOpen;
private javax.swing.ButtonGroup bnGrpDatabasePlatforms; private javax.swing.ButtonGroup bnGrpDatabasePlatforms;
private javax.swing.JButton bnOk; private javax.swing.JButton bnOk;
private javax.swing.JButton bnTest;
private javax.swing.JFileChooser fcDatabasePath; private javax.swing.JFileChooser fcDatabasePath;
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JComboBox<EamDbPlatformEnum> jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPasswordField jpDbPassword; private javax.swing.JPasswordField jpDbPassword;
private javax.swing.JLabel lbCreateIcon;
private javax.swing.JLabel lbDatabaseName;
private javax.swing.JLabel lbDatabasePath; private javax.swing.JLabel lbDatabasePath;
private javax.swing.JLabel lbHostName; private javax.swing.JLabel lbHostName;
private javax.swing.JLabel lbPort; private javax.swing.JLabel lbPort;
private javax.swing.JLabel lbTestIcon;
private javax.swing.JLabel lbUserName; private javax.swing.JLabel lbUserName;
private javax.swing.JLabel lbUserPassword; private javax.swing.JLabel lbUserPassword;
private javax.swing.JPanel pnButtons; private javax.swing.JPanel pnButtons;
private javax.swing.JPanel pnDatabaseConnectionSettings;
private javax.swing.JPanel pnPostgreSQLSettings;
private javax.swing.JPanel pnSQLiteSettings; private javax.swing.JPanel pnSQLiteSettings;
private javax.swing.JPanel pnSetupGuidance;
private javax.swing.JRadioButton rdioBnDisabled;
private javax.swing.JRadioButton rdioBnPostgreSQL;
private javax.swing.JRadioButton rdioBnSQLite;
private javax.swing.JTextArea taSetupGuidance;
private javax.swing.JTextField tbDbHostname; private javax.swing.JTextField tbDbHostname;
private javax.swing.JTextField tbDbName;
private javax.swing.JTextField tbDbPort; private javax.swing.JTextField tbDbPort;
private javax.swing.JTextField tbDbUsername; private javax.swing.JTextField tbDbUsername;
private javax.swing.JTextField tfDatabasePath; private javax.swing.JTextField tfDatabasePath;

View File

@ -25,6 +25,10 @@
<Component id="pnDatabaseContentButtons" max="32767" attributes="0"/> <Component id="pnDatabaseContentButtons" max="32767" attributes="0"/>
<Component id="tbOops" alignment="1" max="32767" attributes="0"/> <Component id="tbOops" alignment="1" max="32767" attributes="0"/>
<Component id="pnDatabaseConfiguration" max="32767" attributes="0"/> <Component id="pnDatabaseConfiguration" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jCheckBox1" min="-2" pref="186" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -33,13 +37,14 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/> <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="pnDatabaseConfiguration" min="-2" max="-2" attributes="0"/> <Component id="pnDatabaseConfiguration" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="tbOops" min="-2" max="-2" attributes="0"/> <Component id="tbOops" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="pnDatabaseContentButtons" min="-2" pref="50" max="-2" attributes="0"/> <Component id="pnDatabaseContentButtons" min="-2" pref="50" max="-2" attributes="0"/>
<EmptySpace min="0" pref="18" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -240,5 +245,15 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="GlobalSettingsPanel.jCheckBox1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox1ActionPerformed"/>
</Events>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -29,6 +29,7 @@ import org.sleuthkit.autopsy.events.AutopsyEvent;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum;
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum.DISABLED;
import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings;
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
@ -85,6 +86,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
bnManageTags = new javax.swing.JButton(); bnManageTags = new javax.swing.JButton();
bnManageTypes = new javax.swing.JButton(); bnManageTypes = new javax.swing.JButton();
tbOops = new javax.swing.JTextField(); tbOops = new javax.swing.JTextField();
jCheckBox1 = new javax.swing.JCheckBox();
setName(""); // NOI18N setName(""); // NOI18N
@ -198,6 +200,13 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
tbOops.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.tbOops.text")); // NOI18N tbOops.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.tbOops.text")); // NOI18N
tbOops.setBorder(null); tbOops.setBorder(null);
org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.jCheckBox1.text")); // NOI18N
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
@ -207,19 +216,23 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tbOops, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tbOops, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap() .addComponent(jCheckBox1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 18, Short.MAX_VALUE)) .addContainerGap())
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -243,6 +256,12 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
load(); // reload db settings content and update buttons load(); // reload db settings content and update buttons
}//GEN-LAST:event_bnDbConfigureActionPerformed }//GEN-LAST:event_bnDbConfigureActionPerformed
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
//if saved setting is disabled checkbox should be disabled already
enableDatabaseConfigureButton(jCheckBox1.isSelected());
enableButtonSubComponents(jCheckBox1.isSelected() && !EamDbPlatformEnum.getSelectedPlatform().equals(DISABLED));
}//GEN-LAST:event_jCheckBox1ActionPerformed
@Override @Override
@Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."}) @Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
public void load() { public void load() {
@ -270,7 +289,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
lbDbPlatformValue.setText(EamDbPlatformEnum.DISABLED.toString()); lbDbPlatformValue.setText(EamDbPlatformEnum.DISABLED.toString());
lbDbNameValue.setText(""); lbDbNameValue.setText("");
lbDbLocationValue.setText(""); lbDbLocationValue.setText("");
enableDatabaseConfigureButton(true); enableDatabaseConfigureButton(jCheckBox1.isSelected());
tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure()); tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure());
break; break;
} }
@ -347,8 +366,8 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* @return True * @return True
*/ */
private boolean enableAllSubComponents(Boolean enable) { private boolean enableAllSubComponents(Boolean enable) {
enableDatabaseConfigureButton(enable); enableDatabaseConfigureButton(jCheckBox1.isSelected() && enable);
enableButtonSubComponents(enable); enableButtonSubComponents(jCheckBox1.isSelected() && enable);
return true; return true;
} }
@ -359,9 +378,17 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* *
* @return True * @return True
*/ */
private boolean enableDatabaseConfigureButton(Boolean enable) { private void enableDatabaseConfigureButton(Boolean enable) {
pnDatabaseConfiguration.setEnabled(enable);
pnDatabaseContentButtons.setEnabled(enable);
bnDbConfigure.setEnabled(enable); bnDbConfigure.setEnabled(enable);
return true; lbDbLocationLabel.setEnabled(enable);
lbDbLocationValue.setEnabled(enable);
lbDbNameLabel.setEnabled(enable);
lbDbNameValue.setEnabled(enable);
lbDbPlatformTypeLabel.setEnabled(enable);
lbDbPlatformValue.setEnabled(enable);
tbOops.setEnabled(enable);
} }
/** /**
@ -384,6 +411,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
private javax.swing.JButton bnImportDatabase; private javax.swing.JButton bnImportDatabase;
private javax.swing.JButton bnManageTags; private javax.swing.JButton bnManageTags;
private javax.swing.JButton bnManageTypes; private javax.swing.JButton bnManageTypes;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JLabel lbDbLocationLabel; private javax.swing.JLabel lbDbLocationLabel;
private javax.swing.JLabel lbDbLocationValue; private javax.swing.JLabel lbDbLocationValue;
private javax.swing.JLabel lbDbNameLabel; private javax.swing.JLabel lbDbNameLabel;