1 33 34 package com.icesoft.icefaces.samples.showcase.layoutPanels.positionedPanel; 35 36 import com.icesoft.faces.component.panelpositioned.PanelPositionedEvent; 37 38 import java.util.ArrayList ; 39 import java.util.List ; 40 41 47 public class PositionedPanelBean { 48 49 private List people = new ArrayList (); 50 51 public PositionedPanelBean() { 52 53 people.add(new PostionedPanelPerson("Mary Smith")); 55 people.add(new PostionedPanelPerson("James Johnson")); 56 people.add(new PostionedPanelPerson("Patricia Williams")); 57 people.add(new PostionedPanelPerson("John Jones")); 58 people.add(new PostionedPanelPerson("Linda Brown")); 59 people.add(new PostionedPanelPerson("Robert Davis")); 60 people.add(new PostionedPanelPerson("Barbara Miller")); 61 resetRank(); 62 } 63 64 65 private void resetRank() { 66 for (int i = 0; i < people.size(); i++) { 67 ((PostionedPanelPerson) people.get(i)).setRank(i + 1); 68 } 69 } 70 71 72 public void changed(PanelPositionedEvent evt) { 73 resetRank(); 74 if (evt.getOldIndex() >= 0){ 75 76 ((PostionedPanelPerson)people.get( 77 evt.getIndex())).getEffect().setFired(false); 78 } 79 80 } 81 82 public List getPeople() { 83 return people; 84 } 85 86 public void setPeople(List people) { 87 this.people = people; 88 } 89 90 } 91 | Popular Tags |