Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » WindowBuilder integration for custom table-like SWT widget
WindowBuilder integration for custom table-like SWT widget [message #740471] Tue, 18 October 2011 14:51 Go to next message
Jim Mayer is currently offline Jim MayerFriend
Messages: 18
Registered: July 2009
Junior Member
We're building a table-like custom widget. The structure follows that of the standard SWT Table class:

* Table (a subclass of Composite)
* TableItem (a subclass of Item)
* TableColumn (another subclass of Item)

I've written an RCP plugin that provides corresponding "info" classes for our Table, TableItem, and TableColumn classes. The code is closely modeled on the info classes from WindowBuilder. Similarly, our "XXX.wbp-component.xml" classes are modeled on WindowBuilder's table integration.

At this point, I can build the plugin, see our table, item, and column classes on the palette, and can see that our table info class is being instantiated and queried.

What I haven't been able to figure out is how to convince WindowBuilder to let me drag items and columns onto the table.

Could anyone point me at an example of how this is done? (or tell me to stop wasting my time!).

If there are no examples for me to look at, I can certainly put together a "mini" example that I could share (which might be useful for other folks as well).

Thanks!

-- Jim


Re: WindowBuilder integration for custom table-like SWT widget [message #740544 is a reply to message #740471] Tue, 18 October 2011 16:16 Go to previous messageGo to next message
Jim Mayer is currently offline Jim MayerFriend
Messages: 18
Registered: July 2009
Junior Member
Hi... somewhat to my surprise, I've made some progress. I can now drag items and columns onto our custom table. I did this by implementing an extension point for "org.eclipse.wb.core.componentsHierarchyProviders" and implementing my own version modeled on WindowBuilder's "ItemsHierarchyProvider".

Does this seem like the right path?

Thanks.

-- Jim
Re: WindowBuilder integration for custom table-like SWT widget [message #740590 is a reply to message #740544] Tue, 18 October 2011 17:24 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 886
Registered: July 2009
Location: Boston, MA
Senior Member
Yes.

Table and TableColumns/Items are tricky since those table children aren't real widgets and don't follow the generic rules established for container/child relationships. The ItemsHierarchyProvider class helps provide the extra info needed for this special case.

BTW, you did exactly the right thing...find something similar in WB (like the existing Table support) and copy/modify as needed. I assume you also found the ItemsHierarchyProvider stuff by searching for other references to TableColumn, TableItem or Table.
Re: WindowBuilder integration for custom table-like SWT widget [message #740621 is a reply to message #740544] Tue, 18 October 2011 18:10 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
I would say that ItemsHierarchyProvider is for building hierarchy of exposed Table and Columns/Items. To just Column manipulations you need "flow container".

	<!-- PARAMETERS -->
	<parameters>
		<parameter name="layout.has">false</parameter>
		<parameter name="gridLayout.grabHorizontal">true</parameter>
		<parameter name="gridLayout.grabVertical">true</parameter>
		<!-- flow container: TableColumn -->
		<parameter name="flowContainer.1">true</parameter>
		<parameter name="flowContainer.1.horizontal">true</parameter>
		<parameter name="flowContainer.1.component">org.eclipse.swt.widgets.TableColumn</parameter>
		<!-- flow container: TableItem -->
		<parameter name="flowContainer.2">true</parameter>
		<parameter name="flowContainer.2.horizontal">false</parameter>
		<parameter name="flowContainer.2.component">org.eclipse.swt.widgets.TableItem</parameter>
		<!-- simple container: TableCursor -->
		<parameter name="simpleContainer">true</parameter>
		<parameter name="simpleContainer.component">org.eclipse.swt.custom.TableCursor</parameter>
	</parameters>


Konstantin Scheglov,
Google, Inc.
Re: WindowBuilder integration for custom table-like SWT widget [message #740648 is a reply to message #740590] Tue, 18 October 2011 18:46 Go to previous message
Jim Mayer is currently offline Jim MayerFriend
Messages: 18
Registered: July 2009
Junior Member
Yup... grep is my friend Smile

Thank you.

-- Jim
Previous Topic:NoClassDefFoundError when trying to open ViewPart code with WindowBuilder
Next Topic:initDataBinding called at design time in nested composites
Goto Forum:
  


Current Time: Fri Nov 28 11:39:06 GMT 2014

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

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