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);
public void init(){ TableLayout ll = (TableLayout) findViewById(R.id.displayLinear); for (int i = 0; i <2; i++) { TableRow row= new TableRow(this); TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT); row.setLayoutParams(lp); checkBox = new CheckBox(this); tv = new TextView(this); addBtn = new ImageButton(this); addBtn.setImageResource(R.drawable.add); minusBtn = new ImageButton(this); minusBtn.setImageResource(R.drawable.minus); qty = new TextView(this); checkBox.setText("hello"); qty.setText("10"); row.addView(checkBox); row.addView(minusBtn); row.addView(qty); row.addView(addBtn); ll.addView(row,i); } }
EntityModel<Account> accModel = new EntityModel<Account>(Account.class, id); add(new CheckBox("cb", new PropertyModel<Boolean>(accModel, "enabled")){ protected boolean wantOnSelectionChangedNotifications() { return true; } });
/** * 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); } }
setGraphic(null); } else if (item instanceof Boolean) { CheckBox checkBox = new CheckBox(); checkBox.setSelected((boolean) item); setGraphic(checkBox);
detailsTable.setWidget(idx, 1, maxSchemaVersion); confirmDelivery = new CheckBox(); confirmDelivery.setWidth("100%"); Label confirmDeliveryLabel = new Label(Utils.constants.confirmDelivery());
name.addInputHandler(this); mandatory = new CheckBox(); mandatory.setWidth("100%"); Label mandatoryLabel = new Label(Utils.constants.mandatory());
profileFiltersLabel = new Label(Utils.constants.profileFilters()); profileFiltersLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel()); includeDeprecatedProfileFilters = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedProfileFilters); Label configurationsLabel = new Label(Utils.constants.configurations()); configurationsLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel()); includeDeprecatedConfigurations = new CheckBox(Utils.constants.includeDeprecated()); setCheckBoxStyle(includeDeprecatedConfigurations);
CheckBox[] cbs = new CheckBox[20]; // Number varies.. for(int i=0; i<20; i++){ cbs[i] = new CheckBox(this); ll.addView(cb); cbs.setText("Test"); }
/*************************************** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public W createWidget(Component rComponent, StyleData rStyle) { return (W) new com.google.gwt.user.client.ui.CheckBox(); } }
@FXML public MenuButton menuButton; ...... CheckBox cb0 = new CheckBox("x"); CustomMenuItem item0 = new CustomMenuItem(cb0); CheckBox cb1 = new CheckBox("y"); CustomMenuItem item1 = new CustomMenuItem(cb1); item0.setHideOnClick(false); item1.setHideOnClick(false); menuButton.getItems().setAll(item0,item1);
treeTable.addGeneratedColumn("generated", new ColumnGenerator() { @Override public Component generateCell(Table source, final Object itemId, Object columnId){ // Get the object associated with the row Object Objet = source.getItem(itemId); //Missing casting instruction if(your condition to check to render a CheckBox()){ return new CheckBox(); } return new Label("your text"); }
CheckBox alternateTextCheck = new CheckBox("Show alternate text"); alternateTextCheck.selectedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> selected, Boolean oldValue, Boolean newValue) {
private CheckBox checkBox; public BooleanCell() { checkBox = new CheckBox(); checkBox.setDisable(true); checkBox.selectedProperty().addListener(new ChangeListener<Boolean> () {
checkBox = new CheckBox(); checkBox.setSelected(getBoolean()); checkBox.setMinWidth(this.getWidth() - this.getGraphicTextGap() * 2);
final CheckBox showFurtherErrors = new CheckBox(); showFurtherErrors.setValue(showErrors); showFurtherErrors.setText("Show further errors");
@Override public void initGUI() { key = new CheckBox(); key.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { //Something happens here } });
final List <CheckBox> cbs = new ArrayList<CheckBox>(); for(int i = 0; i < 5; i++){ CheckBox cb = new CheckBox(this); cb.setText("Apple" + (i + 1)); cbs.add(cb); ll3.addView(cbs.get(i)); }
public MagnoliaTableHead() { super(); selectAll = new CheckBox(); selectAll.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { client.updateVariable(paintableId, "selectAll", event.getValue(), true); } }); selectAll.addStyleName("v-select-all"); }