Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Displaying composite in NaTable cell(I need to display a composite inside a NatTable cell.....)
Displaying composite in NaTable cell [message #1448710] Mon, 20 October 2014 10:23 Go to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
Hii...
I need to display a composite(eg: A editable graph or a editable table) inside a NatTable cell.
I used cell editor for that purpose and able to do that... but the problem is composite appears only after clicking on the cell.
Is there any way to display composite in the cell without any user interaction.

Thank you
Re: Displaying composite in NaTable cell [message #1448773 is a reply to message #1448710] Mon, 20 October 2014 12:22 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
That depends on your painter. Do you ensure to set the bounds of your control in the paintCell() method of your painter?
Re: Displaying composite in NaTable cell [message #1449294 is a reply to message #1448773] Tue, 21 October 2014 06:22 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
Thank you for your reply.
I have one more query can we persists the selected cells..I mean if cell2(c2) is selected and can I persist the previously selected cells say(cell(c0) and cell1(c1))
Re: Displaying composite in NaTable cell [message #1449318 is a reply to message #1449294] Tue, 21 October 2014 07:14 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
What do you mean with persisting selected cells? Persisting in terms of storing it in a file or persisting in terms of keeping the previous selected cells in case you are selecting others?

For persisting selection in a file you need to create and register a corresponding IPersistable. For keeping the selection and not to clear it on select operations you need to register custom commands or command handlers that always perform selections with a internally pressed CTRL key.
Re: Displaying composite in NaTable cell [message #1449403 is a reply to message #1449318] Tue, 21 October 2014 10:00 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
Hii...
I am using ICellPainter as described by you in the following link
https://www.eclipse.org/forums/index.php/t/489481/

But I want to create the control over the cell .... currently I created a control over another control say a main control ... it is giving weird.

thank you
Re: Displaying composite in NaTable cell [message #1449413 is a reply to message #1449403] Tue, 21 October 2014 10:13 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I don't understand what you are trying to achieve
Re: Displaying composite in NaTable cell [message #1449428 is a reply to message #1449413] Tue, 21 October 2014 10:36 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
I just fixed it ..... thank you.....Smile
Re: Displaying composite in NaTable cell [message #1449527 is a reply to message #1449428] Tue, 21 October 2014 13:46 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
Hii
How to avoid repainting of the cell......in my case on scroll the the painted cell getting disturbed and flickering of the table happening a lot..... is that possible to avoid repainting of the cell....
Thank you
Re: Displaying composite in NaTable cell [message #1449597 is a reply to message #1449527] Tue, 21 October 2014 15:27 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
??? if you scroll it needs to be repainted, or how should otherwise the view be updated? NatTable is a completely painted control
Re: Displaying composite in NaTable cell [message #1453773 is a reply to message #1449597] Mon, 27 October 2014 13:11 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
I am creating composite over the nattable and displaying it inside the cell using control.setBounds(bounds) inside cellpainter method.
But when the table is scrolled the cell contents are not scrolling means to say they are fixed at a position.... please suggest a way .
Re: Displaying composite in NaTable cell [message #1453777 is a reply to message #1453773] Mon, 27 October 2014 13:15 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I guess you need to update the bounds of the control on scrolling. If you are using a custom ICellPainter for this, you need to do this in paintCell()
Re: Displaying composite in NaTable cell [message #1454262 is a reply to message #1453777] Tue, 28 October 2014 06:40 Go to previous messageGo to next message
Girish Bhat is currently offline Girish BhatFriend
Messages: 22
Registered: October 2014
Location: Bangalore
Junior Member
I tried with updating bounds .... I am getting following exception on scrolling of nattable

org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4423)
at org.eclipse.swt.SWT.error(SWT.java:4312)
at org.eclipse.swt.SWT.error(SWT.java:4283)
at org.eclipse.swt.widgets.Widget.error(Widget.java:472)
at org.eclipse.swt.widgets.Control.createHandle(Control.java:704)
at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:307)
at org.eclipse.swt.widgets.Decorations.createHandle(Decorations.java:420)
at org.eclipse.swt.widgets.Shell.createHandle(Shell.java:584)
at org.eclipse.swt.widgets.Control.createWidget(Control.java:744)
at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:134)
at org.eclipse.swt.widgets.Decorations.createWidget(Decorations.java:428)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:297)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:375)
at org.eclipse.jface.window.Window.createShell(Window.java:488)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1104)
at org.eclipse.ui.internal.statushandlers.WorkbenchStatusDialogManagerImpl.doAddStatusAdapter(WorkbenchStatusDialogManagerImpl.java:260)
at org.eclipse.ui.internal.statushandlers.WorkbenchStatusDialogManagerImpl.addStatusAdapter(WorkbenchStatusDialogManagerImpl.java:197)
at org.eclipse.ui.statushandlers.WorkbenchStatusDialogManager.addStatusAdapter(WorkbenchStatusDialogManager.java:156)
at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.showStatusAdapter(WorkbenchErrorHandler.java:101)
at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.handle(WorkbenchErrorHandler.java:57)
at org.eclipse.ui.internal.ide.IDEWorkbenchErrorHandler.handle(IDEWorkbenchErrorHandler.java:106)
at org.eclipse.ui.internal.WorkbenchErrorHandlerProxy.handle(WorkbenchErrorHandlerProxy.java:36)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:189)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:242)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopException(WorkbenchAdvisor.java:326)
at org.eclipse.ui.internal.Workbench$3.eventLoopException(Workbench.java:491)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.handle(PartRenderingEngine.java:1134)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1124)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Re: Displaying composite in NaTable cell [message #1454333 is a reply to message #1454262] Tue, 28 October 2014 08:51 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Sorry, I don't understand what you are trying to do. Are you trying to add a control to a cell and scroll it out of the visible area? That won't work since NatTable is not able to deal with moving a Control that is not rendered by NatTable out of the visible area.
Previous Topic:Regular Expression for Nattable Filter
Next Topic:Setting error message on display converter failure.
Goto Forum:
  


Current Time: Sun Mar 07 16:20:12 GMT 2021

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

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

Back to the top