OLD | NEW |
(Empty) | |
| 1 package autotest.planner.triage; |
| 2 |
| 3 import autotest.common.ui.ExtendedListBox; |
| 4 import autotest.common.ui.SimplifiedList; |
| 5 import autotest.planner.resources.PlannerImageBundle; |
| 6 |
| 7 import com.google.gwt.core.client.GWT; |
| 8 import com.google.gwt.event.dom.client.HasClickHandlers; |
| 9 import com.google.gwt.user.client.ui.Button; |
| 10 import com.google.gwt.user.client.ui.CheckBox; |
| 11 import com.google.gwt.user.client.ui.FlexTable; |
| 12 import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
| 13 import com.google.gwt.user.client.ui.HasText; |
| 14 import com.google.gwt.user.client.ui.HasValue; |
| 15 import com.google.gwt.user.client.ui.HorizontalPanel; |
| 16 import com.google.gwt.user.client.ui.Image; |
| 17 import com.google.gwt.user.client.ui.Panel; |
| 18 import com.google.gwt.user.client.ui.PopupPanel; |
| 19 import com.google.gwt.user.client.ui.TextArea; |
| 20 import com.google.gwt.user.client.ui.TextBox; |
| 21 import com.google.gwt.user.client.ui.VerticalPanel; |
| 22 import com.google.gwt.user.client.ui.Widget; |
| 23 |
| 24 public class TriagePopupDisplay extends PopupPanel implements TriagePopup.Displa
y { |
| 25 private Panel container = new VerticalPanel(); |
| 26 private Image closeX = |
| 27 ((PlannerImageBundle) GWT.create(PlannerImageBundle.class)).close().
createImage(); |
| 28 private TextBox labels = new TextBox(); |
| 29 private TextArea keyvals = new TextArea(); |
| 30 private TextBox bugs = new TextBox(); |
| 31 private TextBox reason = new TextBox(); |
| 32 private ExtendedListBox hostAction = new ExtendedListBox(); |
| 33 private ExtendedListBox testAction = new ExtendedListBox(); |
| 34 private CheckBox invalidate = new CheckBox("Invalidate Test"); |
| 35 private Button apply = new Button("Apply"); |
| 36 |
| 37 public TriagePopupDisplay() { |
| 38 super(false, true); |
| 39 |
| 40 HorizontalPanel topPanel = new HorizontalPanel(); |
| 41 topPanel.setWidth("100%"); |
| 42 topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); |
| 43 topPanel.add(closeX); |
| 44 container.add(topPanel); |
| 45 |
| 46 FlexTable bottomTable = new FlexTable(); |
| 47 addRow(bottomTable, "Labels", labels); |
| 48 addRow(bottomTable, "Keyvals", keyvals); |
| 49 addRow(bottomTable, "Bugs", bugs); |
| 50 addRow(bottomTable, "Reason", reason); |
| 51 addRow(bottomTable, "Host", hostAction); |
| 52 addRow(bottomTable, "Test", testAction); |
| 53 addRow(bottomTable, null, invalidate); |
| 54 container.add(bottomTable); |
| 55 |
| 56 container.add(apply); |
| 57 |
| 58 setWidget(container); |
| 59 } |
| 60 |
| 61 private void addRow(FlexTable table, String label, Widget field) { |
| 62 int row = table.getRowCount(); |
| 63 if (label != null) { |
| 64 table.setText(row, 0, label + ":"); |
| 65 } |
| 66 table.setWidget(row, 1, field); |
| 67 } |
| 68 |
| 69 @Override |
| 70 public HasClickHandlers getApplyButton() { |
| 71 return apply; |
| 72 } |
| 73 |
| 74 @Override |
| 75 public HasText getBugsField() { |
| 76 return bugs; |
| 77 } |
| 78 |
| 79 @Override |
| 80 public HasClickHandlers getCloseButton() { |
| 81 return closeX; |
| 82 } |
| 83 |
| 84 @Override |
| 85 public SimplifiedList getHostActionField() { |
| 86 return hostAction; |
| 87 } |
| 88 |
| 89 @Override |
| 90 public HasValue<Boolean> getInvalidateField() { |
| 91 return invalidate; |
| 92 } |
| 93 |
| 94 @Override |
| 95 public HasText getKeyvalsField() { |
| 96 return keyvals; |
| 97 } |
| 98 |
| 99 @Override |
| 100 public HasText getLabelsField() { |
| 101 return labels; |
| 102 } |
| 103 |
| 104 @Override |
| 105 public HasText getReasonField() { |
| 106 return reason; |
| 107 } |
| 108 |
| 109 @Override |
| 110 public SimplifiedList getTestActionField() { |
| 111 return testAction; |
| 112 } |
| 113 } |
OLD | NEW |