Example usage for org.apache.wicket.util.string StringValue isNull

List of usage examples for org.apache.wicket.util.string StringValue isNull

Introduction

In this page you can find the example usage for org.apache.wicket.util.string StringValue isNull.

Prototype

public boolean isNull() 

Source Link

Document

Returns whether the text is null.

Usage

From source file:org.hippoecm.frontend.translation.components.folder.FolderTranslationPage.java

License:Apache License

public FolderTranslationPage(PageParameters parameters) {
    StringValue folderValue = parameters.get("folder");
    if (folderValue.isNull()) {
        folderValue = StringValue.valueOf("evenements");
    }// ww  w.j a v  a 2s  .  co m
    LoadableDetachableModel<T9Tree> treeModel = new LoadableDetachableModel<T9Tree>() {
        private static final long serialVersionUID = 1L;

        @Override
        protected T9Tree load() {
            return new JsonT9Tree();
        }
    };
    IModel<T9Node> t9NodeModel = new Model<T9Node>(treeModel.getObject().getNode(folderValue.toString()));
    add(new FolderTranslationView("grid", treeModel, t9NodeModel, new TestLocaleProvider()));
}

From source file:org.hippoecm.frontend.translation.components.folder.service.SiblingLocator.java

License:Apache License

public SiblingLocator(IModel<T9Tree> data) {
    this.data = data;
    this.behavior = new AbstractAjaxBehavior() {
        private static final long serialVersionUID = 1L;

        @Override/* www . j a  va  2s .  c om*/
        public void onRequest() {
            final RequestCycle requestCycle = RequestCycle.get();
            StringValue t9Id = requestCycle.getRequest().getRequestParameters().getParameterValue(T9ID_ID);
            if (!t9Id.isNull()) {
                try {
                    JSONObject siblingsAsJson = getSiblingsAsJSON(t9Id.toString());
                    requestCycle.scheduleRequestHandlerAfterCurrent(new ExtJsonRequestTarget(siblingsAsJson));
                } catch (JSONException e) {
                    throw new WicketRuntimeException("Could not build map of siblings");
                }
            } else {
                throw new WicketRuntimeException("No node id provided");
            }
        }
    };
}

From source file:org.jaulp.wicket.base.util.parameter.PageParametersUtils.java

License:Apache License

/**
 * <p>// w  w  w .ja  v a 2s  .  c  o m
 * Checks if the given StringValue is not null and the value of the given StringValue object is
 * not null and the value of the given StringValue object is not empty.
 * </p>
 *
 * @param stringValue
 *            the StringValue to check, may be null
 * @return <code>true</code> if the StringValue is not null and the value of the given
 *         StringValue object is not null and the value of the given StringValue object is not
 *         empty.
 */
public static final boolean isNotNullOrEmpty(StringValue stringValue) {
    return stringValue != null && !stringValue.isNull() && !stringValue.isEmpty();
}

From source file:org.jaulp.wicket.base.util.parameter.PageParametersUtils.java

License:Apache License

/**
 * <p>/*from w ww .ja va2  s . c  om*/
 * Checks if the given StringValue is null or the value of the given StringValue object is null
 * or the value of the given StringValue object is empty.
 * </p>
 *
 * @param stringValue
 *            the StringValue to check, may be null
 * @return <code>true</code> if the StringValue is null or the value of the given StringValue
 *         object is null or the value of the given StringValue object is empty.
 */
public static final boolean isNullOrEmpty(StringValue stringValue) {
    return stringValue == null || stringValue.isNull() || stringValue.isEmpty();
}

From source file:org.onehippo.cms7.reports.plugins.brokenlinkslist.BrokenLinksStore.java

License:Apache License

private int parseIntParameter(ServletWebRequest request, String name, int defaultValue) {
    StringValue param = request.getRequestParameters().getParameterValue(name);
    if (!param.isNull()) {
        try {/*from ww  w.ja  v a  2 s  . c o m*/
            return Integer.parseInt(param.toString());
        } catch (NumberFormatException e) {
            log.warn("Value of parameter '" + name + "' is not an integer: '" + param
                    + "', using default value '" + defaultValue + "'");
        }
    }
    return defaultValue;
}

From source file:org.projectforge.web.wicket.WicketUtils.java

License:Open Source License

public static boolean contains(final PageParameters parameters, final String name) {
    final StringValue sval = parameters.get(name);
    if (sval == null) {
        return false;
    } else {/*from   w  w w  .  j  a v a 2 s  .  c o m*/
        return sval.isNull() == false;
    }
}

From source file:org.projectforge.web.wicket.WicketUtils.java

License:Open Source License

public static String getAsString(final PageParameters parameters, final String name) {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
        return null;
    } else {//from   w  w w. ja  v  a2 s .  co m
        return sval.toString();
    }
}

From source file:org.projectforge.web.wicket.WicketUtils.java

License:Open Source License

public static Integer getAsInteger(final PageParameters parameters, final String name) {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
        return null;
    } else {/*w  w  w .j a  va2  s .  com*/
        return sval.toInteger();
    }
}

From source file:org.projectforge.web.wicket.WicketUtils.java

License:Open Source License

public static int getAsInt(final PageParameters parameters, final String name, final int defaultValue) {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
        return defaultValue;
    } else {//from w w  w .j a va 2s  .  c  o m
        return sval.toInt();
    }
}

From source file:org.projectforge.web.wicket.WicketUtils.java

License:Open Source License

public static Long getAsLong(final PageParameters parameters, final String name) {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
        return null;
    } else {/*ww w .  ja v  a  2s.c  om*/
        return sval.toLong();
    }
}