use of org.compiere.swing.CButton in project adempiere by adempiere.
the class POSSubPanel method createButtonAction.
// dispose
/**
* Create Action Button
* @param action action
* @return button
*/
protected CButton createButtonAction(String action, KeyStroke accelerator) {
String acceleratorText = "";
if (action != null && accelerator != null) {
if (accelerator != null) {
int modifiers = accelerator.getModifiers();
if (modifiers >= 0) {
acceleratorText = "(" + KeyEvent.getKeyModifiersText(modifiers);
//acceleratorText += "+";
}
acceleratorText += KeyEvent.getKeyText(accelerator.getKeyCode());
}
posPanel.addStatusBarInfo(action + acceleratorText + ")");
}
//AppsAction(action, accelerator, false);
AppsAction act = new AppsAction(action, accelerator, acceleratorText, false);
act.setDelegate(this);
CButton button = (CButton) act.getButton();
button.setPreferredSize(new Dimension(WIDTH, HEIGHT));
button.setMinimumSize(new Dimension(WIDTH, HEIGHT));
button.setMaximumSize(new Dimension(WIDTH, HEIGHT));
return button;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class POSUserPinListener method doPerformAction.
protected void doPerformAction(ActionEvent actionEvent) {
if (!"KeyEvent".equals(actionEvent.getActionCommand().toString()) || !actionEvent.getActionCommand().toString().equals("Cancel"))
return;
Object objectSource = actionEvent.getSource();
VNumber number = null;
CButton button = null;
if (objectSource instanceof VNumber)
number = (VNumber) objectSource;
if (objectSource instanceof CButton)
button = (CButton) objectSource;
if (!pos.isRequiredPIN())
return;
if (//Number field validation
(number != null && (Msg.translate(Env.getCtx(), "Discount").equals(number.getName()) || Msg.translate(Env.getCtx(), "PriceActual").equals(number.getName())) || //Button validation
(button != null && ("Cancel".equals(button.getName()))))) {
POSUserPinDialog.show(pos);
}
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class AdempierePLAF method getCancelButton.
// getOKButton
/**
* Create Cancel Button
* @return Cancel button
*/
public static CButton getCancelButton() {
CButton b = new CButton();
b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Cancel24.gif")));
b.setMargin(new Insets(0, 10, 0, 10));
b.setToolTipText(s_res.getString("Cancel"));
return b;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class AdempierePLAF method getOKButton.
/**
* Create OK Button
* @return OK button
*/
public static CButton getOKButton() {
CButton b = new CButton();
b.setIcon(new ImageIcon(AdempierePLAF.class.getResource("icons/Ok24.gif")));
b.setMargin(new Insets(0, 10, 0, 10));
b.setToolTipText(s_res.getString("OK"));
return b;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class ConfirmPanel method createExportButton.
// createHelpButton
/************************
* Create Export Button wlth label text
* @param text text
* @return Button
*/
public static final CButton createExportButton(String text) {
AppsAction aa = new AppsAction(A_EXPORT, null, text);
CButton button = (CButton) aa.getButton();
button.setMargin(s_insets);
return button;
}
Aggregations