Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » FilteredTree it won't work in Eclipse Kepler(using FilteredTree in Eclipse Kelper)
FilteredTree it won't work in Eclipse Kepler [message #1115115] Mon, 23 September 2013 17:35 Go to next message
Ingo Schult is currently offline Ingo SchultFriend
Messages: 2
Registered: September 2013
Junior Member
Hallo,

I like to use the FilteredTree in my e4 (Eclipse-Kepler) Project.

here is my Code:

@PostConstruct
public void postConstruct(Composite parent) {
		
  parent.setLayout(new GridLayout(1, false));
  FilteredTree filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.BORDER , new FolderFilter(), true);
  filteredTree.setQuickSelectionMode(true);
  filteredTree.setInitialText("Filter");
  viewer = filteredTree.getViewer();
  initViewer();

  status = new Label(parent, SWT.NONE);
  status.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
  status.setText("Verzeichnisse gelesen");

}


The Text-Widget, for the Filtertext, is displayed, but when I type text into then Textfield nothing happens.

On Eclipse Indigo (View extends ViewPart) ist work fine.

What is wrong?

Greating
Ingo
Re: FilteredTree it won't work in Eclipse Kepler [message #1115918 is a reply to message #1115115] Tue, 24 September 2013 19:32 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3875
Registered: July 2009
Senior Member

What does initViewer() do?

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: FilteredTree it won't work in Eclipse Kepler [message #1116570 is a reply to message #1115918] Wed, 25 September 2013 15:59 Go to previous messageGo to next message
Ingo Schult is currently offline Ingo SchultFriend
Messages: 2
Registered: September 2013
Junior Member
Hi Nitin,

initViewer() do the following:

private void initViewer() {

        viewer.setContentProvider(new DMSTreeContentProvider());
	viewer.setLabelProvider(new DMSLabelProvider());
	viewer.setAutoExpandLevel(3);
	viewer.setInput(new FolderNode(-1, null));

	viewer.addDoubleClickListener(new IDoubleClickListener() {
		@Override
		public void doubleClick(DoubleClickEvent event) {
			TreeViewer viewer = (TreeViewer) event.getViewer();
			IStructuredSelection thisSelection = (IStructuredSelection) event.getSelection();
		        Object selectedNode = thisSelection.getFirstElement();
			viewer.setExpandedState(selectedNode, !viewer.getExpandedState(selectedNode));
	       }
       });

}


The Node-Model is this:
public class FolderNode extends DMSTreeNode {

	public FolderNode(int level, Folder folder) {
		super(level, folder);
	}

	public String toString() {
		return ((Folder) getValue()).getName();
	}
}


And the Folder-Model is this:

public class Folder {

	private String name;
	private int nr;

	public Folder() {
		setName("unkonwn");
		setNr(0);
	}

	public Folder( int nr, String name) {
		setNr(nr);
		setName(name);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getNr() {
		return nr;
	}

	public void setNr(int nr) {
		this.nr = nr;
	}

}


Greetings
Ingo
icon9.gif  Re: FilteredTree it won't work in Eclipse Kepler [message #1353973 is a reply to message #1116570] Wed, 14 May 2014 04:21 Go to previous messageGo to next message
Victor Pyankov is currently offline Victor PyankovFriend
Messages: 10
Registered: July 2009
Junior Member
I have the same problem.

FilteredTree internally uses WorkbenchJob:

protected WorkbenchJob doCreateRefreshJob() {
   return new WorkbenchJob("Refresh Filter") {
      ...
   };
}


In turn WorkbenchJob overrides shouldSchedule() method:

@Override
public boolean shouldSchedule() {
   return super.shouldSchedule() && PlatformUI.isWorkbenchRunning();
}


Oops!!! PlatformUI.isWorkbenchRunning() returns false! Job doesn't run.

I have no ideas. Sad

icon3.gif  Re: FilteredTree it won't work in Eclipse Kepler [message #1355532 is a reply to message #1353973] Wed, 14 May 2014 19:30 Go to previous message
Victor Pyankov is currently offline Victor PyankovFriend
Messages: 10
Registered: July 2009
Junior Member
The solution was found:

import org.eclipse.e4.ui.workbench.swt.internal.copy.FilteredTree;
import org.eclipse.e4.ui.workbench.swt.internal.copy.PatternFilter;


from org.eclipse.e4.ui.workbench.swt plugin.
Previous Topic:android
Next Topic:Eclipse 4.3.2 SR2 Modeling will not launch in Mavericks
Goto Forum:
  


Current Time: Thu Oct 22 14:30:32 GMT 2020

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

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

Back to the top