/**
  * Static Constructor
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   this.setJMenuBar(menuBar);
   confirmPanel.setActionListener(
       this); // set it first just to know buttons are working in case something failed
   //
   mEMail.setIcon(Images.getImageIcon2("EMailSupport16"));
   mEMail.setText(msgBL.getMsg(Env.getCtx(), "EMailSupport"));
   mEMail.addActionListener(this);
   mPreference.setIcon(Images.getImageIcon2("Preference16"));
   mPreference.setText(msgBL.getMsg(Env.getCtx(), "Preference"));
   mPreference.addActionListener(this);
   mEnd.setIcon(Images.getImageIcon2("End16"));
   mEnd.setText(msgBL.getMsg(Env.getCtx(), "End"));
   mEnd.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK));
   mEnd.addActionListener(this);
   //
   westPanel.setLayout(westLayout);
   westPanel.setName("westPanel");
   westPanel.setRequestFocusEnabled(false);
   infoPanel.setLayout(infoLayout);
   infoPanel.setName("infoPanel");
   infoPanel.setRequestFocusEnabled(false);
   this.getContentPane().add(confirmPanel, BorderLayout.SOUTH);
   this.getContentPane().add(westPanel, BorderLayout.WEST);
   westPanel.add(
       iconLabel,
       new GridBagConstraints(
           0,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(10, 10, 10, 10),
           0,
           0));
   this.getContentPane().add(infoPanel, BorderLayout.CENTER);
   infoPanel.add(
       info,
       new GridBagConstraints(
           0,
           1,
           1,
           1,
           1.0,
           1.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(10, 10, 10, 10),
           0,
           0));
   //
   menuBar.add(mFile);
   mFile.add(mEMail);
   if (Env.getUserRolePermissions().isShowPreference()) mFile.add(mPreference);
   mFile.addSeparator();
   mFile.add(mEnd);
 } // jbinit
  /**
   * Static Init.
   *
   * <pre>
   *  mainPanel
   *      northPanel
   *      centerPanel
   *          xMatched
   *          xPanel
   *          xMathedTo
   *      southPanel
   *  </pre>
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    mainPanel.setLayout(mainLayout);
    northPanel.setLayout(northLayout);

    southPanel.setLayout(southLayout);
    generate.setText(Msg.translate(Env.getCtx(), "XX_PrintSelectedLabels"));
    generate.setEnabled(true);

    markall.setText(Msg.translate(Env.getCtx(), "XX_CheckAll"));
    markall.setEnabled(true);

    centerPanel.setLayout(centerLayout);
    xProductScrollPane.setBorder(xProductBorder);
    xProductScrollPane.setPreferredSize(new Dimension(1024, 350));

    xPanel.setLayout(xLayout);

    mainPanel.add(northPanel, BorderLayout.NORTH);
    mainPanel.add(southPanel, BorderLayout.SOUTH);
    mainPanel.add(centerPanel, BorderLayout.CENTER);
    centerPanel.add(xProductScrollPane, BorderLayout.CENTER);
    xProductScrollPane.getViewport().add(xProductTable, null);

    southPanel.add(
        markall,
        new GridBagConstraints(
            6,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 12, 5, 12),
            0,
            0));
    southPanel.add(
        generate,
        new GridBagConstraints(
            8,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 12, 5, 12),
            0,
            0));
  } //  jbInit*/
