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 an Eclipse application?"

m
(Add link to "difference between application and product" article.)
 
Line 4: Line 4:
 
run in a given Eclipse instance.  This application is specified either on the  
 
run in a given Eclipse instance.  This application is specified either on the  
 
command line or by the primary feature.  After the platform starts up,
 
command line or by the primary feature.  After the platform starts up,
control of the VM&#146;s <tt>main</tt> thread is handed over to the application&#146;s  
+
control of the VM's <tt>main</tt> thread is handed over to the application's  
<tt>run</tt> method.  The application&#146;s entire lifecycle occurs within the scope
+
<tt>run</tt> method.  The application's entire lifecycle occurs within the scope
 
of this method.  When the <tt>run</tt> method returns, the platform shuts down.
 
of this method.  When the <tt>run</tt> method returns, the platform shuts down.
  
The application is essentially the boss; it&#146;s the Eclipse analog of the
+
The application is essentially the boss; it's the Eclipse analog of the
 
C or Java <tt>main</tt> method.  All other plug-ins
 
C or Java <tt>main</tt> method.  All other plug-ins
 
in the configuration plug into the application. What goes  
 
in the configuration plug into the application. What goes  
Line 24: Line 24:
 
that do not impinge on the behavior of other plug-ins.  Such constraints
 
that do not impinge on the behavior of other plug-ins.  Such constraints
 
are not as important for the application, which can have the final say
 
are not as important for the application, which can have the final say
when the needs of various plug-ins don&#146;t intersect.  Whereas
+
when the needs of various plug-ins don't intersect.  Whereas
 
plug-ins are citizens of the Eclipse Platform, the application is king. For example,
 
plug-ins are citizens of the Eclipse Platform, the application is king. For example,
 
because the application is always started first, the  
 
because the application is always started first, the  
lazy-loading principle doesn&#146;t apply to it.  The application can customize the menus and
+
lazy-loading principle doesn't apply to it.  The application can customize the menus and
 
toolbars programmatically rather than using the various workbench extension
 
toolbars programmatically rather than using the various workbench extension
 
points. The application can also determine whether views and editors have  
 
points. The application can also determine whether views and editors have  
Line 35: Line 35:
 
explore how it works, start by looking at the <tt>IDEApplication</tt>
 
explore how it works, start by looking at the <tt>IDEApplication</tt>
 
class in the <tt>org.eclipse.ui.ide</tt> plug-in.
 
class in the <tt>org.eclipse.ui.ide</tt> plug-in.
 +
 +
 +
== See Also: ==
 +
 +
[[FAQ What is the difference between a product and an application%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>
 
<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>

Latest revision as of 13:13, 8 May 2017

Technically, an Eclipse application is a plug-in that creates an extension for the extension point org.eclipse.core.runtime.applications. However, the extension point is fairly special. Only one application gets to run in a given Eclipse instance. This application is specified either on the command line or by the primary feature. After the platform starts up, control of the VM's main thread is handed over to the application's run method. The application's entire lifecycle occurs within the scope of this method. When the run method returns, the platform shuts down.

The application is essentially the boss; it's the Eclipse analog of the C or Java main method. All other plug-ins in the configuration plug into the application. What goes into the run method is entirely up to you. It can be a graphical application, which will create a user interface and run some kind of event loop, or a completely headless application that runs without interacting with a user.

Because a running Eclipse instance has only one application in it, the philosophy of building applications is very different from the approach when building plug-ins. Essentially, the flexibility given to plug-ins must be mitigated by the fact that other plug-ins in the system may have competing requirements. The laws of plug-in behavior are designed to allow plug-ins to interact in ways that do not impinge on the behavior of other plug-ins. Such constraints are not as important for the application, which can have the final say when the needs of various plug-ins don't intersect. Whereas plug-ins are citizens of the Eclipse Platform, the application is king. For example, because the application is always started first, the lazy-loading principle doesn't apply to it. The application can customize the menus and toolbars programmatically rather than using the various workbench extension points. The application can also determine whether views and editors have title bars and whether views can be closed or resized.

The Eclipse SDK is one particularly well-known example of an Eclipse application. To explore how it works, start by looking at the IDEApplication class in the org.eclipse.ui.ide plug-in.


See Also:

FAQ What is the difference between a product and an application?



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.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.