Multiple Device Markup Language

Description and Generation

DePaul University

 

School of Computer Science, Telecommunications and Information Systems

Updated on 02/18/2004 12:11 AM


Abstract Architecture Schema Documents Project Files

 

 

TabbedPane Example

Swing TabbedPane

SWT  TabbedPane


MDML

 

<?xml version="1.0" encoding="UTF-8"?>

<Start name="TabbedApplication" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="J:\eclipse\workspace\Zoom\src\resources\ui\UISchema.xsd">

       <Window name="TabApp" title="Tabbed Application" visible="true" show="true">

             <TabbedPane>

                    <Tabs text="Label/TextBox">

                           <GridLayout rows="3" columns="2" icolumns="6"/>

                           <Label text="First Name"/>

                           <TextBox type="text"/>

                           <Label text="Last Name"/>

                           <TextBox type="text"/>

                           <Label text="Address "/>

                           <TextBox type="text"/>

                           <Label text="City"/>

                           <TextBox type="text"/>

                           <Label text="State"/>

                           <TextBox type="text"/>

                           <Label text="Zip"/>

                           <TextBox type="text"/>

                    </Tabs>

                    <Tabs text="ComboBox">

                           <FlowLayout/>

                           <Label text="Combo"/>

                           <ComboBox>

                                 <Item element="24"/>

                                 <Item element="36"/>

                           </ComboBox>

                    </Tabs>

                    <Tabs text="CheckBox">

                           <GridLayout rows="3" columns="1" icolumns="2"/>

                           <Group name="GroupCheck">

                                 <CheckBox text="CheckBox1"/>

                                 <CheckBox text="CheckBox2"/>

                           </Group>

                    </Tabs>

             </TabbedPane>

       </Window>

</Start>

 

 

 


Swing TabbedPane

 

 

 

// Generated by JavaGenerator.

// Fri Jan 30 11:37:25 CST 2004

 

import javax.swing.*;

import javax.swing.event.*;

import javax.swing.border.*;

import java.awt.*;

import java.awt.event.*;

import javax.swing.tree.*;

 

public class TabbedApplication {

 

  public void createComponents() {

    TabApp = new JFrame();

    TabApp.setTitle("TabApp");

    JTabbedPane3 = new JTabbedPane();

    TabApp.getContentPane().add(JTabbedPane3);

    JPanel4 = new JPanel();

    JTabbedPane3.addTab("Label/TextBox" , JPanel4);

    GridLayout5 = new GridLayout();

    JPanel4.setLayout(GridLayout5);

    GridLayout5.setRows(3);

    GridLayout5.setColumns(2);

    JLabel6 = new JLabel();

    JPanel4.add(JLabel6);

    JLabel6.setText("First Name");

    JTextField7 = new JTextField();

    JPanel4.add(JTextField7);

    JLabel8 = new JLabel();

    JPanel4.add(JLabel8);

    JLabel8.setText("Last Name");

    JTextField9 = new JTextField();

    JPanel4.add(JTextField9);

    JLabel10 = new JLabel();

    JPanel4.add(JLabel10);

    JLabel10.setText("Address ");

    JTextField11 = new JTextField();

    JPanel4.add(JTextField11);

    JLabel12 = new JLabel();

    JPanel4.add(JLabel12);

    JLabel12.setText("City");

    JTextField13 = new JTextField();

    JPanel4.add(JTextField13);

    JLabel14 = new JLabel();

    JPanel4.add(JLabel14);

    JLabel14.setText("State");

    JTextField15 = new JTextField();

    JPanel4.add(JTextField15);

    JLabel16 = new JLabel();

    JPanel4.add(JLabel16);

    JLabel16.setText("Zip");

    JTextField17 = new JTextField();

    JPanel4.add(JTextField17);

    JPanel18 = new JPanel();

    JTabbedPane3.addTab("ComboBox" , JPanel18);

    FlowLayout19 = new FlowLayout();

    JLabel20 = new JLabel();

    JPanel18.add(JLabel20);

    JLabel20.setText("Combo");

    JComboBox21 = new JComboBox();

    JPanel18.add(JComboBox21);

    JComboBox21.addItem("24");

    JComboBox21.addItem("36");

    JPanel24 = new JPanel();

    JTabbedPane3.addTab("CheckBox" , JPanel24);

    GridLayout25 = new GridLayout();

    JPanel24.setLayout(GridLayout25);

    GridLayout25.setRows(3);

    GridLayout25.setColumns(1);

    GroupCheck = new ButtonGroup();

    JCheckBox27 = new JCheckBox();

    JPanel24.add(JCheckBox27);

    GroupCheck.add(JCheckBox27);

    JCheckBox27.setText("CheckBox1");

    JCheckBox28 = new JCheckBox();

    JPanel24.add(JCheckBox28);

    GroupCheck.add(JCheckBox28);

    JCheckBox28.setText("CheckBox2");

    TabApp.show();

  }

 

  public Object getComponent(String name) {

    Object result = null;

    if (name.equalsIgnoreCase("TabApp")) {

            result = TabApp;

    }

    else if (name.equalsIgnoreCase("JTabbedPane3")) {

            result = JTabbedPane3;

    }

    else if (name.equalsIgnoreCase("JPanel4")) {

            result = JPanel4;

    }

    else if (name.equalsIgnoreCase("GridLayout5")) {

            result = GridLayout5;

    }

    else if (name.equalsIgnoreCase("JLabel6")) {

            result = JLabel6;

    }

    else if (name.equalsIgnoreCase("JTextField7")) {

            result = JTextField7;

    }

    else if (name.equalsIgnoreCase("JLabel8")) {

            result = JLabel8;

    }

    else if (name.equalsIgnoreCase("JTextField9")) {

            result = JTextField9;

    }

    else if (name.equalsIgnoreCase("JLabel10")) {

            result = JLabel10;

    }

    else if (name.equalsIgnoreCase("JTextField11")) {

            result = JTextField11;

    }

    else if (name.equalsIgnoreCase("JLabel12")) {

            result = JLabel12;

    }

    else if (name.equalsIgnoreCase("JTextField13")) {

            result = JTextField13;

    }

    else if (name.equalsIgnoreCase("JLabel14")) {

            result = JLabel14;

    }

    else if (name.equalsIgnoreCase("JTextField15")) {

            result = JTextField15;

    }

    else if (name.equalsIgnoreCase("JLabel16")) {

            result = JLabel16;

    }

    else if (name.equalsIgnoreCase("JTextField17")) {

            result = JTextField17;

    }

    else if (name.equalsIgnoreCase("JPanel18")) {

            result = JPanel18;

    }

    else if (name.equalsIgnoreCase("FlowLayout19")) {

            result = FlowLayout19;

    }

    else if (name.equalsIgnoreCase("JLabel20")) {

            result = JLabel20;

    }

    else if (name.equalsIgnoreCase("JComboBox21")) {

            result = JComboBox21;

    }

    else if (name.equalsIgnoreCase("JPanel24")) {

            result = JPanel24;

    }

    else if (name.equalsIgnoreCase("GridLayout25")) {

            result = GridLayout25;

    }

    else if (name.equalsIgnoreCase("GroupCheck")) {

            result = GroupCheck;

    }

    else if (name.equalsIgnoreCase("JCheckBox27")) {

            result = JCheckBox27;

    }

    else if (name.equalsIgnoreCase("JCheckBox28")) {

            result = JCheckBox28;

    }

    return(result);

  }

 

  public static TabbedApplication getInstance() {

    if ( gui_instance == null ) {

            gui_instance = new TabbedApplication();

            gui_instance.createComponents();

      }

      return gui_instance;

  }

 

  public static void main(String[] args) {

    try {

            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

       } catch (Exception e) {

            System.out.println("Error");

       }

    getInstance();

  }

 

  protected JLabel JLabel12;

 

  protected JLabel JLabel10;

 

  protected JLabel JLabel8;

 

  protected JLabel JLabel6;

 

  protected JCheckBox JCheckBox28;

 

  protected JCheckBox JCheckBox27;

 

  protected GridLayout GridLayout5;

 

  protected JLabel JLabel14;

 

  protected JLabel JLabel16;

 

  protected JLabel JLabel20;

 

  private static TabbedApplication gui_instance;

 

  protected JTextField JTextField9;

 

  protected JTextField JTextField7;

 

  protected JTabbedPane JTabbedPane3;

 

  protected JFrame TabApp;

 

  protected JTextField JTextField13;

 

  protected JTextField JTextField11;

 

  protected JTextField JTextField15;

 

  protected JTextField JTextField17;

 

  protected JPanel JPanel24;

 

  protected FlowLayout FlowLayout19;

 

  protected JComboBox JComboBox21;

 

  protected GridLayout GridLayout25;

 

  protected JPanel JPanel4;

 

  protected JPanel JPanel18;

 

  protected ButtonGroup GroupCheck;

 

  ////>>>>  TabbedApplication: fields and methods

  //// Add fields and methods below.

 

  ////<<<<  TabbedApplication: fields and methods

}


SWT  TabbedPane

 

 

 

// Generated by JavaGenerator.

// Fri Jan 30 11:43:52 CST 2004

 

import org.eclipse.swt.*;

import org.eclipse.swt.widgets.*;

import org.eclipse.swt.layout.*;

import org.eclipse.swt.graphics.*;

import org.eclipse.swt.custom.*;

 

public class TabbedApplication {

 

  public void createComponents() {

    FillLayout2 = new FillLayout();

    Display2 = new Display();

    TabApp = new Shell(Display2);

    TabApp.setText("TabApp");

    TabApp.setLayout(FillLayout2);

    TabFolder3 = new TabFolder(TabApp , SWT.NONE);

    TabItem4 = new TabItem(TabFolder3 , SWT.NONE);

    Composite4 = new Composite(TabFolder3 , SWT.NONE);

    TabItem4.setControl(Composite4);

    TabItem4.setText("Label/TextBox");

    GridLayout5 = new GridLayout();

    Composite4.setLayout(GridLayout5);

    GridLayout5.numColumns = 6;

    Label6 = new Label(Composite4 , SWT.FLAT);

    Label6.setText("First Name");

    Text7 = new Text(Composite4 , SWT.BORDER);

    Label8 = new Label(Composite4 , SWT.FLAT);

    Label8.setText("Last Name");

    Text9 = new Text(Composite4 , SWT.BORDER);

    Label10 = new Label(Composite4 , SWT.FLAT);

    Label10.setText("Address ");

    Text11 = new Text(Composite4 , SWT.BORDER);

    Label12 = new Label(Composite4 , SWT.FLAT);

    Label12.setText("City");

    Text13 = new Text(Composite4 , SWT.BORDER);

    Label14 = new Label(Composite4 , SWT.FLAT);

    Label14.setText("State");

    Text15 = new Text(Composite4 , SWT.BORDER);

    Label16 = new Label(Composite4 , SWT.FLAT);

    Label16.setText("Zip");

    Text17 = new Text(Composite4 , SWT.BORDER);

    TabItem18 = new TabItem(TabFolder3 , SWT.NONE);

    Composite18 = new Composite(TabFolder3 , SWT.NONE);

    TabItem18.setControl(Composite18);

    TabItem18.setText("ComboBox");

    FillLayout19 = new FillLayout();

    Composite18.setLayout(FillLayout19);

    Label20 = new Label(Composite18 , SWT.FLAT);

    Label20.setText("Combo");

    Combo21 = new Combo(Composite18 , SWT.READ_ONLY);

    Combo21.add("24");

    Combo21.add("36");

    TabItem24 = new TabItem(TabFolder3 , SWT.NONE);

    Composite24 = new Composite(TabFolder3 , SWT.NONE);

    TabItem24.setControl(Composite24);

    TabItem24.setText("CheckBox");

    GridLayout25 = new GridLayout();

    Composite24.setLayout(GridLayout25);

    GridLayout25.numColumns = 2;

    RowLayout26 = new RowLayout();

    GroupCheck = new Group(Composite24 , SWT.BORDER);

    GroupCheck.setLayout(RowLayout26);

    Button27 = new Button(GroupCheck , SWT.CHECK);

    Button27.setText("CheckBox1");

    Button28 = new Button(GroupCheck , SWT.CHECK);

    Button28.setText("CheckBox2");

    TabApp.open();

    while (!TabApp.isDisposed ()) {

             if (!Display2.readAndDispatch ())

                    Display2.sleep ();

       }

       Display2.dispose ();

  }

 

  public Object getComponent(String name) {

    Object result = null;

    if (name.equalsIgnoreCase("FillLayout2")) {

             result = FillLayout2;

    }

    else if (name.equalsIgnoreCase("Display2")) {

             result = Display2;

    }

    else if (name.equalsIgnoreCase("TabApp")) {

             result = TabApp;

    }

    else if (name.equalsIgnoreCase("TabFolder3")) {

             result = TabFolder3;

    }

    else if (name.equalsIgnoreCase("TabItem4")) {

             result = TabItem4;

    }

    else if (name.equalsIgnoreCase("Composite4")) {

             result = Composite4;

    }

    else if (name.equalsIgnoreCase("GridLayout5")) {

             result = GridLayout5;

    }

    else if (name.equalsIgnoreCase("Label6")) {

             result = Label6;

    }

    else if (name.equalsIgnoreCase("Text7")) {

             result = Text7;

    }

    else if (name.equalsIgnoreCase("Label8")) {

             result = Label8;

    }

    else if (name.equalsIgnoreCase("Text9")) {

             result = Text9;

    }

    else if (name.equalsIgnoreCase("Label10")) {

             result = Label10;

    }

    else if (name.equalsIgnoreCase("Text11")) {

             result = Text11;

    }

    else if (name.equalsIgnoreCase("Label12")) {

             result = Label12;

    }

    else if (name.equalsIgnoreCase("Text13")) {

             result = Text13;

    }

    else if (name.equalsIgnoreCase("Label14")) {

             result = Label14;

    }

    else if (name.equalsIgnoreCase("Text15")) {

             result = Text15;

    }

    else if (name.equalsIgnoreCase("Label16")) {

             result = Label16;

    }

    else if (name.equalsIgnoreCase("Text17")) {

             result = Text17;

    }

    else if (name.equalsIgnoreCase("TabItem18")) {

             result = TabItem18;

    }

    else if (name.equalsIgnoreCase("Composite18")) {

             result = Composite18;

    }

    else if (name.equalsIgnoreCase("FillLayout19")) {

             result = FillLayout19;

    }

    else if (name.equalsIgnoreCase("Label20")) {

             result = Label20;

    }

    else if (name.equalsIgnoreCase("Combo21")) {

             result = Combo21;

    }

    else if (name.equalsIgnoreCase("TabItem24")) {

             result = TabItem24;

    }

    else if (name.equalsIgnoreCase("Composite24")) {

             result = Composite24;

    }

    else if (name.equalsIgnoreCase("GridLayout25")) {

             result = GridLayout25;

    }

    else if (name.equalsIgnoreCase("RowLayout26")) {

             result = RowLayout26;

    }

    else if (name.equalsIgnoreCase("GroupCheck")) {

             result = GroupCheck;

    }

    else if (name.equalsIgnoreCase("Button27")) {

             result = Button27;

    }

    else if (name.equalsIgnoreCase("Button28")) {

             result = Button28;

    }

    return(result);

  }

 

  public static TabbedApplication getInstance() {

    if ( gui_instance == null ) {

             gui_instance = new TabbedApplication();

             gui_instance.createComponents();

       }

       return gui_instance;

  }

 

  public static void main(String[] args) {

    getInstance();

  }

 

  protected GridLayout GridLayout5;

 

  protected Composite Composite18;

 

  protected Text Text15;

 

  protected Text Text17;

 

  protected Label Label6;

 

  protected TabItem TabItem18;

 

  protected TabItem TabItem24;

 

  protected FillLayout FillLayout2;

 

  private static TabbedApplication gui_instance;

 

  protected Text Text11;

 

  protected Text Text13;

 

  protected Group GroupCheck;

 

  protected RowLayout RowLayout26;

 

  protected Text Text9;

 

  protected Text Text7;

 

  protected GridLayout GridLayout25;

 

  protected TabItem TabItem4;

 

  protected Shell TabApp;

 

  protected Label Label8;

 

  protected Composite Composite4;

 

  protected Label Label20;

 

  protected Label Label10;

 

  protected Label Label14;

 

  protected Button Button27;

 

  protected Display Display2;

 

  protected Button Button28;

 

  protected Combo Combo21;

 

  protected TabFolder TabFolder3;

 

  protected Label Label12;

 

  protected Label Label16;

 

  protected FillLayout FillLayout19;

 

  protected Composite Composite24;

 

  ////>>>>  TabbedApplication: fields and methods

  //// Add fields and methods below.

 

  ////<<<<  TabbedApplication: fields and methods

}