1 19 20 23 24 package org.netbeans.modules.j2ee.sun.ws7.serverresources.wizards; 25 26 27 31 public class ResourceConfigHelper { 32 33 private ResourceConfigData datas[] = null; 34 private int index; 35 private boolean forEdit = false; 36 37 38 public ResourceConfigHelper(int size) { 39 this(size, 0); 40 } 41 42 public ResourceConfigHelper(int size, int index) { 43 datas = new ResourceConfigData[size]; 44 this.index = index; 45 } 46 47 public ResourceConfigHelper(ResourceConfigData data, int size, int index) { 48 this(size, index); 49 datas[index] = data; 50 } 51 52 public ResourceConfigHelper(ResourceConfigData data) { 53 this(data, 1, 0); 54 } 55 56 public int getIndex() { 57 return index; 58 } 59 60 public void setIndex(int index) { 61 this.index = index; 62 } 63 64 public boolean getForEdit() { 65 return forEdit; 66 } 67 68 public ResourceConfigHelper setForEdit(boolean forEdit) { 69 this.forEdit = forEdit; 70 return this; 71 } 72 73 public ResourceConfigData getData() { 74 ResourceConfigData data = datas[index]; 75 if (data == null) { 76 data = new ResourceConfigData(); 77 datas[index] = data; 78 } 79 return data; 80 } 81 82 public String toString() { 83 StringBuffer str = new StringBuffer (); 84 str.append("index is " + index + "\n"); for (int i = 0; i < datas.length; i++) { 86 if (datas[i] == null) 87 str.append("datas[ " + i + " ] is null"); else 89 str.append("datas[ " + i + " ] is:\n" + datas[i].toString()); } 91 return str.toString(); 92 } 93 94 } 95 | Popular Tags |