use of org.compiere.swing.CButton in project adempiere by adempiere.
the class VCreateFromStatementUI method dynInit.
/**
* Dynamic Init
* @throws Exception if Lookups cannot be initialized
* @return true if initialized
*/
public boolean dynInit() throws Exception {
log.config("");
//Refresh button
CButton refreshButton = ConfirmPanel.createRefreshButton(false);
refreshButton.setMargin(new Insets(1, 10, 0, 10));
refreshButton.setDefaultCapable(true);
refreshButton.addActionListener(this);
v_CreateFromPanel.getConfirmPanel().addButton(refreshButton);
// Add to Main Form
v_Container.getContentPane().add(v_CreateFromPanel);
// C_BankStatement.C_BankAccount_ID
int AD_Column_ID = 4917;
MLookup lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
bankAccountField = new VLookup("C_BankAccount_ID", true, true, true, lookup);
// Set Default
bankAccountField.setValue(getC_BankAccount_ID());
// initial Loading
authorizationField = new VString("authorization", false, false, true, 10, 30, null, null);
authorizationField.addActionListener(this);
MLookup lookupDocument = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_DocType_ID), DisplayType.TableDir);
documentTypeField = new VLookup(MPayment.COLUMNNAME_C_DocType_ID, false, false, true, lookupDocument);
documentTypeField.addActionListener(this);
MLookup lookupTender = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List);
tenderTypeField = new VLookup(MPayment.COLUMNNAME_TenderType, false, false, true, lookupTender);
tenderTypeField.addActionListener(this);
bPartnerLookup = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search));
BPartner_idLabel.setLabelFor(bPartnerLookup);
Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate);
dateToField.setValue(date);
loadBankAccount();
return true;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class VCreateFromPanel method jbInit.
/**
* Create UI
*/
protected void jbInit() {
// Set Layout
setLayout(new BorderLayout());
// Add Parameter
JScrollPane dataPane = new JScrollPane();
dataPane.getViewport().add(dataTable, null);
AppsAction selectAllAction = new AppsAction(SELECT_ALL, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK), null);
CButton selectAllButton = (CButton) selectAllAction.getButton();
selectAllButton.setMargin(new Insets(0, 10, 0, 10));
selectAllButton.setDefaultCapable(true);
selectAllButton.addActionListener(this);
confirmPanel.addButton(selectAllButton);
CPanel southPanel = new CPanel();
BorderLayout southLayout = new BorderLayout();
southPanel.setLayout(southLayout);
southPanel.add(confirmPanel, BorderLayout.CENTER);
southPanel.add(statusBar, BorderLayout.SOUTH);
dataTable.setMultiSelection(true);
// Add to Main
add(parameterPanel, BorderLayout.NORTH);
add(dataPane, BorderLayout.CENTER);
add(southPanel, BorderLayout.SOUTH);
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class MinuteModel method createDay.
// createWeekday
/**
* Create Day Label
* @return button
*/
private CButton createDay() {
CButton button = new CButton();
//button.setBorder(BorderFactory.createLoweredBevelBorder());
button.setBorder(BorderFactory.createEmptyBorder());
button.setHorizontalTextPosition(SwingConstants.CENTER);
button.setMargin(ZERO_INSETS);
button.addActionListener(this);
button.addMouseListener(this);
button.addKeyListener(this);
button.setFocusPainted(false);
button.putClientProperty("Plastic.is3D", Boolean.FALSE);
return button;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class POSQuery method createButtonAction.
/**
* Create Action Button
* @param action action
* @return button
*/
protected CButton createButtonAction(String action, KeyStroke accelerator) {
String acceleratorText = "";
if (action != null && accelerator != null) {
int modifiers = accelerator.getModifiers();
if (modifiers >= 0) {
acceleratorText = "(" + KeyEvent.getKeyModifiersText(modifiers);
//acceleratorText += "+";
}
acceleratorText += KeyEvent.getKeyText(accelerator.getKeyCode());
addStatusBarInfo(action + acceleratorText + ")");
}
AppsAction act = new AppsAction(action, accelerator, false);
act.setDelegate(this);
CButton button = (CButton) act.getButton();
button.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
button.setMinimumSize(getPreferredSize());
button.setMaximumSize(getPreferredSize());
button.setFocusable(false);
return button;
}
use of org.compiere.swing.CButton in project adempiere by adempiere.
the class POSInfoProduct method init.
@Override
protected void init() {
// Set Layout
setLayout(new GridBagLayout());
// Set Border
TitledBorder border = BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "InfoProduct"));
border.setTitleFont(posPanel.getFont());
border.setTitleColor(AdempierePLAF.getTextColor_Label());
setBorder(border);
//
FontMetrics metrics = getFontMetrics(posPanel.getPlainFont());
// Instance Panels
rightPanel = new CPanel(new GridBagLayout());
// For Name
labelName = new CLabel(Msg.getElement(Env.getCtx(), "ProductName"));
labelName.setFont(posPanel.getBigFont());
labelName.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelName, new GridBagConstraints(0, 0, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 0), 0, 0));
labelPriceName = new CLabel(Msg.parseTranslation(ctx, "@PriceStd@ , @PriceList@ ") + posPanel.getCurSymbol());
labelPriceName.setFont(posPanel.getBigFont());
labelPriceName.setHorizontalAlignment(CLabel.LEFT);
labelPriceName.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelPriceName, new GridBagConstraints(0, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
/*labelPriceLimit = new CLabel (posPanel.getNumberFormat().format(Env.ZERO));
labelPriceLimit.setFont(posPanel.getBigFont());
labelPriceLimit.setHorizontalAlignment(CLabel.RIGHT);
labelPriceLimit.setHorizontalTextPosition(CLabel.RIGHT);
labelPriceLimit.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPriceLimit.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPriceLimit, new GridBagConstraints(1, 1, 1, 1, 1, 1
,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));*/
// For Price
labelPrice = new CLabel(posPanel.getNumberFormat().format(Env.ZERO));
labelPrice.setFont(posPanel.getBigFont());
labelPrice.setHorizontalAlignment(CLabel.RIGHT);
labelPrice.setHorizontalTextPosition(CLabel.RIGHT);
labelPrice.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPrice.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPrice, new GridBagConstraints(2, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
labelPriceList = new CLabel(posPanel.getNumberFormat().format(Env.ZERO));
labelPriceList.setFont(posPanel.getBigFont());
labelPriceList.setHorizontalAlignment(CLabel.RIGHT);
labelPriceList.setHorizontalTextPosition(CLabel.RIGHT);
labelPriceList.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPriceList.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPriceList, new GridBagConstraints(3, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
// For Value
labelValue = new CLabel(Msg.getElement(Env.getCtx(), "ProductValue"));
labelValue.setFont(posPanel.getPlainFont());
labelValue.setHorizontalAlignment(CLabel.LEFT);
labelValue.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelValue, new GridBagConstraints(0, 2, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For UOM
labelUOMSymbol = new CLabel(Msg.getElement(Env.getCtx(), "C_UOM_ID"));
labelUOMSymbol.setFont(posPanel.getPlainFont());
labelUOMSymbol.setHorizontalAlignment(CLabel.LEFT);
labelUOMSymbol.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelUOMSymbol, new GridBagConstraints(0, 3, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Category
labelProductCategory = new CLabel(Msg.getElement(Env.getCtx(), "M_Product_Category_ID"));
labelProductCategory.setFont(posPanel.getPlainFont());
labelProductCategory.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelProductCategory, new GridBagConstraints(0, 4, 2, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Category
labelProductTax = new CLabel(Msg.getElement(Env.getCtx(), "C_TaxCategory_ID"));
labelProductTax.setFont(posPanel.getPlainFont());
labelProductTax.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelProductTax, new GridBagConstraints(0, 5, 2, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Description
labelDescription = new CLabel(Msg.getElement(Env.getCtx(), "Description"));
labelDescription.setFont(posPanel.getPlainFont());
labelDescription.setHorizontalAlignment(CLabel.LEFT);
labelDescription.setPreferredSize(new Dimension(20, metrics.getHeight()));
labelDescription.setMaximumSize(new Dimension(20, metrics.getHeight()));
// Add
rightPanel.add(labelDescription, new GridBagConstraints(0, 6, 2, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
// For Image
buttonImage = new CButton();
buttonImage.setFont(posPanel.getFont());
buttonImage.setPreferredSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
buttonImage.setMinimumSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
buttonImage.setFocusable(false);
buttonImage.setVerticalTextPosition(SwingConstants.BOTTOM);
buttonImage.setHorizontalTextPosition(SwingConstants.CENTER);
// Add to panel
// Add Doc Info
add(buttonImage, new GridBagConstraints(0, 0, 1, 1, 0.1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// Add to Header
add(rightPanel, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
}
Aggregations