Implementing IUniqueIndexLayer by a CompositeLayer [message #1016668] |
Thu, 07 March 2013 10:03 |
Alex Kipling Messages: 260 Registered: July 2012 |
Senior Member |
|
|
I would like to make a CompositeLayer, with two vertically composed layers to implement IUniqueIndexLayer.
public LayerCompositeAll() {
super(1, 2);
createLayers();
}
private void createLayers(){
//CREATE LAYERS
// Layer contains existing domain objects
this.layerNewObjects = new LayerNewObjects();
this.layerExistingObjects = new LayerExistingObjects();
setChildLayer(REGIONS.BODY_NEW_OBJECTS, layerNewObjects, 0, 0);
setChildLayer(REGIONS.BODY_EXISTING_OBJECTS, layerExistingObjects, 0, 1);
}
@Override
public int getColumnPositionByIndex(int columnIndex) {
return layerExistingObjects.getColumnPositionByIndex(columnIndex);
}
@Override
public int getRowPositionByIndex(int rowIndex) {
int rowCount = layerNewObjects.getRowCount();
if(rowIndex < rowCount){
return layerNewObjects.getRowPositionByIndex(rowIndex);
}else{
return rowCount + layerExistingObjects.getRowPositionByIndex(rowIndex);
}
}
Question:
Do I implement the getRowPositionByIndex as intended? Is it intended, that the inexes are mapped to one of my vertically aligned tables?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03015 seconds