Skip to content

Commit

Permalink
fixing maven deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
tbee committed Sep 15, 2013
1 parent 6cec7f7 commit c209e25
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ build.xml
/_lib
/gradlew_release.cmd
/gradle_localOverride.cmd
/gradlew_updateWrapper.cmd
/gradlew_repairHeaders.cmd
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ buildscript {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
dependencies {
classpath "eu.mihosoft.vrl.vlicense-header-util:VLicenseHeaderUtil:0.1-r2-SNAPSHOT"
classpath "eu.mihosoft.vrl.vlicense-header-util.gradle:vlicense-header-plugin:0.1-r2-SNAPSHOT"
}
}

final javaHome = System.env['JAVA_HOME']
Expand Down Expand Up @@ -69,7 +73,7 @@ task buildTimestamped(type: Copy, dependsOn: 'build') {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.0-rc-3'
gradleVersion = '1.7'
}

signArchives.onlyIf {
Expand Down
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jun 03 10:11:31 MDT 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-3-bin.zip
#Sun Sep 15 18:45:24 CEST 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
2 changes: 1 addition & 1 deletion license-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* * Neither the name of the organization nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'jfxtras-labs'
53 changes: 37 additions & 16 deletions src/main/java/jfxtras/labs/scene/control/CalendarTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@

package jfxtras.labs.scene.control;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Locale;

import javafx.beans.property.ListProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.ObservableList;
import javafx.scene.control.Control;
import javafx.util.Callback;
import java.lang.reflect.Field;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Locale;

import javafx.beans.property.ListProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.ObservableList;
import javafx.scene.control.Control;
import javafx.util.Callback;

/**
* A textField with displays a calendar (date) with a icon to popup the CalendarPicker
Expand Down Expand Up @@ -101,7 +102,10 @@ private void construct()
public void setCalendar(Calendar value) { calendarObjectProperty.setValue(value); }
public CalendarTextField withCalendar(Calendar value) { setCalendar(value); return this; }

/** Locale: the locale is used to determine first-day-of-week, weekday labels, etc */
/** Locale: the locale is used to determine first-day-of-week, weekday labels, etc
* If possible, the locale will be derived from the DateFormat when it is set.
* Since it is not formally possible to extract the Locale from a DateFormat, the coder is responsible for making sure the dateformat's Locale and this Locale are the same.
*/
public ObjectProperty<Locale> localeProperty() { return localeObjectProperty; }
final private ObjectProperty<Locale> localeObjectProperty = new SimpleObjectProperty<Locale>(Locale.getDefault())
{
Expand All @@ -110,7 +114,7 @@ public void set(Locale value)
super.set(value);
if (dateFormatManual == false)
{
setDateFormat( SimpleDateFormat.getDateInstance(DateFormat.LONG, value) );
setDateFormat( SimpleDateFormat.getDateInstance(DateFormat.MEDIUM, value) );
}
}
};
Expand All @@ -123,12 +127,29 @@ public void set(Locale value)
* It is allow to show time as well for example by SimpleDateFormat.getDateTimeInstance().
*/
public ObjectProperty<DateFormat> dateFormatProperty() { return dateFormatObjectProperty; }
final private ObjectProperty<DateFormat> dateFormatObjectProperty = new SimpleObjectProperty<DateFormat>(this, "dateFormat", SimpleDateFormat.getDateInstance(DateFormat.LONG, getLocale()))
final private ObjectProperty<DateFormat> dateFormatObjectProperty = new SimpleObjectProperty<DateFormat>(this, "dateFormat", SimpleDateFormat.getDateInstance(DateFormat.MEDIUM, getLocale()))
{
public void set(DateFormat value)
{
super.set(value);
dateFormatManual = true;

// see if we can extract the locale
if (value != null)
{
try
{
Field field = value.getClass().getDeclaredField("locale");
field.setAccessible(true);
Locale lLocale = (Locale)field.get(value);
if (lLocale != null)
{
setLocale(lLocale);
}
}
catch (NoSuchFieldException e) { } // ignored on purpose
catch (IllegalAccessException e) { } // ignored on purpose
}
}
};
public DateFormat getDateFormat() { return dateFormatObjectProperty.getValue(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,26 @@

package jfxtras.labs.scene.control;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;

import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.util.Callback;

import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.util.Callback;

/**
* @author Tom Eugelink
Expand Down Expand Up @@ -159,14 +162,35 @@ public void changed(ObservableValue<? extends Calendar> observableValue, Calenda

// locale DE
{
lGridPane.add(new Label("locale DE"), 0, lRowIdx);
lGridPane.add(new Label("locale FR"), 0, lRowIdx);
CalendarTextField lCalendarTextField = new CalendarTextField();
lCalendarTextField.setLocale(Locale.GERMAN);
lCalendarTextField.setLocale(Locale.FRANCE);
lGridPane.add(lCalendarTextField, 1, lRowIdx++);

lCalendarTextField.calendarProperty().set(new GregorianCalendar(2011, 2, 01)); // set a value
}

// locale DE button
{
lGridPane.add(new Label("locale FR"), 0, lRowIdx);
final CalendarTextField lCalendarTextField = new CalendarTextField();
lCalendarTextField.setLocale(Locale.FRANCE);
lGridPane.add(lCalendarTextField, 1, lRowIdx);

Button lButton = new Button("set");
lButton.onMouseClickedProperty().set(new EventHandler<Event>()
{
@Override
public void handle(Event arg0)
{
lCalendarTextField.setCalendar(new GregorianCalendar(2011, 2, 01));
}
});
lGridPane.add(lButton, 2, lRowIdx++);

lCalendarTextField.calendarProperty().set(new GregorianCalendar()); // set a value
}

// disabled
{
lGridPane.add(new Label("custom icon disabled"), 0, lRowIdx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VBox xmlns:fx="http://javafx.com/fxml">
<children>
<CalendarTextField/>
<CalendarTextField fx:id="test" dateFormat="yyyy-MM-dd HH:mm:ss" dateFormats="yyyy-MM-dd, yyyy-MM, yyyy" promptText="test"/>
<CalendarTextField locale="DE"/>
<CalendarTextField fx:id="test" dateFormat="yyyy-MM-dd HH:mm:ss" dateFormats="yyyy-MM-dd, yyyy-MM, yyyy" promptText="default locale, multiple formats"/>
<CalendarTextField locale="FR" promptText="FR locale"/>
</children>
</VBox>

0 comments on commit c209e25

Please sign in to comment.