當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。