<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEMGQHkyeyp7ImA9WxNUEUs.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535</id><updated>2009-11-02T04:53:41.793-08:00</updated><title>Eclipse RCP Tutorials - beta</title><subtitle type="html">Java Eclipse Rich Client Platform Tutorials, Snippets, and Sample Code</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://eclipsercptutorials.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/EclipseRcpTutorials" type="application/atom+xml" /><feedburner:emailServiceId>EclipseRcpTutorials</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;A0EFRXoycCp7ImA9WxJQFk8.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-7247381715975499892</id><published>2009-05-28T11:27:00.000-07:00</published><updated>2009-05-29T13:40:14.498-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T13:40:14.498-07:00</app:edited><title>Using Simple JFace Message Boxes in an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBGaaEWhoI/AAAAAAAABgM/bqcFgI3Y0Ng/s1600-h/eclipse+rcp+JFace+message+2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 102px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBGaaEWhoI/AAAAAAAABgM/bqcFgI3Y0Ng/s200/eclipse+rcp+JFace+message+2.png" alt="" id="BLOGGER_PHOTO_ID_5341346577549526658" border="0" /&gt;&lt;/a&gt;This article shows how to use JFace messages boxes in an RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. The full source code is found at the end of the article. Most if not all GUI applications frequently use message boxes to give or get information to or from the user. Jface provides us with 5 commonly used message boxes which can be conveniently used via a single static method. The available message boxes are:&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MessageDialog.openQuestion()&lt;/li&gt;&lt;li&gt;MessageDialog.openInformation()&lt;/li&gt;&lt;li&gt;MessageDialog.openWarning()&lt;/li&gt;&lt;li&gt;MessageDialog.openConfirm()&lt;/li&gt;&lt;li&gt;MessageDialog.openError()&lt;/li&gt;&lt;/ul&gt;Each method takes  as arguments a Shell that the message box belongs to, the title of the message box, and the message to be displayed in the message box. They each display an icon such as a question mark or a exclamation mark, etc. (For some reason the openQuestion message box displayes an exclamation point on a Mac?!?) and a button or buttons for the user to close the box or respond to a question. The openQuestion and openConfirm message boxes return a boolean corresponding to the users selection.&lt;br /&gt;&lt;br /&gt;To demonstrate the JFace Message Boxes used in an Eclipse RCP application, a view containing a single button is created. When the button is clicked, a Question message box pops up, and depending on the boolean value returned, opens up either a Warning or an Information message box.&lt;br /&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Add code to the createPartControl() method in the application's view to add a button and set its action listener, coding the calls to the JFace message box static methods.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.jfacemessageboxes;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.dialogs.MessageDialog;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.events.SelectionAdapter;&lt;br /&gt;import org.eclipse.swt.events.SelectionEvent;&lt;br /&gt;import org.eclipse.swt.layout.RowLayout;&lt;br /&gt;import org.eclipse.swt.widgets.Button;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.ui.PlatformUI;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt; public static final String ID = "com.eclipsercptutorials.JFaceMessageBoxes.MainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt; public MainView() {}&lt;br /&gt;&lt;br /&gt; public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;   Composite lMainViewComposite = new Composite(parent, SWT.NONE);&lt;br /&gt;&lt;br /&gt;   Button lButton = new Button(lMainViewComposite, SWT.PUSH);&lt;br /&gt;   lButton.setText("Question");&lt;br /&gt;   lButton.addSelectionListener(new SelectionAdapter(){&lt;br /&gt;     public void widgetSelected(SelectionEvent event){&lt;br /&gt;&lt;br /&gt;     Shell lShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();&lt;br /&gt;&lt;br /&gt;     boolean isHavingFun = MessageDialog.openQuestion(lShell, "Information", "Are you having fun?");&lt;br /&gt;&lt;br /&gt;       if(isHavingFun){&lt;br /&gt;&lt;br /&gt;      MessageDialog.openInformation(lShell, "Information", "You are having fun! Java is awesome.");&lt;br /&gt;&lt;br /&gt;       }else{&lt;br /&gt;&lt;br /&gt;      MessageDialog.openWarning(lShell, "Warning", "You are NOT having fun! Go for a walk and get some fresh air.");&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;     }&lt;br /&gt;   });&lt;br /&gt;&lt;br /&gt;   lMainViewComposite.setLayout(new RowLayout()); // this sets a Layout for the view's Composite&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setFocus() {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 2. Run the application and test if everything worked. Your application should now have a view with a single button that triggers a JFace question message box to pop up, and depending on the boolean value returned, opens up either a Warning or an Information message box:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBEtCyH7vI/AAAAAAAABfs/vV001Phdhhc/s1600-h/eclipse+rcp+JFace+message+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 398px; height: 299px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBEtCyH7vI/AAAAAAAABfs/vV001Phdhhc/s400/eclipse+rcp+JFace+message+1.png" alt="" id="BLOGGER_PHOTO_ID_5341344698693316338" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBEtUH2cZI/AAAAAAAABf0/EfVWsBr2z_c/s1600-h/eclipse+rcp+JFace+message+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 204px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBEtUH2cZI/AAAAAAAABf0/EfVWsBr2z_c/s400/eclipse+rcp+JFace+message+2.png" alt="" id="BLOGGER_PHOTO_ID_5341344703347847570" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SiBEt-6VKrI/AAAAAAAABgE/DRsSxyvIQF4/s1600-h/eclipse+rcp+JFace+message+4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 204px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SiBEt-6VKrI/AAAAAAAABgE/DRsSxyvIQF4/s400/eclipse+rcp+JFace+message+4.png" alt="" id="BLOGGER_PHOTO_ID_5341344714833865394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/SiBEtiLQouI/AAAAAAAABf8/tkLr5iOLC2A/s1600-h/eclipse+rcp+JFace+message+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 203px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/SiBEtiLQouI/AAAAAAAABf8/tkLr5iOLC2A/s400/eclipse+rcp+JFace+message+3.png" alt="" id="BLOGGER_PHOTO_ID_5341344707120243426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Piece of Cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.JFaceMessageBoxes.zip"&gt;com.eclipsercptutorials.JFaceMessageBoxes.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-menu-to-view-in-eclipse-rcp.html"&gt;Add a Menu to a View in an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-7247381715975499892?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/jAYNgSg17cs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/7247381715975499892/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/05/using-simple-jface-message-boxes-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7247381715975499892?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7247381715975499892?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/jAYNgSg17cs/using-simple-jface-message-boxes-in.html" title="Using Simple JFace Message Boxes in an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_eIoDncf-Rgo/SiBGaaEWhoI/AAAAAAAABgM/bqcFgI3Y0Ng/s72-c/eclipse+rcp+JFace+message+2.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/05/using-simple-jface-message-boxes-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcEQHk6eip7ImA9WxJQFk4.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-7673957861295255965</id><published>2009-05-20T22:59:00.000-07:00</published><updated>2009-05-29T13:46:41.712-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T13:46:41.712-07:00</app:edited><title>Add a Menu to a View in an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ShTudUXCsII/AAAAAAAABfU/81swguo7GdI/s1600-h/eclipse+rcp+view+menu.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 118px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ShTudUXCsII/AAAAAAAABfU/81swguo7GdI/s200/eclipse+rcp+view+menu.png" alt="" id="BLOGGER_PHOTO_ID_5338153645789851778" border="0" /&gt;&lt;/a&gt;This article shows how to add a menu to a View and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. The full source code is found at the end of the article. Eclipse RCP applications such as the Eclipse IDE, can have a toolbar and/or, as demonstrated here, a  drop down menu located at the top of any View. With just a few lines of code you can easily add a menu to a View. By the way, see the &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html"&gt;article for adding a Toolbar to a View with this link&lt;/a&gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Create an Action that defines what will happen when the action in the menu is clicked. Make a new class that extends org.eclipse.jface.action.Action and implements IWorkbenchAction. The class needs a private static final String property used to set the ID in the constructor. Inside the run() method is where you put your custom code. In this "CustomAction" example, code is added to the run() method that opens up a JFace MessageDialog box using a handy static convenience method of the MessageDialog class.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewmenu;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.Action;&lt;br /&gt;import org.eclipse.jface.dialogs.MessageDialog;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.ui.PlatformUI;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;&lt;br /&gt;&lt;br /&gt;public class CustomAction extends Action implements IWorkbenchAction{&lt;br /&gt;&lt;br /&gt;  private static final String ID = "com.timmolter.helloWorld.CustomAction";&lt;br /&gt;&lt;br /&gt;  public CustomAction(){&lt;br /&gt;    setId(ID);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void run() {&lt;br /&gt;&lt;br /&gt;    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();&lt;br /&gt;    String dialogBoxTitle = "Message";&lt;br /&gt;    String message = "You clicked the custom action from the menu!";&lt;br /&gt;    MessageDialog.openInformation(shell, dialogBoxTitle, message);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void dispose() {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 2: Add the menu with its Action and icon to the View. In the View's createPartControl method new-up the CustomAction, and set the Action's tool-tip text and icon. In this example, a .png icon image called "bomb.png" was added to the icons folder in the plugin project. To find out where to find nice icons for Eclipse RCP projects see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html"&gt;Add an Icon to an Eclipse RCP Application View&lt;/a&gt;. Add the Action to the View's ToolBarManager using the getViewSite().getActionBars().getMenuManager().add(lCustomAction) method. Here the CustomAction was added to the same menu three times just to fill out the menu a bit, but you would of course add a set of several different Actions. Use a Separator in the menu to organize the Actions.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewmenu;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.Separator;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;  public static final String ID = "com.eclipsercptutorials.addViewMenu.MainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;  public MainView() { }&lt;br /&gt;&lt;br /&gt;  public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;   // Custom Action for the View's Menu&lt;br /&gt;   CustomAction lCustomAction = new CustomAction();&lt;br /&gt;   lCustomAction.setText("Open Dialog Box");&lt;br /&gt;   lCustomAction.setImageDescriptor(Activator.getImageDescriptor("icons/bomb.png"));&lt;br /&gt;   getViewSite().getActionBars().getMenuManager().add(lCustomAction);&lt;br /&gt;   getViewSite().getActionBars().getMenuManager().add(new Separator()); //Add a horizontal separator&lt;br /&gt;   getViewSite().getActionBars().getMenuManager().add(lCustomAction);&lt;br /&gt;   getViewSite().getActionBars().getMenuManager().add(lCustomAction);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setFocus() { }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 3: Run the application and test if everything worked. Your application should now have a View with a menu containing several Actions with a Separator. Clicking on one of the Actions opens up a MessageDialog. If you're not seeing it, nor the View's tab and title for that matter, make sure you specify that the title of the View should be shown in the layout.addStandaloneView() method of the Perspective's createInitialLayout() method - the second argument of the addStandaloneView() should be set to true.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewmenu;&lt;br /&gt;&lt;br /&gt;import org.eclipse.ui.IPageLayout;&lt;br /&gt;import org.eclipse.ui.IPerspectiveFactory;&lt;br /&gt;&lt;br /&gt;import com.eclipsercptutorials.addviewmenu.MainView;&lt;br /&gt;&lt;br /&gt;public class Perspective implements IPerspectiveFactory {&lt;br /&gt;&lt;br /&gt;  public void createInitialLayout(IPageLayout layout) {&lt;br /&gt;&lt;br /&gt;   layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, layout.getEditorArea());&lt;br /&gt;   layout.setEditorAreaVisible(false); //hide the editor in the perspective&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ShTwEVbCiaI/AAAAAAAABfc/RGyyTR_h9Ys/s1600-h/eclipse+rcp+view+menu.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 237px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ShTwEVbCiaI/AAAAAAAABfc/RGyyTR_h9Ys/s400/eclipse+rcp+view+menu.png" alt="" id="BLOGGER_PHOTO_ID_5338155415601580450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/SiBJOuNMTTI/AAAAAAAABgU/qK4gGvAl2hM/s1600-h/eclipse+rcp+ad+view+menu+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 207px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/SiBJOuNMTTI/AAAAAAAABgU/qK4gGvAl2hM/s400/eclipse+rcp+ad+view+menu+1.png" alt="" id="BLOGGER_PHOTO_ID_5341349675331767602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Piece of Cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.addViewMenu.zip"&gt;com.eclipsercptutorials.addViewMenu.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html"&gt;Add a Toolbar to a View in an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/using-simple-jface-message-boxes-in.html"&gt;Using Simple JFace Message Boxes in an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-7673957861295255965?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/Fv8Opi2ieCg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/7673957861295255965/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/05/add-menu-to-view-in-eclipse-rcp.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7673957861295255965?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7673957861295255965?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/Fv8Opi2ieCg/add-menu-to-view-in-eclipse-rcp.html" title="Add a Menu to a View in an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_eIoDncf-Rgo/ShTudUXCsII/AAAAAAAABfU/81swguo7GdI/s72-c/eclipse+rcp+view+menu.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/05/add-menu-to-view-in-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEFSHs-fSp7ImA9WxJRGEU.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-2729713587490706184</id><published>2009-05-16T06:56:00.000-07:00</published><updated>2009-05-20T23:33:39.555-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-20T23:33:39.555-07:00</app:edited><title>Add a Toolbar to a View in an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8RUzX6-yI/AAAAAAAABek/SVJzsbGeUdU/s1600-h/Eclipse+rcp+tool+bar+view+1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8RUzX6-yI/AAAAAAAABek/SVJzsbGeUdU/s200/Eclipse+rcp+tool+bar+view+1.png" alt="" id="BLOGGER_PHOTO_ID_5336503132542925602" border="0" /&gt;&lt;/a&gt;This article shows how to add a toolbar to a View and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. The full source code is found at the end of the article. Eclipse RCP applications such as the Eclipse IDE, can have a drop down menu and/or, as demonstrated here, a toolbar located at the top of any View. With just a few lines of code you can easily add an icon to a View's toolbar and have it activate an Action when clicked. By the way, see the &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-menu-to-view-in-eclipse-rcp.html"&gt;article for adding a Menu to a View with this link&lt;/a&gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Create an Action that defines what will happen when the icon in the toolbar is clicked. Make a new class that extends org.eclipse.jface.action.Action and implements IWorkbenchAction. The class needs a private static final String property used to set the ID in the constructor. Inside the run() method is where you put your custom code. In this "CustomAction" example, code is added to the run() method that opens up a JFace MessageDialog box using a handy static convenience method of the MessageDialog class.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewtoolbar;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.Action;&lt;br /&gt;import org.eclipse.jface.dialogs.MessageDialog;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.ui.PlatformUI;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;&lt;br /&gt;&lt;br /&gt;public class CustomAction extends Action implements IWorkbenchAction{&lt;br /&gt;&lt;br /&gt;private static final String ID = "com.timmolter.helloWorld.CustomAction";&lt;br /&gt;&lt;br /&gt;public CustomAction(){&lt;br /&gt;setId(ID);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void run() {&lt;br /&gt;&lt;br /&gt;Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();&lt;br /&gt;String dialogBoxTitle = "Message";&lt;br /&gt;String message = "You clicked something!";&lt;br /&gt;MessageDialog.openInformation(shell, dialogBoxTitle, message);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void dispose() {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 2:Add the toolbar with its Action and icon to the View. In the View's createPartControl method new-up the Action, and set the Action's tool-tip text and icon. In this example, a .png icon image called "bomb.png" was added to the icons folder in the plugin project. To find out where to find nice icons for Eclipse RCP projects see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html"&gt;Add an Icon to an Eclipse RCP Application View&lt;/a&gt;. Add the Action to the View's ToolBarManager using the getViewSite().getActionBars().getToolBarManager().add(lCustomAction) method.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewtoolbar;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;public static final String ID = "com.eclipsercptutorials.addViewToolBar.MainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;public MainView() { }&lt;br /&gt;&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt; // Custom Action for the View's Menu&lt;br /&gt; CustomAction lCustomAction = new CustomAction();&lt;br /&gt; lCustomAction.setText("Open Dialog Box");&lt;br /&gt; lCustomAction.setImageDescriptor(Activator.getImageDescriptor("icons/bomb.png"));&lt;br /&gt; getViewSite().getActionBars().getToolBarManager().add(lCustomAction);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setFocus() { }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Step 3: Run the application and test if everything worked. Your application should now have a View with an icon in the View's toolbar, which opens up a MessageDialog when clicked. If you're not seeing it, nor the View's tab and title for that matter, make sure you specify that the title of the View should be shown in the layout.addStandaloneView() method of the Perspective's createInitialLayout() method - the second argument of the addStandaloneView() should be set to true.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addviewtoolbar;&lt;br /&gt;&lt;br /&gt;import org.eclipse.ui.IPageLayout;&lt;br /&gt;import org.eclipse.ui.IPerspectiveFactory;&lt;br /&gt;&lt;br /&gt;public class Perspective implements IPerspectiveFactory {&lt;br /&gt;&lt;br /&gt;public void createInitialLayout(IPageLayout layout) {&lt;br /&gt;&lt;br /&gt; layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, layout.getEditorArea());&lt;br /&gt; layout.setEditorAreaVisible(false); //hide the editor in the perspective&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8Rbu_LStI/AAAAAAAABes/vXvW9Id-3kA/s1600-h/Eclipse+rcp+tool+bar+view+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8Rbu_LStI/AAAAAAAABes/vXvW9Id-3kA/s400/Eclipse+rcp+tool+bar+view+1.png" alt="" id="BLOGGER_PHOTO_ID_5336503251624479442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8RbqC3H6I/AAAAAAAABe0/lfgyljL2Plo/s1600-h/Eclipse+rcp+tool+bar+view+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 203px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8RbqC3H6I/AAAAAAAABe0/lfgyljL2Plo/s400/Eclipse+rcp+tool+bar+view+2.png" alt="" id="BLOGGER_PHOTO_ID_5336503250297757602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Piece of Cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.addViewToolBar.zip"&gt;com.eclipsercptutorials.addViewToolBar.zip&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-menu-to-view-in-eclipse-rcp.html"&gt;Add a Menu to a View in an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/04/animation-in-eclipse-rcp-applications.html"&gt;Animation in Eclipse RCP Applications - A Bouncing Ball&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-2729713587490706184?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/G6EOBN4J5A8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/2729713587490706184/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/2729713587490706184?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/2729713587490706184?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/G6EOBN4J5A8/add-toolbar-to-view-in-eclipse-rcp.html" title="Add a Toolbar to a View in an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sg8RUzX6-yI/AAAAAAAABek/SVJzsbGeUdU/s72-c/Eclipse+rcp+tool+bar+view+1.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYBQXw7fSp7ImA9WxJRFU0.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-8536545872118129583</id><published>2009-04-21T12:09:00.000-07:00</published><updated>2009-05-16T12:29:10.205-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-16T12:29:10.205-07:00</app:edited><title>Animation in Eclipse RCP Applications - A Bouncing Ball</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Se4ebxEvQkI/AAAAAAAABcE/8UTzdlolAM4/s1600-h/eclipse+rcp+animation.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Se4ebxEvQkI/AAAAAAAABcE/8UTzdlolAM4/s200/eclipse+rcp+animation.png" alt="" id="BLOGGER_PHOTO_ID_5327228871604388418" border="0" /&gt;&lt;/a&gt;This article shows how to add animation to an Eclipse RCP Application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. The full source code is found at the end of the article. To demonstrate the animation, code is created that makes an image of the &lt;a href="http://obscuredclarity.blogspot.com/2009/03/earths-magnificent-moon-13-images.html"&gt;moon&lt;/a&gt; bounce around the view, using real physics equations to control the acceleration and spin. If you want a more in depth explanation of adding an image or updating the GUI from a worker thread please see the previous articles: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html"&gt;Add an Image to an Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/04/how-to-update-gui-of-eclipse-rcp.html"&gt;Updating a Widget in an Eclipse RCP Application from a Worker Thread&lt;/a&gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html"&gt;Add an Image to the view&lt;/a&gt; . For this tutorial, an image of the moon with a transparent background called moon.png was prepared and added to the project.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/Se4o7AfziwI/AAAAAAAABcM/4jltWtFNq2A/s1600-h/moon.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 85px; height: 85px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/Se4o7AfziwI/AAAAAAAABcM/4jltWtFNq2A/s400/moon.png" alt="" id="BLOGGER_PHOTO_ID_5327240403436669698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 2: Create an inner class that implements Runnable, that updates the contents of the view at a regular interval. Later, during the initialization of the view, this worker thread is started, which calls the update() method of the view every ~15 milliseconds. The speed of the animation can be controlled by the TIMER_INTERVAL variable, which defines how long the thread should sleep before waking up and calling the update() method again.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;class AnimatorThread implements Runnable{&lt;br /&gt;&lt;br /&gt;  // The timer interval in milliseconds&lt;br /&gt;  private static final int   TIMER_INTERVAL = 14;&lt;br /&gt;  &lt;br /&gt;  public void go(){&lt;br /&gt;   &lt;br /&gt;   Thread t = new Thread(this);&lt;br /&gt;   t.start();&lt;br /&gt;   &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public void run() {&lt;br /&gt;   try {&lt;br /&gt;    while(true){&lt;br /&gt;     animate();&lt;br /&gt;     Thread.sleep(TIMER_INTERVAL);&lt;br /&gt;    }&lt;br /&gt;   } catch (InterruptedException e) {&lt;br /&gt;    e.printStackTrace();&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 3: Create the view's contents and start the worker thread. In the createPartControl() method of the view, create a Canvas where the image will be painted. Set the canvas's background color and add a paintListener to it with code defining where the image of the moon should be painted. Finally, new up the worker thread class and start it.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;  &lt;br /&gt;  parent.setBackground(new Color(parent.getDisplay(), 205, 38, 38));&lt;br /&gt;&lt;br /&gt;  // Create the canvas for drawing&lt;br /&gt;  canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED);&lt;br /&gt;  canvas.setBackground(new Color(parent.getDisplay(), 0,0,0));&lt;br /&gt;     canvas.addPaintListener( new PaintListener() {&lt;br /&gt;&lt;br /&gt;   public void paintControl(PaintEvent e) {&lt;br /&gt;    &lt;br /&gt;          GC gc = e.gc;&lt;br /&gt;          Transform trans = new Transform(e.display );&lt;br /&gt;          gc.getTransform( trans );&lt;br /&gt;          trans.translate( x, y );&lt;br /&gt;          trans.translate( IMAGE_WIDTH / 2f, IMAGE_WIDTH / 2f );&lt;br /&gt;          trans.rotate( a );&lt;br /&gt;          trans.translate( -IMAGE_WIDTH / 2f, -IMAGE_WIDTH / 2f );&lt;br /&gt;          gc.setTransform( trans );&lt;br /&gt;          trans.dispose();&lt;br /&gt;&lt;br /&gt;          gc.drawImage( moon, 0, 0, moon.getBounds().width, moon.getBounds().height, 0, 0, IMAGE_WIDTH, IMAGE_WIDTH); // Draw the moon&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt; &lt;br /&gt;     AnimatorThread at = new AnimatorThread();&lt;br /&gt;     at.go();&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 4: Create the physics for the bouncing of the ball. Add some constants and variables as private members of the view class and an animate() method which calculates the next position of the moon. Last but not least, force a redraw of the canvas at the end of the animate() method. This invokes the code that was defined in the canvas's PaintListener.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt; public void animate() {&lt;br /&gt;    &lt;br /&gt;  Display.getDefault().asyncExec(new Runnable(){&lt;br /&gt;   &lt;br /&gt;   public void run(){&lt;br /&gt;    &lt;br /&gt;    try{&lt;br /&gt;     &lt;br /&gt;     float left = x;&lt;br /&gt;        float top = y;&lt;br /&gt;&lt;br /&gt;        // Determine the ball's location&lt;br /&gt;        directionY += GRAVITY;&lt;br /&gt;        x += directionX;&lt;br /&gt;        y += directionY;&lt;br /&gt;        a += directionA;&lt;br /&gt;&lt;br /&gt;        // Determine out of bounds&lt;br /&gt;        Rectangle rect = canvas.getClientArea();&lt;br /&gt;        if ( x &gt; rect.width - IMAGE_WIDTH ) {&lt;br /&gt;          x = rect.width - IMAGE_WIDTH;&lt;br /&gt;          directionX = -directionX;&lt;br /&gt;          directionA -= ( directionY - directionA ) * FRICTION_WALL;&lt;br /&gt;        }&lt;br /&gt;        if ( x &lt; 0 ) {&lt;br /&gt;          x = 0;&lt;br /&gt;          directionX = -directionX;&lt;br /&gt;          directionA += ( directionY - directionA ) * FRICTION_WALL;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if ( y &gt; rect.height - IMAGE_WIDTH ) {&lt;br /&gt;          directionY = (int) ( -GRAVITY * Math.sqrt( ( 1 + 8 * ( rect.height - IMAGE_WIDTH ) / GRAVITY ) ) / 2 );&lt;br /&gt;          y = rect.height - IMAGE_WIDTH;&lt;br /&gt;          directionA += ( directionX - directionA ) * FRICTION_FLOOR;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        float right = left + IMAGE_WIDTH;&lt;br /&gt;        float bottom = top + IMAGE_WIDTH;&lt;br /&gt;        if ( x &lt; left )&lt;br /&gt;          left = x;&lt;br /&gt;        else&lt;br /&gt;          right = x + IMAGE_WIDTH;&lt;br /&gt;        if ( y &lt; top )&lt;br /&gt;          top = y;&lt;br /&gt;        else&lt;br /&gt;          bottom = y + IMAGE_WIDTH;&lt;br /&gt;        &lt;br /&gt;        // Force a redraw&lt;br /&gt;        canvas.redraw( (int) Math.floor( left ) - 1, (int) Math.floor( top ) - 1, (int) ( Math.ceil( right ) - Math.floor( left ) ) + 2, (int) ( Math.ceil( bottom ) - Math.floor( top ) ) + 2, false );&lt;br /&gt;        &lt;br /&gt;    }catch(SWTException e){&lt;br /&gt;     //eat it!&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 5: Run the application and test if everything worked. Your application should now have an image of the moon in the view that bounces back and forth across the view. As you resize the view, the moon's boundaries are recalculated.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/Se9Z7CFD-pI/AAAAAAAABcU/KvIWg0W49XI/s1600-h/eclipse+rcp+animation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 399px; height: 300px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/Se9Z7CFD-pI/AAAAAAAABcU/KvIWg0W49XI/s400/eclipse+rcp+animation.png" alt="" id="BLOGGER_PHOTO_ID_5327575754907843218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Here's the full code of the view:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.animation;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.SWTException;&lt;br /&gt;import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;import org.eclipse.swt.events.PaintListener;&lt;br /&gt;import org.eclipse.swt.graphics.Color;&lt;br /&gt;import org.eclipse.swt.graphics.GC;&lt;br /&gt;import org.eclipse.swt.graphics.Image;&lt;br /&gt;import org.eclipse.swt.graphics.Rectangle;&lt;br /&gt;import org.eclipse.swt.graphics.Transform;&lt;br /&gt;import org.eclipse.swt.widgets.Canvas;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Display;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt; &lt;br /&gt; public static final String ID = "com.eclipsercptutorials.animation.mainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt; &lt;br /&gt; // The image&lt;br /&gt; private Image moon;&lt;br /&gt; &lt;br /&gt; // The image width&lt;br /&gt; private static int IMAGE_WIDTH = 85;&lt;br /&gt;&lt;br /&gt; // Rate of downward acceleration per frame&lt;br /&gt; private static final float GRAVITY        = .25f;&lt;br /&gt; &lt;br /&gt; // Coefficient of friction&lt;br /&gt; private static final float FRICTION_FLOOR = 5f / 9f;&lt;br /&gt; private static final float FRICTION_WALL  = 5f / 11f;&lt;br /&gt; &lt;br /&gt; // The location of the "ball"&lt;br /&gt; private float              x              = 0;&lt;br /&gt; private float              y              = 0;&lt;br /&gt; private float              a              = 0;&lt;br /&gt; &lt;br /&gt; // The direction the "ball" is moving&lt;br /&gt; private float              directionX     = 4;&lt;br /&gt; private float              directionY     = 0;&lt;br /&gt; private float              directionA     = 0;&lt;br /&gt; &lt;br /&gt; // We draw everything on this canvas&lt;br /&gt; private Canvas             canvas;&lt;br /&gt; &lt;br /&gt; public MainView() {&lt;br /&gt;  &lt;br /&gt;  moon = Activator.getImageDescriptor("icons/moon.png").createImage();&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void createPartControl(Composite parent) {&lt;br /&gt;  &lt;br /&gt;  parent.setBackground(new Color(parent.getDisplay(), 205, 38, 38));&lt;br /&gt;&lt;br /&gt;  // Create the canvas for drawing&lt;br /&gt;  canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED);&lt;br /&gt;  canvas.setBackground(new Color(parent.getDisplay(), 0,0,0));&lt;br /&gt;     canvas.addPaintListener( new PaintListener() {&lt;br /&gt;&lt;br /&gt;   public void paintControl(PaintEvent e) {&lt;br /&gt;    &lt;br /&gt;          GC gc = e.gc;&lt;br /&gt;          Transform trans = new Transform(e.display );&lt;br /&gt;          gc.getTransform( trans );&lt;br /&gt;          trans.translate( x, y );&lt;br /&gt;          trans.translate( IMAGE_WIDTH / 2f, IMAGE_WIDTH / 2f );&lt;br /&gt;          trans.rotate( a );&lt;br /&gt;          trans.translate( -IMAGE_WIDTH / 2f, -IMAGE_WIDTH / 2f );&lt;br /&gt;          gc.setTransform( trans );&lt;br /&gt;          trans.dispose();&lt;br /&gt;&lt;br /&gt;          gc.drawImage( moon, 0, 0, moon.getBounds().width, moon.getBounds().height, 0, 0, IMAGE_WIDTH, IMAGE_WIDTH); // Draw the moon&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt;     &lt;br /&gt;     AnimatorThread at = new AnimatorThread();&lt;br /&gt;     at.go();&lt;br /&gt; }&lt;br /&gt;     &lt;br /&gt;   public void animate() {&lt;br /&gt;    &lt;br /&gt;  Display.getDefault().asyncExec(new Runnable(){&lt;br /&gt;   &lt;br /&gt;   public void run(){&lt;br /&gt;    &lt;br /&gt;    try{&lt;br /&gt;     &lt;br /&gt;     float left = x;&lt;br /&gt;        float top = y;&lt;br /&gt;&lt;br /&gt;        // Determine the ball's location&lt;br /&gt;        directionY += GRAVITY;&lt;br /&gt;        x += directionX;&lt;br /&gt;        y += directionY;&lt;br /&gt;        a += directionA;&lt;br /&gt;&lt;br /&gt;        // Determine out of bounds&lt;br /&gt;        Rectangle rect = canvas.getClientArea();&lt;br /&gt;        if ( x &gt; rect.width - IMAGE_WIDTH ) {&lt;br /&gt;          x = rect.width - IMAGE_WIDTH;&lt;br /&gt;          directionX = -directionX;&lt;br /&gt;          directionA -= ( directionY - directionA ) * FRICTION_WALL;&lt;br /&gt;        }&lt;br /&gt;        if ( x &lt; 0 ) {&lt;br /&gt;          x = 0;&lt;br /&gt;          directionX = -directionX;&lt;br /&gt;          directionA += ( directionY - directionA ) * FRICTION_WALL;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if ( y &gt; rect.height - IMAGE_WIDTH ) {&lt;br /&gt;          directionY = (int) ( -GRAVITY * Math.sqrt( ( 1 + 8 * ( rect.height - IMAGE_WIDTH ) / GRAVITY ) ) / 2 );&lt;br /&gt;          y = rect.height - IMAGE_WIDTH;&lt;br /&gt;          directionA += ( directionX - directionA ) * FRICTION_FLOOR;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        float right = left + IMAGE_WIDTH;&lt;br /&gt;        float bottom = top + IMAGE_WIDTH;&lt;br /&gt;        if ( x &lt; left )&lt;br /&gt;          left = x;&lt;br /&gt;        else&lt;br /&gt;          right = x + IMAGE_WIDTH;&lt;br /&gt;        if ( y &lt; top )&lt;br /&gt;          top = y;&lt;br /&gt;        else&lt;br /&gt;          bottom = y + IMAGE_WIDTH;&lt;br /&gt;        &lt;br /&gt;        // Force a redraw&lt;br /&gt;        canvas.redraw( (int) Math.floor( left ) - 1, (int) Math.floor( top ) - 1, (int) ( Math.ceil( right ) - Math.floor( left ) ) + 2, (int) ( Math.ceil( bottom ) - Math.floor( top ) ) + 2, false );&lt;br /&gt;        &lt;br /&gt;    }catch(SWTException e){&lt;br /&gt;     //eat it!&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt; public void setFocus() {}&lt;br /&gt; &lt;br /&gt; class AnimatorThread implements Runnable{&lt;br /&gt;&lt;br /&gt;  // The timer interval in milliseconds&lt;br /&gt;  private static final int   TIMER_INTERVAL = 14;&lt;br /&gt;  &lt;br /&gt;  public void go(){&lt;br /&gt;   &lt;br /&gt;   Thread t = new Thread(this);&lt;br /&gt;   t.start();&lt;br /&gt;   &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public void run() {&lt;br /&gt;   try {&lt;br /&gt;    while(true){&lt;br /&gt;     animate();&lt;br /&gt;     Thread.sleep(TIMER_INTERVAL);&lt;br /&gt;    }&lt;br /&gt;   } catch (InterruptedException e) {&lt;br /&gt;    e.printStackTrace();&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Piece of Cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.animation.zip"&gt;com.eclipsercptutorials.animation.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/04/how-to-update-gui-of-eclipse-rcp.html"&gt;Updating a Widget in an Eclipse RCP Application from a Worker Thread&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html"&gt;Add a Toolbar to a View in an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-8536545872118129583?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/qYpyAsVXpJs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/8536545872118129583/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/04/animation-in-eclipse-rcp-applications.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8536545872118129583?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8536545872118129583?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/qYpyAsVXpJs/animation-in-eclipse-rcp-applications.html" title="Animation in Eclipse RCP Applications - A Bouncing Ball" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/Se4ebxEvQkI/AAAAAAAABcE/8UTzdlolAM4/s72-c/eclipse+rcp+animation.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/04/animation-in-eclipse-rcp-applications.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYCQ3Y5cCp7ImA9WxJTFE8.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-5813714861512163988</id><published>2009-04-04T10:37:00.000-07:00</published><updated>2009-04-22T11:16:02.828-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-22T11:16:02.828-07:00</app:edited><title>Updating a Widget in an Eclipse RCP Application from a Worker Thread</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SdfEuRjE1JI/AAAAAAAABbs/B37QHxrJJQM/s1600-h/eclipse+rcp+worker+thread.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 158px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SdfEuRjE1JI/AAAAAAAABbs/B37QHxrJJQM/s200/eclipse+rcp+worker+thread.png" alt="" id="BLOGGER_PHOTO_ID_5320937784025076882" border="0" /&gt;&lt;/a&gt;This article shows how to update an Eclipse RCP Application widget from a worker thread and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. When programming GUI applications, it's often necessary to run a background processes to do some calculations or coordinate timed events. If these processes run on the main (GUI) thread, the GUI will be unresponsive to users' clicks during the process, leading to a bad user experience. To get around this problem, worker threads can be created to do the processing, leaving the GUI thread responsive to user input. The catch though is that you can't update any GUI components (SWT or JFace widgets in this case) from the worker thread. If you try to you get an exception such as: &lt;span style="color: rgb(255, 0, 0);"&gt;Exception in thread "Thread-3" org.eclipse.swt.SWTException: Invalid thread access&lt;/span&gt;. And worse, the compiler won't warn you of this pitfall. In this tutorial an Eclipse RCP application with a view is created, and a label is updated every second from a worker thread.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Create a worker thread class. The following class called WorkerThread implements Runnable and is passed a reference to the MainView class. In its run method, which must be implemented, a counter is initialized to zero and is incremented by one followed by a one second pause. Right before the incrementation the updateLabelText method in the MainView is called. A go() method is added to the class to create the thread and call the run method.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.workerthread;&lt;br /&gt;&lt;br /&gt;class WorkerThread implements Runnable{&lt;br /&gt;&lt;br /&gt;// The timer interval in milliseconds&lt;br /&gt;private static final int   TIMER_INTERVAL = 1000;&lt;br /&gt;&lt;br /&gt;private MainView mainView;&lt;br /&gt;&lt;br /&gt;public WorkerThread(MainView mainView){&lt;br /&gt;this.mainView = mainView;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void go(){&lt;br /&gt;&lt;br /&gt;Thread t = new Thread(this);&lt;br /&gt;t.start();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void run() {&lt;br /&gt;int counter = 0;&lt;br /&gt;try {&lt;br /&gt;while(mainView != null){&lt;br /&gt;mainView.updateLabelText("Counter = " + counter);&lt;br /&gt;counter++;&lt;br /&gt;Thread.sleep(TIMER_INTERVAL);&lt;br /&gt;}&lt;br /&gt;} catch (InterruptedException e) {&lt;br /&gt;e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Step 2: Add a label to the MainView and start the worker thread in the createPartControl method.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;label = new Label(parent, SWT.None); //new up a Label widget&lt;br /&gt;WorkerThread workerThread = new WorkerThread(this);&lt;br /&gt;workerThread.go();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Step 3: Add a method in the MainView class that updates the label's text and is called by the worker thread. The method called updateLabelText in MainView uses the Display's asyncExec method to post a Runnable that is executed in the main thread enabling the update of the Label widget from the worker thread. In the Runnable's run method make sure the widget isn't null or disposed first.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.workerthread;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.SWTException;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Display;&lt;br /&gt;import org.eclipse.swt.widgets.Label;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;public static final String ID = "com.eclipsercptutorials.workerThread.mainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;public Label label;&lt;br /&gt;&lt;br /&gt;public MainView() {}&lt;br /&gt;&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;label = new Label(parent, SWT.None); //new up a Label widget&lt;br /&gt;WorkerThread workerThread = new WorkerThread(this);&lt;br /&gt;workerThread.go();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setFocus() {}&lt;br /&gt;&lt;br /&gt;public void updateLabelText(final String labelText){&lt;br /&gt;&lt;br /&gt;try{&lt;br /&gt;Display.getDefault().asyncExec(new Runnable(){&lt;br /&gt;public void run(){&lt;br /&gt;if(!label.isDisposed() &amp;amp;&amp;amp; label !=null){&lt;br /&gt;label.setText(labelText);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}catch(SWTException e){&lt;br /&gt;//eat it!&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Step 3: Run the application and test if everything worked. Your application should now have a label in the view that updates its value each second and look something like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SdfGIQfTTzI/AAAAAAAABb8/xTDh1XhPjJM/s1600-h/eclipse+rcp+worker+thread.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 317px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SdfGIQfTTzI/AAAAAAAABb8/xTDh1XhPjJM/s400/eclipse+rcp+worker+thread.png" alt="" id="BLOGGER_PHOTO_ID_5320939329929039666" border="0" /&gt;&lt;/a&gt;Piece of cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.workerThread.zip" target="_blank"&gt;com.eclipsercptutorials.workerThread.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html"&gt;Add an Image to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/04/animation-in-eclipse-rcp-applications.html"&gt;Animation in Eclipse RCP Applications - A Bouncing Ball&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-5813714861512163988?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/vH4vGZ6iH_Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/5813714861512163988/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/04/how-to-update-gui-of-eclipse-rcp.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5813714861512163988?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5813714861512163988?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/vH4vGZ6iH_Q/how-to-update-gui-of-eclipse-rcp.html" title="Updating a Widget in an Eclipse RCP Application from a Worker Thread" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/SdfEuRjE1JI/AAAAAAAABbs/B37QHxrJJQM/s72-c/eclipse+rcp+worker+thread.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/04/how-to-update-gui-of-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcDQH49cSp7ImA9WxJTE0k.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-3612951633671765102</id><published>2009-03-29T08:00:00.000-07:00</published><updated>2009-04-21T12:44:31.069-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-21T12:44:31.069-07:00</app:edited><title>Add an Image to an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/Sc-OkhnYfkI/AAAAAAAABas/GK3meBS_FLo/s1600-h/eclipse+rcp+add+image+to+view.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 162px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-OgQUczXI/AAAAAAAABak/ETEaW-hXrgc/s400/eclipse+rcp+add+image+to+view.png" alt="" id="BLOGGER_PHOTO_ID_5318626443097833026" border="0" /&gt;&lt;/a&gt;This article shows how to add an image to a view in an Eclipse RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;RCP Application with a View&lt;/a&gt;. Images used in an RCP application are managed by an ImageRegistry that is global to the scope of a plugin. If your project has a class that extends AbstractUIPlugin, then there is a static method you can use called getImageDescriptor() to access ImageDescriptors given a path to the image. The Activator class ectending AbstractUIPlugin is automatically generated if you used the wizard to create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. The ImageRegistery is the preferred means of handling images in your application because it handles the lazy loading of the images and disposes of them properly when needed. The image is added to a view by adding a canvas to the view's parent composite and adding the image from the image descriptor to the canvas through its addPaintListener method. It may sound confusing, but in practice it's really simple.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt; and &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;add a View to it.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Add the image into the RCP plugin project. In this example an image called moon.png is added to the "icons" folder inside the plugin project. Whether you use this folder or not is really not important - you can organize your images any way you want. In the next step, the path to the image's location is used to get the image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-ZPNQBw3I/AAAAAAAABa0/-igYXdL6-VI/s1600-h/eclipse+rcp+add+image+view2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 176px; height: 148px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-ZPNQBw3I/AAAAAAAABa0/-igYXdL6-VI/s400/eclipse+rcp+add+image+view2.png" alt="" id="BLOGGER_PHOTO_ID_5318638171481817970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 2: Add the image to the view. In the view's class where you want the image to appear, add a global Image field and set it in the view's constructor calling the Activator.getImageDescriptor("icons/moon.png").createImage(); method. Adjust the path accordingly to locate your image. The path is relative to the plugin. In the createPartControl method, add a Canvas to the view's parent Composite and define its PaintEvent to draw the image. In the drawImage method, give it the image and the x and y coordinates where it should be drawn.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addimagetoview;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.events.PaintEvent;&lt;br /&gt;import org.eclipse.swt.events.PaintListener;&lt;br /&gt;import org.eclipse.swt.graphics.GC;&lt;br /&gt;import org.eclipse.swt.graphics.Image;&lt;br /&gt;import org.eclipse.swt.widgets.Canvas;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;public static final String ID = "com.eclipsercptutorials.addimagetoview.mainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;private Image image;&lt;br /&gt;&lt;br /&gt;public MainView() {&lt;br /&gt;&lt;br /&gt;image = Activator.getImageDescriptor("icons/moon.png").createImage();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;// Create the canvas for drawing&lt;br /&gt;Canvas canvas = new Canvas( parent, SWT.NONE);&lt;br /&gt;canvas.addPaintListener( new PaintListener() {&lt;br /&gt;public void paintControl(PaintEvent e) {&lt;br /&gt;     GC gc = e.gc;&lt;br /&gt;     gc.drawImage( image,10,10); // Draw the moon&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public void setFocus() {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 3: Run the application and test if everything worked. Your application should now have an image in the view and look something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-OgQUczXI/AAAAAAAABak/ETEaW-hXrgc/s1600-h/eclipse+rcp+add+image+to+view.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 323px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-OgQUczXI/AAAAAAAABak/ETEaW-hXrgc/s400/eclipse+rcp+add+image+to+view.png" alt="" id="BLOGGER_PHOTO_ID_5318626369735544178" border="0" /&gt;&lt;/a&gt;Piece of cake!!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.addimagetoview.zip" target="_blank"&gt;com.eclipsercptutorials.addimagetoview.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/import-and-export-eclipse-rcp.html"&gt;Import and Export an Eclipse RCP Application Project&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/04/how-to-update-gui-of-eclipse-rcp.html"&gt;Updating a Widget in an Eclipse RCP Application from a Worker Thread&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-3612951633671765102?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/p2_WjNn3vhI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/3612951633671765102/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3612951633671765102?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3612951633671765102?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/p2_WjNn3vhI/add-image-to-eclipse-rcp-application.html" title="Add an Image to an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/Sc-OgQUczXI/AAAAAAAABak/ETEaW-hXrgc/s72-c/eclipse+rcp+add+image+to+view.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMR3s8fyp7ImA9WxVbE0k.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-5438387254749457857</id><published>2009-03-23T11:46:00.000-07:00</published><updated>2009-03-29T09:23:06.577-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-29T09:23:06.577-07:00</app:edited><title>Import and Export an Eclipse RCP Application Project</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/Scf91vxnLiI/AAAAAAAABU8/fuOkm8H9Jj8/s1600-h/Picture+2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 189px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/Scf91vxnLiI/AAAAAAAABU8/fuOkm8H9Jj8/s200/Picture+2.png" alt="" id="BLOGGER_PHOTO_ID_5316496984933608994" border="0" /&gt;&lt;/a&gt;This article shows how to import and export an Eclipse RCP application to and from the Eclipse IDE workbench. Importing is necessary for example, when you want to download a sample RCP project from the internet and run it yourself. Also, you may need to export your RCP project if you are working on a team of developers and you need to get your code to someone. Importing and exporting an RCP project is easily done by following these steps.&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Import&lt;br /&gt;&lt;br /&gt;Step 0: Download, transfer and/or locate the RCP project. If you need a practice RCP project, here's on for you: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.addMenu.zip"&gt;&lt;span style="text-decoration: underline;"&gt;com.eclipsercptutorials.addMenu.zip&lt;/span&gt;&lt;/a&gt;. If you download this, you'll need to unzip it. Or you can download any of the projects found at the end of most of the tutorials on this website.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScfllTbzhUI/AAAAAAAABU0/ML16T5HFDb8/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 129px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScfllTbzhUI/AAAAAAAABU0/ML16T5HFDb8/s400/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5316470314168976706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 1: Choose File ---&gt; Import. Or right click somewhere in the package explorer to find the import action.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScflkmH2O4I/AAAAAAAABUs/QrKTXVinrHM/s1600-h/Picture+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 378px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScflkmH2O4I/AAAAAAAABUs/QrKTXVinrHM/s400/Picture+2.png" alt="" id="BLOGGER_PHOTO_ID_5316470302005672834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 2: On the first page of the Import wizard choose "Existing Projects into Workspace" in the "General" folder. Click Next.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/ScfdgxivP9I/AAAAAAAABUk/dR_Q5RD7UV4/s1600-h/Picture+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 384px; height: 400px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/ScfdgxivP9I/AAAAAAAABUk/dR_Q5RD7UV4/s400/Picture+3.png" alt="" id="BLOGGER_PHOTO_ID_5316461440258752466" border="0" /&gt;&lt;/a&gt;Step 3: On the second page of the Import wizard choose browse for and select the project folder you want to import. Check "Copy projects into workspace". Click Finish. The project now appears in the package explorer!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/Scfdgo5dqnI/AAAAAAAABUc/afT4LDm4FGw/s1600-h/Picture+4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 384px; height: 400px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/Scfdgo5dqnI/AAAAAAAABUc/afT4LDm4FGw/s400/Picture+4.png" alt="" id="BLOGGER_PHOTO_ID_5316461437938150002" border="0" /&gt;&lt;/a&gt;Export&lt;br /&gt;&lt;br /&gt;Step 0: Right-click on the project you'd like to export and choose "Export".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/ScfdgWtMoYI/AAAAAAAABUU/Oc-o3tqxtWw/s1600-h/Picture+5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 392px; height: 400px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/ScfdgWtMoYI/AAAAAAAABUU/Oc-o3tqxtWw/s400/Picture+5.png" alt="" id="BLOGGER_PHOTO_ID_5316461433054863746" border="0" /&gt;&lt;/a&gt;Step 1: On the first page of the Export wizard choose "File System" in the "General" folder. Click Next.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/Scfdfz1Ei-I/AAAAAAAABUM/B8gk_FzVGFs/s1600-h/Picture+6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 384px; height: 400px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/Scfdfz1Ei-I/AAAAAAAABUM/B8gk_FzVGFs/s400/Picture+6.png" alt="" id="BLOGGER_PHOTO_ID_5316461423692647394" border="0" /&gt;&lt;/a&gt;Step 2: On the second page of the Export wizard click on "Browse..." and select the location where you want to export the project. Click Finish. The project is now exported! Now you can zip up the project folder and email it or archive it for example.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/ScfdfVfEUVI/AAAAAAAABUE/7FzA4c2F3r4/s1600-h/Picture+7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 330px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/ScfdfVfEUVI/AAAAAAAABUE/7FzA4c2F3r4/s400/Picture+7.png" alt="" id="BLOGGER_PHOTO_ID_5316461415547294034" border="0" /&gt;&lt;/a&gt;Piece of cake!!&lt;br /&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/verify-user-intent-before-closing.html"&gt;Verify User Intent Before Closing an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-image-to-eclipse-rcp-application.html"&gt;Add an Image to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-5438387254749457857?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/H1VWp4t06hw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/5438387254749457857/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/import-and-export-eclipse-rcp.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5438387254749457857?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5438387254749457857?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/H1VWp4t06hw/import-and-export-eclipse-rcp.html" title="Import and Export an Eclipse RCP Application Project" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/Scf91vxnLiI/AAAAAAAABU8/fuOkm8H9Jj8/s72-c/Picture+2.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/import-and-export-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcGSXc6eyp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-1233143366040455174</id><published>2009-03-22T07:26:00.000-07:00</published><updated>2009-03-28T09:33:48.913-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:33:48.913-07:00</app:edited><title>Verify User Intent Before Closing an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScZOuLFtPmI/AAAAAAAABT8/4iTnviW0NKc/s1600-h/eclipse+rcp+verify+intent.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 110px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScZOuLFtPmI/AAAAAAAABT8/4iTnviW0NKc/s200/eclipse+rcp+verify+intent.png" alt="" id="BLOGGER_PHOTO_ID_5316022965315124834" border="0" /&gt;&lt;/a&gt;This article shows how ask the user if s/he really intends to close a RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. Use this feature sparingly with your applications because it can be an annoying "feature". The best solution would be to add a preference to the application where the user could decide if s/he wanted the reminder or not. Look for a tutorial on how to ad the preferences soon.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Add code to create the dialog box when the close application action is triggered. In the ApplicationWorkbenchAdvisor class that was automatically generated during step 0, you need to override the preShutdown() method. The method returns a boolean where, if true, the application will shut down, and if false, the application will continue running. You need to add code in that method that opens up a dialog box, gets user input, and returns what the user selected. Eclipse's JFace library contains a nice little class called MessageDialog where we can easily make a dialog box pop up, ask a question, and get the yes/no answer. We use the MessageDialog.openQuestion() method and pass it three parameters: a Shell, the dialog box's title, and the question we want to ask.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.verifyintent;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.dialogs.MessageDialog;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.ui.PlatformUI;&lt;br /&gt;import org.eclipse.ui.application.IWorkbenchWindowConfigurer;&lt;br /&gt;import org.eclipse.ui.application.WorkbenchAdvisor;&lt;br /&gt;import org.eclipse.ui.application.WorkbenchWindowAdvisor;&lt;br /&gt;&lt;br /&gt;public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {&lt;br /&gt;&lt;br /&gt;private static final String PERSPECTIVE_ID = "com.eclipsercptutorials.verifyIntent.perspective";&lt;br /&gt;&lt;br /&gt;public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {&lt;br /&gt; return new ApplicationWorkbenchWindowAdvisor(configurer);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getInitialWindowPerspectiveId() {&lt;br /&gt;return PERSPECTIVE_ID;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public boolean preShutdown(){&lt;br /&gt;&lt;br /&gt;Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();&lt;br /&gt;String dialogBoxTitle = "Question";&lt;br /&gt;String question = "Are you sure you want to close this application?";&lt;br /&gt;return MessageDialog.openQuestion(shell, dialogBoxTitle, question);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 2: Run the application and test if everything worked. Your application should now have a dialog box that verifies user intent when the application is closed and look something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScZOqYs0bPI/AAAAAAAABT0/b9BjUi0E5Sg/s1600-h/eclipse+rcp+verify+intent.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 221px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScZOqYs0bPI/AAAAAAAABT0/b9BjUi0E5Sg/s400/eclipse+rcp+verify+intent.png" alt="" id="BLOGGER_PHOTO_ID_5316022900249357554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Piece of Cake!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.verifyIntent.zip"&gt;&lt;span style="text-decoration: underline;"&gt;com.eclipsercptutorials.verifyIntent.zip&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/import-and-export-eclipse-rcp.html"&gt;Import and Export an Eclipse RCP Application Project&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-custom-menu-action-to-eclipse-rcp.html"&gt;Add a Custom Menu Action to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-1233143366040455174?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/ctBqA3IjBwM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/1233143366040455174/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/verify-user-intent-before-closing.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/1233143366040455174?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/1233143366040455174?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/ctBqA3IjBwM/verify-user-intent-before-closing.html" title="Verify User Intent Before Closing an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_eIoDncf-Rgo/ScZOuLFtPmI/AAAAAAAABT8/4iTnviW0NKc/s72-c/eclipse+rcp+verify+intent.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/verify-user-intent-before-closing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMDR3szfSp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-6211334993884006804</id><published>2009-03-22T06:12:00.000-07:00</published><updated>2009-03-28T09:41:16.585-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:41:16.585-07:00</app:edited><title>Add a Custom Menu Action to an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/ScY_lXV2gZI/AAAAAAAABTc/3X5BuNmteuQ/s1600-h/eclipse+rcp+custom+action.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 160px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/ScY_lXV2gZI/AAAAAAAABTc/3X5BuNmteuQ/s200/eclipse+rcp+custom+action.png" alt="" id="BLOGGER_PHOTO_ID_5316006321310826898" border="0" /&gt;&lt;/a&gt;This article shows how to add a custom menu item to a menu in an Eclipse RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. As shown in the article    &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html"&gt;Add a Menu to an Eclipse RCP Application&lt;/a&gt;, it is very easy to add a File menu containing the Exit action. Here a custom menu action is added to the File menu that opens a dialog box when clicked.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Make the custom action. Create a new class that extends org.eclipse.jface.action.Action and implements IWorkbenchAction. The class needs a private static final String property used to set the ID in the constructor. Inside the run() method is where you put your custom code. In this example, code is added that opens up a message dialog box.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.customaction;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.Action;&lt;br /&gt;import org.eclipse.jface.dialogs.MessageDialog;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.ui.PlatformUI;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;&lt;br /&gt;&lt;br /&gt;public class CustomAction extends Action implements IWorkbenchAction{&lt;br /&gt;&lt;br /&gt;private static final String ID = "com.timmolter.helloWorld.CustomAction";&lt;br /&gt;&lt;br /&gt;public CustomAction(){&lt;br /&gt;setId(ID);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void run() {&lt;br /&gt;&lt;br /&gt;Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();&lt;br /&gt;String dialogBoxTitle = "Message";&lt;br /&gt;String message = "You clicked the custom action from the menu!";&lt;br /&gt;MessageDialog.openInformation(shell, dialogBoxTitle, message);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void dispose() {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Step 2: In the ApplicationActionBarAdvisor class add the CustomAction as a private field. In the makeActions() method, new up the custom action, set its text and accelerator and register it. The accelerator is of course optional and it simply adds a keyboard shortcut, in this case CTRL+T. In the fillMenuBar() method, add the action to a File Menu.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.customaction;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.IMenuManager;&lt;br /&gt;import org.eclipse.jface.action.MenuManager;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.ui.IWorkbenchWindow;&lt;br /&gt;import org.eclipse.ui.application.ActionBarAdvisor;&lt;br /&gt;import org.eclipse.ui.application.IActionBarConfigurer;&lt;br /&gt;&lt;br /&gt;public class ApplicationActionBarAdvisor extends ActionBarAdvisor {&lt;br /&gt;&lt;br /&gt;private CustomAction customAction;&lt;br /&gt;&lt;br /&gt;public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {&lt;br /&gt; super(configurer);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void makeActions(IWorkbenchWindow window) {&lt;br /&gt;&lt;br /&gt;//Custom action&lt;br /&gt; customAction = new CustomAction();&lt;br /&gt; customAction.setText("Do custom action!");&lt;br /&gt; customAction.setAccelerator(SWT.CTRL + 'T');&lt;br /&gt; register(customAction);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void fillMenuBar(IMenuManager menuBar) {&lt;br /&gt;&lt;br /&gt; MenuManager fileMenu = new MenuManager("&amp;amp;File", "file"); //create a menuManager to take care of all submenus in "File"&lt;br /&gt; fileMenu.add(customAction); //Add the "customAction" action&lt;br /&gt; menuBar.add(fileMenu); //Add the "File" menu to the menuBar&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Step 3: Run the application and test if everything worked. Your application should now have a File Menu containing a custom action:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY_so72iVI/AAAAAAAABTk/V8jbds3HYzo/s1600-h/eclipse+rcp+custom+action.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 321px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY_so72iVI/AAAAAAAABTk/V8jbds3HYzo/s400/eclipse+rcp+custom+action.png" alt="" id="BLOGGER_PHOTO_ID_5316006446292699474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When the custom action is clicked or CTRL+T is entered, a messaage box should come up:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY_suI-4CI/AAAAAAAABTs/oLwWC0Jz7_Y/s1600-h/eclipse+rcp+dialog+box.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 133px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY_suI-4CI/AAAAAAAABTs/oLwWC0Jz7_Y/s400/eclipse+rcp+dialog+box.png" alt="" id="BLOGGER_PHOTO_ID_5316006447689949218" border="0" /&gt;&lt;/a&gt;Piece of cake!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.customAction.zip"&gt;&lt;span style="text-decoration: underline;"&gt;com.eclipsercptutorials.customAction.zip&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/verify-user-intent-before-closing.html"&gt;Verify User Intent Before Closing an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-nested-menu-items-to-eclipse-rcp.html"&gt;Add Nested Menu Items to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-6211334993884006804?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/ztDq4Ko1L-k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/6211334993884006804/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/add-custom-menu-action-to-eclipse-rcp.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/6211334993884006804?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/6211334993884006804?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/ztDq4Ko1L-k/add-custom-menu-action-to-eclipse-rcp.html" title="Add a Custom Menu Action to an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_eIoDncf-Rgo/ScY_lXV2gZI/AAAAAAAABTc/3X5BuNmteuQ/s72-c/eclipse+rcp+custom+action.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/add-custom-menu-action-to-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIFR3o-cSp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-675542607882563329</id><published>2009-03-21T05:42:00.000-07:00</published><updated>2009-03-28T09:41:56.459-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:41:56.459-07:00</app:edited><title>Add Nested Menu Items to an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScYyyTEPJuI/AAAAAAAABTM/haDj8YlXuFY/s1600-h/eclipse+rcp+nested+menu.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 161px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScYyyTEPJuI/AAAAAAAABTM/haDj8YlXuFY/s200/eclipse+rcp+nested+menu.png" alt="" id="BLOGGER_PHOTO_ID_5315992249850341090" border="0" /&gt;&lt;/a&gt;This article shows how to add nested menu items to a menu in an Eclipse RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. As shown in the article    &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html"&gt;Add a Menu to an Eclipse RCP Application&lt;/a&gt;, it is very easy to add a File menu containing the Exit action. Here the Exit action as well as About and Preferences are added to a submenu called Expand in the File menu to demonstrate nested menu items.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Add the nested menu actions. Open up the ApplicationActionBarAdvisor class and add the three About, Preferences, and Exit actions as private fields. In makeactions(), define the actions and register them. In the fillMenuBar() method, create two instances of MenuManager, one for the File and one for Expand.  Add the three actions to the Expand MenuManager. A Separator is added before the Exit action for the sake of demonstrating this nice menu organizing feature. Next add the Expand MenuManager to the File MenuManager. Finally add the File MenuManager to the menubar.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;package com.eclipsercptutorials.nestedmenu;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.IMenuManager;&lt;br /&gt;import org.eclipse.jface.action.MenuManager;&lt;br /&gt;import org.eclipse.jface.action.Separator;&lt;br /&gt;import org.eclipse.ui.IWorkbenchWindow;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;&lt;br /&gt;import org.eclipse.ui.application.ActionBarAdvisor;&lt;br /&gt;import org.eclipse.ui.application.IActionBarConfigurer;&lt;br /&gt;&lt;br /&gt;public class ApplicationActionBarAdvisor extends ActionBarAdvisor {&lt;br /&gt;&lt;br /&gt;private IWorkbenchAction aboutAction;&lt;br /&gt;private IWorkbenchAction preferencesAction;&lt;br /&gt;private IWorkbenchAction exitAction;&lt;br /&gt;&lt;br /&gt;public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {&lt;br /&gt; super(configurer);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void makeActions(IWorkbenchWindow window) {&lt;br /&gt;&lt;br /&gt; //ActionFactory Actions, the ActionFactory defines a set of common actions and can be used in our application.&lt;br /&gt; aboutAction = ActionFactory.ABOUT.create(window);&lt;br /&gt; register(aboutAction); //register the action so it is deleted when the Workbench window is closed&lt;br /&gt; preferencesAction = ActionFactory.PREFERENCES.create(window);&lt;br /&gt; register(preferencesAction);&lt;br /&gt; exitAction = ActionFactory.QUIT.create(window);&lt;br /&gt; register(exitAction);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void fillMenuBar(IMenuManager menuBar) {&lt;br /&gt;&lt;br /&gt; MenuManager fileMenu = new MenuManager("&amp;amp;File", "file"); //create a menuManager to take care of all submenus in "File"&lt;br /&gt;&lt;br /&gt; MenuManager expandingMenu = new MenuManager("&amp;amp;Expand", "expand");&lt;br /&gt;      expandingMenu.add(aboutAction); //Add the "about" action&lt;br /&gt;      expandingMenu.add(preferencesAction); //Add the "preferences" action&lt;br /&gt;      expandingMenu.add(new Separator()); //Add a horizontal separator&lt;br /&gt;      expandingMenu.add(exitAction); //Add the "exit" action&lt;br /&gt;&lt;br /&gt; fileMenu.add(expandingMenu); //Add the expanding menu to the "File" menu&lt;br /&gt; menuBar.add(fileMenu); //Add the "File" menu to the menuBar&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Step 2: Run the application and test if everything worked. Your application should now have a new menu containing a group of actions nested in a parent menu:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY2hDgs2iI/AAAAAAAABTU/_Thvz2RhUwk/s1600-h/eclipse+rcp+nested+menu.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 322px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScY2hDgs2iI/AAAAAAAABTU/_Thvz2RhUwk/s400/eclipse+rcp+nested+menu.png" alt="" id="BLOGGER_PHOTO_ID_5315996351663495714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Piece of cake!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.nestedmenu.zip"&gt;&lt;span style="text-decoration: underline;"&gt;com.eclipsercptutorials.nestedmenu.zip&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-custom-menu-action-to-eclipse-rcp.html"&gt;Add a custom Menu Action to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html"&gt;Add a Menu to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;a href="http://obscuredclarity.blogspot.com/2008/11/eclipse-rcp-tutorial-table-of-contents.html"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-675542607882563329?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/2hdZcAayNYw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/675542607882563329/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/add-nested-menu-items-to-eclipse-rcp.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/675542607882563329?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/675542607882563329?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/2hdZcAayNYw/add-nested-menu-items-to-eclipse-rcp.html" title="Add Nested Menu Items to an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_eIoDncf-Rgo/ScYyyTEPJuI/AAAAAAAABTM/haDj8YlXuFY/s72-c/eclipse+rcp+nested+menu.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/add-nested-menu-items-to-eclipse-rcp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkINQn0ycSp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-4773588134364005493</id><published>2009-03-20T12:53:00.000-07:00</published><updated>2009-03-28T09:43:13.399-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:43:13.399-07:00</app:edited><title>Add a Menu to an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/SUGPSBrNPjI/AAAAAAAABE4/rZF3tnX0PC0/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 258px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/SUGPSBrNPjI/AAAAAAAABE4/rZF3tnX0PC0/s320/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5278657778105007666" border="0" /&gt;&lt;/a&gt;This article shows how to add a menu containing an action to an Eclipse RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. In particular, the "Exit" action will be added to a "File" menu. Doing so is very simple, requiring only  a few lines of code in one class. The application's menu is used to provide the user with a logical and organized interface to access all the global functions of the application. For example, almost all applications have a File---&gt;Exit or a Help---&gt; About menu. An Eclipse RCP application menu can be as simple or elaborate as needed, and it can contain icons, dividers, and expanding submenus. The following steps demonstrate how to add the Exit action to a File menu to an Eclipse RCP application.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Add code to create the File menu and the Exit action. When you created a hello world application using the new RCP application wizard in Eclipse, it created a ApplicationActionBarAdvisor class that extends ActionBarAdvisor. You need to override 2 of the methods to configure the application's menu to suit the needs of the particular application. During certain strategic points in the workbench's lifecycle, these methods are called and the menu is created. In makeActions(), the Exit action is created and registered. In fillMenuBar() the File menu is created, the Exit action is added to the File menu, and the File menu is added to the application's menu bar.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.eclipsercptutorials.addmenu;&lt;br /&gt;&lt;br /&gt;import org.eclipse.jface.action.IMenuManager;&lt;br /&gt;import org.eclipse.jface.action.MenuManager;&lt;br /&gt;import org.eclipse.ui.IWorkbenchWindow;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory;&lt;br /&gt;import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;&lt;br /&gt;import org.eclipse.ui.application.ActionBarAdvisor;&lt;br /&gt;import org.eclipse.ui.application.IActionBarConfigurer;&lt;br /&gt;&lt;br /&gt;public class ApplicationActionBarAdvisor extends ActionBarAdvisor {&lt;br /&gt;&lt;br /&gt;IWorkbenchAction exitAction;&lt;br /&gt;&lt;br /&gt;public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {&lt;br /&gt;   super(configurer);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void makeActions(IWorkbenchWindow window) {&lt;br /&gt;&lt;br /&gt;   exitAction = ActionFactory.QUIT.create(window); //the ActionFactory defines a set of common actions and can be used in the application.&lt;br /&gt;   register(exitAction);  //register the action so they are deleted when the Workbench window is closed&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void fillMenuBar(IMenuManager menuBar) {&lt;br /&gt;&lt;br /&gt;   MenuManager fileMenu = new MenuManager("&amp;amp;File", "file"); //create a menuManager to take care of all submenus in "File"&lt;br /&gt;   fileMenu.add(exitAction); //Add the "exit" action&lt;br /&gt;   menuBar.add(fileMenu);//Add the "File" menu to the menuBar&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 2: Run the application and test if everything worked. Your application should now have a File menu with an Exit action and look something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SUGO5JUfUvI/AAAAAAAABEw/kKMKEta873s/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 323px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SUGO5JUfUvI/AAAAAAAABEw/kKMKEta873s/s400/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5278657350660477682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Piece of Cake!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.eclipsercptutorials.addMenu.zip"&gt;&lt;span style="text-decoration: underline;"&gt;com.eclipsercptutorials.addMenu.zip&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;---&gt; Next - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-nested-menu-items-to-eclipse-rcp.html"&gt;Add Nested Menu Items to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html"&gt;Add an Icon to an Eclipse RCP Application View&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-4773588134364005493?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/nVZn4ETrPUY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/4773588134364005493/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/4773588134364005493?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/4773588134364005493?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/nVZn4ETrPUY/add-menu-to-eclipse-rcp-application.html" title="Add a Menu to an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_eIoDncf-Rgo/SUGPSBrNPjI/AAAAAAAABE4/rZF3tnX0PC0/s72-c/Picture+1.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkENQH84cCp7ImA9WxNWGUo.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-3578022137420668569</id><published>2009-03-15T02:45:00.000-07:00</published><updated>2009-10-19T11:58:11.138-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-19T11:58:11.138-07:00</app:edited><title>Add an Icon to an Eclipse RCP Application View</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/STZxtGn-ZHI/AAAAAAAABEQ/mdTlJi-LBZg/s1600-h/Picture+5.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 241px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/STZxtGn-ZHI/AAAAAAAABEQ/mdTlJi-LBZg/s320/Picture+5.png" alt="" id="BLOGGER_PHOTO_ID_5275529033197446258" border="0" /&gt;&lt;/a&gt;This article shows how to add an icon to a view in an Eclipse RCP application and builds off of a clean &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World Eclipse RCP Application&lt;/a&gt;. In RCP applications, views are where you put things like tables, buttons, combo boxes, labels, charts, etc. - all the graphical interfaces that a user will interact with when using your application.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Get some icons. Mark James at &lt;a href="http://www.famfamfam.com/lab/icons/silk/"&gt;www.famfamfam.com&lt;/a&gt; has graciously created and made available over 1000 icons suitable for Eclipse RCP applications. His work is licensed under a &lt;a rel="license" href="http://creativecommons.org/licenses/by/2.5/"&gt;Creative       Commons Attribution 2.5 License&lt;/a&gt;, so you can use the icons any way you like. Download the icons, browse through them, and choose one that you'd like to use for your view.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/STZnFIU_zlI/AAAAAAAABDg/85bA3zFIq48/s1600-h/Picture+8.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 239px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/STZnFIU_zlI/AAAAAAAABDg/85bA3zFIq48/s400/Picture+8.png" alt="" id="BLOGGER_PHOTO_ID_5275517351343672914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2: Add the icon to your RCP application. With Eclipse open and the Package Explorer showing the contents of your project, drag and drop an icon into the "icons" folder. For this example, I put the bomb.png icon into the icons folder.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbzXCHTZ88I/AAAAAAAABS0/Y0BwUxCQpUU/s1600-h/eclipse+rcp+icon+explorer.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 338px; height: 339px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbzXCHTZ88I/AAAAAAAABS0/Y0BwUxCQpUU/s400/eclipse+rcp+icon+explorer.png" alt="" id="BLOGGER_PHOTO_ID_5313358091710493634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 3: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;Add a View to the Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 4: Add the icon to a view. Make sure the View is highlighted in the All Extensions list. To the right are the properties of the view. To the right of the icon property, click on the "Browse..." button. In the dialog box that pops up, choose the icon that you just added. The icon should show up next to the view's name in the "All Extensions" list.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SbzYTvLB9WI/AAAAAAAABS8/VaT6Ac4OgW0/s1600-h/eclipse+rcp+add+view+icon.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 260px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SbzYTvLB9WI/AAAAAAAABS8/VaT6Ac4OgW0/s400/eclipse+rcp+add+view+icon.png" alt="" id="BLOGGER_PHOTO_ID_5313359493982188898" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Collapse and re-expand the org.eclipse.ui.views extension point and the icon should be visible next to the view.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbzZLONY3jI/AAAAAAAABTE/eZdAsbXmaxE/s1600-h/eclipse+rcp+see+icon.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 283px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbzZLONY3jI/AAAAAAAABTE/eZdAsbXmaxE/s400/eclipse+rcp+see+icon.png" alt="" id="BLOGGER_PHOTO_ID_5313360447206383154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 5: Specify that the view's title should be shown. Now that the icon is added to the application project and associated with the view, some code is needed to tie everything together. In Perspective.java set the boolean flag for the second argument in the "addStandAloneView" method to true (line 10). This is the "showTitle" flag which tells the RCP application to show a tab for the view containing the icon and a title for the view.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.blogspot.eclipsercptutorials.addicon;&lt;br /&gt;&lt;br /&gt;import org.eclipse.ui.IPageLayout;&lt;br /&gt;import org.eclipse.ui.IPerspectiveFactory;&lt;br /&gt;&lt;br /&gt;public class Perspective implements IPerspectiveFactory {&lt;br /&gt;&lt;br /&gt;public void createInitialLayout(IPageLayout layout) {&lt;br /&gt;&lt;br /&gt;layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, layout.getEditorArea());&lt;br /&gt;layout.setEditorAreaVisible(false); //hide the editor in the perspective&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 6: Give the view's tab a name. In the view's class, add the line "this.setPartName("Hello!");" to the createPartControl method (line 16). Change the "Hello!" String to whatever you want.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.blogspot.eclipsercptutorials.addicon;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Label;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;public static final String ID = "com.blogspot.eclipsercptutorials.addicon.mainView"; //the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;public MainView() {    }&lt;br /&gt;&lt;br /&gt;public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;this.setPartName("Hello!");&lt;br /&gt;&lt;br /&gt;Label label = new Label(parent, SWT.None); //new up a Label widget&lt;br /&gt;label.setText("  All this program does is display this text in a view."); //set the label's text&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setFocus() { }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 7: Run the application and test if everything worked. Your application should now look something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/STZuv1azndI/AAAAAAAABEA/Im7VRCQCAGg/s1600-h/Picture+5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 399px; height: 300px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/STZuv1azndI/AAAAAAAABEA/Im7VRCQCAGg/s400/Picture+5.png" alt="" id="BLOGGER_PHOTO_ID_5275525781583535570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 8: If you want the view to be non-closeable, add layout.getViewLayout(MainView.ID).setCloseable(false);" to the createInitialLayout" method (line 12). This will hide the little "X" on the tab and not allow the tab to be closed, which you probably want to do if your program only has one view.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;package com.blogspot.eclipsercptutorials.addicon;&lt;br /&gt;&lt;br /&gt;import org.eclipse.ui.IPageLayout;&lt;br /&gt;import org.eclipse.ui.IPerspectiveFactory;&lt;br /&gt;&lt;br /&gt;&amp;#32;public class Perspective implements IPerspectiveFactory {&lt;br /&gt;&lt;br /&gt;&amp;#32;public void createInitialLayout(IPageLayout layout) {&lt;br /&gt;&lt;br /&gt;&amp;#32;&amp;#32;layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, &amp;#32;&amp;#32;layout.getEditorArea());&lt;br /&gt;&amp;#32;&amp;#32;layout.setEditorAreaVisible(false); //hide the editor in the perspective&lt;br /&gt;&amp;#32;&amp;#32;layout.getViewLayout(MainView.ID).setCloseable(false);&lt;br /&gt;&amp;#32;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/STZvSfBm0XI/AAAAAAAABEI/9v3vnjRMVMk/s1600-h/Picture+4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 301px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/STZvSfBm0XI/AAAAAAAABEI/9v3vnjRMVMk/s400/Picture+4.png" alt="" id="BLOGGER_PHOTO_ID_5275526376867680626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Piece of cake!&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.blogspot.eclipsercptutorials.addicon.zip"&gt;com.blogspot.eclipsercptutorials.addicon.zip&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;Adding a View to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Next ---&gt; &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-menu-to-eclipse-rcp-application.html"&gt;Add a Menu to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-3578022137420668569?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/HdhfWqzTgkg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/3578022137420668569/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3578022137420668569?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3578022137420668569?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/HdhfWqzTgkg/add-icon-to-eclipse-rcp-application.html" title="Add an Icon to an Eclipse RCP Application View" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/STZxtGn-ZHI/AAAAAAAABEQ/mdTlJi-LBZg/s72-c/Picture+5.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQHSXg7cSp7ImA9WxJQFk8.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-5722473775116341994</id><published>2009-03-13T14:52:00.000-07:00</published><updated>2009-05-29T12:45:38.609-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T12:45:38.609-07:00</app:edited><title>Adding a View to an Eclipse RCP Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRe20v3zJXI/AAAAAAAABAg/nxR-NryxnI4/s1600-h/Program.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 258px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRe20v3zJXI/AAAAAAAABAg/nxR-NryxnI4/s320/Program.png" alt="" id="BLOGGER_PHOTO_ID_5266879306553042290" border="0" /&gt;&lt;/a&gt;As shown in the article &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World with Eclipse RCP - Your First Application&lt;/a&gt;, it is quite simple to create and run your own very basic Java RCP application using Eclipse. This article shows you how to add a "View" to your application. Part of learning how to create RCP applications using Eclipse is to learn the terminology people use. A view is the part of your application where you put things like tables, buttons, combo boxes, labels, charts, etc. - all the graphical interfaces that a user will interact with when using your application. These visible units of interaction are called "widgets" and Eclipse provides us with many customizable widgets in the SWT and JFACE libraries.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;When an RCP application starts up, a string of events occurs under the hood that generates a stand-alone window containing all your customized widgets that give your program its unique look and functionality. At the top of the hierarchy is the Application class and contains the application's main method (actually called "start()"). In the start() method, a single Workbench object is created, which is a behind-the-scenes class controlling your RCP application. The Workbench in turn contains one or more WorkbenchWindow objects, which are the visible windows making up your program. In most cases you just have one WorkbenchWindow. A WorkbenchWindow in turn contains a menu (optional), a toolbar (optional), and/or one or more Perspective objects. In most cases you just have one Perspective. A Perspective in turn contains one Editor object and/or one or more View objects. View objects in turn contain one or more Widgets, which are the finest grain visible units of the RCP application. As a visual example of all this, look at the following BitTorrent application called Vuze (aka Azureus). You see a WorkbenchWindow with a menu, a toolbar, and two views called "My Torrents" and "Statistics". The "Statistics" view contains Tab widgets which in turn contain other widgets.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRakVKi7dJI/AAAAAAAAA_w/V1vsZu805Fc/s1600-h/800px-Azureus_Statistics.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 210px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRakVKi7dJI/AAAAAAAAA_w/V1vsZu805Fc/s400/800px-Azureus_Statistics.png" alt="" id="BLOGGER_PHOTO_ID_5266577497771439250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As a review, the hierarchy is like this:&lt;br /&gt;&lt;br /&gt;Application&lt;br /&gt;|&lt;br /&gt;Workbench&lt;br /&gt;|&lt;br /&gt;WorkbenchWindow(s)&lt;br /&gt;|&lt;br /&gt;Perspective(s)   Menu   Toolbar&lt;br /&gt;|&lt;br /&gt;View(s)  Editor&lt;br /&gt;|&lt;br /&gt;SWT and/or JFace Widget(s)&lt;br /&gt;&lt;br /&gt;When Eclipse set up a HelloWorld RCP application for you with a wizard described &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;here&lt;/a&gt;, it generated an Application, a Workbench, and a WorkbenchWindow with a Perspective. This article shows how to build off of that, by adding a View with a Label widget containing some text to the View. Let's get to it...&lt;br /&gt;&lt;br /&gt;Step 0: Create a &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;HelloWorld RCP application.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Add the "views" extension point to your RCP project. Click on the "Extensions" tab along the bottom of the view in Eclipse that shows all the properties for your RCP project. If you don't see that view, double-click on "MANIFEST.MF" in the "META-INF" folder in your project folder in the Package Explorer. Here, you need to add an extension point to your application. Click "Add..." and a dialog box will pop up for selecting a new extension point. Scroll down and find the extension point called "org.eclipse.ui.views", select it and click "Finish".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbrbShUQlPI/AAAAAAAABSU/KMZYY2H2rNA/s1600-h/eclipse+rcp+view+extension+point.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbrbShUQlPI/AAAAAAAABSU/KMZYY2H2rNA/s400/eclipse+rcp+view+extension+point.png" alt="" id="BLOGGER_PHOTO_ID_5312799821664392434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 2: Add a View to your RCP project. You should now see the org.eclispe.ui.views extension added to the "All Extensions" list for your project. Right-click on "org.eclispe.ui.views" and select New --&gt; view.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbrbroxxvfI/AAAAAAAABSc/34yZHw7TgeY/s1600-h/eclipse+rcp+add+view+extension.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 382px; height: 400px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbrbroxxvfI/AAAAAAAABSc/34yZHw7TgeY/s400/eclipse+rcp+add+view+extension.png" alt="" id="BLOGGER_PHOTO_ID_5312800253163978226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 3: Set the properties of the View. Make sure the View is highlighted in the All Extensions list. To the right you will be able to set some properties of the view. For right now, just the first two properties need to be set. In this example an id of com.blogspot.eclipsercptutorials.mainView and a name of MainView.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/Sbrcf9_NjZI/AAAAAAAABSk/HMQYxxnG5qk/s1600-h/eclipse+rcp+view+properties.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 146px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/Sbrcf9_NjZI/AAAAAAAABSk/HMQYxxnG5qk/s400/eclipse+rcp+view+properties.png" alt="" id="BLOGGER_PHOTO_ID_5312801152210668946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 4: Generate the view's class. In the properties list click on the "class" link. This will bring up a wizard. Leave everything at the default values but give it a name that matches the name you entered in the name property before. Click "Finish".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/Sbrc9UtcxmI/AAAAAAAABSs/iY_np8ro5Og/s1600-h/eclipse+rcp+view+class.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 314px; height: 400px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/Sbrc9UtcxmI/AAAAAAAABSs/iY_np8ro5Og/s400/eclipse+rcp+view+class.png" alt="" id="BLOGGER_PHOTO_ID_5312801656526390882" border="0" /&gt;&lt;/a&gt;Step 5: Add some code to the MainView class that you generated earlier. You need to make sure a "public static final String" field called ID is defined and set equal to the id that you set in the view's properties editor. Also, in createPartControl() add two lines of code that creates a Label widget and set it's text. You may find that when you add the Label code you get an error "Label cannot be resolved to a type". This is because you haven't added an import statement yet above the class definition. The import statements tell the compiler what classes your class will be using. If you ever get an error like that, you can click on the class name, i.e. "Label", in your code and type ctrl+m (windows or Linux) or command+m (Mac). Make sure to always choose the SWT version of the widget and not the Swing or other type of class with the same name.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.blogspot.eclipsercptutorials.addview;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Label;&lt;br /&gt;import org.eclipse.ui.part.ViewPart;&lt;br /&gt;&lt;br /&gt;public class MainView extends ViewPart {&lt;br /&gt;&lt;br /&gt;  public static final String ID = "com.blogspot.eclipsercptutorials.mainView"; // the ID needs to match the id set in the view's properties&lt;br /&gt;&lt;br /&gt;  public MainView() { }&lt;br /&gt;&lt;br /&gt;  public void createPartControl(Composite parent) {&lt;br /&gt;&lt;br /&gt;    Label label = new Label(parent, SWT.None); //new up a Label widget&lt;br /&gt;    label.setText("  All this program does is display this text in a view."); //set the label's text&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setFocus() { }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 6: Add the view to the application's perspective. Remember how when you used the wizard in Eclipse to create a standalone HelloWrold application and it generated a perspective for you automatically? And remember that views are children of perspectives? The Perspective class in your project should look similar to the following if you want it to add your new view. Open Perspective.java and add the two lines of code shown below in the createInitialLayout method.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package com.blogspot.eclipsercptutorials.addview;&lt;br /&gt;&lt;br /&gt;import org.eclipse.ui.IPageLayout;&lt;br /&gt;import org.eclipse.ui.IPerspectiveFactory;&lt;br /&gt;&lt;br /&gt;public class Perspective implements IPerspectiveFactory {&lt;br /&gt;&lt;br /&gt;  public void createInitialLayout(IPageLayout layout) {&lt;br /&gt;&lt;br /&gt;    layout.addStandaloneView(MainView.ID, false, IPageLayout.LEFT, 1.0f, layout.getEditorArea());&lt;br /&gt;    layout.setEditorAreaVisible(false); //hide the editor in the perspective&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Step 7: Run your application. Congrats, you now have an Eclipse RCP application with a view! The view gives you a place to add more widgets and add funtionality to your program. The next things you'll want to add to your program are things like a menu, an editor, more views, status bars, a toolbar, and widgets.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SReqpTLcD_I/AAAAAAAABAQ/9pkVWAh8VLg/s1600-h/Program.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 322px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SReqpTLcD_I/AAAAAAAABAQ/9pkVWAh8VLg/s400/Program.png" alt="" id="BLOGGER_PHOTO_ID_5266865915732692978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.de/group/eclipsercptutorials/web/com.blogspot.eclipsercptutorials.addView.zip"&gt;com.blogspot.eclipsercptutorials.addView.zip&lt;/a&gt;&lt;br /&gt;Next ---&gt;&lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/add-icon-to-eclipse-rcp-application.html"&gt;Add an Icon to an Eclipse RCP Application View&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World with Eclipse RCP - Your First Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-5722473775116341994?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/_xldq0FKNHo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/5722473775116341994/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5722473775116341994?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5722473775116341994?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/_xldq0FKNHo/adding-view-to-eclipse-rcp-application.html" title="Adding a View to an Eclipse RCP Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRe20v3zJXI/AAAAAAAABAg/nxR-NryxnI4/s72-c/Program.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4NR3oycSp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-8620519563945128445</id><published>2009-03-10T13:27:00.000-07:00</published><updated>2009-03-28T09:49:56.499-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:49:56.499-07:00</app:edited><title>Hello World with Eclipse RCP - Your First Application</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRTleUMDQuI/AAAAAAAAA_o/FY-Yl8qzahs/s1600-h/Hello+rcp.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 162px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRTleUMDQuI/AAAAAAAAA_o/FY-Yl8qzahs/s200/Hello+rcp.png" alt="" id="BLOGGER_PHOTO_ID_5266086173281043170" border="0" /&gt;&lt;/a&gt;As discussed in the article &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/using-eclipse-for-rcp-application.html"&gt;Using Eclipse for RCP Application Development&lt;/a&gt;, Eclipse is free and open-source software that people use to develop Java-based applications called Rich Client Platform (RCP) applications. Using a computer with any operating system (in this tutorial Mac OS X), you can use Eclipse to create an advanced program that can be deployed on Mac, Linux, and/or Windows OS. This article shows how easy it is to get started using Eclipse and make your very own application even if you never wrote a line of code in your life. The program is going to be the classic "Hello World" application that programmers often write as their first program when trying out a new coding language or Integrated Development Environment (IDE). Before following along you'll need to have Eclipse and the Java Runtime Environment (JRE) installed as described &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/using-eclipse-for-rcp-application.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Step 0: Launch Eclipse and choose a "workspace". The workspace is where all the files needed for the application, either generated by Eclipse or written by you, will be located. The location I chose for my workspace is in a folder called "workspace" located in the directory that my Eclipse IDE folder resides. Once your application is created, you can navigate to that folder on your hard drive and actually find the files there.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTNV-SI1qI/AAAAAAAAA-g/pHjU2dPTKF0/s1600-h/Eclipse+select+workspace.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 194px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTNV-SI1qI/AAAAAAAAA-g/pHjU2dPTKF0/s400/Eclipse+select+workspace.png" alt="" id="BLOGGER_PHOTO_ID_5266059641682974370" border="0" /&gt;&lt;/a&gt;Step 1: Launch the  new project wizard in Eclipse. Select "File" from the menu, choose "New" and click "Project".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTQH1WUfJI/AAAAAAAAA-o/dIyvpOeXC9Q/s1600-h/New+Project+Eclipse.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 110px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTQH1WUfJI/AAAAAAAAA-o/dIyvpOeXC9Q/s400/New+Project+Eclipse.png" alt="" id="BLOGGER_PHOTO_ID_5266062697301310610" border="0" /&gt;&lt;/a&gt;Step 2: When the new project wizard launches, select "Plugin Project" and click "Next".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/SRTQ555f1OI/AAAAAAAAA-w/Yx6cwUBhT1k/s1600-h/PlugIn+Project.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 382px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/SRTQ555f1OI/AAAAAAAAA-w/Yx6cwUBhT1k/s400/PlugIn+Project.png" alt="" id="BLOGGER_PHOTO_ID_5266063557516055778" border="0" /&gt;&lt;/a&gt;Step 3: Enter a Project name and click "Next". The nomenclature that Java developers use is [top-level domain.secondary-level domain (if any).your personal or organization's domain name.project name], in this example com.blogspot.eclipsercptutorials.helloWorld. The reason for this is to avoid projects with the same name existing elsewhere in the world. If you named your project HelloWorld, there is a chance that there will be other projects out there named the exact same thing. Often people share their projects and source code, and having a consistent project naming system keeps things in order. The point is to have a unique name that no one else will use.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbbXhRhGs7I/AAAAAAAABSE/ihcm4f64tFA/s1600-h/eclipse+rcp+wizaed+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 332px; height: 400px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbbXhRhGs7I/AAAAAAAABSE/ihcm4f64tFA/s400/eclipse+rcp+wizaed+1.png" alt="" id="BLOGGER_PHOTO_ID_5311669777167987634" border="0" /&gt;&lt;/a&gt;Step 4: Choose "Yes" for "Would you like to create a rich client application?" and click "Next".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbbXhdthrvI/AAAAAAAABR8/nXZBeKeOYwE/s1600-h/eclipse+rcp+hello+world+wizard+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 332px; height: 400px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbbXhdthrvI/AAAAAAAABR8/nXZBeKeOYwE/s400/eclipse+rcp+hello+world+wizard+2.png" alt="" id="BLOGGER_PHOTO_ID_5311669780441313010" border="0" /&gt;&lt;/a&gt;Step 5:  Select the "Hello RCP" template and click "Finish".&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRTavBeh2pI/AAAAAAAAA_I/OGxRpeg6Xfw/s1600-h/Hello+world.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 323px; height: 400px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRTavBeh2pI/AAAAAAAAA_I/OGxRpeg6Xfw/s400/Hello+world.png" alt="" id="BLOGGER_PHOTO_ID_5266074365688142482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 6: You may be asked if you want to use the Plug-in Development perspective. Choose "Yes". This just specifies how you want the Eclipse IDE to be laid out when working on RCP applications.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTavT8y6nI/AAAAAAAAA_Q/jcWFFGwioTc/s1600-h/plugin+perspective.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 169px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SRTavT8y6nI/AAAAAAAAA_Q/jcWFFGwioTc/s400/plugin+perspective.png" alt="" id="BLOGGER_PHOTO_ID_5266074370646927986" border="0" /&gt;&lt;/a&gt;Step 7: The new project wizard has created a project for you with all the necessary files and settings to make it an RCP Application. On the left side of the IDE you will see a view called "Package Explorer" which contains your new Hello World application files. These files shown in the view match what is found in your workspace folder, which you set up earlier. Navigate to your workspace folder and you should see your new project there.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_eIoDncf-Rgo/SbbXhnSySlI/AAAAAAAABSM/5lsF_qmyWCU/s1600-h/eclipse+rcp+hello+world+.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 252px;" src="http://1.bp.blogspot.com/_eIoDncf-Rgo/SbbXhnSySlI/AAAAAAAABSM/5lsF_qmyWCU/s400/eclipse+rcp+hello+world+.png" alt="" id="BLOGGER_PHOTO_ID_5311669783013509714" border="0" /&gt;&lt;/a&gt;Step 8: Launch your Hello World application. To do this, you need to be looking at the "Overview" shown in the center view above. This should have been the default thing displayed, but if it is not, just double-click on "MANIFEST.MF" in the "META-INF" folder in your new project folder in the Package Explorer view. On the "Overview" tab, click on the link called "Launch an Eclipse Application" in the "Testing" area. A small window should pop up with "Hello RCP" written at the top. Congrats, you just created and ran your first Eclipse RCP application!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRTdwjF6zcI/AAAAAAAAA_g/ukRv4S4xYJ0/s1600-h/Hello+rcp.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 323px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRTdwjF6zcI/AAAAAAAAA_g/ukRv4S4xYJ0/s400/Hello+rcp.png" alt="" id="BLOGGER_PHOTO_ID_5266077690426478018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;After you close the program, feel free to look around the Overview of your project and also the "src" folder that is part of your project. The "src" folder is where the code that defines your program resides. There should be a package named the same as your project containing a handful of .java files. If you double-click on any of the .java files, they will open up in an editor view in the center of the Eclipse IDE. You may find it satisfying to open up ApplicationWorkbenchWindowAdvisor.java and change the title of your application in the preWindowOpen() method, by changing the "Hello RCP" String to something different and re-running the application.&lt;br /&gt;&lt;br /&gt;While the Hello World program is quite sparse in functionality, it is nonetheless the first step in creating a real application that actually does something useful.&lt;br /&gt;&lt;br /&gt;Get the code: &lt;a href="http://groups.google.com/group/eclipsercptutorials/web/com.blogspot.eclipsercptutorials.helloWorld.zip"&gt;com.blogspot.eclipsercptutorials.helloWorld.zip&lt;/a&gt;&lt;br /&gt;Next ---&gt;&lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/adding-view-to-eclipse-rcp-application.html"&gt;Adding a View to an Eclipse RCP Application&lt;/a&gt;&lt;br /&gt;&lt;--- Previous - &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/using-eclipse-for-rcp-application.html"&gt;Using Eclipse for RCP Application Development&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-8620519563945128445?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/KEpD0wvQgMA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/8620519563945128445/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8620519563945128445?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8620519563945128445?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/KEpD0wvQgMA/hello-world-with-eclipse-rcp-your-first.html" title="Hello World with Eclipse RCP - Your First Application" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/SRTleUMDQuI/AAAAAAAAA_o/FY-Yl8qzahs/s72-c/Hello+rcp.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cCRnY7fyp7ImA9WxVbEkg.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-7170592649567802511</id><published>2009-03-09T14:38:00.001-07:00</published><updated>2009-03-28T09:51:07.807-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T09:51:07.807-07:00</app:edited><title>Using Eclipse for RCP Application Development</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbbM1XJdQAI/AAAAAAAABR0/ysxCq9jTCBU/s1600-h/eclipse+splash+screen.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 130px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbbM1XJdQAI/AAAAAAAABR0/ysxCq9jTCBU/s200/eclipse+splash+screen.png" alt="" id="BLOGGER_PHOTO_ID_5311658027648892930" border="0" /&gt;&lt;/a&gt;Eclipse is free and open-source software that people mainly use to write Java code and develop Java-based programs called Rich Client Platform (RCP) applications. Eclipse is an excellent, if not the best, Integrated Development Environment (IDE) for Java development. The goal of this article it to help anyone who is interested in creating computer applications, even if they never wrote a single line of code in their life before, to decide if Eclipse is right for them.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;One popular RCP application created with Eclipse is Vuze, formerly known as Azureus, a BitTorrent client shown at right. A Rich Client Application can be a full-blown program with a menu bar, icons, toolbars, status bars, etc. It can have tabs, tables, buttons, charts, text boxes, wizards, preferences, dialog boxes, and more. It can be multi-threaded and there are virtually no limitations to your creativity. You could create your own version of Photoshop or just simple a program that plays your favorite song when you open it up. Anything is possible.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbWOLqqGeLI/AAAAAAAABRo/5Gkbrq2pl5s/s1600-h/vuze.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 210px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SbWOLqqGeLI/AAAAAAAABRo/5Gkbrq2pl5s/s400/vuze.png" alt="" id="BLOGGER_PHOTO_ID_5311307666633947314" border="0" /&gt;&lt;/a&gt;If you ever used Microsoft's Visual Studio for developing Windows applications with C#, Eclipse is like Java's version of an application used to develop other applications. I started using Microsoft Visual Studio back in 2005, but have since switched to Eclipse. Eclipse matches my programming philosophy and meets my needs much better than VS for the following reasons.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;With Eclipse, you can develop your application once, and create exports for Windows, Mac, and Linux no matter what operating system (OS) you use as your development computer.&lt;/li&gt;&lt;li&gt;I found that creating an exported product with icons and everything to be much easier and intuitive with Eclipse.&lt;/li&gt;&lt;li&gt;Eclipse is free and open-source. Microsoft makes you pay for the IDE if you want the full-blown professional version. I like open-source.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;I also think VS has its strengths over Eclipse:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The learning curve in creating your first application is much steeper with Eclipse. Getting used to the Eclipse IDE can be frustrating because it has many quirks, that until you figure out, you may spend a lot of time banging your head against the wall. I also found the classes used to simplify the layout of your GUI widgets (i.e. buttons, text boxes, graphics) were better designed in VS.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Online documentation and available quality books is much better for VS and programming Windows applications in C#.&lt;/li&gt;&lt;/ul&gt;All in all, I'm very glad I took the plunge and learned how to use Eclipse to develop RCP applications, and I don't miss VS at all. Some people argue that Java is slow, but I personally believe that is wrong. I've run my own similar C# and Java applications on a Windows system and I can't tell a difference. Java on a Mac and Linux is also very fast.&lt;noscript&gt;&lt;/noscript&gt;&lt;br /&gt;&lt;br /&gt;Another observation that I made is that an Eclipse RCP run on a Windows box will be slower than the same exact application run on a Mac or Linux machine with similar specs. After converting a Windows computer to a Linux computer, the application ran twice as fast and caught up to my other Mac and Linux machines. That's not saying Java is slow on Windows, just that Mac and Linux may be superior operating systems for Java applications. But in most cases, the difference will be negligible. The beauty of Eclipse is that you can choose whatever OS you like!&lt;br /&gt;&lt;br /&gt;I want to write about my experience with Eclipse and help others avoid some of the frustrations I had getting started. It's my way of giving back to the people involved in making Eclipse possible because I've used it and enjoyed it a lot. So go ahead and &lt;a href="http://www.eclipse.org/downloads/"&gt;download Eclipse&lt;/a&gt; and get started on your applications.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SQ_9fxHm_VI/AAAAAAAAA-A/rLiOXWWGbRk/s1600-h/Picture+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 33px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SQ_9fxHm_VI/AAAAAAAAA-A/rLiOXWWGbRk/s400/Picture+3.png" alt="" id="BLOGGER_PHOTO_ID_5264705211622423890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You'll want to download "Eclipse for RCP/Plug-in Developers", unzip it, and place it in an easy to access location in your file system. You can double click the Eclipse IDE launcher icon to open up Eclipse. Also make sure your computer has the &lt;a href="http://www.java.com/en/download/manual.jsp"&gt;Java JRE&lt;/a&gt; (Java 5 JRE or above) installed. If you have a Mac or a PC running Ubuntu (not sure about other Linux distros), it will already be installed. I like to make a shortcut on my desktop or drag the launcher icon to the dock (Mac).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRTG8tDXqzI/AAAAAAAAA-Y/kWLFsIDl1vk/s1600-h/Picture+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 252px; height: 189px;" src="http://4.bp.blogspot.com/_eIoDncf-Rgo/SRTG8tDXqzI/AAAAAAAAA-Y/kWLFsIDl1vk/s400/Picture+1.png" alt="" id="BLOGGER_PHOTO_ID_5266052610491132722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You should be greeted with a splash screen as Eclipse loads...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_eIoDncf-Rgo/SQ_9fwLR6YI/AAAAAAAAA-I/f453TRklc7I/s1600-h/Picture+4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 282px; height: 182px;" src="http://2.bp.blogspot.com/_eIoDncf-Rgo/SQ_9fwLR6YI/AAAAAAAAA-I/f453TRklc7I/s400/Picture+4.png" alt="" id="BLOGGER_PHOTO_ID_5264705211369384322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;and then the Welcome Page.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_eIoDncf-Rgo/SQ_9gQPMYwI/AAAAAAAAA-Q/HXasnKm7CzQ/s1600-h/Picture+7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 439px; height: 274px;" src="http://3.bp.blogspot.com/_eIoDncf-Rgo/SQ_9gQPMYwI/AAAAAAAAA-Q/HXasnKm7CzQ/s400/Picture+7.png" alt="" id="BLOGGER_PHOTO_ID_5264705219975734018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Next ---&gt;&lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World with Eclipse RCP - Your First Application&lt;/a&gt;&lt;br /&gt;Also see: &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Eclipse RCP Tutorial Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-7170592649567802511?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/QJ95M6mhL9c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/7170592649567802511/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/using-eclipse-for-rcp-application.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7170592649567802511?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/7170592649567802511?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/QJ95M6mhL9c/using-eclipse-for-rcp-application.html" title="Using Eclipse for RCP Application Development" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_eIoDncf-Rgo/SbbM1XJdQAI/AAAAAAAABR0/ysxCq9jTCBU/s72-c/eclipse+splash+screen.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/using-eclipse-for-rcp-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4HQnY8cSp7ImA9WxVUGEk.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-3167968727339182460</id><published>2009-03-08T12:06:00.000-07:00</published><updated>2009-03-23T14:48:53.879-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-23T14:48:53.879-07:00</app:edited><title>Share</title><content type="html">After hours sweating over an Eclipse RCP solution, you deserve your moment of glory!&lt;br /&gt;&lt;br /&gt;Just write us at eclipsercptutorials[at]gmail[dot]com&lt;br /&gt;&lt;br /&gt;In your email, you should include the following info:&lt;br /&gt;&lt;br /&gt;1. your name (if you want to be credited) and the link to your website (if any)&lt;br /&gt;2. the title of your tutorial&lt;br /&gt;3. a short description of your tutorial&lt;br /&gt;4. brief step by step instructions, the briefer the better!&lt;br /&gt;5. attach photos (screencasts are welcome too) or the link that help illustrate the steps and/or results&lt;br /&gt;6. source code of the RCP project (zipped) see &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/import-and-export-eclipse-rcp.html"&gt;Import and Export an Eclipse RCP Application Project&lt;/a&gt; for help exporting the project&lt;br /&gt;&lt;br /&gt;The Eclipse community thanks you!&lt;br /&gt;&lt;br /&gt;We believe the most easy and effective way to demonstrate a concept or solution in RCP is to create a new Eclipse RCP Hello World Application first and add the minimal code to it necessary to demonstrate the technique. Therefore every tutorial should start with the step of creating a new Hello World application as shown in &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/hello-world-with-eclipse-rcp-your-first.html"&gt;Hello World with Eclipse RCP - Your First Application&lt;/a&gt;, and be followed by a short list of steps describing what needs to be added and showing the added source code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-3167968727339182460?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/lsQAHqKn2nI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/3167968727339182460/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/share.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3167968727339182460?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/3167968727339182460?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/lsQAHqKn2nI/share.html" title="Share" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/share.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MARHc8eCp7ImA9WxVVFk4.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-5345297965595385661</id><published>2009-03-08T12:04:00.000-07:00</published><updated>2009-03-09T13:44:05.970-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-09T13:44:05.970-07:00</app:edited><title>About</title><content type="html">&lt;span style="font-weight: bold;"&gt;You&lt;br /&gt;&lt;/span&gt;This website is about you because without you there would be no community around Eclipse RCP technology. You may be here to learn from the tutorials others have shared or you may be here to contribute your own tips and examples. Hopefully you're here to do both! &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html"&gt;Check out the available tutorials!&lt;/a&gt; The open source philosophy encourages receiving and giving back in return. You may not have the time or skills to contribute new source code to the project, but there are plenty of other ways to return the favor. Don't hesitate, &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/share.html"&gt;get sharing right away&lt;/a&gt;. It's easy!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Alison Redding&lt;/span&gt;&lt;br /&gt;Alison has been programming in Java since 1997 and a fan of Eclipse RCP for the last 2 years. She currently works at a west coast University writing image processing software in a biotechnology lab. Alison handles our public relations and site promotion.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tim Molter&lt;/span&gt;&lt;br /&gt;Tim has been creating Eclipse RCP applications for over 3 years, first just for fun, and now professionally. His background and passion for physics and mathematics have lead him to seek out programming projects involving scientific automation and analysis. Tim is our main internal contributor of tutorials.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Frederik McGee&lt;/span&gt;&lt;br /&gt;Frederik is a retired sailor/network administrator and programming enthusiast. Fred is our wesite designer and technical troubleshooter.&lt;br /&gt;&lt;br /&gt;Please feel free to contact any of us at eclipsercptutorials[at]gmail[dot]com.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-5345297965595385661?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/zrACaCHU65w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/5345297965595385661/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/about.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5345297965595385661?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/5345297965595385661?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/zrACaCHU65w/about.html" title="About" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/about.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYDQ3wyfip7ImA9WxVUF04.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-2949770942528546346</id><published>2009-03-08T11:00:00.000-07:00</published><updated>2009-03-22T08:02:52.296-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-22T08:02:52.296-07:00</app:edited><title>Frequently Asked Questions</title><content type="html">&lt;span style="font-weight: bold;"&gt;Is this website sponsored by or affiliated with Eclipse.org?&lt;/span&gt;&lt;br /&gt;No. This website was created by a small group of RCP developers who wanted to give back to the Eclipse community in their own unique way. The open source philosophy of the Eclipse community is encouraged here meaning that the more people who share the better it is for the entire group. Please &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/share.html"&gt;share&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why should I share?&lt;/span&gt;&lt;br /&gt;You should share because you invested a lot of time in figuring out how to get something to work and you deserve your moment of glory! Sometimes the programmatical solution for the feature you are trying to add to your program can be elusive. We've all spent hours searching the web for some particular method or trick to accomplish a task and were appreciative that someone else took the time to write about it online. This website was created as a medium to connect sharees and sharers. Don't hesitate, &lt;a href="http://eclipsercptutorials.blogspot.com/2009/03/share.html"&gt;get sharing right away&lt;/a&gt;. It's easy!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What can be shared?&lt;/span&gt;&lt;br /&gt;Any code snippet, how-to, tip or trick written in Java that demonstrates how to accomplish a certain task in developing an Eclipse RCP application.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Who owns the content that I share on this website?&lt;/span&gt;&lt;br /&gt;In the spirit of open source technology, nothing on this site is owned by anybody. However, just as in open source, the contributors of the work are given credit. Every post will list the contributor and a link to their website. Of course the contributors can remain anonymous if they like.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why can't I directly post something to the website?&lt;/span&gt;&lt;br /&gt;Information is best when it is assured to be quality information. Submitted content is tested by one of the site administrators and converted into a consistent format ensuring that the code actually works while also presenting it in a familiar format.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why are there ads on this site?&lt;/span&gt;&lt;br /&gt;Just like the Eclipse Foundation is funded by annual dues from its members and governed by a Board of Directors to pay a core set of developers, this website is developed and actively updated by a core set of site administrators. The hope is to eventually get a real domain name and get the site properly hosted. If there is enough interest, the site will be redesigned to include a forum. By the way, please don't click on the ads unless you have a genuine interest in the product being advertised. Excessive ad clicking is bad.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-2949770942528546346?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/4Jyen3q2uLU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/2949770942528546346/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/frequently-asked-questions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/2949770942528546346?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/2949770942528546346?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/4Jyen3q2uLU/frequently-asked-questions.html" title="Frequently Asked Questions" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/frequently-asked-questions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4BRH05eip7ImA9WxVVGE0.&quot;"><id>tag:blogger.com,1999:blog-1671987051228736535.post-8802568302667322571</id><published>2009-03-08T06:21:00.000-07:00</published><updated>2009-03-11T12:49:15.322-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-11T12:49:15.322-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tutorials" /><title>Eclipse RCP Tutorial Table of Contents</title><content type="html">&lt;script src="http://feeds2.feedburner.com/EclipseRcpTutorials?format=sigpro" language="Javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1671987051228736535-8802568302667322571?l=eclipsercptutorials.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/EclipseRcpTutorials/~4/Xdcqn7guL4E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://eclipsercptutorials.blogspot.com/feeds/8802568302667322571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8802568302667322571?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1671987051228736535/posts/default/8802568302667322571?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/EclipseRcpTutorials/~3/Xdcqn7guL4E/eclipse-rcp-tutorial-table-of-contents.html" title="Eclipse RCP Tutorial Table of Contents" /><author><name>Tim Molter</name><uri>http://www.blogger.com/profile/09117791052747688044</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="15060366094170073430" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://eclipsercptutorials.blogspot.com/2009/03/eclipse-rcp-tutorial-table-of-contents.html</feedburner:origLink></entry></feed>
