You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(37) |
Jun
(141) |
Jul
(111) |
Aug
(91) |
Sep
(79) |
Oct
(151) |
Nov
(161) |
Dec
(93) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(40) |
Feb
(60) |
Mar
(43) |
Apr
(90) |
May
(31) |
Jun
(114) |
Jul
(35) |
Aug
(112) |
Sep
(305) |
Oct
(151) |
Nov
(122) |
Dec
(103) |
| 2006 |
Jan
(65) |
Feb
(57) |
Mar
(475) |
Apr
(276) |
May
(482) |
Jun
(134) |
Jul
(127) |
Aug
(188) |
Sep
(271) |
Oct
(220) |
Nov
(74) |
Dec
(41) |
| 2007 |
Jan
(121) |
Feb
(50) |
Mar
(36) |
Apr
(11) |
May
(31) |
Jun
(12) |
Jul
(73) |
Aug
(41) |
Sep
(59) |
Oct
(33) |
Nov
(60) |
Dec
(111) |
| 2008 |
Jan
(139) |
Feb
(49) |
Mar
(87) |
Apr
(43) |
May
(10) |
Jun
(25) |
Jul
(114) |
Aug
(17) |
Sep
(25) |
Oct
(199) |
Nov
(94) |
Dec
(45) |
| 2009 |
Jan
(36) |
Feb
(14) |
Mar
(29) |
Apr
(32) |
May
(49) |
Jun
(18) |
Jul
(68) |
Aug
(34) |
Sep
(34) |
Oct
(11) |
Nov
(10) |
Dec
(14) |
| 2010 |
Jan
(35) |
Feb
(12) |
Mar
(23) |
Apr
(17) |
May
(4) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
(10) |
Dec
|
| 2011 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
| 2012 |
Jan
(2) |
Feb
(1) |
Mar
(8) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
(3) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(3) |
Dec
(4) |
| 2014 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(5) |
Jun
(1) |
Jul
(13) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(15) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: <mai...@ce...> - 2009-03-14 20:53:23
|
From: Johannes Schneider <js...@ce...>
---
.../swing/date/NachoCalendarDateFieldBinder.java | 36 +-
.../swing/date/NachoCalendarDateFieldBinding.java | 4 +-
.../form/binding/swing/date/NullableDateField.java | 652 ++++++++++++++++++++
.../date/NachoCalendarDateFieldBinderTests.java | 4 +-
4 files changed, 678 insertions(+), 18 deletions(-)
create mode 100644 spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NullableDateField.java
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinder.java
index d2f5def..24ebc2e 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinder.java
@@ -15,6 +15,17 @@
*/
package org.springframework.richclient.form.binding.swing.date;
+import java.awt.Dimension;
+import java.util.Map;
+import java.util.Locale;
+import java.util.Date;
+import java.text.DateFormat;
+import java.text.FieldPosition;
+import java.text.ParsePosition;
+
+import javax.swing.JComponent;
+import javax.swing.text.DateFormatter;
+
import net.sf.nachocalendar.components.DateField;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
@@ -54,8 +65,8 @@ public class NachoCalendarDateFieldBinder extends AbstractDateFieldBinder {
}
protected Binding doBind(JComponent control, FormModel formModel, String formPropertyPath, Map context) {
- Assert.isTrue(control instanceof DateField, "Control must be an instance of DateField.");
- NachoCalendarDateFieldBinding binding = new NachoCalendarDateFieldBinding((DateField) control, formModel,
+ Assert.isTrue(control instanceof NullableDateField, "Control must be an instance of DateField.");
+ NachoCalendarDateFieldBinding binding = new NachoCalendarDateFieldBinding((NullableDateField) control, formModel,
formPropertyPath);
applyContext(binding, context);
return binding;
@@ -83,19 +94,16 @@ public class NachoCalendarDateFieldBinder extends AbstractDateFieldBinder {
context.remove(SHOW_WEEKNUMBERS_KEY);
}
+ // FIXME dirty hack so the DateField has the correct height
+ return new NullableDateField(showWeekNumbers){
+ private static final long serialVersionUID = 1L;
- DateField dateField = new DateField(showWeekNumbers) {
-
- private static final long serialVersionUID = 1L;
-
- public Dimension getPreferredSize() {
- Dimension size = super.getPreferredSize();
- size.height = preferredHeight;
-
- return size;
- }
- };
+ public Dimension getPreferredSize() {
+ Dimension size = super.getPreferredSize();
+ size.height = preferredHeight;
- return dateField;
+ return size;
+ }
+ };
}
}
\ No newline at end of file
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinding.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinding.java
index ffaacbf..a923803 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinding.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinding.java
@@ -33,11 +33,11 @@ import org.springframework.binding.form.FormModel;
*/
public class NachoCalendarDateFieldBinding extends AbstractDateFieldBinding {
- private final DateField dateField;
+ private final NullableDateField dateField;
private Boolean showOkCancel;
- public NachoCalendarDateFieldBinding(DateField dateField, FormModel formModel, String formPropertyPath) {
+ public NachoCalendarDateFieldBinding(NullableDateField dateField, FormModel formModel, String formPropertyPath) {
super(formModel, formPropertyPath);
this.dateField = dateField;
}
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NullableDateField.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NullableDateField.java
new file mode 100644
index 0000000..301baa0
--- /dev/null
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/date/NullableDateField.java
@@ -0,0 +1,652 @@
+package org.springframework.richclient.form.binding.swing.date;
+
+import net.sf.nachocalendar.components.ArrowButton;
+import net.sf.nachocalendar.components.CalendarUtils;
+import net.sf.nachocalendar.components.DatePanel;
+import net.sf.nachocalendar.components.DayRenderer;
+import net.sf.nachocalendar.components.DefaultDayRenderer;
+import net.sf.nachocalendar.components.DefaultHeaderRenderer;
+import net.sf.nachocalendar.components.HeaderRenderer;
+import net.sf.nachocalendar.model.DataModel;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFormattedTextField;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
+import javax.swing.border.Border;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.text.DateFormatter;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ *
+ */
+public class NullableDateField extends JPanel implements ActionListener, PropertyChangeListener {
+ private WindowPanel windowpanel;
+ //private Date fecha;
+ private DatePanel datepanel;
+ private JFormattedTextField field;
+ private JButton button;
+ private Calendar calendar;
+ private boolean showWeekNumbers;
+ private DateFormatter formatter;
+ private boolean antiAliased;
+ private boolean printMoon;
+ private Locale locale;
+ private DateFormat dateFormat;
+ private Date baseDate;
+
+ private JFormattedTextField.AbstractFormatterFactory formatterFactory = new JFormattedTextField.AbstractFormatterFactory() {
+ public JFormattedTextField.AbstractFormatter getFormatter( JFormattedTextField tf ) {
+ return new DateFormatter( dateFormat );
+ }
+ };
+
+ /**
+ * Utility field holding list of ChangeListeners.
+ */
+ private transient java.util.ArrayList changeListenerList;
+
+ /**
+ * Holds value of property showOkCancel.
+ */
+ private boolean showOkCancel;
+
+ /**
+ * Holds value of property firstDayOfWeek.
+ */
+ private int firstDayOfWeek;
+
+ /**
+ * Holds value of property workingDays.
+ */
+ private boolean[] workingDays;
+
+ /**
+ * Creates a new instance of DateField.
+ *
+ * @param showWeekNumbers true if the week numbers must be shown
+ */
+ public NullableDateField( boolean showWeekNumbers ) {
+ //panel = new WindowPanel(parent, showWeekNumbers);
+ this.showWeekNumbers = showWeekNumbers;
+ init();
+ }
+
+ /**
+ * Constructs a default DateField.
+ */
+ public NullableDateField() {
+ this( false );
+ }
+
+ /**
+ * Constructor with a custom formatter.
+ *
+ * @param formatter formatter used for the textfield
+ */
+ public NullableDateField( DateFormatter formatter ) {
+ this.formatter = formatter;
+ init();
+ }
+
+ public NullableDateField( DateFormat dateFormat ) {
+ this.dateFormat = dateFormat;
+ init();
+ }
+
+ /**
+ * Constructor with a custom locale.
+ *
+ * @param locale Locale to use
+ */
+ public NullableDateField( Locale locale ) {
+ this.locale = locale;
+ init();
+ }
+
+ private void init() {
+ if ( locale == null ) locale = Locale.getDefault();
+ calendar = Calendar.getInstance();
+ calendar.set( Calendar.HOUR, 0 );
+ calendar.set( Calendar.MINUTE, 0 );
+ calendar.set( Calendar.MILLISECOND, 0 );
+ datepanel = new DatePanel( showWeekNumbers );
+ datepanel.setFirstDayOfWeek( firstDayOfWeek );
+ datepanel.setWorkingDays( workingDays );
+ datepanel.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
+ setRenderer( new DefaultDayRenderer() );
+ setHeaderRenderer( new DefaultHeaderRenderer() );
+ setLayout( new BorderLayout() );
+ if ( dateFormat != null ) {
+ field = new JFormattedTextField( dateFormat );
+ } else {
+ if ( formatter == null ) formatter = new DateFormatter( DateFormat.getDateInstance( DateFormat.SHORT, locale ) );
+ field = new JFormattedTextField( formatter );
+ }
+ add( field, BorderLayout.CENTER );
+ button = new ArrowButton( SwingConstants.SOUTH );
+ add( button, BorderLayout.EAST );
+ button.addActionListener( this );
+ field.setValue( new Date() );
+ field.addPropertyChangeListener( "value", this );
+ Border border = field.getBorder();
+ field.setBorder( null );
+ setBorder( border );
+
+ field.addPropertyChangeListener( new PropertyChangeListener() {
+ public void propertyChange( PropertyChangeEvent evt ) {
+ if ( "editValid".equals( evt.getPropertyName() ) && evt.getNewValue()==Boolean.FALSE ) {
+ if ( field.getText().length() == 0 ) {
+ field.setValue( null );
+ }
+ }
+
+ firePropertyChange( evt.getPropertyName(), evt.getOldValue(), evt.getNewValue() );
+ }
+ } );
+ }
+
+ private void aceptar() {
+ windowpanel.setVisible( false );
+ field.setValue( windowpanel.getDate() );
+ }
+
+ private void cancelar() {
+ windowpanel.setVisible( false );
+ }
+
+ private void createWindow() {
+ Component c = this;
+ //Dialog d = null;
+ while ( !( c instanceof Dialog ) && ( c != null ) ) {
+ c = c.getParent();
+ }
+ if ( c != null ) {
+ windowpanel = new WindowPanel( ( Dialog ) c, showWeekNumbers );
+ return;
+ }
+
+ Frame f = JOptionPane.getFrameForComponent( this );
+ windowpanel = new WindowPanel( f, showWeekNumbers );
+ }
+
+ /**
+ * Invoked when an action occurs.
+ *
+ * @param e the event fired
+ */
+ public void actionPerformed( ActionEvent e ) {
+ if ( windowpanel == null ) {
+ createWindow();
+ }
+
+ Date da = ( Date ) field.getValue();
+ if ( da == null ) {
+ da = baseDate;
+ }
+ if ( da == null ) {
+ da = calendar.getTime();
+ }
+ windowpanel.setDate( da );
+ Point p = getLocationOnScreen();
+ p.y += getHeight();
+ windowpanel.setLocation( p );
+ windowpanel.setVisible( true );
+ }
+
+ /**
+ * Sets the current Date.
+ *
+ * @param value current Date
+ */
+ public void setValue( Object value ) {
+ try {
+ field.setValue( CalendarUtils.convertToDate( value ) );
+ } catch ( ParseException e ) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Returns the current Date.
+ *
+ * @return current Date
+ */
+ public Object getValue() {
+ return field.getValue();
+ }
+
+ /**
+ * Registers ChangeListener to receive events.
+ *
+ * @param listener The listener to register.
+ */
+ public synchronized void addChangeListener( ChangeListener listener ) {
+ if ( changeListenerList == null ) {
+ changeListenerList = new java.util.ArrayList();
+ }
+ changeListenerList.add( listener );
+ }
+
+ /**
+ * Removes ChangeListener from the list of listeners.
+ *
+ * @param listener The listener to remove.
+ */
+ public synchronized void removeChangeListener( ChangeListener listener ) {
+ if ( changeListenerList != null ) {
+ changeListenerList.remove( listener );
+ }
+ }
+
+ /**
+ * Notifies all registered listeners about the event.
+ *
+ * @param event The event to be fired
+ */
+ private void fireChangeListenerStateChanged( ChangeEvent event ) {
+ java.util.ArrayList list;
+ synchronized ( this ) {
+ if ( changeListenerList == null ) {
+ return;
+ }
+ list = ( java.util.ArrayList ) changeListenerList.clone();
+ }
+ for ( int i = 0; i < list.size(); i++ ) {
+ ( ( javax.swing.event.ChangeListener ) list.get( i ) ).stateChanged( event );
+ }
+ }
+
+ /**
+ * Event fired when a property changes.
+ *
+ * @param evt event fired
+ */
+ public void propertyChange( PropertyChangeEvent evt ) {
+ fireChangeListenerStateChanged( new ChangeEvent( this ) );
+ }
+
+ /**
+ * Getter for property renderer.
+ *
+ * @return Value of property renderer.
+ */
+ public DayRenderer getRenderer() {
+ return datepanel.getRenderer();
+ }
+
+ /**
+ * Setter for property renderer.
+ *
+ * @param renderer New value of property renderer.
+ */
+ public void setRenderer( DayRenderer renderer ) {
+ datepanel.setRenderer( renderer );
+ }
+
+ /**
+ * Getter for property model.
+ *
+ * @return Value of property model.
+ */
+ public DataModel getModel() {
+ return datepanel.getModel();
+ }
+
+ /**
+ * Setter for property model.
+ *
+ * @param model New value of property model.
+ */
+ public void setModel( DataModel model ) {
+ datepanel.setModel( model );
+ }
+
+ /**
+ * Getter for property headerRenderer.
+ *
+ * @return Value of property headerRenderer.
+ */
+ public HeaderRenderer getHeaderRenderer() {
+ return datepanel.getHeaderRenderer();
+ }
+
+ /**
+ * Setter for property headerRenderer.
+ *
+ * @param headerRenderer New value of property headerRenderer.
+ */
+ public void setHeaderRenderer( HeaderRenderer headerRenderer ) {
+ datepanel.setHeaderRenderer( headerRenderer );
+ }
+
+ /**
+ * Getter for property showOkCancel.
+ *
+ * @return Value of property showOkCancel.
+ */
+ public boolean getShowOkCancel() {
+ return this.showOkCancel;
+ }
+
+ /**
+ * Setter for property showOkCancel.
+ *
+ * @param showOkCancel New value of property showOkCancel.
+ */
+ public void setShowOkCancel( boolean showOkCancel ) {
+ if ( this.showOkCancel == showOkCancel ) {
+ return;
+ }
+ boolean old = this.showOkCancel;
+ this.showOkCancel = showOkCancel;
+ windowpanel = null;
+ firePropertyChange( "showOkCancel", old, showOkCancel );
+ }
+
+ /**
+ * Getter for property allowsInvalid.
+ *
+ * @return Value of property showOkCancel.
+ */
+ public boolean getAllowsInvalid() {
+ return formatter.getAllowsInvalid();
+ }
+
+ /**
+ * Setter for property allowsInvalid.
+ *
+ * @param showOkCancel New value of property showOkCancel.
+ */
+ public void setAllowsInvalid( boolean b ) {
+ boolean old = formatter.getAllowsInvalid();
+ formatter.setAllowsInvalid( b );
+ firePropertyChange( "allowsInvalid", old, b );
+ }
+
+ /**
+ * Getter for property firstDayOfWeek.
+ *
+ * @return Value of property firstDayOfWeek.
+ */
+ public int getFirstDayOfWeek() {
+ return this.firstDayOfWeek;
+ }
+
+ /**
+ * Setter for property firstDayOfWeek.
+ *
+ * @param firstDayOfWeek New value of property firstDayOfWeek.
+ */
+ public void setFirstDayOfWeek( int firstDayOfWeek ) {
+ int old = this.firstDayOfWeek;
+ if ( datepanel != null ) datepanel.setFirstDayOfWeek( firstDayOfWeek );
+ this.firstDayOfWeek = firstDayOfWeek;
+ firePropertyChange( "firstDayOfWeek", old, firstDayOfWeek );
+ }
+
+ /**
+ * Getter for property workingDays.
+ *
+ * @return Value of property workingDays.
+ */
+ public boolean[] getWorkingDays() {
+ return this.workingDays;
+ }
+
+ /**
+ * Setter for property workingDays.
+ *
+ * @param workingDays New value of property workingDays.
+ */
+ public void setWorkingDays( boolean[] workingDays ) {
+ boolean[] old = this.workingDays;
+ if ( datepanel != null ) datepanel.setWorkingDays( workingDays );
+ this.workingDays = workingDays;
+ firePropertyChange( "workingDays", old, workingDays );
+ }
+
+ /**
+ * Enables or disables the component
+ *
+ * @param enabled true for enabling
+ */
+ public void setEnabled( boolean enabled ) {
+ button.setEnabled( enabled );
+ field.setEnabled( enabled );
+ super.setEnabled( enabled );
+ }
+
+ /**
+ * Getter for enabled property
+ *
+ * @return true if it's enabled
+ */
+ public boolean isEnabled() {
+ return button.isEnabled();
+ }
+
+ /**
+ * Returns the JFormattedTextField for further customization
+ *
+ * @return the JFormattedTextField
+ */
+ public JFormattedTextField getFormattedTextField() {
+ return field;
+ }
+
+ class WindowPanel extends JDialog {
+ public WindowPanel( Frame parent, boolean showWeekNumbers ) {
+ super( parent, false );
+ init( showWeekNumbers );
+ }
+
+ public WindowPanel( Dialog parent, boolean showWeekNumbers ) {
+ super( parent, false );
+ init( showWeekNumbers );
+ }
+
+ private void init( boolean showWeekNumbers ) {
+ setUndecorated( true );
+ setFocusable( true );
+ JPanel todo = new JPanel( new BorderLayout() );
+ getContentPane().add( todo );
+ todo.add( datepanel );
+ todo.setBorder( BorderFactory.createLineBorder( Color.black ) );
+
+ if ( showOkCancel ) {
+ JPanel abajo = new JPanel();
+ todo.add( abajo, BorderLayout.SOUTH );
+ JButton ok = new JButton( "Ok" );
+ JButton cancel = new JButton( "Cancel" );
+ abajo.add( ok );
+ abajo.add( cancel );
+ getRootPane().setDefaultButton( ok );
+ ok.addActionListener( new ActionListener() {
+ public void actionPerformed( ActionEvent e ) {
+ aceptar();
+ }
+ } );
+ cancel.addActionListener( new ActionListener() {
+ public void actionPerformed( ActionEvent e ) {
+ cancelar();
+ }
+ } );
+ } else {
+ /*datepanel.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent e) {
+ aceptar();
+ }
+ });*/
+ datepanel.addActionListener( new ActionListener() {
+ public void actionPerformed( ActionEvent e ) {
+ aceptar();
+ }
+ } );
+ }
+
+ KeyListener klistener = new KeyAdapter() {
+ public void keyTyped( KeyEvent e ) {
+ if ( e.getKeyChar() == 10 ) {
+ aceptar();
+ }
+ if ( e.getKeyChar() == 27 ) {
+ cancelar();
+ }
+ }
+ };
+
+ datepanel.addKeyListener( klistener );
+ addKeyListener( klistener );
+
+
+ addWindowListener( new WindowAdapter() {
+ public void windowDeactivated( WindowEvent e ) {
+ cancelar();
+ }
+ } );
+
+
+ pack();
+ }
+
+ public Date getDate() {
+ return datepanel.getDate();
+ }
+
+ public void setDate( Date d ) {
+ datepanel.setDate( d );
+ }
+ }
+
+ /**
+ * @return Returns the antiAliased.
+ */
+ public boolean isAntiAliased() {
+ return antiAliased;
+ }
+
+ /**
+ * @param antiAliased The antiAliased to set.
+ */
+ public void setAntiAliased( boolean antiAliased ) {
+ boolean old = this.antiAliased;
+ this.antiAliased = antiAliased;
+ datepanel.setAntiAliased( antiAliased );
+ firePropertyChange( "antiAliased", old, antiAliased );
+ }
+
+ /**
+ * @return Returns the printMoon.
+ */
+ public boolean isPrintMoon() {
+ return printMoon;
+ }
+
+ /**
+ * @param printMoon The printMoon to set.
+ */
+ public void setPrintMoon( boolean printMoon ) {
+ datepanel.setPrintMoon( printMoon );
+ repaint();
+ this.printMoon = printMoon;
+ }
+
+ /**
+ * Sets the Today button visibility.
+ *
+ * @param show
+ */
+ public void setShowToday( boolean show ) {
+ datepanel.setShowToday( show );
+ repaint();
+ }
+
+ /**
+ * Returns the Today button visibility.
+ *
+ * @return
+ */
+ public boolean getShowToday() {
+ return datepanel.getShowToday();
+ }
+
+ /**
+ * Sets the today button text.
+ *
+ * @param caption
+ */
+ public void setTodayCaption( String caption ) {
+ datepanel.setTodayCaption( caption );
+ }
+
+ /**
+ * Returns the today button text.
+ *
+ * @return
+ */
+ public String getTodayCaption() {
+ return datepanel.getTodayCaption();
+ }
+
+ /**
+ * @return Returns the dateFormat.
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * @param dateFormat The dateFormat to set.
+ */
+ public void setDateFormat( DateFormat dateFormat ) {
+ this.dateFormat = dateFormat;
+ field.setFormatterFactory( formatterFactory );
+ }
+
+ /**
+ * @return Returns the baseDate.
+ */
+ public Date getBaseDate() {
+ return baseDate;
+ }
+
+ /**
+ * A base date may different from "today" and will be the date
+ * shown on the Date Window when it is launched. Basically, a user
+ * can have an empty textfield but when the window is open, it won't show
+ * today by default but whatever baseDate is. It is backward compatible, ie
+ * if you do not have a baseDate, the window will open with "today".
+ *
+ * @param baseDate The baseDate to set.
+ */
+ public void setBaseDate( Date baseDate ) {
+ this.baseDate = baseDate;
+ }
+}
+
diff --git a/spring-richclient-core/src/test/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinderTests.java b/spring-richclient-core/src/test/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinderTests.java
index d4f5956..de49248 100644
--- a/spring-richclient-core/src/test/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinderTests.java
+++ b/spring-richclient-core/src/test/java/org/springframework/richclient/form/binding/swing/date/NachoCalendarDateFieldBinderTests.java
@@ -37,11 +37,11 @@ public class NachoCalendarDateFieldBinderTests extends AbstractDateFieldBindingT
}
protected void setValue( JComponent dateField, String value ) {
- ( ( DateField ) dateField ).getFormattedTextField().setText( value );
+ ( ( NullableDateField ) dateField ).getFormattedTextField().setText( value );
}
protected void setValue(JComponent dateField, Date date) {
- ((DateField) dateField).setValue(date);
+ ((NullableDateField) dateField).setValue(date);
}
protected boolean isReadOnly(JComponent dateField) {
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:22
|
From: Johannes Schneider <js...@ce...>
---
.../richclient/form/builder/TableFormBuilder.java | 37 +++++++++++++++++--
1 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
index 98613d7..7a4238c 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
@@ -17,6 +17,7 @@ package org.springframework.richclient.form.builder;
import java.util.HashMap;
import java.util.Map;
+import java.awt.Font;
import javax.swing.JComboBox;
import javax.swing.JComponent;
@@ -29,6 +30,8 @@ import org.springframework.richclient.form.binding.BindingFactory;
import org.springframework.richclient.form.binding.swing.ComboBoxBinder;
import org.springframework.richclient.layout.TableLayoutBuilder;
import org.springframework.util.Assert;
+import com.jgoodies.forms.layout.RowSpec;
+import com.jgoodies.forms.layout.ConstantSize;
/**
* A TableFormBuilder builds a form by using a {@link TableLayoutBuilder}
@@ -37,14 +40,24 @@ import org.springframework.util.Assert;
* @author Mathias Broekelmann
*/
public class TableFormBuilder extends AbstractFormBuilder {
+ private static final RowSpec DESCRIPTION_ROW_SPEC = RowSpec.createGap( new ConstantSize( 2, ConstantSize.PX ) );
- private static final String VALIGN_TOP = TableLayoutBuilder.VALIGN + "=top";
+ private static final String VALIGN_TOP = TableLayoutBuilder.VALIGN + "=top";
- private TableLayoutBuilder builder;
+ private Font descriptionFont;
- private String labelAttributes = TableLayoutBuilder.DEFAULT_LABEL_ATTRIBUTES;
+ {
+ Font labelFont = new JLabel().getFont();
+ descriptionFont = labelFont.deriveFont( Font.ITALIC, labelFont.getSize() - 2 );
+ }
- /**
+ private TableLayoutBuilder builder;
+
+ private String labelAttributes = TableLayoutBuilder.DEFAULT_LABEL_ATTRIBUTES;
+
+ private String descriptionLabelAttributes = TableLayoutBuilder.DEFAULT_LABEL_ATTRIBUTES;
+
+ /**
* Creates an instances of the TableFormBuilder by using a {@link BindingFactory}
*
* @param bindingFactory
@@ -76,6 +89,10 @@ public class TableFormBuilder extends AbstractFormBuilder {
getLayoutBuilder().unrelatedGapRow();
}
+ public void descriptionRow() {
+ getLayoutBuilder().row( DESCRIPTION_ROW_SPEC );
+ }
+
/**
* Adds the field to the form. {@link #createDefaultBinding(String)} is used to create the binding for the field
*
@@ -113,6 +130,18 @@ public class TableFormBuilder extends AbstractFormBuilder {
return addBinding(createDefaultBinding(fieldName), attributes, getLabelAttributes());
}
+ public JComponent addDescription(String fieldName) {
+ return addDescription( fieldName, descriptionLabelAttributes );
+ }
+
+ public JComponent addDescription(String fieldName, String attributes) {
+ JLabel label = getComponentFactory().createLabel( new String[]{getFormModel().getId() + '.' + fieldName + ".description", fieldName + ".description"} );
+ label.setFont( descriptionFont );
+ label.setFont( label.getFont().deriveFont( Font.ITALIC ) );
+ builder.cell( label, attributes );
+ return label;
+ }
+
/**
* Adds the field binding to the form.
*
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:22
|
From: Johannes Schneider <js...@ce...>
---
.../richclient/components/FileChooser.java | 37 ++++++++++++++++
.../form/binding/swing/FileChooserBinder.java | 27 +++++++++++-
.../form/binding/swing/FileChooserBinding.java | 45 +++++++++++++++-----
3 files changed, 97 insertions(+), 12 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/components/FileChooser.java b/spring-richclient-core/src/main/java/org/springframework/richclient/components/FileChooser.java
index ce7f08e..81cc651 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/components/FileChooser.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/components/FileChooser.java
@@ -1,9 +1,14 @@
package org.springframework.richclient.components;
import javax.swing.*;
+import javax.swing.text.Document;
+import javax.swing.filechooser.FileFilter;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.io.File;
+import java.util.*;
+import java.util.List;
/**
* A component that shows a filesystem view and in which the user can either choose a file or a directory,
@@ -99,6 +104,10 @@ public class FileChooser extends JComponent
nameField.setText(text);
}
+ public Document getDocument() {
+ return nameField.getDocument();
+ }
+
/**
* Get the text of the file textfield
*/
@@ -148,6 +157,26 @@ public class FileChooser extends JComponent
return nameField.isEnabled() & openDialogButton.isEnabled();
}
+ private FileFilter fileFilter;
+
+ public FileFilter getFileFilter() {
+ return fileFilter;
+ }
+
+ public void setFileFilter(FileFilter fileFilter) {
+ this.fileFilter=fileFilter;
+ }
+
+ private File currentDir;
+
+ public File getCurrentDir() {
+ return currentDir;
+ }
+
+ public void setCurrentDir(File currentDir) {
+ this.currentDir=currentDir;
+ }
+
private class Handler extends MouseAdapter
{
@@ -157,6 +186,14 @@ public class FileChooser extends JComponent
if (isEnabled())
{
JFileChooser chooser = new JFileChooser();
+ if (fileFilter!=null) {
+ chooser.setFileFilter(fileFilter);
+ }
+
+ if (currentDir!=null) {
+ chooser.setCurrentDirectory(currentDir);
+ }
+
switch (mode)
{
case FILE:
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinder.java
index 4b44d6a..31de36a 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinder.java
@@ -7,7 +7,9 @@ import org.springframework.binding.form.FormModel;
import org.springframework.util.Assert;
import javax.swing.*;
+import javax.swing.filechooser.FileFilter;
import java.util.Map;
+import java.io.File;
public class FileChooserBinder implements Binder
{
@@ -21,10 +23,33 @@ public class FileChooserBinder implements Binder
{
}
+ private FileFilter fileFilter;
+
+ public FileFilter getFileFilter() {
+ return fileFilter;
+ }
+
+ public void setFileFilter(FileFilter fileFilter) {
+ this.fileFilter=fileFilter;
+ }
+
+ private File currentDir;
+
+ public File getCurrentDir() {
+ return currentDir;
+ }
+
+ public void setCurrentDir(File currentDir) {
+ this.currentDir=currentDir;
+ }
+
@SuppressWarnings("unchecked")
protected JComponent createControl(Map context)
{
- return new FileChooser();
+ FileChooser fileChooser=new FileChooser();
+ fileChooser.setCurrentDir(currentDir);
+ fileChooser.setFileFilter(fileFilter);
+ return fileChooser;
}
@SuppressWarnings("unchecked")
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinding.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinding.java
index 607bfc9..f6c4041 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinding.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FileChooserBinding.java
@@ -5,6 +5,8 @@ import org.springframework.richclient.form.binding.support.CustomBinding;
import org.springframework.richclient.components.FileChooser;
import javax.swing.*;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.DocumentEvent;
import java.awt.event.FocusListener;
import java.awt.event.FocusEvent;
@@ -49,6 +51,23 @@ public class FileChooserBinding extends CustomBinding
{
field.setText("");
}
+ field.getDocument().addDocumentListener(new DocumentListener() {
+ @Override
+ public void insertUpdate(DocumentEvent e) {
+ updateControlValue();
+ }
+
+ @Override
+ public void removeUpdate(DocumentEvent e) {
+ updateControlValue();
+ }
+
+ @Override
+ public void changedUpdate(DocumentEvent e) {
+ updateControlValue();
+ }
+ });
+
field.addFocusListener(new FocusListener()
{
@@ -58,22 +77,26 @@ public class FileChooserBinding extends CustomBinding
public void focusLost(FocusEvent e)
{
- if (field.isEditable())
- {
- if (useFile)
- {
- controlValueChanged(new java.io.File(field.getText()));
- }
- else
- {
- controlValueChanged(field.getText());
- }
- }
+ updateControlValue();
}
});
return field;
}
+ private void updateControlValue() {
+ if (field.isEditable())
+ {
+ if (useFile)
+ {
+ controlValueChanged(new java.io.File(field.getText()));
+ }
+ else
+ {
+ controlValueChanged(field.getText());
+ }
+ }
+ }
+
protected void readOnlyChanged()
{
field.setEditable(isEnabled() && !isReadOnly());
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:22
|
From: Johannes Schneider <js...@ce...>
---
.../form/binding/swing/EnumRadioButtonBinder.java | 88 +++++++++--
.../form/binding/swing/EnumRadioButtonBinding.java | 156 +++++++++-----------
2 files changed, 138 insertions(+), 106 deletions(-)
diff --git a/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinder.java b/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinder.java
index feb1e97..807ab02 100644
--- a/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinder.java
+++ b/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinder.java
@@ -1,27 +1,28 @@
package org.springframework.richclient.form.binding.swing;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
import org.springframework.binding.form.FormModel;
+import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.richclient.application.ApplicationServicesLocator;
import org.springframework.richclient.form.binding.Binding;
import org.springframework.richclient.form.binding.support.AbstractBinder;
+import org.springframework.richclient.selection.binding.support.LabelProvider;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
/**
* Radio button binder for enum values.
- *
+ * <p/>
* Use this in your Application Context to configure the binder:
- *
+ * <p/>
* <pre>
* <bean name="enumRadioButtonBinder" class="org.springframework.richclient.form.binding.swing.EnumRadioButtonBinder" />
* </pre>
- *
+ * <p/>
* Or when you need an additional null value that can be selected:
- *
+ * <p/>
* <pre>
* <bean name="enumRadioButtonBinder" class="org.springframework.richclient.form.binding.swing.EnumRadioButtonBinder" >
* <property name="nullable" value="true" />
@@ -32,7 +33,9 @@ import org.springframework.richclient.form.binding.support.AbstractBinder;
*/
public class EnumRadioButtonBinder extends AbstractBinder {
- private boolean nullable = false;
+ private boolean nullable=false;
+
+ private LabelProvider labelProvider;
/**
* Creates a new binder
@@ -50,16 +53,35 @@ public class EnumRadioButtonBinder extends AbstractBinder {
* Sets whether this control can contain a <code>null</code> value
*
* @param nullable <code>true</code> if the binder needs to contain a
- * <code>null</code> value
+ * <code>null</code> value
*/
public void setNullable(boolean nullable) {
- this.nullable = nullable;
+ this.nullable=nullable;
+ }
+
+ public LabelProvider getLabelProvider() {
+ return labelProvider;
+ }
+
+ /**
+ * May be used to set an own label provider
+ *
+ * @param labelProvider the label provider that will be used for the enum
+ */
+ public void setLabelProvider(LabelProvider labelProvider) {
+ this.labelProvider=labelProvider;
}
@Override
protected Binding doBind(JComponent control, FormModel formModel, String formPropertyPath, Map context) {
- EnumRadioButtonBinding binding = new EnumRadioButtonBinding((JPanel) control, formModel, formPropertyPath,
- getPropertyType(formModel, formPropertyPath), getSelectableEnumsList(formModel, formPropertyPath));
+ Class type=getPropertyType(formModel, formPropertyPath);
+
+ if (labelProvider==null) {
+ labelProvider=new DefaultLabelProvider(type);
+ }
+
+ EnumRadioButtonBinding binding=new EnumRadioButtonBinding((JPanel) control, formModel, formPropertyPath,
+ type, labelProvider, getSelectableEnumsList(formModel, formPropertyPath));
return binding;
}
@@ -68,7 +90,7 @@ public class EnumRadioButtonBinder extends AbstractBinder {
* Adds the <code>null</code> value if this binder is nullable.
*/
private List<Enum> getSelectableEnumsList(FormModel formModel, String formPropertyPath) {
- List<Enum> out = new ArrayList<Enum>();
+ List<Enum> out=new ArrayList<Enum>();
if (nullable) {
out.add(null);
}
@@ -78,4 +100,36 @@ public class EnumRadioButtonBinder extends AbstractBinder {
return out;
}
+ /**
+ * Default label provider for my type of enums
+ */
+ protected static class DefaultLabelProvider<T extends Enum<?>> implements LabelProvider {
+ private final MessageSourceAccessor messageSourceAccessor=(MessageSourceAccessor) ApplicationServicesLocator.services().getService(MessageSourceAccessor.class);
+
+ private final Class<T> propertyType;
+
+ private DefaultLabelProvider(Class<T> propertyType) {
+ this.propertyType=propertyType;
+ }
+
+ @Override
+ public String getLabel(Object item) {
+ T enumValue=(T) item;
+
+ String text;
+ if (enumValue==null) {
+ text=messageSourceAccessor.getMessage(propertyType.getName()+".null", "null");
+ if (text==null) {
+ text=propertyType.getName()+".null"; //fallback
+ }
+ } else {
+ text=messageSourceAccessor.getMessage(propertyType.getName()+"."+enumValue.name(), enumValue.name());
+ if (text==null) {
+ text=propertyType.getName()+"."+enumValue.name();
+ }
+ }
+ return text;
+ }
+ }
+
}
\ No newline at end of file
diff --git a/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinding.java b/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinding.java
index 8d77480..dbce47b 100644
--- a/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinding.java
+++ b/spring-richclient-jdk6/src/main/java/org/springframework/richclient/form/binding/swing/EnumRadioButtonBinding.java
@@ -1,5 +1,18 @@
package org.springframework.richclient.form.binding.swing;
+import com.jgoodies.forms.factories.FormFactory;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.ColumnSpec;
+import com.jgoodies.forms.layout.FormLayout;
+import com.jgoodies.forms.layout.RowSpec;
+import org.springframework.binding.form.FormModel;
+import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.richclient.application.ApplicationServicesLocator;
+import org.springframework.richclient.form.binding.support.CustomBinding;
+import org.springframework.richclient.selection.binding.support.LabelProvider;
+import org.springframework.util.Assert;
+
+import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@@ -7,79 +20,56 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javax.swing.ButtonGroup;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-
-import org.springframework.binding.form.FormModel;
-import org.springframework.context.support.MessageSourceAccessor;
-import org.springframework.richclient.form.binding.support.CustomBinding;
-import org.springframework.util.Assert;
-
-import com.jgoodies.forms.factories.FormFactory;
-import com.jgoodies.forms.layout.CellConstraints;
-import com.jgoodies.forms.layout.ColumnSpec;
-import com.jgoodies.forms.layout.FormLayout;
-import com.jgoodies.forms.layout.RowSpec;
-
/**
* Radiobutton binding for Enum values.
- *
+ * <p/>
* Labels for the radio buttons can be configured in the messages:
- *
+ * <p/>
* <pre>
* my.package.MyClass.MY_ENUM = My Enum Label
* my.package.MyClass.null = None
* </pre>
*
* @author Lieven Doclo
- *
*/
-public class EnumRadioButtonBinding extends CustomBinding {
+public class EnumRadioButtonBinding<T extends Enum<?>> extends CustomBinding {
private JPanel contentPanel;
- private List<Enum> selectableEnumsList;
-
- private Map<String, ContainerJRadioButton<Enum>> radioButtons;
+ private final List<T> selectableEnumsList;
- private Class propertyType;
+ /**
+ * Contains the radio buttons.
+ */
+ private final Map<T, JRadioButton> radioButtons=new LinkedHashMap<T, JRadioButton>();
private ButtonGroup group;
- private MessageSourceAccessor messageSourceAccessor;
+ private final LabelProvider labelProvider;
- public EnumRadioButtonBinding(JPanel contentPanel, FormModel formModel, String formPropertyPath,
- Class<?> propertyType, List<Enum> selectableEnumsList) {
+ public EnumRadioButtonBinding(JPanel contentPanel, FormModel formModel, String formPropertyPath, Class<T> propertyType, LabelProvider labelProvider, List<T> selectableEnumsList) {
super(formModel, formPropertyPath, propertyType);
- this.contentPanel = contentPanel;
- this.propertyType = propertyType;
- radioButtons = new LinkedHashMap<String, ContainerJRadioButton<Enum>>();
- messageSourceAccessor = getMessages();
- this.selectableEnumsList = selectableEnumsList;
+ this.contentPanel=contentPanel;
+ this.labelProvider=labelProvider;
+ this.selectableEnumsList=selectableEnumsList;
createRadioButtons();
}
@Override
protected void valueModelChanged(Object newValue) {
deselectAll();
- Enum enumValue = (Enum) newValue;
- ContainerJRadioButton<Enum> button;
- if (enumValue == null) {
- button = radioButtons.get(null);
- }
- else {
- button = radioButtons.get(enumValue.name());
- }
- if (button != null) {
+ T enumValue=(T) newValue;
+
+ JRadioButton button=radioButtons.get(enumValue);
+ if (button!=null) {
button.setSelected(true);
}
}
private void deselectAll() {
- if (group != null)
+ if (group!=null) {
group.clearSelection();
+ }
}
@Override
@@ -89,87 +79,75 @@ public class EnumRadioButtonBinding extends CustomBinding {
}
private JPanel createBindingControl() {
- group = new ButtonGroup();
- FormLayout layout = new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC },
- getDefaultRowsWithGap(radioButtons.keySet().size()));
- int count = 1;
+ group=new ButtonGroup();
+ FormLayout layout=new FormLayout(new ColumnSpec[] {FormFactory.DEFAULT_COLSPEC}, getDefaultRowsWithGap(radioButtons.keySet().size()));
+ int count=1;
contentPanel.setLayout(layout);
- for (ContainerJRadioButton<Enum> button : radioButtons.values()) {
+ for (JRadioButton button : radioButtons.values()) {
group.add(button);
contentPanel.add(button, new CellConstraints(1, count));
- count += 2;
+ count+=2;
}
valueModelChanged(getValue());
return contentPanel;
}
private static RowSpec[] getDefaultRowsWithGap(int rowCount) {
- List<RowSpec> rows = new ArrayList<RowSpec>();
- for (int i = 0; i < rowCount; i++) {
+ List<RowSpec> rows=new ArrayList<RowSpec>();
+ for (int i=0; i<rowCount; i++) {
rows.add(new RowSpec("fill:pref:nogrow"));
rows.add(FormFactory.LINE_GAP_ROWSPEC);
}
- rows.remove(rows.size() - 1);
- return rows.toArray(new RowSpec[] {});
+ rows.remove(rows.size()-1);
+ return rows.toArray(new RowSpec[rows.size()]);
}
@Override
protected void enabledChanged() {
- for (ContainerJRadioButton<Enum> button : radioButtons.values()) {
+ for (JRadioButton button : radioButtons.values()) {
button.setEnabled(isEnabled());
}
-
}
@Override
protected void readOnlyChanged() {
- for (ContainerJRadioButton<Enum> button : radioButtons.values()) {
+ for (JRadioButton button : radioButtons.values()) {
button.setEnabled(isReadOnly());
}
}
private void createRadioButtons() {
- for (Enum enumValue : selectableEnumsList) {
- ContainerJRadioButton<Enum> button = new ContainerJRadioButton<Enum>();
- String text;
- if (enumValue == null) {
- text = messageSourceAccessor.getMessage(propertyType.getName() + ".null", "null");
- button.setText(text == null ? propertyType.getName() + ".null" : text);
- }
- else {
- text = messageSourceAccessor.getMessage(propertyType.getName() + "." + enumValue.name(), enumValue
- .name());
- button.setText(text == null ? propertyType.getName() + "." + enumValue.name() : text);
- }
- button.setContainedObject(enumValue);
- button.addActionListener(new ActionListener() {
+ for (final T enumValue : selectableEnumsList) {
+ JRadioButton button=new JRadioButton();
+ String text=getText(enumValue);
+ button.setText(text);
+ button.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
- ContainerJRadioButton<Enum> button = (ContainerJRadioButton<Enum>) e.getSource();
- controlValueChanged(button.getContainedObject());
+ controlValueChanged(enumValue);
}
-
});
- if (enumValue == null)
- radioButtons.put(null, button);
- else
- radioButtons.put(enumValue.name(), button);
-
+ radioButtons.put(enumValue, button);
}
}
- private class ContainerJRadioButton<T> extends JRadioButton {
-
- private T containedObject;
-
- public T getContainedObject() {
- return containedObject;
- }
-
- public void setContainedObject(T containedObject) {
- this.containedObject = containedObject;
- }
-
+ /**
+ * Returns the text for the given enum value
+ *
+ * @param enumValue the enum value
+ * @return the text for the enum value
+ */
+ private String getText(T enumValue) {
+ return labelProvider.getLabel(enumValue);
}
+ /**
+ * Returns the label provider
+ *
+ * @return
+ */
+ public LabelProvider getLabelProvider() {
+ return labelProvider;
+ }
}
\ No newline at end of file
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:21
|
From: Johannes Schneider <js...@ce...>
---
.../richclient/form/builder/TableFormBuilder.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
index 7a4238c..b1e20f5 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
@@ -127,7 +127,11 @@ public class TableFormBuilder extends AbstractFormBuilder {
* @return an array containing the label and the component which where added to the form
*/
public JComponent[] add(String fieldName, String attributes) {
- return addBinding(createDefaultBinding(fieldName), attributes, getLabelAttributes());
+ return add( fieldName, attributes, getLabelAttributes() );
+ }
+
+ public JComponent[] add(String fieldName, String attributes, String customLabelAttributes) {
+ return addBinding(createDefaultBinding(fieldName), attributes, customLabelAttributes);
}
public JComponent addDescription(String fieldName) {
@@ -181,7 +185,11 @@ public class TableFormBuilder extends AbstractFormBuilder {
* @return an array containing the label and the component which where added to the form
*/
public JComponent[] add(String fieldName, JComponent component, String attributes) {
- return addBinding(createBinding(fieldName, component), attributes, getLabelAttributes());
+ return add( fieldName, component, attributes, getLabelAttributes() );
+ }
+
+ public JComponent[] add(String fieldName, JComponent component, String attributes, String customLabelAttributes) {
+ return addBinding(createBinding(fieldName, component), attributes, customLabelAttributes);
}
/**
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:20
|
From: Johannes Schneider <js...@ce...>
---
.../richclient/form/builder/TableFormBuilder.java | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
index fd79d70..98613d7 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/TableFormBuilder.java
@@ -72,6 +72,10 @@ public class TableFormBuilder extends AbstractFormBuilder {
getLayoutBuilder().relatedGapRow();
}
+ public void unrelatedRow() {
+ getLayoutBuilder().unrelatedGapRow();
+ }
+
/**
* Adds the field to the form. {@link #createDefaultBinding(String)} is used to create the binding for the field
*
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:19
|
From: Johannes Schneider <js...@ce...>
---
.../form/builder/AbstractFormBuilder.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/AbstractFormBuilder.java b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/AbstractFormBuilder.java
index c3b1991..1a4639f 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/AbstractFormBuilder.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/AbstractFormBuilder.java
@@ -209,7 +209,7 @@ public abstract class AbstractFormBuilder {
* label.
* @return a {@link JLabel} for the property.
*/
- protected JLabel createLabelFor(String fieldName, JComponent component) {
+ public JLabel createLabelFor(String fieldName, JComponent component) {
JLabel label = getComponentFactory().createLabel("");
getFormModel().getFieldFace(fieldName).configure(label);
label.setLabelFor(component);
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:19
|
From: Johannes Schneider <js...@ce...>
---
spring-richclient-integrations/pom.xml | 2 +-
.../spring-richclient-jide/pom.xml | 7 +++++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/spring-richclient-integrations/pom.xml b/spring-richclient-integrations/pom.xml
index 4d6ec47..5fcdc82 100644
--- a/spring-richclient-integrations/pom.xml
+++ b/spring-richclient-integrations/pom.xml
@@ -20,7 +20,7 @@
<module>spring-richclient-flexdock</module>
<module>spring-richclient-swingdocking</module>
<!-- JIDE integration isn't built automatically due to licensing -->
- <!--<module>spring-richclient-jide</module>-->
+ <module>spring-richclient-jide</module>
</modules>
<dependencies>
diff --git a/spring-richclient-integrations/spring-richclient-jide/pom.xml b/spring-richclient-integrations/spring-richclient-jide/pom.xml
index 6f3a080..1beccf3 100644
--- a/spring-richclient-integrations/spring-richclient-jide/pom.xml
+++ b/spring-richclient-integrations/spring-richclient-jide/pom.xml
@@ -31,6 +31,13 @@
<jide.version>[2.2.0, 3.0.0)</jide.version>
</properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.jidesoft</groupId>
+ <artifactId>jide-common</artifactId>
+ </dependency>
+ </dependencies>
+
<dependencyManagement>
<dependencies>
<dependency>
--
1.6.2
|
|
From: <mai...@ce...> - 2009-03-14 20:53:17
|
From: Johannes Schneider <js...@ce...>
(createLabelFor and accesor for backing form)
---
.../richclient/wizard/FormBackedWizardPage.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/spring-richclient-core/src/main/java/org/springframework/richclient/wizard/FormBackedWizardPage.java b/spring-richclient-core/src/main/java/org/springframework/richclient/wizard/FormBackedWizardPage.java
index 627ea1e..4e77fb9 100644
--- a/spring-richclient-core/src/main/java/org/springframework/richclient/wizard/FormBackedWizardPage.java
+++ b/spring-richclient-core/src/main/java/org/springframework/richclient/wizard/FormBackedWizardPage.java
@@ -59,7 +59,7 @@ public class FormBackedWizardPage extends AbstractWizardPage {
this.backingForm = backingForm;
}
- protected Form getBackingForm() {
+ public Form getBackingForm() {
return backingForm;
}
--
1.6.2
|
|
From: Peter K. <pe...@ya...> - 2009-02-27 11:37:45
|
Hi ! > See http://en.wikipedia.org/wiki/Pivot_table Okay, that clarifies it. I am not sure if the following projects fit into this, but nevertheless I will list them ;-) http://sourceforge.net/projects/matrex http://sourceforge.net/projects/myjtable (not that good) And I am sure the following data processing/analysis projects could have such a component: http://jmagallanes.sourceforge.net/en/ (a Swing pivot table for OLAP analysis, and charts (based on JFreeChart)) http://rapid-i.com/content/view/10/32/lang,en/ (GPL) http://www.unidata.ucar.edu/software/idv/ http://jas.freehep.org/jas3/ http://biojava.org/wiki/Main_Page http://projects.hepforge.org/jhepwork/ Regards, Peter. |
|
From: Rogan D. <li...@da...> - 2009-02-27 10:23:54
|
Peter Karich wrote: > Hi Geoffrey! > >> There's Jide pivot, but that's not open source. >> There's oswing, but it's not that user friendly imho. > > What is your definition of a pivot table? Which features do you need? > Is a pivot table a tree table where you can collapse and expand rows? > > Regards, > Peter. In my understanding, a Pivot Table is an interactive table that allows the user to "extract" columns to be used to summarise the remaining items in the table, using a predefined or userdefined summary function. See http://en.wikipedia.org/wiki/Pivot_table I'd also be interested in seeing support for an implementation, FWIW. Rogan |
|
From: Peter K. <pe...@ya...> - 2009-02-27 09:11:20
|
ups, I forgot to include some links, what I mean: http://www.java2s.com/Code/Java/Swing-Components/TreeTable.htm http://java.sun.com/products/jfc/tsc/articles/treetable1/ |
|
From: Peter K. <pe...@ya...> - 2009-02-27 09:09:25
|
Hi Geoffrey! > There's Jide pivot, but that's not open source. > There's oswing, but it's not that user friendly imho. What is your definition of a pivot table? Which features do you need? Is a pivot table a tree table where you can collapse and expand rows? Regards, Peter. |
|
From: Geoffrey De S. <ge0...@gm...> - 2009-02-27 08:37:36
|
Hi, Does anyone know of an open source pivot table that would integrate well with spring-richclient? There's Jide pivot, but that's not open source. There's oswing, but it's not that user friendly imho. If I can get it to work, I'll commit the integration back into spring-richclient for course :) -- With kind regards, Geoffrey De Smet |
|
From: jokeway <jo...@ho...> - 2009-01-22 02:20:55
|
Hi How can I show the validate message by the control's 'tab' order? Thanks --------------------- jokeway |
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-21 11:09:20
|
[ http://jira.springframework.org/browse/RCP-553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-553.
------------------------------
Resolution: Fixed
shortcuts for k, m and b applied with scaling
> Adding shortcuts to BigDecimalTextField
> ---------------------------------------
>
> Key: RCP-553
> URL: http://jira.springframework.org/browse/RCP-553
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Benoit Xhenseval
> Assignee: Lieven Doclo
> Priority: Minor
> Fix For: 1.1.0
>
> Attachments: BigDecimalTextField.java.patch
>
>
> We would like to be able to add shortcuts, like "3m" meaning 3 millions, 2k = 2,000. Typically a shortcut for hundred, thousand, millions, billions (for SocGen J ).
> Unfortunately, BigDecimalTextField is explicitly instantiated in several places, making it impossible to extend.
> We have a patch that works fine for us and it should work internationally as the shortcut may vary from one language to the other.
> One needs to add the shortcut characters in a messages.properties file:
> BigDecimalTextField.shortcut.hundred=h
> BigDecimalTextField.shortcut.thousand=k
> BigDecimalTextField.shortcut.million=m
> BigDecimalTextField.shortcut.billion=b
> ...
> So if you type 3k in the field, it will immediately be replaced by 3000.
> If you do not have those entries in the messages.properties, it won't use shortcuts so it is transparent if you do not want it.
> I hope that the patch will be accepted so that we can use SpringRC straight out of the box...
> Many thanks
> Benoit
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-21 10:26:20
|
[ http://jira.springframework.org/browse/RCP-553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-553:
-----------------------------
Fix Version/s: (was: 1.x)
1.1.0
> Adding shortcuts to BigDecimalTextField
> ---------------------------------------
>
> Key: RCP-553
> URL: http://jira.springframework.org/browse/RCP-553
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Benoit Xhenseval
> Priority: Minor
> Fix For: 1.1.0
>
> Attachments: BigDecimalTextField.java.patch
>
>
> We would like to be able to add shortcuts, like "3m" meaning 3 millions, 2k = 2,000. Typically a shortcut for hundred, thousand, millions, billions (for SocGen J ).
> Unfortunately, BigDecimalTextField is explicitly instantiated in several places, making it impossible to extend.
> We have a patch that works fine for us and it should work internationally as the shortcut may vary from one language to the other.
> One needs to add the shortcut characters in a messages.properties file:
> BigDecimalTextField.shortcut.hundred=h
> BigDecimalTextField.shortcut.thousand=k
> BigDecimalTextField.shortcut.million=m
> BigDecimalTextField.shortcut.billion=b
> ...
> So if you type 3k in the field, it will immediately be replaced by 3000.
> If you do not have those entries in the messages.properties, it won't use shortcuts so it is transparent if you do not want it.
> I hope that the patch will be accepted so that we can use SpringRC straight out of the box...
> Many thanks
> Benoit
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-21 10:22:20
|
[ http://jira.springframework.org/browse/RCP-595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-595.
------------------------------
Resolution: Fixed
Fix Version/s: 1.1.0
> Jide-Integration: Deps/Versions
> -------------------------------
>
> Key: RCP-595
> URL: http://jira.springframework.org/browse/RCP-595
> Project: Spring Rich Client Project
> Issue Type: Bug
> Affects Versions: 1.1.0
> Reporter: Johannes Schneider
> Assignee: Lieven Doclo
> Fix For: 1.1.0
>
>
> I had to update the jide/pom.xml:
> <properties>
> - <jide.version>2.4.5</jide.version>
> + <jide.version>[2.2.0, 3.0.0)</jide.version>
> </properties>
>
> + <dependencies>
> + <dependency>
> + <groupId>com.jidesoft</groupId>
> + <artifactId>jide-common</artifactId>
> + </dependency>
> + </dependencies>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-21 10:11:33
|
[ http://jira.springframework.org/browse/RCP-550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-550.
------------------------------
Resolution: Fixed
patch applied
> Quick Patch for extensibility of MDI frames
> -------------------------------------------
>
> Key: RCP-550
> URL: http://jira.springframework.org/browse/RCP-550
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Affects Versions: 1.0.0
> Environment: JDK 1.5
> Reporter: Benoit Xhenseval
> Assignee: Lieven Doclo
> Priority: Minor
> Fix For: 1.1.0
>
> Attachments: DesktopApplicationPage.java.patch
>
>
> Hi
> I would like to suggest the very basic enclosed patch to improve the extensibility of DesktopApplicationPage in an MDI application.
> At the moment it is complex to extend it for say adding a panel to show a resizer.
> This patch simply wraps a existing call into a protected method that could be called from a child class which creates its own createInternalFrame method.
> It is very simple and does not change any functionality so I hope it can be committed...
> Thanks for considering it
> Benoit
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lundberg L. <tav...@cl...> - 2009-01-16 10:52:13
|
Don't restrain your desires, increasse your love stick! http://cid-c307a16973748d46.spaces.live.com/blog/cns!C307A16973748D46!110.entry/ Of trees bow down their heads in respect to that knowing all the waste about him abounds in rocks for that vague destination, and in process of answered. I came back to the corridor i heard for a time clandestinely. At length, waxing confident. |
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-16 08:44:28
|
[ http://jira.springframework.org/browse/RCP-557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-557.
------------------------------
Resolution: Fixed
> Enhancement for NachoCalendarDateFieldBinder
> --------------------------------------------
>
> Key: RCP-557
> URL: http://jira.springframework.org/browse/RCP-557
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Andreas Kuhtz
> Priority: Minor
> Fix For: 1.1.0
>
> Attachments: NachoCalendarDateFieldBinder.patch, showcase-nacho-calendar-sample-patch.diff
>
>
> The NachoCalendar has more properties that should be configurable from the binder. The attached patch exposes more property keys.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-16 08:18:21
|
[ http://jira.springframework.org/browse/RCP-129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-129.
------------------------------
Assignee: Lieven Doclo
Resolution: Fixed
> Modifier util methods in ActionCommand
> --------------------------------------
>
> Key: RCP-129
> URL: http://jira.springframework.org/browse/RCP-129
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Reporter: Peter De Bruycker
> Assignee: Lieven Doclo
> Priority: Trivial
> Fix For: 1.1.0
>
>
> These methods should be added for easier modifier key detection
> {code}
> /**
> * Returns <code>true</code> if the shift key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the shift key was down, <code>false</code>
> * otherwise
> */
> protected boolean isShiftDown() {
> return (getModifiers() & ActionEvent.SHIFT_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the control key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the control key was down, <code>false</code>
> * otherwise
> */
> protected boolean isControlDown() {
> return (getModifiers() & ActionEvent.CTRL_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the meta key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the meta key was down, <code>false</code>
> * otherwise
> */
> protected boolean isMetaDown() {
> return (getModifiers() & ActionEvent.META_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the alt key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the alt key was down, <code>false</code>
> * otherwise
> */
> protected boolean isAltDown() {
> return (getModifiers() & ActionEvent.ALT_MASK) != 0;
> }
> {code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-16 08:14:22
|
[ http://jira.springframework.org/browse/RCP-129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-129:
-----------------------------
Description:
These methods should be added for easier modifier key detection
{code}
/**
* Returns <code>true</code> if the shift key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the shift key was down, <code>false</code>
* otherwise
*/
protected boolean isShiftDown() {
return (getModifiers() & ActionEvent.SHIFT_MASK) != 0;
}
/**
* Returns <code>true</code> if the control key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the control key was down, <code>false</code>
* otherwise
*/
protected boolean isControlDown() {
return (getModifiers() & ActionEvent.CTRL_MASK) != 0;
}
/**
* Returns <code>true</code> if the meta key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the meta key was down, <code>false</code>
* otherwise
*/
protected boolean isMetaDown() {
return (getModifiers() & ActionEvent.META_MASK) != 0;
}
/**
* Returns <code>true</code> if the alt key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the alt key was down, <code>false</code>
* otherwise
*/
protected boolean isAltDown() {
return (getModifiers() & ActionEvent.ALT_MASK) != 0;
}
{code}
was:
These methods should be added for easier modifier key detection
/**
* Returns <code>true</code> if the shift key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the shift key was down, <code>false</code>
* otherwise
*/
protected boolean isShiftDown() {
return (getModifiers() & ActionEvent.SHIFT_MASK) != 0;
}
/**
* Returns <code>true</code> if the control key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the control key was down, <code>false</code>
* otherwise
*/
protected boolean isControlDown() {
return (getModifiers() & ActionEvent.CTRL_MASK) != 0;
}
/**
* Returns <code>true</code> if the meta key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the meta key was down, <code>false</code>
* otherwise
*/
protected boolean isMetaDown() {
return (getModifiers() & ActionEvent.META_MASK) != 0;
}
/**
* Returns <code>true</code> if the alt key was down when invoking this
* <code>ActionCommand</code>.
* @return <code>true</code> if the alt key was down, <code>false</code>
* otherwise
*/
protected boolean isAltDown() {
return (getModifiers() & ActionEvent.ALT_MASK) != 0;
}
> Modifier util methods in ActionCommand
> --------------------------------------
>
> Key: RCP-129
> URL: http://jira.springframework.org/browse/RCP-129
> Project: Spring Rich Client Project
> Issue Type: Improvement
> Reporter: Peter De Bruycker
> Priority: Trivial
> Fix For: 1.1.0
>
>
> These methods should be added for easier modifier key detection
> {code}
> /**
> * Returns <code>true</code> if the shift key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the shift key was down, <code>false</code>
> * otherwise
> */
> protected boolean isShiftDown() {
> return (getModifiers() & ActionEvent.SHIFT_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the control key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the control key was down, <code>false</code>
> * otherwise
> */
> protected boolean isControlDown() {
> return (getModifiers() & ActionEvent.CTRL_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the meta key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the meta key was down, <code>false</code>
> * otherwise
> */
> protected boolean isMetaDown() {
> return (getModifiers() & ActionEvent.META_MASK) != 0;
> }
>
> /**
> * Returns <code>true</code> if the alt key was down when invoking this
> * <code>ActionCommand</code>.
> * @return <code>true</code> if the alt key was down, <code>false</code>
> * otherwise
> */
> protected boolean isAltDown() {
> return (getModifiers() & ActionEvent.ALT_MASK) != 0;
> }
> {code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-01-16 08:11:24
|
[ http://jira.springframework.org/browse/RCP-597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-597.
------------------------------
Resolution: Fixed
Fix Version/s: 1.1.0
done... all poms have been checked and standardized (name)
> wrong parent version in projects 'spring-richclient-full' en 'spring-richclient-release'
> ----------------------------------------------------------------------------------------
>
> Key: RCP-597
> URL: http://jira.springframework.org/browse/RCP-597
> Project: Spring Rich Client Project
> Issue Type: Bug
> Affects Versions: 1.0.1
> Reporter: Wim Lambrecht
> Assignee: Lieven Doclo
> Fix For: 1.1.0
>
>
> pom.xml's contain
> {quote}
> 6 <parent>
> 7 <groupId>org.springframework.richclient</groupId>
> 8 <artifactId>spring-richclient</artifactId>
> 9 *<version>1.0.1</version>*
> 10 </parent>
> {quote}
> and should be the current version *1.1.0-SNAPSHOT* (our 1.1.0 for the release eventually).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fratrick D. <je...@de...> - 2009-01-15 23:36:41
|
How to Give Her Absolutee Pleasure? http://cid-8d52af23d6e967fb.spaces.live.com/blog/cns!8D52AF23D6E967FB!104.entry/ Which of the marvels will it be best for us now go on, katberine go and dally with your detective. The interview. There was a great deal of undeveloped her intently. Then giles said, norfolk ? Were echoes, and they were not wholly of earth, but. |