Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » I wanted to use a FilteredTree in my outline view.(I wanted to use a FilteredTree in my outline view but I can't.)
I wanted to use a FilteredTree in my outline view. [message #500141] Wed, 25 November 2009 03:15 Go to next message
Eclipse UserFriend
Hi. everyone.
I need some help for my plug-in.

I wanted to use a FilteredTree in my outline view.
So I created a subclass of ContentOutlinePage and override default treeviewer to FilteredTree's treeviewer.
After that, all I got is "An outline is not available." message.
At least I wanted to know why, but here's no error log at all.

If I set the treeviewer as normal treeviewer as commented code, below, I can see outline view as normal.

My codes are below. (codes which are not related to this subject are omitted.)
Could anybody help me out?
Is it impossible to use FilteredTree on outline view?

public class TestOutlinePage extends ContentOutlinePage {

	private TreeViewer treeViewer;

	public void createControl(Composite parent) {

		PatternFilter filter = new PatternFilter();
		FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL
				| SWT.V_SCROLL, filter, false);
		treeViewer = tree.getViewer();
		// treeViewr = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);

		treeViewer.addSelectionChangedListener(this);
		treeViewer.setInput(Input);
		... 

	}

	@Override
	protected TreeViewer getTreeViewer() {
		return treeViewer;
	}

	@Override
	public Control getControl() {
		if (treeViewer == null) {
			return null;
		}
		return treeViewer.getControl();
	}

	@Override
	public ISelection getSelection() {
		if (treeViewer == null) {
			return StructuredSelection.EMPTY;
		}
		return treeViewer.getSelection();
	}
    
	@Override
	public void setFocus() {
 		treeViewer.getControl().setFocus();
	}
	
	@Override
	public void setSelection(ISelection selection) {
		if (treeViewer != null) {
			treeViewer.setSelection(selection);
		}
	}
}

[Updated on: Wed, 25 November 2009 03:17] by Moderator

Re: I wanted to use a FilteredTree in my outline view. [message #500504 is a reply to message #500141] Thu, 26 November 2009 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Why do you want to use the outline view.... why not use your own view?

Regards,
Aurelien Pupier
Re: I wanted to use a FilteredTree in my outline view. [message #500876 is a reply to message #500504] Sun, 29 November 2009 21:02 Go to previous message
Eclipse UserFriend
Hi, sorry to reply so late.

The reason I wanted to use outline view is, outline view is easy to use for my plug-in users.

My plug-in is used to edit special config file.
This config file belongs to Java project and is modified with other .java files.

As you know, we usually modify .java files with outline view opened.
So if my plug-in users want to modify config file with other .java files, they can just open my config file with my editor, then outline view is already opened, so they don't need to open another view.
So it is easy to use.

And If I use my own view other than outline view, I think java editor will show "this view is not available" when users switch to Java editor from my editor, because java editor don't know my view type. So this could be so annoying.

These two issues are the reason why I want to use outline view other than my own view.

If I misunderstood something, please let me know.

Thanks for reply anyway Pupier !!!

[Updated on: Sun, 29 November 2009 21:06] by Moderator

Previous Topic:Can't Compile PDE - thousands of errors
Next Topic:I wanted to use a FilteredTree in my outline view.
Goto Forum:
  


Current Time: Sun Jul 27 01:53:58 EDT 2025

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

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

Back to the top