本文整理汇总了Java中com.google.gwt.safehtml.shared.UriUtils.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java UriUtils.fromString方法的具体用法?Java UriUtils.fromString怎么用?Java UriUtils.fromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.safehtml.shared.UriUtils
的用法示例。
在下文中一共展示了UriUtils.fromString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUserDataList
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
@Override
public void setUserDataList(List<PacketUserData> userDataList) {
panelUserCodeList.clear();
radioButtonToUserData = Maps.newHashMap();
for (PacketUserData userData : userDataList) {
SafeUri imageUrl = UriUtils.fromString(Constant.ICON_URL_PREFIX
+ userData.imageFileName);
SafeHtml label = TEMPLATE.image(imageUrl, userData.userCode, userData.playerName);
RadioButton radioButton = new RadioButton(GROUP_USER_CODE, label);
radioButtonToUserData.put(radioButton, userData);
panelUserCodeList.add(radioButton);
if (this.userData.getUserCode() == userData.userCode) {
radioButton.setValue(true);
}
}
}
示例2: render
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
if (value != null) {
SafeUri uri = trustUri_ ? UriUtils.fromTrustedString(value) : UriUtils.fromString(value);
if (width_ == null && height_ != null) // resize with constraint on height
sb.append(template_.imgByHeight(uri, height_));
else if (height_ == null && width_ != null) // resize with constraint on width
sb.append(template_.imgByWidth(uri, width_));
else if (height_ != null) // resize with constraint on width and height
sb.append(template_.img(uri, width_, height_));
}
}
示例3: asHref
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
public static SafeUri asHref (PageType pageType) {
return UriUtils.fromString("#" + pageType.asTargetHistoryToken());
}
示例4: slugToHref
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
public static SafeUri slugToHref (String slug) {
return UriUtils.fromString("#" + slugToTargetHistoryToken(slug));
}
示例5: setOAuthLoginURL
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
public void setOAuthLoginURL(String url) {
this.uri = UriUtils.fromString(url); // maybe change to
// .fromTrustedString in case we
// trust any caller.
preLoginView.setOAuthLoginURL(this.uri);
}
示例6: YouTubeViewGwtImpl
import com.google.gwt.safehtml.shared.UriUtils; //导入方法依赖的package包/类
public YouTubeViewGwtImpl() {
pullToRefresh = new PullPanel();
pullArrowHeader = new PullArrowHeader();
pullToRefresh.setHeader(pullArrowHeader);
handleOnLoad();
cellList = new CellList<YouTubeItem>(new YouTubeCell<YouTubeItem>() {
@Override
public SafeUri getThumbnailUrl(YouTubeItem model) {
return UriUtils.fromString(model.getThumbnailUrl());
}
@Override
public String getDescription(YouTubeItem model) {
String shortDescription = ParserUtils.ellipsis(
model.getDescription(), 128);
return shortDescription;
}
@Override
public String getUploaded(YouTubeItem model) {
return ParserUtils.relativeTime(model.getUploaded(),
"yyyy-MM-dd'T'HH:mm:ss.SSSZ", true);
}
@Override
public boolean canBeSelected(YouTubeItem model) {
return true;
}
});
initWidget(uiBinder.createAndBindUi(this));
accessibilityPrepare();
if (MGWT.getOsDetection().isAndroid()) {
leftFlexSpacer.setVisible(false);
}
}