use of org.adempiere.webui.component.ConfirmPanel in project adempiere by adempiere.
the class InfoPanel method init.
protected void init() {
ThemeUtils.addSclass("ad-infopanel", this);
if (isModal()) {
setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
setWidth(p_width + "px");
setHeight(p_height + "px");
setContentStyle("overflow: auto");
setSizable(true);
setMaximizable(true);
ThemeUtils.addSclass("ad-infopanel-modal", this);
} else {
setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
// setBorder("none");
// setWidth("100%");
// setHeight("100%");
// setStyle("position: absolute");
ThemeUtils.addSclass("ad-infopanel-embedded", this);
}
// Elaine 2008/12/16
confirmPanel = new ConfirmPanel(true, true, false, true, true, true);
confirmPanel.addActionListener(Events.ON_CLICK, this);
// Elaine 2008/12/16
confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setVisible(hasCustomize());
confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory());
confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom());
confirmPanel.getButton(ConfirmPanel.A_OK).setVisible(p_saveResults);
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setTooltip(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Confirm_checkAutoQuery");
checkAutoQuery.addActionListener(this);
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(checkAutoQuery, confirmPanel.getButton(ConfirmPanel.A_REFRESH));
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(new Separator("vertical"), confirmPanel.getButton(ConfirmPanel.A_REFRESH));
//
statusBar.setEastVisibility(false);
statusBar.setAttribute("zk_component_ID", "info_statusBar");
//
p_southLayout.setVflex("min");
Center center = new Center();
center.appendChild(confirmPanel);
p_southLayout.appendChild(center);
South south = new South();
south.appendChild(statusBar);
p_southLayout.appendChild(south);
//
// Reset button
bReset = confirmPanel.createButton(ConfirmPanel.A_RESET);
bReset.addActionListener(this);
lblReset = new Label();
lblReset.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Reset")));
p_table.setOddRowSclass(null);
p_table.setAttribute("zk_component_ID", "Lookup_Data_SearchResults");
p_table.setVflex(true);
// Sizes
p_centerNorth.setVflex("min");
p_centerCenter.setVflex("1");
p_centerSouth.setHeight("25%");
//
ThemeUtils.addSclass("info-panel-center", p_centerLayout);
// May be empty
p_centerLayout.appendChild(p_centerNorth);
// the table
p_centerLayout.appendChild(p_centerCenter);
// detail tabs or other
p_centerLayout.appendChild(p_centerSouth);
//
// Need to use a container for p_table so we can insert paging if required.
Div div = new Div();
div.appendChild(p_table);
div.setVflex("1");
div.setHflex("1");
p_centerCenter.appendChild(div);
p_centerCenter.setAutoscroll(false);
p_centerCenter.setHflex("1");
//
p_centerSouth.setCollapsible(true);
p_centerSouth.setSplittable(true);
p_centerSouth.setHflex("1");
// Setup the north reset button and criteria grid
West spWest = new West();
spWest.setHflex("min");
ThemeUtils.addSclass("criteria", spWest);
Center spCenter = new Center();
//spCenter.setWidth("100%");
spCenter.setHflex("1");
spCenter.setVflex("min");
ThemeUtils.addSclass("criteria", spCenter);
p_northLayout.setHflex("min");
p_northLayout.setVflex("min");
p_northLayout.appendChild(spWest);
p_northLayout.appendChild(spCenter);
// spWest - the reset button
Grid bGrid = GridFactory.newGridLayout();
bGrid.setSizedByContent(true);
Columns bColumns = new Columns();
Column col = new Column();
col.setHflex("min");
bColumns.appendChild(col);
bGrid.appendChild(bColumns);
Rows bRows = new Rows();
Row bRow = new Row();
bGrid.appendChild(bRows);
bRows.appendChild(bRow);
bRow.appendChild(bReset);
bRow = new Row();
bRows.appendChild(bRow);
bRow.appendChild(lblReset);
spWest.appendChild(bGrid);
// The criteria table
//p_criteriaGrid.setSizedByContent(true);
spCenter.appendChild(p_criteriaGrid);
Borderlayout mainPanel = new Borderlayout();
mainPanel.setWidth("100%");
mainPanel.setHeight("100%");
//
North north = new North();
mainPanel.appendChild(north);
north.appendChild(p_northLayout);
//
center = new Center();
mainPanel.appendChild(center);
center.appendChild(p_centerLayout);
//
south = new South();
mainPanel.appendChild(south);
south.appendChild(p_southLayout);
//
if (!isModal()) {
mainPanel.setStyle("position: absolute");
}
this.appendChild(mainPanel);
this.addEventListener(Events.ON_OK, this);
this.setVisible(true);
}
use of org.adempiere.webui.component.ConfirmPanel 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%");
}
use of org.adempiere.webui.component.ConfirmPanel in project adempiere by adempiere.
the class LoginPanel method init.
private void init() {
//this.setContentSclass(ITheme.LOGIN_WINDOW_CLASS);
Div div = new Div();
ThemeUtils.addSclass("ad-loginpanel-header", div);
// TODO - localization
Label label = new Label("Login");
ThemeUtils.addSclass("ad-loginpanel-header-text", label);
div.appendChild(label);
this.appendChild(div);
Table table = new Table();
table.setId("grdLogin");
ThemeUtils.addSclass("ad-loginpanel-body", table);
this.appendChild(table);
Tr tr = new Tr();
table.appendChild(tr);
Td td = new Td();
ThemeUtils.addSclass("ad-loginpanel-header-logo", td);
tr.appendChild(td);
td.setDynamicProperty("colspan", "2");
Image image = new Image();
image.setSrc(ThemeUtils.getLargeLogo());
ThemeUtils.addSclass("ad-loginpanel-header-logo", image);
td.appendChild(image);
tr = new Tr();
tr.setId("rowUser");
table.appendChild(tr);
td = new Td();
tr.appendChild(td);
ThemeUtils.addSclass("login-label", td);
td.appendChild(lblUserId);
td = new Td();
ThemeUtils.addSclass("login-field", td);
tr.appendChild(td);
td.appendChild(txtUserId);
tr = new Tr();
tr.setId("rowPassword");
table.appendChild(tr);
td = new Td();
tr.appendChild(td);
ThemeUtils.addSclass("login-label", td);
td.appendChild(lblPassword);
td = new Td();
ThemeUtils.addSclass("login-field", td);
tr.appendChild(td);
td.appendChild(txtPassword);
tr = new Tr();
tr.setId("rowLanguage");
table.appendChild(tr);
td = new Td();
tr.appendChild(td);
ThemeUtils.addSclass("login-label", td);
td.appendChild(lblLanguage);
td = new Td();
ThemeUtils.addSclass("login-field", td);
tr.appendChild(td);
td.appendChild(lstLanguage);
if (MSystem.isZKRememberUserAllowed()) {
tr = new Tr();
tr.setId("rowRememberMe");
table.appendChild(tr);
td = new Td();
tr.appendChild(td);
ThemeUtils.addSclass("login-label", td);
td.appendChild(new Label(""));
td = new Td();
ThemeUtils.addSclass("login-field", td);
tr.appendChild(td);
td.appendChild(chkRememberMe);
}
div = new Div();
ThemeUtils.addSclass("ad-loginpanel-footer", div);
ConfirmPanel pnlButtons = new ConfirmPanel(false);
pnlButtons.addActionListener(this);
ThemeUtils.addSclass("ad-loginpanel-footer-pnl", pnlButtons);
pnlButtons.getButton(ConfirmPanel.A_OK).setSclass("login-btn");
div.appendChild(pnlButtons);
this.appendChild(div);
this.addEventListener(TokenEvent.ON_USER_TOKEN, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
String[] data = (String[]) event.getData();
try {
int AD_Session_ID = Integer.parseInt(data[0]);
MSession session = new MSession(Env.getCtx(), AD_Session_ID, null);
if (session.get_ID() == AD_Session_ID) {
int AD_User_ID = session.getCreatedBy();
MUser user = MUser.get(Env.getCtx(), AD_User_ID);
if (user != null && user.get_ID() == AD_User_ID) {
String token = data[1];
if (BrowserToken.validateToken(session, user, token)) {
if (MSystem.isZKRememberUserAllowed()) {
txtUserId.setValue(user.getName());
onUserIdChange();
chkRememberMe.setChecked(true);
}
if (MSystem.isZKRememberPasswordAllowed()) {
txtPassword.setValue(token);
txtPassword.setAttribute("user.token.hash", token);
txtPassword.setAttribute("user.token.sid", AD_Session_ID);
}
}
}
}
} catch (Exception e) {
//safe to ignore
logger.log(Level.INFO, e.getLocalizedMessage(), e);
}
}
});
}
use of org.adempiere.webui.component.ConfirmPanel in project adempiere by adempiere.
the class WDocActionPanel method init.
private void init() {
Grid grid = GridFactory.newGridLayout();
grid.setId("grd");
grid.setWidth("400px");
Rows rows = new Rows();
Row rowDocAction = new Row();
Row rowLabel = new Row();
Row rowConfirm = new Row();
Row rowSpacer = new Row();
Panel pnlDocAction = new Panel();
pnlDocAction.appendChild(lblDocAction);
pnlDocAction.appendChild(lstDocAction);
rowDocAction.appendChild(pnlDocAction);
rowDocAction.setAlign("right");
rowLabel.appendChild(label);
rowConfirm.appendChild(confirmPanel);
rowSpacer.appendChild(new Space());
rows.appendChild(rowDocAction);
rows.appendChild(rowLabel);
rows.appendChild(rowSpacer);
rows.appendChild(rowConfirm);
grid.appendChild(rows);
this.setTitle(Msg.translate(Env.getCtx(), "DocAction"));
this.setWidth("410px");
this.setBorder("normal");
this.appendChild(grid);
}
use of org.adempiere.webui.component.ConfirmPanel in project adempiere by adempiere.
the class WFEditor method initForm.
@Override
protected void initForm() {
this.setHeight("100%");
Borderlayout layout = new Borderlayout();
layout.setStyle("width: 100%; height: 100%; position: absolute;");
appendChild(layout);
String sql = MRole.getDefault().addAccessSQL("SELECT AD_Workflow_ID, Name FROM AD_Workflow ORDER BY 2", "AD_Workflow", MRole.SQL_NOTQUALIFIED, // all
MRole.SQL_RO);
KeyNamePair[] pp = DB.getKeyNamePairs(sql, true);
workflowList = ListboxFactory.newDropdownListbox();
for (KeyNamePair knp : pp) {
workflowList.addItem(knp);
}
workflowList.addEventListener(Events.ON_SELECT, this);
North north = new North();
layout.appendChild(north);
north.appendChild(workflowList);
workflowList.setStyle("margin-left: 10px; margin-top: 5px;");
north.setHeight("30px");
imageMap = new Imagemap();
Center center = new Center();
layout.appendChild(center);
center.setAutoscroll(true);
// center.setHflex("true");
center.setVflex("true");
center.appendChild(imageMap);
ConfirmPanel confirmPanel = new ConfirmPanel(true);
confirmPanel.addActionListener(this);
South south = new South();
layout.appendChild(south);
south.appendChild(confirmPanel);
south.setHeight("36px");
}
Aggregations