@Override public void setAccessKey(final char key) { final Element element = uiObject.getElement(); final String accessKey = Character.toString(key); if (AnchorElement.is(element)) { AnchorElement.as(element).setAccessKey(accessKey); } else if (ButtonElement.is(element)) { ButtonElement.as(element).setAccessKey(accessKey); } else if (InputElement.is(element)) { InputElement.as(element).setAccessKey(accessKey); } }
private UserLoginDialogUI(){ super( false, true, true, null); //Set the dialog's caption. this.setText( titlesI18N.userLoginDialogTitle() ); //Set a style name so we can style it with CSS. this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Get a handle to the form and set its action to our jsni method form = FormPanel.wrap(Document.get().getElementById(LOGINFORM_ID), false); //Get the cancel button for text localization cancel = (ButtonElement) Document.get().getElementById(CANCELBUTTON_ID); cancel.setInnerText( getLeftButtonText() ); //Get the submit button for text localization submit = (ButtonElement) Document.get().getElementById(LOGINBUTTON_ID); submit.setInnerText( getRightButtonText() ); //Get the user login input userLoginInput = (InputElement) Document.get().getElementById(USERNAME_ID); //Get the user password input userPasswordInput = (InputElement) Document.get().getElementById(PASSWORD_ID); //Fill dialog with data populateDialog(); //Enable the action buttons and hot key setLeftEnabled( true ); setRightEnabled( true ); }
/** * wraps elemet for button * * @param color * @param element */ public IneButton(Color color, String text, ButtonElement element) { button = Button.wrap(element); initWidget(uiBinder.createAndBindUi(this)); button.setText(text); setColor(color); }
/** * this method initializes the protected fields: labels and button */ protected void createUI() { ObjectDesc desc = new ObjectDesc( loginObjectDesc, new StringFDesc(email, IneFrameI18n.USERNAME()), new StringFDesc(pass, IneFrameI18n.PASSWORD()), new StringFDesc(captcha, IneFrameI18n.CAPTCHA())); descriptorStore.registerObjectDesc(Marker.registered, desc); FormRDesc fDesc = new FormRDesc(loginObjectDesc); fDesc.getRootNode().addChild( email, new WidgetRDesc(FWTypes.TEXTBOXBYDOMID).prop(IneFormProperties.domId, "username")); fDesc.getRootNode().addChild( pass, new WidgetRDesc(FWTypes.PASSWORDTEXTBOXBYDOMID) .prop(IneFormProperties.domId, "password")); fDesc.getRootNode().addChild( captcha, new WidgetRDesc(FWTypes.CAPTCHA) .width(100) .prop(CaptchaFW.PROP_RENDERING, CaptchaFW.HORIZONTAL)); descriptorStore.addDefaultTypedDesc(Marker.registered, loginObjectDesc, fDesc); ineForm = formFactory.createSimple(loginObjectDesc, null); ineForm.renderForm(); formContent.add(ineForm.asWidget()); ButtonElement submitEl = (ButtonElement) Document.get().getElementById("loginSubmit"); Element formEl = DOM.getElementById("loginform"); loginButton = new IneButton(Color.GREEN, IneFrameI18n.LOGIN(), submitEl); formContent.add(loginButton); formPanel = (formEl == null ? new FormPanel() : FormPanel.wrap(formEl)); formEl.getStyle().setDisplay(Display.BLOCK); formPanel.add(formContent); mainPanel.add(formPanel); }
private ButtonElement createButton(Document document, String className) { ButtonElement result = document.createPushButtonElement(); result.addClassName(className); return result; }
private ButtonElement createChildButton(Document document, Element parent, String nameId) { ButtonElement result = createButton(document, nameId); parent.appendChild(result); return result; }