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