/** ***************************************** */ private void doKlartext() { if (jchb.isSelected() && (jcmb.getSelectedIndex() > 0)) { this.internal.setTitle(elternTitel + " [ PW: " + jcmb.getValue().toString() + " ]"); } else { this.internal.setTitle(elternTitel); } }
/** **************************** */ private void doBenutzerWahl() { if (jcmb.getSelectedIndex() == 0) { tfs[0].setText(""); pws[0].setText(""); pws[1].setText(""); aktuelleRechte = ""; userid = ""; this.internal.setTitle(elternTitel); regleButtons("1101000"); } else { tfs[0].setText(jcmb.getSelectedItem().toString()); pws[0].setText(jcmb.getValue().toString()); pws[1].setText(jcmb.getValue().toString()); //// System.out.println(ParameterLaden.pKollegen.get(jcmb.getSelectedIndex()-1).get(0)); aktuelleRechte = ParameterLaden.pKollegen.get(jcmb.getSelectedIndex() - 1).get(2); if (!rechteTools.Rechte.hatRecht(rechteTools.Rechte.BenutzerSuper_user, false) && rechteTools.Rechte.testeRecht(aktuelleRechte, rechteTools.Rechte.BenutzerSuper_user)) { JOptionPane.showMessageDialog( null, "SuperUser-Rechte können nur von einem Benutzer mit SuperUser-Rechten geändert werden"); jcmb.setSelectedIndex(0); tfs[0].setText(""); pws[0].setText(""); pws[1].setText(""); aktuelleRechte = ""; userid = ""; regleButtons("1101000"); return; } if (jchb.isSelected()) { this.internal.setTitle(elternTitel + " [PW:" + jcmb.getValue().toString() + "]"); } else { this.internal.setTitle(elternTitel); } userid = ParameterLaden.pKollegen.get(jcmb.getSelectedIndex() - 1).get(4); regleButtons("1101000"); aktualisiereTree(false); } }
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; }