Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COMMON_JAVA_ARGS="$(tr '\n' ' ' <<-EOF
-Dspring.datasource.password=$POSTGRES_PASSWORD
-DJava.awt.headless=true
-XX:+UseG1GC
-XX:-UseContainerSupport
-Dspring.data.mongodb.uri=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@mongo:27017/ocportal?authSource=admin
-Dspring.datasource.url=jdbc:postgresql://db/ocportal
-Dgoogle.recaptcha.secret=$RECAPTCHA_SECRET
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
/* (c) 2014 - 2016 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.devgateway.toolkit.forms.wicket.components;

import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.form.NumberTextField;
import org.apache.wicket.model.IModel;
import org.apache.wicket.util.convert.IConverter;
import org.devgateway.toolkit.forms.wicket.converters.DecimalConverter;

/**
* A TextField for {@code java.lang.Double} representations that allows for arbitrary number of
* decimal places, since the default TextField rounds up doubles to three decimals.
* A TextField for decimal numbers extending Wicket's NumberTextField<Double>
*
* @author groldan
* @author mpostelnicu
*/
public class DecimalTextField extends TextField<Double> {
public class DecimalTextField extends NumberTextField<Double> {

private static final long serialVersionUID = 1L;

private DecimalConverter decimalConverter;

public DecimalTextField(String id, IModel<Double> model) {
super(id, model, Double.class);
decimalConverter = new DecimalConverter();
}

public void setMaximumFractionDigits(int maximumFractionDigits) {
decimalConverter.setMaximumFractionDigits(maximumFractionDigits);
}

@SuppressWarnings("unchecked")
@Override
public <C> IConverter<C> getConverter(Class<C> type) {
if (Double.class.isAssignableFrom(type)) {
return (IConverter<C>) decimalConverter;
}
return super.getConverter(type);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
<input wicket:id="field" type="text"></input>
<input wicket:id="field" type="number"></input>
</wicket:extend>
</html>

This file was deleted.

5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>clojars</id>
<name>Clojure Libraries</name>
<url>https://repo.clojars.org/</url>
</repository>
<repository>
<id>devgateway-open-source</id>
<name>devgateway-open-source</name>
Expand Down