本文整理汇总了Java中com.google.gwt.user.client.ui.CheckBox.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBox.addStyleName方法的具体用法?Java CheckBox.addStyleName怎么用?Java CheckBox.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.CheckBox
的用法示例。
在下文中一共展示了CheckBox.addStyleName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProperties
import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public void setProperties(RoomPropertiesInterface properties) {
iProperties = properties;
iRooms.setProperties(properties);
iFutureSessions.clear();
iForm.getRowFormatter().setVisible(iFutureSessionsRow, iProperties.hasFutureSessions());
if (iProperties.hasFutureSessions()) {
CheckBox current = new CheckBox(iProperties.getAcademicSessionName());
current.setValue(true); current.setEnabled(false);
current.addStyleName("future-session");
iFutureSessions.add(current);
for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
if (session.isCanAddGlobalRoomGroup() || session.isCanAddDepartmentalRoomGroup()) {
CheckBox ch = new CheckBox(session.getLabel());
iFutureSessionsToggles.put(session.getId(), ch);
ch.addStyleName("future-session");
iFutureSessions.add(ch);
}
}
}
}
示例2: setProperties
import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public void setProperties(RoomPropertiesInterface properties) {
iProperties = properties;
iRooms.setProperties(properties);
iForm.getRowFormatter().setVisible(iTypeRow, !iProperties.getFeatureTypes().isEmpty());
iType.clear();
if (!iProperties.getFeatureTypes().isEmpty()) {
iType.addItem(MESSAGES.itemNoFeatureType(), "-1");
for (FeatureTypeInterface type: iProperties.getFeatureTypes())
iType.addItem(type.getLabel(), type.getId().toString());
}
iFutureSessions.clear();
iForm.getRowFormatter().setVisible(iFutureSessionsRow, iProperties.hasFutureSessions());
if (iProperties.hasFutureSessions()) {
CheckBox current = new CheckBox(iProperties.getAcademicSessionName());
current.setValue(true); current.setEnabled(false);
current.addStyleName("future-session");
iFutureSessions.add(current);
for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
if (session.isCanAddGlobalRoomGroup() || session.isCanAddDepartmentalRoomGroup()) {
CheckBox ch = new CheckBox(session.getLabel());
iFutureSessionsToggles.put(session.getId(), ch);
ch.addStyleName("future-session");
iFutureSessions.add(ch);
}
}
}
}
示例3: 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);
}
示例4: makeCheckBox
import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
public static CheckBox makeCheckBox(String text,
String tip,
boolean selected,
boolean forceNowrap) {
CheckBox cb = new CheckBox();
cb.addStyleName("gwtutil-checkbox");
cb.setValue(selected);
cb.setHTML(text);
cb.setTitle(tip);
if (forceNowrap) {
setStyle(cb, "whiteSpace", "nowrap");
}
return cb;
}
示例5: create
import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
@Override
public Widget create(String machineName, List<RuntimeInfo> runtimeList) {
VerticalPanel panel = new VerticalPanel();
panel.ensureDebugId("runtimeInfoVerticalPanel");
panel.setWidth("100%");
Label caption = new Label(locale.cellTableCaption(machineName));
caption.ensureDebugId("runtimeInfoCellTableCaption");
caption.addStyleName(resources.cellTableStyle().cellTableCaption());
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.setWidth("100%");
hPanel.ensureDebugId("runtimeInfoCellTableHeaderWrapper");
hPanel.add(caption);
ListDataProvider<RuntimeInfo> dataProvider = new ListDataProvider<>(runtimeList);
CheckBox hideCheckBox = new CheckBox("Hide internal servers");
hideCheckBox.addValueChangeHandler(
event -> {
if (event.getValue()) { // if hide = true
dataProvider.setList(
runtimeList
.stream()
.filter(info -> !isNullOrEmpty(info.getPort()))
.collect(toList()));
} else {
dataProvider.setList(runtimeList);
}
dataProvider.refresh();
});
hideCheckBox.addStyleName(resources.cellTableStyle().cellTableHideServersCheckBox());
hideCheckBox.ensureDebugId("runtimeInfoHideServersCheckBox");
hPanel.add(hideCheckBox);
panel.add(hPanel);
panel.add(createCellTable(dataProvider));
return new ScrollPanel(panel);
}
示例6: buildScopePopup
import com.google.gwt.user.client.ui.CheckBox; //导入方法依赖的package包/类
/**
* Rebuild the popup from scratch with all of the scopes that we have from the last time we were
* presented.
*/
private void buildScopePopup() {
scopePanel.clear();
additionalScopePanel.clear();
Set<TextBox> oldEditors = Sets.newLinkedHashSet(freeFormEditors);
freeFormEditors.clear();
// Hide the service scopes label if there aren't any.
hasScopesText.setVisible(!scopesFromDiscovery.isEmpty());
noScopesText.setVisible(scopesFromDiscovery.isEmpty());
// Show different text on the free-form scopes section when there are discovery scopes.
optionalAdditionalScopes.setVisible(!scopesFromDiscovery.isEmpty());
for (final Map.Entry<String, AuthScope> scope : scopesFromDiscovery.entrySet()) {
// Add the check box to the table.
CheckBox scopeToggle = new CheckBox();
SafeHtmlBuilder safeHtml = new SafeHtmlBuilder();
safeHtml.appendEscaped(scope.getKey()).appendHtmlConstant("<br><span>")
.appendEscaped(scope.getValue().getDescription()).appendHtmlConstant("</span>");
scopeToggle.setHTML(safeHtml.toSafeHtml());
scopeToggle.addStyleName(style.discoveryScopeSelector());
scopePanel.add(scopeToggle);
// When the box is checked, add our scope to the selected list.
scopeToggle.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
CheckBox checkBox = (CheckBox) event.getSource();
if (checkBox.getValue()) {
selectedScopes.add(scope.getKey());
} else {
selectedScopes.remove(scope.getKey());
}
}
});
// Enable the check box if the scope is selected.
scopeToggle.setValue(selectedScopes.contains(scope.getKey()));
}
// Process any scopes that are extra.
for (TextBox editor : oldEditors) {
if (!editor.getValue().trim().isEmpty()) {
addFreeFormEditorRow(editor.getValue(), true);
}
}
// There should always be one empty editor.
addFreeFormEditorRow("", false);
}