How to render graphicImage in dataTable based on a column value? - jsf

I have a dataTable, containing Package objects with id and phaseList attributes. I would like this dataTable to display package id and its five phases status with some graphicImages like colored circles.
For example: If a package's phase one is completed, the first circle rendered in a progress column is a green one, other four are red ones.
So basically I need to render a circle based on a value from phaseList element attribute. I already accomplished all of this, but it seems to me that there should be some other way. The problem is that I must have five phase color attributes in a backing bean and five getters and setters for those attributes (see code below). In those getters there is very similar code for all five attributes, so I thought I should have just one color attribute and one getter and there should somehow get an information which circle is currently rendered.
Is there any other way (with less duplicated code) to render those circles?
public class Package implements Serializable {
private static final long serialVersionUID = 1L;
private BigDecimal id;
private List<PhaseStatus> phaseList;
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
public void setPhaseList(List<PhaseStatus> phaseList) {
this.phaseList= phaseList;
}
public List<PhaseStatus> getPhaseList() {
return phaseList;
}
}
PhaseStatus class:
public class PhaseStatus implements Serializable {
private static final long serialVersionUID = 1L;
private BigDecimal phaseId;
private BigDecimal phaseStatus;
private String hint;
public void setPhaseId(BigDecimal phaseId) {
this.phaseId = phaseId;
}
public BigDecimal getPhaseId() {
return phaseId;
}
public void setPhaseStatus(BigDecimal phaseStatus) {
this.phaseStatus = phaseStatus;
}
public BigDecimal getPhaseStatus() {
return phaseStatus;
}
public void setHint(String hint) {
this.hint = hint;
}
public String getHint() {
return hint;
}
}
Xhtml code:
<p:column headerText="Id">
<p:outputLabel value="#{item.id}" />
</p:column>
<p:column headerText="Progress">
<p:commandLink id="lnkPhase1">
<p:graphicImage library="icons" name="#{bean.phaseOneColor}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint1" for="lnkPhase1" value="#{bean.phaseOneHint}" />
<p:commandLink id="lnkPhase2">
<p:graphicImage library="icons" name="#{bean.phaseTwoColor}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint2" for="lnkPhase2" value="#{bean.phaseTwoHint}" />
<p:commandLink id="lnkPhase3">
<p:graphicImage library="icons" name="#{bean.phaseThreeColor}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint3" for="lnkPhase3" value="#{bean.phaseThreeHint}" />
<p:commandLink id="lnkPhase4">
<p:graphicImage library="icons" name="#{bean.phaseFourColor}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint4" for="lnkPhase4" value="#{bean.phaseFourHint}" />
<p:commandLink id="lnkPhase5">
<p:graphicImage library="icons" name="#{bean.phaseFiveColor}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint5" for="lnkPhase5" value="#{bean.phaseFiveHint}" />
</p:column>
Part of my backing bean:
private String phaseOneColor;
private String phaseTwoColor;
private String phaseThreeColor;
private String phaseFourColor;
private String phaseFiveColor;
private DataTable dtPackages;
one of the getter's:
public String getPhaseOneColor() {
Package myPackage = (Package) getDtPackages().getRowData();
List<PhaseStatus> list = myPackage.getPhaseList();
BigDecimal status = list.get(0).getPhaseStatus();
if (status != null) {
switch (status.intValue()) {
case 1:
phaseOneColor = "green.png";
break;
default:
phaseOneColor = "red.png";
break;
}
} else {
phaseOneColor = "red.png";
}
return phaseOneColor;
}
I'm using PrimeFaces 5.1.

