Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Implementing IUniqueIndexLayer by a CompositeLayer
Implementing IUniqueIndexLayer by a CompositeLayer [message #1016668] Thu, 07 March 2013 05:03 Go to next message
Alex Kipling is currently offline Alex Kipling
Messages: 250
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?

Re: Implementing IUniqueIndexLayer by a CompositeLayer [message #1016682 is a reply to message #1016668] Thu, 07 March 2013 05:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1263
Registered: July 2012
Senior Member
Seems to make sense
Re: Implementing IUniqueIndexLayer by a CompositeLayer [message #1016686 is a reply to message #1016682] Thu, 07 March 2013 05:58 Go to previous message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
Thnx. I was not sure, whether the CompositeLayer is the right place to identify itself as a whole to the selection layer.
Previous Topic:Suggestion regarding ColumnHideShowLayer.saveState()
Next Topic:RowHeaderLayer and CompositeLayer
Goto Forum:
  


Current Time: Sat Aug 30 04:25:43 EDT 2014

Powered by FUDForum. Page generated in 0.01812 seconds