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
Line 7: Line 7:
 
<tt>run</tt> method.  The application&#146;s entire lifecycle occurs within the scope
 
<tt>run</tt> method.  The application&#146;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&#146;s the Eclipse analog of the
Line 16: Line 15:
 
event loop, or a completely headless application that runs without  
 
event loop, or a completely headless application that runs without  
 
interacting with a user.
 
interacting with a user.
 
  
 
Because a running Eclipse instance has only one application in it,  
 
Because a running Eclipse instance has only one application in it,  
Line 33: Line 31:
 
points. The application can also determine whether views and editors have  
 
points. The application can also determine whether views and editors have  
 
title bars and whether views can be closed or resized.
 
title bars and whether views can be closed or resized.
 
  
 
The Eclipse SDK is one particularly well-known example of an Eclipse application. To  
 
The Eclipse SDK is one particularly well-known example of an Eclipse application. To  

Revision as of 22:10, 29 May 2006

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&#146;s main thread is handed over to the application&#146;s run method. The application&#146;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&#146;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&#146;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&#146;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.


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