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"));
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations