[Ejtools-cvs] libraries/adwt/src/main/org/ejtools/adwt/editor ArrayEditor.java,1.5,1.6 ClassEditor.j
Brought to you by:
letiemble
|
From: <let...@us...> - 2003-09-15 22:37:20
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv24196/adwt/src/main/org/ejtools/adwt/editor
Modified Files:
ArrayEditor.java ClassEditor.java CollectionEditor.java
DateTimeEditor.java GenericEditor.java IteratorEditor.java
ListEditor.java NumberEditor.java ObjectNameEditor.java
PropertiesEditor.java URLEditor.java
Log Message:
Adjust Eclipse build files
Adjust some Javadoc
Review the models for TreeView and ListView : much more lightweight
Convert resources files to UTF-8 to avoid loosing accents
Index: ArrayEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ArrayEditor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ArrayEditor.java 21 Feb 2003 22:47:56 -0000 1.5
--- ArrayEditor.java 15 Sep 2003 22:37:13 -0000 1.6
***************
*** 16,26 ****
import javax.swing.JPanel;
- import com.dreambean.awt.GenericPropertyCustomizer;
-
import org.ejtools.beans.CustomPropertyEditorManager;
/**
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 21 novembre 2002
* @version $Revision$
*/
--- 16,25 ----
import javax.swing.JPanel;
import org.ejtools.beans.CustomPropertyEditorManager;
+ import com.dreambean.awt.GenericPropertyCustomizer;
+
/**
! * @author Laurent Etiemble
* @version $Revision$
*/
Index: ClassEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ClassEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ClassEditor.java 10 Jan 2003 19:35:15 -0000 1.3
--- ClassEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 12,17 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 6 avril 2002
* @version $Revision$
* @todo Javadoc to complete
--- 12,16 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
Index: CollectionEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/CollectionEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CollectionEditor.java 10 Jan 2003 19:35:14 -0000 1.3
--- CollectionEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 15,20 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 19 octobre 2001
* @version $Revision$
* @todo Javadoc to complete
--- 15,19 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
Index: DateTimeEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/DateTimeEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DateTimeEditor.java 10 Jan 2003 19:35:15 -0000 1.3
--- DateTimeEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 15,20 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 2 janvier 2002
* @version $Revision$
* @todo Javadoc to complete
--- 15,19 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
***************
*** 68,72 ****
return;
}
- String s1 = null;
for (int i = 0; i < fmts.length; i++)
{
--- 67,70 ----
Index: GenericEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/GenericEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GenericEditor.java 10 Jan 2003 19:35:14 -0000 1.3
--- GenericEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 12,17 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 19 octobre 2001
* @version $Revision$
* @todo Javadoc to complete
--- 12,16 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
Index: IteratorEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/IteratorEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IteratorEditor.java 10 Jan 2003 19:35:14 -0000 1.3
--- IteratorEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 14,19 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 19 octobre 2001
* @version $Revision$
* @todo Javadoc to complete
--- 14,18 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
Index: ListEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ListEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ListEditor.java 10 Jan 2003 19:35:15 -0000 1.3
--- ListEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 11,16 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 19 octobre 2001
* @version $Revision$
* @todo Javadoc to complete
--- 11,15 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
Index: NumberEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/NumberEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NumberEditor.java 10 Jan 2003 19:35:14 -0000 1.3
--- NumberEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 11,16 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 6 avril 2002
* @version $Revision$
* @todo Javadoc to complete
--- 11,15 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
***************
*** 19,23 ****
{
/** Description of the Field */
! protected Class clazz = Integer.class;
--- 18,22 ----
{
/** Description of the Field */
! protected Class clazz = Number.class;
Index: ObjectNameEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ObjectNameEditor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ObjectNameEditor.java 21 Feb 2003 22:47:59 -0000 1.5
--- ObjectNameEditor.java 15 Sep 2003 22:37:13 -0000 1.6
***************
*** 8,15 ****
--- 8,18 ----
import java.awt.Component;
+ import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+ import java.awt.event.FocusAdapter;
+ import java.awt.event.FocusEvent;
import java.util.ResourceBundle;
***************
*** 20,30 ****
import javax.swing.SwingUtilities;
! import org.ejtools.adwt.util.ObjectFinder;
/**
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 6 avril 2002
* @version $Revision$
* @todo Javadoc to complete
--- 23,32 ----
import javax.swing.SwingUtilities;
! import org.ejtools.adwt.util.ObjectSearcher;
/**
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
***************
*** 35,39 ****
protected JButton button;
/** Description of the Field */
! protected JPanel panel;
/** Description of the Field */
protected JTextField text;
--- 37,41 ----
protected JButton button;
/** Description of the Field */
! protected Container panel;
/** Description of the Field */
protected JTextField text;
***************
*** 46,49 ****
--- 48,62 ----
{
this.text = new JTextField(30);
+
+ // Update value when edited
+ this.text.addFocusListener(
+ new FocusAdapter()
+ {
+ public void focusLost(FocusEvent e)
+ {
+ setAsText(text.getText());
+ }
+ }
+ );
}
***************
*** 71,108 ****
public Component getCustomEditor()
{
! if (this.panel == null)
{
! GridBagConstraints gridbagconstraints = new GridBagConstraints();
! this.panel = new JPanel();
! this.panel.setLayout(new GridBagLayout());
! this.button = new JButton(resources.getString("ObjectNameEditor.button.view"));
! gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE;
! this.panel.add(button, gridbagconstraints);
! gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER;
! gridbagconstraints.weightx = 1.0;
! gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
! this.panel.add(text, gridbagconstraints);
! this.button.addActionListener(
! new ActionListener()
! {
! /**
! * @param e Event action
! */
! public void actionPerformed(ActionEvent e)
{
! ObjectFinder finder = (ObjectFinder) SwingUtilities.getAncestorOfClass(ObjectFinder.class, ObjectNameEditor.this.panel);
! if ((finder != null) && (ObjectNameEditor.this.value != null))
{
! finder.find(ObjectNameEditor.this.getAsText());
}
}
- }
);
}
- return this.panel;
}
--- 84,128 ----
public Component getCustomEditor()
{
! if (Boolean.getBoolean("ejtools.objectname.hyperlink"))
{
! if (this.panel == null)
! {
! GridBagConstraints gridbagconstraints = new GridBagConstraints();
! this.panel = new JPanel();
! this.panel.setLayout(new GridBagLayout());
! this.button = new JButton(resources.getString("ObjectNameEditor.button.view"));
! gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE;
! this.panel.add(button, gridbagconstraints);
! gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER;
! gridbagconstraints.weightx = 1.0;
! gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
! this.panel.add(text, gridbagconstraints);
! this.button.addActionListener(
! new ActionListener()
{
! /**
! * @param e Event action
! */
! public void actionPerformed(ActionEvent e)
{
! ObjectSearcher finder = (ObjectSearcher) SwingUtilities.getAncestorOfClass(ObjectSearcher.class, ObjectNameEditor.this.panel);
! if ((finder != null) && (ObjectNameEditor.this.value != null))
! {
! finder.find(ObjectNameEditor.this.getAsText());
! }
}
}
);
+ }
+ return this.panel;
+ }
+ else
+ {
+ return this.text;
}
}
***************
*** 118,127 ****
{
this.value = new ObjectName(s);
- this.text.setText(((ObjectName) this.value).getCanonicalName());
- this.firePropertyChange();
}
catch (Exception e)
{
}
}
--- 138,148 ----
{
this.value = new ObjectName(s);
}
catch (Exception e)
{
+ this.value = null;
}
+ this.text.setText(this.getAsText());
+ this.firePropertyChange();
}
***************
*** 137,141 ****
if (this.value != null)
{
! this.text.setText(((ObjectName) this.value).getCanonicalName());
}
}
--- 158,162 ----
if (this.value != null)
{
! this.text.setText(this.getAsText());
}
}
Index: PropertiesEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/PropertiesEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PropertiesEditor.java 10 Jan 2003 19:35:12 -0000 1.3
--- PropertiesEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 18,23 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 19 octobre 2001
* @version $Revision$
* @todo Javadoc to complete
--- 18,22 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
***************
*** 95,100 ****
*
* @author letiembl
- * @created 19 octobre 2001
* @version $Revision$
*/
protected class PropertiesView extends JTextArea
--- 94,99 ----
*
* @author letiembl
* @version $Revision$
+ * @created 19 octobre 2001
*/
protected class PropertiesView extends JTextArea
Index: URLEditor.java
===================================================================
RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/URLEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** URLEditor.java 10 Jan 2003 19:35:14 -0000 1.3
--- URLEditor.java 15 Sep 2003 22:37:13 -0000 1.4
***************
*** 12,17 ****
* Description of the Class
*
! * @author <a href="mailto:let...@us...">Laurent Etiemble</a>
! * @created 6 avril 2002
* @version $Revision$
* @todo Javadoc to complete
--- 12,16 ----
* Description of the Class
*
! * @author Laurent Etiemble
* @version $Revision$
* @todo Javadoc to complete
|