本文整理汇总了Java中com.google.gwt.aria.client.Id类的典型用法代码示例。如果您正苦于以下问题:Java Id类的具体用法?Java Id怎么用?Java Id使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Id类属于com.google.gwt.aria.client包,在下文中一共展示了Id类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addRow
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
public int addRow(Widget header, Widget... widgets) {
if (header.getElement().getId() == null || header.getElement().getId().isEmpty())
header.getElement().setId(DOM.createUniqueId());
P head = new P(DOM.createSpan(), "header-cell");
head.add(header);
add(head);
for (Widget widget: widgets) {
P body = new P(DOM.createSpan(), "content-cell");
add(body);
if (widget instanceof UniTimeTable) {
ScrollPanel scroll = new ScrollPanel(widget);
scroll.addStyleName("scroll");
body.add(scroll);
} else {
body.add(widget);
}
}
if (widgets.length > 0) {
if (widgets[0] instanceof UniTimeWidget)
Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widgets[0]).getWidget().getElement(), Id.of(header.getElement()));
else
Roles.getTextboxRole().setAriaLabelledbyProperty(widgets[0].getElement(), Id.of(header.getElement()));
}
return getWidgetCount() - widgets.length;
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:26,代码来源:FlowForm.java
示例2: addRow
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
public int addRow(Widget header, Widget widget, int colSpan) {
header.addStyleName("label-cell");
int row = getRowCount();
setWidget(row, 0, header);
getCellFormatter().setStyleName(row, 0, "label-td");
if (widget instanceof HasMobileScroll) {
ScrollPanel scroll = new ScrollPanel(widget);
scroll.addStyleName("table-cell");
setWidget(row, 1, scroll);
getCellFormatter().setStyleName(row, 1, "table-td");
} else {
widget.addStyleName("widget-cell");
setWidget(row, 1, widget);
getCellFormatter().setStyleName(row, 1, "widget-td");
}
if (colSpan != 1)
getFlexCellFormatter().setColSpan(row, 1, colSpan);
if (header.getElement().getId() == null || header.getElement().getId().isEmpty())
header.getElement().setId(DOM.createUniqueId());
if (widget instanceof UniTimeWidget)
Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widget).getWidget().getElement(), Id.of(header.getElement()));
else
Roles.getTextboxRole().setAriaLabelledbyProperty(widget.getElement(), Id.of(header.getElement()));
return row;
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:26,代码来源:SimpleForm.java
示例3: selectItem
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
protected void selectItem(SuggestionItem item) {
if (item == selectedSuggestion) {
return;
}
if (selectedSuggestion != null) {
selectedSuggestion.updateSelection(false);
}
if (item != null) {
item.updateSelection(true);
Roles.getMenubarRole().setAriaActivedescendantProperty(getElement(), Id.of(item.getElement()));
}
selectedSuggestion = item;
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:SuggestionsContainer.java
示例4: AriaCheckBox
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
public AriaCheckBox(Element elem) {
super(elem);
iAriaLabel = DOM.createLabel();
iAriaLabel.setId(DOM.createUniqueId());
iAriaLabel.setClassName("unitime-AriaLabel");
DOM.appendChild(getElement(), iAriaLabel);
Roles.getCheckboxRole().setAriaLabelledbyProperty(elem, Id.of(iAriaLabel));
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:AriaCheckBox.java
示例5: insertTabWidget
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
@Override
protected void insertTabWidget(Widget widget, int beforeIndex) {
super.insertTabWidget(widget, beforeIndex);
Roles.getTabRole().setAriaSelectedState(getTabElement(beforeIndex), SelectedValue.FALSE);
getTabElement(beforeIndex).setId(DOM.createUniqueId());
Id ids[] = new Id[getTabCount()];
for (int i = 0; i < getTabCount(); i++) {
Roles.getTabRole().setAriaLabelProperty(getTabElement(i), ARIA.tabNotSelected(1 + i, getTabCount(), getTabLabel(i)));
ids[i] = Id.of(getTabElement(i));
}
Roles.getTablistRole().setAriaOwnsProperty(getElement(), ids);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:13,代码来源:AriaTabBar.java
示例6: removeTab
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
@Override
public void removeTab(int index) {
super.removeTab(index);
Id ids[] = new Id[getTabCount()];
for (int i = 0; i < getTabCount(); i++) {
Roles.getTabRole().setAriaLabelProperty(getTabElement(i), ARIA.tabNotSelected(1 + i, getTabCount(), getTabLabel(i)));
ids[i] = Id.of(getTabElement(i));
}
Roles.getTablistRole().setAriaOwnsProperty(getElement(), ids);
if (getSelectedTab() >= 0) {
Roles.getTabRole().setAriaSelectedState(getTabElement(getSelectedTab()), SelectedValue.TRUE);
Roles.getTabRole().setAriaLabelProperty(getTabElement(getSelectedTab()), ARIA.tabSelected(1 + getSelectedTab(), getTabCount(), getTabLabel(getSelectedTab())));
}
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:AriaTabBar.java
示例7: setAriaLabel
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
@Override
public void setAriaLabel(String text) {
if (iWidget instanceof HasAriaLabel) {
((HasAriaLabel)iWidget).setAriaLabel(text);
} else {
if (iAriaLabel == null) {
iAriaLabel = DOM.createLabel();
iAriaLabel.setId(DOM.createUniqueId());
iAriaLabel.setClassName("hidden-label");
DOM.appendChild(getElement(), iAriaLabel);
Roles.getCheckboxRole().setAriaLabelledbyProperty(iWidget.getElement(), Id.of(iAriaLabel));
}
iAriaLabel.setInnerText(text);
}
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:16,代码来源:UniTimeWidget.java
示例8: setDescription
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
void setDescription(String description, ContentMode contentMode) {
Element element = getInput();
if (description == null || description.isEmpty() || description.trim().isEmpty()) {
if (hasFeedback) {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(this.feedback));
} else {
Roles.getTextboxRole().removeAriaDescribedbyProperty(element);
}
small.setInnerHTML(isDescriptionHeightReservedIfEmpty ? " " : "");
hasDescription = false;
return;
}
if (!hasDescription) {
if (hasFeedback) {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(small), Id.of(this.feedback));
} else {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(small));
}
hasDescription = true;
}
if (ContentMode.HTML == contentMode) {
small.setInnerHTML(description);
} else {
small.setInnerText(description);
}
}
开发者ID:knoobie,项目名称:bootstrap-formgroup,代码行数:30,代码来源:ClientSideFormGroup.java
示例9: setFeedback
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
void setFeedback(String feedback, ContentMode contentMode) {
Element element = getInput();
if (feedback == null || feedback.isEmpty() || feedback.trim().isEmpty()) {
if (hasDescription) {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(small));
} else {
Roles.getTextboxRole().removeAriaDescribedbyProperty(element);
}
this.feedback.setInnerHTML(isFeedbackHeightReservedIfEmpty ? " " : "");
hasFeedback = false;
return;
}
if (!hasFeedback) {
if (hasDescription) {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(small), Id.of(this.feedback));
} else {
Roles.getTextboxRole().setAriaDescribedbyProperty(element, Id.of(this.feedback));
}
hasFeedback = true;
}
if (ContentMode.HTML == contentMode) {
this.feedback.setInnerHTML(feedback);
} else {
this.feedback.setInnerText(feedback);
}
}
开发者ID:knoobie,项目名称:bootstrap-formgroup,代码行数:30,代码来源:ClientSideFormGroup.java
示例10: _updateAriaAttributes
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
private void _updateAriaAttributes() {
// Set the 'aria-level' state. To do this, the computation of the currently selected item's level is needed
Roles.getTreeitemRole()
.setAriaLevelProperty(_focusedItem.getElement(),
TreeViewUtils.itemLevelOf(_focusedItem));
// Set the 'aria-setsize' state. To do this, the computation of the currently selected item's slibings number is needed
Roles.getTreeitemRole()
.setAriaSetsizeProperty(_focusedItem.getElement(),
_focusedItem.getChildCount());
// Set the 'aria-posinset' state. To do this, the computation of the currently selected item's index between slibings is needed
int curSelectionIndex = _focusedItem.getChildIndex(_focusedItem);
Roles.getTreeitemRole()
.setAriaPosinsetProperty(_focusedItem.getElement(),
curSelectionIndex + 1);
// Set the 'aria-expanded' state. This depends on the state of the currently selected item.
// If the item has no children, we remove the 'aria-expanded' state.
if (_focusedItem.getChildCount() == 0) {
Roles.getTreeitemRole()
.removeAriaExpandedState(_focusedItem.getElement());
} else {
Roles.getTreeitemRole()
.setAriaExpandedState(_focusedItem.getElement(),
ExpandedValue.of(_focusedItem.isExpanded()));
}
// Make sure that 'aria-selected' is true.
Roles.getTreeitemRole()
.setAriaSelectedState(_focusedItem.getElement(),
SelectedValue.of(true));
// Update the 'aria-activedescendant' state for the focusable element to match the id of the currently selected item
Roles.getTreeRole()
.setAriaActivedescendantProperty(this.getElement(),
Id.of(_focusedItem.getElement()));
}
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:40,代码来源:TreeView.java
示例11: AriaSuggestBox
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
public AriaSuggestBox(AriaTextBox box, SuggestOracle oracle) {
iOracle = oracle;
iText = box;
iText.setStyleName("gwt-SuggestBox");
initWidget(iText);
addEventsToTextBox();
iSuggestionMenu = new SuggestionMenu();
iPopupScroll = new ScrollPanel(iSuggestionMenu);
iPopupScroll.addStyleName("scroll");
iSuggestionPopup = new PopupPanel(true, false);
iSuggestionPopup.setPreviewingAllNativeEvents(true);
iSuggestionPopup.setStyleName("unitime-SuggestBoxPopup");
iSuggestionPopup.setWidget(iPopupScroll);
iSuggestionPopup.addAutoHidePartner(getElement());
iSuggestionCallback = new SuggestionCallback() {
@Override
public void onSuggestionSelected(Suggestion suggestion) {
if (!suggestion.getReplacementString().isEmpty()) {
setStatus(ARIA.suggestionSelected(status(suggestion)));
}
iCurrentText = suggestion.getReplacementString();
setText(suggestion.getReplacementString());
hideSuggestionList();
fireSuggestionEvent(suggestion);
}
};
iOracleCallback = new SuggestOracle.Callback() {
@Override
public void onSuggestionsReady(Request request, Response response) {
if (response.getSuggestions() == null || response.getSuggestions().isEmpty()) {
if (iSuggestionPopup.isShowing()) iSuggestionPopup.hide();
} else {
iSuggestionMenu.clearItems();
SuggestOracle.Suggestion first = null;
for (SuggestOracle.Suggestion suggestion: response.getSuggestions()) {
iSuggestionMenu.addItem(new SuggestionMenuItem(suggestion));
if (first == null) first = suggestion;
}
iSuggestionMenu.selectItem(0);
ToolBox.setMinWidth(iSuggestionMenu.getElement().getStyle(), (iText.getElement().getClientWidth() - 4) + "px");
iSuggestionPopup.showRelativeTo(iText);
iSuggestionMenu.scrollToView();
if (response.getSuggestions().size() == 1) {
if (first.getReplacementString().isEmpty())
setStatus(status(first));
else
setStatus(ARIA.showingOneSuggestion(status(first)));
} else {
setStatus(ARIA.showingMultipleSuggestions(response.getSuggestions().size(), request.getQuery(), status(first)));
}
}
}
};
Roles.getTextboxRole().setAriaAutocompleteProperty(iText.getElement(), AutocompleteValue.NONE);
iSuggestionPopup.getElement().setAttribute("id", DOM.createUniqueId());
Roles.getTextboxRole().setAriaOwnsProperty(iText.getElement(), Id.of(iSuggestionPopup.getElement()));
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:66,代码来源:AriaSuggestBox.java
示例12: AriaDialogBox
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
public AriaDialogBox(boolean autoHide, boolean modal, Caption caption) {
super(autoHide, modal, caption);
Roles.getDialogRole().set(getElement());
caption.asWidget().getElement().setId(DOM.createUniqueId());
Roles.getDialogRole().setAriaLabelledbyProperty(getElement(), Id.of(caption.asWidget().getElement()));
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:7,代码来源:AriaDialogBox.java
示例13: accessibilityPrepare
import com.google.gwt.aria.client.Id; //导入依赖的package包/类
private void accessibilityPrepare(){
// Set UI labels for accessibility
trafficButton.setTitle("traffic Map");
ferriesButton.setTitle("ferries");
passesButton.setTitle("mountain passes");
socialButton.setTitle("social media");
tollingButton.setTitle("toll rates");
borderButton.setTitle("border waits");
amtrakButton.setTitle("amtrak cascades");
aboutButton.setTitle("about the app");
alertsCarousel.setTitle("high impact alerts");
star.setAltText("star");
// Set ARIA roles for accessibility
Roles.getButtonRole().set(trafficButton.getElement());
Roles.getButtonRole().set(ferriesButton.getElement());
Roles.getButtonRole().set(passesButton.getElement());
Roles.getButtonRole().set(socialButton.getElement());
Roles.getButtonRole().set(tollingButton.getElement());
Roles.getButtonRole().set(borderButton.getElement());
Roles.getButtonRole().set(amtrakButton.getElement());
Roles.getButtonRole().set(aboutButton.getElement());
Roles.getHeadingRole().set(highImpactAlertsPanel.getElement());
Roles.getHeadingRole().set(heading.getElement());
Roles.getTabRole().set(homeTab.getElement());
Roles.getTabRole().setAriaSelectedState(homeTab.getElement(), SelectedValue.TRUE);
Roles.getTabRole().setAriaLabelProperty(homeTab.getElement(), "home");
Roles.getTabRole().set(favoritesTab.getElement());
Roles.getTabRole().setAriaSelectedState(favoritesTab.getElement(), SelectedValue.FALSE);
Roles.getTabRole().setAriaLabelProperty(favoritesTab.getElement(), "favorites");
Roles.getProgressbarRole().set(progressIndicator.getElement());
Roles.getProgressbarRole().setAriaLabelProperty(progressIndicator.getElement(), "loading indicator");
// Define flow
Roles.getHeadingRole().setAriaFlowtoProperty(heading.getElement(), Id.of(trafficButton.getElement()));
// Hide redundant content from VoiceOver
Roles.getHeadingRole().setAriaHiddenState(trafficTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(ferriesTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(passesTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(socialTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(tollingTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(borderTitle.getElement(), true);
Roles.getHeadingRole().setAriaHiddenState(amtrakTitle.getElement(), true);
// TODO Hide pull down until we can figure out how to get VoiceOver to work with it
Roles.getButtonRole().setAriaHiddenState(pullArrowHeader.getElement(), true);
accessibilityShowHome();
}
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:58,代码来源:HomeViewGwtImpl.java
注:本文中的com.google.gwt.aria.client.Id类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论