use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WSQLProcess method createProcessButton.
/**
* Create Process Button.
* @return button
*/
public static final Button createProcessButton() {
Button btnProcess = new Button();
btnProcess.setImage(ServletFns.resolveThemeURL("~./images/Process24.png"));
btnProcess.setName(Msg.getMsg(Env.getCtx(), "Process"));
return btnProcess;
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WAcctViewer method onEvent.
// stateChanged
/**
* Event Performed (Event Listener)
* @param e Event
*/
public void onEvent(Event e) throws Exception {
// log.info(e.getActionCommand());
iframe.setContent(null);
Object source = e.getTarget();
if (source == tabResult)
stateChanged();
else if (source == tabQuery)
stateChanged();
else if (source == selAcctSchema)
actionAcctSchema();
else if (source == bQuery)
actionQuery();
else if (source == selDocument)
actionDocument();
else if (source == selTable)
actionTable();
else if (source == bRePost)
actionRePost();
else if (//FR[3435028]
source == bExport)
actionExportExcel();
else if (source == bPrint)
//PrintScreenPainter.printScreen(this);
;
else // InfoButtons
if (source == bExport)
// Export the table.
actionExportExcel();
else if (source instanceof Button)
actionButton((Button) source);
else if (source == paging) {
int pgno = paging.getActivePage();
int start = pgno * PAGE_SIZE;
int end = start + PAGE_SIZE;
if (end > paging.getTotalSize())
end = paging.getTotalSize();
List<ArrayList<Object>> list = m_queryData.subList(start, end);
ListModelTable model = new ListModelTable(list);
table.setModel(model);
}
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class FindWindow method initSimple.
/**
* initialise lookup record tab
* @throws IOException
*
**/
private void initSimple() throws IOException {
lblDocumentNo = new Label();
lblDocumentNo.setValue(Msg.translate(Env.getCtx(), "DocumentNo").replaceAll("&", ""));
lblDescription = new Label();
lblDescription.setValue(Msg.translate(Env.getCtx(), "Description").replaceAll("&", ""));
lblName = new Label();
lblName.setValue(Msg.translate(Env.getCtx(), "Name").replaceAll("&", ""));
lblValue = new Label();
lblValue.setValue(Msg.translate(Env.getCtx(), "Value").replaceAll("&", ""));
fieldDocumentNo = new Textbox();
fieldDocumentNo.setId("fieldDocumentNo");
fieldDocumentNo.setMaxlength(40);
fieldDescription = new Textbox();
fieldDescription.setId("fieldDescription");
fieldDescription.setMaxlength(40);
fieldName = new Textbox();
fieldName.setMaxlength(40);
fieldValue = new Textbox();
fieldValue.setMaxlength(40);
// Get button from Action
WAppsAction action = new WAppsAction(ConfirmPanel.A_NEW, null, ConfirmPanel.A_NEW);
Button btnNew = action.getButton();
btnNew.setName("btnNew");
btnNew.addEventListener(Events.ON_CLICK, this);
// Get button from Action
action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
Button btnOk = action.getButton();
btnOk.setName("btnOkSimple");
btnOk.addEventListener(Events.ON_CLICK, this);
// Get from action
action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
Button btnCancel = action.getButton();
btnCancel.setName("btnCancel");
btnCancel.addEventListener(Events.ON_CLICK, this);
Panel pnlButtonRight = new Panel();
// Change to Standard button order
pnlButtonRight.appendChild(btnCancel);
pnlButtonRight.appendChild(btnOk);
pnlButtonRight.setAlign("right");
pnlButtonRight.setWidth("100%");
Panel pnlButtonLeft = new Panel();
pnlButtonLeft.appendChild(btnNew);
Hbox hboxButton = new Hbox();
hboxButton.appendChild(pnlButtonLeft);
hboxButton.appendChild(pnlButtonRight);
hboxButton.setWidth("100%");
pnlDocument = new Row();
pnlDocument.setId("pnlDocument");
pnlDocument.appendChild(LayoutUtils.makeRightAlign(lblDocumentNo));
pnlDocument.appendChild(fieldDocumentNo);
pnlDescription = new Row();
pnlDescription.appendChild(LayoutUtils.makeRightAlign(lblDescription));
pnlDescription.appendChild(fieldDescription);
pnlValue = new Row();
pnlValue.appendChild(LayoutUtils.makeRightAlign(lblValue));
pnlValue.appendChild(fieldValue);
pnlName = new Row();
pnlName.appendChild(LayoutUtils.makeRightAlign(lblName));
pnlName.appendChild(fieldName);
contentSimple = new Grid();
contentSimple.setId("contentSimple");
contentSimple.setWidth("100%");
contentSimple.makeNoStrip();
contentSimpleRows = new Rows();
contentSimple.appendChild(contentSimpleRows);
contentSimpleRows.appendChild(pnlValue);
contentSimpleRows.appendChild(pnlName);
contentSimpleRows.appendChild(pnlDocument);
contentSimpleRows.appendChild(pnlDescription);
contentSimple.setVflex(true);
Borderlayout layout = new Borderlayout();
layout.setStyle("height: 100%; width: 99%; position: relative");
winLookupRecord.appendChild(layout);
Center center = new Center();
layout.appendChild(center);
center.appendChild(contentSimple);
center.setFlex(true);
South south = new South();
layout.appendChild(south);
south.appendChild(hboxButton);
winLookupRecord.setWidth("100%");
winLookupRecord.setHeight("100%");
winLookupRecord.addEventListener(Events.ON_OK, this);
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class FindWindow method onEvent.
// addSelectionColumn
public void onEvent(Event event) throws Exception {
if (Events.ON_SELECT.equals(event.getName())) {
if (event.getTarget() instanceof Listbox) {
ListItem row = (ListItem) (event.getTarget().getParent().getParent());
Listbox listbox = (Listbox) event.getTarget();
advancedPanel.setSelectedItem(row);
Listbox listColumn = (Listbox) row.getFellow("listColumn" + row.getId());
Listbox listOperator = (Listbox) row.getFellow("listOperator" + row.getId());
if (listbox.getId().equals(listColumn.getId()) || listbox.getId().equals(listOperator.getId())) {
if (listbox.getId().equals(listColumn.getId())) {
ListItem column = listColumn.getSelectedItem();
if (column != null) {
addOperators(column, listOperator);
}
}
Component componentFrom = getEditorCompQueryFrom(row);
Component componentTo = getEditorCompQueryTo(row);
addRowEditor(componentFrom, (ListCell) row.getFellow("cellQueryFrom" + row.getId()));
addRowEditor(componentTo, (ListCell) row.getFellow("cellQueryTo" + row.getId()));
}
} else if (event.getTarget() == fQueryName) {
int index = fQueryName.getSelectedIndex();
if (index < 0) {
if (fQueryName.getSelectedItem() == null || fQueryName.getSelectedItem().equals(m_sTipText)) {
return;
}
} else if (index == 0) {
// no query - wipe and start over.
List<?> rowList = advancedPanel.getChildren();
for (int rowIndex = rowList.size() - 1; rowIndex >= 1; rowIndex--) rowList.remove(rowIndex);
createFields();
fQueryName.setSelectedIndex(-1);
fQueryName.setText(m_sTipText);
} else
parseUserQuery(userQueries[index - 1]);
}
} else //
if (Events.ON_CLICK.equals(event.getName())) {
// Toolbar Buttons actions
if (event.getTarget() instanceof ToolBarButton) {
ToolBarButton button = (ToolBarButton) event.getTarget();
if ("btnNewAdv".equals(button.getAttribute("name").toString())) {
createFields();
} else if ("btnDeleteAdv".equals(button.getAttribute("name").toString())) {
int index = advancedPanel.getSelectedIndex();
if (index >= 0) {
cmd_delete();
}
} else if ("btnSaveAdv".equals(button.getAttribute("name").toString())) {
// Save the query but don't overwrite the Last query
cmd_save(false);
}
} else // Confirm panel actions
if (event.getTarget() instanceof Button) {
Button btn = (Button) event.getTarget();
if ("btnOkSimple".equals(btn.getName())) {
cmd_ok_Simple();
dispose();
} else if ("btnOkAdv".equals(btn.getName())) {
cmd_ok_Advanced();
dispose();
} else if ("btnCancel".equals(btn.getName())) {
m_isCancel = true;
dispose();
} else if ("btnNew".equals(btn.getName())) {
m_query = MQuery.getNoRecordQuery(m_tableName, true);
m_total = 0;
m_createNew = true;
dispose();
}
}
} else if (Events.ON_OK.equals(event.getName())) {
if (winLookupRecord.equals(event.getTarget())) {
cmd_ok_Simple();
dispose();
} else if (winAdvanced.equals(event.getTarget())) {
cmd_ok_Advanced();
dispose();
}
// Check simple panel fields
for (WEditor editor : m_sEditors) {
if (editor.getComponent() == event.getTarget()) {
cmd_ok_Simple();
dispose();
}
}
// Check simple panel fields
for (WEditor editor : m_sEditors2) {
if (editor != null && editor.getComponent() == event.getTarget()) {
cmd_ok_Simple();
dispose();
}
}
} else if (Events.ON_FOCUS.equals(event.getName())) {
if (event.getTarget() == fQueryName) {
// fQueryName received the focus - delete the tip text so the user can type without
// having to delete the tip.
int index = fQueryName.getSelectedIndex();
if (index < 0) {
if (fQueryName.getSelectedItem() == null || fQueryName.getSelectedItem().equals(m_sTipText)) {
fQueryName.setSelectedIndex(-1);
fQueryName.setText("");
}
}
}
} else if (Events.ON_BLUR.equals(event.getName())) {
if (event.getTarget() == fQueryName) {
// fQueryName lost the focus. If the field is blank, replace the tip text.
if (fQueryName.getSelectedItem() != null && fQueryName.getSelectedItem().equals("")) {
fQueryName.setText(m_sTipText);
}
}
}
}
use of org.adempiere.webui.component.Button in project adempiere by adempiere.
the class WCreateFromPanel method zkInit.
/**
* Create UI
* @throws IOException
*/
protected void zkInit() throws IOException {
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");
contentPane.setWidth("100%");
contentPane.setHeight("100%");
}
Aggregations