com.google.gwt.user.client.ui.CheckBox.addClickHandler()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中com.google.gwt.user.client.ui.CheckBox.addClickHandler()方法的一些代码示例,展示了CheckBox.addClickHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox.addClickHandler()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.CheckBox
类名称:CheckBox
方法名:addClickHandler

CheckBox.addClickHandler介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

protected void ensureDomEventHandlers() {
 addClickHandler(new ClickHandler() {
  @Override
  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());
  }
 });
}

代码示例来源:origin: net.wetheinter/gwt-user

protected void ensureDomEventHandlers() {
 addClickHandler(new ClickHandler() {
  @Override
  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());
  }
 });
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

protected void ensureDomEventHandlers() {
 addClickHandler(new ClickHandler() {
  @Override
  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());
  }
 });
}

代码示例来源:origin: org.geomajas.plugin/geomajas-client-gwt2-plugin-corewidget

private void bindEvents() {
    visibilityToggle.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        if (visibilityToggle.isEnabled()) {
          presenter.toggleLayerVisibility();
          visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
        }
      }
    });
  }
}

代码示例来源:origin: org.kuali.student.core/ks-common-ui

@Override
public HandlerRegistration addClickHandler(ClickHandler handler) {
  if(defaultTableEditor instanceof CheckBox){
    return ((CheckBox)defaultTableEditor).addClickHandler(handler) ;
  }else if(defaultTableEditor instanceof EditableLabel) {
    return ((EditableLabel)defaultTableEditor).addClickHandler(handler) ;
  }
  return null;
}
@Override

代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt

private CheckBox makeCheckBoxToSelectAll() {
  final CheckBox checkBox = new CheckBox( "" );
  checkBox.addClickHandler( new ClickHandler() {
    @Override
    public void onClick(final ClickEvent event) {
      final CheckBox selectAllCheckBox = (CheckBox)event.getSource();
      for (final EIInstanceMinimal eiInstance : instances) {
        final GridRowWidget row = instanceRowMap.get( eiInstance );
        final CheckBox chkBox = row.getCheckBox();
        if ( chkBox != null ) {
          chkBox.setValue( selectAllCheckBox.getValue() );
        }
      }
    }
  } );
  return checkBox;
}

代码示例来源:origin: net.sf.advanced-gwt/advanced-gwt

/**
 * {@inheritDoc}
 */
protected void addListeners(Widget widget) {
  if (clickHandler == null) {
    final GridCell cell = this;
    clickHandler = new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        FlexTable table = getGrid();
        if (table instanceof EditableGrid && ((EditableGrid) table).fireStartEdit(cell))
          ((EditableGrid) table).fireFinishEdit(cell, getNewValue());
      }
    };
    CheckBox checkBox = getCheckBox();
    checkBox.addClickHandler(clickHandler);
  }
}

代码示例来源:origin: sk.seges.acris/acris-widgets-beantable

/**
 * @return the header widget used to select all rows
 */
protected Widget getSelectAllWidget() {
  if (selectAllWidget == null) {
    final CheckBox box = new CheckBox();
    selectAllWidget = box;
    box.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        if (box.getValue()) {
          getDataTable().selectAllRows();
        } else {
          getDataTable().deselectAllRows();
        }
      }
    });
  }
  return selectAllWidget;
}

代码示例来源:origin: stackoverflow.com

public HandlerRegistration addClickHandlerForCheckBox(CheckBox myCheckBox) {
 return myCheckBox.addClickHandler(new MyClickHandler(myCheckBox));
}
public void showData() {
 resetVariables();
 postCodeHandlerReg = addClickHandlerForCheckBox(postCode);
 countryHandlerReg = addClickHandlerForCheckBox(country);
}

代码示例来源:origin: com.ebmwebsourcing.geasytools/model-manager

public UIFieldCheckBox(Boolean defaultValue){
  
  this.uiCheck = new CheckBox();
  
  this.uiCheck.addClickHandler(new ClickHandler() {
    
    @Override
    public void onClick(ClickEvent event) {
      
      setValue(uiCheck.getValue(), true);
      
    }
  });
  
  initWidget(uiCheck);
}

代码示例来源:origin: com.ebmwebsourcing.geasytools/model-manager

