private Form doUploadForm() { form.setAction(getWebContext() + "/jbpm/servicetasks"); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); form.setType(FormType.HORIZONTAL); form.addSubmitCompleteHandler(new Form.SubmitCompleteHandler() { public void onSubmitComplete(final Form.SubmitCompleteEvent event) { presenter.handleSubmitComplete(event); } }); uploader = new FileUpload(() -> { if (presenter.isFileNameValid()) { form.submit(); } }); uploader.setName(FORM_ELEMENT_SERVICE_TASK_ULOAD); form.addAttribute("File", uploader); return form; }
public FormStyleItem addAttribute(String label, IsWidget widget) { final FormStyleItem formStyleItem = GWT.create(FormStyleItem.class); formStyleItem.setup(label, widget, getWidgetCount()); add(formStyleItem); return formStyleItem; }
public int addRow(final IsWidget wid) { return form.addRow(wid); }
public FormStyleItem addAttribute(final String label, final IsWidget wid) { return form.addAttribute(label, wid); }
private void doForm(List<String> parameters) { form = new FormStyleLayout(); form.setType(FormType.HORIZONTAL); link.setTarget("_blank"); form.addAttribute("Reference Link", link); form.addAttribute(param, paramField); fields.add(paramField);
@Test public void testAddAttributeWithHelp() throws Exception { final String attribute = "form attribute"; final String helpTitle = "help title"; final String helpContent = "help content"; final IsWidget widget = mock(IsWidget.class); final int widgetCount = 123; doReturn(widgetCount).when(testedLayout).getWidgetCount(); testedLayout.addAttribute(attribute, helpTitle, helpContent, widget); verify(item).setup(attribute, helpTitle, helpContent, widget, widgetCount); verify(testedLayout).add(item); } }
HorizontalPanel hp = new HorizontalPanel(); hp.add(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.Metadata2())); layout.addRow(hp); layout.addAttribute(translateMetadataIfTranslationsIsKnown(rmd.getAttributeName()), getEditorWidget(rmd, i, HorizontalPanel hp = new HorizontalPanel(); hp.add(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.Attributes1())); layout.addRow(hp); layout.addAttribute(at.getAttributeName(), getEditorWidget(at, i,
@Test public void testAddAttributeWithHelp() throws Exception { final String attribute = "form attribute"; final String helpTitle = "help title"; final String helpContent = "help content"; final Widget widget = mock(Widget.class); final FormStyleItem expectedItem = mock(FormStyleItem.class); final int expectedAttributeIndex = 123; doReturn(expectedItem).when(formStyleLayout).addAttribute(attribute, helpTitle, helpContent, widget); doReturn(expectedAttributeIndex).when(expectedItem).getIndex(); testedPopup.addAttributeWithHelp(attribute, helpTitle, helpContent, widget); verify(formStyleLayout).addAttribute(attribute, helpTitle, helpContent, widget); verify(formStyleLayout).setAttributeVisibility(expectedAttributeIndex, true); } }
public FormStyleLayout() { setType(FormType.HORIZONTAL); }
public FormStyleLayout(final String title) { this(); add(new Legend(title)); }
public void setAttributeVisibility(final int index, final boolean b) { form.setAttributeVisibility(index, b); }
@Before public void setUp() throws Exception { GwtMockito.useProviderForType(FormStyleItem.class, aClass -> item); testedLayout = spy(new FormStyleLayout()); }
public FormStyleItem addAttribute(final String label, final IsWidget wid) { return form.addAttribute(label, wid); }
private void doForm(List<String> parameters) { form = new FormStyleLayout(); form.setType(FormType.HORIZONTAL); link.setTarget("_blank"); form.addAttribute("Reference Link", link); form.addAttribute(param, paramField); fields.add(paramField);
HorizontalPanel hp = new HorizontalPanel(); hp.add(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.Metadata2())); layout.addRow(hp); layout.addAttribute(translateMetadataIfTranslationsIsKnown(rmd.getAttributeName()), getEditorWidget(rmd, i, HorizontalPanel hp = new HorizontalPanel(); hp.add(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.Attributes1())); layout.addRow(hp); layout.addAttribute(at.getAttributeName(), getEditorWidget(at, i,
public FormStyleLayout() { setType(FormType.HORIZONTAL); }
public FormStyleLayout(final String title) { this(); add(new Legend(title)); }
public void setAttributeVisibility(final int index, final boolean b) { form.setAttributeVisibility(index, b); }
private Form doUploadForm() { form.setAction(getWebContext() + "/jbpm/servicetasks"); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); form.setType(FormType.HORIZONTAL); form.addSubmitCompleteHandler(new Form.SubmitCompleteHandler() { public void onSubmitComplete(final Form.SubmitCompleteEvent event) { presenter.handleSubmitComplete(event); } }); uploader = new FileUpload(() -> { if (presenter.isFileNameValid()) { form.submit(); } }); uploader.setName(FORM_ELEMENT_SERVICE_TASK_ULOAD); form.addAttribute("File", uploader); return form; }
public FormStyleItem addAttribute(final String label, final IsWidget wid, final boolean visible) { FormStyleItem formStyleItem = form.addAttribute(label, wid); setAttributeVisibility(formStyleItem.getIndex(), visible); return formStyleItem; }