public Listitem crearFilas(Object objeto, Component componente) throws Exception { Listitem fila = new Listitem(); final Maestro_manual maestro_manual = (Maestro_manual) objeto; fila.appendChild(new Listcell(maestro_manual.getId_manual() + "")); fila.appendChild(new Listcell(maestro_manual.getManual() + "")); fila.appendChild( new Listcell( Utilidades.getNombreElemento( maestro_manual.getTipo_manual(), "tipo_manual", getServiceLocator()))); fila.appendChild( new Listcell( Utilidades.getNombreElemento( maestro_manual.getTipo_moneda(), "tipo_moneda", getServiceLocator()))); Hlayout hlayout = new Hlayout(); fila.setStyle("text-align: justify;nowrap:nowrap"); Toolbarbutton toolbarbutton = new Toolbarbutton("Editar"); toolbarbutton.setImage("/images/editar.gif"); toolbarbutton.setTooltiptext("Editar registro"); toolbarbutton.addEventListener( Events.ON_CLICK, new EventListener<Event>() { @Override public void onEvent(Event arg0) throws Exception { mostrarDatos(maestro_manual); } }); hlayout.appendChild(toolbarbutton); toolbarbutton = new Toolbarbutton("Eliminar"); toolbarbutton.setImage("/images/borrar.gif"); toolbarbutton.setTooltiptext("Eliminar registro"); toolbarbutton.addEventListener( Events.ON_CLICK, new EventListener<Event>() { @Override public void onEvent(Event arg0) throws Exception { Messagebox.show( "Esta seguro que desea eliminar este registro? ", "Eliminar Registro", Messagebox.YES + Messagebox.NO, Messagebox.QUESTION, new org.zkoss.zk.ui.event.EventListener<Event>() { public void onEvent(Event event) throws Exception { if ("onYes".equals(event.getName())) { eliminarDatos(maestro_manual); buscarDatos(); } } }); } }); hlayout.appendChild(toolbarbutton); Listcell listcell = new Listcell(); listcell.appendChild(hlayout); fila.appendChild(listcell); return fila; }
private Component createSimpleValuePane(CfgValue cfgValue) { CfgValueInputCompHolder inputCompHolder = new CfgValueInputCompHolder(cfgValue); valueHolders.add(inputCompHolder); Hlayout pane = new Hlayout(); Button delBtn = createDeleteBtn(cfgValue, pane); pane.appendChild(createLabel(cfgValue)); pane.appendChild(inputCompHolder.getInputComponent()); pane.appendChild(delBtn); if (cfgValue.isElement()) { pane.appendChild(createCopyElementBtn(cfgValue)); } return pane; }
private Component createTextareaPane(CfgValue cfgValue) { CfgValueInputCompHolder inputCompHollder = new CfgValueInputCompHolder(cfgValue); valueHolders.add(inputCompHollder); Vlayout pane = new Vlayout(); Hlayout hlayout = new Hlayout(); Button delBtn = createDeleteBtn(cfgValue, pane); hlayout.appendChild(createLabel(cfgValue)); hlayout.appendChild(delBtn); if (cfgValue.isElement()) { hlayout.appendChild(createCopyElementBtn(cfgValue)); } pane.appendChild(hlayout); pane.appendChild(inputCompHollder.getInputComponent()); return pane; }
protected Tabpanel renderTabpanel(final Resource resource) { Tabpanel sourcepanel = new Tabpanel(); Hlayout hlayout = new Hlayout(); hlayout.setStyle("margin-top:20px"); final Label label = new Label("Image url:"); hlayout.appendChild(label); final Textbox txtURL = new Textbox(); txtURL.setValue(resource.getContent()); txtURL.setWidth("500px"); txtURL.setConstraint("no empty"); hlayout.appendChild(txtURL); txtURL.addEventListener( Events.ON_CHANGE, new EventListener() { public void onEvent(Event event) throws Exception { if (txtURL.isValid()) { if (event instanceof InputEvent) { String value = ((InputEvent) event).getValue(); resource.setContent(value); FiddleSourceEventQueue.lookup().fireResourceChanged(resource, Type.Modified); } } } }); sourcepanel.appendChild(hlayout); { sourcepanel.appendChild(new Separator()); } { Label lbl = new Label( "Enter a image url ,and you have to make sure you have the right to use the image."); sourcepanel.appendChild(lbl); } return sourcepanel; }
private Component createComboPane(CfgType type) { valueHolders = new ArrayList<CfgValueHolder>(); // Vlayout pane = new Vlayout(); // for dialog's parent,can't use Panel Hlayout titleLayout = new Hlayout(); titleLayout.appendChild(embed ? createLabel(cfgValue) : createTitle(cfgValue)); if (cfgValue.getParent() != null) { Button delBtn = createDeleteBtn(cfgValue, pane); titleLayout.appendChild(delBtn); } addBtn = createAddBtn(); titleLayout.appendChild(addBtn); if (cfgValue.isElement()) { titleLayout.appendChild(createCopyElementBtn(cfgValue)); } pane.appendChild(titleLayout); pane.appendChild(new Space()); Component body = createBody(type); pane.appendChild(body); // return pane; }
private Component createLinkPane(final CfgValue cfgValue) { Hlayout pane = new Hlayout(); pane.appendChild(createLabel(cfgValue)); pane.appendChild(createEnterBtn(cfgValue)); return pane; }