當前位置: 首頁>>代碼示例>>Java>>正文


Java Cookies.getCookie方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.Cookies.getCookie方法的典型用法代碼示例。如果您正苦於以下問題:Java Cookies.getCookie方法的具體用法?Java Cookies.getCookie怎麽用?Java Cookies.getCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.Cookies的用法示例。


在下文中一共展示了Cookies.getCookie方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: InstructorCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private InstructorCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Instructor");
		if (cookie != null) {
			String[] params = cookie.split("\\|");
			int idx = 0;
			iSortAttributesBy = Integer.valueOf(params[idx++]);
			iSortInstructorsBy = Integer.valueOf(params[idx++]);
			iSortTeachingRequestsBy = new int[] {Integer.valueOf(params[idx++]), Integer.valueOf(params[idx++]), Integer.valueOf(params[idx++])};
			iTeachingRequestsColumns = new int[] {Integer.valueOf(params[idx++]), Integer.valueOf(params[idx++]), Integer.valueOf(params[idx++])};
			iSortTeachingAssignmentsBy = Integer.valueOf(params[idx++]);
			iTeachingAssignmentsColumns = Integer.valueOf(params[idx++]);
			iAssignmentChangesBase = Integer.valueOf(params[idx++]);
			iSortAssignmentChangesBy = Integer.valueOf(params[idx++]);
			iAssignmentChangesColumns = Integer.valueOf(params[idx++]);
			iShowTeachingRequests = "T".equals(params[idx++]);
			iShowTeachingAssignments = "T".equals(params[idx++]);
			iQuery = new String[] {params[idx++], params[idx++], params[idx++]};
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:23,代碼來源:InstructorCookie.java

示例2: CurriculumCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private CurriculumCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Curriculum");
		if (cookie != null && cookie.length() > 0) {
			String[] values = cookie.split(":");
			iType = CourseCurriculaTable.Type.valueOf(values[0]);
			iMode = CurriculaCourses.Mode.valueOf(values[1]);
			iPercent = "T".equals(values[2]);
			iRulesPercent = "T".equals(values[3]);
			iRulesShowLastLike = "T".equals(values[4]);
			iCourseDetails = "T".equals(values[5]);
			iCurMode.fromString(values[6]);
			iShowLast = !"F".equals(values[7]);
			iShowProjected = !"F".equals(values[8]);
			iShowExpected = !"F".equals(values[9]);
			iShowEnrolled = !"F".equals(values[10]);
			iShowRequested = "T".equals(values[11]);
			iShowSnapshotExpected = !"T".equals(values[12]);
			iShowSnapshotProjected = !"T".equals(values[13]);
			iSortBy = Integer.parseInt(values[14]);
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:25,代碼來源:CurriculumCookie.java

示例3: SolverCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private SolverCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Solver");
		if (cookie != null) {
			String[] params = cookie.split("\\|");
			int idx = 0;
			iLogLevel = Integer.valueOf(params[idx++]);
			iTimeGridFilter = "1".equals(params[idx++]);
			iAssignedClassesFilter = "1".equals(params[idx++]);
			iAssignedClassesSort = Integer.parseInt(params[idx++]);
			iNotAssignedClassesFilter = "1".equals(params[idx++]);
			iNotAssignedClassesSort = Integer.parseInt(params[idx++]);
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:SolverCookie.java

示例4: EventCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private EventCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Event");
		if (cookie != null) {
			String[] params = cookie.split("\\|");
			int idx = 0;
			iFlags = Integer.parseInt(params[idx++]);
			iShowDeltedMeetings = "T".equals(params[idx++]);
			iSortRoomsBy = Integer.valueOf(params[idx++]);
			iRoomsHorizontal = !"F".equals(params[idx++]);
			iExpandRoomConflicts = "T".equals(params[idx++]);
			iAutomaticallyApproveNewMeetings = "T".equals(params[idx++]);
			iHideDuplicitiesForMeetings = "T".equals(params[idx++]);
			while (idx < params.length) {
				String hash = params[idx++];
				int colon = hash.indexOf(':');
				iHash.put(hash.substring(0, colon), hash.substring(colon + 1));
			}
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:23,代碼來源:EventCookie.java

示例5: SectioningStatusCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private SectioningStatusCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:StudentStatus");
		if (cookie != null) {
			String[] params = cookie.split("\\|");
			int idx = 0;
			iOnlineTab = Integer.parseInt(params[idx++]);
			iOnlineQuery = params[idx++];
			iBashTab = Integer.parseInt(params[idx++]);
			iBashQuery = params[idx++];
			for (int i = 0; i < iSortBy.length; i++)
				iSortBy[i] = Integer.parseInt(params[idx++]);
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:SectioningStatusCookie.java

示例6: restoreState

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public void restoreState() {
	Set<String> nodes = new HashSet<String>();
	String sideBarCookie = Cookies.getCookie("UniTime:MobileMenu");
	if (sideBarCookie != null)
		for (String node: sideBarCookie.split("\\|"))
			nodes.add(node);
	for (int i = 0 ; i < iStackPanel.getWidgetCount(); i++) {
		if (nodes.contains(iStackPanel.getStackText(i))) {
			iStackPanel.showStack(i);
		}
		if (iStackPanel.getWidget(i) instanceof Tree) {
			Tree t = (Tree)iStackPanel.getWidget(i);
			for (int j = 0; j < t.getItemCount(); j++) {
				openNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
			}
		}
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:UniTimeMobileMenu.java

示例7: restoreState

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public void restoreState() {
	Set<String> nodes = new HashSet<String>();
	String sideBarCookie = Cookies.getCookie("UniTime:SideBar");
	if (sideBarCookie != null)
		for (String node: sideBarCookie.split("\\|"))
			nodes.add(node);
	iDisclosurePanel.setOpen(nodes.contains("Root") || sideBarCookie == null);
	if (iUseStackPanel)
		for (int i = 0 ; i < iStackPanel.getWidgetCount(); i++) {
			if (nodes.contains(iStackPanel.getStackText(i))) {
				iStackPanel.showStack(i);
			}
			if (iStackPanel.getWidget(i) instanceof Tree) {
				Tree t = (Tree)iStackPanel.getWidget(i);
				for (int j = 0; j < t.getItemCount(); j++) {
					openNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
				}
			}
		}
	else
		for (int i = 0; i < iTree.getItemCount(); i++) {
			openNodes(nodes, iTree.getItem(i), null);
		}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:25,代碼來源:UniTimeSideBar.java

示例8: getData

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private String getData(String dataName) {
	if (dataName == null || dataName.equals("")) return "";
	
	dataName = buildPathString(dataName);
	String data = null;
	try {
		if (dataStore != null) {
			data = dataStore.getItem(dataName);
		} else {
			data = Cookies.getCookie(dataName);
		}
	} catch (Exception e) {}

	if (data == null || data.equals("null")) {
		data = "";
	}
	return data;
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:19,代碼來源:LocalDataServiceImpl.java

示例9: doFinish

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
protected void doFinish(RequestBuilder rb) {
    super.doFinish(rb);

    if (checkUserInfo) {
        String userToken = Cookies.getCookie(LoginManagerImpl.COOKIE_USER_KEY);
        userToken = userToken == null ? "" : userToken.replaceAll("\"", "");
        String user = userToken.contains("/") ? userToken.split("/", 2)[1] : null;
        LoginManager loginManager= Application.getInstance().getLoginManager();
        if (user != null && loginManager!=null && loginManager.getLoginInfo()!=null) {
            if (!loginManager.getLoginInfo().getLoginName().equals(user)) {
                loginManager.refreshUserInfo(true);
            }
        }
    }
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:17,代碼來源:ServiceLocator.java

示例10: LastChangesCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private LastChangesCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:LastChanges");
		if (cookie != null && cookie.length() > 0) {
			String[] values = cookie.split(":");
			iShowDetails = "T".equals(values[0]);
			iSortColumn = Integer.parseInt(values[1]);
			iSortOrder = "T".equals(values[2]);
			iMultiSession = "T".equals(values[3]);
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:14,代碼來源:RoomNoteChanges.java

示例11: RoomCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private RoomCookie() {
	iFlags = new int[RoomsPageMode.values().length];
	iHash = new String[RoomsPageMode.values().length];
	for (int i = 0; i < iFlags.length; i++) {
		iFlags[i] = 0;
		iHash[i] = "";
	}
	try {
		String cookie = Cookies.getCookie("UniTime:Room");
		if (cookie != null) {
			String[] params = cookie.split("\\|");
			int idx = 0;
			iSortRoomsBy = Integer.valueOf(params[idx++]);
			iSortRoomGroupsBy = Integer.valueOf(params[idx++]);
			iSortRoomFeaturesBy = Integer.valueOf(params[idx++]);
			setOrientation(params[idx++]);
			iDeptMode = Integer.valueOf(params[idx++]);
			for (int i = 0; i < iFlags.length; i++) {
				iFlags[i] = Integer.parseInt(params[idx++]);
				iHash[i] = params[idx++];
			}
			while (idx < params.length) {
				String[] x = params[idx++].split(":");
				iFutures.put(Long.valueOf(x[0]), new Integer(x[1]));
			}
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:30,代碼來源:RoomCookie.java

示例12: SectioningCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private SectioningCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Sectioning");
		if (cookie != null && cookie.length() > 0) {
			String[] values = cookie.split(":");
			iCourseDetails = "T".equals(values[0]);
			iShowClassNumbers = "T".equals(values.length >= 2 ? values[1] : "F");
			iRelatedSortBy = Integer.parseInt(values[2]);
			iEnrollmentFilter = EnrollmentFilter.values()[Integer.parseInt(values[3])];
			iEnrollmentSortBy = Integer.parseInt(values[4]);
			iEnrollmentSortBySubpart = values[5];
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:16,代碼來源:SectioningCookie.java

示例13: ReservationCookie

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
private ReservationCookie() {
	try {
		String cookie = Cookies.getCookie("UniTime:Reservations");
		if (cookie != null && cookie.length() > 0) {
			String[] values = cookie.split(":");
			iCourseDetails = "T".equals(values[0]);
			iSortBy = Integer.valueOf(values[1]);
		}
	} catch (Exception e) {
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:12,代碼來源:ReservationCookie.java

示例14: onConnect

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
@Override
public void onConnect() {
  connected = ConnectState.CONNECTED;
  connectedAtLeastOnce = true;

  // Sends the session cookie to the server via an RPC to work around browser bugs.
  // See: http://code.google.com/p/wave-protocol/issues/detail?id=119
  String token = Cookies.getCookie(JETTY_SESSION_TOKEN_NAME);
  if (token != null) {
    TransportAuthenticationRequestJsoImpl auth = TransportAuthenticationRequestJsoImpl.create();
    auth.setToken(token);
    int requestId = sequenceNo++;
    requestsCallbacks.put(requestId, new ResponseCallback<EmptyResponse>() {
      @Override
      public void run(EmptyResponse response) {
      }
    });
    send(MessageWrapper.create(requestId, TRANSPORT_AUTHENTICATION_REQUEST, auth));
  }

  // Flush queued messages.
  while (!messages.isEmpty() && connected == ConnectState.CONNECTED) {
    send(messages.poll());
  }

  // Notify listeners.
  for (ConnectionListener listener : listeners) {
    listener.onConnected();
  }
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:31,代碼來源:WaveWebSocketClient.java

示例15: checkAuthentication

import com.google.gwt.user.client.Cookies; //導入方法依賴的package包/類
public static OauthClient checkAuthentication() {
	if (oauthInstance != null) return oauthInstance;
	if (Window.Location.getParameter("accessToken") != null) {
		oauthInstance = readFromUrl();
	} else 	if (Cookies.getCookie(COOKIE_TOKEN_NAME) != null) {
		oauthInstance =  readFromCookie();
	}
	return oauthInstance;
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:10,代碼來源:OauthClient.java


注:本文中的com.google.gwt.user.client.Cookies.getCookie方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。