Search in sources :

Example 26 with CButton

use of org.compiere.swing.CButton in project adempiere by adempiere.

the class ConfirmPanel method createCustomizeButton.

//	createRefreshButton
/************************
	 *	Create Customize Button wlth label text
	 *  @param text text
	 *  @return button
	 */
public static final CButton createCustomizeButton(String text) {
    AppsAction aa = new AppsAction(A_CUSTOMIZE, null, text);
    CButton button = (CButton) aa.getButton();
    button.setMargin(s_insets);
    return button;
//	Env.getImageIcon("Preference24.gif"));
}
Also used : CButton(org.compiere.swing.CButton)

Example 27 with CButton

use of org.compiere.swing.CButton in project adempiere by adempiere.

the class ConfirmPanel method createNewButton.

//	createNewButton
/**
	 *	Create New Button with label text - F2
	 *  @param text text
	 *  @return Product Attribute Button
	 */
public static final CButton createNewButton(String text) {
    AppsAction aa = new AppsAction(A_NEW, KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), text);
    CButton button = (CButton) aa.getButton();
    button.setMargin(s_insets);
    return button;
}
Also used : CButton(org.compiere.swing.CButton)

Example 28 with CButton

use of org.compiere.swing.CButton in project adempiere by adempiere.

the class ConfirmPanel method createCancelButton.

//	createOKButton
/**
	 *	Create Cancel Button wlth label text and register ESC as KeyStroke
	 *  @param text text
	 *  @return Cancel Button
	 */
public static final CButton createCancelButton(String text) {
    AppsAction aa = new AppsAction(A_CANCEL, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), text);
    CButton button = (CButton) aa.getButton();
    button.setMargin(s_insets);
    return button;
}
Also used : CButton(org.compiere.swing.CButton)

Example 29 with CButton

use of org.compiere.swing.CButton in project adempiere by adempiere.

the class ConfirmPanel method createResetButton.

//	createRefreshButton
/************************
	 *	Create Reset Button wlth label text
	 *  @param text text
	 *  @return button
	 */
public static final CButton createResetButton(String text) {
    AppsAction aa = new AppsAction(A_RESET, null, text);
    CButton button = (CButton) aa.getButton();
    button.setMargin(s_insets);
    return button;
}
Also used : CButton(org.compiere.swing.CButton)

Example 30 with CButton

use of org.compiere.swing.CButton in project adempiere by adempiere.

the class AcctViewer method actionAcctSchema.

//  actionPerformed
/**
	 * 	New Acct Schema
	 */
private void actionAcctSchema() {
    KeyNamePair kp = (KeyNamePair) selAcctSchema.getSelectedItem();
    if (kp == null)
        return;
    m_data.C_AcctSchema_ID = kp.getKey();
    m_data.ASchema = MAcctSchema.get(Env.getCtx(), m_data.C_AcctSchema_ID);
    log.info(m_data.ASchema.toString());
    //
    //  Sort Options
    sortBy1.removeAllItems();
    sortBy2.removeAllItems();
    sortBy3.removeAllItems();
    sortBy4.removeAllItems();
    sortAddItem(new ValueNamePair("", ""));
    sortAddItem(new ValueNamePair("DateAcct", Msg.translate(Env.getCtx(), "DateAcct")));
    sortAddItem(new ValueNamePair("DateTrx", Msg.translate(Env.getCtx(), "DateTrx")));
    sortAddItem(new ValueNamePair("C_Period_ID", Msg.translate(Env.getCtx(), "C_Period_ID")));
    //
    CLabel[] labels = new CLabel[] { lsel1, lsel2, lsel3, lsel4, lsel5, lsel6, lsel7, lsel8 };
    CButton[] buttons = new CButton[] { sel1, sel2, sel3, sel4, sel5, sel6, sel7, sel8 };
    int selectionIndex = 0;
    MAcctSchemaElement[] elements = m_data.ASchema.getAcctSchemaElements();
    for (int i = 0; i < elements.length && selectionIndex < labels.length; i++) {
        MAcctSchemaElement acctSchemaElement = elements[i];
        String columnName = acctSchemaElement.getColumnName();
        String displayColumnName = acctSchemaElement.getDisplayColumnName();
        if (columnName.equals("User1_ID") || columnName.equals("User2_ID") || columnName.equals("User3_ID") || columnName.equals("User4_ID"))
            displayColumnName = acctSchemaElement.getName();
        else
            displayColumnName = acctSchemaElement.getDisplayColumnName();
        //  Add Sort Option
        sortAddItem(new ValueNamePair(columnName, Msg.translate(Env.getCtx(), displayColumnName)));
        //  Additional Elements
        if (!acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Organization) && !acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Account)) {
            labels[selectionIndex].setText(Msg.translate(Env.getCtx(), displayColumnName));
            labels[selectionIndex].setVisible(true);
            buttons[selectionIndex].setActionCommand(columnName);
            buttons[selectionIndex].addActionListener(this);
            buttons[selectionIndex].setIcon(m_iFind);
            buttons[selectionIndex].setText("");
            buttons[selectionIndex].setVisible(true);
            selectionIndex++;
        }
    }
    //	don't show remaining
    while (selectionIndex < labels.length) {
        labels[selectionIndex].setVisible(false);
        buttons[selectionIndex++].setVisible(false);
    }
}
Also used : CLabel(org.compiere.swing.CLabel) KeyNamePair(org.compiere.util.KeyNamePair) ValueNamePair(org.compiere.util.ValueNamePair) CButton(org.compiere.swing.CButton) MAcctSchemaElement(org.compiere.model.MAcctSchemaElement)

Aggregations

CButton (org.compiere.swing.CButton)40 Insets (java.awt.Insets)11 Dimension (java.awt.Dimension)9 AppsAction (org.compiere.apps.AppsAction)6 CPanel (org.compiere.swing.CPanel)5 GridBagConstraints (java.awt.GridBagConstraints)3 ImageIcon (javax.swing.ImageIcon)3 VLookup (org.compiere.grid.ed.VLookup)3 MLookup (org.compiere.model.MLookup)3 BorderLayout (java.awt.BorderLayout)2 Color (java.awt.Color)2 Font (java.awt.Font)2 Timestamp (java.sql.Timestamp)2 HashMap (java.util.HashMap)2 JScrollPane (javax.swing.JScrollPane)2 MigLayout (net.miginfocom.swing.MigLayout)2 VString (org.compiere.grid.ed.VString)2 MImage (org.compiere.model.MImage)2 MPOSKey (org.compiere.model.MPOSKey)2 MPOSKeyLayout (org.compiere.model.MPOSKeyLayout)2