Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Decorating the JS Editor title icon with an overlay(to be able to distinguish between many files with the same name and different purpose.)
Decorating the JS Editor title icon with an overlay [message #559932] Mon, 20 September 2010 12:55 Go to next message
Enrico Magen is currently offline Enrico MagenFriend
Messages: 15
Registered: September 2010
Junior Member
Our eclipse plug-in is used to create mobile application using web languages (html and javascript).
When a user creates our application in eclipse she can choose to add custom js files for the various environments she wants to support (e.g. iPhone, Android, Blackberry, etc.)

The directory structure is currently:

app
|-----common
|-----|-----js
|-----|-----images
|-----|-----css
|-----Android
|-----|-----js
|-----|-----images
|-----|-----css
|-----iPhone
|-----|-----js
|-----|-----images
|-----|-----css
..

inside each js directory there are files name "application name".js (e.g. myapp.js)
when you work on 3 files of the same name, you get lost which file belongs to which environment. This is very confusing when you see a few editor tabs all editing the same file name.
What I want to achieve is have the editor tabs' title show a small overlay on each file icon corresponding to the environment.

I managed to do this exact thing in the tree view using a custom adapter and the org.eclipse.ui.decorators extension point.

I've been googling for about 5 hours now trying to figure out how to do this and I've found many people from 3-5 years ago trying to achieve the same thing, but alas no answers.

I tried extending org.eclipse.ui.editors and have my custom class extend org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitE ditor (jsdt is in my plug-in's dependencies), only to override the getTitleImage but it won't compile:

The type org.eclipse.ui.texteditor.AbstractDecoratedTextEditor cannot be resolved. It is indirectly referenced from required .class files


Please help?
Thank you very much.

[Updated on: Mon, 20 September 2010 12:56]

Report message to a moderator

Re: Decorating the JS Editor title icon with an overlay [message #559935 is a reply to message #559932] Mon, 20 September 2010 13:17 Go to previous messageGo to next message
Ian Tewksbury is currently offline Ian TewksburyFriend
Messages: 48
Registered: July 2009
Location: RTP, NC, USA
Member
Enrico,

Purely based on your compile error I would say you are missing a plugin dependency on whichever plugin contains "org.eclipse.ui.texteditor.AbstractDecoratedTextEditor".

Someone else will have to speak to the best way of achieving your goal though.

Blue Skies,

~Ian


Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
Re: Decorating the JS Editor title icon with an overlay [message #559940 is a reply to message #559935] Mon, 20 September 2010 13:41 Go to previous message
Enrico Magen is currently offline Enrico MagenFriend
Messages: 15
Registered: September 2010
Junior Member
Thanks,

I managed to solve the compilation error by adding a bunch of dependencies to the plug-in, but I really feel this is not the best practice to achieve this goal.

(I didn't get it working this way yet though...)

Previous Topic:Where is Java EE Module Dependencies in Helios?
Next Topic:rcp and dot net ?
Goto Forum:
  


Current Time: Sat Nov 29 04:06:05 GMT 2014

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

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