本文整理汇总了Java中com.google.gwt.user.client.Window.Location.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java Location.getParameter方法的具体用法?Java Location.getParameter怎么用?Java Location.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Window.Location
的用法示例。
在下文中一共展示了Location.getParameter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadContactDetails
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
private void loadContactDetails(final JSONObject self) {
final String addContactToken = Location.getParameter("id");
CollaborationClient.getInstance().getContactDetails(addContactToken, new JsonCallback() {
public void onJsonReceived(JSONValue jsonValue) {
if (jsonValue.isObject().containsKey("error")) {
SC.say("Error", "This invitation is no longer valid");
} else {
JSONObject contact = jsonValue.isObject();
if (self.get("localId").isString().stringValue().equals(contact.get("localId").isString().stringValue()) && self.get("accountType").isNumber().equals(contact.get("accountType").isNumber())) {
SC.say("You cannot add your own account as a contact. <br> Login with a different account to ARLearn to accept this invitation.");
} else {
buildPage(jsonValue.isObject(), addContactToken);
}
}
}
});
}
示例2: HistoryToken
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public HistoryToken(PageType type) {
iType = type.name();
// 1. take page type defaults --> DEFAULTS
if (type.getParams() != null)
for (int i = 0; 1 + i < type.getParams().length; i += 2)
iDefaults.put(type.getParams()[i], type.getParams()[i + 1]);
// 2. take page parameters --> DEFAULTS (on top of the page type defaults)
for (Map.Entry<String, List<String>> params: Window.Location.getParameterMap().entrySet())
iDefaults.put(params.getKey(), params.getValue().get(0));
// 3. take cookie --> PARAMS (override defaults)
String cookie = EventCookie.getInstance().getHash(iType);
if (cookie != null) {
for (String pair: cookie.split("\\&")) {
int idx = pair.indexOf('=');
if (idx >= 0) {
String key = pair.substring(0, idx);
if (Location.getParameter(key) == null)
iParams.put(key, URL.decodeQueryString(pair.substring(idx + 1)));
}
}
}
// 4. take page token (hash) --> PARAMS (override cookie)
parse(History.getToken());
}
示例3: isActivated
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
@Override
public boolean isActivated() {
String disabled = Location.getParameter(DISABLE_PARAM);
if (disabled == null) {
return true;
}
return !Boolean.valueOf(disabled);
}
示例4: redirected
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public static boolean redirected()
{
String authProvider = getAuthProviderFromCookie();
if (authProvider == null)
{
return false;
}
if (Location.getParameter("code") != null) //facebook,google,github,windows live
return true;
if (Location.getParameter("oauth_token") != null) // twitter,yahoo,flickr
return true;
if (Location.getParameter("oauth_verifier") != null) // Flickr
return true;
String error = Location.getParameter("error");
if (error != null)
{
String errorMessage = Location.getParameter("error_description");
Window.alert("Error: " + error + ":" + errorMessage);
reload();
return false;
}
return false;
}
示例5: init
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
@Override
public void init() {
try {
String stateParameter = Location.getParameter(getAppController().getLoginManager().getNetworkLoginManager()
.getURLParameterForOAuthTokenProcessing());
isPostLogin = stateParameter != null
&& stateParameter.startsWith(getAppController().getLoginManager().getNetworkLoginManager().getURLParameterValueForOAuthTokenProcessing());
if (isPostLogin)
this.postLoginView = new PostLoginOAuthWindowView(this);
else
this.preLoginView = new LoginOAuthWindowView(this);
} catch (Throwable e) {
}
}
示例6: extractNodeIdFromLocation
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public int extractNodeIdFromLocation() {
if(Location.getParameter("node") != null) {
return Integer.valueOf(Location.getParameter("node"));
}else {
return -1;
}
}
示例7: getNodeId
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
private int getNodeId() {
if(Location.getParameter("node") != null) {
return Integer.valueOf(Location.getParameter("node"));
}else {
return -1;
}
}
示例8: hasUrlParameter
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
public static boolean hasUrlParameter(String parameter) {
return Location.getParameter(parameter) != null;
}
示例9: getLocationParameter
import com.google.gwt.user.client.Window.Location; //导入方法依赖的package包/类
/** simply returns the Location parameter value for the given key.
* This method is to prevent direct calls to Location.getParameter()
* due to encapsulation and testing reasons
*
* @param paramName
* @return
*/
public String getLocationParameter(String paramName) {
return Location.getParameter(paramName);
}