PropertyElementspublic class PropertyElements extends Object
Fields Summary |
---|
private com.sun.enterprise.tools.common.dd.connector.ResourceAdapter | ra |
Constructors Summary |
---|
public PropertyElements(com.sun.enterprise.tools.common.dd.connector.ResourceAdapter ra)Creates new PropertyElements
this.ra = ra;
| public PropertyElements(PropertyElements source)
this.ra = (ResourceAdapter) source.ra.clone();
| PropertyElements(String[] args)
int rowCount = 0;
if (null != args && args.length > 0) {
try {
rowCount = Integer.parseInt(args[0]);
}
catch (Throwable t) {
t.printStackTrace();
}
}
ra = new ResourceAdapter();
for (int i = 0; i < rowCount; i++) {
ra.addPropertyElement(true);
ra.setAttributeValue(ResourceAdapter.PROPERTY,i,"name",""+i); //NOI18N
ra.setAttributeValue(ResourceAdapter.PROPERTY,i,"value",""+(rowCount - i)); //NOI18N
}
//
// Note: the ResourceAdapter MUST be part of a SunConnector or the
// PropertyElementsTableModel is BROKEN.
SunConnector connectorDD = SunConnector.createGraph();
connectorDD.setResourceAdapter(ra);
|
Methods Summary |
---|
java.lang.String | dumpIt()
return ra.dumpBeanNode();
| public java.lang.Object | getAttributeDetail(int row, int col)
return ra.getAttributeValue(ResourceAdapter.PROPERTY, row, intToAttribute(col)); //NOI18N
| public int | getLength()
return ra.sizePropertyElement();
| public com.sun.enterprise.tools.common.dd.connector.ResourceAdapter | getResourceAdapter()
return ra;
| public int | getWidth()
return 2;
| private java.lang.String | intToAttribute(int col)
if (col == 0)
return "name"; // NOI18N
if (col == 1)
return "value"; // NOI18N
return "error"; // NOI18N
| public void | setAttributeDetail(java.lang.Object v, int r, int c)
String input = (String) v;
if (null == input || 0 == input.trim().length()) {
// test for need to delete
if (r >= getLength())
return;
int otherDex = c - 1;
if (otherDex < 0)
otherDex = -otherDex;
String otherVal = ra.getAttributeValue(ResourceAdapter.PROPERTY, r,
intToAttribute(otherDex));
if (null == otherVal || 0 == otherVal.trim().length()) {
ra.removePropertyElement(r);
return;
}
input = " "; // NOI18N
}
while (r >= getLength())
ra.addPropertyElement(true);
ra.setAttributeValue(ResourceAdapter.PROPERTY, r, intToAttribute(c), input); //NOI18N
| public java.lang.String | toString()
return ra.dumpBeanNode();
|
|