/** * Instantiates a new CtlSchemasViewImpl. */ public CtlSchemasViewImpl() { super(true); if (displayShowHigherLevelScopeCheckBox()) { showHigherScopeCheckBox = new CheckBox(Utils.constants.displayHigherScopes()); showHigherScopeCheckBox.addStyleName(Utils.kaaAdminStyle.bAppContentTitle()); Element.as(showHigherScopeCheckBox.getElement().getChild(0)) .getStyle().setMarginRight(10, Unit.PX); showHigherScopeCheckBox.setValue(defaultShowHigherLevelScopes()); appendToolbarWidget(showHigherScopeCheckBox); } }
/** * This method is called when a widget is detached from the browser's * document. Overridden because of IE bug that throws away checked state and * in order to clear the event listener off of the <code>inputElem</code>. */ @Override protected void onUnload() { // Clear out the inputElem's event listener (breaking the circular // reference between it and the widget). DOM.setEventListener(inputElem, null); setValue(getValue()); }
@Override protected void initDetailsTable() { Label authorLabel = new Label(Utils.constants.author()); createdUsername = new KaaAdminSizedTextBox(-1, false); createdUsername.setWidth("100%"); detailsTable.setWidget(0, 1, createdUsername); authorLabel.setVisible(!create); createdUsername.setVisible(!create); Label dateTimeCreatedLabel = new Label(Utils.constants.dateTimeCreated()); createdDateTime = new KaaAdminSizedTextBox(-1, false); createdDateTime.setWidth("100%"); 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); getSaveButtonWidget().setVisible(false); name.setEnabled(false); mandatory.setEnabled(false); description.getTextArea().setEnabled(false);
final LinearLayout attractedTo = (LinearLayout) findViewById(R.id.register_attracted_to); final CheckBox male = new CheckBox(this); male.setText("Male"); male.setTextColor(getResources().getColor(R.color.foreground_text)); attractedTo.addView(male); final CheckBox female = new CheckBox(this); female.setText("Female"); female.setTextColor(getResources().getColor(R.color.foreground_text)); attractedTo.addView(female);
@Override protected void resetImpl() { name.setValue(""); name.setEnabled(true); nameLabel.addStyleName(REQUIRED); weight.setValue(null); weight.setEnabled(true); weightLabel.addStyleName(REQUIRED); description.setValue(""); createdUsername.setValue(""); createdDateTime.setValue(""); addProfileFilterButton.setVisible(!create); addConfigurationButton.setVisible(!create); addTopicButton.setVisible(!create); profileFiltersGrid.setEnableActions(true); configurationsGrid.setEnableActions(true); includeDeprecatedProfileFilters.setVisible(!create); includeDeprecatedProfileFilters.setValue(false); includeDeprecatedConfigurations.setVisible(!create); includeDeprecatedConfigurations.setValue(false); }
if (type == TYPE.CHECKBOXES){ LinearLayout myPanel = new LinearLayout(this); for (int i = 0; i < n ; i++){ CheckBox chk=new CheckBox(this); chk.setText("Hello"); myPanel.addView(chk); } myRootPanel.addView(myPanel); }
LinearLayout llsomething = new LinearLayout(this); Checkbox cbSomething = new CheckBox(this); TextView tvSomething = new TextView(this); tvSomething.setText(R.string.something); llsomething.addView(cbSomething); llsomething.addView(tvSomething);
final Label titleBarLabel = new Label("An Error Occurred in the Bus"); titleBarLabel.getElement().getStyle().setFontSize(10, Style.Unit.PT); titleBarLabel.getElement().getStyle().setFontWeight(Style.FontWeight.BOLDER); titleBarLabel.getElement().getStyle().setColor("white"); final HorizontalPanel buttonPanel = new HorizontalPanel(); final CheckBox showFurtherErrors = new CheckBox(); showFurtherErrors.setValue(showErrors); showFurtherErrors.setText("Show further errors"); showFurtherErrors.getElement().getStyle().setFontSize(10, Style.Unit.PT); showFurtherErrors.getElement().getStyle().setColor("white"); showFurtherErrors.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(final ValueChangeEvent<Boolean> booleanValueChangeEvent) { final Button disconnectFromServer = new Button("Disconnect Bus"); disconnectFromServer.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final Button clearErrors = new Button("Clear Log"); clearErrors.addClickHandler(new ClickHandler() { @Override
CheckBox checkbox = new CheckBox(this); checkbox.setText("completed"); checkbox.setTextSize(TypedValue.COMPLEX_UNIT_PT, 10); checkbox.setTextColor(Color.BLACK); checkbox.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); LinearLayout layout = (LinearLayout)findViewById(R.id.layoutku); layout.addView(checkbox);
final LinearLayout layout = new LinearLayout(this); ScrollView scrollView = new ScrollView(this); layout.setOrientation(LinearLayout.VERTICAL); CheckBox[] t=new CheckBox[15]; for (i=0;i<currentBattery.temperatureNumber;i++) { t[i]=new CheckBox(this); t[i].setText("title"); t[i].setChecked(false); t[i].setOnCheckedChangeListener(this); scrollView.addView(t[i]); }
Label authorLabel = new Label(Utils.constants.author()); createdUsername = new KaaAdminSizedTextBox(-1, false); createdUsername.setWidth("100%"); detailsTable.setWidget(row, 1, createdUsername); authorLabel.setVisible(!create); createdUsername.setVisible(!create); includeDeprecatedProfileFilters = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedProfileFilters); addProfileFilterButton = new Button(Utils.constants.addProfileFilter()); addProfileFilterButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall()); addProfileFilterButton.getElement() includeDeprecatedProfileFilters.setVisible(!create); profileFiltersGrid.setVisible(!create); includeDeprecatedConfigurations = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedConfigurations); includeDeprecatedConfigurations.setVisible(!create); configurationsGrid.setVisible(!create);
private void createTreeElement( final TreeItem root, String changeName, List<PreviewNode> children) { FlowPanel element = new FlowPanel(); element.getElement().getStyle().setFloat(LEFT); CheckBox itemCheckBox = new CheckBox(); itemCheckBox.setValue(true); itemCheckBox.getElement().getStyle().setFloat(LEFT); itemCheckBox.getElement().getStyle().setMarginTop(3, PX); Label name = new Label(changeName); name.addClickHandler( event -> { delegate.onSelectionChanged(containerChanges.get(root)); root.setSelected(true); }); name.getElement().getStyle().setFloat(LEFT); element.add(itemCheckBox); element.add(name); element.getElement().getParentElement().getStyle().setMargin(1, PX); itemCheckBox.addValueChangeHandler( event -> { checkChildrenState(root, event.getValue());
private Widget createWidget() { m_errorLabel.setText("hello"); Button ok = new Button("OK"); ok.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final CheckBox check = new CheckBox(); check.setText("Don't show again for 24hours"); check.addClickHandler(new ClickHandler() { m_layoutPanel.setHeight("125px"); m_caption.getElement().getStyle().setBackgroundColor("#ebebeb"); m_caption.setText("Error"); m_layoutPanel.addNorth(m_caption, 2);
y2range.addBlurHandler(refreshgraph); y2range.addKeyPressHandler(refreshgraph); ylog.addClickHandler(new AdjustYRangeCheckOnClick(ylog, yrange)); y2log.addClickHandler(new AdjustYRangeCheckOnClick(y2log, y2range)); ylog.addClickHandler(refreshgraph); y2log.addClickHandler(refreshgraph); wxh.addBlurHandler(refreshgraph); wxh.addKeyPressHandler(refreshgraph); horizontalkey.addClickHandler(refreshgraph); keybox.addClickHandler(refreshgraph); nokey.addClickHandler(refreshgraph); smooth.addClickHandler(refreshgraph); y2range.setText("[0:]"); y2range.setEnabled(false); y2log.setEnabled(false); table.setText(0, 0, "From"); hbox.add(now); table.setWidget(0, 1, hbox); autoreload.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(final ValueChangeEvent<Boolean> event) {
public CheckBoxItem(String name, String title) { super(name, title); checkBox = new CheckBox(); checkBox.setName(name); checkBox.setTitle(SWITCH_TO_EXPRESSION_TITLE); checkBox.setTabIndex(0); checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> booleanValueChangeEvent) { setUndefined(false); checkBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { textBox = new TextBox(); textBox.setTitle("Shift click for regular input"); textBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { panel = new HorizontalPanel(); panel.add(checkBoxWrapper); panel.add(textBoxWrapper);
updateFullNames.addValueChangeHandler(event -> patternField.setEnabled(event.getValue())); updateDelegateUpdating.addValueChangeHandler( event -> updateMarkDeprecated.setEnabled(event.getValue())); configureLabel.addClickHandler( event -> { if (isUpdateSimilarlyVariables()) { newName.addKeyUpHandler( event -> { }); updateSimilarlyVariables.addValueChangeHandler( event -> { if (event.getValue()) { configureLabel.getElement().getStyle().setCursor(POINTER); configureLabel.getElement().getStyle().setColor(Style.getPrimaryHighlightsColor()); } else { configureLabel.getElement().getStyle().setCursor(DEFAULT); configureLabel.getElement().getStyle().setColor(Style.getButtonDisabledFontColor());
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...."; }
private LayerWidget(final Layer layer) { setWidth("100%"); Button removeBtn = new Button("Refresh"); removeBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { layer.refresh(); } }); add(removeBtn); if (layer instanceof LabelsSupported) { final LabelsSupported labelsSupported = (LabelsSupported) layer; CheckBox labeledCheckBox = new CheckBox("Labeled"); labeledCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { labelsSupported.setLabeled(!labelsSupported.isLabeled()); layer.refresh(); } }); add(labeledCheckBox); } add(new Label(layer.getTitle())); setStyleName(ExampleBase.getShowcaseResource().css().sampleRow()); } }