|
From: <fb...@us...> - 2003-07-14 21:02:33
|
Update of /cvsroot/jgb/jgb/src/java/examples/jgb/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv31851/src/java/examples/jgb/examples
Modified Files:
WebBrowserEventManager.java
Log Message:
* src/java/tests/jgb/handlers/swing/TestConstraintsTagHandler.java:
Started implementing new constraints-handling code. Started making
constraints be saved in a Map instead of last defined. The map is
associative with the current object. So constraints are attached to
their parent objects, but are used for children of said parent.
* src/java/core/jgb/handlers/swing/ConstraintsTagHandler.java:
Implemented tests.
* src/java/core/jgb/handlers/swing/AbstractControlTagHandler.java,
src/java/tests/jgb/handlers/swing/TestAbstractControlTagHandler.java,
src/java/tests/jgb/handlers/swing/TestControlTagHandler.java,
src/java/tests/jgb/handlers/swing/TestGlueTagHandler.java,
src/java/tests/jgb/handlers/swing/TestStrutTagHandler.java:
Had to modify tests to take into account new Constraints object
and way of doing things.
* src/examples/webbrowser.xml:
Works, but not exactly right. Problem with constraints that are not
properly associated. All controls are so small as to be useless...
Added a "Dump" menu item to use XMLEncoder to dump the frame.
* src/java/examples/jgb/examples/WebBrowserEventManager.java:
Modified to implement the dump() method required by the register
call of the dump menu item.
* src/java/core/jgb/builder/utils/Constraints.java:
Created implementation that is a data holder for two pieces of
information: value and class. No tests for such a simple class.
Index: WebBrowserEventManager.java
===================================================================
RCS file: /cvsroot/jgb/jgb/src/java/examples/jgb/examples/WebBrowserEventManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WebBrowserEventManager.java 6 Jun 2003 04:12:45 -0000 1.1
--- WebBrowserEventManager.java 14 Jul 2003 21:02:30 -0000 1.2
***************
*** 6,11 ****
--- 6,15 ----
import javax.swing.event.HyperlinkEvent;
import java.io.IOException;
+ import java.io.FileOutputStream;
+ import java.io.BufferedOutputStream;
+ import java.io.FileNotFoundException;
import java.net.URL;
import java.util.EventObject;
+ import java.beans.XMLEncoder;
public class WebBrowserEventManager {
***************
*** 35,38 ****
--- 39,55 ----
}
});
+ }
+
+ public void dump(EventObject event, WindowContext context) {
+ JComponent comp = (JComponent) context.getObject("webbrowser");
+ try {
+ XMLEncoder encoder = new XMLEncoder(
+ new BufferedOutputStream(new FileOutputStream("out.dump.xml")));
+ encoder.writeObject(comp);
+ encoder.flush();
+ encoder.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace(); //To change body of catch statement use Options | File Templates.
+ }
}
|