Esempio n. 3
0
  /**
   * Descripción de Método
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    this.setLayout(mainLayout);
    this.add(splitPane, BorderLayout.CENTER);
    splitPane.setOpaque(false);
    graphPanel.setLayout(graphLayout);

    //

    splitPane.add(graphPanel, JSplitPane.LEFT);
    splitPane.add(cardPanel, JSplitPane.RIGHT);
    splitPane.setBorder(null);
    splitPane.setName("gc_splitPane");

    //

    cardPanel.setLayout(cardLayout);
    cardPanel.add(srPane, "srPane"); // Sequence Important!
    cardPanel.add(mrPane, "mrPane");
    cardPanel.setBorder(null);
    cardPanel.setName("gc_cardPanel");

    // single row (w/o xPane it would be centered)

    srPane.setBorder(null);
    srPane.setName("gc_srPane");
    srPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    srPane.add(vPane, JSplitPane.TOP);
    srPane.setTopComponent(vPane);
    vPane.getViewport().add(xPanel, null);
    xPanel.add(vPanel);
    vPane.setBorder(null);
    xPanel.setLayout(xLayout);
    xPanel.setName("gc_xPanel");
    xLayout.setAlignment(FlowLayout.LEFT);
    xLayout.setHgap(0);
    xLayout.setVgap(0);

    // multi-row

    mrPane.setBorder(null);
    mrPane.getViewport().add(vTable, null);
    mrPane.setName("gc_mrPane");

    //

    graphPanel.setBorder(null);
    graphPanel.setName("gc_graphPanel");
    srPane.setDividerLocation(200);
  } // jbInit
Esempio n. 4
0
 /**
  * Static component init.
  *
  * <pre>
  *  - panel
  *      - northPanel
  *          - parameterPanel
  *          - toolBar
  *      - gridController
  *      - confirmPanel
  *  - statusBar
  *  </pre>
  *
  * @throws Exception
  */
 void jbInit() throws Exception {
   // [ 1707303 ] Account Combination Form(VAccountDialog) translation issue
   titledBorder =
       new TitledBorder(
           BorderFactory.createEtchedBorder(Color.white, new Color(134, 134, 134)),
           Msg.getMsg(Env.getCtx(), "Parameter"));
   //
   panelLayout.setHgap(5);
   panelLayout.setVgap(5);
   northLayout.setHgap(5);
   northLayout.setVgap(5);
   //
   parameterPanel.setLayout(parameterLayout);
   parameterPanel.setBorder(titledBorder);
   northPanel.setLayout(northLayout);
   toolBar.setOrientation(JToolBar.VERTICAL);
   toolBar.setBorder(null);
   toolBar.setRequestFocusEnabled(false);
   toolBar.setBorderPainted(false);
   toolBar.setMargin(new Insets(5, 5, 5, 5));
   bSave.setIcon(new ImageIcon(ResourceFinder.getResource("images/Save24.gif")));
   bSave.setMargin(new Insets(2, 2, 2, 2));
   bSave.setToolTipText(Msg.getMsg(Env.getCtx(), "AccountNewUpdate"));
   bSave.addActionListener(this);
   bRefresh.setIcon(new ImageIcon(ResourceFinder.getResource("images/Refresh24.gif")));
   bRefresh.setMargin(new Insets(2, 2, 2, 2));
   bRefresh.setToolTipText(Msg.getMsg(Env.getCtx(), "Refresh"));
   bRefresh.addActionListener(this);
   bIgnore.setIcon(new ImageIcon(ResourceFinder.getResource("images/Ignore24.gif")));
   bIgnore.setMargin(new Insets(2, 2, 2, 2));
   bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(), "Ignore"));
   bIgnore.addActionListener(this);
   //
   toolBar.addSeparator();
   toolBar.add(bRefresh, null);
   toolBar.add(bIgnore, null);
   toolBar.add(bSave, null);
   //
   getContentPane().add(panel);
   panel.setLayout(panelLayout);
   panel.add(confirmPanel, BorderLayout.SOUTH);
   panel.add(northPanel, BorderLayout.NORTH);
   northPanel.add(parameterPanel, BorderLayout.CENTER);
   northPanel.add(toolBar, BorderLayout.EAST);
   //
   this.getContentPane().add(statusBar, BorderLayout.SOUTH);
   confirmPanel.addActionListener(this);
 } //	jbInit
Esempio n. 5
0
  private void init() {
    CPanel panel = new CPanel();
    panel.setLayout(new MigLayout());
    getContentPane().add(panel);

    panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "SalesRep_ID")));

    username =
        new PosTextField(
            Msg.translate(posPanel.getCtx(), "SalesRep_ID"),
            posPanel,
            posPanel.p_pos.getOSK_KeyLayout_ID());

    panel.add(username, "wrap");

    panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "UserPIN")));

    pin =
        new PosTextField(
            Msg.translate(posPanel.getCtx(), "UserPIN"),
            posPanel,
            posPanel.p_pos.getOSNP_KeyLayout_ID());

    panel.add(pin, "");

    AppsAction act = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false);
    act.setDelegate(this);
    bProcess = (CButton) act.getButton();
    bProcess.setFocusable(false);
    panel.add(bProcess, "h 50!, w 50!");

    pack();
  }
 /**
  * Static Init
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   mainPanel.setLayout(mainLayout);
   this.getContentPane().add(mainPanel, BorderLayout.CENTER);
   //	North
   northPanel.setLayout(new ALayout());
   northPanel.add(showAll, new ALayoutConstraint(0, 0));
   showAll.addActionListener(this);
   this.getContentPane().add(northPanel, BorderLayout.NORTH);
   //	Center
   mainPanel.add(centerScrollPane, BorderLayout.CENTER);
   centerScrollPane.getViewport().add(m_table, null);
   //	South
   mainPanel.add(confirmPanel, BorderLayout.SOUTH);
   mainPanel.setPreferredSize(new Dimension(SCREEN_WIDTH, SCREEN_HEIGHT));
   confirmPanel.addActionListener(this);
 }
 /**
  * Layout
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   this.getContentPane().setLayout(mainLayout);
   this.getContentPane().add(centerPanel, BorderLayout.CENTER);
   this.getContentPane().add(confirmPanel, BorderLayout.SOUTH);
   centerPanel.setLayout(centerLayout);
   //
   confirmPanel.setActionListener(this);
 } // jbInit
Esempio n. 8
0
  /**
   * Static component init
   *
   * @throws Exception
   */
  void jbInit() throws Exception {
    panel.setLayout(panelLayout);
    southPanel.setLayout(southLayout);
    mainPanel.setLayout(gridBagLayout);
    panelLayout.setHgap(5);
    panelLayout.setVgap(10);
    getContentPane().add(panel);
    panel.add(mainPanel, BorderLayout.NORTH);
    panel.add(southPanel, BorderLayout.SOUTH);
    southPanel.add(confirmPanel, BorderLayout.CENTER);

    toLink.setText(TO_LINK);
    toLink.addActionListener(this);
    toLink.setMargin(ConfirmPanel.s_insets);
    confirmPanel.addComponent(toLink);

    toRoute.setText(TO_ROUTE);
    toRoute.addActionListener(this);
    toRoute.setMargin(ConfirmPanel.s_insets);
    confirmPanel.addComponent(toRoute);

    getAddress.setText("Procurar");
    getAddress.addActionListener(this);
    getAddress.setMargin(ConfirmPanel.s_insets);
    confirmPanel.addComponent(getAddress);
    //

    fAddress1.setMandatory(
        new MColumn(Env.getCtx(), MColumn.getColumn_ID("C_Location", "Address1"), null)
            .isMandatory());
    fAddress2.setMandatory(
        new MColumn(Env.getCtx(), MColumn.getColumn_ID("C_Location", "Address2"), null)
            .isMandatory());
    fAddress3.setMandatory(
        new MColumn(Env.getCtx(), MColumn.getColumn_ID("C_Location", "Address3"), null)
            .isMandatory());
    fAddress4.setMandatory(
        new MColumn(Env.getCtx(), MColumn.getColumn_ID("C_Location", "Address4"), null)
            .isMandatory());
    fPostal.setMandatory(
        new MColumn(Env.getCtx(), MColumn.getColumn_ID("C_Location", "Postal"), null)
            .isMandatory());

    confirmPanel.addActionListener(this);
  } //	jbInit
