|
43 | 43 | import com.google.gwt.user.client.ui.HTMLTable; |
44 | 44 | import com.google.gwt.user.client.ui.Label; |
45 | 45 | import com.google.gwt.user.client.ui.PopupPanel; |
46 | | -import com.google.gwt.user.client.ui.PopupPanel.PositionCallback; |
47 | 46 | import com.google.gwt.user.client.ui.ResizeComposite; |
48 | 47 | import com.google.gwt.user.client.ui.ScrollPanel; |
49 | 48 | import com.google.gwt.user.client.ui.SplitLayoutPanel; |
50 | 49 | import com.google.gwt.user.client.ui.TextBox; |
51 | 50 | import com.google.gwt.user.client.ui.Tree; |
52 | 51 | import com.google.gwt.user.client.ui.TreeItem; |
53 | 52 | import com.google.gwt.user.client.ui.VerticalPanel; |
| 53 | +import com.google.gwt.user.client.ui.PopupPanel.PositionCallback; |
54 | 54 |
|
55 | 55 | public class ModeEdit extends ResizeComposite implements KeyUpHandler, |
56 | 56 | OpenHandler<TreeItem>, CloseHandler<TreeItem>, |
@@ -279,7 +279,8 @@ public void onSuccess() { |
279 | 279 | // propView.logNodeRecursive(0, "em.em.cb", true); |
280 | 280 | } |
281 | 281 | tree.resetState(); |
282 | | - if (Log.on) tree.logTree(log); |
| 282 | + if (Log.on) |
| 283 | + tree.logTree(log); |
283 | 284 |
|
284 | 285 | updateTimer.start(); |
285 | 286 | log.finish(); |
@@ -388,7 +389,9 @@ public void call(PartialTrees results) { |
388 | 389 | List<ViewProp> viewProps = new ArrayList<ViewProp>( |
389 | 390 | loadedProps.get(node.id)); |
390 | 391 | for (ViewProp viewProp : viewProps) { |
391 | | - log.logln("prossesing ViewProp:" + viewProp); |
| 392 | + log |
| 393 | + .logln("prossesing ViewProp:" |
| 394 | + + viewProp); |
392 | 395 | updateNode(viewProp, node, results); |
393 | 396 | } |
394 | 397 | } else if (node instanceof Argument) { |
@@ -743,24 +746,30 @@ public void call(PartialTrees trees) { |
743 | 746 | } |
744 | 747 | }); |
745 | 748 | } else { |
746 | | - ArgMap.messageTimed( |
747 | | - "Cannot link to existing proposition when proposition currently being edited has children", |
748 | | - MessageType.ERROR); |
| 749 | + ArgMap |
| 750 | + .messageTimed( |
| 751 | + "Cannot link to existing proposition when proposition currently being edited has children", |
| 752 | + MessageType.ERROR); |
749 | 753 | } |
750 | 754 | } |
751 | 755 |
|
752 | | - public void sideSearch(ViewPropEdit viewProp) { |
| 756 | + private void cancelSideSearch() { |
753 | 757 | if (sideSearch != null) { |
754 | 758 | sideSearch.cancelSearch(); |
755 | 759 | sideSearch = null; |
756 | 760 | } |
| 761 | + hideSearchBox(); |
| 762 | + } |
| 763 | + |
| 764 | + public void sideSearch(ViewPropEdit viewProp) { |
| 765 | + cancelSideSearch(); |
757 | 766 |
|
758 | 767 | sideSearchResults.removeAllRows(); |
759 | 768 | sideSearchContinueButton.setVisible(false); |
760 | 769 |
|
761 | 770 | String searchString = viewProp.getTextAreaContent().trim(); |
762 | 771 | if (!searchString.equals("") && viewProp.getChildCount() == 0 |
763 | | - && !viewProp.deleted) { |
| 772 | + /* && !viewProp.deleted */) { |
764 | 773 | List<Long> filterIDs = new ArrayList<Long>(); |
765 | 774 | filterIDs.addAll(viewProp.getAncestorIDs()); |
766 | 775 | if (viewProp.getParent() != null) { |
@@ -1040,7 +1049,8 @@ public void run() { |
1040 | 1049 | } |
1041 | 1050 |
|
1042 | 1051 | schedule(currentFrequency); |
1043 | | - if (on) getUpdatesAndApply(); |
| 1052 | + if (on) |
| 1053 | + getUpdatesAndApply(); |
1044 | 1054 | } |
1045 | 1055 |
|
1046 | 1056 | public void start() { |
@@ -1129,9 +1139,17 @@ public void setViewProp(ViewPropEdit viewProp) { |
1129 | 1139 | } |
1130 | 1140 | } |
1131 | 1141 |
|
| 1142 | + public void cancelSearch() { |
| 1143 | + viewProp = null; |
| 1144 | + cancelSideSearch(); |
| 1145 | + cancel(); |
| 1146 | + } |
| 1147 | + |
1132 | 1148 | @Override |
1133 | 1149 | public void run() { |
1134 | | - sideSearch(viewProp); |
| 1150 | + if (viewProp != null) { |
| 1151 | + sideSearch(viewProp); |
| 1152 | + } |
1135 | 1153 | } |
1136 | 1154 |
|
1137 | 1155 | @Override |
@@ -1302,8 +1320,8 @@ public void onOpen(OpenEvent<TreeItem> event) { |
1302 | 1320 | if (!source.isLoaded()) { |
1303 | 1321 | loadFromServer(source, 2, 1); |
1304 | 1322 | } else { |
1305 | | - List<ViewNode> list = new ArrayList<ViewNode>( |
1306 | | - source.getChildCount()); |
| 1323 | + List<ViewNode> list = new ArrayList<ViewNode>(source |
| 1324 | + .getChildCount()); |
1307 | 1325 | for (int i = 0; i < source.getChildCount(); i++) { |
1308 | 1326 | if (!source.getChild(i).isLoaded()) { |
1309 | 1327 | list.add(source.getChild(i)); |
|
0 commit comments