private void checkLogLabel () { if (log == null) { ((GwtApplication)Gdx.app).log = log = new TextArea(); // It's possible that log functions are called // before the app is initialized. E.g. SoundManager can call log functions before the app is initialized. // Since graphics is null, we're getting errors. The log size will be updated later, in case graphics was null if (Gdx.graphics != null) { log.setSize(Gdx.graphics.getWidth() + "px", "200px"); } else { log.setSize("400px", "200px"); // Dummy value } log.setReadOnly(true); ((GwtApplication)Gdx.app).getRootPanel().add(log); } }
@Override public void log (String tag, String message) { checkLogLabel(); log.setText(log.getText() + "\n" + tag + ": " + message); log.setCursorPos(log.getText().length() - 1); System.out.println(tag + ": " + message); }
@Override protected HasValue<String> createBody(HasErrorMessage hasErrorMessage) { SizedTextArea body = new SizedTextArea(-1); body.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 200); return body; }
this.serverProfileSchemaId = serverProfileSchemaId; VerticalPanel dialogContents = new VerticalPanel(); dialogContents.setSpacing(4); dialogContents.getElement().getStyle().setOverflow(Overflow.AUTO); setWidget(dialogContents); filterPanel.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 200); filterPanel.getTextArea().getElement().getStyle().setPropertyPx("maxHeight", 200); filterPanel.getTextArea().setWidth("725px"); filterPanel.getTextArea().getElement().getStyle().setPropertyPx("maxWidth", 725); filterPanel.addInputHandler(new InputEventHandler() { @Override dialogContents.add(table); testFilterButton = new Button(Utils.constants.testFilter(), new ClickHandler() { @Override public void onClick(ClickEvent event) { testFilterButton.setEnabled(false); Button closeButton = new Button(Utils.constants.close(), new ClickHandler() { @Override public void onClick(ClickEvent event) {
private void showAddNewComment() { newCommentLayout.clear(); final TextArea comment = new TextArea(); comment.setWidth( "100%" ); newCommentLayout.add( comment ); Button ok = new Button( MetadataConstants.INSTANCE.OK() ); Button cancel = new Button( MetadataConstants.INSTANCE.Cancel() ); ok.addClickHandler( new ClickHandler() { public void onClick( final ClickEvent sender ) { sendNewComment( comment.getText() ); } } ); cancel.addClickHandler( new ClickHandler() { public void onClick( final ClickEvent sender ) { showNewCommentButton(); } } ); final HorizontalPanel hp = new HorizontalPanel(); hp.add( ok ); hp.add( cancel ); newCommentLayout.add( hp ); comment.setFocus( true ); }
description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); Label descriptionLabel = new Label(Utils.constants.description()); descriptionLabel.setWidth("200px"); buttonsPanel = new HorizontalPanel(); buttonsPanel.setSpacing(5); detailsTable.getFlexCellFormatter().setColSpan(2, 0, 2); saveButton = new Button(Utils.constants.save()); activateButton = new Button(Utils.constants.activate()); deactivateButton = new Button(Utils.constants.deactivate()); buttonsPanel.add(saveButton); buttonsPanel.add(activateButton); buttonsPanel.add(deactivateButton);
String getMessagePreview(final EIURI instanceURI, final String instanceLabel) { final Person fromInfo = new Person( fromNameText.getText(), fromEmailText.getText(), fromTitleText.getText(), fromLabName.getText(), institutionNameText.getText(), institutionSelect.getItemText(institutionSelect.getSelectedIndex()) ); final TributaryRequestDetailInfo requestDetailInfo = new TributaryRequestDetailInfo( instanceURI, instanceLabel, descriptionText.getText(), additionalInfoText.getText(), agreeToCiteCheckBox.getValue(), agreeToShareCheckBox.getValue() ); final ContactBean msg = new TributaryBean( fromInfo, requestDetailInfo, subject, ccEmailCheckBox.getValue() ); // this will deliver html in case that's what the message will use, or plain-text if no html: showGlasspane(); InstancePage.contactService.getMessageContent( SessionContext.getSessionId(), msg, true, new RootAsyncCallback<String>() { @Override public void onSuccess(String result) { if ( result != null ) { contentPreview = result; new TributaryPreviewPanel( contentPreview ) ; hideGlasspane(); } else { Window.alert( "Error obtaining message text. Please check required fields." ); } } }); return "Still only a mock-message: working on the async callback...."; }
description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 80); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(5, 0, descriptionLabel); HorizontalPanel ctlSwitchPanel = new HorizontalPanel(); detailsTable.setWidget(6, 0, ctlSwitchPanel); detailsTable.getFlexCellFormatter().setColSpan(6, 0, 2); ctlSwitchPanel.getElement().getStyle().setPaddingTop(10, Unit.PX); ctlSwitchPanel.getElement().getStyle().setPaddingBottom(10, Unit.PX); existingCtlButton = new ToggleButton(Utils.constants.selectExistingType()); newCtlButton = new ToggleButton(Utils.constants.createNewType());
name.addInputHandler(this); mandatory = new CheckBox(); mandatory.setWidth("100%"); Label mandatoryLabel = new Label(Utils.constants.mandatory()); detailsTable.setWidget(3, 0, mandatoryLabel); detailsTable.setWidget(3, 1, mandatory); mandatory.addValueChangeHandler(this); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(4, 0, descriptionLabel); sendNotification = new Button(Utils.constants.sendNotification()); detailsTable.setWidget(5, 0, sendNotification); sendNotification.setVisible(!create); getSaveButtonWidget().setVisible(false); name.setEnabled(false); mandatory.setEnabled(false); description.getTextArea().setEnabled(false);
return new Button( metawidget.getLabelString( attributes ) ); return new CheckBox(); ListBox listBox = new ListBox(); listBox.setVisibleItemCount( 1 ); return new CheckBox(); TextBox textbox = new TextBox(); textbox.setMaxLength( 1 ); return new TextBox(); return new TextArea();
description = new SizedTextArea(1024); description.setWidth("100%"); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); description.getTextArea().getElement().getStyle().setPropertyPx("maxWidth", 487); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(row, 0, descriptionLabel); profileFiltersLabel = new Label(Utils.constants.profileFilters()); profileFiltersLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel()); includeDeprecatedProfileFilters = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedProfileFilters); addProfileFilterButton = new Button(Utils.constants.addProfileFilter()); addProfileFilterButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall()); addProfileFilterButton.getElement() .getParentElement() .getStyle() includeDeprecatedProfileFilters.setVisible(!create); profileFiltersGrid.setVisible(!create); Label configurationsLabel = new Label(Utils.constants.configurations()); configurationsLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel()); includeDeprecatedConfigurations = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedConfigurations);
description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(5, 0, descriptionLabel); ecfVersionsLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel()); addEcfVersionButton = new Button(Utils.constants.addFamilyVersion()); addEcfVersionButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall()); addEcfVersionButton.getElement().getParentElement().getStyle().setPropertyPx("paddingTop", 15); detailsTable.getCellFormatter().setHorizontalAlignment( 8, 2, HasHorizontalAlignment.ALIGN_RIGHT);
@Override public void onClick(ClickEvent event) { String alertMsg = validateFields(); if (alertMsg.isEmpty()) { StemCellSearchApplicationState appState = StemCellSearchApplicationState.getInstance(); String msgText = messageText.getText(); StringBuffer emailSb = new StringBuffer( DEFAULT_MESSAGE_PREFIX ); if ( !msgText.isEmpty() ) { emailSb.append("Message: "); emailSb.append( msgText ); emailSb.append("\n\n"); } emailSb.append(PREAMBLE_TO_URL); emailSb.append( appState.buildResultsPageUrl() ); emailSb.append(POSTAMBLE_TO_URL); emailSb.append( DEFAULT_MESSAGE_SUFFIX ); emailSb.append( appState.getCentralSearchLink() ); emailSb.append( IPS_CELL_SEARCH_PAGE_PATH ); sendEmail( NO_NAME, emailText.getText(), DEFAULT_SUBJECT_TEXT, emailSb.toString() ); clearTextFields(); hide(); } else { Window.alert( alertMsg ); } } });
private void initializeTextFields() { emailText = new TextBox(); emailText.setStyleName( ELEMENT_STYLE ); emailText.setVisibleLength(50); emailText.setMaxLength(70); messageText = new TextArea(); messageText.setStyleName( ELEMENT_STYLE ); messageText.setVisibleLines(4); clearTextFields(); }
@Override void clearFields() { super.clearFields(); fromTitleText.setText( "" ); fromLabName.setText( "" ); institutionNameText.setText( "" ); institutionSelect.setItemSelected( 0, true ); descriptionText.setText( "" ); additionalInfoText.setText( "" ); agreeToCiteCheckBox.setValue( false ); agreeToShareCheckBox.setValue( false ); ccEmailCheckBox.setValue( false ); }
rootElement = ourUiBinder.createAndBindUi(this); reset(); projectName.getElement().setAttribute("placeholder", "Define the name of your project..."); projectName.getElement().setAttribute("maxlength", "128"); projectName.getElement().setAttribute("spellcheck", "false"); projectDescription .getElement() .setAttribute("placeholder", "Add a description to your project..."); projectDescription.getElement().setAttribute("maxlength", "256"); setConfigOptions(null); selectPath.addClickHandler( new ClickHandler() { @Override
@Inject public ZipImporterPageViewImpl( ProjectImporterResource resource, ZipImporterPageViewImplUiBinder uiBinder) { style = resource.zipImporterPageStyle(); style.ensureInjected(); initWidget(uiBinder.createAndBindUi(this)); projectName.getElement().setAttribute("maxlength", "32"); projectDescription.getElement().setAttribute("maxlength", "256"); skipFirstLevel.setValue(false); }
@Override protected TabItem createGeneralTab() { final TabItem tab = new TabItem(CrudRs.TXT.generalSetting()); tab.addField(id, CrudRs.TXT.id()); event = new ExChosenValueListBox<>(binding, new ModelNameRenderer<SystemEventModel>(), new ModelIdProvidesKey<SystemEventModel>()); tab.addField(event, AdminModuleRs.MSG.event()); subject = new TextBox(); tab.addField(subject, AdminModuleRs.MSG.subject()); template = new TextArea(); tab.addField(template, AdminModuleRs.MSG.template()); return tab; }
public BasicContactPanel(final EIEntity instanceEntity, final ResourceFacet facet) { initWidget( uiBinder.createAndBindUi( this ) ); super.init( instanceEntity, facet ); final boolean isResource = ResourceFacet.resource.equals(facet); if( isResource ) { contactFormHeader.setText(HEADER_PREFIX + "the owner of this resource."); } else { contactFormHeader.setText(HEADER_PREFIX + "this " + facet.getLabel() + "."); } hidePart2(); createTextArea( subjectText, TEXT_BOX_STYLE ); createTextArea( messageText, TEXT_BOX_STYLE ); subjectText.setText( isResource ? (RESOURCE_SUBJECT_PREFACE + instanceEntity.getLabel()) : NON_RESOURCE_SUBJECT ); nextButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { showPart2(); } }); }