本文整理匯總了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);
}