本文整理汇总了Java中com.google.gwt.i18n.client.HasDirection.Direction类的典型用法代码示例。如果您正苦于以下问题:Java Direction类的具体用法?Java Direction怎么用?Java Direction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Direction类属于com.google.gwt.i18n.client.HasDirection包,在下文中一共展示了Direction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: insertItem
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Inserts an item into the list box, specifying its direction and an initial value for the item. If the index is less than zero, or greater than or equal
* to the length of the list, then the item will be appended to the end of the list.
*
* @param item the text of the item to be inserted
* @param dir the item's direction. If {@code null}, the item is displayed in the widget's overall direction, or, if a direction estimator has been set, in
* the item's estimated direction.
* @param value the item's value, to be submitted if it is part of a {@link FormPanel}.
* @param index the index at which to insert it
*/
public void insertItem(String item, Direction dir, String value, int index) {
SelectElement select = getSelectElement();
OptionElement option = Document.get().createOptionElement();
setOptionText(option, item, dir);
option.setValue(value);
int itemCount = select.getLength();
if (index < 0 || index > itemCount) {
index = itemCount;
}
if (index == itemCount) {
select.add(option, null);
} else {
OptionElement before = select.getOptions().getItem(index);
select.add(option, before);
}
}
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:28,代码来源:AccessibleListBox.java
示例2: setOptionText
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Sets the text of an option element. If the direction of the text is opposite to the page's direction, also wraps it with Unicode bidi formatting
* characters to prevent garbling, and indicates that this was done by setting the option's <code>BIDI_ATTR_NAME</code> custom attribute.
*
* @param option an option element
* @param text text to be set to the element
* @param dir the text's direction. If {@code null} and direction estimation is turned off, direction is ignored.
*/
protected void setOptionText(OptionElement option, String text, Direction dir) {
if (dir == null && estimator != null) {
dir = estimator.estimateDirection(text);
}
if (dir == null) {
option.setText(text);
option.removeAttribute(BIDI_ATTR_NAME);
} else {
String formattedText = BidiFormatter.getInstanceForCurrentLocale().unicodeWrapWithKnownDir(dir, text, false /* isHtml */, false /* dirReset */);
option.setText(formattedText);
if (formattedText.length() > text.length()) {
option.setAttribute(BIDI_ATTR_NAME, "");
} else {
option.removeAttribute(BIDI_ATTR_NAME);
}
}
}
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:26,代码来源:AccessibleListBox.java
示例3: createUrlToShare
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
private SelectHandler createUrlToShare(final VerticalPanel geoDataContainer) {
return new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
urlToShareAnchor.setHref(getHref());
urlToShareAnchor.setText(
UIMessages.INSTANCE.seeOtherWindow("GeoWE Project"),
Direction.LTR);
urlShared.setText(getHref());
urlPanel.setVisible(true);
urlShared.setVisible(true);
}
private String getHref() {
String baseUrl = GWT.getHostPageBaseURL();
baseUrl += "?projectUrl="
+ URL.encodeQueryString(urlTextField.getValue());
return baseUrl;
}
};
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:25,代码来源:OpenProjectDialog.java
示例4: insertItem
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
@Override
public void insertItem(String item, Direction dir, String value, int index) {
SelectElement select = getElement().cast();
OptionElement option = Document.get().createOptionElement();
setOptionText(option, item, dir);
option.setValue(value);
option.setTitle(item);
int itemCount = select.getLength();
if (index < 0 || index > itemCount) {
index = itemCount;
}
if (index == itemCount) {
select.add(option, null);
} else {
OptionElement before = select.getOptions().getItem(index);
select.add(option, before);
}
}
开发者ID:rkfg,项目名称:gwtutil,代码行数:20,代码来源:ListBoxWithTooltip.java
示例5: showSourceFile
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Show a source file based on the selection in the source list.
*/
private void showSourceFile() {
if (content == null) {
return;
}
// Set the highlighted tab.
tabExample.getElement().getStyle().clearColor();
tabStyle.getElement().getStyle().clearColor();
tabSource.getElement().getStyle().setColor(SELECTED_TAB_COLOR);
contentSource.setHTML(loadingHtml, Direction.LTR);
contentPanel.setWidget(new ScrollPanel(contentSource));
if (!tabSourceList.isVisible() || tabSourceList.getSelectedIndex() == 0) {
// If the source list isn't visible or the first item is selected, load
// the source for the example.
content.getSource(new CustomCallback());
} else {
// Load a raw file.
String filename = tabSourceList.getItemText(
tabSourceList.getSelectedIndex());
content.getRawSource(filename, new CustomCallback());
}
}
开发者ID:Peergos,项目名称:Peergos,代码行数:27,代码来源:ShowcaseShell.java
示例6: createUrlToShare
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
private SelectHandler createUrlToShare(final VerticalPanel geoDataContainer) {
return new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
urlToShareAnchor.setHref(getHref());
urlToShareAnchor.setText(
UIMessages.INSTANCE.seeOtherWindow(getLayerName()),
Direction.LTR);
urlShared.setText(getHref());
urlPanel.setVisible(true);
urlShared.setVisible(true);
}
private String getHref() {
String baseUrl = GWT.getHostPageBaseURL();
baseUrl += "?layerUrl="
+ URL.encodeQueryString(urlTextField.getValue())
+ "&layerName=" + getLayerName() + "&layerProj="
+ getProjectionName() + "&layerFormat="
+ getDataFormat();
return baseUrl;
}
};
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:28,代码来源:GeoDataImportDialog.java
示例7: setText
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Sets the text in the text box.
*
* @param text
* the text to set in the text box
*/
public void setText(final String text) {
/**
* To leave caret in the beginning of the line. SetSelectionRange
* wouldn't work on IE (see #13477)
*/
Direction previousDirection = this.tb.getDirection();
this.tb.setDirection(Direction.RTL);
this.tb.setText(text);
this.tb.setDirection(previousDirection);
}
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:17,代码来源:VComboBoxMultiselect.java
示例8: showSourceStyles
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Show the source CSS style.
*/
private void showSourceStyles() {
if (content == null) {
return;
}
// Set the highlighted tab.
tabExample.getElement().getStyle().clearColor();
tabStyle.getElement().getStyle().setColor(SELECTED_TAB_COLOR);
tabSource.getElement().getStyle().clearColor();
contentSource.setHTML(loadingHtml, Direction.LTR);
contentPanel.setWidget(new ScrollPanel(contentSource));
content.getStyle(new CustomCallback());
}
开发者ID:Peergos,项目名称:Peergos,代码行数:18,代码来源:ShowcaseShell.java
示例9: getTextDirection
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
@Override
public Direction getTextDirection() {
return directionalTextHelper.getTextDirection();
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:5,代码来源:BaseCheckBox.java
示例10: setHTML
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
@Override
public void setHTML(SafeHtml html, Direction dir) {
directionalTextHelper.setTextOrHtml(html.asString(), dir, true);
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:5,代码来源:BaseCheckBox.java
示例11: setText
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
@Override
public void setText(String text, Direction dir) {
directionalTextHelper.setTextOrHtml(text, dir, false);
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:5,代码来源:BaseCheckBox.java
示例12: MaterialCheckBox
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
public MaterialCheckBox(SafeHtml label, Direction dir) {
super(label, dir);
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:4,代码来源:MaterialCheckBox.java
示例13: MaterialRadioButton
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
public MaterialRadioButton(String name, SafeHtml label, Direction dir) {
super(name, label, dir);
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:4,代码来源:MaterialRadioButton.java
示例14: onError
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
public void onError() {
if (id == nextCallbackId) {
contentSource.setHTML("Cannot find resource", Direction.LTR);
}
}
开发者ID:Peergos,项目名称:Peergos,代码行数:6,代码来源:ShowcaseShell.java
示例15: onSuccess
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
public void onSuccess(String value) {
if (id == nextCallbackId) {
contentSource.setHTML(value, Direction.LTR);
}
}
开发者ID:Peergos,项目名称:Peergos,代码行数:6,代码来源:ShowcaseShell.java
示例16: setItemText
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Sets the text associated with the item at a given index.
*
* @param index the index of the item to be set
* @param text the item's new text
* @param dir the item's direction.
* @throws IndexOutOfBoundsException if the index is out of range
*/
public void setItemText(int index, String text, Direction dir) {
checkIndex(index);
if (text == null) {
throw new NullPointerException("Cannot set an option to have null text");
}
setOptionText(getSelectElement().getOptions().getItem(index), text, dir);
}
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:16,代码来源:AccessibleListBox.java
示例17: addItem
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Adds an item to the list box, specifying its direction. This method has
* the same effect as
* <pre>addItem(value, dir, item)</pre>
*
* @param value the item's value, to be submitted if it is part of a
* {@link FormPanel}; cannot be <code>null</code>
* @param dir the item's direction
* @param reload perform a 'material select' reload to update the DOM.
*/
public void addItem(T value, Direction dir, boolean reload) {
values.add(value);
listBox.addItem(keyFactory.generateKey(value), dir);
if (reload) {
reload();
}
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:19,代码来源:MaterialListValueBox.java
示例18: insertItem
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Inserts an item into the list box, specifying its direction. Has the same
* effect as
* <pre>insertItem(value, dir, item, index)</pre>
*
* @param value the item's value, to be submitted if it is part of a
* {@link FormPanel}.
* @param dir the item's direction
* @param index the index at which to insert it
* @param reload perform a 'material select' reload to update the DOM.
*/
public void insertItem(T value, Direction dir, int index, boolean reload) {
values.add(index, value);
listBox.insertItem(keyFactory.generateKey(value), dir, index);
if (reload) {
reload();
}
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:20,代码来源:MaterialListValueBox.java
示例19: addItem
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Adds an item to the list box, specifying its direction. This method has the same effect as
* <p/>
* <pre>
* addItem(item, dir, item)
* </pre>
*
* @param item the text of the item to be added
* @param dir the item's direction
*/
public void addItem(String item, Direction dir) {
insertItem(item, dir, INSERT_AT_END);
}
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:14,代码来源:AccessibleListBox.java
示例20: BaseCheckBox
import com.google.gwt.i18n.client.HasDirection.Direction; //导入依赖的package包/类
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
* @param dir the text's direction. Note that {@code DEFAULT} means direction
* should be inherited from the widget's parent element.
*/
public BaseCheckBox(SafeHtml label, Direction dir) {
this();
setHTML(label, dir);
}
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:12,代码来源:BaseCheckBox.java
注:本文中的com.google.gwt.i18n.client.HasDirection.Direction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论