Difference between revisions of "FAQ What is a plug-in?"

From Eclipsepedia

Jump to: navigation, search
 
m
Line 1: Line 1:
In retrospect, ''plug-in'', perhaps wasn’t the most appropriate term for the
+
In retrospect, ''plug-in'', perhaps wasn’t the most appropriate term for the components that build up an Eclipse application.  The term implies the existence of a socket, a monolithic machine or grid that is being plugged into. In Eclipse, this isn’t the case.  A plug-in connects with a universe of other plug-ins to form a running application.  The best software analogy compares a plug-in to an object in object-oriented programming. A plug-in, like an object, is an encapsulation of behavior and/or data that interacts with other plug-ins to form a running program.
components that build up an Eclipse application.  The term implies
+
the existence of a socket, a monolithic machine or grid that is being
+
plugged into. In Eclipse, this isn’t the case.  A plug-in connects with a universe
+
of other plug-ins to form a running application.  The best software analogy
+
compares a plug-in to an object in object-oriented programming. A
+
plug-in, like an object, is an encapsulation of behavior and/or data that
+
interacts with other plug-ins to form a running program.
+
 
+
 
+
 
+
A better question in the context of Eclipse is, What isn’t a plug-in?
+
A single Java source file, <tt>Main.java</tt>, is not part of
+
a plug-in.  This class is used only to find and invoke the plug-in responsible
+
for starting up the Eclipse Platform.  This class will typically in turn be invoked
+
by a native executable, such as <tt>eclipse.exe</tt> on Windows,
+
although this is just icing to hide the incantations required to find and
+
launch a Java virtual machine.  In short, just about everything
+
in Eclipse is a plug-in.
+
 
+
 
+
 
+
 
+
More concretely, a plug-in minimally consists of a <i>plug-in manifest file</i>,
+
<tt>plugin.xml</tt>. This manifest provides important details about
+
the plug-in, such as its name, ID, and version number.  The manifest may also tell
+
the platform what Java code it supplies and what other plug-ins
+
it requires, if any. Note that everything except the basic plug-in description is
+
optional.  A plug-in may provide code, or it may provide only documentation,
+
resource bundles, or other data to be used by other plug-ins.
+
 
+
 
+
 
+
 
+
A plug-in that provides Java code may specify in the manifest a concrete
+
subclass of <tt>org.eclipse.core.runtime.Plugin</tt>.  This class
+
consists mostly of convenience methods for accessing various platform utilities,
+
and it may also implement <tt>startup</tt> and <tt>shutdown</tt>
+
methods that define the lifecycle of the plug-in within the platform.
+
 
+
  
 +
A better question in the context of Eclipse is, What isn&#146;t a plug-in? A single Java source file, <tt>Main.java</tt>, is not part of a plug-in.  This class is used only to find and invoke the plug-in responsible  for starting up the Eclipse Platform.  This class will typically in turn be invoked by a native executable, such as <tt>eclipse.exe</tt> on Windows, although this is just icing to hide the incantations required to find and launch a Java virtual machine.  In short, just about everything in Eclipse is a plug-in.
  
 +
More concretely, a plug-in minimally consists of a <i>plug-in manifest file</i>, <tt>plugin.xml</tt>. This manifest provides important details about the plug-in, such as its name, ID, and version number.  The manifest may also tell the platform what Java code it supplies and what other plug-ins  it requires, if any. Note that everything except the basic plug-in description is optional.  A plug-in may provide code, or it may provide only documentation, resource bundles, or other data to be used by other plug-ins.
  
 +
A plug-in that provides Java code may specify in the manifest a concrete subclass of <tt>org.eclipse.core.runtime.Plugin</tt>.  This class  consists mostly of convenience methods for accessing various platform utilities, and it may also implement <tt>startup</tt> and <tt>shutdown</tt> methods that define the lifecycle of the plug-in within the platform.
  
 
== See Also: ==
 
== See Also: ==
 +
*[[FAQ What is the plug-in manifest file (plugin.xml)?]]
 +
*[[FAQ What are extensions and extension points?]]
  
 
+
{{Template:FAQ_Tagline}}
[[FAQ_What_is_the_plug-in_manifest_file_%28%3Ctt%3Eplugin.xml%3C%2Ftt%3E%29%3F]]
+
 
+
 
+
[[FAQ_What_are_extensions_and_extension_points%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 05:02, 17 June 2006

In retrospect, plug-in, perhaps wasn’t the most appropriate term for the components that build up an Eclipse application. The term implies the existence of a socket, a monolithic machine or grid that is being plugged into. In Eclipse, this isn’t the case. A plug-in connects with a universe of other plug-ins to form a running application. The best software analogy compares a plug-in to an object in object-oriented programming. A plug-in, like an object, is an encapsulation of behavior and/or data that interacts with other plug-ins to form a running program.

A better question in the context of Eclipse is, What isn’t a plug-in? A single Java source file, Main.java, is not part of a plug-in. This class is used only to find and invoke the plug-in responsible for starting up the Eclipse Platform. This class will typically in turn be invoked by a native executable, such as eclipse.exe on Windows, although this is just icing to hide the incantations required to find and launch a Java virtual machine. In short, just about everything in Eclipse is a plug-in.

More concretely, a plug-in minimally consists of a plug-in manifest file, plugin.xml. This manifest provides important details about the plug-in, such as its name, ID, and version number. The manifest may also tell the platform what Java code it supplies and what other plug-ins it requires, if any. Note that everything except the basic plug-in description is optional. A plug-in may provide code, or it may provide only documentation, resource bundles, or other data to be used by other plug-ins.

A plug-in that provides Java code may specify in the manifest a concrete subclass of org.eclipse.core.runtime.Plugin. This class consists mostly of convenience methods for accessing various platform utilities, and it may also implement startup and shutdown methods that define the lifecycle of the plug-in within the platform.

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.