Exemplo n.º 1
0
 private void ButtonAceptActionPerformed(
     java.awt.event.ActionEvent evt) // GEN-FIRST:event_ButtonAceptActionPerformed
     { // GEN-HEADEREND:event_ButtonAceptActionPerformed
   try {
     Attribute Attr;
     if (ModeGrp) {
       Attr = Perm.getAttr(PDACL.fGROUPNAME);
     } else {
       Attr = Perm.getAttr(PDACL.fUSERNAME);
     }
     Attr.setValue(UserComboBox.getSelectedItem());
     Attr = Perm.getAttr(PDACL.fPERMISION);
     Attr.setValue(PermisionComboBox.getSelectedIndex() + 1);
     Cancel = false;
     this.dispose();
   } catch (PDException ex) {
     MainWin.Message(MainWin.DrvTT(ex.getLocalizedMessage()));
   }
 } // GEN-LAST:event_ButtonAceptActionPerformed
Exemplo n.º 2
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    LabelOperation = new javax.swing.JLabel();
    UserNameLabel = new javax.swing.JLabel();
    PermisionLabel = new javax.swing.JLabel();
    UserComboBox = new javax.swing.JComboBox();
    PermisionComboBox = new javax.swing.JComboBox();
    ButtonAcept = new javax.swing.JButton();
    ButtonCancel = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(MainWin.TT("Permissions_Maintenance"));
    setResizable(false);
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
          }
        });

    LabelOperation.setFont(new java.awt.Font("DejaVu Sans", 1, 14));
    LabelOperation.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    LabelOperation.setText("jLabel1");

    UserNameLabel.setFont(MainWin.getFontDialog());
    UserNameLabel.setText("jLabel1");

    PermisionLabel.setFont(MainWin.getFontDialog());
    PermisionLabel.setText("jLabel1");

    UserComboBox.setFont(MainWin.getFontDialog());
    UserComboBox.setModel(getComboModel());

    PermisionComboBox.setFont(MainWin.getFontDialog());
    PermisionComboBox.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"READ", "CATALOG", "VERSION", "UPDATE", "DELETE"}));

    ButtonAcept.setFont(MainWin.getFontDialog());
    ButtonAcept.setText(MainWin.TT("Ok"));
    ButtonAcept.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ButtonAceptActionPerformed(evt);
          }
        });

    ButtonCancel.setFont(MainWin.getFontDialog());
    ButtonCancel.setText(MainWin.TT("Cancel"));
    ButtonCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ButtonCancelActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        UserNameLabel,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        89,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(UserComboBox, 0, 316, Short.MAX_VALUE))
                            .addComponent(
                                LabelOperation,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                417,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        PermisionLabel,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        89,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(PermisionComboBox, 0, 316, Short.MAX_VALUE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(ButtonAcept)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(ButtonCancel)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(LabelOperation)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(UserNameLabel)
                            .addComponent(
                                UserComboBox,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(PermisionLabel)
                            .addComponent(
                                PermisionComboBox,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ButtonCancel)
                            .addComponent(ButtonAcept))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
  } // </editor-fold>//GEN-END:initComponents