Changeset 830
- Timestamp:
- 02/04/14 23:11:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r827 r830 611 611 _Agent = agent; 612 612 613 Thread t = new Thread(_Agent); 613 Thread.UncaughtExceptionHandler h = new Thread.UncaughtExceptionHandler() { 614 public void uncaughtException(Thread th, Throwable ex) { 615 616 MessageBay.errorMessage("Error occurred in Action: " + th.getName()); 617 ex.printStackTrace(); 618 619 stopAgent(); 620 _Agent = null; 621 } 622 }; 623 624 Thread t = new Thread(_Agent,nameWithCorrectCase); 625 614 626 t.setPriority(Thread.MIN_PRIORITY); 615 627 t.setUncaughtExceptionHandler(h); 628 616 629 if (FreeItems.textOnlyAttachedToCursor()) { 617 630 itemParam = FreeItems.getItemAttachedToCursor(); … … 635 648 // background 636 649 t.run(); 637 String result = _Agent.toString(); 638 // Attach the result to the cursor 639 if (FreeItems.textOnlyAttachedToCursor()) { 650 if (_Agent != null) { 651 String result = _Agent.toString(); 652 // Attach the result to the cursor 653 if (FreeItems.textOnlyAttachedToCursor()) { 640 654 Item resultItem = FreeItems.getItemAttachedToCursor(); 641 655 resultItem.setText(result); 656 } 657 // if there is a completion frame, then display it to the user 642 658 } 643 // if there is a completion frame, then display it to the user644 659 } else { 645 660 t.start(); 646 if (_Agent .hasResultFrame()) {661 if (_Agent != null && _Agent.hasResultFrame()) { 647 662 // TODO We want to be able to navigate through the frames as 648 663 // the results are loading
Note:
See TracChangeset
for help on using the changeset viewer.