Article View: borland.public.jbuilder.java.swing
Article #12908Re: GUI Designer, DataModules and MVC Documents
From: Greg Hamer
Date: Sat, 17 Oct 1998 00:00
Date: Sat, 17 Oct 1998 00:00
93 lines
4561 bytes
4561 bytes
The dataset designer is the one that looks for datamodules, and so when it
finds one, it was only looking at it for properties that applied to
it that particular designer. We will be making it more generic in in the
future so that it behaves as you expect it to.
Geoffrey L. Goetz wrote:
> I was wondering how the dbSwing and the JDBC components are made aware
> of the DataSet objects contained within a DataModule.
>
> I created a DataModule, added a PlainDocument property and ran the
> wizard to "Use DataModule" in my frame. When I went into the designer
> of the frame and added a simple JTextField to my frame, I could not use
> the design time 'drop-down selection' for the document property of the
> JTextField to select the PlainDocument property of the DataModule. Why?
>
> If I do the exact same steps with a Database and a QueryDataSet in the
> DataModule, for the dbSwing and the JDBC components, I can use the
> design time 'drop-down selection' for the dataset property. What magic
> is going on in the IDE to make this happen?
>
> public class DataModule1 implements DataModule{
> private static DataModule1 myDM;
> PlainDocument pdEmployeeName = new PlainDocument();;
> public DataModule1() {
> try {
> jbInit();}
> catch (Exception e) {
> e.printStackTrace();}}
> private void jbInit() throws Exception {}
> public static DataModule1 getDataModule() {
> if (myDM == null)
> myDM = new DataModule1();
> return myDM;}
> public com.sun.java.swing.text.PlainDocument getPdEmployeeName() {
> return pdEmployeeName;}}
>
> public class Frame1 extends JFrame {
> DataModule1 dataModule11;
> JTextField jTextField1 = new JTextField();
> FlowLayout flowLayout1 = new FlowLayout();
> public Frame1() {
> enableEvents(AWTEvent.WINDOW_EVENT_MASK);
> try {
> jbInit();}
> catch (Exception e) {
> e.printStackTrace();}}
> private void jbInit() throws Exception {
> dataModule11 = untitled13.DataModule1.getDataModule();
> this.getContentPane().setLayout(flowLayout1);
> this.setSize(new Dimension(400, 300));
> this.setTitle("Frame Title");
> this.getContentPane().add(jTextField2, null);}
> protected void processWindowEvent(WindowEvent e) {
> super.processWindowEvent(e);
> if (e.getID() == WindowEvent.WINDOW_CLOSING) {
> System.exit(0);}}}
>
> I want to be able to set the document property of the JTextField in the
> designer rather than having to go to the code. If I ad the following
> line of code manually all is well...
>
> jTextField1.setDocument(dataModule11.getPdEmployeeName());
>
> Which is very similar to the line of code that the designer will add
> when I set the dataset property in the property editor...
>
> jdbTextField1.setDataSet(dataModule11.getQueryDataSet1());
>
> What's going on here?
> -Geoff
>
> P.S. This was not a 'cross post' rather two separate posts. I was going
> after the JBuilder DataModule crowd and the JBuilder Swing crowd,
> thinking that neither frequented the other's territory.
>
> --
>
> \\|//
> | (o o) |
> =-=-=-=-=-=-=-=-=-=-=-=-=-(_)-=-=-=-=-=-=-=-=-=-=-=-=-=
> _|__ ______ __|_
> (____) / _____) ___ ______ _____ _____ (____)
> (____) / / ___ / ___) / __ / / ____)/ ____) (____)
> (____) / /___/ // ___) / /_/ / / ___) / ___) (____)
> (__) /_______//_____)/_____/ /_/ /_/ (__)
> | |
> | http://home.columbus.rr.com/ggeoffre |
> | |
> | .oo0O O0oo. |
> | ( ) ( ) |
> =-=-=-=-=-=-=-=-=-=-=-\ (-=-=-) /-=-=-=-=-=-=-=-=-=-=-=
> \_) (_/
Technical Details
Message-ID:
<36290FBE.9EAF85EF@inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<361CD2B0.DEB58C81@bottom.of.note.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,1bef20a9933606d2 X-Google-Attributes: gid111d45,public From: Greg Hamer <ghamer@inprise.com> Subject: Re: GUI Designer, DataModules and MVC Documents Date: 1998/10/17 Message-ID: <36290FBE.9EAF85EF@inprise.com> X-Deja-AN: 402271082 Content-Transfer-Encoding: 7bit References: <361CD2B0.DEB58C81@bottom.of.note.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing