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

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

Introduction

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

Prototype

public final int toInt() throws StringValueConversionException 

Source Link

Document

Convert this text to an int.

Usage

From source file:com.cubeia.games.poker.admin.wicket.pages.tournaments.blinds.CreateOrEditBlindsStructure.java

License:Open Source License

private BlindsStructure initBlindsStructure(PageParameters parameters) {
    StringValue structureId = parameters.get("structureId");
    if (!isEmpty(structureId)) {
        return adminDAO.getItem(BlindsStructure.class, structureId.toInt());
    }//from   ww w.  j ava2s .  c o m
    return new BlindsStructure();
}

From source file:com.cubeia.games.poker.admin.wicket.util.WicketHelpers.java

License:Open Source License

public static Integer toIntOrNull(StringValue value) {
    if (nullValue(value))
        return null;
    return value.toInt();
}

From source file:com.ecom.web.components.gmap.event.ZoomEndListener.java

License:Apache License

@Override
protected void onEvent(AjaxRequestTarget target) {
    Request request = RequestCycle.get().getRequest();
    int oldLevel = 0;
    int newLevel = 0;
    StringValue oldZoomLevelParameter = request.getRequestParameters().getParameterValue("argument0");
    StringValue newZoomLevelParameter = request.getRequestParameters().getParameterValue("argument1");
    if (oldZoomLevelParameter.isNull() || newZoomLevelParameter.isNull()) {
        return;// w  w w. ja va2s.  c  om
    }
    oldLevel = oldZoomLevelParameter.toInt();
    newLevel = newZoomLevelParameter.toInt();
    onZoomEnd(target, oldLevel, newLevel);
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.articles.ArticleCommentFormPage.java

License:Apache License

public ArticleCommentFormPage(PageParameters parameters) {

    setPageTitle(ResourceUtils.getModel("label.addComment"));
    add(new ButtonPageMenu("leftMenu", ArticlesPageLeftMenu.values()));

    StringValue articleParam = parameters.get(PageParametersUtils.ARTICLE);
    StringValue commentParam = parameters.get(PageParametersUtils.COMMENT);

    if (articleParam.isNull() || articleParam.isEmpty() || commentParam.isEmpty() || commentParam.isNull()) {
        throw new RestartResponseAtInterceptPageException(ArticlesPage.class);
    }/*from  ww w . java2  s.  com*/

    int articleId = articleParam.toInt();
    int commentId = commentParam.toInt();

    Article article = facade.read(articleId);

    boolean isPublicArticle = article.getResearchGroup() == null;
    testUserCanAddArticleComment(isPublicArticle);

    ArticleComment parentComment = facade.readComment(commentId);
    Person person = EEGDataBaseSession.get().getLoggedUser();

    ArticleComment newComment = new ArticleComment();
    newComment.setArticle(article);
    newComment.setPerson(person);
    newComment.setParent(parentComment);

    add(new ArticleCommentFormPanel("addCommentFormPanel", new Model<ArticleComment>(newComment),
            getFeedback()));

}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.articles.ArticleFormPage.java

License:Apache License

public ArticleFormPage(PageParameters parameters) {

    testUserCanAddArticle();//from w  w  w.  j a  va2 s  . c  o  m

    setPageTitle(ResourceUtils.getModel("pageTitle.editArticle"));
    add(new Label("title", ResourceUtils.getModel("pageTitle.editArticle")));

    StringValue param = parameters.get(DEFAULT_PARAM_ID);
    if (param.isNull() || param.isEmpty()) {
        throw new RestartResponseAtInterceptPageException(ArticlesPage.class);
    }

    int articleId = param.toInt();
    Article article = articleFacade.getArticleDetail(articleId, EEGDataBaseSession.get().getLoggedUser());
    setupComponents(new Model<Article>(article));
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.articles.ViewArticlePage.java

License:Apache License

public ViewArticlePage(PageParameters parameters) {

    StringValue param = parameters.get(DEFAULT_PARAM_ID);
    if (param.isNull() || param.isEmpty()) {
        throw new RestartResponseAtInterceptPageException(ArticlesPage.class);
    }/*from  w  ww.jav  a  2  s. com*/
    int articleId = param.toInt();

    setupComponents(articleId);
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.data.AddDataFilePage.java

License:Apache License

public AddDataFilePage(PageParameters parameters) {

    StringValue stringValue = parameters.get(DEFAULT_PARAM_ID);
    if (stringValue.isNull() || stringValue.isEmpty()) {
        throw new RestartResponseAtInterceptPageException(ListExperimentsPage.class);
    }// w ww  .  j a v a  2  s  . c o m

    int experimentId = stringValue.toInt();

    setPageTitle(ResourceUtils.getModel("pageTitle.addDataFile"));
    add(new ButtonPageMenu("leftMenu", ExperimentsPageLeftMenu.values()));

    setupComponents(experimentId);
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.data.DataFileDetailPage.java

License:Apache License

private int parseParameters(PageParameters parameters) {

    StringValue value = parameters.get(BasePage.DEFAULT_PARAM_ID);
    if (value.isNull() || value.isEmpty())
        throw new RestartResponseAtInterceptPageException(EEGDataBaseApplication.get().getHomePage());
    return value.toInt();
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.experiments.ExperimentFormPage.java

License:Apache License

private int parseParameters(PageParameters parameters) {
    StringValue value = parameters.get(BasePage.DEFAULT_PARAM_ID);
    if (value.isNull() || value.isEmpty())
        throw new RestartResponseAtInterceptPageException(EEGDataBaseApplication.get().getHomePage());
    return value.toInt();
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.experiments.ExperimentsPackageDownloadPage.java

License:Apache License

public ExperimentsPackageDownloadPage(PageParameters parameters) {

    StringValue packageIdValue = parameters.get(DEFAULT_PARAM_ID);
    if (packageIdValue.isNull() || packageIdValue.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListExperimentsByPackagePage.class);
    else/* w  ww.  j av  a  2s .co  m*/
        setupComponents(packageIdValue.toInt());
}