/** * Sets URI fragment. This method fires a {@link UriFragmentChangedEvent} * * @param newUriFragment * id of the new fragment * @see UriFragmentChangedEvent * @see Page.UriFragmentChangedListener */ public void setUriFragment(String newUriFragment) { setUriFragment(newUriFragment, true); }
/** * Sets the URI fragment to the given string. * * @param fragment * The new URI fragment. */ protected void setFragment(String fragment) { page.setUriFragment(fragment, false); } }
public void clearUriFragments(){ page.setUriFragment("", false); }
private void applyHistory(String username, String fragment) { // If there was existing history, then restore that history snapshot. if (fragment != null) { LoggerFactory.getLogger(this.getClass()).info("Restoring history for user {}: {}", username, fragment); if (getPage() != null) { getPage().setUriFragment(fragment); } m_historyManager.applyHistory(fragment, m_graphContainer); } }
public void rememberNavigation(String caption, String space, String subSpace, String search, boolean navLink) { String newEntry = caption.replace('|', ' ') + "|" + space + "|" + subSpace + "|" + search; while (this.history.remove(newEntry) ) {} // move up this.history.add(newEntry); doUpdateHistoryMenu(); if (navLink) UI.getCurrent().getPage().setUriFragment("!:" + space + "/" + (subSpace == null ? "" : subSpace) + "/" + (search == null ? "" : search)); }
private void updateUriFragment() { if (isUriFragmentEnabled()) { String currentStepId = getId(currentStep); if (currentStepId != null && currentStepId.length() > 0) { Page.getCurrent().setUriFragment(currentStepId, false); } else { Page.getCurrent().setUriFragment(null, false); } } }
private void applyHistory(String username, String fragment) { // If there was existing history, then restore that history snapshot. if (fragment != null) { LoggerFactory.getLogger(this.getClass()).info("Restoring history for user {}: {}", username, fragment); if (getPage() != null) { getPage().setUriFragment(fragment); } m_historyManager.applyHistory(fragment, m_graphContainer); } }
public static void pushState(String navigationState) { checkNotEmptyString(navigationState, "Unable to push empty navigation state"); if (headless()) { log.debug("Unable to push navigation state in headless mode"); return; } Page.getCurrent().setUriFragment(navigationState, false); }
@Override public void setCurrentView(NavigateableView view){ if (!setCurrentViewCausedByHistoryChange){ // Add url fragmentHistory support String uriFragment = calculateUri(view); HistoryEntry entry = new HistoryEntry(); entry.eventsToFire = calculateEventsToFireList(view); if (historyStack.isEmpty()) historyStack.put("", entry); historyStack.put(uriFragment, entry); page.setUriFragment(uriFragment, false); // Seems not to work at first call } fireNavigatedTo(view); }
@Override public void uriFragmentChanged(UriFragmentChangedEvent event) { if (isUriFragmentEnabled()) { String fragment = event.getUriFragment(); if ((fragment == null || fragment.equals("")) && !steps.isEmpty()) { // empty fragment -> set the fragment of first step Page.getCurrent().setUriFragment(getId(steps.get(0))); } else { activateStep(fragment); } } }
private void saveHistory() { if (m_settingFragment == 0) { String fragment = m_historyManager.saveOrUpdateHistory(m_applicationContext.getUsername(), m_graphContainer); if (getPage() != null) { getPage().setUriFragment(fragment, false); } } }
private void saveHistory() { if (m_settingFragment == 0) { String fragment = m_historyManager.saveOrUpdateHistory(m_applicationContext.getUsername(), m_graphContainer); if (getPage() != null) { getPage().setUriFragment(fragment, false); } } }
public boolean openSpace(String spaceId, String subSpace, String search, boolean history, boolean navLink) { GuiSpaceService space = getSpace(spaceId); if (space == null) return false; if (!getApi().hasAccess(space.getName()) || !space.hasAccess(getApi().getAccessControl())) return false; String ret = showSpace(space, subSpace, search); if (ret != null && history) { String newEntry = ret.replace('|', ' ') + "|" + spaceId + "|" + subSpace + "|" + search; while (this.history.remove(newEntry) ) {} // move up this.history.add(newEntry); doUpdateHistoryMenu(); } if (navLink) UI.getCurrent().getPage().setUriFragment("!:" + spaceId + "/" + (subSpace == null ? "" : subSpace) + "/" + (search == null ? "" : search)); return ret != null; }
protected void showOverview(boolean setLinking) { if (menuLeave != null) menuLeave.setEnabled(false); contentScreen.removeAllComponents(); cleanupMenu(); currentSpace = null; contentScreen.addComponent(overView); contentScreen.setExpandRatio(overView, 1f); menuHistory.setText(MNls.find(this, "menu.history=History")); if (setLinking) UI.getCurrent().getPage().setUriFragment(""); }
if (!fragment .equals(page.getUriFragment())) { page.setUriFragment(fragment, false);
if (!fragment .equals(page.getUriFragment())) { page.setUriFragment(fragment, false);