Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Customize an Eclipse View with SWT
icon5.gif  Customize an Eclipse View with SWT [message #688209] Fri, 24 June 2011 07:20 Go to next message
Renaud C is currently offline Renaud C
Messages: 19
Registered: May 2011
Junior Member
Hello!
I have developed a plugin, a new Eclipse view (ViewPart).
And I would like to use SWT tools to modify my view (Sash, ScrolledComposite...).

I am displaying a TreeViewer and I use a contentprovider and a labelprovider.

public void createPartControl(Composite parent) {
		treeviewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
		treeviewer.setContentProvider(new TreeContentProvider());
		treeviewer.setLabelProvider(new TreeLabelProvider());
	}


Actually, I see an SWT program, I see an Eclipse plugin to create a new view, but I don't know how to use swt in the plugin structure.

In fact, I just want to display my tree in the upper part of my view (delimited by a sash)...

Thank you very much for your help!
Re: Customize an Eclipse View with SWT [message #690828 is a reply to message #688209] Thu, 30 June 2011 09:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: robert julian chandradoss

On 6/24/2011 12:50 PM, Renaud C wrote:
> Hello!
> I have developed a plugin, a new Eclipse view (ViewPart).
> And I would like to use SWT tools to modify my view (Sash,
> ScrolledComposite...).
>
> I am displaying a TreeViewer and I use a contentprovider and a
> labelprovider.
>
> public void createPartControl(Composite parent) {
> treeviewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
> treeviewer.setContentProvider(new TreeContentProvider());
> treeviewer.setLabelProvider(new TreeLabelProvider());
> }
>
> Actually, I see an SWT program, I see an Eclipse plugin to create a new
> view, but I don't know how to use swt in the plugin structure.
>
> In fact, I just want to display my tree in the upper part of my view
> (delimited by a sash)...
>
> Thank you very much for your help!

Renaud,
Please post some actual code to run. Also, elaborate what you
are trying to achieve, may be with figure/picture.

best regards. --julian
Re: Customize an Eclipse View with SWT [message #690978 is a reply to message #690828] Thu, 30 June 2011 13:52 Go to previous message
Renaud C is currently offline Renaud C
Messages: 19
Registered: May 2011
Junior Member
For now, I display 2 treeviewer separated by a Sash :

public void createPartControl(Composite parent) {
		treeviewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
		treeviewer.setContentProvider(new TreeContentProvider());
		treeviewer.setLabelProvider(new TreeLabelProvider());

		new Sash(parent, SWT.VERTICAL);

		treeviewerTwo = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
		treeviewerTwo.setContentProvider(new TreeContentProviderTwo());
		treeviewerTwo.setLabelProvider(new TreeLabelProvider());

		createActions();
		createToolbar();

		getSite().setSelectionProvider(treeviewer);
		getSite().getWorkbenchWindow().getSelectionService()
				.addSelectionListener(listener);
	}


http://www.habile-webdesign.com/plugin_screenshot.png

And now I would like to split this view horizontally, these two treeviewers on the top, and a new part below where I would like to insert another tree (result of operations between the two previous treeviewers).


And, by the way,
		getSite().setSelectionProvider(treeviewer);
		getSite().getWorkbenchWindow().getSelectionService()
				.addSelectionListener(listener);

allows me to display properties of a treeviewer element selected. But I can use only one provider with this system, and I would like the same for the two treeviewers. Allowing to see properties of treeviewer elements and treeviewerTwo elements.
With my current code, I can see only properties of treeviewer elements.

Thanks everybody!

[Updated on: Thu, 30 June 2011 13:53]

Report message to a moderator

Previous Topic:Coolbar Mouse Listener
Next Topic:How to initiate an inactive view in an IFolderLayout
Goto Forum:
  


Current Time: Thu Oct 23 05:11:45 GMT 2014

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

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