<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>My Eclipse Diary</title>
	<link>http://www.javawiki.org</link>
	<description>Expressions developing RCP</description>
	<pubDate>Thu, 06 Jul 2006 22:01:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>javawiki.org becomes richclient2.eu</title>
		<link>http://www.javawiki.org/2006_07_06/javawikiorg-becomes-richclient2eu/</link>
		<comments>http://www.javawiki.org/2006_07_06/javawikiorg-becomes-richclient2eu/#comments</comments>
		<pubDate>Thu, 06 Jul 2006 22:01:53 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Blog</category>
		<guid isPermaLink="false">http://www.javawiki.org/2006_07_06/javawikiorg-becomes-richclient2eu/</guid>
		<description><![CDATA[&#8230;the rest remains constant. My employer decided to host my expressions about the eclipse-framework and prepared a new blog, where also other client-technologies will be mentioned and is accessible under http://www.richclient2.eu.

]]></description>
			<content:encoded><![CDATA[<p>&#8230;the rest remains constant. My <a target="_blank" href="http://www.spiritlink.de">employer</a> decided to host my expressions about the eclipse-framework and prepared a new blog, where also other client-technologies will be mentioned and is accessible under <a href="http://www.richclient2.eu">http://www.richclient2.eu</a>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_07_06/javawikiorg-becomes-richclient2eu/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>A SWT Calendar widget</title>
		<link>http://www.javawiki.org/2006_04_10/a-swt-calendar-widget/</link>
		<comments>http://www.javawiki.org/2006_04_10/a-swt-calendar-widget/#comments</comments>
		<pubDate>Mon, 10 Apr 2006 19:57:08 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>SWT</category>
		<guid isPermaLink="false">http://www.javawiki.org/2006_04_10/a-swt-calendar-widget/</guid>
		<description><![CDATA[Today I want to show how to use of the open-source project SWT-Calendar. With a few lines of code you can implement a wonderful small calendar widget for SWT, that is not delivered by default.
I&#8217;ve written a tiny RCP where you can select a date.

If you click on the text-field you can edit and save [...]]]></description>
			<content:encoded><![CDATA[<p>Today I want to show how to use of the open-source project <a title="SWTCalendar HomePage" href="http://swtcalendar.sourceforge.net/">SWT-Calendar</a>. With a few lines of code you can implement a wonderful small calendar widget for SWT, that is not delivered by default.</p>
<p>I&#8217;ve written a tiny RCP where you can select a date.</p>
<p><img id="image15" alt="Calendar RCP" src="http://www.javawiki.org/wp-content/uploads/2006/04/calendar_full.png" /><br />
If you click on the text-field you can edit and save a date. This dialog is very easy to integrate in your RCP, will preselect the date of the text-field and will solve all your problems with the missing calendar-widget. <img src='http://www.javawiki.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<img id="image17" alt="The Calendar Dialog" src="http://www.javawiki.org/wp-content/uploads/2006/04/calendar_dialog.png" /></p>
<p><strong>Downloads</strong><br />
<img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a id="p18" href="http://www.javawiki.org/wp-content/uploads/2006/04/org.javawiki.calendar.zip">Download the Calendar-Demo as Plug-In (Source included - 56kByte)<br />
<img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> </a><a id="p19" href="http://www.javawiki.org/wp-content/uploads/2006/04/org.javawiki.calendar_rcp.zip">Download the Calendar-Demo as RCO (Source inluded - 6,2Mbyte)</a><a id="p18" href="http://www.javawiki.org/wp-content/uploads/2006/04/org.javawiki.calendar.zip"><br />
</a><br />
<a id="p19" href="http://www.javawiki.org/wp-content/uploads/2006/04/org.javawiki.calendar_rcp.zip" />
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_04_10/a-swt-calendar-widget/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Getting rid of &#8220;Convert Line Delimiters to&#8221;</title>
		<link>http://www.javawiki.org/2006_03_20/getting-rid-of-convert-line-delimiters-to/</link>
		<comments>http://www.javawiki.org/2006_03_20/getting-rid-of-convert-line-delimiters-to/#comments</comments>
		<pubDate>Mon, 20 Mar 2006 19:57:09 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Uncategorized</category>
	<category>RCP</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=14</guid>
		<description><![CDATA[If you're having dependencies to org.eclipse.ui.ide and you launch your RCP you'll automatically get an entry in the menu-bar that is called "Convert Line Delimiters to" and also "Last Edit Location", although you don't need it. To remove this entries place the following lines in your ApplicationActionBarAdvisor

PLAIN TEXT
JAVA:




&#160;


ActionSetRegistry reg = WorkbenchPlugin.getDefault&#40;&#41;.getActionSetRegistry&#40;&#41;;


IActionSetDescriptor&#91;&#93; actionSets = reg.getActionSets&#40;&#41;;


// removing [...]]]></description>
			<content:encoded><![CDATA[<p>If you're having dependencies to <code>org.eclipse.ui.ide</code> and you launch your RCP you'll automatically get an entry in the menu-bar that is called "Convert Line Delimiters to" and also "Last Edit Location", although you don't need it. To remove this entries place the following lines in your <code>ApplicationActionBarAdvisor<br />
</code><br />
<div class="igBar"><a href="javascript:showCodeTxt('java-2');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-2">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">ActionSetRegistry reg = WorkbenchPlugin.<span style="color: #006600;">getDefault</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getActionSetRegistry</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">IActionSetDescriptor<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> actionSets = reg.<span style="color: #006600;">getActionSets</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// removing annoying gotoLastPosition Message.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> actionSetId = <span style="color: #ff0000;">"org.eclipse.ui.edit.text.actionSet.navigation"</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color:#800000;">0</span>; i &lt;actionSets.<span style="color: #006600;">length</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">getId</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">equals</span><span style="color:#006600; font-weight:bold;">&#40;</span>actionSetId<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; continue;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; IExtension ext = actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">getConfigurationElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #006600;">getDeclaringExtension</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; reg.<span style="color: #006600;">removeExtension</span><span style="color:#006600; font-weight:bold;">&#40;</span>ext, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Removing convert line delimiters menu.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">actionSetId = <span style="color: #ff0000;">"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color:#800000;">0</span>; i &lt;actionSets.<span style="color: #006600;">length</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">getId</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">equals</span><span style="color:#006600; font-weight:bold;">&#40;</span>actionSetId<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; continue;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; IExtension ext = actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">getConfigurationElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #006600;">getDeclaringExtension</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; reg.<span style="color: #006600;">removeExtension</span><span style="color:#006600; font-weight:bold;">&#40;</span>ext, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> actionSets<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_20/getting-rid-of-convert-line-delimiters-to/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>JRE-Bundling with the Look &#038; Feel of the current XP-Theme</title>
		<link>http://www.javawiki.org/2006_03_19/jre-bundling-with-the-look-feel-of-the-current-xp-theme/</link>
		<comments>http://www.javawiki.org/2006_03_19/jre-bundling-with-the-look-feel-of-the-current-xp-theme/#comments</comments>
		<pubDate>Sun, 19 Mar 2006 17:19:33 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>RCP</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=13</guid>
		<description><![CDATA[It is always recommended to deliver a JRE with your Eclipse-Product, because it has tow major advantages.

The client needn't to install java (probably he doesn't have the rights or the competence).
You can be sure that all your clients use the same version and vendor of the vm.

But theres also a great advantage: Sun doesn't provide [...]]]></description>
			<content:encoded><![CDATA[<p>It is always recommended to deliver a JRE with your Eclipse-Product, because it has tow major advantages.</p>
<ol>
<li>The client needn't to install java (probably he doesn't have the rights or the competence).</li>
<li>You can be sure that all your clients use the same version and vendor of the vm.</li>
</ol>
<p>But theres also a great advantage: Sun doesn't provide by default a manifest-file for displaying the widgets in the current theme of your operating-system (see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178745">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178745</a>), but uses the default look&#038;feel of Windows. To fix this you need to the <code>javaw.exe.manifest</code>, located in your <code>org.eclipse.swt.win32.win32.x86_x.y.z.jar</code>-Plugin Package.</p>
<p>To bundle your VM, just create a folder "jre" in your [Eclipse-Root]-Directory copy the vm, take the Manifest-file and copy it to <code>[Eclipse-Root]/jre/bin</code>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_19/jre-bundling-with-the-look-feel-of-the-current-xp-theme/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Enhancing the Combo-Widget with Images</title>
		<link>http://www.javawiki.org/2006_03_03/enhancing-the-combo-widget-with-images/</link>
		<comments>http://www.javawiki.org/2006_03_03/enhancing-the-combo-widget-with-images/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 23:32:14 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>SWT</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=12</guid>
		<description><![CDATA[Probably you was already faced with the requirement to add small icons to your pulldowns. That looks very nice, but unfortunately there is no common SWT-Widget to realize this.
Fortunately the Eclipse-Framework is OpenSource and we can reprodruce the structure of a SWT-ComboBox. A Combo is not more than a text-field and a small button with an arrow. In addition is a event-handler implemented that shows a Composite as a tooltip with the entries of the "combo-list". We just have to take this class and change the structure of the content. We don't want to have a org.eclipse.swt.widgets.List, but a org.eclipse.swt.widgets.Table with multiple org.eclipse.swt.widgets.TableItems where you can specify an image...]]></description>
			<content:encoded><![CDATA[<p>Probably you was already faced with the requirement to add small icons to your pulldowns. That looks very nice, but unfortunately there is no common SWT-Widget to realize this.<br />
Fortunately the Eclipse-Framework is OpenSource and we can reprodruce the structure of a SWT-ComboBox. A Combo is not more than a text-field and a small button with an arrow. In addition is a event-handler implemented that shows a Composite as a tooltip with the entries of the "combo-list". We just have to take this class and change the structure of the content. We don't want to have a <code>org.eclipse.swt.widgets.List</code>, but a <code>org.eclipse.swt.widgets.Table</code> with multiple <code>org.eclipse.swt.widgets.TableItem</code>s where you can specify an image. After adjusting the access-methods we have a new cool Widget, that has the same structure and methods like the "built-in"s. <img src='http://www.javawiki.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Screenshot</h3>
<p><img alt="The ImageCombo in Action (as Widget in a JFace-Dialog)" src="http://www.javawiki.org/wp-content/image_combo.png" /><br />
The ImageCombo in Action (as Widget in a JFace-Dialog).</p>
<h3>Usage</h3>
<ul>
<li><img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a style="cursor: url('chrome://targetalert/content/skin/duke.png')" title="Download the JavaFile and copy it into your Java-Project." href="http://www.javawiki.org/wp-content/ImageCombo.java">Download the JavaFile and copy it into your Java-Project.</a></li>
<li>Reference the Widget like all the other ones.</li>
</ul>
<h3 />
<h3>Update</h3>
<ul>
<li><img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a title="Download the file and copy it to your project." style="cursor: url('chrome://targetalert/content/skin/duke.png')" href="http://www.javawiki.org/wp-content/ImageCombo_GTK.java">ImageCombo.java with Corrections for GTK</a> (Thanks to Jeremy Dowdall)<a title="Download the JavaFile and copy it into your Java-Project." href="http://www.javawiki.org/wp-content/ImageCombo_GTK.java"><br />
</a></li>
</ul>
<h3>Code-Example</h3>
<p>The following snippet show the usage in a very simple JFace-Dialog.</p>
<div class="igBar"><a href="javascript:showCodeTxt('java-3');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-3">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Very Simple Dialog with {@link org.eclipse.swt.widgets.Label}</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* and a Combo that has the capability to show also icons.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @author Tom Seidel</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleDialog <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=allinurl%3ADialog+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Dialog</span></a> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AList+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">List</span></a> list;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param parentShell</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param list</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">protected</span> SimpleDialog<span style="color:#006600; font-weight:bold;">&#40;</span>Shell parentShell, <a href="http://www.google.com/search?q=allinurl%3AList+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">List</span></a> list<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">super<span style="color:#006600; font-weight:bold;">&#40;</span>parentShell<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">list</span> = list;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* (non-Javadoc)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">protected</span> <a href="http://www.google.com/search?q=allinurl%3AControl+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Control</span></a> createDialogArea<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AComposite+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Composite</span></a> parent<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AComposite+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Composite</span></a> comp = <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AComposite+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Composite</span></a><span style="color:#006600; font-weight:bold;">&#41;</span> super.<span style="color: #006600;">createDialogArea</span><span style="color:#006600; font-weight:bold;">&#40;</span>parent<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">comp.<span style="color: #006600;">setLayout</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AGridLayout+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">GridLayout</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">2</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ALabel+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Label</span></a> textLabel = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ALabel+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>comp,SWT.<span style="color: #006600;">NONE</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">GridData gd = <span style="color: #000000; font-weight: bold;">new</span> GridData<span style="color:#006600; font-weight:bold;">&#40;</span>SWT.<span style="color: #006600;">BEGINNING</span>, SWT.<span style="color: #006600;">CENTER</span>, <span style="color: #000000; font-weight: bold;">false</span>,false<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">gd.<span style="color: #006600;">widthHint</span> = <span style="color:#800000;">80</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">textLabel.<span style="color: #006600;">setLayoutData</span><span style="color:#006600; font-weight:bold;">&#40;</span>gd<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">textLabel.<span style="color: #006600;">setText</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Your choice:"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">ImageCombo combo = <span style="color: #000000; font-weight: bold;">new</span> ImageCombo<span style="color:#006600; font-weight:bold;">&#40;</span>comp, SWT.<span style="color: #006600;">READ_ONLY</span> | SWT.<span style="color: #006600;">BORDER</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AIterator+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Iterator</span></a> iter = <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">list</span>.<span style="color: #006600;">iterator</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span>iter.<span style="color: #006600;">hasNext</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">AbstractBaseElement element = <span style="color:#006600; font-weight:bold;">&#40;</span>AbstractBaseElement<span style="color:#006600; font-weight:bold;">&#41;</span> iter.<span style="color: #006600;">next</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// add text and image to the combo.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">combo.<span style="color: #006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span>element.<span style="color: #006600;">getId</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,ImagecontributionPlugin.<span style="color: #006600;">getDefault</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #006600;">getImage</span><span style="color:#006600; font-weight:bold;">&#40;</span>ImageContributor.<span style="color: #006600;">getImageIdByObject</span><span style="color:#006600; font-weight:bold;">&#40;</span>element<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">combo.<span style="color: #006600;">setLayoutData</span><span style="color:#006600; font-weight:bold;">&#40;</span>gd<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> comp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_03/enhancing-the-combo-widget-with-images/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Best-Practice: Developing a Model-Based Editor - Editor-Implementation</title>
		<link>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-implementation/</link>
		<comments>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-implementation/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 23:10:59 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Editors</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=11</guid>
		<description><![CDATA[Developing a Model-Based Editor - TOC

Intro
Preparation
Editor-Inputs
Editor-Implementation

TBD

]]></description>
			<content:encoded><![CDATA[<h3>Developing a Model-Based Editor - TOC</h3>
<ol>
<li><a href="http://www.javawiki.org/?p=8">Intro</a></li>
<li><a href="http://www.javawiki.org/?p=9">Preparation</a></li>
<li><a href="http://www.javawiki.org/?p=10">Editor-Inputs</a></li>
<li><strong><a href="http://www.javawiki.org/?p=11">Editor-Implementation</a></strong><strong></strong></li>
</ol>
<p>TBD
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-implementation/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Best-Practice: Developing a Model-Based Editor - Editor-Inputs</title>
		<link>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-inputs/</link>
		<comments>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-inputs/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 23:08:11 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Editors</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=10</guid>
		<description><![CDATA[Developing a Model-Based Editor - TOC

Intro
Preparation
Editor-Inputs
Editor-Implementation

TBD

]]></description>
			<content:encoded><![CDATA[<h3>Developing a Model-Based Editor - TOC</h3>
<ol>
<li><a href="http://www.javawiki.org/?p=8">Intro</a></li>
<li><a href="http://www.javawiki.org/?p=9">Preparation</a></li>
<li><strong><a href="http://www.javawiki.org/?p=10">Editor-Inputs</a></strong></li>
<li><a href="http://www.javawiki.org/?p=11">Editor-Implementation</a></li>
</ol>
<p>TBD
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_03/best-practice-developing-a-model-based-editor-editor-inputs/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Best-Practice: Developing a Model-Based Editor - Preparation</title>
		<link>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-preparation/</link>
		<comments>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-preparation/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 00:55:25 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Editors</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=9</guid>
		<description><![CDATA[In our example we want to provide an simple editor for the object org.javawiki.model.SubProcess and a MultiPageEditor with two pages for the object org.javawiki.model.Step. At first we define the extension points. The assignment which object-signature is linked with a special editor is realized in the EditorContributor. This class knows the correct editor-id (specified in your plugin.xml) to a special Object.]]></description>
			<content:encoded><![CDATA[<h3>Developing a Model-Based Editor - TOC</h3>
<ol>
<li><a href="http://www.javawiki.org/?p=8">Intro</a></li>
<li><strong><a href="http://www.javawiki.org/?p=9">Preparation</a></strong></li>
<li><a href="http://www.javawiki.org/?p=10">Editor-Inputs</a></li>
<li><a href="http://www.javawiki.org/?p=11">Editor-Implementation</a></li>
</ol>
<p>The following describes the basics of creating editors.</p>
<h3>Declaring the extension-point</h3>
<p>In our example we want to provide an simple editor for the object <code>org.javawiki.model.SubProcess</code> and a MultiPageEditor with two pages for the object <code>org.javawiki.model.Step</code>. At first we define the extension points.</p>
<div class="igBar"><a href="javascript:showCodeTxt('xml-4');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">XML:</span><br />
<div id="xml-4">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">contributorClass=&quot;org.javawiki.editors.ProcessEditorContributor&quot;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">default=&quot;false&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">extensions=&quot;step&quot;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">icon=&quot;icons/sample.gif&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">id=&quot;org.javawiki.editors.StepEditor&quot;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">name=&quot;StepEditor&quot;/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">contributorClass=&quot;org.javawiki.editors.ProcessEditorContributor&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">default=&quot;false&quot;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">extensions=&quot;subp&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">icon=&quot;icons/sample.gif&quot;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">id=&quot;org.javawiki.editors.parts.SubProcessEditor&quot;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">name=&quot;SubProcessEditor&quot;/&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Declaration in the <code>plugin.xml</code></p>
<h3>Managing the Object-Editor-Mapping</h3>
<p>The assignment which object-signature is linked with a special editor is realized in the <code>EditorContributor</code>. This class knows the correct editor-id (specified in your plugin.xml) to a special Object.</p>
<div class="igBar"><a href="javascript:showCodeTxt('java-5');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-5">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> STEP_EDITOR_ID = <span style="color: #ff0000;">"org.javawiki.editors.StepEditor"</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> SUBPROCESS_EDITOR_ID = <span style="color: #ff0000;">"org.javawiki.editors.parts.SubProcessEditor"</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">static</span> <a href="http://www.google.com/search?q=allinurl%3AMap+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Map</span></a> editorMapping;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">static</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">editorMapping = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AHashMap+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">HashMap</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">editorMapping.<span style="color: #006600;">put</span><span style="color:#006600; font-weight:bold;">&#40;</span>Step.<span style="color: #006600;">class</span>,STEP_EDITOR_ID<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">editorMapping.<span style="color: #006600;">put</span><span style="color:#006600; font-weight:bold;">&#40;</span>SubProcess.<span style="color: #006600;">class</span>,SUBPROCESS_EDITOR_ID<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Returns the correct editor id by the given</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* class-signature</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param clazz the class of the object that will be</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* edited with an Editor</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @return the editor-id definded in the &lt;code&gt;plugin.xml&lt;/code&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getEditorIdByClass<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> clazz<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color:#006600; font-weight:bold;">&#41;</span> editorMapping.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>clazz<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<h3>Open programmatically an editor</h3>
<p>The command for opening an editor is:</p>
<div class="igBar"><a href="javascript:showCodeTxt('java-6');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-6">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">PlatformUI.<span style="color: #006600;">getWorkbench</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getActiveWorkbenchWindow</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getActivePage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">openEditor</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">myEditorInput,<span style="color: #ff0000;">"editor.id.specified.in.plugin.xml"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>In the Best-Practice example we wrote a wrapper for opening an editor, the <code>ResourceHandler</code>, that has a Method #openEditor(final AbstractBaseElement model) and a method for checking if the model is already represented by an open editor #getEditorIndex(IEditorInput input)</p>
<h3>Open the editor on doubleClick on an item in the JFace-Viewer</h3>
<p>Just add an <code>IDoubleClickListener</code> and call the <code>ResourceHandler</code></p>
<div class="igBar"><a href="javascript:showCodeTxt('java-7');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-7">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">viewer</span>.<span style="color: #006600;">addDoubleClickListener</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> IDoubleClickListener<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> doubleClick<span style="color:#006600; font-weight:bold;">&#40;</span>DoubleClickEvent event<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">ResourceHandler.<span style="color: #006600;">getDefault</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">openEditor</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#40;</span>AbstractBaseElement<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>IStructuredSelection<span style="color:#006600; font-weight:bold;">&#41;</span> event.<span style="color: #006600;">getSelection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getFirstElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<h3>Conclusion</h3>
<p>OK, what do we have? - We have two editors defined (without any implementation),  the assignment from editor to model-object and  the capability to open an editor on double-click on an elemnt in the JFace-Viewer. Now only the editors are missing.</p>
<p>Let's take the rest!!!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-preparation/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Best-Practice:  Developing a Model-Based Editor - Intro</title>
		<link>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-intro/</link>
		<comments>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-intro/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 00:50:40 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Editors</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=8</guid>
		<description><![CDATA[A very important element of the Eclipse-Framework are editors. Editors are among views the fundamental element for user-interaction.
Eclipse provides a wonderful framework for creating editors with a reserved area (the "editor area"), where you don't have to care for common behaviour. Just implement the contribution of the input and provide an implementation for saving the edited input...]]></description>
			<content:encoded><![CDATA[<h3>Developing a Model-Based Editor - TOC</h3>
<ol>
<li><strong><a href="http://www.javawiki.org/?p=8">Intro</a></strong></li>
<li><a href="http://www.javawiki.org/?p=9">Preparation</a></li>
<li><a href="http://www.javawiki.org/?p=10">Editor-Inputs</a></li>
<li><a href="http://www.javawiki.org/?p=11">Editor-Implementation</a></li>
</ol>
<p>A very important element of the Eclipse-Framework are editors.  Editors are among views the fundamental element for user-interaction.<br />
Eclipse provides a wonderful framework for creating editors with a reserved area (the "editor area"), where you don't have to care for common behaviour. Just implement the contribution of the input and provide an implementation for saving the edited input.</p>
<h3>What's the goal of this article?</h3>
<p>In the most articles and books is described how to implement an editor for editing a file with a special extension that exists physically in the workspace. But what if you want to use all the functionality the editor comes with, without writing or reading any files, but just pure Java-objects? I want to show you a way how to use in a very easy and clear way how to use simple <code>EditorPart</code>s and <code>MultiPageEditorPart</code>s with <code>Form</code>s. In addition I want to provide a strategy for managing your editors. At the end will be a eclipse-product, that has a simple view-part with a list (known from the Image-Contribution Product) . If you double-click on a list the object-specified editor will be opened and display the properties of the object, without all the workspace, file and project handling.</p>
<h3>Requirements</h3>
<ul>
<li>Every Object can be handled with an editor</li>
<li>The Icon will be contributed by the <a href="http://www.javawiki.org/?p=6">ImageContributor</a></li>
<li>The framework knows the objects that were already "opened" by an editor.</li>
<li>A very easy way to provide new editors for new Java-Objects</li>
<li>Saving with the given "Dirty-Flag"</li>
</ul>
<h3>Screenshot of the Application</h3>
<p><img alt="The editor application with different open editors, based on the double-clicked java-object in the ViewPart on the left." src="http://www.javawiki.org/wp-content/editor_application.png" /><br />
Screenshot of the ready-to-use application</p>
<p><strong>Let's roll!!!</strong></p>
<p><img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a title="Download the required plugins as Eclipse-Projects (Source included)" href="http://www.javawiki.org/wp-content/org.javawiki.editors.zip">Download the required plugins as Eclipse-Projects (Source included)</a><br />
<img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a title="Download the Editors-Best-Practice as RCP (Source included)" href="http://www.javawiki.org/wp-content/org.javawiki.editors_rcp.zip">Download the Editors-Best-Practice as RCP (Source included)</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_03_02/best-practice-developing-a-model-based-editor-intro/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Polish up your JFace-Viewer! Sorting a table</title>
		<link>http://www.javawiki.org/2006_01_18/tidy-up-your-jface-viewer-sorting-a-table/</link>
		<comments>http://www.javawiki.org/2006_01_18/tidy-up-your-jface-viewer-sorting-a-table/#comments</comments>
		<pubDate>Wed, 18 Jan 2006 01:38:18 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>JFace</category>
		<guid isPermaLink="false">http://www.javawiki.org/?p=7</guid>
		<description><![CDATA[Today I want to show how to add a sorter to your JFace-Table. The requirement is to sort descending und ascending by clicking on the TableColumn-Header. JFace already provides sorting-functionality. We just have to provide something like an alogrithm to arrange the items. For that we implemented the CollectionSorter that uses the default Collator from ViewerSorter...]]></description>
			<content:encoded><![CDATA[<p>Today I want to show how to add a sorter to your JFace-Table. The requirement is to sort descending und ascending by clicking on the TableColumn-Header.</p>
<p><img alt="The Viewer with an inital Sorting (Column ID)" src="http://www.javawiki.org/wp-content/table_sorter_initalize.png" /><br />
The inital view with sorting</p>
<p><img alt="The ascending sorting after a click on the ID-Column header" src="http://www.javawiki.org/wp-content/table_sorter_reverse.png" /><br />
The ascending sorting after a click on the ID-Column header.</p>
<p>JFace already provides sorting-functionality. We just have to provide something like an alogrithm to arrange the items. For that we implemented the <code>CollectionSorter</code> that uses the default Collator from <code>ViewerSorter</code>. Now look at the Sorter:</p>
<p>Initializing the Sorter with a default column</p>
<div class="igBar"><a href="javascript:showCodeTxt('java-8');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span><br />
<div id="java-8">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CollationSorter <span style="color: #000000; font-weight: bold;">extends</span> ViewerSorter <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AMap+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Map</span></a> sortMap = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AHashMap+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">HashMap</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Creates an instance of the sorter</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param tc0 the default sorter-column.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> CollationSorter<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ATableColumn+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">TableColumn</span></a> defaultColumn<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">setCurrentColumn<span style="color:#006600; font-weight:bold;">&#40;</span>defaultColumn<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Pushs the current sortorder in a map which key is the</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* table-column.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param column</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> pushSortCriteria<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ATableColumn+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">TableColumn</span></a> column<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>column<span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">put</span><span style="color:#006600; font-weight:bold;">&#40;</span>column,<span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">boolean</span> newSort = !<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>column<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">booleanValue</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">put</span><span style="color:#006600; font-weight:bold;">&#40;</span>column,<span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>newSort<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Asks for the current sort-order and inverts the sort-order</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param column the requested column</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @return true if the sortIndex is descending, else false.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> isDescending<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ATableColumn+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">TableColumn</span></a> column<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">boolean</span> returnValue = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>column<span style="color:#006600; font-weight:bold;">&#41;</span> != <span style="color: #000000; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">returnValue = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">sortMap</span>.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>column<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">booleanValue</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">pushSortCriteria<span style="color:#006600; font-weight:bold;">&#40;</span>column<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> returnValue;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3ATableColumn+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">TableColumn</span></a> currentColumn = <span style="color: #000000; font-weight: bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* (non-Javadoc)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @see org.eclipse.jface.viewers.ViewerSorter#getCollator()</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">int</span> compare<span style="color:#006600; font-weight:bold;">&#40;</span>Viewer viewer, <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> obj1, <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> obj2<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> rc = -<span style="color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// get the data</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">AbstractBaseElement data1 = <span style="color:#006600; font-weight:bold;">&#40;</span>AbstractBaseElement<span style="color:#006600; font-weight:bold;">&#41;</span> obj1;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">AbstractBaseElement data2 = <span style="color:#006600; font-weight:bold;">&#40;</span>AbstractBaseElement<span style="color:#006600; font-weight:bold;">&#41;</span> obj2;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ACollationKey+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">CollationKey</span></a> key1 = <span style="color: #000000; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ACollationKey+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">CollationKey</span></a> key2 = <span style="color: #000000; font-weight: bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">currentColumn</span> == <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>TableViewer<span style="color:#006600; font-weight:bold;">&#41;</span>viewer<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getTable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key1 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data1.<span style="color: #006600;">getId</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key2 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data2.<span style="color: #006600;">getId</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">currentColumn</span> == <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>TableViewer<span style="color:#006600; font-weight:bold;">&#41;</span>viewer<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getTable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key1 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data1.<span style="color: #006600;">getName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key2 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data2.<span style="color: #006600;">getName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">currentColumn</span> == <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>TableViewer<span style="color:#006600; font-weight:bold;">&#41;</span>viewer<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getTable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key1 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data1.<span style="color: #006600;">getDescription</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key2 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span>data2.<span style="color: #006600;">getDescription</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// replace null-strings with empty-strings</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>key1 == <span style="color: #000000; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key1 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">""</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>key2 == <span style="color: #000000; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">key2 = getCollator<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">getCollationKey</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">""</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #808080; font-style: italic;">//$NON-NLS-1$</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>isDescending<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">currentColumn</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rc = key1.<span style="color: #006600;">compareTo</span><span style="color:#006600; font-weight:bold;">&#40;</span>key2<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rc = key2.<span style="color: #006600;">compareTo</span><span style="color:#006600; font-weight:bold;">&#40;</span>key1<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> rc;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* Sets the sort column.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">* @param currentColumn The currentColumn to set.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setCurrentColumn<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ATableColumn+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">TableColumn</span></a> currentColumn<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">currentColumn</span>&nbsp; = currentColumn;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">pushSortCriteria<span style="color:#006600; font-weight:bold;">&#40;</span>currentColumn<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>This sorter you can use everywhere, you just have to modify the Creation of the Collator-Keys.</p>
<p><strong>Direction Indicator</strong><br />
This feature will be aviable in <a href="http://download.eclipse.org/eclipse/downloads/drops/S-3.2M1-200508111530/eclipse-news-M1.html">Eclipse 3.2 </a></p>
<p><img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a title="JFace TableSorter Plugin" href="http://www.javawiki.org/wp-content/org.javawiki.tablesort.zip">Download the JFace TableSorter Plugin</a> (Requires <a href="http://www.javawiki.org/?p=5">Model-Plugin</a>)<br />
<img src="http://www.javawiki.org/wp-content/importjar_wiz.png" /> <a title="JFace TableSorter RCP (source included)" href="http://www.javawiki.org/wp-content/org.javawiki.tablesort_rcp.zip">Download the JFace TableSorter RCP (source included)</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.javawiki.org/2006_01_18/tidy-up-your-jface-viewer-sorting-a-table/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
