OLD | NEW |
(Empty) | |
| 1 package autotest.afe.create; |
| 2 |
| 3 import autotest.afe.CheckBoxPanel; |
| 4 import autotest.afe.CheckBoxPanelDisplay; |
| 5 import autotest.afe.ControlTypeSelect; |
| 6 import autotest.afe.ControlTypeSelectDisplay; |
| 7 import autotest.afe.HostSelector; |
| 8 import autotest.afe.HostSelectorDisplay; |
| 9 import autotest.afe.IButton; |
| 10 import autotest.afe.IButton.ButtonImpl; |
| 11 import autotest.afe.ICheckBox; |
| 12 import autotest.afe.ICheckBox.CheckBoxImpl; |
| 13 import autotest.afe.ITextArea; |
| 14 import autotest.afe.ITextArea.TextAreaImpl; |
| 15 import autotest.afe.ITextBox; |
| 16 import autotest.afe.ITextBox.TextBoxImpl; |
| 17 import autotest.afe.TestSelector; |
| 18 import autotest.afe.TestSelectorDisplay; |
| 19 import autotest.common.ui.ExtendedListBox; |
| 20 import autotest.common.ui.RadioChooser; |
| 21 import autotest.common.ui.RadioChooserDisplay; |
| 22 import autotest.common.ui.SimplifiedList; |
| 23 |
| 24 import com.google.gwt.event.dom.client.HasClickHandlers; |
| 25 import com.google.gwt.event.logical.shared.HasCloseHandlers; |
| 26 import com.google.gwt.event.logical.shared.HasOpenHandlers; |
| 27 import com.google.gwt.user.client.ui.Anchor; |
| 28 import com.google.gwt.user.client.ui.Button; |
| 29 import com.google.gwt.user.client.ui.CheckBox; |
| 30 import com.google.gwt.user.client.ui.DisclosurePanel; |
| 31 import com.google.gwt.user.client.ui.HTMLPanel; |
| 32 import com.google.gwt.user.client.ui.HasText; |
| 33 import com.google.gwt.user.client.ui.HasValue; |
| 34 import com.google.gwt.user.client.ui.HorizontalPanel; |
| 35 import com.google.gwt.user.client.ui.Label; |
| 36 import com.google.gwt.user.client.ui.Panel; |
| 37 import com.google.gwt.user.client.ui.TextBox; |
| 38 import com.google.gwt.user.client.ui.VerticalPanel; |
| 39 |
| 40 public class CreateJobViewDisplay implements CreateJobViewPresenter.Display { |
| 41 public static final int CHECKBOX_PANEL_COLUMNS = 5; |
| 42 |
| 43 private TextBox jobName = new TextBox(); |
| 44 private ExtendedListBox priorityList = new ExtendedListBox(); |
| 45 private TextBoxImpl kernel = new TextBoxImpl(); |
| 46 private TextBoxImpl kernel_cmdline = new TextBoxImpl(); |
| 47 private TextBox timeout = new TextBox(); |
| 48 private TextBox maxRuntime = new TextBox(); |
| 49 private TextBox emailList = new TextBox(); |
| 50 private CheckBoxImpl skipVerify = new CheckBoxImpl(); |
| 51 private RadioChooserDisplay rebootBefore = new RadioChooserDisplay(); |
| 52 private RadioChooserDisplay rebootAfter = new RadioChooserDisplay(); |
| 53 private CheckBox parseFailedRepair = new CheckBox(); |
| 54 private CheckBoxImpl hostless = new CheckBoxImpl(); |
| 55 private TestSelectorDisplay testSelector = new TestSelectorDisplay(); |
| 56 private CheckBoxPanelDisplay profilersPanel = new CheckBoxPanelDisplay(CHECK
BOX_PANEL_COLUMNS); |
| 57 private CheckBoxImpl runNonProfiledIteration = |
| 58 new CheckBoxImpl("Run each test without profilers first"); |
| 59 private ExtendedListBox droneSet = new ExtendedListBox(); |
| 60 private TextAreaImpl controlFile = new TextAreaImpl(); |
| 61 private DisclosurePanel controlFilePanel = new DisclosurePanel(); |
| 62 private ControlTypeSelectDisplay controlTypeSelect = new ControlTypeSelectDi
splay(); |
| 63 private TextBoxImpl synchCountInput = new TextBoxImpl(); |
| 64 private ButtonImpl editControlButton = new ButtonImpl(); |
| 65 private HostSelectorDisplay hostSelector = new HostSelectorDisplay(); |
| 66 private ButtonImpl submitJobButton = new ButtonImpl("Submit Job"); |
| 67 private Button createTemplateJobButton = new Button("Create Template Job"); |
| 68 private Button resetButton = new Button("Reset"); |
| 69 private Anchor viewLink = new Anchor(""); |
| 70 |
| 71 public void initialize(HTMLPanel panel) { |
| 72 Panel profilerControls = new VerticalPanel(); |
| 73 profilerControls.add(profilersPanel); |
| 74 profilerControls.add(runNonProfiledIteration); |
| 75 |
| 76 controlFile.setSize("50em", "30em"); |
| 77 |
| 78 HorizontalPanel controlOptionsPanel = new HorizontalPanel(); |
| 79 controlOptionsPanel.setVerticalAlignment(HorizontalPanel.ALIGN_BOTTOM); |
| 80 controlOptionsPanel.add(controlTypeSelect); |
| 81 Label useLabel = new Label("Use"); |
| 82 useLabel.getElement().getStyle().setProperty("marginLeft", "1em"); |
| 83 synchCountInput.setSize("3em", ""); // set width only |
| 84 synchCountInput.getElement().getStyle().setProperty("margin", "0 0.5em 0
0.5em"); |
| 85 controlOptionsPanel.add(useLabel); |
| 86 controlOptionsPanel.add(synchCountInput); |
| 87 controlOptionsPanel.add(new Label("host(s) per execution")); |
| 88 Panel controlEditPanel = new VerticalPanel(); |
| 89 controlEditPanel.add(controlOptionsPanel); |
| 90 controlEditPanel.add(controlFile); |
| 91 |
| 92 Panel controlHeaderPanel = new HorizontalPanel(); |
| 93 controlHeaderPanel.add(viewLink); |
| 94 controlHeaderPanel.add(editControlButton); |
| 95 |
| 96 controlFilePanel.setHeader(controlHeaderPanel); |
| 97 controlFilePanel.add(controlEditPanel); |
| 98 |
| 99 panel.add(jobName, "create_job_name"); |
| 100 panel.add(kernel, "create_kernel"); |
| 101 panel.add(kernel_cmdline, "create_kernel_cmdline"); |
| 102 panel.add(timeout, "create_timeout"); |
| 103 panel.add(maxRuntime, "create_max_runtime"); |
| 104 panel.add(emailList, "create_email_list"); |
| 105 panel.add(priorityList, "create_priority"); |
| 106 panel.add(skipVerify, "create_skip_verify"); |
| 107 panel.add(rebootBefore, "create_reboot_before"); |
| 108 panel.add(rebootAfter, "create_reboot_after"); |
| 109 panel.add(parseFailedRepair, "create_parse_failed_repair"); |
| 110 panel.add(hostless, "create_hostless"); |
| 111 panel.add(testSelector, "create_tests"); |
| 112 panel.add(profilerControls, "create_profilers"); |
| 113 panel.add(controlFilePanel, "create_edit_control"); |
| 114 panel.add(hostSelector, "create_host_selector"); |
| 115 panel.add(submitJobButton, "create_submit"); |
| 116 panel.add(createTemplateJobButton, "create_template_job"); |
| 117 panel.add(resetButton, "create_reset"); |
| 118 panel.add(droneSet, "create_drone_set"); |
| 119 } |
| 120 |
| 121 public CheckBoxPanel.Display getCheckBoxPanelDisplay() { |
| 122 return profilersPanel; |
| 123 } |
| 124 |
| 125 public ControlTypeSelect.Display getControlTypeSelectDisplay() { |
| 126 return controlTypeSelect; |
| 127 } |
| 128 |
| 129 public ITextArea getControlFile() { |
| 130 return controlFile; |
| 131 } |
| 132 |
| 133 public HasCloseHandlers<DisclosurePanel> getControlFilePanelClose() { |
| 134 return controlFilePanel; |
| 135 } |
| 136 |
| 137 public HasOpenHandlers<DisclosurePanel> getControlFilePanelOpen() { |
| 138 return controlFilePanel; |
| 139 } |
| 140 |
| 141 public HasClickHandlers getCreateTemplateJobButton() { |
| 142 return createTemplateJobButton; |
| 143 } |
| 144 |
| 145 public SimplifiedList getDroneSet() { |
| 146 return droneSet; |
| 147 } |
| 148 |
| 149 public IButton getEditControlButton() { |
| 150 return editControlButton; |
| 151 } |
| 152 |
| 153 public HasText getEmailList() { |
| 154 return emailList; |
| 155 } |
| 156 |
| 157 public HostSelector.Display getHostSelectorDisplay() { |
| 158 return hostSelector; |
| 159 } |
| 160 |
| 161 public ICheckBox getHostless() { |
| 162 return hostless; |
| 163 } |
| 164 |
| 165 public HasText getJobName() { |
| 166 return jobName; |
| 167 } |
| 168 |
| 169 public ITextBox getKernel() { |
| 170 return kernel; |
| 171 } |
| 172 |
| 173 public ITextBox getKernelCmdline() { |
| 174 return kernel_cmdline; |
| 175 } |
| 176 |
| 177 public HasText getMaxRuntime() { |
| 178 return maxRuntime; |
| 179 } |
| 180 |
| 181 public HasValue<Boolean> getParseFailedRepair() { |
| 182 return parseFailedRepair; |
| 183 } |
| 184 |
| 185 public SimplifiedList getPriorityList() { |
| 186 return priorityList; |
| 187 } |
| 188 |
| 189 public RadioChooser.Display getRebootAfter() { |
| 190 return rebootAfter; |
| 191 } |
| 192 |
| 193 public RadioChooser.Display getRebootBefore() { |
| 194 return rebootBefore; |
| 195 } |
| 196 |
| 197 public HasClickHandlers getResetButton() { |
| 198 return resetButton; |
| 199 } |
| 200 |
| 201 public ICheckBox getRunNonProfiledIteration() { |
| 202 return runNonProfiledIteration; |
| 203 } |
| 204 |
| 205 public ICheckBox getSkipVerify() { |
| 206 return skipVerify; |
| 207 } |
| 208 |
| 209 public IButton getSubmitJobButton() { |
| 210 return submitJobButton; |
| 211 } |
| 212 |
| 213 public ITextBox getSynchCountInput() { |
| 214 return synchCountInput; |
| 215 } |
| 216 |
| 217 public TestSelector.Display getTestSelectorDisplay() { |
| 218 return testSelector; |
| 219 } |
| 220 |
| 221 public HasText getTimeout() { |
| 222 return timeout; |
| 223 } |
| 224 |
| 225 public HasText getViewLink() { |
| 226 return viewLink; |
| 227 } |
| 228 |
| 229 public void setControlFilePanelOpen(boolean isOpen) { |
| 230 controlFilePanel.setOpen(isOpen); |
| 231 } |
| 232 } |
OLD | NEW |