cb.addClickHandler(new ClickHandler() {

代码示例来源:origin: fjfd/microscope

private MetricForm addMetricForm(final String label, final int item) {
  final MetricForm metric = new MetricForm(refreshgraph);
  metric.x1y2().addClickHandler(updatey2range);
  metric.setMetricChangeHandler(metric_change_handler);
  metric.setAggregators(aggregators);
  metrics.insert(metric, label, item);
  return metric;
}

代码示例来源:origin: fjfd/microscope

public MetricForm(final EventsHandler handler) {
  events_handler = handler;
  setupDownsampleWidgets();
  downsample.addClickHandler(handler);
  downsampler.addChangeHandler(handler);
  interval.addBlurHandler(handler);
  interval.addKeyPressHandler(handler);
  rate.addClickHandler(handler);
  x1y2.addClickHandler(handler);
  aggregators.addChangeHandler(handler);
  metric.addBlurHandler(handler);
  metric.addKeyPressHandler(handler);
  {
    final EventsHandler metric_handler = new EventsHandler() {
      protected <H extends EventHandler> void onEvent(final DomEvent<H> event) {
        if (metric_change_handler != null) {
          metric_change_handler.onMetricChange(MetricForm.this);
        }
      }
    };
    metric.addBlurHandler(metric_handler);
    metric.addKeyPressHandler(metric_handler);
  }
  metric.setValidationRegexp(TSDB_ID_RE);
  assembleUi();
}

代码示例来源:origin: org.kuali.student.core/ks-common-ui

public void installCheckBoxRowHeaderColumn() {
  columnList.remove(rowHeader);
  rowHeader.setId("RowHeader");
  rowHeader.setName("RowHeader");
  final CheckBox checkBox = new CheckBox();
  checkBox.setTabIndex(-1);
  checkBox.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      int count = getRowCount();
      for (int i = 0; i < count; i++) {
        getRow(i).setSelected(checkBox.getValue());
      }
      fireTableDataChanged();
    }
  });
  DOM.setStyleAttribute(checkBox.getElement(), "style", "padding-right: 0.8em");
  rowHeader.setColumnTitleWidget(checkBox);
  rowHeader.setWidth("40px");
  rowHeader.setVisible(true);
  columnList.add(0, rowHeader);
}

代码示例来源:origin: fjfd/microscope

private void setupDownsampleWidgets() {
  downsampler.setEnabled(false);
  interval.setEnabled(false);
  interval.setMaxLength(5);
  interval.setVisibleLength(5);
  interval.setValue("10m");
  interval.setValidationRegexp("^[1-9][0-9]*[smhdwy]$");
  downsample.addClickHandler(new ClickHandler() {
    public void onClick(final ClickEvent event) {
      final boolean checked = ((CheckBox) event.getSource()).getValue();
      downsampler.setEnabled(checked);
      interval.setEnabled(checked);
      if (checked) {
        downsampler.setFocus(true);
      }
    }
  });
}

代码示例来源:origin: oVirt/ovirt-engine

private CheckBox buildCheckbox(final T checkBoxValue) {
  final CheckBox newCheckBox = new CheckBox(SafeHtmlUtils.fromString(renderer.render(checkBoxValue)));
  newCheckBox.setValue(false);
  newCheckBox.setStyleName(style.checkBox());
  newCheckBox.addClickHandler(event -> {
    // ValueChangeEvent fired to notify the mapped ListModel about the new Selection/deselection.
    ValueChangeEvent.fire(CheckBoxGroup.this, getValue());
  });
  return newCheckBox;
}

代码示例来源:origin: org.opennms.features/org.opennms.features.node-page-list

check.addClickHandler(new ClickHandler() {

代码示例来源:origin: org.jboss.ballroom/widgets

setUndefined(false);
checkBox.addClickHandler(new  ClickHandler() {
  @Override
  public void onClick(ClickEvent clickEvent) {

代码示例来源:origin: fjfd/microscope

y2range.addBlurHandler(refreshgraph);
y2range.addKeyPressHandler(refreshgraph);
ylog.addClickHandler(new AdjustYRangeCheckOnClick(ylog, yrange));
y2log.addClickHandler(new AdjustYRangeCheckOnClick(y2log, y2range));
ylog.addClickHandler(refreshgraph);
y2log.addClickHandler(refreshgraph);
ylabel.addBlurHandler(refreshgraph);
ylabel.addKeyPressHandler(refreshgraph);
wxh.addBlurHandler(refreshgraph);
wxh.addKeyPressHandler(refreshgraph);
horizontalkey.addClickHandler(refreshgraph);
keybox.addClickHandler(refreshgraph);
nokey.addClickHandler(refreshgraph);
smooth.addClickHandler(refreshgraph);

相关文章