public boolean getShowAgain() { return !dontShowAgain.getValue(); }
/** * This binds a field, and returns a check box editor for it. * @param bind Interface to bind to. * @param toolTip tool tip. * @return */ private Widget editableBoolean( final FieldBooleanBinding bind, final String toolTip ) { if ( !readOnly ) { final CheckBox box = new CheckBox(); box.setTitle( toolTip ); box.setValue( bind.getValue() ); box.addClickHandler( new ClickHandler() { public void onClick( ClickEvent w ) { boolean b = box.getValue(); bind.setValue( b ); } } ); return box; } else { final CheckBox box = new CheckBox(); box.setValue( bind.getValue() ); box.setEnabled( false ); return box; } }
private Widget makeEventTypeCheckBox( final String eventType, final Boolean isEnabled ) { final CheckBox chkEventType = new CheckBox( AuditLogEntryCellHelper.getEventTypeDisplayText( eventType ) ); chkEventType.setValue( Boolean.TRUE.equals( isEnabled ) ); chkEventType.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange( ValueChangeEvent<Boolean> event ) { auditLog.getAuditLogFilter().getAcceptedTypes().put( eventType, event.getValue() ); } } ); return chkEventType; }
/** * 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). setEventListener(asOld(inputElem), null); setValue(getValue()); }
/** * Creates a label with the specified text and a default direction * estimator. * * @param label * the check box's label * @param directionEstimator * A DirectionEstimator object used for automatic direction * adjustment. For convenience, * {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used. */ public CheckBox(String label, DirectionEstimator directionEstimator) { this(); setDirectionEstimator(directionEstimator); setText(label); }
setEventListener(asOld(inputElem), null); getElement().replaceChild(newInputElem, inputElem); int tabIndex = getTabIndex(); boolean checked = getValue(); boolean enabled = isEnabled(); String formValue = getFormValue(); setTabIndex(tabIndex); setValue(checked); setEnabled(enabled); setFormValue(formValue); if (isAttached()) { setEventListener(asOld(inputElem), this);
public void onClick( ClickEvent sender ) { at.setUseRowNumber( useRowNumber.getValue() ); reverseOrder.setEnabled( useRowNumber.getValue() ); dtable.updateSystemControlledColumnValues(); } } );
CheckBox chkOnlyDisplayDSLConditions = new CheckBox(); chkOnlyDisplayDSLConditions.setText( Constants.INSTANCE.OnlyDisplayDSLActions() ); chkOnlyDisplayDSLConditions.setValue( bOnlyShowDSLConditions ); chkOnlyDisplayDSLConditions.addValueChangeHandler( new ValueChangeHandler<Boolean>() {
/** * An editor for whether the column is hidden or not * @param col * @return */ public static CheckBox getHideColumnIndicator( final DTColumnConfig52 col ) { final CheckBox chkHide = new CheckBox(); chkHide.setValue( col.isHideColumn() ); chkHide.addClickHandler( new ClickHandler() { public void onClick( ClickEvent sender ) { col.setHideColumn( chkHide.getValue() ); } } ); return chkHide; }
private void chosenPatternsSelected( final Set<ActionInsertFactFieldsPattern> cps ) { btnRemoveFactTypes.setEnabled( cps.size() > 0 ); fieldDefinition.setVisible( false ); if ( cps.size() == 1 ) { chosenPatternsSelection = cps.iterator().next(); presenter.selectPattern( chosenPatternsSelection ); patternDefinition.setVisible( true ); validateBinding(); txtBinding.setEnabled( true ); txtBinding.setVisible( true ); txtBinding.setText( chosenPatternsSelection.getBoundName() ); chkLogicalInsert.setEnabled( true ); chkLogicalInsert.setVisible( true ); chkLogicalInsert.setValue( chosenPatternsSelection.isInsertedLogically() ); } else { chosenPatternsSelection = null; setAvailableFields( new ArrayList<AvailableField>() ); setChosenFields( new ArrayList<ActionInsertFactCol52>() ); patternDefinition.setVisible( false ); txtBinding.setEnabled( false ); txtBinding.setVisible( false ); txtBinding.setText( "" ); chkLogicalInsert.setEnabled( false ); chkLogicalInsert.setVisible( false ); } }
/** * Checks or unchecks the check box. * <p> * Note that this <em>does not</em> set the value property of the checkbox * input element wrapped by this widget. For access to that property, see * {@link #setFormValue(String)} * * @param value * true to check, false to uncheck; null value implies false */ public void setValue(Boolean value) { setValue(value, false); }
private void populateFieldDefinition() { // Fields common to all table formats txtColumnHeader.setEnabled( true ); chkUpdateEngine.setEnabled( true ); txtColumnHeader.setText( chosenFieldsSelection.getHeader() ); chkUpdateEngine.setValue( chosenFieldsSelection.isUpdate() ); criteriaExtendedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY ); criteriaLimitedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.LIMITED_ENTRY ); // Fields specific to the table format switch ( presenter.getTableFormat() ) { case EXTENDED_ENTRY: txtValueList.setEnabled( !presenter.hasEnums( chosenFieldsSelection ) ); txtValueList.setText( chosenFieldsSelection.getValueList() ); makeDefaultValueWidget(); defaultValueContainer.setVisible( true ); break; case LIMITED_ENTRY: makeLimitedValueWidget(); limitedEntryValueContainer.setVisible( true ); break; } }
final CheckBox chkNegated = new CheckBox(); chkNegated.addClickHandler( new ClickHandler() {
protected void ensureDomEventHandlers() { addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // Checkboxes always toggle their value, no need to compare // with old value. Radio buttons are not so lucky, see // overrides in RadioButton ValueChangeEvent.fire(CheckBox.this, getValue()); } }); }
protected CheckBox(Element elem) { super(DOM.createLabel()); assert elem.hasAttribute("type") : "The elem should has type attributes"; String elementType = elem.getAttribute("type"); if(CHECKBOX.equalsIgnoreCase(elementType)) { this.setStyleName(CHECKBOX); } else if(RADIO.equalsIgnoreCase(elementType)){ this.setStyleName(RADIO); } inputElem = InputElement.as(elem); spanElem = Document.get().createSpanElement(); getElement().appendChild(inputElem); getElement().appendChild(spanElem); String uid = DOM.createUniqueId(); inputElem.setPropertyString("id", uid); asLabel().setHtmlFor(uid); directionalTextHelper = new DirectionalTextHelper(spanElem, false); setTabIndex(0); }
private void chosenConditionsSelected( final Set<ActionSetFieldCol52> cws ) { btnRemove.setEnabled( true ); if ( cws.size() == 1 ) { chosenFieldsSelection = cws.iterator().next(); fieldDefinition.setVisible( true ); validateFieldHeader(); populateFieldDefinition(); } else { chosenFieldsSelection = null; fieldDefinition.setVisible( false ); txtColumnHeader.setEnabled( false ); txtValueList.setEnabled( false ); defaultValueContainer.setVisible( false ); chkUpdateEngine.setEnabled( false ); } }
/** * Creates a check box with the specified text label. * * @param label * the check box's label */ public CheckBox(String label) { this(); setText(label); }
/** * <b>Affected Elements:</b> * <ul> * <li>-label = label next to checkbox.</li> * </ul> * * @see UIObject#onEnsureDebugId(String) */ @Override protected void onEnsureDebugId(String baseID) { super.onEnsureDebugId(baseID); ensureDebugId(asLabel(), baseID, "label"); ensureDebugId(inputElem, baseID, "input"); asLabel().setHtmlFor(inputElem.getId()); }
public SplashModalFooter( final ParameterizedCommand<Boolean> closeCommand ) { this.closeCommand = checkNotNull( "okCommand", closeCommand ); add( uiBinder.createAndBindUi( this ) ); closeButton.ensureDebugId( "SplashModalFooter-close" ); dontShowAgain.ensureDebugId( "SplashModalFooter-dontShowAgain" ); }