use of org.zkoss.zhtml.Text in project adempiere by adempiere.
the class WBrowserListItemRenderer method setLabelText.
/**
* Set the label text
* @param text
* @param label
*/
private void setLabelText(String text, Label label) {
String display = text;
if (text != null && text.length() > MAX_TEXT_LENGTH)
display = text.substring(0, MAX_TEXT_LENGTH - 3) + "...";
if (display != null)
display = XMLs.encodeText(display);
label.appendChild(new Text(display));
if (text != null && text.length() > MAX_TEXT_LENGTH)
label.setDynamicProperty("title", text);
else
label.setDynamicProperty("title", "");
}
use of org.zkoss.zhtml.Text in project adempiere by adempiere.
the class StatusBarPanel method setStatusLine.
/**
* @param text
* @param error
* @param showPopup ignore for embedded
*/
public void setStatusLine(String text, boolean error, boolean showPopup) {
statusLine.setText(text);
if (error)
statusLine.setStyle("color: red");
else
statusLine.setStyle("color: black");
statusLine.setTooltiptext(text);
if (showPopup && AEnv.isBrowserSupported()) {
Text t = new Text(text);
popupContent.getChildren().clear();
popupContent.appendChild(t);
popupContent.setStyle(POPUP_TEXT_STYLE);
if (error) {
popupStyle = POPUP_ERROR_BACKGROUND_STYLE;
} else {
popupStyle = POPUP_INFO_BACKGROUND_STYLE;
}
String shadow = SHADOW_STYLE;
popupStyle = popupStyle + shadow + POPUP_POSITION_STYLE;
showPopup();
//auto hide
/* TODO-evenos: ZK6 */
String script = "setTimeout('zk.Widget.$(\"" + popup.getUuid() + "\").$n().style.display = \"none\"',";
if (error)
script += "3500";
else
script += "1000";
script += ")";
AuScript aus = new AuScript(popup, script);
Clients.response("statusPopupFade", aus);
}
}
use of org.zkoss.zhtml.Text in project adempiere by adempiere.
the class WDeleteSelection method initComponents.
/**
* Init components
*/
private void initComponents() {
container = new Window();
container.setTitle(Msg.getMsg(Env.getCtx(), "DeleteSelection"));
container.setAttribute("modal", Boolean.TRUE);
container.setWidth("500px");
container.setHeight("400px");
container.setBorder("normal");
container.setSizable(true);
container.setClosable(true);
container.setMaximizable(true);
// Init list
listbox = new Listbox();
// FR [ 2877111 ]
Vector<String> data = getData();
for (int i = 0; i < data.size(); i++) {
String record = data.get(i);
listbox.appendItem(record, record);
}
// Is a multiple selection
listbox.setMultiple(true);
// Instance Panel
confirmPanel = new ConfirmPanel(true);
//
Div div = new Div();
div.setStyle("width: 100%; height: 100%");
Pre pre = new Pre();
Text text = new Text(Msg.getMsg(Env.getCtx(), "DeleteSelectionDescription"));
text.setParent(pre);
pre.setParent(div);
//
Borderlayout layout = new Borderlayout();
layout.setParent(container);
layout.setWidth("100%");
layout.setHeight("100%");
North north = new North();
north.setParent(layout);
north.appendChild(div);
Center center = new Center();
center.setParent(layout);
center.setFlex(true);
center.appendChild(listbox);
listbox.setWidth("100%");
listbox.setVflex(true);
//
South south = new South();
south.setParent(layout);
south.appendChild(confirmPanel);
// Add Listener
confirmPanel.addActionListener(Events.ON_CLICK, this);
// Default Selected
if (isDefaultSelected() && getSelection() != null) {
listbox.setSelectedIndices(getSelection());
}
}
use of org.zkoss.zhtml.Text in project adempiere by adempiere.
the class WRecordInfo method init.
/**
* Static Layout
* @throws Exception
*/
private void init() throws Exception {
Div div = new Div();
div.setStyle("width: 100%; height: 100%");
Pre pre = new Pre();
Text text = new Text(getInfo());
text.setParent(pre);
pre.setParent(div);
//
Borderlayout layout = new Borderlayout();
layout.setParent(v_Container);
layout.setWidth("100%");
layout.setHeight("100%");
Center center = new Center();
center.setParent(layout);
center.setFlex(true);
if (isOk()) {
North north = new North();
north.setParent(layout);
north.appendChild(div);
center.appendChild(table);
table.setWidth("100%");
table.setVflex(true);
} else {
center.appendChild(div);
}
//
South south = new South();
south.setParent(layout);
south.appendChild(confirmPanel);
confirmPanel.addActionListener(Events.ON_CLICK, this);
}
use of org.zkoss.zhtml.Text 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