<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1052352981190159815</id><updated>2024-09-04T12:09:44.442-07:00</updated><category term="Cascaded menus"/><category term="Delete Logs on Problems View"/><category term="Editor in event loop"/><category term="FIxedConnectionAnchor"/><category term="suspending a thread on Editor close"/><title type='text'>Commercial   Java   Products</title><subtitle type='html'>The blog contains tips and tricks for Java based commercial product development.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-8444325803312193257</id><published>2011-10-25T03:10:00.000-07:00</published><updated>2011-10-25T03:10:36.224-07:00</updated><title type='text'>Ever thought of running a RCP in Browser ? RAP is here !</title><content type='html'>I have been hearing a lot in terms of web based version of Eclipse APIs and browser based RCP off late. On googling a bit, I found out that RAP has indeed made it possible to launch the RCP in a web browser.A RAP screencast showing how to convert the RCP  Mail Template into a RAP application can be seen at this link - &lt;a href=&quot;http://www.volanakis.de/nuggets/RCP_Mail_goes_RAP/index.html&quot; id=&quot;nrd5&quot; target=&quot;_blank&quot; title=&quot;View screencast in new window&quot;&gt;View screencast in new window&lt;/a&gt;.&lt;br /&gt;
&lt;div id=&quot;gb-6&quot; style=&quot;padding: 1em 0pt; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.volanakis.de/nuggets/RCP_Mail_goes_RAP/index.html&quot; id=&quot;nrd5&quot; target=&quot;_blank&quot; title=&quot;View screencast in new window&quot;&gt;&lt;img src=&quot;http://docs.google.com/File?id=dgmxkzdm_67t987mfd8&quot; style=&quot;height: 311px; width: 379px;&quot; /&gt; &lt;/a&gt;&lt;/div&gt;&lt;b&gt;Wait, what is RAP anyway? &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
RAP stands for &lt;a href=&quot;http://www.eclipse.org/rap/&quot; id=&quot;yb49&quot; target=&quot;_blank&quot; title=&quot;Rich Ajax Platform&quot;&gt;Rich Ajax Platform&lt;/a&gt;. It is an Eclipse Project that enables Java developers to&lt;b&gt; build browser-based &lt;/b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/AJAX&quot; id=&quot;mho4&quot; target=&quot;_blank&quot; title=&quot;AJAX&quot;&gt;&lt;b&gt;AJAX&lt;/b&gt;&lt;/a&gt;&lt;b&gt; applications&lt;/b&gt; &lt;b&gt;using the&lt;/b&gt; &lt;b&gt;full Java libraries, Eclipse APIs and a plug-in architecture&lt;/b&gt;. It does so by providing a web-enabled implementation of SWT, JFace and the Workbench.&lt;br /&gt;
&lt;br /&gt;
Although, this experiment sort of works but I am not sure how useful will it be to try and run a HEAVY swt based app in a plain browser. Hope to see much more development happening in this context as one benefit that this is surely going to bring is the freedom from installing a RCP on each client machine.&lt;br /&gt;
&lt;br /&gt;
WAY TO GO &lt;b style=&quot;color: red;&quot;&gt;RAP&lt;/b&gt;.</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/8444325803312193257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/10/ever-thought-of-running-rcp-in-browser.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8444325803312193257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8444325803312193257'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/10/ever-thought-of-running-rcp-in-browser.html' title='Ever thought of running a RCP in Browser ? RAP is here !'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-8218476894665173024</id><published>2011-10-25T02:52:00.000-07:00</published><updated>2011-10-25T02:52:58.322-07:00</updated><title type='text'>Quick Access (Ctrl+3) feature added</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Quick Access&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;(Ctrl+3)&lt;/span&gt; command has been introduced in &lt;a href=&quot;http://download.eclipse.org/eclipse/downloads/drops/S-3.3M7-200705031400/index.php&quot; target=&quot;_blank&quot; title=&quot;Eclipse 3.3 M7 download&quot;&gt;Eclipse 3.4&lt;/a&gt;. &lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;It &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;allows you to access UI-elements - like Views, Perspectives, Commands, etc. - by just typing their name&lt;/span&gt;.&lt;br /&gt;
&lt;div style=&quot;padding: 1em 0pt; text-align: center;&quot;&gt;&lt;img src=&quot;http://docs.google.com/File?id=dgmxkzdm_47hs5t9pfc&quot; /&gt;&lt;/div&gt;Some usage examples:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open the &lt;span style=&quot;font-weight: bold;&quot;&gt;Navi&lt;/span&gt;gator View? Ctrl+3, Navi, return&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;D&lt;/span&gt;ebug &lt;span style=&quot;font-weight: bold;&quot;&gt;L&lt;/span&gt;ast &lt;span style=&quot;font-weight: bold;&quot;&gt;L&lt;/span&gt;aunched? Ctrl+3, DLL, return&lt;/li&gt;
&lt;li&gt;Open the Debug Perspective? Ctrl+3, Perspectives D (&lt;span style=&quot;font-weight: bold;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;erspectives &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;D&lt;/span&gt;ebug), return&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/8218476894665173024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/10/quick-access-ctrl3-feature-added.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8218476894665173024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8218476894665173024'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/10/quick-access-ctrl3-feature-added.html' title='Quick Access (Ctrl+3) feature added'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-6084950767168265958</id><published>2011-07-26T23:31:00.000-07:00</published><updated>2011-10-25T02:26:52.739-07:00</updated><title type='text'>Remove Unwanted Perspectives from your RCP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;While creating a RCP recently I noticed that I had dependencies on some of the Eclipse JDT and Plugin development features and due to this the RCP was showing some really unnecessary entries in the Perspective selection bar.&lt;br /&gt;
&lt;br /&gt;
On debugging a little I found out the concept of pre-defined perspectives (those which come as a result of contributions from Plugin.xml of any contributing plugin) and it is indeed pain to remove those perspectives from any RCP.&lt;br /&gt;
&lt;br /&gt;
Here is the snippet that I hacked to get rid of those predefined perspectives -&lt;br /&gt;
&lt;br /&gt;
Call the&amp;nbsp; removeUnWantedPerspectives() (attached below) method from postWindowCreate() method of your RCP&#39;s WorkbenchWindowAdvisor extension class -&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static final String[] IGNORE_PERSPECTIVES = new String[] {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;org.eclipse.birt.report.designer.ui.ReportPerspective&quot;, &quot;org.eclipse.debug.ui.DebugPerspective&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;org.eclipse.jdt.ui.JavaPerspective&quot;, &quot;org.eclipse.jdt.ui.JavaHierarchyPerspective&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;org.eclipse.jdt.ui.JavaBrowsingPerspective&quot;, &quot;org.eclipse.mylyn.tasks.ui.perspectives.planning&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;org.eclipse.pde.ui.PDEPerspective&quot;, &quot;org.eclipse.team.cvs.ui.cvsPerspective&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;org.eclipse.ui.resourcePerspective&quot;, }; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* Removes the unwanted perspectives from your RCP application&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private void removeUnWantedPerspectives() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IPerspectiveRegistry perspectiveRegistry = PlatformUI.getWorkbench().getPerspectiveRegistry();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IPerspectiveDescriptor[] perspectiveDescriptors = perspectiveRegistry.getPerspectives();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;string&gt; ignoredPerspectives = Arrays.asList(GenericConstants.IGNORE_PERSPECTIVES);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;iperspectivedescriptor&gt; removePerspectiveDesc = new ArrayList&lt;iperspectivedescriptor&gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Add the perspective descriptors with the matching perspective ids to the list&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (IPerspectiveDescriptor perspectiveDescriptor : perspectiveDescriptors) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(ignoredPerspectives.contains(perspectiveDescriptor.getId())) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; removePerspectiveDesc.add(perspectiveDescriptor);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // If the list is non-empty then remove all such perspectives from the IExtensionChangeHandler&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(perspectiveRegistry instanceof IExtensionChangeHandler &amp;amp;&amp;amp; !removePerspectiveDesc.isEmpty()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IExtensionChangeHandler extChgHandler = (IExtensionChangeHandler) perspectiveRegistry;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; extChgHandler.removeExtension(null, removePerspectiveDesc.toArray());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/iperspectivedescriptor&gt;&lt;/iperspectivedescriptor&gt;&lt;/string&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/6084950767168265958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/07/remove-unwanted-perspectives-from-your.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/6084950767168265958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/6084950767168265958'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2011/07/remove-unwanted-perspectives-from-your.html' title='Remove Unwanted Perspectives from your RCP'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-36086700413870831</id><published>2010-11-23T05:36:00.000-08:00</published><updated>2011-10-25T02:26:26.930-07:00</updated><title type='text'>Remove the Progress Monitor Part from Jface Wizard</title><content type='html'>Many a times the Jface wizards have posed an annoying problem to me... Even after setting the needsProgressMonitor attribute to false, there is some extra space left at the bottom of the wizard dialog which contains the invisible progress monitor part.&lt;br /&gt;
&lt;br /&gt;
I finally managed a hack that removes that part, here is the code that you need to use -&lt;br /&gt;
&lt;br /&gt;
WizardDialog dialog = new WizardDialog(null, wizard) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; protected Control createDialogArea(Composite parent) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Control ctrl = super.createDialogArea(parent);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; getProgressMonitor();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return ctrl;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; protected IProgressMonitor getProgressMonitor() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ProgressMonitorPart monitor = (ProgressMonitorPart) super.getProgressMonitor();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GridData gridData = new GridData(GridData.FILL_HORIZONTAL);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; gridData.heightHint = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; monitor.setLayoutData(gridData);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; monitor.setVisible(false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return monitor;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }; &lt;br /&gt;
&lt;br /&gt;
This safely removes the extra space from the bottom of the wizard. Though you will not be able to use the progress monitor from this point onwards in the wizard where this code is placed.</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/36086700413870831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/11/remove-progress-monitor-part-from-jface.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/36086700413870831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/36086700413870831'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/11/remove-progress-monitor-part-from-jface.html' title='Remove the Progress Monitor Part from Jface Wizard'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-8312496107422524396</id><published>2010-06-03T05:24:00.000-07:00</published><updated>2011-10-25T02:25:45.583-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delete Logs on Problems View"/><title type='text'>Delete Logs action on Eclipse Problems View</title><content type='html'>The standard Eclipse Errors view has a provision for deleting all the logs by simply using the &lt;b&gt;Delete Logs&lt;/b&gt; action available in the view tool bar as shown -&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAebc91rZqI/AAAAAAAAAA4/VauA9kG3Y94/s1600/Delete+Logs+on+Error+View.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;164&quot; src=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAebc91rZqI/AAAAAAAAAA4/VauA9kG3Y94/s640/Delete+Logs+on+Error+View.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;But there is no such provision available for the Eclipse Problems View. If you are planning to utilize the problems view in your product then this might be a big headache. I encountered the same thing and decided to contribute one of my own action for doing this job.&lt;br /&gt;
&lt;br /&gt;
Extension Point Definition -&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_ONpgpP4adJo/TAedSifN4UI/AAAAAAAAABA/nWfZ6_NPmpM/s1600/Extension+Point+Definition.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;http://1.bp.blogspot.com/_ONpgpP4adJo/TAedSifN4UI/AAAAAAAAABA/nWfZ6_NPmpM/s400/Extension+Point+Definition.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_ONpgpP4adJo/TAedt2GZaLI/AAAAAAAAABI/BRBfnpu6hjw/s1600/Problems+View+ID.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;139&quot; src=&quot;http://2.bp.blogspot.com/_ONpgpP4adJo/TAedt2GZaLI/AAAAAAAAABI/BRBfnpu6hjw/s640/Problems+View+ID.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Extension Point Details -&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAed2zGXjGI/AAAAAAAAABQ/VaP10xVnFj8/s1600/Extension+Element+Details.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAed2zGXjGI/AAAAAAAAABQ/VaP10xVnFj8/s400/Extension+Element+Details.jpg&quot; width=&quot;387&quot; /&gt;&lt;/a&gt;&lt;/div&gt;The class DeleteLogsAction looks as follows -&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;public class DeleteLogsAction extends Action implements IViewActionDelegate {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private IViewPart view;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private final static String DIALOG_TITLE = &quot;Confirm Delete&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private final static String DIALOG_MESSAGE = &quot;Are you sure you want to delete all logged events?&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private final static String MARKER_TYPE = IMarker.PROBLEM;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private final static int DEPTH = IResource.DEPTH_INFINITE;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private final static boolean INCLUDE_SUB_TYPES = true;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public DeleteLogsAction() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.setImageDescriptor(Activator.getImageDescriptor(&quot;\\icons\\remove.gif&quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.setDisabledImageDescriptor(Activator.getImageDescriptor(&quot;\\icons\\remove_disabled.gif&quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void init(IViewPart view) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.view = view;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run(IAction action) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(ResourcesPlugin.getWorkspace() != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IWorkspace workSpace = ResourcesPlugin.getWorkspace();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(workSpace.getRoot() != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IWorkspaceRoot root = workSpace.getRoot();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IMarker[] markers = root.findMarkers(MARKER_TYPE, INCLUDE_SUB_TYPES, DEPTH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(markers != null &amp;amp;&amp;amp; markers.length &amp;gt; 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; boolean confirm = MessageDialog.openConfirm(view.getSite().getShell(), DIALOG_TITLE,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DIALOG_MESSAGE);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(confirm)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; root.deleteMarkers(MARKER_TYPE, INCLUDE_SUB_TYPES, DEPTH);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; catch ( CoreException e )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PALogger.logError(Activator.PLUGIN_ID, &quot;Failed to delete the problem markers.&quot;, e);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void selectionChanged(IAction action, ISelection selection) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
Once this part is done, You will be able to see the new action in the problems view -&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_ONpgpP4adJo/TAee7OroDAI/AAAAAAAAABY/KNudk_WPsLQ/s1600/Problems+View+with+Delete+Logs+Action.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;129&quot; src=&quot;http://2.bp.blogspot.com/_ONpgpP4adJo/TAee7OroDAI/AAAAAAAAABY/KNudk_WPsLQ/s640/Problems+View+with+Delete+Logs+Action.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/8312496107422524396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/delete-logs-action-on-eclipse-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8312496107422524396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8312496107422524396'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/delete-logs-action-on-eclipse-problems.html' title='Delete Logs action on Eclipse Problems View'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_ONpgpP4adJo/TAebc91rZqI/AAAAAAAAAA4/VauA9kG3Y94/s72-c/Delete+Logs+on+Error+View.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-6369394602044128151</id><published>2010-06-03T05:04:00.000-07:00</published><updated>2011-10-25T02:25:18.792-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Editor in event loop"/><category scheme="http://www.blogger.com/atom/ns#" term="suspending a thread on Editor close"/><title type='text'>Run editor in event loop</title><content type='html'>We have only seen dialogs in a modal mode but recently I came across a requirement where we had to open an editor from a UI thread and then hold the Job until that editor was either closed or a button &#39;continue&#39; was pressed upon it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The challenge here was halting/suspending the job until some user action has been received. So here is the trick that I applied towards this problem -&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Get the active workbench window -&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;&lt;b style=&quot;background-color: #eeeeee;&quot;&gt;IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;Get the active page -&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;IWorkbenchPage page = dw.getActivePage();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open the editor -&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;IEditorPart part = IDE.openEditor(page, editorInput, true);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Use the following method to keep the job suspended until the editorpart was disposed -&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;background-color: #eeeeee;&quot;&gt;runEventLoop(page, part.getEditorInput(), monitor);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;&lt;b&gt;private void runEventLoop(IWorkbenchPage page, IEditorInput editorInput, ProgressMonitor monitor) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Display display = Display.getCurrent();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(page != null &amp;amp;&amp;amp; editorInput != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (page.findEditor(editorInput) != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; IEditorPart part = page.findEditor(editorInput);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(!monitor.isCanceled())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(!display.readAndDispatch())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; display.sleep();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(part.getSite() != null &amp;amp;&amp;amp; part.getSite().getPage() != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; part.getSite().getPage().closeEditor(part, false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; display.update();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
So, as long as the editor part is received on &lt;b style=&quot;background-color: #eeeeee;&quot;&gt;page.findEditor(editorInput) &lt;/b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;line the display would sleep and hence our job will sit dummy. As soon as the editor part is not found, the while loop will exit updating the display in the process.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/6369394602044128151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/run-editor-in-event-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/6369394602044128151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/6369394602044128151'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/run-editor-in-event-loop.html' title='Run editor in event loop'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-7501644740013780150</id><published>2010-06-03T02:36:00.000-07:00</published><updated>2011-10-25T02:24:56.925-07:00</updated><title type='text'>Change types in Eclipse Problems View using EMF</title><content type='html'>An interesting problem that I recently faced was to change the type for the messages appearing in the Type column of Eclipse Problems view. I am working with EMF plugins at the moment and had to come up with a solution that suits the EMF environment. By default any validation message in EMF has a type of &#39;&lt;b&gt;EMF Problem&lt;/b&gt;&#39; associated with it but in certain situations we need to change that to meet our business needs. So, here is what you need to do -&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Define your own Resource Markers in some plugin as shown -&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAd09ki4BdI/AAAAAAAAAAw/T4B8y-xTrjE/s1600/Resource+Markers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/_ONpgpP4adJo/TAd09ki4BdI/AAAAAAAAAAw/T4B8y-xTrjE/s320/Resource+Markers.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Override the validate action present in the ActionBarContributor class of your EMF editor plugin. By default it points to the &quot;org.eclipse.emf.edit.ui.action.ValidateAction&quot;, create your own class extending this one.&lt;/li&gt;
&lt;li&gt;In the extended class, override the method &quot;Diagnostic validate(final IProgressMonitor progressMonitor)&quot; in the following manner -&lt;/li&gt;
&lt;/ul&gt;&lt;a href=&quot;&quot; name=&quot;more&quot;&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;protected Diagnostic validate(final IProgressMonitor progressMonitor)&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;{&amp;nbsp; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Overridden the utility to supply the new Marker ID */&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eclipseResourcesUtil = EMFPlugin.IS_RESOURCES_BUNDLE_AVAILABLE ?&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new EclipseResourcesUtil() {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected String getMarkerID() {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;New Resource Marker ID&quot; &lt;your id=&quot;&quot; marker=&quot;&quot; new=&quot;&quot;&gt;;&lt;/your&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } : null;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Changes finished*/&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;When you will now execute the validate action, the custom type specified while defining your own resource marker shall be shown instead of &#39;EMF Problem&#39;. &lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/7501644740013780150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/change-types-in-eclipse-problems-view.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/7501644740013780150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/7501644740013780150'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/change-types-in-eclipse-problems-view.html' title='Change types in Eclipse Problems View using EMF'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_ONpgpP4adJo/TAd09ki4BdI/AAAAAAAAAAw/T4B8y-xTrjE/s72-c/Resource+Markers.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-2149408039234209330</id><published>2010-06-03T01:59:00.000-07:00</published><updated>2011-10-25T02:24:33.208-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FIxedConnectionAnchor"/><title type='text'>Stop Connection from moving when Nodes are moved</title><content type='html'>For this to take place we need to understand the concept of fixedconnectionAnchor. Try to extend the class AbstractConnectionAnchor and override the methods getLocation() and the getOwner() method to suit to your needs.&lt;br /&gt;
&lt;br /&gt;
Then go to the editpart you wish the connection to stick to and just write the following code -&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connEditPart) {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fixedAnchor == null)&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fixedAnchor = new FixedConnectionAnchor(getNodeFigure());&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getNodeFigure().addAncestorListener(fixedAnchor);&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp; return fixedAnchor;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;} &lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;public ConnectionAnchor getTargetConnectionAnchor(Request request) {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fixedAnchor == null)&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fixedAnchor = new FixedConnectionAnchor(getNodeFigure());&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getNodeFigure().addAncestorListener(fixedAnchor);&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;&amp;nbsp; return fixedAnchor;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/2149408039234209330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/stop-connection-from-moving-when-nodes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/2149408039234209330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/2149408039234209330'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/stop-connection-from-moving-when-nodes.html' title='Stop Connection from moving when Nodes are moved'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1052352981190159815.post-8643809677766009958</id><published>2010-06-03T01:44:00.000-07:00</published><updated>2011-10-25T02:24:02.526-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cascaded menus"/><title type='text'>Cascaded menus in GMF</title><content type='html'>To get nested menus while dragging a connection out from a node in GMF  we need to make our own command that extends PopupMenuCommand. &lt;br /&gt;
&lt;br /&gt;
The Steps will be - &lt;br /&gt;
&lt;pre&gt;1. Override the method doExecuteWithResult().
2. Inside the method we would need to call another method createPopupMenu().
3. To populate the contents of the popupmenu we need the connection and endMenu contents.
4. To get the endMenu Contents write a method similar to :-

