Methods Summary |
---|
public void | addItem(java.lang.String name, java.lang.String value)Add an item name and string value
// Insert a new row into the container
bmc.addRow();
// Add the item at the end
bmc.set(bmc.getRowCount()-2, 0, name);
bmc.set(bmc.getRowCount()-2, 1, value);
|
public void | addItem(java.lang.String name, boolean state)Add an item name and boolean value
this.addItem(name, (state ? "True" : "False"));
|
public void | jbInit()UI elements of the attribute panel
this.setBevelInner(BevelPanel.FLAT);
tempColumns[0] = new ColumnView();
tempColumns[0].setAlignment(Alignment.LEFT | Alignment.MIDDLE);
tempColumns[0].setCaption("Attribute");
tempColumns[0].setWidth(100);
tempColumns[1] = new ColumnView();
tempColumns[1].setAlignment(Alignment.LEFT | Alignment.MIDDLE);
tempColumns[1].setCaption("Value");
tempColumns[1].setWidth(305);
gridControl1.setColumnViews(tempColumns);
gridControl1.setDragSubfocus(false);
gridControl1.setEditInPlace(false);
gridControl1.setGridVisible(false);
// gridControl1.setHScrollVisible(false);
gridControl1.setResizableRows(false);
gridControl1.setRowHeaderVisible(false);
gridControl1.setSelectRow(true);
gridControl1.setShowFocus(false);
// gridControl1.setVScrollVisible(false);
gridControl1.setModel(bmc);
gridControl1.setViewManager(new BasicViewManager(new TextItemPainter(), new TextItemEditor()));
this.setLayout(gridLayout1);
this.add(gridControl1, null);
|
public void | removeItem(java.lang.String name)Loop through the container. This will remove all occurances
of the item just in case there are duplicates. Use
removeItem(int) to remove only a specific item.
for (int i=0;i<bmc.getRowCount();i++) {
if (bmc.get(i, 0).equals(name) == true)
bmc.removeRow(i);
}
|
public void | removeItem(int index)This will remove only the item specified in the index paramater
bmc.removeRow(index);
|
public void | setValue(java.lang.String name, java.lang.String value)Loop through the container. This will set all occurances
of the item just in case there are duplicates. Use
setItem(int) to set only a specific item. If the specified
item does not exist, it is added to the display.
boolean foundItem = false;
if (bmc.getRowCount() > 1) {
for (int i=0;i<bmc.getRowCount()-1;i++) {
if (bmc.get(i, 0).equals(name) == true) {
foundItem = true;
bmc.set(i, 1, value);
}
}
}
if (foundItem == false)
this.addItem(name, value);
|
public void | setValue(int index, boolean state)This will set only the item specified in the index paramater
String value;
this.setValue(index, (state ? "True" : "False"));
|
public void | setValue(int index, java.lang.String value)This will set only the item specified in the index paramater
bmc.set(index, 1, value);
|
public void | setValue(java.lang.String name, boolean state)Loop through the container. This will set all occurances
of the item just in case there are duplicates. Use
setItem(int) to set only a specific item. If the specified
item does not exist, it is added to the display.
this.setValue(name, (state ? "True" : "False"));
|