本文整理匯總了Java中gwt.material.design.client.constants.IconPosition類的典型用法代碼示例。如果您正苦於以下問題:Java IconPosition類的具體用法?Java IconPosition怎麽用?Java IconPosition使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IconPosition類屬於gwt.material.design.client.constants包,在下文中一共展示了IconPosition類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: UnitWidget
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
protected UnitWidget() {
addStyleName(res.style().view());
titlePanel = new MaterialPanel();
titlePanel.addStyleName(res.style().titlePanel());
title = new Heading(HeadingSize.H4);
title.addStyleName(res.style().title());
titlePanel.add(title);
add(titlePanel);
contentRow = new MaterialRow();
contentRow.addStyleName(res.style().content());
add(contentRow);
nextRow = new MaterialRow();
nextRow.addStyleName(res.style().next());
nextRow.setVisible(false);
add(nextRow);
// MaterialIcon nextIcon = new MaterialIcon(IconType.NAVIGATE_NEXT);
// nextIcon.setIconPosition(IconPosition.LEFT);
// nextIcon.setMarginRight(0);
nextLink = new MaterialLink(IconType.NAVIGATE_NEXT);
nextLink.setIconPosition(IconPosition.LEFT);
nextLink.setWaves(WavesType.DEFAULT);
nextLink.addStyleName(res.style().nextLink());
nextLink.addClickHandler(e -> onNext());
}
示例2: createNavBarOptions
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
MaterialButton createNavBarOptions() {
MaterialButton moreButton = new MaterialButton();
moreButton.add(createDropDown());
moreButton.setType(ButtonType.FLAT);
moreButton.setIconColor(Color.WHITE);
moreButton.setIconPosition(IconPosition.LEFT);
moreButton.setIconType(IconType.MORE_VERT);
moreButton.getElement().addClassName(NAV_OPTIONS_CSS_CLASS);
return moreButton;
}
示例3: createLinkLeft
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
protected MaterialLink createLinkLeft() {
final MaterialLink linkLeft = new MaterialLink(IconType.CHEVRON_LEFT);
linkLeft.setIconPosition(IconPosition.NONE);
return linkLeft;
}
示例4: createLinkRight
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
protected MaterialLink createLinkRight() {
final MaterialLink linkRight = new MaterialLink(IconType.CHEVRON_RIGHT);
linkRight.setIconPosition(IconPosition.NONE);
return linkRight;
}
示例5: setIconPosition
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
@Override
public void setIconPosition(IconPosition position) {
icon.setIconPosition(position);
}
示例6: testIcon
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
public void testIcon() {
// UiBinder
// given
T widget = getWidget(false);
// when / then
MaterialIcon icon = widget.getIcon();
assertNotNull(icon);
icon.setIconType(IconType.POLYMER);
assertEquals(IconType.POLYMER, icon.getIconType());
icon.setIconSize(IconSize.LARGE);
assertEquals(IconSize.LARGE, icon.getIconSize());
icon.setIconSize(IconSize.MEDIUM);
assertEquals(IconSize.MEDIUM, icon.getIconSize());
icon.setIconSize(IconSize.SMALL);
assertEquals(IconSize.SMALL, icon.getIconSize());
icon.setIconSize(IconSize.TINY);
assertEquals(IconSize.TINY, icon.getIconSize());
icon.setIconPosition(IconPosition.RIGHT);
icon.setIconPosition(IconPosition.LEFT);
icon.setIconColor(Color.AMBER);
icon.setIconPrefix(true);
assertTrue(icon.isIconPrefix());
icon.setIconPrefix(false);
assertFalse(icon.isIconPrefix());
icon.setIconFontSize(2, Style.Unit.PX);
// Standard
// given
attachWidget();
// when / then
icon.setIconType(IconType.POLYMER);
assertEquals(IconType.POLYMER.getCssName(), icon.getElement().getInnerHTML());
icon.setIconSize(IconSize.LARGE);
assertTrue(icon.getElement().hasClassName(IconSize.LARGE.getCssName()));
icon.setIconSize(IconSize.MEDIUM);
assertTrue(icon.getElement().hasClassName(IconSize.MEDIUM.getCssName()));
icon.setIconSize(IconSize.SMALL);
assertTrue(icon.getElement().hasClassName(IconSize.SMALL.getCssName()));
icon.setIconSize(IconSize.TINY);
assertTrue(icon.getElement().hasClassName(IconSize.TINY.getCssName()));
icon.setIconPosition(IconPosition.RIGHT);
assertTrue(icon.getElement().hasClassName(IconPosition.RIGHT.getCssName()));
icon.setIconPosition(IconPosition.LEFT);
assertTrue(icon.getElement().hasClassName(IconPosition.LEFT.getCssName()));
icon.setIconColor(Color.AMBER);
assertTrue(icon.getElement().hasClassName(Color.AMBER.getCssName() + "-text"));
icon.setIconPrefix(true);
assertTrue(icon.isIconPrefix());
assertTrue(icon.getElement().hasClassName("prefix"));
icon.setIconPrefix(false);
assertFalse(icon.getElement().hasClassName("prefix"));
icon.setIconFontSize(2, Style.Unit.PX);
assertEquals("2px", icon.getElement().getStyle().getFontSize());
}
示例7: setIconPosition
import gwt.material.design.client.constants.IconPosition; //導入依賴的package包/類
/**
* Set the position of the icon.
*/
void setIconPosition(IconPosition position);