| 1 |
|
package org.kuali.student.common.ui.client.widgets.dialog; |
| 2 |
|
|
| 3 |
|
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
| 4 |
|
import org.kuali.student.common.ui.client.widgets.KSLabel; |
| 5 |
|
import org.kuali.student.common.ui.client.widgets.KSLightBox; |
| 6 |
|
import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations.ButtonEnum; |
| 7 |
|
import org.kuali.student.common.ui.client.widgets.field.layout.button.ButtonGroup; |
| 8 |
|
|
| 9 |
|
import com.google.gwt.event.dom.client.ClickHandler; |
| 10 |
|
import com.google.gwt.event.logical.shared.CloseHandler; |
| 11 |
|
import com.google.gwt.event.shared.HandlerRegistration; |
| 12 |
|
import com.google.gwt.user.client.ui.FlowPanel; |
| 13 |
|
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 9 |
Complexity Density: 0.47 |
|
| 14 |
|
public class ButtonMessageDialog<T extends ButtonEnum> { |
| 15 |
|
|
| 16 |
|
private KSLabel messageLabel = new KSLabel(); |
| 17 |
|
private SectionTitle title = SectionTitle.generateH3Title(""); |
| 18 |
|
|
| 19 |
|
private FlowPanel layout = new FlowPanel(); |
| 20 |
|
|
| 21 |
|
private KSLightBox dialog; |
| 22 |
|
private ButtonGroup<T> buttons; |
| 23 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 24 |
0
|
public ButtonMessageDialog(String titleText, String message, ButtonGroup<T> buttons){... |
| 25 |
0
|
this.buttons = buttons; |
| 26 |
0
|
setupLayout(titleText, message); |
| 27 |
|
} |
| 28 |
|
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
|
| 29 |
0
|
private void setupLayout(String titleText, String message){... |
| 30 |
|
|
| 31 |
0
|
dialog = new KSLightBox(); |
| 32 |
0
|
SectionTitle sectionTitle = SectionTitle.generateH2Title(titleText); |
| 33 |
0
|
layout.add(sectionTitle); |
| 34 |
0
|
messageLabel.setText(message); |
| 35 |
0
|
layout.add(messageLabel); |
| 36 |
0
|
dialog.addButtonGroup(buttons); |
| 37 |
0
|
layout.addStyleName("ks-confirmation-message-layout"); |
| 38 |
0
|
messageLabel.setStyleName("ks-confirmation-message-label"); |
| 39 |
0
|
dialog.setWidget(layout); |
| 40 |
0
|
dialog.setSize(600, 120); |
| 41 |
|
} |
| 42 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
0
|
public void show(){... |
| 44 |
0
|
dialog.show(); |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 47 |
0
|
public void hide(){... |
| 48 |
0
|
dialog.hide(); |
| 49 |
|
} |
| 50 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 51 |
0
|
public void removeCloseLink(){... |
| 52 |
0
|
dialog.removeCloseLink(); |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
0
|
public HandlerRegistration addCloseLinkClickHandler(ClickHandler clickHandler) {... |
| 56 |
0
|
return dialog.addCloseLinkClickHandler(clickHandler); |
| 57 |
|
} |
| 58 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 59 |
0
|
public HandlerRegistration addCloseHandler(CloseHandler handler){... |
| 60 |
0
|
return dialog.addCloseHandler(handler); |
| 61 |
|
} |
| 62 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 63 |
0
|
public void setMessageText(String text){... |
| 64 |
0
|
messageLabel.setText(text); |
| 65 |
|
} |
| 66 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 67 |
0
|
public ButtonGroup<T> getButtonGroup(){... |
| 68 |
0
|
return buttons; |
| 69 |
|
} |
| 70 |
|
} |