Example usage for org.apache.wicket.util.value ValueMap getString

List of usage examples for org.apache.wicket.util.value ValueMap getString

Introduction

In this page you can find the example usage for org.apache.wicket.util.value ValueMap getString.

Prototype

@Override
public final String getString(final String key) 

Source Link

Usage

From source file:net.kornr.swit.wicket.layout.threecol.ThreeColumnsLayoutBorderFixed.java

License:Apache License

public ThreeColumnsLayoutBorderFixed(String id, LayoutInfo layout) {
    super(id);// w  ww.ja v a  2  s  .  co m
    m_layout = layout;

    m_colmaskholygrail = new WebMarkupContainer("colmask_holygrail");
    m_colmid = new WebMarkupContainer("colmid");
    m_colleft = new WebMarkupContainer("colleft");
    m_col1wrap = new WebMarkupContainer("col1wrap");
    m_col1 = new WebMarkupContainer("col1");
    m_col2 = new WebMarkupContainer("col2");
    m_col3 = new WebMarkupContainer("col3");

    m_colmaskholygrail.add(m_colmid);
    m_colmid.add(m_colleft);
    m_colleft.add(m_col1wrap);
    m_col1wrap.add(m_col1);
    m_colleft.add(m_col2);
    m_colleft.add(m_col3);

    m_left = new ColumnPanel("leftcolumn");
    m_right = new ColumnPanel("rightcolumn");

    m_col2.add(m_left);
    m_col3.add(m_right);

    this.add(m_colmaskholygrail);
    m_col1.add(getBodyContainer());

    ///
    /// Now, sets the classes

    ValueMap m = layout.getClassId();
    m_colmaskholygrail.add(new AttributeAppender("class",
            new Model<String>(m.getString("colmask") + " " + m.getString("holygrail")), " "));
    m_colmid.add(new AttributeAppender("class", new Model<String>(m.getString("colmid")), " "));
    m_colleft.add(new AttributeAppender("class", new Model<String>(m.getString("colleft")), " "));
    m_col1wrap.add(new AttributeAppender("class", new Model<String>(m.getString("col1wrap")), " "));
    m_col1.add(new AttributeAppender("class", new Model<String>(m.getString("col1")), " "));
    m_col2.add(new AttributeAppender("class", new Model<String>(m.getString("col2")), " "));
    m_col3.add(new AttributeAppender("class", new Model<String>(m.getString("col3")), " "));
}

From source file:net.kornr.swit.wicket.layout.threecol.ThreeColumnsLayoutBorderPc.java

License:Apache License

public ThreeColumnsLayoutBorderPc(String id, LayoutInfo layout) {
    super(id);//from  w  w  w .  ja va 2s.  c  o m

    m_layout = layout;

    m_left = new ColumnPanel("leftcolumn");
    m_right = new ColumnPanel("rightcolumn");

    m_colmaskthreecol = new WebMarkupContainer("colmask_threecol");
    m_colmid = new WebMarkupContainer("colmid");
    m_colleft = new WebMarkupContainer("colleft");
    m_col1 = new WebMarkupContainer("col1");
    m_col2 = new WebMarkupContainer("col2");
    m_col3 = new WebMarkupContainer("col3");

    this.add(m_colmaskthreecol);
    m_colmaskthreecol.add(m_colmid);
    m_colmid.add(m_colleft);
    m_colleft.add(m_col1);
    m_colleft.add(m_col2);
    m_colleft.add(m_col3);

    m_col1.add(getBodyContainer());

    m_col2.add(m_left);
    m_col3.add(m_right);

    ValueMap m = layout.getClassId();
    m_colmaskthreecol.add(new AttributeAppender("class",
            new Model<String>(m.getString("colmask") + " " + m.getString("threecol")), " "));
    m_colmid.add(new AttributeAppender("class", new Model<String>(m.getString("colmid")), " "));
    m_colleft.add(new AttributeAppender("class", new Model<String>(m.getString("colleft")), " "));
    m_col1.add(new AttributeAppender("class", new Model<String>(m.getString("col1")), " "));
    m_col2.add(new AttributeAppender("class", new Model<String>(m.getString("col2")), " "));
    m_col3.add(new AttributeAppender("class", new Model<String>(m.getString("col3")), " "));
}

From source file:org.geoserver.web.crs.DynamicCrsMapResource.java

License:Open Source License

@Override
public IResourceStream getResourceStream() {

    ValueMap parameters = getParameters();
    int width = parameters.getInt("WIDTH", 400);
    int height = parameters.getInt("HEIGHT", 200);
    String bboxStr = parameters.getString("BBOX");

    ByteArrayOutputStream output = null;
    if (bboxStr != null) {

        try {//www  . java2  s . com
            CRSAreaOfValidityMapBuilder builder = new CRSAreaOfValidityMapBuilder(width, height);
            Envelope envelope = parseEnvelope(bboxStr);
            RenderedImage image = builder.createMapFor(crs, envelope);
            output = new ByteArrayOutputStream();
            ImageIO.write(image, "PNG", output);
        } catch (Exception e) {
            output = null;
            e.printStackTrace();
        }
    }

    final byte[] byteArray = output == null ? null : output.toByteArray();

    return new ByteArrayResourceStream(byteArray);
}

From source file:org.obiba.onyx.quartz.core.engine.questionnaire.question.OpenAnswerDefinitionSuggestion.java

License:Open Source License

private String getValueMapString(String key) {
    ValueMap valueMap = openAnswer.getUIArgumentsValueMap();
    return valueMap == null ? null : valueMap.getString(key);
}

From source file:org.wicketstuff.misc.MyMixedParamUrlCodingStrategy.java

License:Apache License

@Override
public ValueMap decodeParameters(String urlFragment, Map urlParameters) {
    ValueMap back = super.decodeParameters(urlFragment, urlParameters);
    for (String key : back.keySet()) {
        back.put(key, urlDecode(back.getString((String) key)));
    }/*  w ww . j  av a  2 s .  co  m*/
    return back;
}

From source file:org.xaloon.wicket.plugin.user.panel.ActivationPanel.java

License:Apache License

private void addActivationForm() {
    final ValueMap properties = new ValueMap();

    PageParameters pageParameters = (PageParameters) getDefaultModelObject();
    String activationKey = pageParameters.get(ACTIVATION_KEY).toOptionalString();
    if (!StringUtils.isEmpty(activationKey)) {
        properties.put(ACTIVATION_KEY, activationKey);
    }/* w  w w.  j a v a2 s.  c o m*/
    Form<Void> activationForm = new StatelessForm<Void>("activation-form");
    add(activationForm);
    // Add activation key field
    final RequiredTextField<String> activationKeyField = new RequiredTextField<String>(ACTIVATION_KEY,
            new PropertyModel<String>(properties, ACTIVATION_KEY));
    activationForm.add(activationKeyField);

    // Add password fiels
    final PasswordTextField passwordTextField = new PasswordTextField(PARAM_PASSWORD,
            new PropertyModel<String>(properties, PARAM_PASSWORD));
    activationForm.add(passwordTextField);

    activationForm.add(new Button("submit") {
        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit() {
            String activationKey = properties.getString(ACTIVATION_KEY);
            String userPassword = properties.getString(PARAM_PASSWORD);

            if (userFacade.activate(activationKey, userPassword)) {
                getSession().info(getString(MESSAGE_INFO_ACTIVATED));
            } else {
                getSession().warn(getString(MESSAGE_ERROR_ACTIVATION));
            }
            activationKeyField.setModelObject(null);
            passwordTextField.setModelObject(null);
            setResponsePage(getPage());
        }
    });
}