🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #13028

GUI Designer, DataModules and MVC Documents

#13028
From: Geoffrey L. Goetz
Date: Thu, 08 Oct 1998 00:00
89 lines
4095 bytes
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: <361CD2B0.DEB58C81@bottom.of.note.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,1bef20a9933606d2,start
X-Google-Attributes: gid111d45,public
From: "Geoffrey L. Goetz" <please.read.sig@bottom.of.note.com>
Subject: GUI Designer, DataModules and MVC Documents
Date: 1998/10/08
Message-ID: <361CD2B0.DEB58C81@bottom.of.note.com>
X-Deja-AN: 399011323
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing