2198 Names made more consistant, other minor clean up

This commit is contained in:
William Schaefer 2017-02-03 11:30:19 -05:00
parent c33a84179c
commit f81a8fd173
5 changed files with 16 additions and 20 deletions

View File

@ -28,6 +28,7 @@ import java.util.List;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JRadioButton; import javax.swing.JRadioButton;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
import org.sleuthkit.autopsy.ingest.IngestOptionsPanel; import org.sleuthkit.autopsy.ingest.IngestOptionsPanel;
import org.sleuthkit.autopsy.ingest.IngestProfileMap; import org.sleuthkit.autopsy.ingest.IngestProfileMap;
@ -39,9 +40,13 @@ import org.sleuthkit.autopsy.ingest.IngestProfileMap.IngestProfile;
*/ */
final class IngestProfileSelectionPanel extends JPanel implements ItemListener { final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
private static final String CUSTOM_SETTINGS_DISPLAY_NAME = "Custom Settings"; @Messages({"IngestProfileSelectionPanel.customSettings.name=Custom Settings",
private static final String CUSTOM_SETTINGS_DESCRIPTION = "configure individual module settings in next step of wizard"; //WJS-TODO these should be @Message "IngestProfileSelectionPanel.name=Ingest Profile Selection",
private final RunIngestModuleWizardPanel1 wizardPanel; "IngestProfileSelectionPanel.customSettings.description=configure individual module settings in next step of wizard"})
private static final String CUSTOM_SETTINGS_DISPLAY_NAME = Bundle.IngestProfileSelectionPanel_customSettings_name();
private static final String CUSTOM_SETTINGS_DESCRIPTION = Bundle.IngestProfileSelectionPanel_customSettings_description();
private final RunIngestModulesWizardPanel1 wizardPanel;
private String selectedProfile; private String selectedProfile;
private List<IngestProfile> profiles = Collections.emptyList(); private List<IngestProfile> profiles = Collections.emptyList();
@ -51,13 +56,13 @@ final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
* @param panel - the WizardPanel which contains this panel * @param panel - the WizardPanel which contains this panel
* @param lastSelectedProfile - the profile that will be selected initially * @param lastSelectedProfile - the profile that will be selected initially
*/ */
IngestProfileSelectionPanel(RunIngestModuleWizardPanel1 panel, String lastSelectedProfile) { IngestProfileSelectionPanel(RunIngestModulesWizardPanel1 panel, String lastSelectedProfile) {
initComponents(); initComponents();
//WJS-TODO figure out how to get width of writable area, if text length greater than width. Trim text to width minus 3 chars in length and then add ... to the end //WJS-TODO figure out how to get width of writable area, if text length greater than width. Trim text to width minus 3 chars in length and then add ... to the end
wizardPanel = panel; wizardPanel = panel;
selectedProfile = lastSelectedProfile; selectedProfile = lastSelectedProfile;
populateListOfCheckboxes(); populateListOfCheckboxes();
this.setName("Ingest Profile Selection"); //WJS-TODO @Messages this this.setName(Bundle.IngestProfileSelectionPanel_name());
} }
/** /**
@ -92,15 +97,6 @@ final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
*/ */
private void addRadioButton(String profileDisplayName, String profileContextName, String profileDesc) { private void addRadioButton(String profileDisplayName, String profileContextName, String profileDesc) {
String displayText = profileDisplayName + " - " + profileDesc; String displayText = profileDisplayName + " - " + profileDesc;
int width = profileListScrollPane.getWidth();
if (width > 3) {
if (displayText.length() > width) {
String ellipses = "...";
displayText = displayText.substring(0, width - ellipses.length()) + ellipses;
}
} else {
System.out.println("NOT KNOWN BEFORE DRAWN USE DIFFERENT WAY TO GET WIDTH"); //WJS-TODO remove this when working
}
JRadioButton myRadio = new JRadioButton(displayText); //NON-NLS JRadioButton myRadio = new JRadioButton(displayText); //NON-NLS
myRadio.setName(profileContextName); myRadio.setName(profileContextName);
myRadio.setToolTipText(profileDesc); myRadio.setToolTipText(profileDesc);

View File

@ -87,7 +87,7 @@ public final class RunIngestModulesAction extends AbstractAction {
*/ */
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
WizardDescriptor wiz = new WizardDescriptor(new RunIngestModuleWizardIterator()); WizardDescriptor wiz = new WizardDescriptor(new RunIngestModulesWizardIterator());
// {0} will be replaced by WizardDescriptor.Panel.getComponent().getName() // {0} will be replaced by WizardDescriptor.Panel.getComponent().getName()
wiz.setTitleFormat(new MessageFormat("{0}")); wiz.setTitleFormat(new MessageFormat("{0}"));
wiz.setTitle(Bundle.RunIngestModulesAction_name()); wiz.setTitle(Bundle.RunIngestModulesAction_name());

View File

@ -32,7 +32,7 @@ import org.sleuthkit.autopsy.ingest.IngestProfileMap;
* Iterator class for creating a wizard for run ingest modules. * Iterator class for creating a wizard for run ingest modules.
* *
*/ */
final class RunIngestModuleWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> { final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
private int index; private int index;
@ -49,10 +49,10 @@ final class RunIngestModuleWizardIterator implements WizardDescriptor.Iterator<W
panels = new ArrayList<>(); panels = new ArrayList<>();
TreeMap<String, IngestProfileMap.IngestProfile> profileMap = new IngestProfileMap().getIngestProfileMap(); TreeMap<String, IngestProfileMap.IngestProfile> profileMap = new IngestProfileMap().getIngestProfileMap();
if (!profileMap.isEmpty()) { if (!profileMap.isEmpty()) {
panels.add(new RunIngestModuleWizardPanel1()); panels.add(new RunIngestModulesWizardPanel1());
} }
panels.add(new RunIngestModuleWizardPanel2()); panels.add(new RunIngestModulesWizardPanel2());
String[] steps = new String[panels.size()]; String[] steps = new String[panels.size()];
for (int i = 0; i < panels.size(); i++) { for (int i = 0; i < panels.size(); i++) {
Component c = panels.get(i).getComponent(); Component c = panels.get(i).getComponent();

View File

@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings;
* selection panel and is only created when profiles exist. * selection panel and is only created when profiles exist.
* *
*/ */
class RunIngestModuleWizardPanel1 extends EarlyFinishWizardDescriptorPanel { class RunIngestModulesWizardPanel1 extends EarlyFinishWizardDescriptorPanel {
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
private final static String PROP_LASTPROFILE_NAME = "RIMW_LASTPROFILE_NAME"; //NON-NLS private final static String PROP_LASTPROFILE_NAME = "RIMW_LASTPROFILE_NAME"; //NON-NLS

View File

@ -24,7 +24,7 @@ import org.openide.util.HelpCtx;
import org.sleuthkit.autopsy.ingest.IngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
class RunIngestModuleWizardPanel2 extends EarlyFinishWizardDescriptorPanel { class RunIngestModulesWizardPanel2 extends EarlyFinishWizardDescriptorPanel {
/** /**
* The visual ingestJobSettingsPanel that displays this panel. If you need * The visual ingestJobSettingsPanel that displays this panel. If you need