当前位置: 首页>>代码示例>>Java>>正文


Java CheckBox.addValueChangeHandler方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.CheckBox.addValueChangeHandler方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBox.addValueChangeHandler方法的具体用法?Java CheckBox.addValueChangeHandler怎么用?Java CheckBox.addValueChangeHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.CheckBox的用法示例。


在下文中一共展示了CheckBox.addValueChangeHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PeriodPreferencesWidget

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public PeriodPreferencesWidget(boolean editable) {
	iEditable = editable;

	iPanel = new AbsolutePanel();
	
	iHorizontal = new CheckBox(MESSAGES.periodPreferenceHorizontal());
	iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
		@Override
		public void onValueChange(ValueChangeEvent<Boolean> event) {
			RoomCookie.getInstance().setHorizontal(iHorizontal.getValue());
			render();
		}
	});
	
	initWidget(iPanel);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:PeriodPreferencesWidget.java

示例2: addOneKey

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
private void addOneKey(GpgKeyInfo k) {
  int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  CheckBox sel = new CheckBox();
  sel.addValueChangeHandler(updateDeleteHandler);
  table.setWidget(row, 0, sel);
  table.setWidget(row, 1, new CopyableLabel(k.id()));
  table.setText(row, 2, k.fingerprint());

  VerticalPanel userIds = new VerticalPanel();
  for (int i = 0; i < k.userIds().length(); i++) {
    userIds.add(new InlineLabel(k.userIds().get(i)));
  }
  table.setWidget(row, 3, userIds);

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, k);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:MyGpgKeysScreen.java

示例3: renderCheckBox

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
private void renderCheckBox(int row, LabelAndValues lv) {
  ApprovalInfo self =
      Gerrit.isSignedIn() ? lv.info.forUser(Gerrit.getUserAccount().getId().get()) : null;

  final String id = lv.info.name();
  final CheckBox b = new CheckBox();
  b.setText(id);
  b.setEnabled(lv.permitted.contains((short) 1));
  if (self != null && self.value() == 1) {
    b.setValue(true);
  }
  b.addValueChangeHandler(
      new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
          in.label(id, event.getValue() ? (short) 1 : (short) 0);
        }
      });
  b.setStyleName(style.label_name());
  labelsTable.setWidget(row, 0, b);

  CellFormatter fmt = labelsTable.getCellFormatter();
  fmt.setStyleName(row, labelHelpColumn, style.label_help());
  labelsTable.setText(row, labelHelpColumn, lv.info.valueText("+1"));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:ReplyBox.java

示例4: RequestedServiceToggle

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public RequestedServiceToggle(EventServiceProviderInterface provider) {
	super("toggle");
	iProvider = provider;
	iCheckbox = new CheckBox(provider.getLabel());
	add(iCheckbox);
	if (provider.hasMessage()) {
		iDescription = new P("description");
		iDescription.setHTML(provider.getMessage());
		iCheckbox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
			@Override
			public void onValueChange(ValueChangeEvent<Boolean> event) {
				iDescription.setVisible(event.getValue());
			}
		});
		iDescription.setVisible(false);
		add(iDescription);
	}
}
 
开发者ID:UniTime,项目名称:unitime,代码行数:19,代码来源:EventAdd.java

示例5: FieldsEditor

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public FieldsEditor(ApiService service, String key) {
  super("");

  this.service = service;
  this.key = key;
  root = new CheckBox(key.isEmpty() ? "Select all/none" : key);
  root.setValue(false);
  root.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
    @Override
    public void onValueChange(ValueChangeEvent<Boolean> event) {
      for (HasValue<Boolean> checkBox : children.values()) {
        checkBox.setValue(event.getValue(), true);
      }
    }
  });
  add(root);
}
 
开发者ID:showlowtech,项目名称:google-apis-explorer,代码行数:18,代码来源:FieldsEditor.java

示例6: BooleanPropertyEditor

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
/**
 * Creates a new property editor for boolean values.
 *
 * @param trueValue  spelling of true value
 * @param falseValue  spelling of false value
 */
public BooleanPropertyEditor(String trueValue, String falseValue) {
  this.trueValue = trueValue;
  this.falseValue = falseValue;

  checkbox = new CheckBox();
  checkbox.addValueChangeHandler(this);

  initWidget(checkbox);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:16,代码来源:BooleanPropertyEditor.java

示例7: addCheckBox

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
private void addCheckBox(Panel panel, String caption, boolean initValue,
    ValueChangeHandler<Boolean> handler) {
  CheckBox box = new CheckBox(caption);
  box.setValue(initValue);
  box.addValueChangeHandler(handler);
  panel.add(box);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:8,代码来源:DebugOptions.java

示例8: createEditToggleCheckBox

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
private CheckBox createEditToggleCheckBox(final Editor editor) {
  CheckBox check = new CheckBox("Toggle edit");
  check.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
    @Override
    public void onValueChange(ValueChangeEvent<Boolean> event) {
      setEditing(editor, event.getValue());
    }
  });
  return check;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:EditorHarness.java

示例9: EditorBooleanPropertyWidget

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public EditorBooleanPropertyWidget(String name, boolean value) {
  propertyName.setText(name);

  propertyValueBox = new CheckBox();
  propertyValueBox.setValue(value);
  propertyValueBox.addValueChangeHandler(this);
  valuePanel.add(propertyValueBox);
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:EditorBooleanPropertyWidget.java

示例10: CommitViewImpl

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
/** Create view. */
@Inject
protected CommitViewImpl(GitResources res, GitLocalizationConstant locale) {
  this.res = res;
  this.locale = locale;
  this.message = new ShiftableTextArea();
  this.ensureDebugId("git-commit-window");

  this.setTitle(locale.commitTitle());

  Widget widget = uiBinder.createAndBindUi(this);
  this.setWidget(widget);

  btnCancel =
      createButton(
          locale.buttonCancel(), "git-commit-cancel", event -> delegate.onCancelClicked());
  btnCommit =
      createButton(
          locale.buttonCommit(), "git-commit-commit", event -> delegate.onCommitClicked());
  btnCommit.addStyleName(resources.windowCss().primaryButton());

  remoteBranches = new ListBox();
  remoteBranches.setEnabled(false);
  remoteBranches.getElement().setAttribute("style", "width: 230px");

  pushAfterCommit = new CheckBox();
  pushAfterCommit.setHTML(locale.commitPushCheckboxTitle());
  pushAfterCommit.ensureDebugId("push-after-commit-check-box");
  pushAfterCommit.addValueChangeHandler(event -> remoteBranches.setEnabled(event.getValue()));

  pushAfterCommit.addStyleName(res.gitCSS().spacing());
  getFooter().add(pushAfterCommit);
  getFooter().add(remoteBranches);

  addButtonToFooter(btnCommit);
  addButtonToFooter(btnCancel);
}
 
开发者ID:eclipse,项目名称:che,代码行数:38,代码来源:CommitViewImpl.java

示例11: populate

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
void populate(int row, TagInfo k) {
  if (k.canDelete()) {
    CheckBox sel = new CheckBox();
    sel.addValueChangeHandler(updateDeleteHandler);
    table.setWidget(row, 1, sel);
    canDelete = true;
  } else {
    table.setText(row, 1, "");
  }

  table.setWidget(row, 2, new InlineHTML(highlight(k.getShortName(), match)));

  if (k.revision() != null) {
    table.setText(row, 3, k.revision());
  } else {
    table.setText(row, 3, "");
  }

  FlowPanel actionsPanel = new FlowPanel();
  if (k.webLinks() != null) {
    for (WebLinkInfo webLink : Natives.asList(k.webLinks())) {
      actionsPanel.add(webLink.toAnchor());
    }
  }
  table.setWidget(row, 4, actionsPanel);

  FlexCellFormatter fmt = table.getFlexCellFormatter();
  String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
  String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
  fmt.addStyleName(row, 1, iconCellStyle);
  fmt.addStyleName(row, 2, dataCellStyle);
  fmt.addStyleName(row, 3, dataCellStyle);
  fmt.addStyleName(row, 4, dataCellStyle);

  setRowItem(row, k);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:37,代码来源:ProjectTagsScreen.java

示例12: addOneId

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
void addOneId(ExternalIdInfo k) {
  if (k.isUsername()) {
    // Don't display the username as an identity here.
    return;
  }

  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  final int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  if (k.canDelete()) {
    final CheckBox sel = new CheckBox();
    sel.addValueChangeHandler(updateDeleteHandler);
    table.setWidget(row, 1, sel);
  } else {
    table.setText(row, 1, "");
  }
  if (k.isTrusted()) {
    table.setText(row, 2, "");
  } else {
    table.setText(row, 2, Util.C.untrustedProvider());
    fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().identityUntrustedExternalId());
  }
  if (k.emailAddress() != null && k.emailAddress().length() > 0) {
    table.setText(row, 3, k.emailAddress());
  } else {
    table.setText(row, 3, "");
  }
  table.setText(row, 4, k.describe());

  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());

  setRowItem(row, k);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:39,代码来源:MyIdentitiesScreen.java

示例13: addOneKey

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
void addOneKey(SshKeyInfo k) {
  final FlexCellFormatter fmt = table.getFlexCellFormatter();
  final int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  final CheckBox sel = new CheckBox();
  sel.addValueChangeHandler(updateDeleteHandler);

  table.setWidget(row, 1, sel);
  if (k.isValid()) {
    table.setText(row, 2, "");
    fmt.removeStyleName(
        row,
        2, //
        Gerrit.RESOURCES.css().sshKeyPanelInvalid());
  } else {
    table.setText(row, 2, Util.C.sshKeyInvalid());
    fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().sshKeyPanelInvalid());
  }
  table.setText(row, 3, k.algorithm());

  CopyableLabel keyLabel = new CopyableLabel(k.sshPublicKey());
  keyLabel.setPreviewText(elide(k.encodedKey(), 40));
  table.setWidget(row, 4, keyLabel);

  table.setText(row, 5, k.comment());

  fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
  fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().sshKeyPanelEncodedKey());
  for (int c = 2; c <= 5; c++) {
    fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
  }

  setRowItem(row, k);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:37,代码来源:SshPanel.java

示例14: CombinationPropertyPart

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public CombinationPropertyPart (Map<String, String> options) {
	initWidget(uiBinder.createAndBindUi(this));
	CheckBox checkBox;
	for (String key : options.keySet()) {
		pnlCheckBoxes.add(checkBox = new CheckBox());
		checkBox.setFormValue(key);
		checkBox.setText(options.get(key));
		checkBox.addValueChangeHandler(CHECKED);
		checkBox.setStyleName(style.checkbox());
		checkBoxes.put(key, checkBox);
	}
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:13,代码来源:CombinationPropertyPart.java

示例15: buildPanel

import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
@Override
public void buildPanel() {
    ViewerOptions viewerOptions = new ViewerOptions();
    viewerOptions.skyAtmosphere = null;
    final ViewerPanel csVPanel = new ViewerPanel(viewerOptions);

    CesiumTerrainProviderOptions terrainProviderOptions = new CesiumTerrainProviderOptions();
    terrainProviderOptions.url = "https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles";
    terrainProviderOptions.requestWaterMask = true;
    terrainProviderOptions.requestVertexNormals = true;
    csVPanel.getViewer().terrainProvider = new CesiumTerrainProvider(terrainProviderOptions);

    Cartesian3 position = Cartesian3.fromRadians(-2.0862979473351286, 0.6586620013036164, 1400.0);

    BoxGraphicsOptions boxGraphicsOptions = new BoxGraphicsOptions();
    boxGraphicsOptions.dimensions = new ConstantProperty<>(new Cartesian3(1400.0, 1400.0, 2800.0));
    boxGraphicsOptions.material = new ColorMaterialProperty(Color.WHITE().withAlpha(0.3f));
    boxGraphicsOptions.outline = new ConstantProperty<>(true);
    boxGraphicsOptions.outlineColor = new ConstantProperty<>(Color.WHITE());

    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(position);
    entityOptions.box = new BoxGraphics(boxGraphicsOptions);
    Entity entity = csVPanel.getViewer().entities().add(entityOptions);

    ModelGraphicsOptions modelGraphicsOptions = new ModelGraphicsOptions();
    modelGraphicsOptions.uri = new ConstantProperty<>(GWT.getModuleBaseURL() + "SampleData/models/CesiumMan/Cesium_Man.glb");
    modelGraphicsOptions.minimumPixelSize = new ConstantProperty<>(128);
    modelGraphicsOptions.maximumScale = new ConstantProperty<>(800);

    entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(position);
    entityOptions.model = new ModelGraphics(modelGraphicsOptions);
    csVPanel.getViewer().entities().add(entityOptions);

    ClippingPlaneCollectionOptions clippingPlaneCollectionOptions = new ClippingPlaneCollectionOptions();
    clippingPlaneCollectionOptions.modelMatrix = entity.computeModelMatrix(JulianDate.now());
    clippingPlaneCollectionOptions.planes = new Plane[] {
            new Plane(new Cartesian3(1.0,  0.0, 0.0), -700.0),
            new Plane(new Cartesian3(-1.0,  0.0, 0.0), -700.0),
            new Plane(new Cartesian3(0.0,  1.0, 0.0), -700.0),
            new Plane(new Cartesian3(0.0, -1.0, 0.0), -700.0)
    };
    clippingPlaneCollectionOptions.edgeWidth = 1.0;
    clippingPlaneCollectionOptions.edgeColor = Color.WHITE();

    final Globe globe = csVPanel.getViewer().scene().globe;
    globe.depthTestAgainstTerrain = true;
    globe.clippingPlanes = new ClippingPlaneCollection(clippingPlaneCollectionOptions);

    csVPanel.getViewer().trackedEntity = entity;

    CheckBox globeClippingCBox = new CheckBox("Globe clipping planes enabled");
    globeClippingCBox.setValue(true);
    globeClippingCBox.getElement().getStyle().setColor("white");
    globeClippingCBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            globe.clippingPlanes.enabled = event.getValue();
        }
    });

    AbsolutePanel aPanel = new AbsolutePanel();
    aPanel.add(csVPanel);
    aPanel.add(globeClippingCBox, 20, 20);

    contentPanel.add(new HTML("<p>User-defined clipping planes applied to terrain.</p>"));
    contentPanel.add(aPanel);

    initWidget(contentPanel);
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:72,代码来源:TerrainClippingPlanes.java


注:本文中的com.google.gwt.user.client.ui.CheckBox.addValueChangeHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。