fixes bug#24029
qua: dev:Aristides git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@110897 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0b46f2aa8f
commit
06f9026686
12
.classpath
12
.classpath
|
@ -8,13 +8,8 @@
|
|||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
|
@ -24,5 +19,10 @@
|
|||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
|
2
.project
2
.project
|
@ -9,8 +9,8 @@
|
|||
<project>modelWeb</project>
|
||||
<project>GeneradorBoletosCNAB</project>
|
||||
<project>WSTotvs</project>
|
||||
<project>Flyway</project>
|
||||
<project>CustomAdmVenta</project>
|
||||
<project>Flyway</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionRuta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionRutaRemoveSelecionada;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEixoConexionRutaRemoveSelecionada;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderGeracaoConexionPorRuta;
|
||||
|
||||
@Controller("gerarConexionPorRutaController")
|
||||
|
@ -91,7 +92,7 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
private MyListbox localidadesComunsDestinoCList;
|
||||
private MyListbox listEspCanal;
|
||||
private MyListbox listPuntoVenta;
|
||||
private List<Parada> lsLocalidadesComuns;
|
||||
private List<Parada> lsLocalidadesComunsAB;
|
||||
private List<Parada> lsLocalidadesComunsLinhasBC;
|
||||
private Combobox cmbTipoPtovta;
|
||||
private Combobox cmbPtovta;
|
||||
|
@ -310,6 +311,43 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
public void onClick$btnPesquisaLocalidadesDestino(Event ev) throws InterruptedException {
|
||||
executarPesquisaLocalidadesDestino();
|
||||
}
|
||||
public void renderizarLinhasAB() {
|
||||
localidadesComunsList.setItemRenderer(new RenderEixoConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada conexionRutaVO = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesComunsList.getListData()) {
|
||||
if (((Parada) objectParada).equals(conexionRutaVO)) {
|
||||
localidadesComunsList.removeItem(conexionRutaVO);
|
||||
lsLocalidadesComunsAB.remove(conexionRutaVO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gerarLocalidadesComunsAB();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void renderizarLinhasBC() {
|
||||
localidadesComunsDestinoCList.setItemRenderer(new RenderEixoConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada conexionRutaVO = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesComunsDestinoCList.getListData()) {
|
||||
if (((Parada) objectParada).equals(conexionRutaVO)) {
|
||||
localidadesComunsDestinoCList.removeItem(conexionRutaVO);
|
||||
lsLocalidadesComunsLinhasBC.remove(conexionRutaVO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gerarLocalidadesComunsBC();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void executarPesquisaLocalidadesOrigen() throws InterruptedException {
|
||||
|
||||
|
@ -435,16 +473,17 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
localidadesLinhaASelecionadaList.getListData().removeAll(paradasDuplicadas);
|
||||
localidadesLinhaBSelecionadaList.getListData().removeAll(paradasDuplicadas);
|
||||
|
||||
if(lsLocalidadesComuns!=null) {
|
||||
if(lsLocalidadesComunsAB!=null) {
|
||||
for (Parada parada : paradasDuplicadas) {
|
||||
if(!lsLocalidadesComuns.contains(parada)){
|
||||
lsLocalidadesComuns.add(parada);
|
||||
if(!lsLocalidadesComunsAB.contains(parada)){
|
||||
lsLocalidadesComunsAB.add(parada);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
lsLocalidadesComuns = new ArrayList<Parada>(paradasDuplicadas);
|
||||
lsLocalidadesComunsAB = new ArrayList<Parada>(paradasDuplicadas);
|
||||
}
|
||||
localidadesComunsList.setModel(new ListModelList(lsLocalidadesComuns));
|
||||
localidadesComunsList.setData(lsLocalidadesComunsAB);
|
||||
renderizarLinhasAB();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -463,7 +502,8 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
}else {
|
||||
lsLocalidadesComunsLinhasBC = new ArrayList<Parada>(paradasDuplicadas);
|
||||
}
|
||||
localidadesComunsDestinoCList.setModel(new ListModelList(lsLocalidadesComunsLinhasBC));
|
||||
localidadesComunsDestinoCList.setData(new ListModelList(lsLocalidadesComunsLinhasBC));
|
||||
renderizarLinhasBC();
|
||||
|
||||
}
|
||||
|
||||
|
@ -474,7 +514,7 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onClick$btnCombinarTrechos(Event ev) throws InterruptedException {
|
||||
if (lsLocalidadesComuns == null || lsLocalidadesComuns.isEmpty()) {
|
||||
if (lsLocalidadesComunsAB == null || lsLocalidadesComunsAB.isEmpty()) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionPorRutaController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
@ -823,11 +863,11 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public List<Parada> getLsLocalidadesComuns() {
|
||||
return lsLocalidadesComuns;
|
||||
return lsLocalidadesComunsAB;
|
||||
}
|
||||
|
||||
public void setLsLocalidadesComuns(List<Parada> lsLocalidadesComuns) {
|
||||
this.lsLocalidadesComuns = lsLocalidadesComuns;
|
||||
this.lsLocalidadesComunsAB = lsLocalidadesComuns;
|
||||
}
|
||||
|
||||
public List<Parada> getLsLocalidadesComunsLinhasBC() {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Valdevir
|
||||
*/
|
||||
public class RenderEixoConexionRutaRemoveSelecionada implements ListitemRenderer {
|
||||
|
||||
private EventListener listenerGenerico;
|
||||
|
||||
public RenderEixoConexionRutaRemoveSelecionada(EventListener listenerGenerico) {
|
||||
super();
|
||||
this.listenerGenerico = listenerGenerico;
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
Parada parada = (Parada) o;
|
||||
|
||||
Listcell lc = new Listcell(parada.getDescparada().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
Button btnRemoverPermissao = new Button();
|
||||
btnRemoverPermissao.setAttribute("data", o);
|
||||
btnRemoverPermissao.addEventListener("onClick", listenerGenerico);
|
||||
btnRemoverPermissao.setImage("/gui/img/remove.png");
|
||||
lc.appendChild(btnRemoverPermissao);
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", parada);
|
||||
}
|
||||
}
|
|
@ -174,11 +174,11 @@
|
|||
<tabpanel>
|
||||
<grid fixedLayout="true" height="400px">
|
||||
<columns>
|
||||
<column width="25%" />
|
||||
<column width="14%" />
|
||||
<column width="25%" />
|
||||
<column width="12%" />
|
||||
<column width="25%" />
|
||||
<column width="22%" />
|
||||
<column width="17%" />
|
||||
<column width="22%" />
|
||||
<column width="17%" />
|
||||
<column width="22%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
|
@ -308,7 +308,9 @@
|
|||
align="center" style="background: #ffa99c"
|
||||
image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesComunsAB.value')}"
|
||||
width="100%" />
|
||||
width="80%" />
|
||||
<listheader
|
||||
align="center" label="" width="20%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
|
@ -352,7 +354,9 @@
|
|||
align="center" style="background: #ffa99c"
|
||||
image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesComunsBC.value')}"
|
||||
width="100%" />
|
||||
width="80%" />
|
||||
<listheader
|
||||
align="center" label="" width="20%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
|
|
Loading…
Reference in New Issue