Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337741

Summary: [editor] Can we rename "editor" to "editableText"?
Product: [ECD] Orion Reporter: Boris Bokowski <bokowski>
Component: ClientAssignee: Project Inbox <e4.orion-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, Silenio_Quarti, susan, thatnitind
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: All   
Whiteboard:

Description Boris Bokowski CLA 2011-02-21 12:21:05 EST
I think people think of "editor" as the thing that is fully configured with an undo stack, a good number of standard key bindings, standard rulers, etc. See bug 337647.

I would like to propose the following rename:

current terminology  -->  new terminology
"editor"  --> "editableText"
"editorContainer"  --> "editor"

Any opinions?
Comment 1 Felipe Heidrich CLA 2011-02-22 10:46:24 EST
(In reply to comment #0)
> "editor"  --> "editableText"

By "editor", you mean eclipse.Editor, that lives in /org.eclipse.orion.client.editor/web/js/editor.js

To be renamed to "editableText"

> "editorContainer"  --> "editor"
> Any opinions?

Personally I find "editableText" a bad name. For me, eclipse.Editor is an editor on its own. The "editorContainer" is an extension of eclipse.Editor and could be called CodeEditor, TextEditor, etc. Depending on your design you could call "editorContainer" by BasicEditor or AbstractEditor and then add subclasses like "HTMLEditor", "JSEditor", "CSSEditor", etc.

Other alternative (in case you really want to use the name editor for your guy) is to change the name space for the editor, instead of 
eclipse.Editor
it could be changed to
orion.editor.Editor
(open to suggestios)
and "editorContainer" could be orion.client.Editor or orion.ui.Editor

This last approach would also solve name collision for other "types" like:
eclipse.KeyBinding
eclipse.Style
eclipse.StyleRange
etc
(note that some of these names only exist because of JSDoc)
Comment 2 Susan McCourt CLA 2011-02-22 12:10:17 EST
The current editor container can be configured with features that are plain text (undo, etc.), and some more code-oriented things (content assist, problem rulers).  So calling it a "code editor" or "text editor" doesn't really help.  And "BasicEditor" is just a different way to deal with namespace.  I think they are both editors, one more at a "widget level" and the other with more semantics.

Given that different audiences will see them both as "editors", I like the namespace idea.  

In my early work on bug 337647, I have started to call editorContainer "editor" and when I need the widget, I call "editor.getEditorWidget()".  But I'm not suggesting that the "widget" word be used for names, it's just a good way to distinguish between the two when I'm in code that deals with both layers (plug-in commands, etc.)
Comment 3 Felipe Heidrich CLA 2011-02-22 12:47:55 EST
(In reply to comment #2)
> Given that different audiences will see them both as "editors", I like the
> namespace idea.  

I agree with that, any suggestions for namespaces ?

I'm not against changing the name for eclipse.Editor, it is just hard to find a good name for it. SSQ should be here this afternoon, I'll ask what he thinks.

> "editor.getEditorWidget()"
Not bad IMO. In the desktop the same method exists and it is called getTextWidget().
Comment 4 Boris Bokowski CLA 2011-02-22 13:57:18 EST
I don't particularly like the namespace idea, because it will be a constant cause of confusion (did you mean "this editor" or "that editor"?)

How about EditorWidget as the name for the widget-level editor?
Comment 5 Felipe Heidrich CLA 2011-02-23 09:37:05 EST
(In reply to comment #4)
> I don't particularly like the namespace idea, because it will be a constant
> cause of confusion (did you mean "this editor" or "that editor"?)
> How about EditorWidget as the name for the widget-level editor?

we can say that an editor (that is not a widget) has a view (that is a widget).
so maybe a better name is TextView (or TextViewer)
Comment 6 Silenio Quarti CLA 2011-02-23 10:38:37 EST
I like TextView given that we already have TextModel. Note that the rulers interface have an API called setEditor() which should probably be renamed to setView() as well.
Comment 7 Silenio Quarti CLA 2011-02-23 10:38:37 EST
I like TextView given that we already have TextModel. Note that the rulers interface have an API called setEditor() which should probably be renamed to setView() as well.
Comment 8 Felipe Heidrich CLA 2011-06-03 16:13:48 EDT
Fixed, see Bug 347826 for details.