&lt;div style=&quot;background-color: #cccccc;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;protected List getEndMenuContent(Object connectionItem)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;  ModelingAssistantService mInstance = ModelingAssistantService.getInstance();&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;  if(connectionItem instanceof IElementType)&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;   {&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;     IElementType connectionType = (IElementType) connectionItem;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;     List returneMe = new ArrayList();&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;     List menuContent = mInstance.getTypesForTarget(getKnownEnd(), connectionType);&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: #cccccc; font-family: verdana;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;     for (int i = 0; i &amp;lt;&amp;gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;      {&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;         if(menuContent.get(i) instanceof IElementType)&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;                    returneMe.add(menuContent.get(i));&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;        else&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;               returneMe.add(new PopupMenu.CascadingMenu(&quot;{name of the catrgory}&quot;, new PopupMenu(&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;               (List) (menuContent.get(i)), getConnectionAndEndLabelProvider(menuContent.get(i)))));&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;              }&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;      }&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;      returneMe.add(EXISTING_ELEMENT);&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;      return returneMe;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt; }&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;return Collections.EMPTY_LIST;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana;&quot;&gt;}&lt;/span&gt;

&lt;/span&gt;Once you are done with these stpes then go ahead with the normal&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;procedure to call this command in the ContainerNodeEditPolicy of your projetct. &lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://commercialjavaproducts.blogspot.com/feeds/8643809677766009958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/cascaded-menus-in-gmf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8643809677766009958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1052352981190159815/posts/default/8643809677766009958'/><link rel='alternate' type='text/html' href='http://commercialjavaproducts.blogspot.com/2010/06/cascaded-menus-in-gmf.html' title='Cascaded menus in GMF'/><author><name>Eureka</name><uri>http://www.blogger.com/profile/04192549804099788163</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRewittcYgKt_FgSRRBVdDKFzBSogouN9vm-P2XN9Vf6828GD6hap4cuOsvH3WQJvi3UAHpFWe4yDz6yd0tix587OGtVytEiVQcCc27MFqpUvv45EE44WqpuC1oHJg/s220/glossy-java-logo.png'/></author><thr:total>0</thr:total></entry></feed>