Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350622 - Customize images for Navigator Content
Summary: Customize images for Navigator Content
Status: CLOSED DUPLICATE of bug 366265
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 14:48 EDT by Pradyut Sarma CLA
Modified: 2011-12-14 13:46 EST (History)
2 users (show)

See Also:


Attachments
File Semantics (95.55 KB, image/png)
2011-06-29 14:03 EDT, Pradyut Sarma CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pradyut Sarma CLA 2011-06-28 14:48:12 EDT
Build Identifier: M8

Hi,

Orion allows users to contribute content to the editor using the orion.core.file service/extension point. Content can either be in the form of directories or files whose icons are currently defined in a CSS class. There is no way that a contributor can customize the image that will differentiate his file type from another file type in the Navigator. The idea is basically to have a mechanism by which the contributor of the file to the Navigator also contributes the image to it. Probably, the easiest way would be to accept the image URL too, as part of the JSON response in the http://wiki.eclipse.org/Orion/Server_API/File_API#File.

I am not sure whether it is enough to just accept the image URI for a file/folder or an entire CSS class to describe the contributed content.

Thanks and Regards,
Pradyut.

Reproducible: Always

Steps to Reproduce:
Check the "Details" section
Comment 1 John Arthorne CLA 2011-06-28 16:45:06 EDT
Having the file server define the icons used by a particular client is a bit strange. We generally don't want client implementation details in the server or file system implementation code. Another approach is that file icons come from editor associations (use the editor's icon for files associated with that editor). This is roughly what Eclipse desktop does. Related to bug 349802.
Comment 2 Mark Macdonald CLA 2011-06-29 13:59:42 EDT
(In reply to comment #0)
> I am not sure whether it is enough to just accept the image URI for a
> file/folder or an entire CSS class to describe the contributed content.

General comment: we should stick to CSS classes rather than image URLs. CSS allows more control, and it's required for common web development tricks like 'sprites' (combining images into 1 large grid to reduce HTTP overhead).

We don't currently have a mechanism for plugins to contribute CSS (see Bug 347493)
Comment 3 Pradyut Sarma CLA 2011-06-29 14:02:23 EDT
Hey John,

I agree to the technical POV that the client and server implementations
shouldn't be mixed up. But I still have a couple of points to support my stand.

The idea of using the editor icon for the file associated with it works in case
of a one-to-one association of a file type with an editor but that would rarely
be the case. That is because, an editor may be used by more than one file type
to render its details. In such a case, it is most important to safeguard the
semantics of the object that is displayed in the Navigator even though the
editor icon may not always do that. An example of such a case is attached with
this message where an XML editor is used to render a WSDL whereas one look in
the Navigator makes one understand that the object in the tree is a WSDL. Even
in case of Eclipse-In-Desktop, the navigator icons come from a Label provider
whereas the editor icon from the editor contribution/extension point.

Just some thoughts ;)

Thanks and Regards,
Pradyut.
Comment 4 Pradyut Sarma CLA 2011-06-29 14:03:09 EDT
Created attachment 198851 [details]
File Semantics
Comment 5 John Arthorne CLA 2011-06-30 14:38:23 EDT
(In reply to comment #3)
> editor icon may not always do that. An example of such a case is attached with
> this message where an XML editor is used to render a WSDL whereas one look in
> the Navigator makes one understand that the object in the tree is a WSDL. Even
> in case of Eclipse-In-Desktop, the navigator icons come from a Label provider
> whereas the editor icon from the editor contribution/extension point.

I think you will find that the Navigator label in Eclipse comes from the editor association. If you change the default editor for a WSDL file to the XML editor, then I believe that icon in the Navigator will change.
Comment 6 Pradyut Sarma CLA 2011-06-30 15:07:17 EDT
Hey John,

You are right about the WSDL file association. In case of changing the default editor to XML for a WSDL, the Navigator icon also changes.
I tried to do the same for a .java file by changing the default editor for a java file to a text editor. But the Navigator icon still depicts a java CLASS and not a java FILE, even though double clicking on the java class opens up the content in the text editor.

Thanks and Regards,
Pradyut.

(In reply to comment #5)
> I think you will find that the Navigator label in Eclipse comes from the editor
> association. If you change the default editor for a WSDL file to the XML
> editor, then I believe that icon in the Navigator will change.
Comment 7 Susan McCourt CLA 2011-12-14 13:46:18 EST
Pradyut, this request is now implemented via bug 366265.
Since you opened this bug, we introduced a content type definition mechanism, and it is now possible to define content types as well as specify an icon for them.

*** This bug has been marked as a duplicate of bug 366265 ***