Esempio n. 9
0
 /**
  * This method initializes cCustomerDataPanel
  *
  * @return org.compiere.swing.CPanel
  */
 private CPanel getCCustomerDataPanel() {
   if (cCustomerDataPanel == null) {
     GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
     gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL;
     gridBagConstraints5.gridy = 2;
     gridBagConstraints5.weightx = 1.0;
     gridBagConstraints5.anchor = java.awt.GridBagConstraints.WEST;
     gridBagConstraints5.insets = new java.awt.Insets(7, 5, 0, 0);
     gridBagConstraints5.gridx = 1;
     GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
     gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL;
     gridBagConstraints4.gridy = 1;
     gridBagConstraints4.weightx = 1.0;
     gridBagConstraints4.anchor = java.awt.GridBagConstraints.WEST;
     gridBagConstraints4.insets = new java.awt.Insets(7, 5, 0, 0);
     gridBagConstraints4.gridx = 1;
     GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
     gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
     gridBagConstraints3.gridy = 0;
     gridBagConstraints3.weightx = 1.0;
     gridBagConstraints3.insets = new java.awt.Insets(0, 5, 0, 0);
     gridBagConstraints3.gridx = 1;
     GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
     gridBagConstraints2.gridx = 0;
     gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
     gridBagConstraints2.insets = new java.awt.Insets(7, 0, 0, 0);
     gridBagConstraints2.gridy = 2;
     cAddressLabel = new CLabel();
     cAddressLabel.setText(MSG_ADDRESS);
     GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
     gridBagConstraints1.gridx = 0;
     gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
     gridBagConstraints1.insets = new java.awt.Insets(7, 0, 0, 0);
     gridBagConstraints1.gridy = 1;
     cIdentificationLabel = new CLabel();
     cIdentificationLabel.setText(MSG_CUSTOMER_IDENTIFICATION_NUMBER);
     GridBagConstraints gridBagConstraints = new GridBagConstraints();
     gridBagConstraints.gridx = 0;
     gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
     gridBagConstraints.gridy = 0;
     cNameLabel = new CLabel();
     cNameLabel.setText(MSG_NAME);
     cCustomerDataPanel = new CPanel();
     cCustomerDataPanel.setLayout(new GridBagLayout());
     cCustomerDataPanel.setBorder(
         javax.swing.BorderFactory.createCompoundBorder(
             javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED),
             javax.swing.BorderFactory.createEmptyBorder(0, 5, 5, 5)));
     cCustomerDataPanel.add(cNameLabel, gridBagConstraints);
     cCustomerDataPanel.add(cIdentificationLabel, gridBagConstraints1);
     cCustomerDataPanel.add(cAddressLabel, gridBagConstraints2);
     cCustomerDataPanel.add(getCNameText(), gridBagConstraints3);
     cCustomerDataPanel.add(getCIdentificationText(), gridBagConstraints4);
     cCustomerDataPanel.add(getCAddressText(), gridBagConstraints5);
   }
   return cCustomerDataPanel;
 }
Esempio n. 10
0
 /**
  * This method initializes cCustomerDataPanel
  *
  * @return org.compiere.swing.CPanel
  */
 private CPanel getCMainPanel() {
   if (cMainPanel == null) {
     cMainPanel = new CPanel();
     cMainPanel.setLayout(new BorderLayout());
     cMainPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
     cMainPanel.add(getCCmdPanel(), java.awt.BorderLayout.EAST);
     cMainPanel.add(getCCustomerDataPanel(), java.awt.BorderLayout.CENTER);
   }
   return cMainPanel;
 }
