﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-罗明的博客-随笔分类-Eclipse</title><link>http://www.blogjava.net/Andyluo/category/1762.html</link><description>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;font color="blue"&gt;锻炼身体、提升技能、修身养性&lt;/font&gt;&lt;br&gt;
讨论Eclipse, Java, Linux, Google产品&lt;br&gt;
&lt;/td&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-9685945790422740";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description><language>zh-cn</language><lastBuildDate>Fri, 29 Jun 2007 21:26:10 GMT</lastBuildDate><pubDate>Fri, 29 Jun 2007 21:26:10 GMT</pubDate><ttl>60</ttl><item><title>OSGi框架规范第4版 之 简要介绍</title><link>http://www.blogjava.net/Andyluo/archive/2007/06/29/OSGi_Introduction.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 29 Jun 2007 06:18:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2007/06/29/OSGi_Introduction.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/127065.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2007/06/29/OSGi_Introduction.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/127065.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/127065.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Eclipse从3.0版本开始采用基于OSGi的插件体系结构。这篇文章简要介绍OSGi框架的功能架构。OSGi框架是OSGi服务平台规范的核心部分。该框架提供了一个大众化，安全，可管理的平台，可以支持可扩展可下载应用插件的部署，我们称这些应用插件为Bundle。&nbsp;&nbsp;<a href='http://www.blogjava.net/Andyluo/archive/2007/06/29/OSGi_Introduction.html'>阅读全文</a><img src ="http://www.blogjava.net/Andyluo/aggbug/127065.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2007-06-29 14:18 <a href="http://www.blogjava.net/Andyluo/archive/2007/06/29/OSGi_Introduction.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse WTP的Bug？</title><link>http://www.blogjava.net/Andyluo/archive/2006/04/18/41588.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Tue, 18 Apr 2006 02:10:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2006/04/18/41588.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/41588.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2006/04/18/41588.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/41588.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/41588.html</trackback:ping><description><![CDATA[
		<p>昨天看了IBM <a class="" title="" href="http://www.ibm.com/developerworks/cn/" target="_blank">Developerworks</a>上一篇介绍WTP的<a class="" title="Eclipse Web 工具平台 V1.0 简介" href="https://service2.boulder.ibm.com/developerworks/cn/education/opensource/os-ecl-wtp/index.html" target="_blank">教程</a>，对照着使用WTP1.0完成一个J2EE示例书签应用程序，服务器使用<a class="" title="" href="http://www.jboss.com" target="_blank">JBoss</a>，数据库用的是<a class="" title="" href="http://db.apache.org/derby" target="_blank">Derby</a>，Eclipse版本3.1.1。<br /><br />在新建JBoss Server时，因为本机上已有Tomcat占用了8080端口（未启动），所以将监听端口由默认的8080改成了8081，结果运行服务器后：JBoss进程明明正常启动（根据Console得出），但WTP的Servers视图却提示“Timeout waiting for JBOSS 3.2.3 to start. Server did not start after 50000s”，服务器的状态也显示Stopped。但改成默认的8080就一切正常。怎么能出这种问题呢？难道WTP就是通过查询8080有没有JBoss在监听，从而判断JBoss是否启动成功？强烈怀疑这是一个Bug，不知道在最新版Eclipse和WTP改过来没有<img height="19" src="http://www.blogjava.net/Emoticons/confused_smile.gif" width="19" border="0" /><br /><br /><strong>PS</strong>: 用老版的Eclipse3.1.1来开发也是迫不得已，本来已安装了<a class="" title="" href="http://www.eclipse.org/projects/callisto.php" target="_blank">Callisto</a>最新<strong>完整</strong>版（Eclipse3.2M5），但在J2EE透视图中就是看不到EJB项目分类，新建EJB项目也抛出若干个异常，看Log发现是JFace插件里抛出了NullPointerException，总之是做不下去了，不知道这样的Callisto怎么会算MileStone，: (<br /><br />那个50000s应该是50000ms吧，50000s可是13时53分啊！^_^</p>
<img src ="http://www.blogjava.net/Andyluo/aggbug/41588.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2006-04-18 10:10 <a href="http://www.blogjava.net/Andyluo/archive/2006/04/18/41588.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse BIRT报表不能预览的解决办法</title><link>http://www.blogjava.net/Andyluo/archive/2006/04/09/40113.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Sun, 09 Apr 2006 10:44:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2006/04/09/40113.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/40113.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2006/04/09/40113.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/40113.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/40113.html</trackback:ping><description><![CDATA[
		<p>预览报表时提示无法显示网页，查看D:\eclipse\workspace\.metadata\.log文件后发现错误：<br />!MESSAGE <strong>Exception occurred starting the embedded application server.<br /></strong>!STACK 0<br />org.apache.commons.logging.LogConfigurationException: <br />org.apache.commons.logging.LogConfigurationException: <br />org.apache.commons.logging.LogConfigurationException: <br />     <strong>Class org.apache.commons.logging.impl.Log4JLogger does not implement Log<br /></strong>...<br /><br />搜索plugins目录下的log文件，发现既有Log4j又有CommonsLogging，将plugins目录下的org.apache.jakarta_log4j_logging_version.jar移出Eclipse目录（移出Classpath），重启动Eclipse，就可以预览了。<br /><br />其他Web服务器不能启动（如Eclipse的Help打不开，JBoss提示上述Log异常）的错误也可以参照以上方法解决。</p>
<img src ="http://www.blogjava.net/Andyluo/aggbug/40113.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2006-04-09 18:44 <a href="http://www.blogjava.net/Andyluo/archive/2006/04/09/40113.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[备份from blueline]Keyboard driven Eclipse [Terse Systems](zz)</title><link>http://www.blogjava.net/Andyluo/archive/2006/02/16/31012.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Feb 2006 06:09:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2006/02/16/31012.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/31012.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2006/02/16/31012.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/31012.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/31012.html</trackback:ping><description><![CDATA[<P>I had to get obsessed with keyboard shortcuts when using IDEA. <BR>Apparently some of that must have rubbed off, because <BR>lately I've been looking for shortcuts to methods and classes in Eclipse 3.0.</P>
<P>There are two traversal shortcuts I use all the time: Ctrl-O and Ctrl-T.</P>
<P>Ctrl-O shows the methods of the class in the current editor in a popup. <BR>Hit Ctrl-O when the popup is up, and you'll see all the inherited <BR>methods as well. This is incredibly useful, as it allows me to bounce <BR>between methods even when I'm not sure which class is implementing <BR>which method. </P>
<P>Ctrl-T shows the type hierarchy of a selected type in a popup. This is the <BR>complement to Ctrl-O. When I'm sure of what <BR>interface I'm looking at, but I really want to pick a particular implementation <BR>and want to go trawling through that <BR>implementation for a bit, Ctrl-T will show me all the subclasses or <BR>implementors for that type.</P>
<P>There is a third option which I haven't used much. Ctrl-F3 shows the <BR>methods of a selected type in a popup. I can see how this can be useful, <BR>but in practice I have a pretty good idea of which methods are attached<BR>&nbsp;to which classes and Ctrl-Space fills most of my needs there.</P>
<P>However, I have been missing a couple of things. These are the shortcuts <BR>I just found recently, and are very good for hitting up random files:</P>
<P>Ctrl-E shows a popup list of all the open files.<BR>Ctrl-Shift-T creates a dialog box that you can use to navigate to any class.<BR>Ctrl-Shift-R creates a dialog box that shows any resource in the project <BR>(basically any file.)<BR>Alternately, there's an Eclipse plugin called <A href="http://www.muermann.org/gotofile/">GotoFile</A> which seems to behave <BR>a little more "IDEAish".</P>
<P>Finally, I found a plugin which actually integrates Eclipse with Windows! <BR><A href="http://opensource.trajano.net/">Eclipse Platform Extensions</A> is actually functional and useful, although <BR>you wouldn't guess it by looking at the website. Although it says that <BR>it provides a "System GC" functionality, it actually does far more, <BR>like provide a "Open in Windows Explorer" and <BR>"Open Command Window here" dialog to the Package Explorer.</P><img src ="http://www.blogjava.net/Andyluo/aggbug/31012.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2006-02-16 14:09 <a href="http://www.blogjava.net/Andyluo/archive/2006/02/16/31012.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[备份from blueline]Installing the help system as an infocenter</title><link>http://www.blogjava.net/Andyluo/archive/2006/02/16/31011.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Feb 2006 06:08:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2006/02/16/31011.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/31011.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2006/02/16/31011.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/31011.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/31011.html</trackback:ping><description><![CDATA[<H1>Installing the help system as an infocenter</H1>
<P>You can allow your users to access the help system over the Internet or an intranet, by <BR>installing the infocenter and the documentation plug-ins on a server. Clients view help <BR>by navigating to a URL, and the help system is shown in their web browser. The <BR>infocenter help system can be used both for client applications and for web <BR>applications, either of which can have their help accessed remotely. All features <BR>of help system except infopops and active help are supported. </P>
<P>The infocenter help system allows passing number of options that can be used to <BR>customize various aspects of the infocenter. The following options are supported:</P>
<UL>
<LI><B>-eclipsehome</B> <I>eclipseInstallPath</I> - specifies Eclipse installation directory. <BR>This directory is a parent to "plugins" directory and eclipse executable. <BR>The option must be provided, when current directory from which infocenter <BR>is launched, is not the same as Eclipse installation directory. 
<LI><B>-data</B> <I>instanceArea</I> - specifies a path that Eclipse can use to write instance data. <BR>The value can be an absolute path of a directory, or a path relative to Eclipse <BR>installation directory. The option must be provided when Eclipse is installed in <BR>the read only location, or has been customized to override osgi.instance.area <BR>or osgi.instance.area.default properties. 
<LI><B>-host</B> <I>helpServerHost</I> - specifies host name of the interface that help server <BR>will use. It overrides host name specified in the application server plugin preferences. 
<LI><B>-port</B> <I>helpServerPort</I> - specifies port number that help server will use. It overrides <BR>port number specified in the application server plugin preferences. 
<LI><B>-locales</B> <I>localeList</I> - specifies a list of locales that infocenter will recognize and <BR>provide a customized content for. If the option is not specified, infocenter will <BR>build navigation, and index documents for each preferred locale of the browsers <BR>accessing the infocenter. When the option is present, locales from browser <BR>requests will be matched with locales in the list. If browser preferred locale <BR>does not exist in the list, but its language part does, it will be used. Subsequently, <BR>additional browser locales in decreased order of preference will be matched <BR>against the list. If none of the browser locales (or its language part) matches any <BR>locale on the list, the client will be served content in the default locale - server <BR>locale or locale passed with -nl option. For example using options <PRE>-nl en -locales de en es fr it ja ko pt_BR zh_CN zh_TW</PRE>will cause infocenter operating in 10 locales. All other locales will receive content <BR>for en locale. 
<LI><B>-dir rtl</B> - sets right-to-left rendering direction of help UI in the browser. 
<LI><B>-noexec</B> - indicates that Eclipse executable should not be used. You may need to use <BR>this option when running on a platform for which Eclipse executable is not available. 
<LI>Additionally, most <A href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.platform.doc.user/tasks/running_eclipse.htm">options accepted by Eclipse executable</A> can be passed. They are <BR>especially useful during debugging and for applying customization to Eclipse. <BR>For example, passing options <PRE><EM><SPAN style="FONT-STYLE: normal">-vmargs -Xmx256M</SPAN></EM> </PRE>increases memory available to the infocenter and will allow serving a larger book collection. </LI></UL>
<H2><B>Installation/packaging</B></H2>
<P>These steps are for the help system integrator and are not meant to address all the possible scenarios.<BR>&nbsp;It is assumed that all your documentation is delivered as Eclipse plug-ins and, in general, you are <BR>familiar with the eclipse help system.</P>
<OL>
<LI>Download the Eclipse Platform Runtime Binary driver from <A href="http://www.eclipse.org/downloads/" target=_blank>www.eclipse.org</A>. 
<LI>Install (unzip) the driver in a directory, <VAR>d:\myApp</VAR>. This will create an eclipse sub-directory, <BR>d:\myApp\eclipse that contains the code required for the Eclipse platform <BR>(which includes the help system). </LI></OL>
<H2><B>How to start or stop infocenter from command line</B></H2>
<P>The org.eclipse.help.standalone.Infocenter class has a main method that you can use to <BR>launch infocenter from a command line. The command line arguments syntax is:</P><PRE><EM><SPAN style="FONT-STYLE: normal">-command start | shutdown | [-eclipsehome eclipseInstallPath] <BR>[-data instanceArea] [-host helpServerHost] [-locales localeList] <BR>[-port helpServerPort] [-dir rtl] [-noexec] [platform options] <BR>[-vmargs JavaVMarguments]</SPAN></EM></PRE>
<P>To start an infocenter on port 8081 issue a start command by running</P><PRE>java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_3.1.0.jar <BR>org.eclipse.help.standalone.Infocenter -command start -eclipsehome <BR>d:\myApp\eclipse -port 8081</PRE>
<P>To shut the infocenter down issue a shutdown command by running</P><PRE>java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_3.1.0.jar <BR>org.eclipse.help.standalone.Infocenter -command shutdown -eclipsehome <BR>d:\myApp\eclipse</PRE>
<H2>Using the infocenter</H2>
<P>Start the web server. Point a web browser to the path "help" web application running on a port <BR>specified when starting the infocenter.&nbsp; On the machine the infocenter is installed, this would be <BR>http://localhost:8081/help/. </P>
<H2><B>How to start or stop infocenter from Java</B></H2>
<P>When including infocenter as part of another application, it may be more convenient to start it <BR>and stop using Java APIs instead of using system commands. Follow the steps if it is the case:</P>
<OL>
<LI>Make sure <EM><SPAN style="FONT-STYLE: normal">d:\myApp\eclipse\plugins\org.eclipse.help.base_3.1.0.jar</SPAN></EM> is on your app classpath. <BR>The class you use to start, and shut down the infocenter isorg.eclipse.help.standalone.Infocenter. 
<LI>Create an array of String containing options that you want to pass to the infocenter. Typically,<BR>the eclipsehome and port options are needed. <PRE><EM><SPAN style="FONT-STYLE: normal">String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" ,<BR> "-port", "8081" };</SPAN></EM> </PRE>
<LI>In your application, create an instance of the Help class by passing the options.<PRE><EM><SPAN style="FONT-STYLE: normal">Infocenter infocenter = new Help(options);</SPAN></EM> </PRE>
<LI>To start the help system: <PRE><EM><SPAN style="FONT-STYLE: normal">helpSystem.start();</SPAN></EM></PRE>
<LI>
<P>To shut the infocenter down:</P><PRE><EM><SPAN style="FONT-STYLE: normal">helpSystem.shutdown();</SPAN></EM> </PRE></LI></OL>
<H2>Making infocenter available on the web</H2>
<P>Eclipse contains a complete infocenter and does not require other server software to run. <BR>However, in unsecure environment like Internet, it is recommended infocenter is not accessed <BR>directly by clients, but is made available through an HTTP server or an application server. <BR>Most servers come with modules or servlets for delegating certain request to other web <BR>resources. For example, one may configure a proxy module of Apache HTTP Server to <BR>redirect requests made to <I>http://mycompany.com/myproduct/infocenter</I> to <BR><I>http://internalserver:8081/help</I> that runs an infocenter. Adding the lines <PRE>LoadModule proxy_module modules/ApacheModuleProxy.dll
ProxyPass /myproduct/infocenter http://internalserver:8081/help
ProxyPassReverse /myproduct/infocenter http://internalserver:8081/help
</PRE>to conf/httpd.conf file of Apache server running mycompany web site accomplishes this. 
<P></P>
<P>Some versions of Apache HTTP server, may contain AddDefaultCharset directive enabled in <BR>configuration file. Remove the directive or replace with <PRE>AddDefaultCharset Off</PRE>to have browsers display documents using correct character set. 
<P></P>
<H2>Running multiple instance of infocenter</H2>
<P>Multiple instances of infocenter can be run on a machine from one installation. Each started <BR>instance must use its own port and be provided with a workspace, hence <CODE>-port</CODE> and <CODE>-data</CODE> <BR>options must be specified. The instances can serve documentation from different set of plug-ins, <BR>by providing a valid platform configuration with <CODE>-configuration</CODE> option. </P>
<P>If <CODE>-configuration</CODE> is not used and configuration directory is shared among multiple infocenter <BR>instances, with overlapping set of locales, it must be ensured that all search indexes are created <BR>by one infocenter instance before another instance is started. Indexes are saved in the configuration <BR>directory, and write access is not synchronized across infocenter processes. </P>
<H2>[Optional] Installing a minimal set of plug-ins</H2>
<P>The infocenter does not require the entire &nbsp;Eclipse Platform package. It is possible to run the <BR>infocenter with the following plug-ins (located in the&nbsp; eclipse\plugins directory):<BR></P>
<P><CODE>org.apache.lucene<BR>org.eclipse.core.runtime<BR>org.eclipse.help<BR>org.eclipse.help.appserver<BR>org.eclipse.help.base<BR>org.eclipse.help.webapp<BR>org.eclipse.osgi<BR>org.eclipse.tomcat<BR>org.eclipse.update.configurator<BR></CODE></P>
<P>Some documentation plug-ins may have dependencies on other plug-ins, usually by specifying required <BR>plug-ins in their plugin.xml. The dependent plug-ins need to be installed on the infocenter as well. <BR>Additionally, plug-ins that were designed for earlier than 3.0 version of Eclipse implicitly require an <CODE>org.eclipse.core.runtime.compatibility</CODE> being present plug-in to work. </P>
<P>Infocenter plug-ins can be updated without restarting the infocenter, using commands explained <BR>in <A href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.platform.doc.isv/reference/misc/help_infocenter_update.html">Updating a running infocenter from command line</A> topic. To use this functionality, the minimal <BR>set of plug-ins must include <CODE>org.eclipse.update.core</CODE> plug-in. </P>
<P>See <A href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.platform.doc.isv/reference/misc/help_preferences.html">Help System Preferences</A> for more information on customizing help system.</P><img src ="http://www.blogjava.net/Andyluo/aggbug/31011.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2006-02-16 14:08 <a href="http://www.blogjava.net/Andyluo/archive/2006/02/16/31011.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>以前做的两个开源项目，分别基于Java Swing 和 Eclipse RCP</title><link>http://www.blogjava.net/Andyluo/archive/2005/12/16/24286.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 16 Dec 2005 13:06:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/12/16/24286.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/24286.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/12/16/24286.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/24286.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/24286.html</trackback:ping><description><![CDATA[第一个是XmallCharter, 何为Charter? 就是画图表的啦。Xmall吗?是我毕业后要开的公司的名字啊（这家伙又在yy了^_^）。<BR><BR>XmallCharter是一个基于JFreeChart库的图表软件，仿照PowerPoint里的图表功能，支持饼状图、域图、线状图、条形图、3D条形图等图表类型，100% Java Swing 代码，绿色软件，解压缩即可在Linux、W$等系统上运行。<BR><BR>项目现在“寄居”在SourceForge.net上，最新版本是0.2。<BR><BR>去年学校的创新竞赛（也是挑战杯的校内选拔赛），每个俱乐部都要交作品，我顺便把XmallCharter和文档交了上去，还好，得了个三等奖，当时还比较兴奋（这个项目本来是《界面设计》课程的大作业，那时候刚刚完成，才花了一个星期，意外之喜）<BR><BR>项目网址：<A href="http://www.sourceforge.net/projects/xmallcharter">www.sourceforge.net/projects/xmallcharter</A><BR><BR><IMG height=480 alt=xmall.jpg src="http://www.blogjava.net/images/blogjava_net/andyluo/xmall.jpg" width=640 border=0><BR><BR><BR>第二个是XBlogger，一个基于Eclipse RCP的Blog客户端，是今年IBM校园科技创新竞赛的参赛作品，但是由于某些原因，最终没能提交（55～，早点回学校就好了）。本地数据库使用<A href="http://www.google.com/search?hl=zh-CN&amp;q=hsqldb&amp;lr=">HSqlDB</A>，目前只支持Blogger.com（.Text类型的也能支持，但还没加上，懒了）。本来应该有个Web Service中间层，以后可行的话可能会加上，基本架构和截屏如下（现在还没开源，完善一下先）：<BR><BR>基本架构：<BR><BR><IMG style="WIDTH: 513px; HEIGHT: 254px" height=366 alt=xmall_arch.gif src="http://www.blogjava.net/images/blogjava_net/andyluo/xmall_arch.gif" width=600 border=0><BR><BR>（用OpenOffice打开的Word文档，有点变形）<BR><BR>截图：<BR><BR><IMG height=479 alt=Xblogger.JPG src="http://www.blogjava.net/images/blogjava_net/andyluo/Xblogger.JPG" width=639 border=0><BR><img src ="http://www.blogjava.net/Andyluo/aggbug/24286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-12-16 21:06 <a href="http://www.blogjava.net/Andyluo/archive/2005/12/16/24286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Eclipse Plugin中执行任务</title><link>http://www.blogjava.net/Andyluo/archive/2005/10/06/14875.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 06 Oct 2005 07:26:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/10/06/14875.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/14875.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/10/06/14875.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/14875.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/14875.html</trackback:ping><description><![CDATA[<P>Job代表一个异步操作。<BR>要执行的操作写在run方法里。</P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">定义一个Job</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;AJob&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extends</SPAN><SPAN style="COLOR: #000000">&nbsp;Job<BR><IMG id=Codehighlighter1_33_203_Open_Image onclick="this.style.display='none'; Codehighlighter1_33_203_Open_Text.style.display='none'; Codehighlighter1_33_203_Closed_Image.style.display='inline'; Codehighlighter1_33_203_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_33_203_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_33_203_Closed_Text.style.display='none'; Codehighlighter1_33_203_Open_Image.style.display='inline'; Codehighlighter1_33_203_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_33_203_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_33_203_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;AJob()<BR><IMG id=Codehighlighter1_51_77_Open_Image onclick="this.style.display='none'; Codehighlighter1_51_77_Open_Text.style.display='none'; Codehighlighter1_51_77_Closed_Image.style.display='inline'; Codehighlighter1_51_77_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_51_77_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_51_77_Closed_Text.style.display='none'; Codehighlighter1_51_77_Open_Image.style.display='inline'; Codehighlighter1_51_77_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;</SPAN><SPAN id=Codehighlighter1_51_77_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_51_77_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">super</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Andy's&nbsp;Job</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;IStatus&nbsp;run(IProgressMonitor&nbsp;monitor)<BR><IMG id=Codehighlighter1_127_201_Open_Image onclick="this.style.display='none'; Codehighlighter1_127_201_Open_Text.style.display='none'; Codehighlighter1_127_201_Closed_Image.style.display='inline'; Codehighlighter1_127_201_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_127_201_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_127_201_Closed_Text.style.display='none'; Codehighlighter1_127_201_Open_Image.style.display='inline'; Codehighlighter1_127_201_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;</SPAN><SPAN id=Codehighlighter1_127_201_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_127_201_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;System.out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">This&nbsp;is&nbsp;Andy's&nbsp;Job</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Status.OK_STATUS;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV>
<P><BR>schedule后，任务在平台线程等待队列中排队，等待调度执行。<BR>调用方式1：</P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">异步调用</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">AJob&nbsp;job&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;AJob();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>job.schedule();&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">唤起平台线程来调度这个Job</SPAN></DIV>
<P>调用方式2：</P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">结束后再运行</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">AJob&nbsp;job&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;AJob();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>job.schedule();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><IMG src="http://www.blogjava.net/images/dot.gif">&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;do&nbsp;some&nbsp;other&nbsp;things.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">job.join();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">block，直到job完成或调用线程被中断</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(job.getResult().isOk())<BR><IMG id=Codehighlighter1_211_244_Open_Image onclick="this.style.display='none'; Codehighlighter1_211_244_Open_Text.style.display='none'; Codehighlighter1_211_244_Closed_Image.style.display='inline'; Codehighlighter1_211_244_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_211_244_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_211_244_Closed_Text.style.display='none'; Codehighlighter1_211_244_Open_Image.style.display='inline'; Codehighlighter1_211_244_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_211_244_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_211_244_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Job&nbsp;completed&nbsp;with&nbsp;success.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_251_291_Open_Image onclick="this.style.display='none'; Codehighlighter1_251_291_Open_Text.style.display='none'; Codehighlighter1_251_291_Closed_Image.style.display='inline'; Codehighlighter1_251_291_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_251_291_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_251_291_Closed_Text.style.display='none'; Codehighlighter1_251_291_Open_Image.style.display='inline'; Codehighlighter1_251_291_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_251_291_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_251_291_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Job&nbsp;did&nbsp;not&nbsp;complete&nbsp;successfully.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">}</SPAN></SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV><BR>取消一个Job：<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">job.cancel())<BR><IMG id=Codehighlighter1_18_33_Open_Image onclick="this.style.display='none'; Codehighlighter1_18_33_Open_Text.style.display='none'; Codehighlighter1_18_33_Closed_Image.style.display='inline'; Codehighlighter1_18_33_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_18_33_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_18_33_Closed_Text.style.display='none'; Codehighlighter1_18_33_Open_Image.style.display='inline'; Codehighlighter1_18_33_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_18_33_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_18_33_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;job.join();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">cancel可能不会立即成功，我们用join等待cancel操作完成。</SPAN></DIV><img src ="http://www.blogjava.net/Andyluo/aggbug/14875.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-10-06 15:26 <a href="http://www.blogjava.net/Andyluo/archive/2005/10/06/14875.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse Tip: Sharing Java project settings  (ZZ)</title><link>http://www.blogjava.net/Andyluo/archive/2005/07/15/7794.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 15 Jul 2005 12:05:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/07/15/7794.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/7794.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/07/15/7794.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/7794.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/7794.html</trackback:ping><description><![CDATA[<P align=left>The Eclipse 3.1 has a new feature. Now the Java project settings like Compiler and&nbsp;Code Style can be shared with the entire team using the version control tool. </P>
<P align=left>To do this right click the project in <STRONG>Package Explorer</STRONG> or <STRONG>Navigator view</STRONG> and got to either <STRONG>Java Code Style</STRONG> or <STRONG>Java Compiler</STRONG> options. Check the <STRONG>Enable project specific settings</STRONG>. </P>
<P align=left>This will create a <STRONG>.settings</STRONG> folder in the project root. Eclipse will add and maintain&nbsp;the project specific configuration in this folder. Commit this folder to the version control. Thats it. Now the project settings are shared with the team. When the other team members synchronize with the repository they will get the project settings too. Any team member can update and check in the settings. Cool! </P><img src ="http://www.blogjava.net/Andyluo/aggbug/7794.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-07-15 20:05 <a href="http://www.blogjava.net/Andyluo/archive/2005/07/15/7794.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse Icons</title><link>http://www.blogjava.net/Andyluo/archive/2005/07/15/7792.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 15 Jul 2005 11:50:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/07/15/7792.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/7792.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/07/15/7792.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/7792.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/7792.html</trackback:ping><description><![CDATA[都在这几个文件夹里：<BR>org.eclipse.debug.ui/icons<BR>org.eclipse.pde.ui/icons<BR>org.eclipse.jdt.ui/icons<BR>org.eclipse.vcm.ui/icons<BR>org.eclipse.team.ui/icons<BR>org.eclipse.ant.ui/icons<BR>org.eclipse.help.ui/icons<BR>org.eclipse.ui/icons<BR>org.eclipse.ui.views/icons<BR>org.eclipse.ui.console/icons<BR><BR>一个比较全的Icon网页：<BR><A href="http://www.codehaus.org/~bwalding/eclipse-icons/">http://www.codehaus.org/~bwalding/eclipse-icons/</A><BR><BR>以后找Eclipse的图片就方便了，: )<img src ="http://www.blogjava.net/Andyluo/aggbug/7792.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-07-15 19:50 <a href="http://www.blogjava.net/Andyluo/archive/2005/07/15/7792.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse's process monitor &amp; Container Selection Dialog</title><link>http://www.blogjava.net/Andyluo/archive/2005/07/10/7440.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Sun, 10 Jul 2005 02:35:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/07/10/7440.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/7440.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/07/10/7440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/7440.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/7440.html</trackback:ping><description><![CDATA[<P xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">The wizard in this code is a standard wizard that displays pages, then generates code in the <FONT face="Courier New, monospace">doFinish</FONT> method. What is most interesting about this class is that in <FONT face="Courier New, monospace">performFinish</FONT>, it demonstrates how to interact with Eclipse's process monitor for tasks that take a long time.<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_0_167_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_167_Open_Text.style.display='none'; Codehighlighter1_0_167_Closed_Image.style.display='inline'; Codehighlighter1_0_167_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_0_167_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_167_Closed_Text.style.display='none'; Codehighlighter1_0_167_Open_Image.style.display='inline'; Codehighlighter1_0_167_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_0_167_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_0_167_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000">*<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;when&nbsp;'Finish'&nbsp;button&nbsp;is&nbsp;pressed&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;in&nbsp;the&nbsp;wizard.&nbsp;We&nbsp;will&nbsp;create&nbsp;an&nbsp;operation&nbsp;and&nbsp;run&nbsp;it<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;using&nbsp;wizard&nbsp;as&nbsp;execution&nbsp;context.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_202_1061_Open_Image onclick="this.style.display='none'; Codehighlighter1_202_1061_Open_Text.style.display='none'; Codehighlighter1_202_1061_Closed_Image.style.display='inline'; Codehighlighter1_202_1061_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_202_1061_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_202_1061_Closed_Text.style.display='none'; Codehighlighter1_202_1061_Open_Image.style.display='inline'; Codehighlighter1_202_1061_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;boolean&nbsp;performFinish()&nbsp;</SPAN><SPAN id=Codehighlighter1_202_1061_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_202_1061_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;final&nbsp;String&nbsp;containerName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;page.getContainerName();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;final&nbsp;String&nbsp;fileName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;page.getFileName();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;IRunnableWithProgress&nbsp;op&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;IRunnableWithProgress()&nbsp;<BR><IMG id=Codehighlighter1_374_699_Open_Image onclick="this.style.display='none'; Codehighlighter1_374_699_Open_Text.style.display='none'; Codehighlighter1_374_699_Closed_Image.style.display='inline'; Codehighlighter1_374_699_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_374_699_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_374_699_Closed_Text.style.display='none'; Codehighlighter1_374_699_Open_Image.style.display='inline'; Codehighlighter1_374_699_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_374_699_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_374_699_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;run(IProgressMonitor&nbsp;monitor)&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throws&nbsp;InvocationTargetException&nbsp;<BR><IMG id=Codehighlighter1_475_693_Open_Image onclick="this.style.display='none'; Codehighlighter1_475_693_Open_Text.style.display='none'; Codehighlighter1_475_693_Closed_Image.style.display='inline'; Codehighlighter1_475_693_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_475_693_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_475_693_Closed_Text.style.display='none'; Codehighlighter1_475_693_Open_Image.style.display='inline'; Codehighlighter1_475_693_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_475_693_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_475_693_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_489_553_Open_Image onclick="this.style.display='none'; Codehighlighter1_489_553_Open_Text.style.display='none'; Codehighlighter1_489_553_Closed_Image.style.display='inline'; Codehighlighter1_489_553_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_489_553_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_489_553_Closed_Text.style.display='none'; Codehighlighter1_489_553_Open_Image.style.display='inline'; Codehighlighter1_489_553_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_489_553_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_489_553_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doFinish(containerName,&nbsp;fileName,&nbsp;monitor);<BR><IMG id=Codehighlighter1_579_639_Open_Image onclick="this.style.display='none'; Codehighlighter1_579_639_Open_Text.style.display='none'; Codehighlighter1_579_639_Closed_Image.style.display='inline'; Codehighlighter1_579_639_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_579_639_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_579_639_Closed_Text.style.display='none'; Codehighlighter1_579_639_Open_Image.style.display='inline'; Codehighlighter1_579_639_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(CoreException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_579_639_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_579_639_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;InvocationTargetException(e);<BR><IMG id=Codehighlighter1_649_685_Open_Image onclick="this.style.display='none'; Codehighlighter1_649_685_Open_Text.style.display='none'; Codehighlighter1_649_685_Closed_Image.style.display='inline'; Codehighlighter1_649_685_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_649_685_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_649_685_Closed_Text.style.display='none'; Codehighlighter1_649_685_Open_Image.style.display='inline'; Codehighlighter1_649_685_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_649_685_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_649_685_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitor.done();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG id=Codehighlighter1_710_759_Open_Image onclick="this.style.display='none'; Codehighlighter1_710_759_Open_Text.style.display='none'; Codehighlighter1_710_759_Closed_Image.style.display='inline'; Codehighlighter1_710_759_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_710_759_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_710_759_Closed_Text.style.display='none'; Codehighlighter1_710_759_Open_Image.style.display='inline'; Codehighlighter1_710_759_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_710_759_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_710_759_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getContainer().run(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">,&nbsp;op);<BR><IMG id=Codehighlighter1_792_818_Open_Image onclick="this.style.display='none'; Codehighlighter1_792_818_Open_Text.style.display='none'; Codehighlighter1_792_818_Closed_Image.style.display='inline'; Codehighlighter1_792_818_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_792_818_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_792_818_Closed_Text.style.display='none'; Codehighlighter1_792_818_Open_Image.style.display='inline'; Codehighlighter1_792_818_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(InterruptedException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_792_818_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_792_818_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR><IMG id=Codehighlighter1_856_1040_Open_Image onclick="this.style.display='none'; Codehighlighter1_856_1040_Open_Text.style.display='none'; Codehighlighter1_856_1040_Closed_Image.style.display='inline'; Codehighlighter1_856_1040_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_856_1040_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_856_1040_Closed_Text.style.display='none'; Codehighlighter1_856_1040_Open_Image.style.display='inline'; Codehighlighter1_856_1040_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(InvocationTargetException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_856_1040_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_856_1040_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Throwable&nbsp;realException&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;e.getTargetException();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDialog.openError(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getShell(),&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Error</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;realException.getMessage());<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_1064_1072_Open_Image onclick="this.style.display='none'; Codehighlighter1_1064_1072_Open_Text.style.display='none'; Codehighlighter1_1064_1072_Closed_Image.style.display='inline'; Codehighlighter1_1064_1072_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1064_1072_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1064_1072_Closed_Text.style.display='none'; Codehighlighter1_1064_1072_Open_Image.style.display='inline'; Codehighlighter1_1064_1072_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_1064_1072_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_1064_1072_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000">&nbsp;<IMG src="http://www.blogjava.net/images/dot.gif">&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1074_1249_Open_Image onclick="this.style.display='none'; Codehighlighter1_1074_1249_Open_Text.style.display='none'; Codehighlighter1_1074_1249_Closed_Image.style.display='inline'; Codehighlighter1_1074_1249_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1074_1249_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1074_1249_Closed_Text.style.display='none'; Codehighlighter1_1074_1249_Open_Image.style.display='inline'; Codehighlighter1_1074_1249_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_1074_1249_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_1074_1249_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000">*<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;worker&nbsp;method.&nbsp;It&nbsp;will&nbsp;find&nbsp;the&nbsp;container,&nbsp;create<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;file&nbsp;if&nbsp;missing&nbsp;or&nbsp;just&nbsp;replace&nbsp;its&nbsp;contents,&nbsp;and&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;open&nbsp;the&nbsp;editor&nbsp;on&nbsp;the&nbsp;newly&nbsp;created&nbsp;file.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;doFinish(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;containerName,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;fileName,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IProgressMonitor&nbsp;monitor)<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throws&nbsp;CoreException&nbsp;<BR><IMG id=Codehighlighter1_1390_2644_Open_Image onclick="this.style.display='none'; Codehighlighter1_1390_2644_Open_Text.style.display='none'; Codehighlighter1_1390_2644_Closed_Image.style.display='inline'; Codehighlighter1_1390_2644_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1390_2644_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1390_2644_Closed_Text.style.display='none'; Codehighlighter1_1390_2644_Open_Image.style.display='inline'; Codehighlighter1_1390_2644_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1390_2644_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1390_2644_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;create&nbsp;a&nbsp;sample&nbsp;file</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;monitor.beginTask(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Creating&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;fileName,&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;IWorkspaceRoot&nbsp;root&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourcesPlugin.getWorkspace().getRoot();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;IResource&nbsp;resource&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;root.findMember(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Path(containerName));<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">resource.exists()&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">(resource&nbsp;instanceof&nbsp;IContainer))&nbsp;<BR><IMG id=Codehighlighter1_1702_1802_Open_Image onclick="this.style.display='none'; Codehighlighter1_1702_1802_Open_Text.style.display='none'; Codehighlighter1_1702_1802_Closed_Image.style.display='inline'; Codehighlighter1_1702_1802_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1702_1802_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1702_1802_Closed_Text.style.display='none'; Codehighlighter1_1702_1802_Open_Image.style.display='inline'; Codehighlighter1_1702_1802_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1702_1802_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1702_1802_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throwCoreException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Container&nbsp;\</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">&nbsp;+&nbsp;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;containerName&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;does&nbsp;not&nbsp;exist.</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;IContainer&nbsp;container&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(IContainer)&nbsp;resource;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;final&nbsp;IFile&nbsp;file&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;container.getFile(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Path(fileName));<BR><IMG id=Codehighlighter1_1933_2158_Open_Image onclick="this.style.display='none'; Codehighlighter1_1933_2158_Open_Text.style.display='none'; Codehighlighter1_1933_2158_Closed_Image.style.display='inline'; Codehighlighter1_1933_2158_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1933_2158_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1933_2158_Closed_Text.style.display='none'; Codehighlighter1_1933_2158_Open_Image.style.display='inline'; Codehighlighter1_1933_2158_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_1933_2158_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1933_2158_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;stream&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;openContentStream();<BR><IMG id=Codehighlighter1_2008_2071_Open_Image onclick="this.style.display='none'; Codehighlighter1_2008_2071_Open_Text.style.display='none'; Codehighlighter1_2008_2071_Closed_Image.style.display='inline'; Codehighlighter1_2008_2071_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2008_2071_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2008_2071_Closed_Text.style.display='none'; Codehighlighter1_2008_2071_Open_Image.style.display='inline'; Codehighlighter1_2008_2071_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(file.exists())&nbsp;</SPAN><SPAN id=Codehighlighter1_2008_2071_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2008_2071_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.setContents(stream,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;monitor);<BR><IMG id=Codehighlighter1_2078_2130_Open_Image onclick="this.style.display='none'; Codehighlighter1_2078_2130_Open_Text.style.display='none'; Codehighlighter1_2078_2130_Closed_Image.style.display='inline'; Codehighlighter1_2078_2130_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2078_2130_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2078_2130_Closed_Text.style.display='none'; Codehighlighter1_2078_2130_Open_Image.style.display='inline'; Codehighlighter1_2078_2130_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_2078_2130_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2078_2130_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.create(stream,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;monitor);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stream.close();<BR><IMG id=Codehighlighter1_2182_2188_Open_Image onclick="this.style.display='none'; Codehighlighter1_2182_2188_Open_Text.style.display='none'; Codehighlighter1_2182_2188_Closed_Image.style.display='inline'; Codehighlighter1_2182_2188_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2182_2188_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2182_2188_Closed_Text.style.display='none'; Codehighlighter1_2182_2188_Open_Image.style.display='inline'; Codehighlighter1_2182_2188_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(IOException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_2182_2188_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2182_2188_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;monitor.worked(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;monitor.setTaskName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Opening&nbsp;file&nbsp;for&nbsp;editing<IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG id=Codehighlighter1_2322_2615_Open_Image onclick="this.style.display='none'; Codehighlighter1_2322_2615_Open_Text.style.display='none'; Codehighlighter1_2322_2615_Closed_Image.style.display='inline'; Codehighlighter1_2322_2615_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2322_2615_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2322_2615_Closed_Text.style.display='none'; Codehighlighter1_2322_2615_Open_Image.style.display='inline'; Codehighlighter1_2322_2615_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;getShell().getDisplay().asyncExec(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Runnable()&nbsp;</SPAN><SPAN id=Codehighlighter1_2322_2615_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2322_2615_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_2350_2607_Open_Image onclick="this.style.display='none'; Codehighlighter1_2350_2607_Open_Text.style.display='none'; Codehighlighter1_2350_2607_Closed_Image.style.display='inline'; Codehighlighter1_2350_2607_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2350_2607_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2350_2607_Closed_Text.style.display='none'; Codehighlighter1_2350_2607_Open_Image.style.display='inline'; Codehighlighter1_2350_2607_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;run()&nbsp;</SPAN><SPAN id=Codehighlighter1_2350_2607_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2350_2607_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IWorkbenchPage&nbsp;page&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PlatformUI.getWorkbench().<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getActiveWorkbenchWindow().getActivePage();<BR><IMG id=Codehighlighter1_2497_2555_Open_Image onclick="this.style.display='none'; Codehighlighter1_2497_2555_Open_Text.style.display='none'; Codehighlighter1_2497_2555_Closed_Image.style.display='inline'; Codehighlighter1_2497_2555_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2497_2555_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2497_2555_Closed_Text.style.display='none'; Codehighlighter1_2497_2555_Open_Image.style.display='inline'; Codehighlighter1_2497_2555_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_2497_2555_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2497_2555_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDE.openEditor(page,&nbsp;file,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG id=Codehighlighter1_2585_2597_Open_Image onclick="this.style.display='none'; Codehighlighter1_2585_2597_Open_Text.style.display='none'; Codehighlighter1_2585_2597_Closed_Image.style.display='inline'; Codehighlighter1_2585_2597_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2585_2597_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2585_2597_Closed_Text.style.display='none'; Codehighlighter1_2585_2597_Open_Image.style.display='inline'; Codehighlighter1_2585_2597_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(PartInitException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_2585_2597_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2585_2597_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;monitor.worked(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"><BR>This code is a simple SWT wizard page. The most interesting characteristic of this class is in the <FONT face="Courier New, monospace">handleBrowse</FONT> method. This method uses Eclipse's <FONT face="Courier New, monospace">ContainerSelectionDialog</FONT> for displaying the folders in the workspace.<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_2_114_Open_Image onclick="this.style.display='none'; Codehighlighter1_2_114_Open_Text.style.display='none'; Codehighlighter1_2_114_Closed_Image.style.display='inline'; Codehighlighter1_2_114_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_2_114_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2_114_Closed_Text.style.display='none'; Codehighlighter1_2_114_Open_Image.style.display='inline'; Codehighlighter1_2_114_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_2_114_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000">*<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;Uses&nbsp;the&nbsp;standard&nbsp;container&nbsp;selection&nbsp;dialog&nbsp;to<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;*&nbsp;choose&nbsp;the&nbsp;new&nbsp;value&nbsp;for&nbsp;the&nbsp;container&nbsp;field.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_146_587_Open_Image onclick="this.style.display='none'; Codehighlighter1_146_587_Open_Text.style.display='none'; Codehighlighter1_146_587_Closed_Image.style.display='inline'; Codehighlighter1_146_587_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_146_587_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_146_587_Closed_Text.style.display='none'; Codehighlighter1_146_587_Open_Image.style.display='inline'; Codehighlighter1_146_587_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;handleBrowse()&nbsp;</SPAN><SPAN id=Codehighlighter1_146_587_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_146_587_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ContainerSelectionDialog&nbsp;dialog&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ContainerSelectionDialog(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getShell(),<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourcesPlugin.getWorkspace().getRoot(),<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Select&nbsp;new&nbsp;file&nbsp;container</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG id=Codehighlighter1_417_583_Open_Image onclick="this.style.display='none'; Codehighlighter1_417_583_Open_Text.style.display='none'; Codehighlighter1_417_583_Closed_Image.style.display='inline'; Codehighlighter1_417_583_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_417_583_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_417_583_Closed_Text.style.display='none'; Codehighlighter1_417_583_Open_Image.style.display='inline'; Codehighlighter1_417_583_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(dialog.open()&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;ContainerSelectionDialog.OK)&nbsp;</SPAN><SPAN id=Codehighlighter1_417_583_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_417_583_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object[]&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;dialog.getResult();<BR><IMG id=Codehighlighter1_493_577_Open_Image onclick="this.style.display='none'; Codehighlighter1_493_577_Open_Text.style.display='none'; Codehighlighter1_493_577_Closed_Image.style.display='inline'; Codehighlighter1_493_577_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_493_577_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_493_577_Closed_Text.style.display='none'; Codehighlighter1_493_577_Open_Image.style.display='inline'; Codehighlighter1_493_577_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(result.length&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN id=Codehighlighter1_493_577_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_493_577_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;containerText.setText(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((Path)result[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]).toOSString());<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P></P>
<P xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">&nbsp;</P><img src ="http://www.blogjava.net/Andyluo/aggbug/7440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-07-10 10:35 <a href="http://www.blogjava.net/Andyluo/archive/2005/07/10/7440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>&lt;IMG alt=EclipseIcon src="http://www.blogjava.net/images/blogjava_net/kukoo/1547/EclipseIcon.GIF" border=0 align=top&gt;如何制作和使用库插件 --Eclipse RCP -- 设计小结</title><link>http://www.blogjava.net/Andyluo/archive/2005/07/06/7208.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Wed, 06 Jul 2005 08:30:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/07/06/7208.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/7208.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/07/06/7208.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/7208.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/7208.html</trackback:ping><description><![CDATA[<P>在Eclipse的插件体系中，所有的类库文件都是以插件的形式存在的。如果你的Plugin项目要用到第三方API库或者另一个工程的API，你可以将他们包装成一个插件，这就是库插件的含义。</P>
<P>在我们小组的设计中，Plugin和控制逻辑是分成两个工程单独开发的，Plugin主要实现界面功能，通过调用控制逻辑实现数据存储、Blog发布、打印等功能，所以接触到了制作库插件这个过程，现在写下来，希望有点帮助。</P>
<P>如何制作库插件：<BR>将库工程转换为Plugin工程，在MANIFEST.MF的overview里定义ID，在Runtime里加入你要公开的包（Exported Packages）。OK</P>
<P>如何使用库插件，主要分为三步：<BR>1、在Dependencies Tab的Required Plug-ins中加入你的库插件（保证输出项目时导出相应的库插件）<BR>2、然后Compute build path（使项目能够顺利通过编译）<BR>3、在运行对话框的Plugin Tab里单击Add required plugins，这样项目才能正常运行<BR><BR>有一点忘了就会挺郁闷的！<BR><BR><IMG height=16 alt=o_folder.gif src="http://www.blogjava.net/images/blogjava_net/andyluo/1760/o_folder.gif" width=13 border=0>&nbsp; <A href="http://technorati.com/tag/rcp" rel=tag>RCP</A>&nbsp; <A href="http://technorati.com/tag/rcp" rel=tag>Eclipse</A>&nbsp;<A href="http://technorati.com/tag/rcp" rel=tag>Plugin</A></P><img src ="http://www.blogjava.net/Andyluo/aggbug/7208.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-07-06 16:30 <a href="http://www.blogjava.net/Andyluo/archive/2005/07/06/7208.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>将Help嵌入Eclipse RCP需要注意的一些问题</title><link>http://www.blogjava.net/Andyluo/archive/2005/07/06/7207.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Wed, 06 Jul 2005 08:28:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/07/06/7207.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/7207.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/07/06/7207.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/7207.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/7207.html</trackback:ping><description><![CDATA[<DIV class=postcontent>
<P>详细的制作Help过程我就不说了，在<A href="http://www.eclipse.org/articles/Article-RCP-3/tutorial3.html">这里</A>可以找到。</P>
<P>要注意三个问题：<BR>1、添加的插件要齐全，使用Help要增加以下几个插件：<BR><CODE>org.apache.ant</CODE> <BR><CODE>org.apache.lucene</CODE> <BR><CODE>org.eclipse.help.appserver</CODE> <BR><CODE>org.eclipse.help.base</CODE> <BR><CODE>org.eclipse.help.ui</CODE> <BR><CODE>org.eclipse.help.webapp</CODE> <BR><CODE>org.eclipse.tomcat</CODE> <BR><BR>2、在Build里添加html文件的信息，使html文件能正确导出，如：<BR>bin.includes = plugin.xml,\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *.jar,\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugin.properties,\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>book.xml,\</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>html/,\</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>icons/<BR></B><BR>3、在html文件中不能有中文的链接（显示为乱码，服务器会提示找不到该文件），所以html和图片的名称尽量用英文，内容用中文倒没有问题。</P></DIV><img src ="http://www.blogjava.net/Andyluo/aggbug/7207.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-07-06 16:28 <a href="http://www.blogjava.net/Andyluo/archive/2005/07/06/7207.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>练习RCP遇到的一个问题及思考</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/23/6611.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 23 Jun 2005 11:43:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/23/6611.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6611.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/23/6611.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6611.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6611.html</trackback:ping><description><![CDATA[<P>Problem Description：新建了一个RCP Mail的Template Example，运行正常，但是当我将在另一个RCP工程里建好的View放进来时，工程运行就抛出Invalid Menu Extension (Path is invalid): org.eclipse.ui.edit.text.gotoLastEditPosition，而且菜单和工具栏里多出了一些Eclipse自己的东西（如Search，Go to Last Edit Location）。捣动半天未果，后来偶然发现另外一个一模一样的运行配置运行OK，只是使用了另一个Workspace，比较一下发现，出错工程的Workspace多了三四个Plugin的配置（org.eclipse.core.resources，org.eclipse.core.runtime，org.eclipse.debug.core，org.eclipse.debug.ui），而成功的工程workspace只有org.eclipse.ui.workbench的Plugin配置，其他都一样，即使我复制过来也不好使。现在只能用以前的那个成功的配置了，好使，但不知道为什么会出现上述情况，<BR>&nbsp;难道是成功的工程已经将一些Extension注册了，所以后面的工程都用不了。</P>
<P>可能的原因：今天看Eclipse的RCP Tutorial时注意到Eclipse RCP所需的Plugin最小集是org.eclipse.core.runtime和org.eclipse.ui，又记起昨天使用了PDE的调试功能，所以org.eclipse.debug.core，org.eclipse.debug.ui可能是调试时生成的，或者是以前别的项目用过出错工程的workspace目录，生成了一些别的Plugin目录，而多出的Plugin在Plugin.xml文件里注册的menu在我的程序里没有被添加（或者没有定义对应的MenuPath），于是就抛出了：Invalid Menu Extension (Path is invalid)</P>
<P>不过还有一个问题：怎么workspace的.Plugin文件夹里只有org.eclipse.ui.workbench而没有org.eclipse.core.runtime，有谁知道这是为什么吗？</P><img src ="http://www.blogjava.net/Andyluo/aggbug/6611.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-23 19:43 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/23/6611.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《Contributing to Eclipse》阅读笔记 - 第零循环 - Eclipse整体架构</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6319.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 17 Jun 2005 14:53:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6319.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6319.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6319.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6319.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6319.html</trackback:ping><description><![CDATA[<P>为了打好做Plugin的基础，今天特地借了本《Contributing to Eclipse》，其实应该是买一本的，这本书这么经典。听说这本书是从Eclipse的内部构架来讲的，对于快速入门Plugin的开发可能不是特别合适，但没有发现书店有别的关于SWT或Plugin的书，555<BR><BR>好了，开始切入正题，Go Go Go</P>
<P>《Contributing to Eclipse》分为四个循环，第一个循环是第零个循环（hahaha）。<BR><BR>第零个循环介绍了Eclipse的基础架构，然后通过编写一个最简单的HelloWorld Plugin带我们走进Contributing的大门。</P>
<P>先说说这里列出的比较重要的概念：<BR>Eclipse分为三层：Platform、JDT、PDE。其中PDE是对JDT的扩展，提供了插件开发支持。</P>
<P>Platform又分为两层：Core（Workspace、Runtime）、UI（Workbench、JFace、SWT）。<BR>下面分别介绍一下：<BR>Runtime --- 定义了插件的基础设施。启动时发现所有可用插件并管理插件的加载。<BR>Workspace --- 管理一个或多个顶级项目。<BR>SWT（Standard Widget Toolkit）--- 提供图形显示功能，定义了一组标准窗体组件。<BR>JFace --- 建立在SWT上的一组比较小的UI框架，提供对常用UI任务的支持。<BR>Workbench --- Eclipse的UI聚合体，核心要素是编辑器、视图（View）和视角（Perspective）。<BR>其中视角（Perspective）定义了各工作台部件的可视化排列方式。</P>
<P>All Right. That's how you get it. <BR>Go on, be a tiger.</P><img src ="http://www.blogjava.net/Andyluo/aggbug/6319.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 22:53 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6319.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>这个界面挺好玩</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6248.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Fri, 17 Jun 2005 00:20:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6248.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6248.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6248.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6248.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6248.html</trackback:ping><description><![CDATA[SWT里的Right to Left Style，将Menu设为SWT.RIGHT_TO_LEFT就可以了，以前没看到过这种效果，不知道别的语言可不可以这样。<BR><IMG height=336 alt=倒窗口.JPG src="http://www.blogjava.net/images/blogjava_net/andyluo/倒窗口.JPG" width=494 border=0><img src ="http://www.blogjava.net/Andyluo/aggbug/6248.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 08:20 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6248.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT = 本地化的Java？</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6249.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Jun 2005 20:30:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6249.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6249.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6249.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6249.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6249.html</trackback:ping><description><![CDATA[<P>刚才看了Examples里的Web Browser实例，感觉特别像一个Rss Reader里的简易浏览器。</P>
<P>上software.hit.edu.cn看Flash没有问题，打开一个Word文档也OK，应该是内嵌了IE吧。</P>
<P>看了代码也只发现一个setLocation(URL)，没有跟本地系统联系的代码，难道SWT里的Browser本身就内嵌了IE。</P>
<P>以前也听说过SWT是不用虚拟机的（是吗？），都是调用本地的dll，只是现在亲眼目睹了。</P>
<P><STRONG>这不有点像AWT吗？！</STRONG></P><IMG height=1 src="http://blueline.hit.edu.cn/blog/andy/aggbug/1685.aspx" width=1><img src ="http://www.blogjava.net/Andyluo/aggbug/6249.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 04:30 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6249.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT Examples阅读笔记 - Custom Controls</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6250.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Jun 2005 20:01:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6250.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6250.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6250.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6250.html</trackback:ping><description><![CDATA[<P>这就是定制的Controls？有什么特别的地方吗？我好像也没看出来<BR><BR>CCombo就是一个ComboBox，不过可以设为Flat，这样比较酷。<BR><BR>CLabel有一个Shadow相关的属性，可以设置IN或OUT（就是突出或凹进，这是Label啊！搞得这么花哨）。<BR><BR>CTabFolder在视觉上有些改进，也是Flat Style，看着看着就忍不住想碰一下。当Size缩小时，CTabItem可以隐藏起来，在右上方显示一个下拉双箭头，还显示了隐藏的Item数目，应该就是Eclipse里的那种风格了。<BR><IMG height=203 alt=CTabFolder.JPG src="http://www.blogjava.net/images/blogjava_net/andyluo/1760/CTabFolder.JPG" width=222 border=0><BR><BR>StyledText，顾名思义。比较特别的：可以将句子Strikeout，就是在选择的句子上划一条“删除线”。<BR><BR>TableTree跟上节Controls里讲的Tree差不多。<U>有一个SWT.FULL_SELECTION Style不知道有什么用</U>。<BR><BR>例子看完了，休息...休息一下。</P><IMG height=1 src="http://blueline.hit.edu.cn/blog/andy/aggbug/1684.aspx" width=1><img src ="http://www.blogjava.net/Andyluo/aggbug/6250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 04:01 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT Examples阅读笔记 - Controls</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6251.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Jun 2005 19:20:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6251.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6251.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6251.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6251.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6251.html</trackback:ping><description><![CDATA[我们来看一下Swt Controls，所有的控件应该都在这里了。<BR>首先是Button，里面的TOGGLE（按下不弹起）、FLAT（平平的，跟DotNet里的Flat Style差不多）和ARROW（一个方向箭头，可以指定方向）挺好玩的，组合一下会有多重效果（用 | 来组合，如SWT.ARROW | SWT.FLAT | SWT.PUSH）。<BR><BR>再看看Canvas（画布）,SWT.NO_REDRAW_RESIZE属性设置resize时画布不重画，想起了小田老师的实验1，呵呵。<U>Caret显示一个光标</U>，不知道是干什么用的。<U>还有一个Fill Damaged Area With Color</U>，看源代码也没弄懂，不就是画几个五颜六色的Rectangle吗，要单独列出来吗？<BR><BR>第三是ComboBox，Style是SWT.DROP_DOWN时是下拉列表，SWT.SIMPLE是将所有选项都平铺在板子上的ComboBox。<BR><BR>CoolBar也是工具栏咯，只不过比一般的ToolBar漂亮（SWT里还有ToolBar）不知道Item Styles中的SWT.DROP_DOWN有什么用，好像只对Toggle Item起作用。工具栏里可以放Text了。（后补 -&gt; 发现DROP_DOWN的功能了：Item被隐藏时显示一个扩展箭头。刚才说的Toggle Item其实是Radio）<BR><BR>Dialog有四个Model Style：SWT.MODELESS、SWT.PRIMARY_MODAL、SWT.APPLICATION_MODAL、SWT.SYSTEM_MODAL(不知道PRIMARY_MODAL是做什么用的)<BR><BR>ToolBar里可以加入ComboBox<BR><BR>Tree可以有Multiple Columns和Header。甚至还能显示行列，简直就是Tree和Table的结晶。<BR><BR>例子看完了，休息...休息一下。<IMG height=1 src="http://blueline.hit.edu.cn/blog/andy/aggbug/1683.aspx" width=1><img src ="http://www.blogjava.net/Andyluo/aggbug/6251.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 03:20 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6251.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT Examples阅读笔记 - 开题报告</title><link>http://www.blogjava.net/Andyluo/archive/2005/06/17/6252.html</link><dc:creator>罗明</dc:creator><author>罗明</author><pubDate>Thu, 16 Jun 2005 17:39:00 GMT</pubDate><guid>http://www.blogjava.net/Andyluo/archive/2005/06/17/6252.html</guid><wfw:comment>http://www.blogjava.net/Andyluo/comments/6252.html</wfw:comment><comments>http://www.blogjava.net/Andyluo/archive/2005/06/17/6252.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Andyluo/comments/commentRss/6252.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Andyluo/services/trackbacks/6252.html</trackback:ping><description><![CDATA[<P>假如不考研的话，我就要在这一段时间多弄弄技术了，决定学学Eclipse的plugin和RCP，于是首先得学SWT。<BR><BR>上次看了几篇中文的paper，知道了SWT的基本应用，现在该动动手了（尽管我向来都提倡君子动口不动手的，呵呵），当然是首先看看swt都能干什么啦，最好的下手之处就是swt examples。<BR><BR>运行环境就是Eclipse啦，我的Eclipse本来不打算换的，我已经装了RC1（那天下RC2也是一位朋友要用，我的电脑上从3.0.1到3.1RC2都有，pat），但听说RC2超级快，所以也解压缩试一下。说了这么多废话，真有点对不起观众，555<BR><BR>现在看看怎么运行SWT Examples，我们启动Eclipse，从Help的Welcome里选择Samples，单击SWT下面的红圆圈，链接到download examples(我在Update里设了代理，速度马马虎虎)，自动安装完examples后，单击OutLine里的run examples，不要害怕，这时会弹出一个Eclipse的启动画面，不要认为哪里做错了，对，这就是Examples的Laucher。在Laucher打开的workbench里选择Window-&gt;Show View-&gt;Other,选择Swt Examples里的例子。现在可以慢慢看了。</P><img src ="http://www.blogjava.net/Andyluo/aggbug/6252.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Andyluo/" target="_blank">罗明</a> 2005-06-17 01:39 <a href="http://www.blogjava.net/Andyluo/archive/2005/06/17/6252.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>