Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2014. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="STYLESHEET" href="../book.css" type="text/css">
<script language="JavaScript" src="PLUGINS_ROOT/" type="text/javascript"></script>
<title>PDE Tips and Tricks</title>


<h2>Tips and Tricks</h2>

<table border="1" cellpadding="10" cellspacing="0" width="600">
    <td valign="top" align="left" width="20%"><b>Convert API Tools Javadoc tags to annotations</b></td>
    <td valign="top" align="left" width="80%">
    	Plug-ins using API Tools can add restrictions to API Java types (such as No Reference, No Extend) 
    	using Javadoc tags or annotations.  It is recommended that projects use annotations, so PDE
    	provides a conversion wizard that will replace the tags with the equivalent PDE annotations.
    	The wizard is available by right clicking on an API Tools enabled plug-in project and selecting
    	<b>Plug-in Tools > Convert API Tools Javadoc Tags</b>.
    	A list of the available restrictions is available on the API Tools
    	<a href="">wiki page</a>.
    <td valign="top" align="left" width="20%"><b>Show the current target platform in status bar</b></td>
    <td valign="top" align="left" width="80%">
    	If you regularly switch between target platforms, PDE provides an option to show the current target
    	platform in the status bar.  On the <b>Plug-in Development</b> preference page, select
    	<b>Show current target platform in status bar</b>.  The status bar entry will show the name of
    	the active target definition and will show an error icon if there are problems with the target.
    <td valign="top" align="left" width="20%"><b>Find a feature by entering a plug-in name in the feature selection dialog</b></td>
    <td valign="top" align="left" width="80%">
    	When adding a feature to a product, feature or launch configuration, you can enter the name of a plug-in in the filter text box
    	of the feature selection dialog.  Features that include that plug-in will match the filter and be displayed.
    <td valign="top" align="left" width="20%"><b>Quickly search for any plug-in artifact</b></td>
    <td valign="top" align="left" width="80%">
    	Use the <b>Open Plug-in Artifact</b> dialog to quickly find and open plug-in artifacts.  Search
    	by the name of the plug-in, feature or product, or search for a specific package, extension point
    	or extension.  The icons can be used to see whether the artifact is available in the workspace or
    	if it comes from the target platform.  You can press <b>Ctrl-Shift-A</b> to open the dialog.
    <td valign="top" align="left" width="20%"><b>To clean or not to clean</b></td>
    <td valign="top" align="left" width="80%">When you create a new runtime 
    workbench launch configuration, PDE presets the Program Arguments on the 
    launch configuration to include a -clean argument.&nbsp;
    <p>This -clean argument clears all runtime-cached data in your runtime 
    workbench from one invocation to the next to ensure that all the changes 
    made in your host workbench, e.g. new Java packages were added to a plug-in 
    project, etc., are picked up when you launch a runtime workbench.</p>
    <p>This clearing of the cache may hinder performance if your target platform 
    contains a large number of plug-ins.&nbsp; </p>
    <p>Therefore, if you're in a situation where your target platform has a 
    large number of plug-ins and you're at a stage where you are not actively 
    adding/removing packages from your plug-in projects, you could remove the 
    -clean argument from the launch configuration to improve startup time.</p></td>
    <td valign="top" align="left" width="20%"><b>Importing with linking</b></td>
    <td valign="top" align="left" width="80%">Importing external plug-ins and 
    fragments can be time consuming and may result in large workspaces, 
    depending on the content of the plug-ins being imported.&nbsp; Therefore, 
    the 'Import External Plug-ins and Fragments' wizard gives you the option to 
    import with linking.&nbsp; This means that the import operation will not 
    copy the resources being imported into your workspace.&nbsp; It will simply 
    create links to the files being imported.&nbsp; You will be able to browse 
    these linked resources, as if they had been copied into your workspace.&nbsp; 
    However, they are physically not there on your file system, so you will not 
    be able to modify them.&nbsp; Beware of operations that depend on files 
    being physically in your workspace, as they will not work on linked 
    <td valign="top" align="left" width="20%" height="112"><b>Templates</b></td>
    <td valign="top" align="left" width="80%" height="112">For a quick start, PDE provides 
    several template plug-ins that will generate a plug-in with one or more 
    fully-working extensions.&nbsp; In addition, if at any point, you would like 
    to add a new extension from the template list (without having to generate a 
    plug-in), you could access these extension templates directly from the 
    manifest editor.&nbsp; From the 'Extensions' page of the editor, click 
    'Add...'.&nbsp; In the wizard that comes up, select Extension Templates in 
    the left pane and choose the template of choice in the right pane.</td>
    <td width="20%" valign="top" align="left" height="280"><b>Plug-in dependency extent</b></td>
    <td width="80%" valign="top" align="left" height="280">If you have ever looked at the 
    list of plug-ins that your plug-in depends on and wondered why your plug-in 
    needs a particular plug-in X, now you can easily find out why.&nbsp; 
    <p>The <b>Compute Dependency Extent </b>operation
      found on the context menu in several contexts (including manifest file
      Dependencies page and Plug-in Dependencies view) performs a combined Java and
      plug-in search to find all Java types and extension points provided by 
    plug-in X which are referenced
      by your plug-in. The results will be displayed in the Search view.&nbsp; When a type is selected in the Search results view, the <b>References
      in <i>MyPlugIn</i></b> action in the context menu searches for the places
      in the plug-in where the selected type is referenced.&nbsp;</p>
    <p>If the 
    search returns 0 results, you should definitely remove plug-in X from your 
    list of dependencies, as it is not being used at all, and it would just slow 
    class loading.</p>
    <p>The <b>Compute Dependency Extent</b> is also useful to check if you are 
    using internal (non-API) classes from plug-in X, which might not be 
    <td width="20%" valign="top" align="left" height="112"><b>Finding unused dependencies</b></td>
    <td width="80%" valign="top" align="left" height="112">Minimizing a plug-in's number of 
    dependencies is certain to improve performance.&nbsp; As your plug-in 
    evolves, its list of dependencies might become stale, as it might be still 
    containing references to plug-ins that it no longer needs.&nbsp; A quick way 
    to check that all dependencies listed by your plug-in are actually used by 
    the plug-in is to run the 'Find Unused Dependencies' utility, which is 
    available through the context menu of the 'Dependencies' page of PDE's 
    manifest editor.</td>
    <td width="20%" valign="top" align="left" height="80"><b>Extending the Java 
    search scope</b></td>
    <td width="80%" valign="top" align="left" height="80">Java Search is limited to projects 
    in your workspace and external jars that these projects reference.&nbsp; If 
    you would like to add more libraries from external plug-ins into the search: 
    open the <b>Plug-ins View</b>, select a plug-in and choose <b>Add to Java Search</b> 
    from the context menu. This is handy for remaining
      aware of other plug-ins that depend on ones you're working on.
      <p>On the <b>Plug-in Development</b> preference page you can also turn on 
      <b>Include all plug-ins from target in Java search</b>, which will add every
      plug-in in your target platform to the search scope.</p></td>
    <td valign="top" align="left" width="20%">
    	<b>Creating a Rich Client Application</b>
    <td valign="top" align="left" width="80%">
		<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.cheatsheets.openCheatSheet(cheatSheetId=org.eclipse.pde.rcpapp)")'>
    		<img src="PLUGINS_ROOT/" alt="Open the RCP cheat sheet"><strong>Creating a Rich Client Application</strong></a>
		cheat sheet will guide you through the individual steps to create a plug-in, 
		define a plug-in based product, customize a product, export a Rich Client Platform (RCP) 
		application and define a feature-based product using the Plug-in Development Environment (PDE).
    <td valign="top" align="left" width="20%">
    	<b>Creating an Eclipse Plug-in</b>
    <td valign="top" align="left" width="80%">
		<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.cheatsheets.openCheatSheet(cheatSheetId=org.eclipse.pde.helloworld)")'>
    		<img src="PLUGINS_ROOT/" alt="Open the hello world cheat sheet"><strong>Creating an Eclipse Plug-in</strong></a>
		cheat sheet will guide you through the individual steps to create a plug-in, a plug-in extension, 
		a feature and an update site using the Plug-in Development Environment (PDE). 
		It will also demonstrate how to install and uninstall a feature using Install/Update.


New to GrepCode? Check out our FAQ X