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. [message #603598] 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.

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

At least I wanted to know why, but here's no error log at all.

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);
}
}
}
Re: I wanted to use a FilteredTree in my outline view. [message #603626 is a reply to message #603598] 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 #603704 is a reply to message #603626] 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.

Thank for reply anyway !!!
Previous Topic:I wanted to use a FilteredTree in my outline view.
Next Topic:Galileo & plugin template examples
Goto Forum:
  


Current Time: Wed Jul 23 21:50:19 EDT 2025

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

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

Back to the top