Skip to main content


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 10:03 Go to next message
Alex Kipling is currently offline Alex KiplingFriend
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?

Re: Implementing IUniqueIndexLayer by a CompositeLayer [message #1016682 is a reply to message #1016668] Thu, 07 March 2013 10:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
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 10:58 Go to previous message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
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:EditableGridExample fell asleep
Goto Forum:
  


Current Time: Thu Apr 25 05:28:46 GMT 2024

Powered by FUDForum. Page generated in 0.02753 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top