What about something like this
public String getPhaseColor(int phase) {
Package package = (Package) getDtPackages().getRowData();
List<PhaseStatus> list = package.getPhaseList();
BigDecimal status = list.get(phase).getPhaseStatus();
if (status != null) {
switch (status.intValue()) {
case 1:
phaseColor = "green.png";
break;
default:
phaseColor = "red.png";
break;
}
} else {
phaseColor = "red.png";
}
return phaseColor;
}
Similar for tooltips
public String getPhaseTooltip(int phase) {
Package package = (Package) getDtPackages().getRowData();
List<PhaseStatus> list = package.getPhaseList();
BigDecimal status = list.get(phase).getPhaseStatus();
String tooltip = null;
if (status != null) {
switch (status.intValue()) {
case n:
tooltip = "Phase " + phase + " tooltip";
break;
default:
}
} else {
tooltip = "probably error";
}
return tooltip;
}
And you use this in page like this
<p:column headerText="Progress">
<ui:repeat var="phase" value="#{item.phaseList}" varStatus="status">
<p:commandLink id="lnkPhase#{status.index + 1}">
<p:graphicImage library="icons" name="#{bean.getPhaseColor(status.index + 1)}" width="24px" height="24px" />
</p:commandLink>
<p:tooltip id="hint#{status.index + 1}" for="lnkPhase#{status.index + 1}" value="#{bean.getPhaseTooltip(status.index + 1)}" />
</ui:repeat>
</p:column>
There might be some errors in the code since I'm typing it in here directly, but you'll get the idea.
UPDATE
For Java 5 (method invocations with parameters doesn't work), you could do something like this
public Map<Integer, String> getPhaseColors() {
Package package = (Package) getDtPackages().getRowData();
Map<Integer, String> phaseColors = new HashMap<Integer, String>();
if (package != null) {
List<PhaseStatus> list = package.getPhaseList();
for (int i = 0; i < list.size(); i++;) {
BigDecimal ps = list.get(i).getPhaseStatus();
if (ps != null) {
phaseColors.put(i, ps.intValue() == 1 ? "green.png" : "red.png");
} else {
phaseColors.put(i, "red.png");
}
}
}
return phaseColor;
}
<p:graphicImage library="icons" name="#{bean.phaseColors[status.index + 1]}" width="24px" height="24px" />
Similar for tooltips.

Related

jsf static list won't show up in datatable

I'm trying to get a list to show in datatable from managed bean to JSF page but it doesn't work.
it's telling me " not records found " .
JSF managed bean :
#ManagedBean
#RequestScoped
public class TestController {
private List<Rhnom> list = new ArrayList<Rhnom>();
#SuppressWarnings("serial")
private List<String> list2 = new ArrayList<String>() {{
add("s1");
add("s2");
add("s3");
}};
//getters and setters
JSF page :
<p:dataTable value="#{tesController.list2}" var="type">
<p:column headerText="Lib">
<h:outputText value="#{type}">
</h:outputText>
</p:column>
</p:dataTable>
I consider that you have problems with the implementation
Link
https://www.primefaces.org/showcase/ui/data/datatable/basic.xhtml
Example
<p:dataTable var="car" value="#{dtBasicView.cars}">
<p:column headerText="Id">
<h:outputText value="#{car.id}" />
</p:column>
<p:column headerText="Year">
<h:outputText value="#{car.year}" />
</p:column>
<p:column headerText="Brand">
<h:outputText value="#{car.brand}" />
</p:column>
<p:column headerText="Color">
<h:outputText value="#{car.color}" />
</p:column>
</p:dataTable>
Managebean
#Named("dtBasicView")
#ViewScoped
public class BasicView implements Serializable {
private List<Car> cars;
#Inject
private CarService service;
#PostConstruct
public void init() {
cars = service.createCars(10);
}
public List<Car> getCars() {
return cars;
}
public void setService(CarService service) {
this.service = service;
}
}
Java Class
#Named
#ApplicationScoped
public class CarService {
private final static String[] colors;
private final static String[] brands;
static {
colors = new String[10];
colors[0] = "Black";
colors[1] = "White";
colors[2] = "Green";
colors[3] = "Red";
colors[4] = "Blue";
colors[5] = "Orange";
colors[6] = "Silver";
colors[7] = "Yellow";
colors[8] = "Brown";
colors[9] = "Maroon";
brands = new String[10];
brands[0] = "BMW";
brands[1] = "Mercedes";
brands[2] = "Volvo";
brands[3] = "Audi";
brands[4] = "Renault";
brands[5] = "Fiat";
brands[6] = "Volkswagen";
brands[7] = "Honda";
brands[8] = "Jaguar";
brands[9] = "Ford";
}
public List<Car> createCars(int size) {
List<Car> list = new ArrayList<Car>();
for(int i = 0 ; i < size ; i++) {
list.add(new Car(getRandomId(), getRandomBrand(), getRandomYear(), getRandomColor(), getRandomPrice(), getRandomSoldState()));
}
return list;
}
private String getRandomId() {
return UUID.randomUUID().toString().substring(0, 8);
}
private int getRandomYear() {
return (int) (Math.random() * 50 + 1960);
}
private String getRandomColor() {
return colors[(int) (Math.random() * 10)];
}
private String getRandomBrand() {
return brands[(int) (Math.random() * 10)];
}
private int getRandomPrice() {
return (int) (Math.random() * 100000);
}
private boolean getRandomSoldState() {
return (Math.random() > 0.5) ? true: false;
}
public List<String> getColors() {
return Arrays.asList(colors);
}
public List<String> getBrands() {
return Arrays.asList(brands);
}
}

#PostConstruct initialize is not getting invoked implicitly

Using -Primefaces 3.4 + JSF 2.0-
I am displaying some drop down values from database and the Postconstruct initialize method is not getting invoke implicitly.
Its working when I am calling the init method from other bean.
xhtml code:
<p:panelGrid style="width:50%" styleClass="panelgrid">
<p:row>
<p:column styleClass="columnA" style="width:10%">#{msgs.partTypeTitle}</p:column>
<p:column styleClass="columnB">
<h:selectOneMenu id="partTypeDpDnId" value="#{ppcrDetails.newPpcr.selectedPartType}" style="width:150px;font-size:13px;" >
<f:selectItems value="#{ppcrDetails.newPpcr.partsType}" />
</h:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column styleClass="columnA" style="width:25%">#{msgs.familyTitle}</p:column>
<p:column styleClass="columnB">
<h:selectOneMenu id="familyDpDnId" value="#{ppcrDetails.newPpcr.selectedFamilyValues}" style="width:150px;font-size:13px;">
<f:selectItems value="#{ppcrDetails.newPpcr.familyValues}" />
</h:selectOneMenu>
</p:column>
</p:row>
</p:panelGrid>
-Bean:
#ManagedBean(name = "newPpcr" , eager = true)
#SessionScoped
public class NewPpcr implements Serializable {
#PostConstruct
public void initialize() throws QtException {
LOGGER.log(Level.DEBUG, "QuotationTool: NewPpcr initilize.");
partsType.clear();
List<MdPartsType> partList = partsTypeFacade.findAll();
int partSequence = 0;
for (MdPartsType part : partList) {
partsType.add(new SelectItem(partSequence++, part.getPartType()));
}
familyValues.clear();
List<MdFamily> familyList = familyFacade.findAll();
int familySequence = 0;
for (MdFamily family : familyList) {
familyValues.add(new SelectItem(familySequence++, family.getFamily()));
}
}
But this is not working, So I am calling initialize method from other bean then drop down is populating:
#ManagedBean(name = "ppcrDetails", eager = true)
#SessionScoped
public class PpcrDetails implements Serializable{
private List<SelectItem> partType = new ArrayList<SelectItem>();
private List<SelectItem> familyValues = new ArrayList<SelectItem>();
public List<SelectItem> getPartType() {
try {
partType.clear();
if (partType == null || partType.isEmpty()) {
newPpcr.initialize();
this.partType = newPpcr.getPartsType();
}
} catch (QtException e) {
LOGGER.error(e.getMessage(), e);
}
return partType;
}
public void setPartType(List<SelectItem> partType) {
this.partType = partType;
}
public List<SelectItem> getFamilyValues() {
try {
familyValues.clear();
if (familyValues == null || familyValues.isEmpty()) {
newPpcr.initialize();
this.familyValues = newPpcr.getFamilyValues();
}
} catch (QtException e) {
LOGGER.error(e.getMessage(), e);
}
return familyValues;
}
public void setFamilyValues(List<SelectItem> familyValues) {
this.familyValues = familyValues;
}
From this approach I am able to display the values but it is breaking the some functionality.

Primefaces InputText passing empty value to the backing bean

I am using JSF template with top, left and content views of a chat application. On the left is a list of discussions, displayed using composite components. When I select one discussion, every conversation in the selected discussion is required to the displayed in the content. There is a create button in the content pane which allows to create a new text within the selected discussion. On click of create, a dialog opens to input the message text.
The issue is, when I select a discussion on the left, and then click on the create in the content, the text message from the dialog is passing blank values to the backing bean. The setter method is getting called, but the value passed is blank. I observed that, if I click on create when the page is loaded, without selecting a discussion, it is sending the message with correct value. Every subsequent creates even after selecting a discussion continues to pass the same value.
I am using Primefaces 3.4.2 and glassfish 4.
Below is the center pane xhtml
<h:body>
<h:form id="newForm">
<p:commandLink id="test" value="Create Bubble" />
<p:overlayPanel id="panel" for="test" >
<p:commandButton id="map" icon="ui-icon-map" onclick="map_dlg.show();"/>
<p:commandButton id="map1" icon="ui-icon-document" onclick="survey_dlgcreate.show();"/>
<p:commandButton id="map2" icon="ui-icon-folder" onclick="txt_dlg.show();"/>
</p:overlayPanel>
<a:discussionComp discussion="#{displayDiscussionBean}"/>
</h:form>
<p:focus id="focus" context="textdlg"/>
<p:dialog id="textdlg" modal="true" header="Text bubble" appendToBody="true" hideEffect="fade" widgetVar="txt_dlg">
<h:form id="t3">
<p:outputLabel value="Enter your message"/><p:inputText value="#{displayDiscussionBean.txtMsg}"/>
<p:commandButton icon="Post" action="#{displayDiscussionBean.createTextBubble()}" oncomplete="txt_dlg.hide();"/>
</h:form>
</p:dialog>
</h:body>
Here is what my left panel is.
<!--IMPLEMENTATION-->
<cc:implementation>
<h:form id="leftPanel">
<p:dataTable id="disc" value="#{cc.attrs.discussionModel}" var="discussion" style="margin-top: 2px;height: 100%" selectionMode="single" selection="#{discussionBean.selectedDiscussion}" >
<p:ajax event="rowSelect" update=":detail_panel" />
<f:facet name="header">
Discussions
<h:commandLink action="#{discussionBean.createDiscussion()}">
<p:graphicImage id="add" url="/resources/images/plus.png" style="height: 25px;float: right" />
<p:tooltip for="add" value="Add Discussion" style="font-size: 12px" hideEffect="fade"/>
</h:commandLink>
</f:facet>
<p:column style="font-size: 12px;">
#{discussion.title}
</p:column>
</p:dataTable>
</h:form>
</cc:implementation>
My backing bean (displayDiscussionBean) for the create is a SessionScoped bean, and has get and set methods for the txtMsg. However on submit, set method gets fired, but with blank value. Below is the backing bean.
#Named
#SessionScoped
public class DisplayDiscussionBean implements Serializable {
private static final long serialVersionUID = 1L;
#EJB
private DiscussionEJB discussionEJB;
private TextEJB textEJB;
private DiscussionEntity de;
private HashMap<Integer, TextEntity> textMap;
private String selectedOption;
#Inject
private DiscussionBean discussionBean;
private String msg;
private Integer currentBubbleId;
private Integer currentBubbleType = 55;
#Inject
private Locations loc;
private String txtMsg;
private TreeNode root;
private Integer did;
public Integer getDid() {
return did;
}
public void setDid(Integer did) {
this.did = did;
setDetails();
}
public DisplayDiscussionBean() {
}
public DisplayDiscussionBean(Integer id) {
}
private void setDetails() {
de = discussionEJB.getDiscussionDetails(did);
textMap = new HashMap<>();
root = new DefaultTreeNode("Root", null);
Map<Integer, TreeNode> nodeMap = new HashMap<>();
for (BubbleEntity b : de.getBubbleList()) {
TreeNode node = new DefaultTreeNode(b, null);
nodeMap.put(b.getBubbleId(), node);
TextEntity te = (TextEntity) b;
textMap.put(te.getBubbleId(), te);
}
for (BubbleEntity b : de.getBubbleList()) {
if (b.getParentId() != null) {
TreeNode currNode = nodeMap.get(b.getBubbleId());
TreeNode parentNode = nodeMap.get(b.getParentId());
currNode.setParent(parentNode);
} else {
TreeNode currNode = nodeMap.get(b.getBubbleId());
currNode.setParent(root);
}
}
}
public void createTextBubble() {
if (did == null){
did=discussionBean.getSelectedDiscussion().getDiscussionId();
}
textEJB.createTextBubble(txtMsg, did, null);
}
public DiscussionEntity getDe() {
return de;
}
public void setDe(DiscussionEntity de) {
this.de = de;
}
public TreeNode getRoot() {
return root;
}
public void setRoot(TreeNode root) {
this.root = root;
}
public HashMap<Integer, TextEntity> getTextMap() {
return textMap;
}
public void setTextMap(HashMap<Integer, TextEntity> textMap) {
this.textMap = textMap;
}
public String getSelectedOption() {
return selectedOption;
}
public void setSelectedOption(String selectedOption) {
this.selectedOption = selectedOption;
}
public Integer getCurrentBubbleId() {
return currentBubbleId;
}
public void setCurrentBubbleId(Integer currentBubbleId) {
this.currentBubbleId = currentBubbleId;
}
public Integer getCurrentBubbleType() {
return currentBubbleType;
}
public void setCurrentBubbleType(Integer currentBubbleType) {
this.currentBubbleType = currentBubbleType;
}
public String getTxtMsg() {
return txtMsg;
}
public void setTxtMsg(String txtMsg) {
this.txtMsg = txtMsg;
System.out.println("set text msg is "+txtMsg);
}
}
Any suggestioins what am I doing wrong here?
Try using only one form instead. Remove the inner form. I too had a similar issue and removing inner form worked for me.
If that doesn't work try adding 'process' or 'execute' attribute to your button which calls your bean method

Unable to find matching navigation case with from-view-id '/index.xhtml' for action : JSF

I am getting the following error :
Unable to find matching navigation case with from-view-id '/index.xhtml' for action '#{medcontroller.getMedGeneric}' with outcome 'javax.faces.model.ListDataModel#7a652236'
I am new to jsf and I'm really clueless about solving this error. I have a ManagedBean with the following code:
MedController.java
#ManagedBean(name = "medcontroller")
#SessionScoped
public class MedController implements Serializable {
int startId;
String gName;
int endId;
DataModel medNames;
//DataModel medGeneric;
MedicineHelper helper;
private int recordCount = 1000;
private int pageSize = 10;
private Medicine current;
private int selectedItemIndex;
public MedController() {
helper = new MedicineHelper();
startId = 1;
endId = 10;
}
public MedController(int startId, int endId) {
helper = new MedicineHelper();
this.startId = startId;
this.endId = endId;
}
public Medicine getSelected() {
if (current == null) {
current = new Medicine();
selectedItemIndex = -1;
}
return current;
}
public DataModel getMedNames() {
if (medNames == null) {
medNames = new ListDataModel(helper.getMedNames(startId, endId));
}
return medNames;
}
public String getgName()
{
return gName;
}
public void setgName(String gName)
{
this.gName = gName;
}
public DataModel getMedGeneric() {
if (medNames == null) {
medNames= new ListDataModel(helper.getMedGeneric(gName));
}
return medNames;
}
void recreateModel() {
medNames = null;
}
public boolean isHasNextPage() {
if (endId + pageSize <= recordCount) {
return true;
}
return false;
}
public boolean isHasPreviousPage() {
if (startId-pageSize > 0) {
return true;
}
return false;
}
public String next() {
startId = endId+1;
endId = endId + pageSize;
recreateModel();
return "index";
}
public String previous() {
startId = startId - pageSize;
endId = endId - pageSize;
recreateModel();
return "index";
}
public int getPageSize() {
return pageSize;
}
public String prepareView(){
current = (Medicine) getMedNames().getRowData();
return "browse";
}
public String prepareList(){
recreateModel();
return "index";
}
}
And here is my JSF file
index.xhtml
<ui:define name="body">
<h:form styleClass="jsfcrud_list_form">
<h:commandLink action="#{medcontroller.previous}" value="Previous #{medcontroller.pageSize}" rendered="#{medcontroller.hasPreviousPage}"/>
<h:commandLink action="#{medcontroller.next}" value="Next #{medcontroller.pageSize}" rendered="#{medcontroller.hasNextPage}"/>
<h:dataTable value="#{medcontroller.medNames}" var="item" border="1" cellpadding="15" cellspacing="10" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
<h:column>
<f:facet name="header">
<h:outputText value="BrandName"/>
</f:facet>
<h:outputText value="#{item.brandName}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Generic"/>
</f:facet>
<h:outputText value="#{item.generic}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value=" "/>
</f:facet>
<h:commandLink action="#{medcontroller.prepareView}" value="View"/>
</h:column>
</h:dataTable>
<h:inputText value="#{medcontroller.gName}" />
<h:commandButton value="Submit" action="#{medcontroller.getMedGeneric}" />
</h:form>
</ui:define>
Please help me solve the error.
Also, I do not have a faces-config.xml file. I am using netbeans ide 7.1.2 web application with jsf and hibernate framework.
Thank you in advance.
The <h:commandButton action> must point to a method which invokes some business logic and returns either void or a String representing the target page you'd like to (re)display. However you returned a whole ListDataModel which isn't making any sense to JSF navigation handler and hence this error.
Something like this should do:
public String getMedGeneric(){
// Do your business logic here.
return "someViewId";
}
This will navigate to someViewId.xhtml. However, if you intend to stick on the same view, just let it return void (or null) and it will redisplay the same view.
public void getMedGeneric(){
// Do your business logic here.
}
By the way, it's really a poor naming convention to prefix action method names with get. This is confusing and makes your code not self-documenting. Rather name it loadMedGeneric() or so. I'm merely guessing as you didn't tell anywhere about the concrete functional requirement, what exactly that button should be doing.
getMedGeneric should return java.lang.String which represent navigation to another page described in faces-config.xml. In your case it return some model so it will not work unfortunatell. Let try to put getMedGeneric() action to actionListener and then in action put navigation String. i.e:
action="navString" actionListener="#{medcontroller.getMedGeneric}"
you should try just
actionListener="#{medcontroller.getMedGeneric}"

How to use selectOneMenu without converter?

I'm using selectOneMenu for displaying some pictures and Strings, the pictures is for displaying purposes only i have (i.e. i have nothing to do with them on submitting) i want only to set the string next to the image, i have a conflict in setting the itemValue of the f:selectItems to the String required, when i do that the images doesn't appear at all, in a word i want to only submit the value of the string in the chosen selectItem without using converter:
JSF Code:
<p:selectOneMenu id="SkinChooser" value="#{personBean.ObjectDTO.personDescription.skin}"
panelStyle="width:150px" effect="fade" var="s"
style="width:160px" converter="#{personBean.converter}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{missedPersonBean.selectedSkins}"
var="skin" itemLabel="#{skin.skinType}" itemValue="#{skin}" />
<p:column>
<p:graphicImage value="/resources/images/skin/#{s.skinPhoto}"
width="40" height="50" />
</p:column>
<p:column>
#{s.skinType}
</p:column>
</p:selectOneMenu>
Skin.Java
public class Skin {
String skinPhoto;
String skinType;
public Skin() {
}
public Skin(String photo, String type) {
this.skinPhoto = photo;
this.skinType = type;
}
public String getSkinPhoto() {
return skinPhoto;
}
public void setSkinPhoto(String skinPhoto) {
this.skinPhoto = skinPhoto;
}
public String getSkinType() {
return skinType;
}
public void setSkinType(String skinType) {
this.skinType = skinType;
}
}
personBean.Java
#ManagedBean(name = "personBean")
#SessionScoped
public class ReportPerson {
private Skin skin;
private static List<Skin> selectedSkins;
static {
System.err.println("Array is filled");
selectedSkins = new ArrayList<Skin>();
selectedSkins.add(new Skin("1", "Pale white"));
selectedSkins.add(new Skin("2", "Fair white"));
selectedSkins.add(new Skin("3", "Light brown"));
selectedSkins.add(new Skin("4", "Moderate brown"));
selectedSkins.add(new Skin("5", "Dark brown"));
selectedSkins.add(new Skin("6", "Deeply pigmented"));
System.err.println("Finished Filling");
}
public List<Skin> getSelectedSkins() {
return selectedSkins;
}
public void setSelectedSkins(List<Skin> selectedSkins) {
this.selectedSkins = selectedSkins;
}
public Skin getSkin() {
return skin;
}
public void setSkin(Skin skin) {this.skin = skin;}
}

Resources