Esempio n. 11
0
 /**
  * Static Init
  *
  * @throws Exception
  */
 void jbInit() throws Exception {
   mainPanel.setLayout(mainLayout);
   mainLayout.setHgap(2);
   mainLayout.setVgap(2);
   infoPane.setBorder(BorderFactory.createLoweredBevelBorder());
   infoPane.setPreferredSize(new Dimension(500, 400));
   getContentPane().add(mainPanel);
   mainPanel.add(infoPane, BorderLayout.CENTER);
   mainPanel.add(confirmPanel, BorderLayout.SOUTH);
   infoPane.getViewport().add(info, null);
   confirmPanel.addActionListener(this);
 } //	jbInit
  private void init(Window owner, String title, String htmlText, boolean editable) {
    if (title == null) setTitle(Msg.getMsg(Env.getCtx(), "Editor"));
    else setTitle(title);

    // General Layout
    final CPanel mainPanel = new CPanel();
    mainPanel.setLayout(new BorderLayout());
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    mainPanel.add(editor, BorderLayout.CENTER);
    editor.setPreferredSize(new Dimension(600, 600));
    mainPanel.add(confirmPanel, BorderLayout.SOUTH);
    confirmPanel.setActionListener(this);
    //
    setHtmlText(htmlText);
  } // init
Esempio n. 13
0
  /**
   * Add Product
   *
   * @param element panel
   * @param product product
   */
  private void addProduct(CPanel element, MProduct product) {
    Insets ii = new Insets(2, 4, 2, 4);
    int M_Product_ID = product.getM_Product_ID();
    CPanel pe = new CPanel();
    pe.setBorder(BorderFactory.createLineBorder(Color.BLUE, 1));
    pe.setLayout(new GridBagLayout());

    //	Product Value - Price
    pe.add(
        new JLabel(product.getValue()),
        new GridBagConstraints(
            0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, ii, 0, 0));
    String formatted = "";
    if (m_M_PriceList_Version_ID != 0) {
      MProductPrice pp =
          MProductPrice.get(Env.getCtx(), m_M_PriceList_Version_ID, M_Product_ID, null);
      if (pp != null) {
        BigDecimal price = pp.getPriceStd();
        formatted = m_price.format(price);
      } else formatted = "-";
    }
    pe.add(
        new JLabel(formatted, JLabel.RIGHT),
        new GridBagConstraints(
            1, 0, 1, 1, .5, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, ii, 0, 0));

    //	Product Name - Qty
    pe.add(
        new JLabel(product.getName()),
        new GridBagConstraints(
            0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, ii, 0, 0));
    formatted = "";
    if (m_M_Warehouse_ID != 0) {
      BigDecimal qty = MStorage.getQtyAvailable(m_M_Warehouse_ID, M_Product_ID, 0, null);
      if (qty == null) formatted = "-";
      else formatted = m_qty.format(qty);
    }
    pe.add(
        new JLabel(formatted, JLabel.RIGHT),
        new GridBagConstraints(
            1, 1, 1, 1, .5, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, ii, 0, 0));
    //
    element.add(pe);
  } //	addProduct
  private CPanel generateInstalledSoftPanel() {
    CPanel panel = new CPanel();
    panel.setLayout(new BorderLayout());
    // Installed apps
    installedAppsList = new BasicEventList<IUnitModel>();
    FilterList<IUnitModel> installedFilterList = new FilterList<IUnitModel>(installedAppsList);
    EventTableModel<IUnitModel> installedTableModel =
        new EventTableModel<IUnitModel>(installedFilterList, new IUnitTableFormat());
    table = new JTable(installedTableModel);
    panel.add(new JScrollPane(table), BorderLayout.CENTER);

    CPanel btnPanel = new CPanel();
    panel.add(btnPanel, BorderLayout.SOUTH);

    updateBtn = new CButton(Msg.getMsg(Env.getAD_Language(ctx), "Update"));
    updateBtn.addActionListener(this);
    btnPanel.add(updateBtn);

    return panel;
  }
