Exemplo n.º 1
0
  private JXPanel getButtonTeil() {
    //                                   1            2  3   4        5
    FormLayout lay =
        new FormLayout(
            "fill:0:grow(0.5),80dlu,3dlu,80dlu,fill:0:grow(0.5)",
            //       1             2   3   4  5   6  7   8  9  10  11  12 13  14 15  16  17  18   19
            "fill:0:grow(0.33),p,20dlu,p,1dlu,p,1dlu,p,1dlu,p,25dlu,p,5dlu,p,5dlu,p,15dlu,p,fill:0:grow(0.66)");
    CellConstraints cc = new CellConstraints();
    JXPanel jpan = new JXPanel();
    jpan.setLayout(lay);

    JLabel lab = new JLabel("Benutzer auswählen");
    jpan.add(lab, cc.xy(2, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    jcmb = new JRtaComboBox();
    jcmb.setDataVectorWithStartElement(ParameterLaden.pKollegen, 0, 1, "./.");
    jcmb.setActionCommand("benutzerwahl");
    jcmb.addActionListener(al);
    jpan.add(jcmb, cc.xy(4, 2));

    lab = new JLabel("Benutzername");
    jpan.add(lab, cc.xy(2, 4, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    tfs[0] = new JRtaTextField("nix", false);
    tfs[0].setEnabled(false);
    jpan.add(tfs[0], cc.xy(4, 4));

    lab = new JLabel("Passwortanzeige");
    jpan.add(lab, cc.xy(2, 6, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    jchb = new JRtaCheckBox("im Klartext anzeigen");
    jpan.add(jchb, cc.xy(4, 6));
    if (!rechteTools.Rechte.hatRecht(rechteTools.Rechte.BenutzerSuper_user, false)) {
      jchb.setSelected(false);
      jchb.setEnabled(false);
    }
    jchb.setActionCommand("klartext");
    jchb.addActionListener(al);

    lab = new JLabel("Passwort");
    jpan.add(lab, cc.xy(2, 8, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    pws[0] = new JPasswordField();
    pws[0].setEnabled(false);
    jpan.add(pws[0], cc.xy(4, 8));

    lab = new JLabel("Passwort wiederholen");
    jpan.add(lab, cc.xy(2, 10, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    pws[1] = new JPasswordField();
    pws[1].setEnabled(false);
    jpan.add(pws[1], cc.xy(4, 10));

    jpan.add((buts[0] = ButtonTools.macheButton("neuer Benutzer", "neu", al)), cc.xy(2, 12));
    jpan.add((buts[1] = ButtonTools.macheButton("Benutzer ändern", "edit", al)), cc.xy(4, 12));
    jpan.add((buts[2] = ButtonTools.macheButton("Benutzer speichern", "save", al)), cc.xy(2, 14));
    jpan.add((buts[3] = ButtonTools.macheButton("Benutzer löschen", "delete", al)), cc.xy(4, 14));
    jpan.add(
        (buts[4] = ButtonTools.macheButton("Vorgang abbrechen", "dobreak", al)), cc.xyw(2, 16, 3));

    jpan.add(
        (buts[5] = ButtonTools.macheButton("Rechte exportieren", "doexport", al)), cc.xy(2, 18));
    jpan.add(
        (buts[6] = ButtonTools.macheButton("Rechte importieren", "doimport", al)), cc.xy(4, 18));
    buts[5].setForeground(Color.BLUE);
    buts[6].setForeground(Color.RED);
    regleButtons("1101000");
    return jpan;
  }