| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.common.ui.client.widgets.search; |
| 17 |
|
|
| 18 |
|
import java.util.List; |
| 19 |
|
|
| 20 |
|
import org.kuali.student.common.search.dto.SearchRequest; |
| 21 |
|
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
| 22 |
|
import org.kuali.student.common.ui.client.mvc.Callback; |
| 23 |
|
import org.kuali.student.common.ui.client.widgets.KSLightBox; |
| 24 |
|
import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations; |
| 25 |
|
import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations.ButtonEnum; |
| 26 |
|
import org.kuali.student.common.ui.client.widgets.field.layout.button.ActionCancelGroup; |
| 27 |
|
import org.kuali.student.common.ui.client.widgets.field.layout.button.ButtonGroup; |
| 28 |
|
import org.kuali.student.common.ui.client.widgets.layout.VerticalFlowPanel; |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 42 (42) |
Complexity: 11 |
Complexity Density: 0.38 |
|
| 30 |
|
public class AdvancedSearchWindow { |
| 31 |
|
|
| 32 |
|
private VerticalFlowPanel layout = new VerticalFlowPanel(); |
| 33 |
|
private KSLightBox dialog; |
| 34 |
|
private SearchPanel searchPanel; |
| 35 |
|
|
| 36 |
|
private ActionCancelGroup actionCancelButtons = new ActionCancelGroup(ButtonEnumerations.SearchCancelEnum.SEARCH, ButtonEnumerations.SearchCancelEnum.CANCEL); |
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
0
|
public List<SelectedResults> getSelectedValues() {... |
| 39 |
0
|
return searchPanel.getSelectedValues(); |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 42 |
0
|
public SearchRequest getSearchRequest() {... |
| 43 |
0
|
return searchPanel.getSearchRequest(); |
| 44 |
|
} |
| 45 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 46 |
0
|
public String getSelectedLookupName() {... |
| 47 |
0
|
return searchPanel.getSelectedLookupName(); |
| 48 |
|
} |
| 49 |
|
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
|
| 50 |
0
|
public AdvancedSearchWindow(String title, SearchPanel panel){... |
| 51 |
|
|
| 52 |
0
|
actionCancelButtons.addStyleName("KS-Advanced-Search-Buttons"); |
| 53 |
0
|
addCancelCompleteCallback(null); |
| 54 |
0
|
searchPanel = panel; |
| 55 |
0
|
searchPanel.setActionCancelButtonGroup(actionCancelButtons); |
| 56 |
0
|
searchPanel.setupButtons(); |
| 57 |
|
|
| 58 |
|
|
| 59 |
0
|
dialog = new KSLightBox(); |
| 60 |
0
|
layout.addStyleName("KS-Advanced-Search-Window"); |
| 61 |
0
|
SectionTitle sectionTitle = SectionTitle.generateH2Title(title); |
| 62 |
0
|
layout.add(sectionTitle); |
| 63 |
0
|
layout.add(panel); |
| 64 |
0
|
layout.add(actionCancelButtons); |
| 65 |
|
|
| 66 |
0
|
dialog.setMaxHeight(620); |
| 67 |
0
|
ButtonGroup buttons = panel.getButtons(); |
| 68 |
0
|
buttons.removeFromParent(); |
| 69 |
0
|
dialog.addButtonGroup(buttons); |
| 70 |
|
} |
| 71 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 72 |
0
|
public void show(){... |
| 73 |
0
|
searchPanel.setupSearch(); |
| 74 |
0
|
dialog.setWidget(layout); |
| 75 |
0
|
dialog.setMaxHeight(600); |
| 76 |
0
|
dialog.show(); |
| 77 |
|
} |
| 78 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
0
|
public void hide(){... |
| 80 |
0
|
dialog.hide(); |
| 81 |
|
} |
| 82 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public void addCancelCompleteCallback(final Callback<Boolean> callback){... |
| 84 |
|
|
| 85 |
0
|
actionCancelButtons.addCallback(new Callback<ButtonEnumerations.ButtonEnum>(){ |
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 86 |
0
|
@Override... |
| 87 |
|
public void exec(ButtonEnum result) { |
| 88 |
0
|
if (result == ButtonEnumerations.SearchCancelEnum.CANCEL) { |
| 89 |
0
|
if (callback != null) { |
| 90 |
0
|
callback.exec(true); |
| 91 |
|
} |
| 92 |
0
|
dialog.hide(); |
| 93 |
|
} |
| 94 |
|
} |
| 95 |
|
}); |
| 96 |
|
} |
| 97 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 98 |
0
|
public void addActionCompleteCallback(Callback<Boolean> callback){... |
| 99 |
0
|
searchPanel.addActionCompleteCallback(callback); |
| 100 |
|
} |
| 101 |
|
} |