Skip to content
Snippets Groups Projects
Commit 0c64501b authored by adam-m's avatar adam-m
Browse files

Simplify code - remove null listener, listener not needed, service syncs up on next start.

parent 1b6e41af
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,6 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer { ...@@ -52,7 +52,6 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
private KeywordSearchListsXML loader; private KeywordSearchListsXML loader;
private KeywordListsTableModel listsTableModel; private KeywordListsTableModel listsTableModel;
private KeywordsTableModel keywordsTableModel; private KeywordsTableModel keywordsTableModel;
private ActionListener ingestListener;
private ActionListener searchListener; private ActionListener searchListener;
private boolean ingestRunning; private boolean ingestRunning;
...@@ -176,14 +175,13 @@ else if(changed.equals(IngestModuleEvent.STOPPED.toString() ) && ...@@ -176,14 +175,13 @@ else if(changed.equals(IngestModuleEvent.STOPPED.toString() ) &&
private void initIngest(boolean running) { private void initIngest(boolean running) {
ActionListener[] current = searchAddButton.getActionListeners(); ActionListener[] current = searchAddButton.getActionListeners();
for (int i = 0; i < current.length; i++) { for (int i = 0; i < current.length; i++) {
if (current[i].equals(ingestListener) || current[i].equals(searchListener)) { if (current[i].equals(searchListener)) {
searchAddButton.removeActionListener(current[i]); searchAddButton.removeActionListener(current[i]);
} }
} }
if (running) { if (running) {
ingestRunning = true; ingestRunning = true;
searchAddButton.setText("Add to Ingest"); searchAddButton.setText("Add to Ingest");
searchAddButton.addActionListener(ingestListener);
listsTableModel.resync(); listsTableModel.resync();
ingestIndexLabel.setText("Ingest is ongoing. Results will appear as the index is populated."); ingestIndexLabel.setText("Ingest is ongoing. Results will appear as the index is populated.");
} else { } else {
...@@ -249,16 +247,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ...@@ -249,16 +247,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(searchAddButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 220, Short.MAX_VALUE)
.addComponent(manageListsButton)
.addContainerGap())
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(ingestIndexLabel) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addContainerGap(327, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(searchAddButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 220, Short.MAX_VALUE)
.addComponent(manageListsButton))
.addGroup(layout.createSequentialGroup()
.addComponent(ingestIndexLabel)
.addGap(0, 317, Short.MAX_VALUE)))
.addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment