Package de.chris_soft.fyllgen.widget.person

Examples of de.chris_soft.fyllgen.widget.person.PersonRelationCombo


   */
  public Control createTabItemWidgets(AtomData[] atomData, Composite parentComposite, String relationshipType,
      CurrentPersonChanger currentPersonChanger) {
    Properties[] viewData = new Properties[0];
    Control firstControl = null;
    PersonRelationCombo relationshipChanger = null;
    for (AtomData atom : atomData) {
      // In einem speziellen Fall wird das Label nicht erzeugt, weil auch das
      // "personencombo"-Objekt nicht erzeugt wird.
      if (relationshipChanger == null || !atom.type.equals("personcombo")) {
        boolean atTop = atom.type.equals("textarea");
        createGridLabelTopLeft(parentComposite, atom.title, atTop);
      }

      // Einzeiliges Textfeld als Eingabe.
      if (atom.type.equals("text")) {
        GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
        if (relationshipType == null) {
          CurrentPersonChangeListener cpcl = new PersonText(parentComposite, atom.name, viewData);
          cpcl.getControl().setLayoutData(gd);
          cpcl.setCurrentPersonChanger(currentPersonChanger);
          if (this.firstControl == null) {
            this.firstControl = cpcl.getControl();
          }
          if (firstControl == null) {
            firstControl = cpcl.getControl();
          }
        }
        else {
          RelationshipChangeListener rcl = new RelationshipText(parentComposite, atom.name, viewData);
          rcl.getControl().setLayoutData(gd);
          rcl.setRelationshipChanger(relationshipChanger);
        }
      }

      // Mehrzeiliges Textfeld, in der Regel das einzige auf diesem Reiter.
      else if (atom.type.equals("textarea")) {
        PersonTextarea textarea = new PersonTextarea(parentComposite, atom.name, viewData);
        GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        textarea.getControl().setLayoutData(gd);
        textarea.setCurrentPersonChanger(currentPersonChanger);
      }

      // Datumsfelder.
      else if (atom.type.equals("date")) {
        if (relationshipType == null) {
          CurrentPersonChangeListener cpcl = new PersonDateField(parentComposite, atom.name, viewData);
          cpcl.setCurrentPersonChanger(currentPersonChanger);
        }
        else {
          RelationshipChangeListener rcl = new RelationshipDateField(parentComposite, atom.name, viewData);
          rcl.setRelationshipChanger(relationshipChanger);
        }
      }

      // Optionen zur Auswahl.
      else if (atom.type.equals("option")) {
        if (relationshipType == null) {
          CurrentPersonChangeListener cpcl =
            new PersonOption(parentComposite, atom.name, atom.keys, atom.values, "?", viewData);
          cpcl.setCurrentPersonChanger(currentPersonChanger);
        }
        else {
          RelationshipChangeListener rcl =
            new RelationshipOption(parentComposite, atom.name, atom.keys, atom.values, "?", viewData);
          rcl.setRelationshipChanger(relationshipChanger);
        }
      }

      // Personen-ComboBox.
      else if (atom.type.equals("personcombo")) {
        if (relationshipChanger == null) {
          // Ein Composite erzeugen, in dem die ComboBox und ein Button zum
          // Wechsel liegen.
          Composite c2 = new Composite(parentComposite, 0);
          GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
          c2.setLayoutData(gd);
          GridLayout gl = new GridLayout();
          gl.numColumns = 2;
          gl.marginHeight = gl.marginWidth = 0;
          c2.setLayout(gl);

          // ComboBox im inneren Composite erzeugen.
          PersonRelationCombo personRelationCombo = new PersonRelationCombo(c2, relationshipType);
          CurrentPersonChangeListener cpcl = personRelationCombo;
          gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
          cpcl.getControl().setLayoutData(gd);
          cpcl.setCurrentPersonChanger(currentPersonChanger);

View Full Code Here


          gl.numColumns = 2;
          gl.marginHeight = gl.marginWidth = 0;
          c2.setLayout(gl);

          // ComboBox im inneren Composite erzeugen.
          PersonRelationCombo personRelationCombo = new PersonRelationCombo(c2, relationshipType);
          CurrentPersonChangeListener cpcl = personRelationCombo;
          gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
          cpcl.getControl().setLayoutData(gd);
          cpcl.setCurrentPersonChanger(currentPersonChanger);
View Full Code Here

TOP

Related Classes of de.chris_soft.fyllgen.widget.person.PersonRelationCombo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.