本文整理汇总了Java中com.google.gwt.aria.client.Roles类的典型用法代码示例。如果您正苦于以下问题:Java Roles类的具体用法?Java Roles怎么用?Java Roles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Roles类属于com.google.gwt.aria.client包,在下文中一共展示了Roles类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: UniTimeTable
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
public UniTimeTable() {
setCellPadding(2);
setCellSpacing(0);
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONCLICK);
sinkEvents(Event.ONKEYDOWN);
sinkEvents(Event.ONDBLCLICK);
setStylePrimaryName("unitime-MainTable");
iHintPanel = new PopupPanel();
iHintPanel.setStyleName("unitime-PopupHint");
Roles.getGridRole().set(getElement());
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:14,代码来源:UniTimeTable.java
示例2: addRow
import com.google.gwt.aria.client.Roles; //导入依赖的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
示例3: addRow
import com.google.gwt.aria.client.Roles; //导入依赖的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
示例4: ChipPanel
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
public ChipPanel(Chip chip, String color) {
iChip = chip;
setStyleName("chip");
addStyleName(color);
iLabel = new Label(chip.getTranslatedValue());
iLabel.setStyleName("text");
add(iLabel);
iButton = new HTML("×");
iButton.setStyleName("button");
add(iButton);
if (chip.hasToolTip())
setTitle(toString() + "\n" + chip.getToolTip());
else
setTitle(toString());
Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:FilterBox.java
示例5: setTextInputAllowed
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
public void setTextInputAllowed(boolean textInputAllowed) {
debug("VComboBoxMultiselect: setTextInputAllowed()");
// Always update styles as they might have been overwritten
if (textInputAllowed) {
removeStyleDependentName(STYLE_NO_INPUT);
Roles.getTextboxRole()
.removeAriaReadonlyProperty(this.tb.getElement());
} else {
addStyleDependentName(STYLE_NO_INPUT);
Roles.getTextboxRole()
.setAriaReadonlyProperty(this.tb.getElement(), true);
}
if (this.textInputEnabled == textInputAllowed) {
return;
}
this.textInputEnabled = textInputAllowed;
updateReadOnly();
}
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:21,代码来源:VComboBoxMultiselect.java
示例6: onStateChanged
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
getWidget().captionManagedByLayout = getState().captionManagedByLayout;
super.onStateChanged(stateChangeEvent);
if (!getWidget().captionManagedByLayout
&& isContextHelpIconEnabled()) {
if (getWidget().contextHelpIcon == null) {
getWidget().contextHelpIcon = DOM.createSpan();
getWidget().contextHelpIcon.setInnerHTML("?");
getWidget().contextHelpIcon.setClassName(CONTEXT_HELP_CLASSNAME);
Roles.getTextboxRole().setAriaHiddenState(getWidget().contextHelpIcon, true);
getWidget().getElement().appendChild(getWidget().contextHelpIcon);
DOM.sinkEvents(getWidget().contextHelpIcon, VTooltip.TOOLTIP_EVENTS | Event.ONCLICK);
} else {
getWidget().contextHelpIcon.getStyle().clearDisplay();
}
} else if (getWidget().contextHelpIcon != null) {
getWidget().contextHelpIcon.getStyle()
.setDisplay(Style.Display.NONE);
getWidget().setAriaInvalid(false);
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:CubaCheckBoxConnector.java
示例7: SuggestionPopup
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public SuggestionPopup(Widget widget) {
super(true, true, true);
com.google.gwt.user.client.Element popup = getElement();
popup.getStyle().setZIndex(Z_INDEX);
Roles.getListRole().set(popup);
setStylePrimaryName(V_FILTERSELECT_SUGGESTPOPUP);
setAutoHideEnabled(true);
setOwner(CubaSuggestionFieldWidget.this);
addCloseHandler(this);
setWidget(widget);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:CubaSuggestionFieldWidget.java
示例8: selectItem
import com.google.gwt.aria.client.Roles; //导入依赖的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
示例9: SuggestionMenuItem
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public SuggestionMenuItem(String text, boolean asHTML) {
setElement(DOM.createTD());
setSelectionStyle(false);
if (asHTML) {
setHTML(text);
} else {
setText(text);
}
setStyleName("gwt-MenuItem");
getElement().setAttribute("id", DOM.createUniqueId());
// Add a11y role "menuitem"
Roles.getMenuitemRole().set(getElement());
}
开发者ID:markoradinovic,项目名称:suggestfield,代码行数:17,代码来源:SuggestionMenuItem.java
示例10: accessibilityPrepare
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
private void accessibilityPrepare(){
// Add ARIA roles for accessibility
Roles.getButtonRole().set(backButton.getElement());
Roles.getButtonRole().setAriaLabelProperty(backButton.getElement(), "back");
Roles.getHeadingRole().set(heading.getElement());
Roles.getCheckboxRole().set(starButton.getElement());
Roles.getCheckboxRole().setAriaLabelProperty(starButton.getElement(), "favorite");
Roles.getTabRole().set(sailingsTab.getElement());
Roles.getTabRole().setAriaSelectedState(sailingsTab.getElement(), SelectedValue.TRUE);
Roles.getTabRole().setAriaLabelProperty(sailingsTab.getElement(), "sailings");
Roles.getTabRole().set(alertsTab.getElement());
Roles.getTabRole().setAriaSelectedState(alertsTab.getElement(), SelectedValue.FALSE);
Roles.getTabRole().setAriaLabelProperty(alertsTab.getElement(), "route alerts");
Roles.getProgressbarRole().set(progressIndicator.getElement());
Roles.getProgressbarRole().setAriaLabelProperty(progressIndicator.getElement(), "loading indicator");
accessibilityShowSailings();
}
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:25,代码来源:FerriesRouteSailingsViewGwtImpl.java
示例11: updateAriaAttributes
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
private void updateAriaAttributes(int setSize) {
// Early out if this is a root node.
if (isRootNode()) {
return;
}
Roles.getTreeitemRole().setAriaSetsizeProperty(getElement(), setSize);
int selectionIndex = parentNode.indexOf(this);
Roles.getTreeitemRole().setAriaPosinsetProperty(getElement(), selectionIndex + 1);
// Set 'aria-expanded' state
// don't set aria-expanded on the leaf nodes
if (isLeaf()) {
Roles.getTreeitemRole().removeAriaExpandedState(getElement());
}
else {
Roles.getTreeitemRole().setAriaExpandedState(getElement(), ExpandedValue.of(open));
}
Roles.getTreeitemRole().setAriaLevelProperty(getElement(), this.depth);
}
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:CellTreeNodeView.java
示例12: setAriaLabel
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@Override
public void setAriaLabel(String text) {
if (text == null || text.isEmpty())
Roles.getTextboxRole().removeAriaLabelledbyProperty(getElement());
else
Roles.getTextboxRole().setAriaLabelProperty(getElement(), text);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:AriaPasswordTextBox.java
示例13: AriaCheckBox
import com.google.gwt.aria.client.Roles; //导入依赖的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
示例14: setAriaLabel
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@Override
public void setAriaLabel(String text) {
if (text == null || text.isEmpty())
Roles.getTextboxRole().removeAriaLabelProperty(getElement());
else
Roles.getTextboxRole().setAriaLabelProperty(getElement(), text);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:AriaTextBox.java
示例15: setAriaLabel
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@Override
public void setAriaLabel(String text) {
if (text == null || text.isEmpty())
Roles.getButtonRole().removeAriaLabelledbyProperty(getElement());
else
Roles.getButtonRole().setAriaLabelProperty(getElement(), text);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:AriaButton.java
示例16: ClickableHint
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
public ClickableHint(String text) {
super(text);
getElement().setTabIndex(0);
setStyleName("unitime-Hint");
sinkEvents(Event.KEYEVENTS);
Roles.getLinkRole().set(getElement());
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:ClickableHint.java
示例17: setAriaLabel
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
@Override
public void setAriaLabel(String text) {
if (text == null || text.isEmpty())
Roles.getLinkRole().removeAriaLabelledbyProperty(getElement());
else
Roles.getLinkRole().setAriaLabelProperty(getElement(), text);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:ClickableHint.java
示例18: AriaStatus
import com.google.gwt.aria.client.Roles; //导入依赖的package包/类
protected AriaStatus(Element element, boolean assertive) {
setElement(element);
setStyleName("unitime-AriaStatus");
Roles.getStatusRole().set(getElement());
Roles.getStatusRole().setAriaLiveProperty(getElement(), assertive ? LiveValue.ASSERTIVE : LiveValue.POLITE);
Roles.getStatusRole().setAriaAtomicProperty(getElement(), true);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:AriaStatus.java
示例19: insertTabWidget
import com.google.gwt.aria.client.Roles; //导入依赖的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
示例20: removeTab
import com.google.gwt.aria.client.Roles; //导入依赖的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
注:本文中的com.google.gwt.aria.client.Roles类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论