Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » merging from sf to nebula release w glazedlists
merging from sf to nebula release w glazedlists [message #1010816] Mon, 18 February 2013 09:37 Go to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 352
Registered: July 2009
Senior Member
i try to merge my code from
net.sourceforge.nattable.core-2.3.1.jar
net.sourceforge.nattable.extension.glazedlists-2.3.1.jar

to
org.eclipse.nebula.widgets.nattable.core-0.9.0.jar
org.eclipse.nebula.widgets.nattable.extension.glazedlists-0.9.0.jar


actually i thought there is not much of a change, as 2.3.11 was only a bugfix release, and the move to 0.9.0 was namespace and adding features.

fact is there was also a change in the glazedlists (whole packages are gone now - ca.odell.glazedlists)
my code is based on these classes, so what do i need to do to get it working again?

do you have tutorials how to merge?

my current table is pretty complex, as i got sorting, filtering, styling, and dynamic datatype handling included in my project. (about 20+ classes for the table...)

note:
FilterList, SortedList, ObservableElementList, TransformedList, EventList, BasicEventList<E>, FunctionList
all this is marked as red and unknown.

btw... replacing the LayerCell to ILayerCell did not work for me
	/**
	 * If a cell belongs to a column group: column position - set to the start
	 * position of the group span - set to the width/size of the column group<br>
	 * NOTE: gc.setClip() is used in the CompositeLayerPainter to ensure that
	 * partially visible Column group header cells are rendered properly.
	 * */
	@Override
	public ILayerCell getCellByPosition(int columnPosition, int rowPosition) {
		int bodyColumnIndex = getColumnIndexByPosition(columnPosition);
		// Column group header cell
		if (columnGroupModel.isPartOfAGroup(bodyColumnIndex)) {
			return super.getCellByPosition(columnPosition, rowPosition);
		} else { // render column header w/ rowspan = 2
			ILayerCell cell = columnHeaderLayer.getCellByPosition(
					columnPosition, getGroupHeaderRowPostion());
// RED - function 'getGroupHeaderRowPostion()' does not 
			if (cell != null) {
				cell.updateLayer(this);// RED - function does not 
				cell.updateRowSpan(1);// RED - function does not exist
			}
			return cell;
		}
	}
Re: merging from sf to nebula release w glazedlists [message #1010826 is a reply to message #1010816] Mon, 18 February 2013 09:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1335
Registered: July 2012
Senior Member
Hi Ludwig,

no there was no change to GlazedLists there. It is still using GlazedLists 1.8. But we hopefully will update to 1.9 soon. This looks more like an issue with your target platform or a missing GlazedLists plugin in your dropins folder. Wink

Greez,
Dirk
Re: merging from sf to nebula release w glazedlists [message #1010885 is a reply to message #1010826] Mon, 18 February 2013 12:18 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 352
Registered: July 2009
Senior Member
what you say sounds like i need glazedlists beside the glazedlists extension for nattable.

when nattable was at sf the glazedlists were included in the jar file.

so now i need
net.sourceforge.nattable.core-2.3.1.jar
net.sourceforge.nattable.extension.glazedlists-2.3.1.jar
glazedlists-1.8.0_java15.jar


whereat
net.sourceforge.nattable.core-2.3.1.jar
net.sourceforge.nattable.extension.glazedlists-2.3.1.jar

which was fine...

so after adding glazedlists-1.8.0_java15.jar and fixing all packages all seems fine (at least no errors for compiling but one problem remains (the function i wrote below)
i don't know how to adapt it to fit the new api
as updateLayer, updateRowSpan and getGroupHeaderRowPosition does no longer exist.

PS: thanks for your fast reply! really appreciate it
Re: merging from sf to nebula release w glazedlists [message #1010892 is a reply to message #1010885] Mon, 18 February 2013 12:34 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1335
Registered: July 2012
Senior Member
I just looked into the 2.3.2 Sourceforge version of NatTable, and there the GlazedLists jar wasn't part of the glazedlists extension jar. As far as I can remember I always needed to put the glazedlists jar manually to the dropins folder or the target platform I use. It would even be strange in terms of licensing if we would package third-party-libraries in our own ones. But as GlazedLists hopefully will be available in the Orbit p2 update site, this shouldn't matter in the future.

Quote:

i don't know how to adapt it to fit the new api
as updateLayer, updateRowSpan and getGroupHeaderRowPosition does no longer exist.


You need to be a little bit more precise. Where don't you find those methods(?) anymore?

This one is the post for the 0.9.0 release.
http://www.eclipse.org/forums/index.php/t/383590/

This is the post for the 2.3.2 release which was the last one on Sourceforge, as it seems you missed that one too.
http://sourceforge.net/projects/nattable/forums/forum/744992/topic/5241765

Greez,
Dirk
Re: merging from sf to nebula release w glazedlists [message #1010896 is a reply to message #1010885] Mon, 18 February 2013 12:42 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 352
Registered: July 2009
Senior Member
this function was in my CustomColumnGroupHeaderLayer which extends your ColumnGroupHeaderLayer

the problem with the default one is:
if there are no groups the height is 1 line but rendered height is 2 lines;

when i overwrite your function with this one (i fixed it now)
/**
	 * If a cell belongs to a column group: <br>
	 * column position - set to the start position of the group<br>
	 * span position - set to the width/size of the column group<br>
	 * NOTE: gc.setClip() is used in the CompositeLayerPainter to ensure that
	 * partially visible Column group header cells are rendered properly.
	 **/
	@Override
	public ILayerCell getCellByPosition(int columnPosition, int rowPosition) {
		int bodyColumnIndex = getColumnIndexByPosition(columnPosition);
		// Column group header cell
		if (columnGroupModel.isPartOfAGroup(bodyColumnIndex)) {
			return super.getCellByPosition(columnPosition, rowPosition);
		} else { // render column header w/ rowspan = 2
			// ILayerCell cell = columnHeaderLayer.getCellByPosition(
			// columnPosition, getGroupHeaderRowPostion());
			ILayerCell cell = columnHeaderLayer.getCellByPosition(
					columnPosition, rowPosition);
			// if (cell != null) {
			// cell.updateLayer(this);
			// cell.updateRowSpan(1);
			// }
			return cell;
		}
	}


note that the outcommented stuff is my old code (which i used before)
now the height of my columns is correct again. thanks for you help!
Re: merging from sf to nebula release w glazedlists [message #1010899 is a reply to message #1010896] Mon, 18 February 2013 12:48 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1335
Registered: July 2012
Senior Member
Doesn't ColumnGroupHeaderLayer.setCalculateHeight(true) fullfill your requirements?
Re: merging from sf to nebula release w glazedlists [message #1011777 is a reply to message #1010899] Wed, 20 February 2013 08:34 Go to previous message
Ludwig Moser is currently offline Ludwig Moser
Messages: 352
Registered: July 2009
Senior Member
confirmed!
seems to do the same job as my code Smile
(afaik this was not available when i started my table cfg)
Previous Topic:Custom IConfigLabelAccumulator gets same row positions even after scrolling the table
Next Topic:NatTableBuilder download?
Goto Forum:
  


Current Time: Tue Oct 21 08:57:23 GMT 2014

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

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