示例#1
0
/**
 * Descripción de Clase
 *
 * @version 2.2, 21.04.07
 * @author Equipo de Desarrollo de openXpertya
 */
public class KeyStoreDialog extends CDialog {

  /** Descripción de Campo */
  private CLabel lCN = new CLabel("(CN) Nombre com" + "\u00fa" + "n");

  /** Descripción de Campo */
  private CTextField fCN = new CTextField(20);

  /** Descripción de Campo */
  private CLabel lOU = new CLabel("(OU) Unidad organizativa");

  /** Descripción de Campo */
  private CLabel lO = new CLabel("(O) Organizaci" + "\u00f3" + "n");

  /** Descripción de Campo */
  private CLabel lL = new CLabel("(L) Localidad");

  /** Descripción de Campo */
  private CTextField fOU = new CTextField(20);

  /** Descripción de Campo */
  private CTextField fO = new CTextField(20);

  /** Descripción de Campo */
  private CTextField fL = new CTextField(20);

  /** Descripción de Campo */
  private CLabel lS = new CLabel("(S) Estado/Provincia");

  /** Descripción de Campo */
  private CLabel lC = new CLabel("(C) Pa" + "\u00ed" + "s (2 Car.)");

  /** Descripción de Campo */
  private CTextField fS = new CTextField(20);

  /** Descripción de Campo */
  private CTextField fC = new CTextField(2);

  /** Descripción de Campo */
  private CButton bOK = ConfirmPanel.createOKButton("OK");

  /** Descripción de Campo */
  private CButton bCancel = ConfirmPanel.createCancelButton("Cancelar");

  /** Descripción de Campo */
  private boolean m_ok = false;

  /**
   * Constructor ...
   *
   * @param owner
   * @param cn
   * @param ou
   * @param o
   * @param l
   * @param s
   * @param c
   * @throws HeadlessException
   */
  public KeyStoreDialog(JFrame owner, String cn, String ou, String o, String l, String s, String c)
      throws HeadlessException {

    super(owner, true);
    setTitle("Di" + "\u00e1" + "logo de creaci" + "\u00f3" + "n del certificado (KeyStore)");

    //
    jbInit();
    setValues(cn, ou, o, l, s, c);

    //
    AEnv.showCenterWindow(owner, this);
  } // KeyStoreDialog

  /**
   * Descripción de Método
   *
   * @param e
   */
  public void actionPerformed(ActionEvent e) {

    if (e.getSource() == bOK) {
      m_ok = true;
    }

    dispose();
  } // actionPerformed

  /** Descripción de Método */
  private void jbInit() {

    CPanel panel = new CPanel(new ALayout());

    panel.add(lCN, new ALayoutConstraint(0, 0));
    panel.add(fCN, null);
    panel.add(lOU, new ALayoutConstraint(1, 0));
    panel.add(fOU, null);
    panel.add(lO, new ALayoutConstraint(2, 0));
    panel.add(fO, null);
    panel.add(lL, new ALayoutConstraint(3, 0));
    panel.add(fL, null);
    panel.add(lS, new ALayoutConstraint(4, 0));
    panel.add(fS, null);
    panel.add(lC, new ALayoutConstraint(5, 0));
    panel.add(fC, null);
    panel.setPreferredSize(new Dimension(400, 150));

    //
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(panel, BorderLayout.CENTER);

    //
    CPanel confirmPanel = new CPanel(new FlowLayout(FlowLayout.RIGHT));

    confirmPanel.add(bCancel);
    confirmPanel.add(bOK);
    getContentPane().add(confirmPanel, BorderLayout.SOUTH);

    //
    bCancel.addActionListener(this);
    bOK.addActionListener(this);
  } // jbInit

  // ~--- get methods --------------------------------------------------------

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getC() {
    return fC.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getCN() {
    return fCN.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getL() {
    return fL.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getO() {
    return fO.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getOU() {
    return fOU.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public String getS() {
    return fS.getText();
  }

  /**
   * Descripción de Método
   *
   * @return
   */
  public boolean isOK() {
    return m_ok;
  } // isOK

  // ~--- set methods --------------------------------------------------------

  /**
   * Descripción de Método
   *
   * @param cn
   * @param ou
   * @param o
   * @param l
   * @param s
   * @param c
   */
  public void setValues(String cn, String ou, String o, String l, String s, String c) {

    fCN.setText(cn);
    fOU.setText(ou);
    fO.setText(o);
    fL.setText(l);
    fS.setText(s);
    fC.setText(c);
  } // setValues
} // KeyStoreDialog
示例#2
0
  /**
   * Descripción de Método
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    CompiereColor.setBackground(this);
    panel.setLayout(panelLayout);
    southPanel.setLayout(southLayout);
    mainPanel.setLayout(gridBagLayout);
    panelLayout.setHgap(5);
    panelLayout.setVgap(10);
    fCreateNew.setText(Msg.getMsg(Env.getCtx(), "CreateNew"));
    fX.setColumns(15);
    fY.setColumns(15);
    fZ.setColumns(15);
    lLocator.setLabelFor(fLocator);
    lLocator.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    fWarehouseInfo.setBackground(CompierePLAF.getFieldBackground_Inactive());
    fWarehouseInfo.setReadWrite(false);
    fWarehouseInfo.setColumns(15);
    fValue.setColumns(15);
    lWarehouseInfo.setLabelFor(fWarehouseInfo);
    lWarehouseInfo.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
    lWarehouse.setLabelFor(fWarehouse);
    lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
    lX.setLabelFor(fX);
    lX.setText(Msg.getElement(Env.getCtx(), "X"));
    lY.setLabelFor(fY);
    lY.setText(Msg.getElement(Env.getCtx(), "Y"));
    lZ.setLabelFor(fZ);
    lZ.setText(Msg.getElement(Env.getCtx(), "Z"));
    lValue.setLabelFor(fValue);
    lValue.setText(Msg.translate(Env.getCtx(), "Value"));
    getContentPane().add(panel);
    panel.add(mainPanel, BorderLayout.CENTER);

    //

    mainPanel.add(
        lLocator,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fLocator,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        fCreateNew,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(10, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lWarehouseInfo,
        new GridBagConstraints(
            0,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fWarehouseInfo,
        new GridBagConstraints(
            1,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lWarehouse,
        new GridBagConstraints(
            0,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fWarehouse,
        new GridBagConstraints(
            1,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lX,
        new GridBagConstraints(
            0,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fX,
        new GridBagConstraints(
            1,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lY,
        new GridBagConstraints(
            0,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fY,
        new GridBagConstraints(
            1,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lZ,
        new GridBagConstraints(
            0,
            6,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fZ,
        new GridBagConstraints(
            1,
            6,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));
    mainPanel.add(
        lValue,
        new GridBagConstraints(
            0,
            7,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 5),
            0,
            0));
    mainPanel.add(
        fValue,
        new GridBagConstraints(
            1,
            7,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 0, 0, 5),
            0,
            0));

    //

    panel.add(southPanel, BorderLayout.SOUTH);
    southPanel.add(confirmPanel, BorderLayout.NORTH);
    confirmPanel.addActionListener(this);
  } // jbInit