Esempio n. 15
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
  /**
   * Static Init.
   *
   * <pre>
   *  mainPanel
   *      northPanel
   *      centerPanel
   *          xMatched
   *          xPanel
   *          xMathedTo
   *      southPanel
   *  </pre>
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    mainPanel.setLayout(mainLayout);
    northPanel.setLayout(northLayout);

    // LineRefProv_Label.setText(Msg.getMsg(Env.getCtx(), "RecordNo",new String[]
    // {""+LineRefProv.getXX_VMR_PO_LineRefProv_ID()}));
    LineRefProv_Label.setText("");
    southPanel.setLayout(southLayout);
    bNewProduct.setText(Msg.translate(Env.getCtx(), "NewProduct"));
    bNewProduct.setEnabled(true);
    bDisassociate.setText(Msg.translate(Env.getCtx(), "Disassociate"));
    bDisassociate.setEnabled(false);
    centerPanel.setLayout(centerLayout);
    xProductScrollPane.setBorder(xProductBorder);
    xProductScrollPane.setPreferredSize(new Dimension(450, 150));
    xAssociateScrollPane.setBorder(xAssociateBorder);
    xAssociateScrollPane.setPreferredSize(new Dimension(450, 58));

    xPanel.setLayout(xLayout);
    mainPanel.add(northPanel, BorderLayout.NORTH);
    northPanel.add(
        LineRefProv_Label,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 12, 5, 5),
            0,
            0));

    mainPanel.add(southPanel, BorderLayout.SOUTH);

    mainPanel.add(centerPanel, BorderLayout.CENTER);
    centerPanel.add(xProductScrollPane, BorderLayout.NORTH);
    xProductScrollPane.getViewport().add(xProductTable, null);
    centerPanel.add(xAssociateScrollPane, BorderLayout.SOUTH);
    centerPanel.add(xPanel, BorderLayout.CENTER);
    xAssociateScrollPane.getViewport().add(xAssociateTable, null);

    southPanel.add(
        bDisassociate,
        new GridBagConstraints(
            2,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 12, 5, 12),
            0,
            0));
    southPanel.add(
        bNewProduct,
        new GridBagConstraints(
            8,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 12, 5, 12),
            0,
            0));
  } //  jbInit
Esempio n. 17
0
 /**
  * Static Init
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   CompiereColor.setBackground(panel);
   newBorder = new TitledBorder("");
   accountBorder = new TitledBorder("");
   mainPanel.setLayout(mainLayout);
   newPanel.setBorder(newBorder);
   newPanel.setLayout(newLayout);
   newBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeNewAccount"));
   valueLabel.setText(Msg.translate(Env.getCtx(), "Value"));
   isExpense.setSelected(true);
   isExpense.setText(Msg.getMsg(Env.getCtx(), "Expense"));
   nameLabel.setText(Msg.translate(Env.getCtx(), "Name"));
   nameField.setColumns(20);
   valueField.setColumns(10);
   newButton.setText(
       Msg.getMsg(Env.getCtx(), "Create") + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
   newButton.addActionListener(this);
   accountPanel.setBorder(accountBorder);
   accountPanel.setLayout(accountLayout);
   accountBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeFromAccount"));
   accountButton.setText(
       Msg.getMsg(Env.getCtx(), "Create")
           + " "
           + Msg.getMsg(Env.getCtx(), "From")
           + " "
           + Msg.getElement(Env.getCtx(), "Account_ID"));
   accountButton.addActionListener(this);
   accountOKPanel.setLayout(accountOKLayout);
   accountOKLayout.setAlignment(FlowLayout.RIGHT);
   confirmPanel.setActionListener(this);
   //
   mainPanel.add(newPanel, BorderLayout.NORTH);
   newPanel.add(
       valueLabel,
       new GridBagConstraints(
           0,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.EAST,
           GridBagConstraints.NONE,
           new Insets(5, 5, 5, 5),
           0,
           0));
   newPanel.add(
       valueField,
       new GridBagConstraints(
           1,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.WEST,
           GridBagConstraints.NONE,
           new Insets(5, 0, 5, 5),
           0,
           0));
   newPanel.add(
       nameLabel,
       new GridBagConstraints(
           0,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.EAST,
           GridBagConstraints.NONE,
           new Insets(5, 5, 5, 5),
           0,
           0));
   newPanel.add(
       nameField,
       new GridBagConstraints(
           1,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.WEST,
           GridBagConstraints.NONE,
           new Insets(5, 0, 5, 5),
           0,
           0));
   newPanel.add(
       isExpense,
       new GridBagConstraints(
           2,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.WEST,
           GridBagConstraints.NONE,
           new Insets(5, 5, 5, 5),
           0,
           0));
   newPanel.add(
       newButton,
       new GridBagConstraints(
           2,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(5, 5, 5, 5),
           0,
           0));
   mainPanel.add(accountPanel, BorderLayout.CENTER);
   accountPanel.add(accountOKPanel, BorderLayout.SOUTH);
   accountOKPanel.add(accountButton, null);
   accountPanel.add(dataPane, BorderLayout.CENTER);
   dataPane.getViewport().add(dataTable, null);
 } //  jbInit
Esempio n. 18
0
  /**
   * Descripción de Método
   *
   * @throws Exception
   */
  private void jbInit() throws Exception {
    CompiereColor.setBackground(this);
    this.setIconImage(Env.getImage("mReport.gif"));
    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    //

    northPanel.setLayout(northLayout);
    this.getContentPane().add(northPanel, BorderLayout.NORTH);
    northPanel.add(toolBar, BorderLayout.EAST);
    this.getContentPane().add(centerScrollPane, BorderLayout.CENTER);
    centerScrollPane.getViewport().add(m_viewPanel, null);

    centerScrollPane.getVerticalScrollBar().setUnitIncrement(20);
    centerScrollPane.getHorizontalScrollBar().setUnitIncrement(20);

    this.getContentPane().add(statusBar, BorderLayout.SOUTH);

    // ToolBar

    this.setJMenuBar(menuBar);

    // Page Control

    toolBar.add(bPrevious);
    toolBar.add(spinner);
    spinner.setToolTipText(Msg.getMsg(m_ctx, "GoToPage"));
    toolBar.add(bNext);

    // Zoom Level

    toolBar.addSeparator();

    //              toolBar.add(comboZoom, null);
    //              comboZoom.setToolTipText(Msg.getMsg(m_ctx, "Zoom"));
    // Drill

    toolBar.addSeparator();
    labelDrill.setText(Msg.getMsg(m_ctx, "Drill") + ": ");
    toolBar.add(labelDrill);
    toolBar.add(comboDrill);
    comboDrill.setToolTipText(Msg.getMsg(m_ctx, "Drill"));

    // Format, Customize, Find

    toolBar.addSeparator();
    toolBar.add(comboReport);
    comboReport.setToolTipText(Msg.translate(m_ctx, "AD_PrintFormat_ID"));
    toolBar.add(bCustomize);
    bCustomize.setToolTipText(Msg.getMsg(m_ctx, "PrintCustomize"));
    toolBar.add(bFind);
    bFind.setToolTipText(Msg.getMsg(m_ctx, "Find"));
    toolBar.addSeparator();

    // Print/Export

    toolBar.add(bPrint);
    toolBar.addSeparator();
    toolBar.add(bPageSetup);
    bPageSetup.setToolTipText(Msg.getMsg(m_ctx, "PageSetup"));
    toolBar.add(bSendMail);
    toolBar.add(bArchive);

    if (m_isCanExport) {
      bExport.setToolTipText(Msg.getMsg(m_ctx, "Export"));
      toolBar.add(bExport);
    }

    // End

    toolBar.addSeparator();
    toolBar.add(bEnd, null);
    bEnd.setToolTipText(Msg.getMsg(m_ctx, "End"));
  } // jbInit
  // organizacion de la forma
  private void jbInit() throws Exception {
    /*
     * Valores de las etiquetas
     * */
    monthLabel.setText(Msg.getMsg(Env.getCtx(), "Month"));
    yearLabel.setText(Msg.getMsg(Env.getCtx(), "Year"));
    categoryLabel.setText(Msg.getMsg(Env.getCtx(), "XX_Category"));
    agreementTypeLabel.setText(Msg.getMsg(Env.getCtx(), "XX_TradeAgreementType"));
    departmentLabel.setText(Msg.translate(Env.getCtx(), "XX_Department_I"));
    vendorLabel.setText(Msg.translate(Env.getCtx(), "VendorCod"));

    // Ubicacion del boton de Busqueda (panel superior)
    mainPanel.setLayout(mainLayout);
    northPanel.setLayout(northLayout);
    bSearch.setText(Msg.translate(Env.getCtx(), "XX_Search"));

    bReset.setText(Msg.translate(Env.getCtx(), "Reset"));

    // bSearch.setPreferredSize(new Dimension(100,30));
    bSearch.setEnabled(true);
    xPanel.setLayout(xLayout);

    dateLabel.setText(Msg.translate(Env.getCtx(), "Date"));
    bReset.addActionListener(this);

    // Ubicacion de botones Cancelar y Generar nota de credito (Panel Inferior)
    southPanel.setLayout(southLayout);

    centerPanel.setLayout(centerLayout);
    xScrollPaneACC.setBorder(xBorder);
    xScrollPaneACC.setPreferredSize(new Dimension(960, 220));
    xScrollPaneAAP.setBorder(xBorderAAP);
    xScrollPaneAAP.setPreferredSize(new Dimension(960, 220));
    xScrollPaneDetails.setBorder(xBorderDetails);
    xScrollPaneDetails.setPreferredSize(new Dimension(960, 220));

    xPanel.setLayout(xLayout);

    // Panel Superior search
    northPanel.add(
        bSearch,
        new GridBagConstraints(
            2,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0, 12, 5, 12),
            0,
            0));
    northPanel.add(
        bReset,
        new GridBagConstraints(
            3,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 12, 5, 12),
            0,
            0));

    /*
     * Combos y labels de la 1era línea
     * */
    northPanel.add(
        monthLabel,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 5, 5, 5),
            0,
            0));
    northPanel.add(
        monthCombo,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 0),
            0,
            0));
    northPanel.add(
        yearLabel,
        new GridBagConstraints(
            2,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 5, 5, 5),
            0,
            0));
    northPanel.add(
        yearField,
        new GridBagConstraints(
            3,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 0),
            0,
            0));
    northPanel.add(
        categoryLabel,
        new GridBagConstraints(
            4,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 5, 5, 5),
            0,
            0));
    northPanel.add(
        categoryCombo,
        new GridBagConstraints(
            5,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 0),
            0,
            0));

    /*
     * Combos y labels de la 2da línea
     */
    northPanel.add(
        departmentLabel,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 5, 5, 5),
            0,
            0));
    northPanel.add(
        departmentCombo,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 0),
            0,
            0));
    northPanel.add(
        vendorLabel,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(12, 5, 5, 5),
            0,
            0));
    northPanel.add(
        comboBPartner,
        new GridBagConstraints(
            3,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 0),
            0,
            0));

    mainPanel.add(northPanel, BorderLayout.NORTH);
    // mainPanel.add(southPanel,  BorderLayout.SOUTH);
    mainPanel.add(centerPanel, BorderLayout.CENTER);

    southPanel.add(
        xScrollPaneACC,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            8,
            7,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(12, 0, 5, 0),
            5,
            5));

    southPanel.add(
        totalPurchaseACC,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 250),
            0,
            0));

    southPanel.add(
        xScrollPaneAAP,
        new GridBagConstraints(
            0,
            4,
            1,
            1,
            8,
            7,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(12, 0, 5, 0),
            5,
            5));

    southPanel.add(
        totalPurchaseAAP,
        new GridBagConstraints(
            0,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(12, 0, 5, 250),
            0,
            0));

    southPanel.add(
        xScrollPaneDetails,
        new GridBagConstraints(
            0,
            8,
            1,
            1,
            8,
            7,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(12, 0, 5, 0),
            5,
            5));

    xScrollPaneACC.getViewport().add(xTableACC, null);
    xScrollPaneAAP.getViewport().add(xTableAAP, null);
    xScrollPaneDetails.getViewport().add(xTableDetails, null);

    centerPanel.add(southPanel);
  } //  jbInit
