git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@21105 d1611594-4594-4d17-8e1d-87c2c4800839
parent
1b9bf8f414
commit
632cf7de02
|
@ -12,20 +12,19 @@ import org.springframework.stereotype.Controller;
|
|||
import org.zkoss.zhtml.Filedownload;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.InputEvent;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.ConfigCoordenadas;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfigLayoutImpressaoBoleto;
|
||||
|
||||
@Controller("configLayoutImpressaoBoletoController")
|
||||
@Scope("prototype")
|
||||
public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardComposer
|
||||
implements ListitemRenderer {
|
||||
public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private MyListbox campoCoordenadasList;
|
||||
|
@ -33,13 +32,20 @@ public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardCompo
|
|||
private Intbox txtLinha;
|
||||
private Intbox txtColuna;
|
||||
private List<ConfigCoordenadas> lsConfigCoordenadas;
|
||||
private Integer linha;
|
||||
private Integer coluna;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
linha = 0;
|
||||
coluna = 0;
|
||||
txtLinha.setValue(linha);
|
||||
txtColuna.setValue(coluna);
|
||||
|
||||
lsConfigCoordenadas = new ArrayList<ConfigCoordenadas>();
|
||||
|
||||
campoCoordenadasList.setItemRenderer(this);
|
||||
campoCoordenadasList.setItemRenderer(new RenderConfigLayoutImpressaoBoleto());
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws IOException {
|
||||
|
@ -99,96 +105,21 @@ public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardCompo
|
|||
campoCoordenadasList.setData(lsConfigCoordenadas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
ConfigCoordenadas configCoordenadas = (ConfigCoordenadas) o;
|
||||
public void onChanging$txtLayout(InputEvent ev) {
|
||||
if (ev.getValue().endsWith("\n")) {
|
||||
linha = linha + 1;
|
||||
txtLinha.setValue(linha);
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
coluna = 0;
|
||||
} else if (ev.getValue().endsWith(" ")) {
|
||||
coluna = coluna + 1;
|
||||
} else {
|
||||
linha = 0;
|
||||
coluna = 0;
|
||||
|
||||
lc = new Listcell(configCoordenadas.getLbCampo());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configCoordenadas.getLinha().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configCoordenadas.getColuna().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", configCoordenadas);
|
||||
}
|
||||
|
||||
class ConfigCoordenadas {
|
||||
private String lbCampo;
|
||||
private String campo;
|
||||
private Integer linha;
|
||||
private Integer coluna;
|
||||
|
||||
public ConfigCoordenadas() {
|
||||
super();
|
||||
txtLinha.setValue(linha);
|
||||
}
|
||||
|
||||
public String getLbCampo() {
|
||||
return lbCampo;
|
||||
}
|
||||
|
||||
public void setLbCampo(String lbCampo) {
|
||||
this.lbCampo = lbCampo;
|
||||
}
|
||||
|
||||
public String getCampo() {
|
||||
return campo;
|
||||
}
|
||||
|
||||
public void setCampo(String campo) {
|
||||
this.campo = campo;
|
||||
}
|
||||
|
||||
public Integer getLinha() {
|
||||
return linha;
|
||||
}
|
||||
|
||||
public void setLinha(Integer linha) {
|
||||
this.linha = linha;
|
||||
}
|
||||
|
||||
public Integer getColuna() {
|
||||
return coluna;
|
||||
}
|
||||
|
||||
public void setColuna(Integer coluna) {
|
||||
this.coluna = coluna;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + getOuterType().hashCode();
|
||||
result = prime * result + ((campo == null) ? 0 : campo.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ConfigCoordenadas other = (ConfigCoordenadas) obj;
|
||||
if (!getOuterType().equals(other.getOuterType()))
|
||||
return false;
|
||||
if (campo == null) {
|
||||
if (other.campo != null)
|
||||
return false;
|
||||
} else if (!campo.equals(other.campo))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private ConfigLayoutImpressaoBoletoController getOuterType() {
|
||||
return ConfigLayoutImpressaoBoletoController.this;
|
||||
}
|
||||
txtColuna.setValue(coluna);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.ConfigCoordenadas;
|
||||
|
||||
public class RenderConfigLayoutImpressaoBoleto implements ListitemRenderer {
|
||||
|
||||
@Override
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
ConfigCoordenadas configCoordenadas = (ConfigCoordenadas) o;
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
|
||||
lc = new Listcell(configCoordenadas.getLbCampo());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configCoordenadas.getLinha().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configCoordenadas.getColuna().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", configCoordenadas);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
<window id="winConfigLayoutImpressaoBoleto"
|
||||
title="Config Layout Impressão Boleto"
|
||||
apply="${configLayoutImpressaoBoletoController}"
|
||||
contentStyle="overflow:auto" height="400px" width="400px"
|
||||
contentStyle="overflow:auto" height="470px" width="800px"
|
||||
border="normal">
|
||||
<toolbar>
|
||||
<button id="btnSalvar" image="/gui/img/save.png"
|
||||
|
@ -18,64 +18,90 @@
|
|||
image="/gui/img/exit.png" width="35px" />
|
||||
</toolbar>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="Campo" />
|
||||
<combobox id="cmbCampo">
|
||||
<comboitem value="getOrigen" label="De" />
|
||||
<comboitem value="getDestino" label="Para" />
|
||||
<comboitem value="getFolio"
|
||||
label="Número Bilhete" />
|
||||
<comboitem value="getFecha" label="Data Viagem" />
|
||||
<comboitem value="getHora" label="Hora Viagem" />
|
||||
<comboitem value="getAsiento" label="Poltrona" />
|
||||
<comboitem value="getAnden" label="Plataforma" />
|
||||
<comboitem value="getPrecio" label="Tarifa" />
|
||||
<!-- <comboitem value="precio" label="Seguro" /> -->
|
||||
<!-- <comboitem value="precio" label="Pedágio" /> -->
|
||||
<!-- <comboitem value="precio" label="Tarifa Embarque" /> -->
|
||||
<!-- <comboitem value="precio" label="Total" /> -->
|
||||
<comboitem value="getFechaVenta"
|
||||
label="Data Emissão" />
|
||||
<comboitem value="getEmpresa" label="Agência" />
|
||||
<comboitem value="getCveUsuario" label="Agente" />
|
||||
<comboitem value="getCorrida" label="Serviço" />
|
||||
<!-- <comboitem value="corrida" label="Prefixo" /> -->
|
||||
<!-- <comboitem value="LINHA" label="Linha" /> -->
|
||||
</combobox>
|
||||
</row>
|
||||
<row>
|
||||
<label value="Linha" />
|
||||
<intbox id="txtLinha" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="Coluna" />
|
||||
<intbox id="txtColuna" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox>
|
||||
<grid fixedLayout="true">
|
||||
<rows>
|
||||
<row spans="2">
|
||||
<label value="Layout" />
|
||||
</row>
|
||||
<row spans="2" align="center">
|
||||
<textbox id="txtLayout" rows="23" cols="60" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnAddCampoCoordenadas" image="/gui/img/add.png"
|
||||
width="35px" />
|
||||
<button id="btnRemoverCampoCoordenadas"
|
||||
image="/gui/img/remove.png" width="35px" />
|
||||
</toolbar>
|
||||
<vbox>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="Campo" />
|
||||
<combobox id="cmbCampo">
|
||||
<comboitem value="getOrigen" label="De" />
|
||||
<comboitem value="getDestino"
|
||||
label="Para" />
|
||||
<comboitem value="getFolio"
|
||||
label="Número Bilhete" />
|
||||
<comboitem value="getFecha"
|
||||
label="Data Viagem" />
|
||||
<comboitem value="getHora"
|
||||
label="Hora Viagem" />
|
||||
<comboitem value="getAsiento"
|
||||
label="Poltrona" />
|
||||
<comboitem value="getAnden"
|
||||
label="Plataforma" />
|
||||
<comboitem value="getPrecio"
|
||||
label="Tarifa" />
|
||||
<!-- <comboitem value="precio" label="Seguro" /> -->
|
||||
<!-- <comboitem value="precio" label="Pedágio" /> -->
|
||||
<!-- <comboitem value="precio" label="Tarifa Embarque" /> -->
|
||||
<!-- <comboitem value="precio" label="Total" /> -->
|
||||
<comboitem value="getFechaVenta"
|
||||
label="Data Emissão" />
|
||||
<comboitem value="getEmpresa"
|
||||
label="Agência" />
|
||||
<comboitem value="getCveUsuario"
|
||||
label="Agente" />
|
||||
<comboitem value="getCorrida"
|
||||
label="Serviço" />
|
||||
<!-- <comboitem value="corrida" label="Prefixo" /> -->
|
||||
<!-- <comboitem value="LINHA" label="Linha" /> -->
|
||||
</combobox>
|
||||
</row>
|
||||
<row>
|
||||
<label value="Linha" />
|
||||
<intbox id="txtLinha" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="Coluna" />
|
||||
<intbox id="txtColuna" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<listbox id="campoCoordenadasList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/builder.gif" label="Campo" />
|
||||
<listheader image="/gui/img/builder.gif" label="Linha" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="Coluna" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<toolbar>
|
||||
<button id="btnAddCampoCoordenadas"
|
||||
image="/gui/img/add.png" width="35px" />
|
||||
<button id="btnRemoverCampoCoordenadas"
|
||||
image="/gui/img/remove.png" width="35px" />
|
||||
</toolbar>
|
||||
|
||||
<listbox id="campoCoordenadasList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/builder.gif"
|
||||
label="Campo" />
|
||||
<listheader image="/gui/img/builder.gif"
|
||||
label="Linha" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="Coluna" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue