use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WEditor method fillHorizontal.
/**
* Stretch editor component to fill container
*/
public void fillHorizontal() {
//streach component to fill grid cell
if (getComponent() instanceof HtmlBasedComponent) {
//can't stretch bandbox & datebox
if (!(getComponent() instanceof Bandbox) && !(getComponent() instanceof Datebox)) {
String width = "100%";
if (getComponent() instanceof Button) {
Button btn = (Button) getComponent();
String zclass = btn.getZclass();
if (gridField.getDisplayType() == DisplayType.Image) {
if (!zclass.contains("image-button-field ")) {
btn.setZclass("image-button-field " + zclass);
}
} else if (!zclass.contains("form-button ")) {
btn.setZclass("form-button " + zclass);
}
} else if (getComponent() instanceof Image) {
Image image = (Image) getComponent();
image.setWidth("48px");
image.setHeight("48px");
} else {
((HtmlBasedComponent) getComponent()).setWidth(width);
}
}
}
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class POSNumberBox method init.
private void init() {
Table grid = new Table();
appendChild(grid);
grid.setStyle("border: none; padding: 0px; margin: 0px;" + HEIGHT + WIDTH + FONT_SIZE);
grid.setDynamicProperty("border", "0");
grid.setDynamicProperty("cellpadding", "0");
grid.setDynamicProperty("cellspacing", "0");
Tr tr = new Tr();
grid.appendChild(tr);
tr.setStyle("border: none; padding: 0px; margin: 0px; white-space:nowrap; ");
Td td = new Td();
tr.appendChild(td);
td.setStyle("border: none; padding: 0px; margin: 0px;");
decimalBox = new Decimalbox();
if (integral) {
decimalBox.setScale(0);
decimalBox.setStyle("display: inline;width:85x;" + HEIGHT + FONT_SIZE);
} else
decimalBox.setStyle("display: inline;text-align:right;width:80px;" + HEIGHT + FONT_SIZE);
td.appendChild(decimalBox);
Td btnColumn = new Td();
tr.appendChild(btnColumn);
btnColumn.setStyle("border: none; padding: 0px; margin: 0px;" + HEIGHT);
btnColumn.setSclass("editor-button");
btn = new Button();
btn.setImage("/images/Calculator10.png");
btn.setTabindex(-1);
LayoutUtils.addSclass("editor-button", btn);
btnColumn.appendChild(btn);
popup = getCalculatorPopup();
LayoutUtils.addSclass("editor-button", btn);
btn.setPopup(popup);
btn.setStyle("text-align: center; height:35px;");
appendChild(popup);
String style = AEnv.isFirefox2() ? "display: inline" : "display: inline-block";
style = style + ";white-space:nowrap";
this.setStyle(style);
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WPOSSubPanel method createButtonAction.
// getButtonAction
/**
* Create Action Button
* @param action action
* @return button
*/
protected Button createButtonAction(String action, int m_OSK_KeyLayout_ID) {
Button button = new Button();
button.setImage("images/" + action + "24.png");
button.setTooltiptext(Msg.translate(ctx, action));
button.setId(m_OSK_KeyLayout_ID + "");
button.setWidth(WIDTH + "px");
button.setHeight(HEIGHT + "px");
button.addActionListener(this);
return button;
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WCreateFromStatementUI method dynInit.
/**
* Dynamic Init
* @throws Exception if Lookups cannot be initialized
* @return true if initialized
*/
public boolean dynInit() throws Exception {
log.config("");
//Refresh button
Button refreshButton = v_CreateFromPanel.getConfirmPanel().createButton(ConfirmPanel.A_REFRESH);
refreshButton.addEventListener(Events.ON_CLICK, this);
v_CreateFromPanel.getConfirmPanel().addButton(refreshButton);
// 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 WTableDirEditor("C_BankAccount_ID", true, true, true, lookup);
// Set Default
bankAccountField.setValue(getC_BankAccount_ID());
// initial Loading
authorizationField = new WStringEditor("authorization", false, false, true, 10, 30, null, null);
authorizationField.getComponent().addEventListener(Events.ON_CHANGE, this);
lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_DocType_ID), DisplayType.TableDir);
documentTypeField = new WTableDirEditor(MPayment.COLUMNNAME_C_DocType_ID, false, false, true, lookup);
documentTypeField.getComponent().addEventListener(Events.ON_CHANGE, this);
lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List);
tenderTypeField = new WTableDirEditor(MPayment.COLUMNNAME_TenderType, false, false, true, lookup);
tenderTypeField.getComponent().addEventListener(Events.ON_CHANGE, this);
lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search);
bPartnerLookup = new WSearchEditor("C_BPartner_ID", false, false, true, lookup);
Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate);
dateToField.setValue(date);
loadBankAccount();
return true;
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WCreateFromWindow method zkInit.
protected void zkInit() throws Exception {
Borderlayout contentPane = new Borderlayout();
appendChild(contentPane);
North north = new North();
contentPane.appendChild(north);
north.appendChild(parameterPanel);
Center center = new Center();
contentPane.appendChild(center);
center.appendChild(dataTable);
WAppsAction selectAllAction = new WAppsAction(SELECT_ALL, null, null);
Button selectAllButton = selectAllAction.getButton();
confirmPanel.addComponentsLeft(selectAllButton);
selectAllButton.addActionListener(this);
South south = new South();
contentPane.appendChild(south);
Panel southPanel = new Panel();
south.appendChild(southPanel);
southPanel.appendChild(new Separator());
southPanel.appendChild(confirmPanel);
southPanel.appendChild(new Separator());
southPanel.appendChild(statusBar);
setWidth("750px");
setHeight("550px");
setSizable(true);
setBorder("normal");
contentPane.setWidth("100%");
contentPane.setHeight("100%");
}
Aggregations