Bug 4321 - [nls tooling] outline for .properties files
Summary: [nls tooling] outline for .properties files
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 86273 107996 333521 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 23:09 EDT by Erich Gamma CLA
Modified: 2013-02-20 08:54 EST (History)
9 users (show)

See Also:


Attachments
Screenshot of hiearchical implementation (167.68 KB, image/png)
2011-01-05 03:10 EST, Thomas Schindl CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2001-10-10 23:09:45 EDT
AK (10/9/2001 4:58:42 PM)
	having an outline for .proprties files would be very useful	

NOTES:
EG (10.10.2001 21:53:48)
	an outline with one entry per file, is this really usefull?
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:15:19 EDT
moved to 'active'
Comment 2 Erich Gamma CLA 2001-11-10 19:53:43 EST
defer
Comment 3 Dirk Baeumer CLA 2002-07-25 13:33:39 EDT
Reopen
Comment 4 Dirk Baeumer CLA 2002-07-25 13:33:53 EDT
Won't fix for 2.x or 3.x
Comment 5 Dani Megert CLA 2005-02-23 11:08:45 EST
*** Bug 86273 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2005-02-23 11:09:23 EST
Might be considered in the nls tooling effort
Comment 7 Dani Megert CLA 2005-08-26 03:14:57 EDT
*** Bug 107996 has been marked as a duplicate of this bug. ***
Comment 8 Deepak Azad CLA 2010-09-28 11:11:19 EDT
Gathering requirements from the duplicates
1. The outline shows all *keys*
2. The outline should be sortable (view toolbar toggle).
3. The non-plus-ultra would be a hierarchical outline that groups common key prefixes.
4. Clicking on a (leaf) item would open the file and place the cursor at the key
location. Hovering would display the value?

The first 2 have to be implemented...

For the hierarchical representation we could maybe have another tool bar button, to toggle between hierarchical and flat representation. Or do we want only hierarchical representation? Or only flat representation?
Comment 9 Dani Megert CLA 2010-09-28 12:12:01 EDT
>Hovering would display the value?
There's already the OS hover when the item doesn't fit the view. We shouldn't override that.

I'm not longer convinced that his is too useful.
Comment 10 Markus Keller CLA 2010-10-06 10:44:45 EDT
I agree that we shouldn't show the value in a tooltip in the Outline view.

The default presentation should be flat (with a toggle to enable alphabetical sorting). I would start with that. A quick outline would also be handy.

Hierarchical mode should go into a separate bug (or dropped altogether). It's not clear how the hierarchies should be built, since the keys are only defined as flat char sequences and groupings are mere ad-hoc conventions (separate at dot, underscore, slash, camelCase boundary, ...).
Comment 11 Thomas Schindl CLA 2011-01-05 02:07:30 EST
*** Bug 333521 has been marked as a duplicate of this bug. ***
Comment 12 Thomas Schindl CLA 2011-01-05 02:08:19 EST
It would be nice if one could see the property keys in the outline e.g. to sort
and group them. I've just written an implementation which I published at
http://tomsondev.bestsolution.at/2011/01/04/improvement-properties-editor/. 

If JDT is interested I could make a patch for JDT-UI which enhances the current
editor.
Comment 13 Dani Megert CLA 2011-01-05 03:03:58 EST
Tom, can you read through this bug and comment on our requirements and concerns we discussed and also attach some screenshots from your solution?
Comment 14 Thomas Schindl CLA 2011-01-05 03:09:23 EST
(In reply to comment #13)
> Tom, can you read through this bug and comment on our requirements and concerns
> we discussed and also attach some screenshots from your solution?

My requirements who are implemented are:
* Hierarchical (currently I group by "_" but I'd also like to add ".")
* Sortable
* Display at least some parts of the translation (I display the first 20 chars 
  using StyledString)

On my todo list:
* Flat representation
Comment 15 Thomas Schindl CLA 2011-01-05 03:10:29 EST
Created attachment 186071 [details]
Screenshot of hiearchical implementation
Comment 16 Thomas Schindl CLA 2011-01-05 03:14:47 EST
(In reply to comment #10)
> I agree that we shouldn't show the value in a tooltip in the Outline view.
> 

Agreed - I've used the new StyledCellLabelProvider stuff to show this extra information

> The default presentation should be flat (with a toggle to enable alphabetical
> sorting). I would start with that. A quick outline would also be handy.
> 

Agreed - it's on my todo list but very to add to my code base because I already remember those informations in a flat list.

> Hierarchical mode should go into a separate bug (or dropped altogether). It's
> not clear how the hierarchies should be built, since the keys are only defined
> as flat char sequences and groupings are mere ad-hoc conventions (separate at
> dot, underscore, slash, camelCase boundary, ...).

IMHO _ (underscore) and . (point) are the most common and used because the NLS-Tooling uses those patterns.
Comment 17 Thomas Schindl CLA 2011-01-05 03:19:31 EST
Other interesting resources:
* http://wiki.eclipse.org/Babel_/_Message_Bundle_Editor
* http://mytourbook.sourceforge.net/mytourbook/index.php/development/translation/install-resource-editor

but they go a lot beyond what I'd like to get as a default properties editor (maybe some formatting stuff would be nice but that's for another bug :-)
Comment 18 Dani Megert CLA 2011-01-05 07:15:01 EST
Tom, what are the scenarios/usecases where you really use that view in your daily work?
Comment 19 Thomas Schindl CLA 2011-01-05 07:24:13 EST
UC1:
* add new key next to the same group (currently I have to hit CTRL+F and enter 
  the first part == group) 
  => Could be solve naturally also by an autoformat which puts groups together 
     things according to their prefix
UC2:
* Find current keys
  a) to modify their value (e.g. you have spot a typo)
  b) delete the key because it is unused
Comment 20 Dani Megert CLA 2011-01-05 07:26:25 EST
Why do you perform this manually instead of using the wizard and 'Find Broken Externalized Strings' action?
Comment 21 Dani Megert CLA 2011-01-05 07:30:05 EST
>UC2:
>* Find current keys
>  a) to modify their value (e.g. you have spot a typo)
Where do you get the key from? If it's in the code then you can go directly to it via Ctrl+click.
Comment 22 Thomas Schindl CLA 2011-01-05 07:30:24 EST
(In reply to comment #20)
> Why do you perform this manually instead of using the wizard and 'Find Broken
> Externalized Strings' action?

because this only works if you use the NLS-System which you won't e.g. in a Web-Environment where you simply do a ResourceBundle#getBundle() or you want to write RAP applications where the current static field approach of NLS fails completely.
Comment 23 Thomas Schindl CLA 2011-01-05 07:31:11 EST
(In reply to comment #21)
> >UC2:
> >* Find current keys
> >  a) to modify their value (e.g. you have spot a typo)
> Where do you get the key from? If it's in the code then you can go directly to
> it via Ctrl+click.

See comment 22
Comment 24 Dani Megert CLA 2011-01-05 07:36:21 EST
(In reply to comment #22)
(In reply to comment #23)
Makes sense.

Tom, would you be able to invest more time into this? As you mentioned the "flat" style is missing and I'd probably also like an option to hide the values. Furthermore I expect some polish so it fits into our existing code base. If so, the first step would be to provide an initial patch for 'org.eclipse.jdt.ui'.
Comment 25 Thomas Schindl CLA 2011-01-05 07:39:12 EST
Sure I'll:
* first add the features to my code base at eclipse
* provide a patch for JDT-UI (should it go to JDT-UI component wise then)
  => this was the reason I haven't found this bug report in first place :-)

I'll come back with a patch hopefully soon