mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
2774 added organization choosing to new case wizards
This commit is contained in:
parent
b87e6d6796
commit
670d6d668f
@ -48,20 +48,6 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
*/
|
||||
public NewCaseVisualPanel2() {
|
||||
initComponents();
|
||||
try {
|
||||
this.dbManager = EamDb.getInstance();
|
||||
} catch (EamDbException ex) {
|
||||
dbManager = null;
|
||||
}
|
||||
if (dbManager == null) {
|
||||
comboBoxOrgName.setEnabled(false);
|
||||
bnNewOrganization.setEnabled(false);
|
||||
lbPointOfContactNameText.setEnabled(false);
|
||||
lbPointOfContactEmailText.setEnabled(false);
|
||||
lbPointOfContactPhoneText.setEnabled(false);
|
||||
} else {
|
||||
loadOrganizationData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,6 +61,26 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
return NbBundle.getMessage(this.getClass(), "NewCaseVisualPanel2.getName.text");
|
||||
}
|
||||
|
||||
void setUpOrganization() {
|
||||
try {
|
||||
this.dbManager = EamDb.getInstance();
|
||||
} catch (EamDbException ex) {
|
||||
dbManager = null;
|
||||
}
|
||||
boolean cREnabled = (dbManager != null);
|
||||
comboBoxOrgName.setEnabled(cREnabled);
|
||||
bnNewOrganization.setEnabled(cREnabled);
|
||||
lbPointOfContactNameText.setEnabled(cREnabled);
|
||||
lbPointOfContactEmailText.setEnabled(cREnabled);
|
||||
lbPointOfContactPhoneText.setEnabled(cREnabled);
|
||||
if (cREnabled) {
|
||||
loadOrganizationData();
|
||||
} else {
|
||||
selectedOrg = null;
|
||||
clearOrganization();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
@ -213,10 +219,7 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
if ("".equals(orgName)) {
|
||||
selectedOrg = null;
|
||||
lbPointOfContactNameText.setText("");
|
||||
lbPointOfContactEmailText.setText("");
|
||||
lbPointOfContactPhoneText.setText("");
|
||||
clearOrganization();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -251,19 +254,16 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
comboBoxOrgName.addItem(org.getName());
|
||||
});
|
||||
} catch (EamDbException ex) {
|
||||
|
||||
selectedOrg = null;
|
||||
}
|
||||
|
||||
if (!orgs.isEmpty() && null != selectedOrg) {
|
||||
if (null != selectedOrg) {
|
||||
comboBoxOrgName.setSelectedItem(selectedOrg.getName());
|
||||
lbPointOfContactNameText.setText(selectedOrg.getPocName());
|
||||
lbPointOfContactEmailText.setText(selectedOrg.getPocEmail());
|
||||
lbPointOfContactPhoneText.setText(selectedOrg.getPocPhone());
|
||||
} else {
|
||||
comboBoxOrgName.setSelectedItem("");
|
||||
lbPointOfContactNameText.setText("");
|
||||
lbPointOfContactEmailText.setText("");
|
||||
lbPointOfContactPhoneText.setText("");
|
||||
clearOrganization();
|
||||
}
|
||||
}
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
@ -283,6 +283,13 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
private javax.swing.JLabel optionalLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private void clearOrganization() {
|
||||
comboBoxOrgName.setSelectedItem("");
|
||||
lbPointOfContactNameText.setText("");
|
||||
lbPointOfContactEmailText.setText("");
|
||||
lbPointOfContactPhoneText.setText("");
|
||||
}
|
||||
|
||||
String getCaseNumber() {
|
||||
return caseNumberTextField.getText();
|
||||
}
|
||||
@ -291,4 +298,13 @@ class NewCaseVisualPanel2 extends javax.swing.JPanel {
|
||||
return examinerTextField.getText();
|
||||
}
|
||||
|
||||
String getOrganization() {
|
||||
if (selectedOrg != null) {
|
||||
return selectedOrg.getName();
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ class NewCaseWizardPanel2 implements WizardDescriptor.ValidatingPanel<WizardDesc
|
||||
if (component == null) {
|
||||
component = new NewCaseVisualPanel2();
|
||||
}
|
||||
component.setUpOrganization();
|
||||
return component;
|
||||
}
|
||||
|
||||
@ -137,9 +138,9 @@ class NewCaseWizardPanel2 implements WizardDescriptor.ValidatingPanel<WizardDesc
|
||||
*/
|
||||
@Override
|
||||
public void storeSettings(WizardDescriptor settings) {
|
||||
NewCaseVisualPanel2 currentComponent = getComponent();
|
||||
settings.putProperty("caseNumber", currentComponent.getCaseNumber()); //NON-NLS
|
||||
settings.putProperty("caseExaminer", currentComponent.getExaminer()); //NON-NLS
|
||||
settings.putProperty("caseNumber", component.getCaseNumber()); //NON-NLS
|
||||
settings.putProperty("caseExaminer", component.getExaminer()); //NON-NLS
|
||||
settings.putProperty("caseOrganization", component.getOrganization()); //NON-NLS
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user