mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
2173 fix selection listener for disabling / enabling ok button
This commit is contained in:
parent
3c3d6699c3
commit
94d833b56f
@ -76,6 +76,7 @@
|
|||||||
<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/casemodule/Bundle.properties" key="OpenRecentCasePanel.openButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="OpenRecentCasePanel.openButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openButtonActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openButtonActionPerformed"/>
|
||||||
|
@ -60,7 +60,7 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
|
|||||||
public void valueChanged(ListSelectionEvent e) {
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
//enable the ok button when something is selected
|
//enable the ok button when something is selected
|
||||||
if (!e.getValueIsAdjusting()){
|
if (!e.getValueIsAdjusting()){
|
||||||
openButton.setEnabled(e.getFirstIndex()>=0);
|
openButton.setEnabled(imagesTable.getSelectedRowCount() > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -101,7 +101,6 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
|
|||||||
imagesTable.getColumnModel().getColumn(0).setPreferredWidth((int) (.30 * width));
|
imagesTable.getColumnModel().getColumn(0).setPreferredWidth((int) (.30 * width));
|
||||||
imagesTable.getColumnModel().getColumn(1).setPreferredWidth((int) (.70 * width));
|
imagesTable.getColumnModel().getColumn(1).setPreferredWidth((int) (.70 * width));
|
||||||
// If there are any images, let's select the first one
|
// If there are any images, let's select the first one
|
||||||
openButton.setEnabled(false);
|
|
||||||
if (imagesTable.getRowCount() > 0) {
|
if (imagesTable.getRowCount() > 0) {
|
||||||
imagesTable.setRowSelectionInterval(0, 0);
|
imagesTable.setRowSelectionInterval(0, 0);
|
||||||
}
|
}
|
||||||
@ -262,6 +261,7 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
|
|||||||
cancelButton.setText(org.openide.util.NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.cancelButton.text")); // NOI18N
|
cancelButton.setText(org.openide.util.NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.cancelButton.text")); // NOI18N
|
||||||
|
|
||||||
openButton.setText(org.openide.util.NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.openButton.text")); // NOI18N
|
openButton.setText(org.openide.util.NbBundle.getMessage(OpenRecentCasePanel.class, "OpenRecentCasePanel.openButton.text")); // NOI18N
|
||||||
|
openButton.setEnabled(false);
|
||||||
openButton.addActionListener(new java.awt.event.ActionListener() {
|
openButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
openButtonActionPerformed(evt);
|
openButtonActionPerformed(evt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user