0

I'm writing Eclipse plugin. One of many features is create Tree with File Attributes like .java files have (if you click on .java File in Eclipse you can see whole list with what classes or methods this file have).

I can create this tree with separate view, it isn't problem (I have data,using TreeViewer and everything works great), but now I must create this tree in Project Explorer View and I don't know how.
Maybe should I write because it isn't obviously. This tree won't be display with .java file but with .txt file.

So read about this. What I know for now:

  1. I should have org.eclipse.ui.decorators extension point. I already have it
  2. My class should extends LabelProvider implements ILightweightLabelDecorator . It already has it

Also I can get access to already selection File , Project , Folder (by using decorate() method). I can add prefix/suffix to already select file ,add icons into File but...

I'm not seeing any methods what give me possibility add any attributes to file.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Peter
  • 27
  • 3

2 Answers2

0

You should be using the extension points to provide content, not labels, just as your existing trees (hopefully) use content providers for those details. Start at http://help.eclipse.org/luna/topic/org.eclipse.platform.doc.isv/guide/cnf.htm .

nitind
  • 19,089
  • 4
  • 34
  • 43
  • I'm affraid Im not still understand also it's possible solve my problem without your framework ?,only 'clear' Java. Yes,my existing TreeViewe on separate view using Content Provider and LabelProvider. – Peter Aug 29 '14 at 06:39
  • The `Project Explorer` is built using that framework. It is *the* way to implement what you want. – nitind Aug 30 '14 at 07:12
0

nitind has right , if someone wants implement outline with Project Explorer,use Common Navigator Framework.

Here is simply examples,wrote by creator this framework,how to do this :

  1. http://scribbledideas.blogspot.com/2006/05/building-common-navigator-based-viewer.html // create view

  2. http://scribbledideas.blogspot.com/2006/05/building-common-navigator-based-viewer_22.html // create outline

Just try copy this example into your project.

Thx nitind for advice.

Peter
  • 27
  • 3