List of usage examples for com.google.gwt.user.client Cookies getCookie
public static String getCookie(String name)
From source file:org.uberfire.wbtest.client.security.SecurityContextInfoScreen.java
License:Apache License
public void updateLabels() { cookieLabel.setText(Cookies.getCookie(UserCookieEncoder.USER_COOKIE_NAME)); super.updateLabels(securityContext.getCachedUser()); }
From source file:org.unitime.timetable.gwt.client.admin.AdminCookie.java
License:Apache License
private AdminCookie() { try {/*from w w w . ja v a 2 s . c o m*/ String cookie = Cookies.getCookie("UniTime:Admin"); if (cookie != null) { String[] params = cookie.split("\\|"); int idx = 0; iSortTasksBy = Integer.valueOf(params[idx++]); iSortTaskExecutionsBy = Integer.valueOf(params[idx++]); } } catch (Exception e) { } }
From source file:org.unitime.timetable.gwt.client.curricula.CurriculumCookie.java
License:Apache License
private CurriculumCookie() { try {/* w w w. j a v a 2s . c om*/ 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]); iSortBy = Integer.parseInt(values[12]); } } catch (Exception e) { } }
From source file:org.unitime.timetable.gwt.client.events.EventCookie.java
License:Apache License
private EventCookie() { try {/* w w w. j av a 2s. c o m*/ 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) { } }
From source file:org.unitime.timetable.gwt.client.instructor.InstructorCookie.java
License:Apache License
private InstructorCookie() { try {//from w w w. ja v a 2 s. c o m 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) { } }
From source file:org.unitime.timetable.gwt.client.page.UniTimeMobileMenu.java
License:Apache License
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);//from w w w . ja v a2 s . com 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)); } } } }
From source file:org.unitime.timetable.gwt.client.page.UniTimeSideBar.java
License:Apache License
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);/* w w w .j a va2 s .c o m*/ 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); } }
From source file:org.unitime.timetable.gwt.client.reservations.ReservationCookie.java
License:Apache License
private ReservationCookie() { try {//from w ww. ja va 2 s . c o m 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) { } }
From source file:org.unitime.timetable.gwt.client.rooms.RoomCookie.java
License:Apache License
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;//from ww w.java 2 s.c om 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) { } }
From source file:org.unitime.timetable.gwt.client.sectioning.DegreePlanDialog.java
License:Apache License
private void selectLastTab() { try {/*from w ww . ja va 2s .c o m*/ int tab = Integer.valueOf(Cookies.getCookie("UniTime:CourseFinderCourses")); if (tab >= 0 || tab < iCourseDetailsTabPanel.getTabCount() && tab != iCourseDetailsTabPanel.getSelectedTab()) iCourseDetailsTabPanel.selectTab(tab); else iCourseDetailsTabPanel.selectTab(0); } catch (Exception e) { iCourseDetailsTabPanel.selectTab(0); } }