/** * Gets the target window name. * * @see #setWindowName(String) * * @return the window target string */ public String getWindowName() { return getState(false).target; }
/** * Sets the features for opening the window. See e.g. * {@link https://developer.mozilla.org/en-US/docs/DOM/window.open#Position_and_size_features} * for a description of the commonly supported features. * * @param features a string with window features, or <code>null</code> to use the default features. */ // @formatter:on public void setFeatures(String features) { getState().features = features; }
/** * Sets the target window name that will be used. If a window has already * been opened with the same name, the contents of that window will be * replaced instead of opening a new window. If the name is * <code>null</code> or <code>"_blank"</code>, a new window will always be * opened. * * @param windowName * the target name for the window */ public void setWindowName(String windowName) { getState().target = windowName; }
/** * Gets the window features. * * @see #setFeatures(String) * @return */ public String getFeatures() { return getState(false).features; }
/** * Gets that URI fragment configured for opened windows. * * @return the URI fragment string, or <code>null</code> if no fragment is * configured. * * @see #setUriFragment(String) */ public String getUriFragment() { return getState(false).uriFragment; }
/** * Sets a URI fragment that will be added to the URI opened in the window. * If the window is opened to contain a Vaadin UI, the fragment will be * available using {@link Page#getUriFragment()} on the Page instance of the * new UI. * <p> * The default value is <code>null</code>. * * @param uriFragment * the URI fragment string that should be included in the opened * URI, or <code>null</code> to preserve the original fragment of * the URI. */ public void setUriFragment(String uriFragment) { getState().uriFragment = uriFragment; }
/** * Gets the names of all parameters set using * {@link #setParameter(String, String)}. * * @return an unmodifiable set of parameter names * * @see #setParameter(String, String) * @see #getParameter(String) */ public Set<String> getParameterNames() { return Collections.unmodifiableSet(getState().parameters.keySet()); }
/** * Removes a parameter that has been set using * {@link #setParameter(String, String)}. Removing a parameter that has not * been set has no effect. * * @param name * the name of the parameter to remove, not <code>null</code> * * @see #setParameter(String, String) */ public void removeParameter(String name) { if (name == null) { throw new IllegalArgumentException("Null not allowed"); } getState().parameters.remove(name); }
/** * Gets the value of a parameter set using * {@link #setParameter(String, String)}. If there is no parameter with the * given name, <code>null</code> is returned. * * @param name * the name of the parameter to get, not <code>null</code> * @return the value of the parameter, or <code>null</code> there is no * parameter * * @see #setParameter(String, String) * @see #getParameter(String) */ public String getParameter(String name) { if (name == null) { throw new IllegalArgumentException("Null not allowed"); } return getState(false).parameters.get(name); }
/** * Sets a parameter that will be added to the query string of the opened * URI. If the window is opened to contain a Vaadin UI, the parameter will * be available using {@link VaadinRequest#getParameter(String)} e.g. using * the request instance passed to {@link UI#init(VaadinRequest)}. * <p> * Setting a parameter with the same name as a previously set parameter will * replace the previous value. * * @param name * the name of the parameter to add, not <code>null</code> * @param value * the value of the parameter to add, not <code>null</code> * * @see #removeParameter(String) * @see #getParameterNames() * @see #getParameter(String) */ public void setParameter(String name, String value) { if (name == null || value == null) { throw new IllegalArgumentException("Null not allowed"); } getState().parameters.put(name, value); }
/** * Add this extension to the {@code EventTrigger}. * * @param eventTrigger * the trigger to attach this extension to * * @since 8.4 */ public void extend(EventTrigger eventTrigger) { super.extend(eventTrigger.getConnector()); getState().partInformation = eventTrigger.getPartInformation(); }