diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-02-08 15:17:48 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-02-08 15:17:48 +0100 |
| commit | 8849a5f9cdea4c5cabc2216b38f35274375b4c05 (patch) | |
| tree | 39f0a2962629f31d03288001d71b987fbb5ef62c /src/main/java/com/c2kernel/gui/EntityFinder.java | |
| parent | 1e7f63219e88b36d788dda8cc4d07c13f840d82d (diff) | |
Added bouncy bar to the status pane to make people feel better when the
system is busy.
Diffstat (limited to 'src/main/java/com/c2kernel/gui/EntityFinder.java')
| -rw-r--r-- | src/main/java/com/c2kernel/gui/EntityFinder.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/com/c2kernel/gui/EntityFinder.java b/src/main/java/com/c2kernel/gui/EntityFinder.java index 71903eb..7a16f26 100644 --- a/src/main/java/com/c2kernel/gui/EntityFinder.java +++ b/src/main/java/com/c2kernel/gui/EntityFinder.java @@ -110,7 +110,6 @@ public class EntityFinder extends Box implements Runnable { findNextButton.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- MainFrame.status.setText("Navigating to next match");
nextMatch();
}
});
@@ -152,19 +151,25 @@ public class EntityFinder extends Box implements Runnable { @Override
public void run() {
Thread.currentThread().setName("Entity Search");
- MainFrame.status.setText("Searching. Please Wait");
+ MainFrame.progress.startBouncing("Searching. Please Wait");
findButton.setEnabled(false); findNextButton.setEnabled(false);
String searchTerm = inputField.getText();
if (searchTerm.length() == 0) return; // don't allow null searches
findNextButton.setEnabled(false);
- matches = lookup.search(rootNode,inputField.getText());
+ String term = inputField.getText();
+// The following block does property searching when the field contains a colon, but that returns EntityPaths, which the tree can't handle
+// int colonPos = term.indexOf(':');
+// if (colonPos > 0)
+// matches = lookup.search(rootNode,term.substring(0, colonPos), term.substring(colonPos+1));
+// else
+ matches = lookup.search(rootNode,term);
if (!matches.hasMoreElements()) {
- MainFrame.status.setText("No results");
+ MainFrame.progress.stopBouncing("No results");
currentConsumer.push(searchTerm); // for subscribers who don't care if it exists
findButton.setEnabled(true);
return;
}
- MainFrame.status.setText("Selecting first match.");
+ MainFrame.progress.stopBouncing("Selecting first match.");
nextMatch();
}
|