Esempio n. 20
0
  /**
   * Descripción de Método
   *
   * @throws Exception
   */
  void jbInit() throws Exception {
    CompiereColor.setBackground(this);
    mainPanel.setLayout(mainLayout);
    mainLayout.setHgap(5);
    mainLayout.setVgap(5);
    this.getContentPane().add(mainPanel);
    northPanel.setLayout(northLayout);
    northPanel.add(toolBar, BorderLayout.CENTER);
    toolBar.add(bLoad);
    toolBar.add(bDelete);
    toolBar.add(bSave);
    toolBar.add(bOpen);
    toolBar.add(cbContent);
    mainPanel.add(northPanel, BorderLayout.NORTH);

    //

    bOpen.setEnabled(false);
    bOpen.setIcon(Env.getImageIcon("Editor24.gif"));
    bOpen.setMargin(new Insets(0, 2, 0, 2));
    bOpen.setToolTipText(Msg.getMsg(Env.getCtx(), "Open"));
    bOpen.addActionListener(this);

    //

    bSave.setEnabled(false);
    bSave.setIcon(Env.getImageIcon("Export24.gif"));
    bSave.setMargin(new Insets(0, 2, 0, 2));
    bSave.setToolTipText(Msg.getMsg(Env.getCtx(), "AttachmentSave"));
    bSave.addActionListener(this);

    //

    bLoad.setIcon(Env.getImageIcon("Import24.gif"));
    bLoad.setMargin(new Insets(0, 2, 0, 2));
    bLoad.setToolTipText(Msg.getMsg(Env.getCtx(), "Load"));
    bLoad.addActionListener(this);

    //

    bDelete.setIcon(Env.getImageIcon("Delete24.gif"));
    bDelete.setMargin(new Insets(0, 2, 0, 2));
    bDelete.setToolTipText(Msg.getMsg(Env.getCtx(), "Delete"));
    bDelete.addActionListener(this);

    //

    Dimension size = cbContent.getPreferredSize();

    size.width = 200;
    cbContent.setPreferredSize(size);

    // cbContent.setToolTipText(text);

    cbContent.addActionListener(this);
    cbContent.setLightWeightPopupEnabled(false); // Acrobat Panel is heavy

    //

    text.setBackground(CompierePLAF.getInfoBackground());
    text.setPreferredSize(new Dimension(200, 200));

    //

    mainPanel.add(confirmPanel, BorderLayout.SOUTH);
    confirmPanel.addActionListener(this);
    bDeleteAll = ConfirmPanel.createDeleteButton(true);
    confirmPanel.addButton(bDeleteAll);
    bDeleteAll.addActionListener(this);

    //

    info.setText("-");
    info.setReadWrite(false);
    graphPanel.add(info, BorderLayout.CENTER);

    //

    mainPanel.add(centerPane, BorderLayout.CENTER);
    centerPane.add(graphPanel, JSplitPane.LEFT);
    centerPane.add(text, JSplitPane.RIGHT);
    centerPane.setResizeWeight(.75); // more to graph
  } // jbInit
Esempio n. 21
0
  void jbInit() throws Exception {

    // criando os labels
    executar.setText("Executar(F5)");
    executar.setToolTipText("Executa Comando SQL");
    exportar.setText("Exportar");
    exportar.setToolTipText("Exporta Consulta para arquivo CSV");

    // /adicionando as bordas
    painelSuperior.setBorder(BorderFactory.createTitledBorder("COMANDO SQL"));
    painelInferior.setBorder(BorderFactory.createTitledBorder("ERROS"));
    scrollPane.setBorder(BorderFactory.createTitledBorder("RESULTADO"));
    painelPrincipal.setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize());
    caixaLista.setPreferredSize(new Dimension(100, 20));

    // layout do painel

    painelPrincipal.setLayout(borderLayout);
    painelSuperior.setLayout(gridBaglayout);
    painelInferior.setLayout(gridBaglayout);
    painelSuperiorDireito.setLayout(gridBaglayout);
    painelSuperiorEsquerdo.setLayout(gridBaglayout);
    painelPrincipal.add(scrollPane, BorderLayout.CENTER);
    painelPrincipal.add(painelSuperior, BorderLayout.NORTH);
    painelPrincipal.add(painelInferior, BorderLayout.SOUTH);

    painelSuperior.add(
        painelSuperiorEsquerdo,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    painelSuperior.add(
        painelSuperiorDireito,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    painelSuperior.add(
        caixaLista,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));

    // adicionando paineis no painel principal

    painelSuperiorEsquerdo.add(
        barraRolagem,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    painelSuperiorDireito.add(
        executar,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));

    painelSuperiorDireito.add(
        exportar,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));

    // ////////////////////Panel inferio
    painelInferior.add(
        erroSQL,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));

    // adicionando componentes no painel

    barraRolagem.getViewport().add(comandoSQL, null);
    // comandoSQL.setEditable(false);

    erroSQL.setEnabled(false);
    // adicionando componentes eventos variados

    painelPrincipal.addKeyListener(this);
    executar.addActionListener(this);
    exportar.addActionListener(this);
    comandoSQL.addKeyListener(this);
    caixaLista.addItemListener(this);

    painelPrincipal.repaint();
  }
