本文整理匯總了Java中com.google.gwt.http.client.URL.decode方法的典型用法代碼示例。如果您正苦於以下問題:Java URL.decode方法的具體用法?Java URL.decode怎麽用?Java URL.decode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.http.client.URL
的用法示例。
在下文中一共展示了URL.decode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTokenMap
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public static HashMap<String, String> getTokenMap(String token) {
token = URL.decode(token);
String[] tokens = token.split(";");
HashMap<String, String> tokenMap = new HashMap<String, String>();
for( int i=0; i < tokens.length; i++ ) {
if ( tokens[i].contains("=") ) {
String[] parts = tokens[i].split("=");
String name = parts[0];
String value = parts[1];
if ( !value.contains("ferret_") ) {
tokenMap.put(name, value);
}
}
}
return tokenMap;
}
示例2: TokenParser
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public TokenParser(String token) {
String[] tokens = token.split("\\" + TokenConstants.FilterMainSeparator, 2);
primaryToken = URL.decode(tokens[0]);
if (tokens.length > 1) {
filters = new HashMap<String, String>();
String[] filterComponents = tokens[1].split("\\" + TokenConstants.FilterSeparator, 0);
for (String filter : filterComponents) {
String[] keyValue = filter.split("\\" + TokenConstants.FilterKeyValueSeparator, 2);
if (keyValue.length != 2)
continue;
filters.put(URL.decode(keyValue[0]), URL.decode(keyValue[1]));
}
} else {
filters = null;
}
}
示例3: handleLinkClick
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@UsedByApp
public void handleLinkClick(Event event) {
Element target = Element.as(event.getEventTarget());
String href = target.getAttribute("href");
if (href.startsWith("send:")) {
String msg = href.substring("send:".length());
msg = URL.decode(msg);
if (lastVisiblePeer != null) {
messenger.sendMessage(lastVisiblePeer, msg);
event.preventDefault();
}
} else {
if (JsElectronApp.isElectron()) {
JsElectronApp.openUrlExternal(href);
event.preventDefault();
}
}
}
示例4: checkLastQuery
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
private void checkLastQuery() {
if (Window.Location.getParameter("q") != null) {
iFilter.setValue(Window.Location.getParameter("q"), true);
if (Window.Location.getParameter("t") != null) {
if ("2".equals(Window.Location.getParameter("t"))) {
iTabPanel.selectTab(1);
} else {
iTabPanel.selectTab(0);
}
} else {
loadData();
}
} else if (Window.Location.getHash() != null && !Window.Location.getHash().isEmpty()) {
String hash = URL.decode(Window.Location.getHash().substring(1));
if (!hash.matches("^[0-9]+\\:?[0-9]*@?$")) {
if (hash.endsWith("@")) {
iFilter.setValue(hash.substring(0, hash.length() - 1), true);
iTabPanel.selectTab(1);
} else if (hash.endsWith("$")) {
iFilter.setValue(hash.substring(0, hash.length() - 1), true);
iTabPanel.selectTab(2);
} else {
iFilter.setValue(hash, true);
loadData();
}
}
} else {
String q = SectioningStatusCookie.getInstance().getQuery(iOnline);
if (q != null) iFilter.setValue(q);
int t = SectioningStatusCookie.getInstance().getTab(iOnline);
if (t >= 0 && t < iTabPanel.getTabCount()) {
iTabPanel.selectTab(t, false);
iTabIndex = -1;
}
if (GWT_CONSTANTS.searchWhenPageIsLoaded() && q != null && !q.isEmpty())
loadData();
}
}
示例5: decode
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
/**
* Take in the XML request string and prepare it to be used to construct and LASRequest object.
* @param xml -- the input XML off the servlet request.
* @return xml -- the converted string
*/
public static String decode(String xml) {
xml = URL.decode(xml);
// Get rid of the entity values for > and <
xml = xml.replace(">", ">");
xml = xml.replace("<", "<");
// Replace the op value with gt ge eq lt le as needed.
xml = xml.replace("op=\">=\"", "op=\"ge\"");
xml = xml.replace("op=\">\"", "op=\"gt\"");
xml = xml.replace("op=\"=\"", "op=\"eq\"");
xml = xml.replace("op=\"<=\"", "op=\"le\"");
xml = xml.replace("op=\"<\"", "op=\"lt\"");
return xml;
}
示例6: prepareFromRequest
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
_applicationName = request.getParameter(NameTokens.APPLICATION_NAME_PARAM, null);
if (_applicationName != null) {
_applicationName = URL.decode(_applicationName);
}
}
示例7: prepareFromRequest
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
_artifactKey = request.getParameter(NameTokens.ARTIFACT_REFERENCE_KEY_PARAM, null);
if (_artifactKey != null) {
_artifactKey = URL.decode(_artifactKey);
}
}
示例8: prepareFromRequest
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
_serviceName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.SERVICE_NAME_PARAM, null);
_applicationName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.APPLICATION_NAME_PARAM, null);
if (_serviceName != null) {
_serviceName = URL.decode(_serviceName);
}
if (_applicationName != null) {
_applicationName = URL.decode(_applicationName);
}
}
示例9: prepareFromRequest
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
_componentName = request.getParameter(NameTokens.COMPONENT_NAME_PARAM, null);
if (_componentName != null) {
_componentName = URL.decode(_componentName);
}
_extensionName = request.getParameter(NameTokens.EXTENSION_NAME_PARAM, null);
if (_extensionName != null) {
_extensionName = URL.decode(_extensionName);
}
}
示例10: prepareFromRequest
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
_referenceName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.REFERENCE_NAME_PARAM, null);
_applicationName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.APPLICATION_NAME_PARAM, null);
if (_referenceName != null) {
_referenceName = URL.decode(_referenceName);
}
if (_applicationName != null) {
_applicationName = URL.decode(_applicationName);
}
}
示例11: toFilyAppModuleId
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public static String toFilyAppModuleId(String aRelative, String aStartPoint) {
Element moduleIdNormalizer = com.google.gwt.dom.client.Document.get().createDivElement();
moduleIdNormalizer.setInnerHTML("<a href=\"" + aStartPoint + "/" + aRelative + "\">o</a>");
String mormalizedAbsoluteModuleUrl = URL.decode(moduleIdNormalizer.getFirstChildElement().<AnchorElement> cast().getHref());
String hostContextPrefix = AppClient.relativeUri() + AppClient.getSourcePath();
Element hostContextNormalizer = com.google.gwt.dom.client.Document.get().createDivElement();
hostContextNormalizer.setInnerHTML("<a href=\"" + hostContextPrefix + "\">o</a>");
String mormalizedHostContextPrefix = URL.decode(hostContextNormalizer.getFirstChildElement().<AnchorElement> cast().getHref());
return mormalizedAbsoluteModuleUrl.substring(mormalizedHostContextPrefix.length());
}
示例12: getFromHash
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
private String getFromHash(String hash, String param) {
int paramIndex = hash.toLowerCase().indexOf(param.toLowerCase());
if(!hash.isEmpty() && hash.charAt(0) == '#' && paramIndex != -1){
int endIndex = hash.indexOf("/", paramIndex);
if (endIndex != -1)
return URL.decode(hash.substring(paramIndex + param.length(), endIndex));
else
return URL.decode(hash.substring(paramIndex + param.length()));
}
return null;
}
示例13: menuLoaded
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
protected void menuLoaded(LayerMenuItem menuTree) {
if (menuTree.isLeaf()) {
menuTree.addChildItem(new LayerMenuItem("No datasets found!", null, null, false, null));
}
layerSelector.populateLayers(menuTree);
Window.setTitle(menuTree.getTitle());
if (permalinking) {
String bgMap = permalinkParamsMap.get("bgmap");
if (bgMap != null && !"".equals(bgMap)) {
try {
mapArea.setBackgroundMap(bgMap);
} catch (Exception e) {
/*
* It doesn't matter if we can't set the background map, so
* ignore any exceptions
*/
}
}
String currentLayer = permalinkParamsMap.get("layer");
if (currentLayer != null) {
String serverUrl = permalinkParamsMap.get("server");
if (serverUrl == null || "".equals(serverUrl)) {
String path = Window.Location.getProtocol() + "//" + Window.Location.getHost()
+ Window.Location.getPath();
path = path.substring(0, path.lastIndexOf("/"));
final String wmsUrl = path + "/wms";
GWT.log("Permalinking without server argument. Current WMS: " + wmsUrl);
layerSelector.selectLayer(currentLayer, wmsUrl, false);
} else {
String currentWms = URL.decode(serverUrl);
GWT.log("Permalinking with server argument. Current WMS: " + currentWms);
layerSelector.selectLayer(currentLayer, currentWms, false);
}
}
}
}
示例14: getParameter
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
public static String getParameter(String name){
String parameter = Window.Location.getParameter(name);
if(parameter != null){
parameter = URL.decode(parameter);
}
return parameter;
}
示例15: popHistory
import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
private void popHistory(boolean shouldAutoRefresh, String historyToken) {
historyToken = URL.decode(historyToken);
if (!historyToken.equals("")) {
setUpdateRequired(true);
// First split out the panel history
String[] settings = historyToken.split("token");
// The first token is the "gallery settings", the ones that follow
// are for each output panel.
// The number of panels in the history is settings.length - 1
if (settings.length - 1 != xPanelCount) {
setupOutputPanels(settings.length - 1, Constants.IMAGE);
if (settings.length - 1 == 1) {
setupMainPanelAndRefreshForceLASRequest(false);
compareMenu.setSelectedIndex(0);
compareMenuChanged();
} else {
setupPanelsAndRefreshNOforceLASRequestWithCompareMenus(false);
if (settings.length - 1 == 2) {
compareMenu.setSelectedIndex(1);
compareMenuChanged();
} else {
compareMenu.setSelectedIndex(2);
compareMenuChanged();
}
}
// Set the state of the system...
}
HashMap<String, String> tokenMap = Util.getTokenMap(settings[0]);
if ((tokenMap.containsKey("xDSID") && tokenMap.get("xDSID").equals(xVariable.getDSID()))
&& (tokenMap.containsKey("varid") && tokenMap.get("varid").equals(xVariable.getID()))) {
// We can do this only because we are reusing the current
// variable.
applyTokens(settings);
// Don't request that the plot refresh happen automatically,
// don't force panels to update if they don't need to, and don't
// add to the history stack.
eventBus.fireEvent(new WidgetSelectionChangeEvent(shouldAutoRefresh, false, false));
} else {
historyString = historyToken;
historyTokens = tokenMap;
Util.getRPCService().getCategories(tokenMap.get("xCATID"), tokenMap.get("xDSID"), requestGridForHistory);
}
}
}