use of org.zkoss.zk.ui.metainfo.PageDefinition in project adempiere by adempiere.
the class WLogin method doCreatePart.
protected Component doCreatePart(Component parent) {
layout = new Borderlayout();
if (parent != null)
layout.setParent(parent);
else
layout.setPage(page);
ThemeUtils.addSclass("ad-wlogin-layout", layout);
Center center = new Center();
center.setParent(layout);
center.setHflex("true");
center.setVflex("true");
center.setAutoscroll(true);
ThemeUtils.addSclass("ad-wlogin-layout-center", center);
Vbox vb = new Vbox();
vb.setParent(center);
vb.setPack("center");
vb.setAlign("center");
vb.setWidth("100%");
vb.setHeight("100%");
LoginWindow loginWindow = new LoginWindow(app);
loginWindow.setParent(vb);
if (!AEnv.isBrowserSupported()) {
//TODO: localization
String msg = "You might experience slow performance and user interface anomalies using your current browser to access the application. We recommend the use of Firefox, Google Chrome or Apple Safari.";
browserWarningWindow = new Window();
ThemeUtils.addSclass("ad-wlogin-browser-not-supported", browserWarningWindow);
Div div = new Div();
div.appendChild(new Text(msg));
browserWarningWindow.setPosition("top,right");
browserWarningWindow.appendChild(div);
browserWarningWindow.setPage(page);
browserWarningWindow.doOverlapped();
}
try {
String right = ThemeUtils.getLoginRightPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(right);
East east = new East();
ThemeUtils.addSclass("ad-wlogin-east-panel", east);
addContent(east, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
}
}
try {
String left = ThemeUtils.getLoginLeftPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(left);
West west = new West();
ThemeUtils.addSclass("ad-wlogin-west-panel", west);
addContent(west, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
}
}
try {
String top = ThemeUtils.getLoginTopPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(top);
North north = new North();
ThemeUtils.addSclass("ad-wlogin-north-panel", north);
addContent(north, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
}
}
try {
String bottom = ThemeUtils.getLoginBottomPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(bottom);
South south = new South();
ThemeUtils.addSclass("ad-wlogin-south-panel", south);
addContent(south, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
}
}
return layout;
}
Aggregations