/** Put the widget in single activity mode. */ private void setSingleActivityMode() { sortPanel.setVisible(false); titlePanel.setVisible(false); postContent.setVisible(false); stream.setVisible(false); searchStatusWidget.setVisible(false); searchBoxWidget.setVisible(false); feedLinkWidget.setVisible(false); sortSearchRow.setVisible(false); EventBus.getInstance().notifyObservers(new ChangeActivityModeEvent(true)); }
/** * Check the history for changes. * * @param history the history. * @return true if it has changed. */ private boolean checkHistory(final Map<String, String> history) { boolean hasChanged = false; Long newActivityId = 0L; Long newStreamId = 0L; Long newGroupId = 0L; String newSearch = ""; String newSort = sortPanel.getSort(); if (null != history) { if (history.containsKey("activityId")) { newActivityId = Long.parseLong(history.get("activityId")); } if (history.containsKey("streamId")) { newStreamId = Long.parseLong(history.get("streamId")); } if (history.containsKey("groupId")) { newGroupId = Long.parseLong(history.get("groupId")); } if (history.containsKey("search")) { newSearch = history.get("search"); } } // Only process if the stream/group ID has not changed. Handled elsewhere otherwise. if (streamId.equals(newStreamId) && groupId.equals(newGroupId)) { hasChanged = !(newActivityId.equals(activityId) && newSearch.equals(search) && newSort.equals(sort)); } streamId = newStreamId; activityId = newActivityId; search = newSearch; sort = newSort; groupId = newGroupId; return hasChanged; }