tag:blogger.com,1999:blog-2563203433163751262024-03-12T21:19:31.486-07:00OpenBiomind-GUIThis blog contains updates and random information about <a href="http://code.google.com/p/openbiomind-gui/">OpenBiomind-GUI</a>, a GUI for <a href="http://code.google.com/p/openbiomind/">OpenBiomind</a>. The project was started as a part of <a href="http://code.google.com/soc/2008/">Google Summer of Code 2008</a>. It is being developed in <a href="http://java.sun.com/javase/6/">Java 6</a> using <a href="http://www.eclipse.org/ganymede/">Eclipse 3.4 RCP</a>.Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-256320343316375126.post-24690505215931688532008-08-07T08:25:00.000-07:002008-08-07T08:27:56.941-07:00Complete PipelineI implemented the Complete Pipeline task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsULnIByYI/AAAAAAAACAY/sAagoPuy_MU/s1600-h/Task-CompletePipeline-1.PNG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsULnIByYI/AAAAAAAACAY/sAagoPuy_MU/s400/Task-CompletePipeline-1.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5231797581834733954" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJsULsCE5pI/AAAAAAAACAg/jknEF5E5Aqg/s1600-h/Task-CompletePipeline-2.PNG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJsULsCE5pI/AAAAAAAACAg/jknEF5E5Aqg/s400/Task-CompletePipeline-2.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5231797583151949458" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-74197893952496765062008-07-24T22:11:00.000-07:002008-08-07T08:25:49.593-07:00Converting Graphviz dot file to image file using dot utilityOpenBiomind generates a <a href="http://www.graphviz.org/">Graphviz</a> dot file as an output of GraphFeatures task. In the GUI, we thought to provide a image of the graph too. This was simply achieved using the <a href="http://www.graphviz.org/Documentation/dotguide.pdf">dot</a> utility provided by Graphviz.<br /><br />Following snippet shows a sample usage (working example can be seen in this snippet was modified from <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/src/openbiomind/gui/wizards/GraphFeaturesWizard.java?r=46">revision 46</a> of <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/src/openbiomind/gui/wizards/GraphFeaturesWizard.java">GraphFeaturesWizard</a>):<br /><textarea name="code" class="java" cols="80" rows="10"><br />// final String graphvizDotUtilityPath = ...<br />// final String imageType = ... // "png", "gif", or other supported type<br />// final String sourceDotFilePath = ...<br />// final String outputImageFilePath = ...<br /><br />final List<String> commandList = new ArrayList<String>();<br />commandList.add(graphvizDotUtilityPath);<br />commandList.add("-T" + imageType);<br />commandList.add(sourceDotFilePath);<br />commandList.add("-o" + outputImageFilePath);<br /><br />// java.lang.Process<br />// java.lang.ProcessBuilder<br />final Process process = new ProcessBuilder(commandList).start();<br /></textarea><br />Following is the snapshot of a workbench after opening the graph (image):<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsT7SH2KJI/AAAAAAAACAQ/BJvBZhJex2E/s1600-h/Workbench-GraphFeatures.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsT7SH2KJI/AAAAAAAACAQ/BJvBZhJex2E/s400/Workbench-GraphFeatures.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231797301318920338" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-358363472293205082008-07-24T22:07:00.000-07:002008-08-07T08:24:52.469-07:00Graph FeaturesI implemented the Graph Features task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJsS_Zi3i6I/AAAAAAAACAI/W1wKArQOcMg/s1600-h/Task-GraphFeatures.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJsS_Zi3i6I/AAAAAAAACAI/W1wKArQOcMg/s400/Task-GraphFeatures.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231796272519154594" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-78856130100399890242008-07-24T22:01:00.000-07:002008-08-07T07:59:49.364-07:00Preference DialogHere is the preference dialog of the application:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsN1D7fX2I/AAAAAAAACAA/1A2thpoN-yo/s1600-h/Dialog-Preferences.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJsN1D7fX2I/AAAAAAAACAA/1A2thpoN-yo/s400/Dialog-Preferences.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231790597360017250" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-16581584852176703992008-07-19T23:41:00.001-07:002008-08-07T07:59:10.889-07:00Image EditorI implemented an Image Editor to display the generated image. I needed that for View Clusters task. Found a good amount of help from <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet48.java?view=co">Snippet 48</a> of <a href="http://www.eclipse.org/swt/snippets/">SWT Snippets</a>. Following is the snapshot of the workbench after opening the image file:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJsNqynV3YI/AAAAAAAAB_4/UtBC-DLhjX4/s1600-h/Workbench-ImageEditor.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJsNqynV3YI/AAAAAAAAB_4/UtBC-DLhjX4/s400/Workbench-ImageEditor.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231790420913413506" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-12851762670326448492008-07-19T23:27:00.000-07:002008-08-07T07:58:18.863-07:00View ClustersI implemented the View Clusters task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uQZvRSOrh0A/SJsNfYoUkSI/AAAAAAAAB_w/vN_cpidhMlg/s1600-h/Task-ViewClusters.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_uQZvRSOrh0A/SJsNfYoUkSI/AAAAAAAAB_w/vN_cpidhMlg/s400/Task-ViewClusters.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231790224959639842" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-88146549366070492002008-07-18T21:16:00.000-07:002008-08-07T07:57:28.155-07:00ClusterizeI implemented the Clusterize task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJsNSVCl6iI/AAAAAAAAB_o/5K8zV4Alor8/s1600-h/Task-Clusterize.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJsNSVCl6iI/AAAAAAAAB_o/5K8zV4Alor8/s400/Task-Clusterize.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231790000657787426" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-49436994971759568442008-07-16T15:45:00.000-07:002008-08-07T08:28:08.791-07:00Clustering TransformerI implemented the ClusteringTransformer task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJr-aS6M2II/AAAAAAAAB_g/84weBre0oEs/s1600-h/Task-ClusteringTransformer.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJr-aS6M2II/AAAAAAAAB_g/84weBre0oEs/s400/Task-ClusteringTransformer.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231773644850256002" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-23199732438066503412008-07-10T18:52:00.000-07:002008-08-07T08:28:21.082-07:00Utility ComputerI implemented the UtilityComputer task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJr9KaOKpkI/AAAAAAAAB_Y/-R6Gi_9Ojes/s1600-h/Task-UtilityComputer.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJr9KaOKpkI/AAAAAAAAB_Y/-R6Gi_9Ojes/s400/Task-UtilityComputer.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231772272423511618" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-44931103735620059672008-07-08T21:36:00.000-07:002008-07-09T20:37:00.896-07:00How to fix "workspace excited with unsaved changes" issue?<blockquote style="font-weight: bold;">!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.</blockquote><br />While using the workspace resources in Eclipse 3.4 RCP application, if you get the above message whenever you restart the workbench, then you need to save the workspace, before existing the workbench. One possible, way to do this is to overload the <span style="font-weight: bold;">preWindowShellClose()</span> method in your of <span style="font-weight: bold;">WorkbenchWindowAdvisor</span>. You can save the workspace by using <span style="font-weight: bold;">ResourcesPlugin.getWorkspace().save(...)</span> method.<br /><br />Following snippet elaborates this (this snippet was modified from <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/src/openbiomind/gui/ApplicationWorkbenchWindowAdvisor.java?r=32">revision 32</a> of <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/src/openbiomind/gui/ApplicationWorkbenchWindowAdvisor.java">ApplicationWorkbenchWindowAdvisor</a>):<br /><br /><textarea name="code" class="java" cols="80" rows="10"><br />import org.eclipse.core.resources.ResourcesPlugin;<br />import org.eclipse.core.runtime.CoreException;<br />import org.eclipse.ui.application.WorkbenchWindowAdvisor;<br /><br />public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {<br /><br /> // other methods...<br /><br /> @Override<br /> public boolean preWindowShellClose() {<br /> try {<br /> // save the full workspace before quit<br /> ResourcesPlugin.getWorkspace().save(true, null);<br /> } catch (final CoreException e) {<br /> // log exception, if required<br /> }<br /><br /> return true;<br /> }<br /><br />}<br /></textarea>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-18452088969329751302008-07-08T20:59:00.000-07:002008-08-07T06:47:25.087-07:00File Menu and Edit MenuEclipse RCP 3.4 allows you to easily add menu commands. You just need to use the ID of an existing command as the command ID of the menu item. I used that extensively to create the File and Edit menus.<br /><div style="text-align: center;"><span style="font-weight: bold;">File Menu</span><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJr8ufhW-HI/AAAAAAAAB_I/DZsFrb7L0tk/s1600-h/Menu-File.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_uQZvRSOrh0A/SJr8ufhW-HI/AAAAAAAAB_I/DZsFrb7L0tk/s400/Menu-File.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231771792809850994" /></a><br /><div style="text-align: center;"><span style="font-weight: bold;">Edit Menu</span><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJr8ueUocJI/AAAAAAAAB_Q/8h712t_P58Y/s1600-h/Menu-Edit.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_uQZvRSOrh0A/SJr8ueUocJI/AAAAAAAAB_Q/8h712t_P58Y/s400/Menu-Edit.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231771792488034450" /></a><br />Following is the code snippet of <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/plugin.xml">plugin.xml</a> file (you may also look at the <a href="http://code.google.com/p/openbiomind-gui/source/browse/trunk/plugin.xml?r=34">revision 34</a> from where this snippet has been copied):<br /><textarea name="code" class="xml" cols="80" rows="10"><br /><menu<br /> id="openbiomind.gui.menus.Edit"<br /> label="Edit"<br /> mnemonic="E"><br /> <command<br /> commandId="org.eclipse.ui.edit.undo"<br /> id="openbiomind.gui.menus.edit.Undo"<br /> mnemonic="U"<br /> style="push"><br /> </command><br /> <command<br /> commandId="org.eclipse.ui.edit.redo"<br /> id="openbiomind.gui.menus.edit.Redo"<br /> mnemonic="R"<br /> style="push"><br /> </command><br /> <separator<br /> name="openbiomind.gui.menus.edit.separator1"<br /> visible="true"><br /> </separator><br /> <command<br /> commandId="org.eclipse.ui.edit.cut"<br /> id="openbiomind.gui.menus.edit.Cut"<br /> mnemonic="t"<br /> style="push"><br /> </command><br /> <command<br /> commandId="org.eclipse.ui.edit.copy"<br /> id="openbiomind.gui.menus.edit.Copy"<br /> mnemonic="C"<br /> style="push"><br /> </command><br /> <command<br /> commandId="org.eclipse.ui.edit.paste"<br /> id="openbiomind.gui.menus.edit.Paste"<br /> mnemonic="P"<br /> style="push"><br /> </command><br /> <separator<br /> name="openbiomind.gui.menus.edit.separator2"<br /> visible="true"><br /> </separator><br /> <command<br /> commandId="org.eclipse.ui.edit.delete"<br /> id="openbiomind.gui.menus.edit.Delete"<br /> mnemonic="D"<br /> style="push"><br /> </command><br /> <command<br /> commandId="org.eclipse.ui.edit.selectAll"<br /> id="openbiomind.gui.menus.edit.SelectAll"<br /> mnemonic="A"<br /> style="push"><br /> </command><br /> <separator<br /> name="openbiomind.gui.menus.edit.separator3"<br /> visible="true"><br /> </separator><br /> <command<br /> commandId="org.eclipse.ui.edit.findReplace"<br /> id="openbiomind.gui.menus.edit.FindReplace"<br /> mnemonic="F"<br /> style="push"><br /> </command><br /></menu><br /></textarea>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-30287172289076139412008-07-06T18:45:00.000-07:002008-08-07T08:28:34.768-07:00Meta TaskI implemented the MetaTask task for OpenBiomind-GUI. Following is the snapshot of the wizard:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8h09NysI/AAAAAAAAB_A/ETGfBhJpAhc/s1600-h/Task-MetaTask.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8h09NysI/AAAAAAAAB_A/ETGfBhJpAhc/s400/Task-MetaTask.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231771575225535170" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-86966465822141661332008-07-04T19:52:00.000-07:002008-08-07T06:44:28.274-07:00Enhance Dataset and DatasetTransformerFollowing are some of the screen shots of OpenBiomind-GUI 0.0.2.20080704 (revision 27 of <a href="http://code.google.com/p/openbiomind-gui/">http://code.google.com/p/openbiomind-gui/</a>):<br /><br /><div style="text-align: center;"><span style="font-weight: bold;">Enhance Dataset</span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8DcD_2WI/AAAAAAAAB-w/1rIRmuK-dGQ/s1600-h/Task-EnhanceDataset.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8DcD_2WI/AAAAAAAAB-w/1rIRmuK-dGQ/s400/Task-EnhanceDataset.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231771053147019618" /></a><br /><div style="text-align: center;"><span style="font-weight: bold;">Dataset Transformer</span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8DYy_nkI/AAAAAAAAB-4/NrGpZpEIVYo/s1600-h/Task-DatasetTransformer.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_uQZvRSOrh0A/SJr8DYy_nkI/AAAAAAAAB-4/NrGpZpEIVYo/s400/Task-DatasetTransformer.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5231771052270394946" /></a><br /><br />More screen shots are available at <a href="http://picasaweb.google.com/bsanghvi/OpenBiomindGUI">http://picasaweb.google.com/bsanghvi/OpenBiomindGUI</a>.<br /><br />P.S. The post was edited on a later date.Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-14202915901261135812008-07-04T19:38:00.000-07:002008-08-07T06:41:55.853-07:00Splash ScreenHere is the Splash Screen that I created for OpenBiomind-GUI. I used <a href="http://www.gimp.org/">GIMP</a> to create this image. Clearly, I am not an artist and this was my first attempt at making an image :)<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uQZvRSOrh0A/SJr7f9zDn5I/AAAAAAAAB-k/w5163Rj0Ckw/s1600-h/Splash.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_uQZvRSOrh0A/SJr7f9zDn5I/AAAAAAAAB-k/w5163Rj0Ckw/s400/Splash.png" alt="" id="BLOGGER_PHOTO_ID_5231770443727478674" border="0" /></a>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-21909790324559649082008-07-04T13:16:00.000-07:002008-07-04T13:39:29.653-07:00Creating/Opening Link using Eclipse SWTI recently had a need to use hyperlinks (though I did not use it eventually). Here is a snippet to create hyperlinks in using Eclipse SWT.<br /><textarea name="code" class="java" cols="80" rows="10"><br />/*<br /> * Specific to Eclipse SWT<br /> * Related packages<br /> * - org.eclipse.swt.widgets.Link<br /> * - org.eclipse.swt.events.SelectionAdapter<br /> * - org.eclipse.swt.events.SelectionEvent<br /> * - org.eclipse.swt.SWT<br /> * - org.eclipse.swt.program.Program<br /> */<br />final Link link = new Link(parent, SWT.NONE);<br />link.setText("Visit <a href=\"http://code.google.com/p/openbiomind-gui/\">OpenBiomind-GUI homepage</a>");<br /><br />/*<br /> * You can use Selection Listener to identify the text that was clicked.<br /> * For e.g. here when user clicks on the hyperlink named OpenBiomind-GUI<br /> * then its href text, that is, http://code.google.com/p/openbiomind-gui/<br /> * is set as event.text.<br /> */<br />link.addSelectionListener(new SelectionAdapter() {<br /><br /> @Override<br /> public void widgetSelected(final SelectionEvent event) {<br /> // this will open the hyperlink in the default web browser<br /> Program.launch(event.text);<br /> }<br /><br />});<br /></textarea>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-6695919992433550772008-07-03T10:13:00.000-07:002008-07-04T13:39:08.221-07:00Creating NUM_ONLY Text Field using Eclipse SWTWhile working on a wizard, I needed to use text fields that accept only numbers. Following is a snippet of what I used. This text field will only accept digits as input. All other inputs (barring a few) are discarded.<br /><textarea name="code" class="java" cols="80" rows="10"><br />/* <br /> * Specific to Eclipse SWT.<br /> * Related packages<br /> * - org.eclipse.swt.widgets.Text<br /> * - org.eclipse.swt.events.VerifyListener<br /> * - org.eclipse.swt.events.VerifyEvent<br /> * - org.eclipse.swt.SWT<br /> */<br /><br />final Text text = new Text(parent, SWT.SINGLE | SWT.BORDER); // use desired style<br />// Use text.setTextLimit(...) to set a limit on number of digits<br /><br />/*<br /> * You need to use Verify Listener.<br /> * Key Listener will not block Paste actions, and users may still be able to<br /> * paste non numerals in the text field<br /> */<br />text.addVerifyListener(new VerifyListener() {<br /><br /> @Override<br /> public void verifyText(final VerifyEvent event) {<br /> switch (event.keyCode) {<br /> case SWT.BS: // Backspace<br /> case SWT.DEL: // Delete<br /> case SWT.HOME: // Home<br /> case SWT.END: // End<br /> case SWT.ARROW_LEFT: // Left arrow<br /> case SWT.ARROW_RIGHT: // Right arrow<br /> return;<br /> }<br /><br /> if (!Character.isDigit(event.character)) {<br /> event.doit = false; // disallow the action<br /> }<br /> }<br /><br />});<br /></textarea>Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0tag:blogger.com,1999:blog-256320343316375126.post-35020960375618954182008-06-25T21:16:00.000-07:002008-06-25T22:39:06.402-07:00WelcomeI will be putting up updates on the development of <a href="http://code.google.com/p/openbiomind-gui/">OpenBiomind-GUI</a> as well as other related stuff on this blog. OpenBiomind-GUI provides a GUI for <a href="http://code.google.com/p/openbiomind/">OpenBiomind</a>. The project was started in summer 2008 as a <a href="http://code.google.com/soc/2008/">Google Summer of Code 2008</a> project. The title of the project was <a href="http://code.google.com/soc/2008/siai/appinfo.html?csaid=E01679067FA7BCFF">Java GUI for OpenBiomind</a>.<br /><br />Tomorrow it will be one month since the coding started for it.Bhavesh Sanghvihttp://www.blogger.com/profile/18136418222275813335noreply@blogger.com0