Bug 99568 - [EditorMgmt] Move createEditor() method from EditorDescriptor to IEditorDescriptor
Summary: [EditorMgmt] Move createEditor() method from EditorDescriptor to IEditorDescr...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-06-13 04:25 EDT by Michal Tkacz CLA
Modified: 2019-09-06 16:10 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Tkacz CLA 2005-06-13 04:25:36 EDT
It seems to me (correct me if I'm wrong) that there is no way to build an editor
having IEditorDescriptor object other than cast it to EditorDescriptor and use
createEditor() method. This however is discouraged since EditorDescriptor class
is not part of an API (it resides in an "internal" package).

What I'm trying to achieve is to create a multipage editor, where one of the
pages is a default XML editor. However all I get from
IEditorRegistry.getDefaultEditor() is an IEditorDescriptor instance.
Comment 1 Michael Van Meekeren CLA 2006-04-21 13:19:19 EDT
Moving Dougs bugs
Comment 2 Michael Valenta CLA 2006-09-14 10:56:00 EDT
On a slightly related note, we also need to do this in Team but for a slightly different reason. We need to determine if the default editor for a file is a text editor or not. We need to do this in order to ensure that we can use the editor when showing annotations. That is, we create the editor and test whether it implements ITextEditor. If it does not, we use the default text editor instead of the default editor for the file type.
Comment 3 Markus Keller CLA 2007-09-26 09:33:29 EDT
Allowing clients to create editor parts opens a new class of lifecycle issues, since the workbench is no longer in control of all editor instances. See e.g. bug 204679.

If this API is added, its Javadoc must urge clients to make sure all created editors are eventually disposed properly.

(In reply to comment #2)
IMO, a better solution for the Team team would be a query on IEditorDescriptor that returns the Class object that would be used to create an editor instance.
Comment 4 Michal Tkacz CLA 2007-09-26 09:55:37 EDT
In scenario I described above workbench doesn't really have to know about created instance as it shouldn't manage it. And it sounds quite normal (still worth mentioning in Javadoc) that what you have created, you should dispose.
Comment 5 Susan McCourt CLA 2009-07-09 19:07:41 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 6 Boris Bokowski CLA 2009-11-17 13:05:13 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:10:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.