本文整理汇总了Java中com.google.gwt.user.client.Window.Location.getProtocol方法的典型用法代码示例。如果您正苦于以下问题:Java Location.getProtocol方法的具体用法?Java Location.getProtocol怎么用?Java Location.getProtocol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Window.Location
的用法示例。
在下文中一共展示了Location.getProtocol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changeLocale
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public void changeLocale( String locale )
{
if( currentPlace == null )
return;
String token = placeTokenizer.getToken( currentPlace );
Map<String, List<String>> curParams = new HashMap<String, List<String>>( Location.getParameterMap() );
ArrayList<String> value = new ArrayList<String>();
value.add( locale );
curParams.put( "locale", value );
String queryString = "?";
boolean fAddAnd = false;
for( Entry<String, List<String>> e : curParams.entrySet() )
{
if( fAddAnd )
queryString += "&";
fAddAnd = true;
queryString += URL.encodeQueryString( e.getKey() ) + "=" + URL.encodeQueryString( HexaTools.arrayToString( e.getValue() ) );
}
String url = Location.getProtocol() + "//" + Location.getHost() + Location.getPath() + queryString + "#" + token;
Window.Location.replace( url );
}
示例2: getUrlPrefix
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
/**
* @return the URL of the client including protocol and host.
*/
private String getUrlPrefix() {
return Location.getProtocol() + "//" + Location.getHost();
}
示例3: getPlaceUrl
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public String getPlaceUrl( Place place )
{
String token = placeTokenizer.getToken( place );
return Location.getProtocol() + "//" + Location.getHost() + Location.getPort() + Location.getPath() + Location.getQueryString() + "#" + token;
}
示例4: getUrlPrefix
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
/**
* Returns the URL of the client including protocol and host.
*
* @return URL of the client.
*/
private String getUrlPrefix() {
return Location.getProtocol() + "//" + Location.getHost();
}