Esempio n. 22
0
  /**
   * Get Grid Element
   *
   * @param xValue X value
   * @param yValue Y value
   * @return Panel with Info
   */
  private CPanel getGridElement(MAttributeValue xValue, MAttributeValue yValue) {
    CPanel element = new CPanel();
    element.setBorder(BorderFactory.createLineBorder(Color.BLACK, 2));
    element.setLayout(new BoxLayout(element, BoxLayout.Y_AXIS));

    String sql = "SELECT * FROM M_Product WHERE IsActive='Y'";
    //	Product Attributes
    if (xValue != null)
      sql +=
          " AND M_AttributeSetInstance_ID IN "
              + "(SELECT M_AttributeSetInstance_ID "
              + "FROM M_AttributeInstance "
              + "WHERE M_Attribute_ID="
              + xValue.getM_Attribute_ID()
              + " AND M_AttributeValue_ID="
              + xValue.getM_AttributeValue_ID()
              + ")";
    if (yValue != null)
      sql +=
          " AND M_AttributeSetInstance_ID IN "
              + "(SELECT M_AttributeSetInstance_ID "
              + "FROM M_AttributeInstance "
              + "WHERE M_Attribute_ID="
              + yValue.getM_Attribute_ID()
              + " AND M_AttributeValue_ID="
              + yValue.getM_AttributeValue_ID()
              + ")";
    sql = MRole.getDefault().addAccessSQL(sql, "M_Product", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
    PreparedStatement pstmt = null;
    int noProducts = 0;
    try {
      pstmt = DB.prepareStatement(sql, null);
      ResultSet rs = pstmt.executeQuery();
      while (rs.next()) {
        MProduct product = new MProduct(Env.getCtx(), rs, null);
        addProduct(element, product);
        noProducts++;
      }
      rs.close();
      pstmt.close();
      pstmt = null;
    } catch (Exception e) {
      log.log(Level.SEVERE, sql, e);
    }
    try {
      if (pstmt != null) pstmt.close();
      pstmt = null;
    } catch (Exception e) {
      pstmt = null;
    }

    int mode = modeCombo.getSelectedIndex();
    //	No Products
    if (noProducts == 0 && mode == MODE_VIEW) {
      //	CButton button = ConfirmPanel.createNewButton(true);
      //	button.addActionListener(this);
      //	element.add(button);
    } else //	Additional Elements
    {
      if (mode == MODE_PRICE) {
        //	Price Field
      } else if (mode == MODE_PO) {
        //	Qty Field
      }
    }
    return element;
  } //	getGridElement
  private CPanel generateRepositoriesPanel() {
    CPanel panel = new CPanel();
    panel.setLayout(new BorderLayout());

    CPanel topPanel = new CPanel();
    topPanel.setLayout(new GridBagLayout());
    panel.add(topPanel, BorderLayout.NORTH);

    locationsCombo = new CComboBox(P2.get().getRepositories());
    locationsCombo.addActionListener(this);
    locationLabel.setText(Msg.translate(Env.getCtx(), "Repositories"));
    locationLabel.setLabelFor(locationsCombo);

    topPanel.add(
        locationLabel,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(2, 2, 2, 2),
            0,
            0));
    topPanel.add(
        locationsCombo,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.3,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 20),
            0,
            0));

    repositoryBtn = new CButton(Msg.getMsg(ctx, "Manage Repositories"));
    repositoryBtn.addActionListener(this);

    topPanel.add(
        repositoryBtn,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(10, 1, 2, 100),
            0,
            0));

    CPanel tablePanel = new CPanel();
    panel.add(tablePanel, BorderLayout.CENTER);

    // Available iu
    repoAppsList = new BasicEventList<IUnitModel>();
    FilterList<IUnitModel> repoFilterList = new FilterList<IUnitModel>(repoAppsList);
    EventTableModel<IUnitModel> tepoTableModel =
        new EventTableModel<IUnitModel>(repoFilterList, new IUnitTableFormat());
    table = new JTable(tepoTableModel);
    tablePanel.add(new JScrollPane(table));

    CPanel btnPanel = new CPanel();
    panel.add(btnPanel, BorderLayout.SOUTH);

    installBtn = new CButton(Msg.getMsg(Env.getAD_Language(ctx), "Install"));
    installBtn.addActionListener(this);
    btnPanel.add(installBtn);

    return panel;
  }