Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "FAQ What is the difference between a view and an editor?"

 
m
Line 6: Line 6:
 
about the differences between views and editors.
 
about the differences between views and editors.
  
* Editors display the contents of a file, and views contain groups of files or things other
+
* Editors display the contents of a file, and views contain groups of files or things other than files.  Wrong.  Both editors and views can have arbitrary contents from a file or multiple files or be from something that is not a file at all.
than files.  Wrong.  Both editors and views can have arbitrary contents from a file or
+
* Editors display text and views display tables or trees.  Wrong again.  There are no constraints about what goes into an editor or a view.  For example, the plug-in Manifest Editor is form-based, whereas the Console view shows plain text.
multiple files or be from something that is not a file at all.</li>
+
 
+
 
+
* Editors display text and views display tables or trees.  Wrong again.  There are
+
no constraints about what goes into an editor or a view.  For example, the plug-in Manifest Editor
+
is form-based, whereas the Console view shows plain text.
+
  
 
What are the real differences between views and editors?  Here are the main ones.
 
What are the real differences between views and editors?  Here are the main ones.
  
* There is generally only one instance of a given view per workbench page, but
+
* There is generally only one instance of a given view per workbench page, but there can be several instances of the same type of editor.
there can be several instances of the same type of editor.</li>
+
* Editors can appear in only one region of the page, whereas views can be moved to any part of the page and minimized as fast views.
 
+
* Editors can be in a dirty state, meaning that their contents are unsaved and will be lost if the editor is closed without saving.
* Editors can appear in only one region of the page, whereas views can be moved to
+
* Views have a local toolbar, whereas editors contribute buttons to the global toolbar.
any part of the page and minimized as fast views.</li>
+
* Editors can be associated with a file name or an extension, and this association can be changed by users.
 
+
* Editors can be in a dirty state, meaning that their contents are unsaved and
+
will be lost if the editor is closed without saving.</li>
+
 
+
* Views have a local toolbar, whereas editors contribute buttons to the global toolbar.</li>
+
 
+
* Editors can be associated with a file name or an extension, and this association
+
can be changed by users.</li>
+
 
+
 
+
  
 
== See Also: ==
 
== See Also: ==
 +
*[[FAQ What is a viewer?]]
 +
*[[FAQ What is a view?]]
  
[[FAQ_What_is_a_viewer%3F]]
+
{{Template:FAQ_Tagline}}
 
+
[[FAQ_What_is_a_view%3F]]
+
 
+
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
+

Revision as of 21:49, 29 May 2006

When they first start to write plug-ins that contribute visual components, people are often confused about whether they should write a view or an editor. Superficially, the two appear to be very similar: Both are parts that make up a workbench page, both can contain arbitrary visual subcomponents, and both have various mechanisms for plugging in actions and menus. Let&#146;s start with some common misconceptions about the differences between views and editors.

  • Editors display the contents of a file, and views contain groups of files or things other than files. Wrong. Both editors and views can have arbitrary contents from a file or multiple files or be from something that is not a file at all.
  • Editors display text and views display tables or trees. Wrong again. There are no constraints about what goes into an editor or a view. For example, the plug-in Manifest Editor is form-based, whereas the Console view shows plain text.

What are the real differences between views and editors? Here are the main ones.

  • There is generally only one instance of a given view per workbench page, but there can be several instances of the same type of editor.
  • Editors can appear in only one region of the page, whereas views can be moved to any part of the page and minimized as fast views.
  • Editors can be in a dirty state, meaning that their contents are unsaved and will be lost if the editor is closed without saving.
  • Views have a local toolbar, whereas editors contribute buttons to the global toolbar.
  • Editors can be associated with a file name or an extension, and this association can be changed by users.

See Also:


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.

Back to the top