本文整理汇总了Java中org.zkoss.zul.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于org.zkoss.zul包,在下文中一共展示了Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAfterCompose
import org.zkoss.zul.Label; //导入依赖的package包/类
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
// Fill grid with forms
gridForms.getRows().getChildren().clear();
for(Form form : ConfigLoader.getInstance().getForms().queryForAll()) {
Row row = new Row();
Cell nameCell = new Cell();
Cell linkCell = new Cell();
// Create table name cell
nameCell.appendChild(new Label(form.getTitle()));
// Create table link cell
A link = new A();
link.setTarget("_blank");
link.setHref("/data/" + form.getName());
link.setLabel(form.getName());
linkCell.appendChild(link);
row.appendChild(nameCell);
row.appendChild(linkCell);
gridForms.getRows().appendChild(row);
}
}
示例2: createIdCell
import org.zkoss.zul.Label; //导入依赖的package包/类
private Component createIdCell(IdentityEnum id) {
if (StringUtils.isNotBlank(id.name())){
Listcell cell = new Listcell();
Hlayout h = new Hlayout();
Image image = new Image();
image.setSrc((String) IDENTITY_CONVERTER.coerceToUi(id, image));
image.setWidth("36px");
Label label = new Label();
label.setValue((String) IDENTITY_CONVERTER.coerceToUi(id, label));
h.setSpacing("10px");
Div div = new Div();
div.setStyle("margin-top : 7px;");
label.setParent(div);
image.setParent(h);
div.setParent(h);
h.setParent(cell);
return cell;
}
return new Listcell();
}
示例3: append
import org.zkoss.zul.Label; //导入依赖的package包/类
private void append(Row row, String label, String toolTip, Component component) {
Div lbl = new Div();
lbl.setStyle("text-align: right");
lbl.appendChild(new Label(label));
if (StringUtils.isNotBlank(toolTip)) {
lbl.setTooltiptext(toolTip);
lbl.setStyle("cursor: help;" + lbl.getStyle());
}
row.appendChild(ZKUtils.newCell(lbl));
if (component instanceof Cell) {
row.appendChild(component);
} else {
row.appendChild(ZKUtils.newCell(modifyComponent(component, toolTip)));
}
}
示例4: render
import org.zkoss.zul.Label; //导入依赖的package包/类
@Override
public void render(Row row, final Cost cost, int index) throws Exception {
row.appendChild(new Label(cost.getDescription()));
row.appendChild(new Label(DateHelper.getDate(cost.getDate())));
row.appendChild(new Label(AmountHelper.formatDecimal(cost.getAmount())));
row.appendChild(new Label(AmountHelper.formatDecimal(cost.getVat())));
row.appendChild(new Label(cost.getCostType().getOmschrijving()));
row.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
public void onEvent(Event event) throws Exception {
Map<String, Object> arguments = new HashMap<>();
arguments.put("cost", cost);
String template = "edit-cost.zul";
Window window = (Window) Executions.createComponents(template, null, arguments);
window.doModal();
}
});
}
示例5: render
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* Renders a row
* @param row object where to place information
* @param object object to be rendered
* @param i index of the row
* @throws Exception in case components cannot be added to the row
*/
@Override
public void render(Row row, Object object, int i) throws Exception {
DateFormat dateFormatter = new SimpleDateFormat(CommonConstants.DATE_FORMAT);
DateFormat timeFormatter = new SimpleDateFormat(CommonConstants.TIME_FORMAT);
InstanceChange change = (InstanceChange) object;
// the data append to each row with simple label
row.appendChild(new Label(dateFormatter.format(change.getChangeDate())
+ " " + timeFormatter.format(change.getChangeDate())));
row.appendChild(new Label(change.getAttribute()));
row.appendChild(new Label(change.getRequester()));
if (change.getOldValue() != null)
row.appendChild(getFormattedLabel(change.getOldValue(), 50));
else
row.appendChild(new Label("-"));
if (change.getNewValue() != null)
row.appendChild(getFormattedLabel(change.getNewValue(), 50));
else
row.appendChild(new Label("-"));
}
示例6: getFormattedLabel
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* Formats a label to fit in the grid columns, with no wrap.
* @param text text to format
* @param maxLength maximum length of the text
* @return Label object with the formated text
*/
private Label getFormattedLabel(String text, int maxLength) {
Label toret = new Label(text);
toret.setMaxlength(maxLength);
if (text.length() > maxLength) {
toret.setTooltiptext(text);
}
toret.setStyle("hyphens:none;text-wrap:none;-webkit-hyphens:none;white-space:nowrap;");
return toret;
}
示例7: showError
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* Displays an error window for the error code provided.
* @param errorCode error code for the message to be displayed.
*/
private void showError(String errorCode) {
Window errorWindow = (Window) this.getParent().getFellow("errorWindow");
Label errorMessage = (Label) errorWindow.getFellow("errorMessage");
errorMessage.setValue(Labels.getLabel(errorCode));
try {
errorWindow.doModal();
} catch (SuspendNotAllowedException ex) {
Logger.getLogger(ShutdownController.class.getName()).log(Level.SEVERE, "ERROR SHOWING ERROR WINDOW", ex);
}
}
示例8: showError
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* Displays an error window for the error code provided.
* @param errorCode error code for the message to be displayed.
* @param exception exception to log
*/
private void showError(String errorCode, Exception exception) {
if (exception != null) {
Logger.getLogger(FileController.class.getName()).log(Level.SEVERE, "ERROR DISPATCHING JOB", exception);
}
Window errorWindow = (Window) this.getParent().getFellow("errorWindow");
Label errorMessage = (Label) errorWindow.getFellow("errorMessage");
errorMessage.setValue(Labels.getLabel(errorCode));
try {
errorWindow.doModal();
} catch (SuspendNotAllowedException ex) {
Logger.getLogger(FileController.class.getName()).log(Level.SEVERE, "ERROR SHOWING ERROR WINDOW", ex);
}
}
示例9: render
import org.zkoss.zul.Label; //导入依赖的package包/类
@Override
public void render(Row row, Tournament data, int index) throws Exception {
new Label(data.getStartDate().toString()).setParent(row);
A link = new A();
link.setLabel(data.getName());
link.setHref("/pages/tournament/tournament.zul?id="+data.getId());
link.setParent(row);
new Label(data.getAddress().getCountry()+" "+data.getAddress().getCity()+" ("+data.getAddress().getZipCode()+")").setParent(row);
new Label(data.getParticipants().size()+"/"+data.getNbPlayersMax()).setParent(row);
}
示例10: appendPageLinks
import org.zkoss.zul.Label; //导入依赖的package包/类
private void appendPageLinks(String path, File[] files) {
if (!path.equals("/")){
Label title = new Label(path);
title.setSclass("title");
linkArea.appendChild(title);
}
for (File zulFile : files){
A link = new A(zulFile.getName());
link.setHref(path+"/"+zulFile.getName());
linkArea.appendChild(link);
}
}
示例11: refreshGAList
import org.zkoss.zul.Label; //导入依赖的package包/类
@Command
@NotifyChange(value = { "service_list", "currentState", "userList", "userListbyOffice" })
public void refreshGAList() {
if (isLogin()) {
// QLog.l().logger().debug("\n\n\n\nGABOARD VISIBILITY: \n" + CheckGABoard + "\n\n");
// QLog.l().logger().debug("\n\n\n\nGABOARD VISIBILITY user.getGABoard(): \n" + user.getGABoard() + "\n\n");
// user.getGABoard()
if (CheckGABoard == true) {
// UsersInside.getInstance().getUsersInside()
// .put(user.getName() + user.getPassword(), new Date().getTime());
// QSessions.getInstance()
// .update(user.getUser().getId(), Sessions.getCurrent().getRemoteHost(),
// Sessions.getCurrent().getRemoteAddr().getBytes());
////
// Long userId = user.getUser().getId();
// QUser quser = QUserList.getInstance().getById(userId);
// quser.setCurrentState(currentState);
// aftercompose(#GAManagementDialog);
GAManagementDialogWindow.doModal();
Label CW = (Label) GAManagementDialogWindow.getFellow("GA_CW");
String S_CW = new Integer(getCustomersCount()).toString();
CW.setValue(S_CW);
Label SC = (Label) GAManagementDialogWindow.getFellow("GA_SC");
String S_SC = new Integer(servingCSR()).toString();
SC.setValue(S_SC);
Label LC = (Label) GAManagementDialogWindow.getFellow("GA_LC");
String S_LC = new Integer(LogginCSR()).toString();
LC.setValue(S_LC);
}
// BindUtils.postNotifyChange(null, null, Form.this, "*");
}
}
示例12: clickMe
import org.zkoss.zul.Label; //导入依赖的package包/类
@Command("clickMe")
public void clickMe() {
if (!checkPlugin()) {
return;
}
Integer office_id = getSessionOfficeId();
PrintRecords records = getPrintRecordsByOfficeId(office_id);
if (records.isInvited()) {
records.setInvited(false);
Clients.evalJavaScript("DHTMLSound()");
}
for (int i = 1; i < lines.size(); i++) {
final Str line = lines.get(i);
line.clear();
if (i <= records.getRecords().size()) {
line.labelA = new Label(
records.getRecords().get(i - 1).customerPrefix + records.getRecords()
.get(i - 1).customerNumber);
line.labelB = new Label(records.getRecords().get(i - 1).point);
final boolean blink = (
records.getRecords().get(i - 1).getState() == CustomerState.STATE_INVITED
|| records.getRecords().get(i - 1).getState()
== CustomerState.STATE_INVITED);
line.labelA.setClass(blink ? "blink_me" : "no_blink");
line.labelB.setClass(blink ? "blink_me" : "no_blink");
line.set();
}
}
}
示例13: nuevaCeldaDetalle
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* Crea celda tabla.
*
* @param nuevaEtiqueta
* Par�metro nueva etiqueta
* @param style
* Par�metro style
* @return el listcell
*/
public static Listcell nuevaCeldaDetalle(final Label nuevaEtiqueta,
final String style) {
final Listcell celdaRetorno = new Listcell();
if (style != null) {
celdaRetorno.setStyle(style);
}
celdaRetorno.appendChild(nuevaEtiqueta);
return celdaRetorno;
}
示例14: nuevaEtiquetaDetalle
import org.zkoss.zul.Label; //导入依赖的package包/类
/**
* M�todo para Nueva etiqueta detalle de la clase GTTUtilsWeb.
*
* @param dato
* Par�metro dato
* @return el label
*/
public static Label nuevaEtiquetaDetalle(final Object dato) {
final Label labelRetorno = new Label();
if (dato != null) {
if (dato instanceof Date) {
labelRetorno.setValue(dateToString((Date) dato));
} else {
labelRetorno.setValue(dato.toString());
}
}
return labelRetorno;
}
示例15: refreshUserList
import org.zkoss.zul.Label; //导入依赖的package包/类
private void refreshUserList() throws SQLException {
lstUsers.getItems().clear();
for(User usr : ConfigLoader.getInstance().getUsers().queryForAll()) {
Listitem item = new Listitem();
Listcell cell = new Listcell();
item.setValue(usr);
cell.appendChild(new Label(usr.getLogin()));
item.appendChild(cell);
lstUsers.getItems().add(item);
}
}