<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>没有比人更高的山 &#187; Java</title>
	<atom:link href="http://www.zhlwish.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhlwish.com</link>
	<description>Where there is a will there is a way.</description>
	<lastBuildDate>Fri, 13 Jan 2012 08:13:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Eclipse JFace Binding/绑定 (3)</title>
		<link>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-3/</link>
		<comments>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-3/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 14:28:19 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Eclispe RCP]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=786</guid>
		<description><![CDATA[前文Eclipse JFace Binding/绑定 (1)”和Eclipse JFace Binding/绑定 (2)”分别讲述了JavaBean API的事件机制和Eclipse JFace Binding的SWT控件属性和JavaBean属性的绑定。本文是本系列的最后一篇，讲述JFace中TableViewer、TreeViewer和ListViewer的绑定，由于TableViewer比较有代表性，因此使用TableViewer作为示例。 为什么需要WritableList、WritableSet和WritableMap 在做任何事情之前，先要提出一个为什么，“当你保持一颗好奇的心，当你愿意去问“为什么”，而不是一味得不假思索得接受，你便能够从一件事物的不同角度去审度，你就站得更高，看得更远”——这是 《Sandra Lee: 人生很短，做自己喜欢的事 》中的一句话，我很喜欢。 提出这个问题，潜台词肯定是为什么不能直接用List、Set、Map呢？原因在于集合对象不同于普通对象，集合对象包括了一组对象，这组对象本身的属性改变需要监听自然不必说，对象的添加、删除也是需要监听的，因此Java Collection API中的List、Set和Map就不够用了，更何况几何对象中所包括的那一组对象还必须封装到一个WritableValue对象中，不然元素和GUI的绑定又得失效了。 那么这么多复杂的工作就让WritableList去干吧。 JavaBean中的List属性 我们先模拟一下有钱人，他们都能买几套房子，因此都有几个地址，将地址列表作为有钱人的一个属性。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 &#8230; <a href="http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Eclipse JFace Binding/绑定 (2)</title>
		<link>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-2/</link>
		<comments>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-2/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 13:15:11 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Eclispe RCP]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=775</guid>
		<description><![CDATA[前文《Eclipse JFace Binding/绑定 (1)》介绍了JavaBean的事件机制，Eclipse的绑定利用了这种机制，（据说Eclipse Binding的下一个目标是Pojo对象的双向绑定，利用asm这样的字节码操作库）。 绑定针对对象实例而不是类型 在深入之前，需要明确的是，在Java中绑定永远是针对对象实例的绑定，而不是针对对象类型的绑定。也就是说下面的代码会使model之前注册的监听器失效。 Model model = new Model&#40;&#41;; model.addPropertyChangeListener&#40;new IPropertyChangeListener&#40;&#41;&#123; public void propertyChangeListener&#40;PropertyChangeEvent evt&#41;&#123; System.out.println&#40;evt.getPropertyName&#40;&#41; + “ changed”&#41;; &#125; &#125;&#41;; model = new Model&#40;&#41;; IObservable接口 Eclipse绑定的核心是IObservableValue、IObservableList，通过实现这些接口对GUI和模型进行监听，我把实现了这些接口的对象成为绑定对象。包括： IObservable &#8211; 所有Observable接口的根接口，提供了对对象实例变化的监听机制 IObservableValue &#8211; 提供了getValue()和setValue()方法，提供了监听value改变的机制 IVetoableValue &#8211; 继承自IObservableValue，提供了在value变化之前进行事件处理的机制 IObservableCollection &#8230; <a href="http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse JFace Binding/绑定 (1)</title>
		<link>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-1/</link>
		<comments>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-1/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 08:08:55 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Eclispe RCP]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=767</guid>
		<description><![CDATA[binding这个词挺有意思的，中文意译为“绑定”，音译也可以是”绑定“，但是“绑定”这个词看起来又不是像“巴士”这样的词一样属于外来词。我深深地感觉第一个把binding翻译成“绑定”的人当时一定感觉很好。 为什么需要“绑定” 在MVC架构中，View（GUI）上的控件的值来源于Model，用户在View上的操作也需要更新到Model。由于桌面应用程序的实时响应特性，后台服务（如数字校验、根据单价和数量计算总价）对Model的更新也需要实时通过View反馈给用户。 Java应用中，Model和View都是相互独立的JavaBean。JavaBean API中，Bean之间的通信通过事件传递实现。事件在一方属性变化时被创建，然后传递给响应变化的一方，后者从事件对象中获取事件信息，进而调用相应的方法实现响应操作。 一般情况下，GUI操作以及Model的属性变化被封装成一个事件对象（Event），事件对象一般包括了事件发生的来源（控件或者模型），变化之前的值和变化之后的值。如对于JavaBean API中定义的类PropertyChangeEvent，有source、propertyName、oldValue、newValue四个属性。 模拟Model和View的“绑定” GUI和Model的绑定使用观察者模式来实现，也就是常说的Observable模式，不过在JavaBean的事件模型里面叫做Listener模式。不同的叫法实质是一样的，Observable是针对被观察的对象而言，Listener则是针对观察其他对象的对象而言。 Observable模式在Java API中有支持，可以直接继承java.util.Observable来实现一个被观察类，通过实现java.util.Observer接口实现观察者，然后调用Observable.addObserver(Observer)方法来建立消息发送渠道。这种方法存在的问题就是，被观察者类必须继承Observable类，由于Java是单继承，因此这个类就不能继承其他类了。 JavaBean API中提供IPropertyChangeListener接口和PropertyChangeSupport类来实现Bean之间的事件通信。我们创建如下两个类： Window：模拟GUI中的窗口，包括txtUsername和txtPassword两个文本输入框 Model：模式实体类，包括username和password两个字符串属性 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 &#8230; <a href="http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/09/17/eclipse-jface-binding-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 9</title>
		<link>http://www.zhlwish.com/2011/09/09/gef-step-by-step-9/</link>
		<comments>http://www.zhlwish.com/2011/09/09/gef-step-by-step-9/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 06:32:48 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=747</guid>
		<description><![CDATA[很长一段时间没有继续写了，很多东西都快忘记了，赶紧捡起来 让你的GEF图元可以拖动和缩放 拖动算是最简单的用户交互吧，不过麻雀虽小，肝胆俱全，不理解其原理和设计思路，很难谈得上去应用，但是要理解这一整套交互模型又有相当的难度，本文虽重在实践，这里也略做介绍。后文中所述图元指EditPart对象实例。 GEF用户交互有四个重要的概念：Command，Policy，Request，Role GEF图元对于用户操作的响应（具体的执行操作）被称为Command，这是命令模式的典型实现 GEF图元对于用户操作采用何种响应（操作->响应）被称为EditPolicy，这是策略模式的典型实现，Policy可以认为是一个Map，输入一个Request，输出其对应的Command 用户对图元的操作（拖拽、选择）被称为Request 用户对图元的操作是可以分类的，这个类型被称为Role。比如拖动图元移动位置，拖动图元边框改变图元大小是影响布局的操作，称为LAYOUT_ROLE；双击图元修改图元上的文字信息，双击连线上的问题修改连线的说明，这些都是直接对图元进行修改的操作，称为DIRECT_EDIT_ROLE……，这样的操作类型有很多，以后有机会再进行系统的总结。 对于用户的操作，图元使用那种响应策略（是边框变粗、还是Label变成Input接受用户输入），取决于图元上注册的事件响应类型（Role），当然我们可以向图元同时注册多个响应策略，用于响应不同的用户输入： installEditPolicy&#40;EditPolicy.LAYOUT_ROLE, new DiagramLayoutEditPolicy&#40;&#41;&#41;; 关于此installEditPolicy()方法，我同组的小牛分析得比较透彻，看他：http://www.thankcreate.com/java/357 OK, 下面我们开始编码。 创建Command 首先创建一个Command类，用于响应用户的拖拽操作，com.zhlwish.learngef.command.AjustNodeConstraintCommand继承自org.eclipse.gef.commands.Command，代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 &#8230; <a href="http://www.zhlwish.com/2011/09/09/gef-step-by-step-9/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/09/09/gef-step-by-step-9/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 8</title>
		<link>http://www.zhlwish.com/2011/08/22/gef-step-by-step-8/</link>
		<comments>http://www.zhlwish.com/2011/08/22/gef-step-by-step-8/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 13:54:05 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=715</guid>
		<description><![CDATA[将View中的图形移到编辑器中 在View中是不能对图形进行移动、修改大小的，需要对图形进行修改必须使用Editor，因此，我们首先创建一个GEF编辑器，然后将图形显示在编辑器中。 创建编辑器 打开plugin.xml，打开Extensions标签页，添加org.eclipse.ui.editors扩展，然后添加一个Editor，Name为Nodes GEF Editor，Extensions为gef，如下图所示: 创建NodeGefEditor类，继承自GraphicalEditorWithFlyoutPalette，代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 package com.zhlwish.learngef.editor; &#160; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.gef.DefaultEditDomain; import org.eclipse.gef.palette.PaletteRoot; import org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette; &#8230; <a href="http://www.zhlwish.com/2011/08/22/gef-step-by-step-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/22/gef-step-by-step-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 7</title>
		<link>http://www.zhlwish.com/2011/08/22/gef-step-by-step-7/</link>
		<comments>http://www.zhlwish.com/2011/08/22/gef-step-by-step-7/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 13:53:53 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=706</guid>
		<description><![CDATA[添加Tooltips 我们希望用户将鼠标移动到图元上时，能够友好的显示图元的一些详细信息，可以通过Tooltip的方法实现。GEF中Figure类中定义了图元的Tooltip，其类型为IFigure，因此我们可以创建一个Label，然后将Label作为图元的Tooltip显示。 在NodeFigure类中添加一个私有方法createToolTip()，将结点的位置和背景的颜色显示给用户。 1 2 3 4 5 6 7 private Figure createToolTip&#40;&#41;&#123; Label tooltip = new Label&#40;&#41;; String color = model.getColor&#40;&#41;.toString&#40;&#41;; String loc = model.getLocation&#40;&#41;.toString&#40;&#41;; tooltip.setText&#40;color + &#34;, &#34; + loc&#41;; return tooltip; &#125; 之后在NodeFigure的构造函数中调用setToolTip()给图元设置Tooltip（下面代码的倒数第二行） 1 2 3 4 &#8230; <a href="http://www.zhlwish.com/2011/08/22/gef-step-by-step-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/22/gef-step-by-step-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 6</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step-6/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step-6/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:47:14 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=677</guid>
		<description><![CDATA[添加连接线 要在两个结点（Node）之间显示连接线，需要在模型上添加连接线，修改showDiagram()函数，在node和node2之间添加一个Connection对象，为了方便，先在Connection类中添加connection()方法，如下所示： public void connect&#40;Node source, Node target&#41;&#123; setSource&#40;source&#41;; setTarget&#40;target&#41;; source.addOutgoingConnection&#40;this&#41;; target.addIncomingConnection&#40;this&#41;; &#125; 接着在showDiagram()方法中创建Connection模型对象，并且连接node和node2。 private void showDiagram&#40;&#41; &#123; Diagram diagram = new Diagram&#40;&#41;; &#160; Node node = new Node&#40;&#41;; node.setText&#40;&#34;测试节点&#34;&#41;; node.setLocation&#40;new Point&#40;10, 10&#41;&#41;; diagram.addNode&#40;node&#41;; &#160; Node node2 = new Node&#40;&#41;; &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 5</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:45:41 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=662</guid>
		<description><![CDATA[显示Diagram模型 到目前为止，仅仅显示了一个节点（Node）的图形，如何显示多个节点，也就是一个Diagram的模型呢？ 我们修改NodeGefView类的showDiagram()方法，创建Diagram模型，并且创建两个Node模型，加入到Diagram中。 private void showDiagram&#40;&#41; &#123; Diagram diagram = new Diagram&#40;&#41;; &#160; Node node = new Node&#40;&#41;; node.setText&#40;&#34;测试节点&#34;&#41;; node.setLocation&#40;new Point&#40;10, 10&#41;&#41;; diagram.addNode&#40;node&#41;; &#160; Node node2 = new Node&#40;&#41;; node2.setText&#40;&#34;测试节点&#34;&#41;; node2.setLocation&#40;new Point&#40;10, 70&#41;&#41;; diagram.addNode&#40;node2&#41;; &#160; graphicalViewer.setContents&#40;diagram&#41;; &#125; 但是运行时发现，现在视图上无显示，连上一步显示的Node模型对应的矩形框都没有了。 解决这个问题，我们通过覆盖DiagramPart的父类的getModelChildren()方法实现，此方法默认返回空列表。首先在Diagram模型类中加入一个返回其孩子结点的方法： public &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF – 4</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step-4/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step-4/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:44:49 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=656</guid>
		<description><![CDATA[创建View 打开META-INF/MANIFEST.MF，在Extensions页面添加org.eclipse.ui.views扩展点，并添加一个名为“Nodes GEF View”的扩展点。 创建View对应的Java类 自定义视图需要继承自ViewPart类型，通过覆盖createPartControl()方法自定义视图上显示的内容。此处视图上显示一个ScrollingGraphicalViewer，GraphicViewer需要设置rootEditPart和EditPartFactory，然后调用setContent()方法传入模型对象，该方法能根据模型的类型生成相应的EditPart，然后创建相应的Figure并加入显示队列中进行绘图。 1 2 3 4 ScalableFreeformRootEditPart rootEditPart = new ScalableFreeformRootEditPart&#40;&#41;; ScrollingGraphicalViewer graphicalViewer = new ScrollingGraphicalViewer&#40;&#41;; graphicalViewer.setRootEditPart&#40;rootEditPart&#41;; graphicalViewer.setEditPartFactory&#40;new PartFactory&#40;&#41;&#41;; 整个View类的代码如下，我们自己定义了一个私有showDiagram()方法创建模型并调用setContent()方法。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step-4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF &#8211; 3</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step-3/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step-3/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:43:52 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=652</guid>
		<description><![CDATA[实现模型对应的Part 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package com.zhlwish.learngef.part; &#160; import org.eclipse.draw2d.IFigure; import org.eclipse.gef.editparts.AbstractGraphicalEditPart; &#160; import com.zhlwish.learngef.figure.NodeFigure; import com.zhlwish.learngef.model.Node; &#160; public class NodePart extends AbstractGraphicalEditPart&#123; &#160; &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF &#8211; 2</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step-2/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step-2/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:42:37 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=642</guid>
		<description><![CDATA[创建模型对应的Figure 由于节点对应的Figure中需要使用Color，因此先在Activator类中加入ColorRegistry类型的属性，修改之后如下，其中第20行和第50行以后为新增加的。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一步一步实现GEF &#8211; 1</title>
		<link>http://www.zhlwish.com/2011/08/12/gef-step-by-step-1/</link>
		<comments>http://www.zhlwish.com/2011/08/12/gef-step-by-step-1/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:40:55 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[GEF]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=628</guid>
		<description><![CDATA[创建项目 创建Eclipse Plugin项目，名称为com.zhlwish.learngef 打开META-INF/ MANIFEST.MF，在Dependencies标签页上Required Plug-ins区域，添加名称为org.eclipse.gef的插件依赖。 创建模型 定义三个模型类，Diagram，Node，Connection，分别代表整个GEF图，节点，节点之间的连线，GEF图类由结点组成 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 &#8230; <a href="http://www.zhlwish.com/2011/08/12/gef-step-by-step-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/12/gef-step-by-step-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java实践：最好提供无参数的构造函数</title>
		<link>http://www.zhlwish.com/2011/08/11/provide-none-param-constructor-in-java/</link>
		<comments>http://www.zhlwish.com/2011/08/11/provide-none-param-constructor-in-java/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 08:02:06 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=605</guid>
		<description><![CDATA[一个类在没有显式定义构造函数的时候，Java会隐式提供一个无参数的构造函数。但是当显式定义了构造函数的情况下，Java就不会提供这个无参数的构造函数了。这是由于在显式定义的构造函数中可能进行了一些必要的初始化工作，此时如果错误调用默认无参构造函数会导致这些必须的初始化工作并没有完成，进而导致程序异常。 经过编程实践，本人认为还是有必要再显式定义了有参构造函数的情况下，仍然显式定义一个无参构造函数。主要原因是“最好提供缺省值”（It will be better to provide a default value），另外一个原因则是在工厂方法中大量使用的java.lang.Class.newInstance()方法只能调用无参构造函数。 提供缺省值 在定义类的时候，最好为属性设置缺省值，以免出现Java中最常见的NullPointException，如下所示，当然此代码并不涉及构造函数神马事情，此处省略不相关的部分，下文类似。 1 2 3 public class NodeEditPart&#123; private List&#60;Connection&#62; incomings = new ArrayList&#60;Connection&#62;&#40;0&#41;; &#125; 通过构造函数设置属性值是非常常见的。下面代码摘取自java.awt.Label类，其中定义了空的构造函数，并且设置文本默认为空字符串。 1 2 3 4 5 6 7 8 9 10 public Label&#40;&#41; &#123; this&#40;&#34;&#34;, &#8230; <a href="http://www.zhlwish.com/2011/08/11/provide-none-param-constructor-in-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/11/provide-none-param-constructor-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JFace中的GridLayoutFactory和GridDataFactory</title>
		<link>http://www.zhlwish.com/2011/08/05/jface_gridlayoutfactory_griddatafactory/</link>
		<comments>http://www.zhlwish.com/2011/08/05/jface_gridlayoutfactory_griddatafactory/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 08:08:01 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[SWT. JFace]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=556</guid>
		<description><![CDATA[研究SWT Layout原理的时候，找到一个视频：《Creating a Custom Window Layout in Eclipse RCP Applications》，顿时被作者使用的GridLayoutFactory和GridDataFactory惊艳了，前些天，我还傻乎乎的自己写了几个简单的类实现相同的功能，无知真可怕。本文介绍了此两个类的用法，最后有一个简单的示例。 GridLayout SWT有四种布局方式：FillLayout，RowLayout，GridLayout，FormLayout，其中使用后三种布局方式的时候，需要为每个子控件指定专门的layout data，分别是RowData，GridData和FormData，这些布局方式和相关的设置，有篇德文的文章《SWT Layout-Manager》讲解得异常清楚，不懂德文不要紧，就看里面的图就行了，在此我转载两张关于GridLayout的图： GridLayout的属性 GridData的属性 使用GridLayoutFactory 先说GridLayoutFactory，一般我们要创建一个GridLayout需要这样： GridLayout layout = new GridLayout&#40;2, false&#41;; layout.marginHeight = 10; layout.marginWidth = 10; layout.horizontalSpacing = 5; layout.verticalSpacing = 5; 而GridLayoutFactory则可以这样创建： GridLayoutFactory.fillDefaults&#40;&#41;.numColumns&#40;2&#41;.margins&#40;10, 10&#41;.spacing&#40;5, 5&#41;.create&#40;&#41;; &#8230; <a href="http://www.zhlwish.com/2011/08/05/jface_gridlayoutfactory_griddatafactory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/05/jface_gridlayoutfactory_griddatafactory/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Eclipse RCP中获取Plugin/Bundle中文件资源的绝对路径</title>
		<link>http://www.zhlwish.com/2011/08/02/find-file-in-bundles-of-eclipse-rcp/</link>
		<comments>http://www.zhlwish.com/2011/08/02/find-file-in-bundles-of-eclipse-rcp/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 13:15:47 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=543</guid>
		<description><![CDATA[摘要：在进行Eclipse RCP开发的过程中，需要使用一些其他的资源（如图片、声音、配置文件、数据库等），我们一般将这些资源放到Plugin/Bundle的相应目录下（如图片资源放到icons目录，声音放到sounds目录，数据库文件放到data目录）。本文先对Eclipse Plugin和Bundle进行分析，之后讲解了如何使用Eclipse API通过这些资源的相对路径（相对于Plugin/Bundle）获取这些资源的绝对路径的方法，最后总结了org.osgi.framework.Bundle接口和FileLocator工具类的使用方法。 Bundle和Plugin Eclipse Platform架构于OSGi核心之上，每个Eclipse Plugin就是OSGi的一个Bundle，因此在Eclipse RCP中Plugin和Bundle是等价的概念。 OSGi框架中定义了org.osgi.framework.IBundle接口，表示运行于OSGi环境中的一个Bundle。Eclipse RCP中定义了org.eclipse.core.runtime.Plugin抽象类，代表一个Eclipse插件。但是Plugin抽象类并没有实现IBundle接口，而是在内部拥有一个IBundle对象实例。Plugin类实现了BundleActivator，控制其内部的IBundle对象的启动和停止，并负责将BundleContext注入到IBundle对象实例中。 我们可以发现，在IBundle接口中定义了如下几个方法，可以获取位于在Bundle文件目录中的资源： 方法 解释 URL getResource(String name); 通过Bundle的Class Loader加载资源，和Class.getResource(String)类似，注意如果当前的bundle是一个fregment，则返回null Enumeration getResources(String name) 和上面的方法一样，不过由于Eclipse插件可以包括多个Fregment，每个Fregment中可以分别包含相对路径相同的文件，因此通过一个相对路径可能找到多个匹配的资源 URL getEntry(String path); 在当前Bundle中根据Path找相应的Entry（此处的entry和resource到底有什么区别我还尚不清楚） Enumeration getEntryPaths(String path); 和上面的方法一样，同getResources(String) Enumeration findEntries(String path, String filePattern, boolean recurse); 根据path和pattern找相应的资源文件，可以使用通配符，如需要查找所有语言文件： bundle.findEntries(“OSGI-INF/l10n”, &#8230; <a href="http://www.zhlwish.com/2011/08/02/find-file-in-bundles-of-eclipse-rcp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/08/02/find-file-in-bundles-of-eclipse-rcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse RCP 中 Part 和 Site、菜单和工具栏</title>
		<link>http://www.zhlwish.com/2011/07/25/eclipse-rcp-part-and-site/</link>
		<comments>http://www.zhlwish.com/2011/07/25/eclipse-rcp-part-and-site/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 13:16:16 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=535</guid>
		<description><![CDATA[在进行 Eclipse RCP 开发的时候，由于 GUI 系统和 Eclipse 平台本身的复杂性，让我们很难理顺各种组件之间的关系，本文对 Eclipse RCP 的 GUI 组成结构进行分析，解释了 Workbench，Workbench Window，Workbench Page，Workbench Part，View Part 和 Editor Part 以及其相互之间的关系。并对和上述组件关系紧密的形如 I**Site 的类（包括 IWorkbenchSite，IWorkbenchPartSite，IPageSite，IViewSite，IEditorSite）进行了分析。 本文最后给出了一个在自定义 View 中加入上下文菜单、工具栏和下拉菜单的示例。 本文的全文PDF文件请点击《Eclipse RCP 中 Part 和 Site、菜单和工具栏》下载 本人撰写的其他Eclipse RCP文章： Eclipse RCP中的日志 Eclipse RCP开发中关于Image(图片)的API使用 &#8230; <a href="http://www.zhlwish.com/2011/07/25/eclipse-rcp-part-and-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/07/25/eclipse-rcp-part-and-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java播放音乐资料收集</title>
		<link>http://www.zhlwish.com/2011/07/21/java-play-music/</link>
		<comments>http://www.zhlwish.com/2011/07/21/java-play-music/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 17:20:44 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=441</guid>
		<description><![CDATA[Java播放音乐比较麻烦，主要原因是Java的跨平台导致。Java的播放音乐的API主要包括两部分，一是Java SE里面包含的Java Sound API，二是作为独立于Java SE之外的Java Music Framework。两者的主要差别在于所支持的声音文件格式不同。 本文只是对相关技术进行了简单罗列，收集了相关的链接地址，需要深入了解请进入相关链接深入阅读。 Java平台提供的sound API 支持的音频文件格式只有AIFF，AU，WAV 支持的音乐文件格式有MIDI，RMF(Rich Music Format) 声音格式：8位和16位单声道以及立体声音频数据，采样率在8khz和48khz之间 Java sound api简介 JavaTM Sound Programmer Guide Java Sound API: Java Sound Demo 使用第三方的库播放MP3格式的音乐 How to Play an MP3 File in Java：JLayer MP3 Library 使用Java &#8230; <a href="http://www.zhlwish.com/2011/07/21/java-play-music/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/07/21/java-play-music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse RCP开发中关于Image(图片)的API使用</title>
		<link>http://www.zhlwish.com/2011/07/18/eclipse-rcp-image-api/</link>
		<comments>http://www.zhlwish.com/2011/07/18/eclipse-rcp-image-api/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 14:06:28 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclispe RCP]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=434</guid>
		<description><![CDATA[Eclipse RCP开发中的Image API分为两个层次，一个是SWT层，另一个是JFace层面的。 SWT层面的API中的类主要包括Image，ImageData和ImageLoader三个，JFace层面的API中的类主要包括ImageDescriptor和ImageRegistry。 本文的全文PDF文件请点击《Eclipse RCP开发中关于Image(图片)的API使用》下载]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/07/18/eclipse-rcp-image-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse RCP中的日志</title>
		<link>http://www.zhlwish.com/2011/07/13/eclipse-rcp-plugin-log/</link>
		<comments>http://www.zhlwish.com/2011/07/13/eclipse-rcp-plugin-log/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 05:02:11 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Eclipse RCP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=422</guid>
		<description><![CDATA[完成Eclipse RCP平台日志功能是核心接口为：org.eclipse.core.runtime.ILog org.eclipse.core.internal.runtime.Log实现了该接口，主要方法如下： 构造函数： public Log&#40;Bundle plugin&#41; 方法： public void log&#40;final IStatus status&#41; 一般情况下插件的Activator继承自AbstractPlugin，也间接继承自Plugin，org.eclipse.core.runtime.Plugin中定义了: public final ILog getLog&#40;&#41; 通过该方法直接返回ILog实例，如果当前插件中没有ILog实例，则创建一个新的实例返回 另一个相关的接口是org.eclipse.core.runtime.IStatus，org.eclipse.core.runtime.Status类实现了这个接口，其构造函数如下： public Status&#40;int severity, String pluginId, int code, String message, Throwable exception&#41; 其中： severity为消息级别，在IStatus中有定义 pluginId为插件实例的ID code为消息类型编码，一般为IStatus.OK，各个Plugin可以自行定义status code message为消息内容 exception为异常实例，可以为null 示例： import &#8230; <a href="http://www.zhlwish.com/2011/07/13/eclipse-rcp-plugin-log/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2011/07/13/eclipse-rcp-plugin-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu下Eclipse安装反编译插件JadClipse</title>
		<link>http://www.zhlwish.com/2010/11/16/eclipse-decompiler-jadclipse/</link>
		<comments>http://www.zhlwish.com/2010/11/16/eclipse-decompiler-jadclipse/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 04:26:25 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[jad]]></category>
		<category><![CDATA[反编译]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=254</guid>
		<description><![CDATA[我是在Ubuntu中使用Eclipe helios，即eclipse 3.6，参考了这篇文章http://www.blogjava.net/hongjunli/archive/2007/08/15/137054.html安装jodeclipse不成功，打开class文件，报错“the editor&#8217;s class name was mistyped in plugin.xml.”，可能是因为jodeclipse不支持新版本的eclipse吧，于是考虑安装jadclipse，jadclipse是在一个非常不错的Java反编译工具，之前写过一篇博客介绍《Java反编译工具Jad详解》，这个作为续篇，介绍如何在Eclipse里面使用jad。 首先，还是到http://www.varaneckas.com/jad下载jad，为了给开源做点贡献，我也把windows和linux的两个版本下来，做个备份： 1. Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform 2. Jad 1.5.8e for Linux (statically linked) 以下以ubuntu为例，把下载后的jad解压到/opt/jad目录，我的eclipse安装在/opt/eclipse目录。cd到/opt/jad目录，执行./jad，输出版本和帮助信息就OK说明jad本身没有问题了。 到http://sourceforge.net/projects/jadclipse/下载jadeclipse，当前版本为3.3.0版本，支持eclipse3.3以上，下载后就是一个jar文件，直接放到/opt/eclipse/plugins目录，重启eclipse。 依次点击：Window -&#62; Preferences -&#62; Java，如果出现JadClipse，即说明jadclipse安装成功，不急，还有两个设置： 点击JadClipse，把Path to decompiler设置为/opt/jad/jad 点击General -&#62; Editors &#8230; <a href="http://www.zhlwish.com/2010/11/16/eclipse-decompiler-jadclipse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/11/16/eclipse-decompiler-jadclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL中drop user if exists功能的实现方法</title>
		<link>http://www.zhlwish.com/2010/07/30/mysql-drop-user-if-not/</link>
		<comments>http://www.zhlwish.com/2010/07/30/mysql-drop-user-if-not/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 11:48:32 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=218</guid>
		<description><![CDATA[在编写可以重复执行的创建数据库的脚本时，我们知道下面语句可以测试数据库是否存在，如果存在的话就删除掉 1 DROP DATABASE IF EXISTS testdb; 但是我们没办法测试用户是否存在，MySQL是没有drop user if exist这样的功能的。详见：http://bugs.mysql.com/bug.php?id=19166 不过有另外一种变通的办法可以实现同样的功能，代码如下： 1 2 3 4 # a way TO implement the functionality OF 'drop user if exists' which mysql does # NOT support FOR now GRANT usage ON *.* &#8230; <a href="http://www.zhlwish.com/2010/07/30/mysql-drop-user-if-not/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/07/30/mysql-drop-user-if-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java反编译工具Jad详解</title>
		<link>http://www.zhlwish.com/2010/06/26/jad/</link>
		<comments>http://www.zhlwish.com/2010/06/26/jad/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 11:18:34 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jad]]></category>
		<category><![CDATA[反编译]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=196</guid>
		<description><![CDATA[做项目过程中需要反编译一个jar包，于是作了一些学习，记录下来。 Jad(JAva Decompiler)是一个Java的反编译器，可以通过命令行把Java的class文件反编译成源代码。 如果你在使用编写代码的时候遇到找不到源代码的第三方库，而且你又需要看看这个库的具体实现，那么你就需要使用这个东西。而且如果你是使用Eclipse的话，还有一个Eclipse插件JadClipse，JadClipse提供一个class文件查看器可以直接打开class文件查看其反编译后的源代码， 太方便了，太方便了！ 不过，可惜的是这个开源项目似乎已经关闭了，官方网站已经上不去了，有个叫Tomas Varaneckas的好心人收集了所有的版本提供给大家下载：JAD Java Decompiler Download 而且这个最新的版本也只支持Java 4，不支持Java 5。还有一个叫做JD-Core的工具支持Java 5的新特性，如enum等，而且它提供独立的GUI程序JD-GUI和基于Eclipse的插件JD-Eclipse，也很方便。但是对于JD-Core，作者没有提供下载的链接，他说“Open the sources of JD-Core is not on my roadmap: I spent too many time on this project.”当然后面也有一大篇文章是别人用来骂他的，可以看Add JD-Core to the download list，蛮有意思。 我的项目中需要将第三方库反编译出来，让后对其进行修改，然后再编译，不仅仅是查看，因此只能用命令行的Jad来做。 使用方法： [1] 反编译一个class文件：jad &#8230; <a href="http://www.zhlwish.com/2010/06/26/jad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/06/26/jad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java注释中的@deprecated与源代码中的@Deprecated</title>
		<link>http://www.zhlwish.com/2010/05/10/java_deprecated/</link>
		<comments>http://www.zhlwish.com/2010/05/10/java_deprecated/#comments</comments>
		<pubDate>Mon, 10 May 2010 12:55:25 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java annotation]]></category>
		<category><![CDATA[javadoc]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=187</guid>
		<description><![CDATA[首先，请注意标题，这两个标记有大小写之分，一个是D，一个是d。 源代码标记@Deprecated是在JDK1.5中作为内置的annotation引入的，用于表明类(class)、方法(method)、字段(field)已经不再推荐使用，并且在以后的JDK版本中可能将其删除，编译器在默认情况下检测到有此标记的时候会提示警告信息。 Java注释中的@deprecated用于在用Javadoc工具生成文档的时候，标注此类/接口、方法、字段已经被废止。 不过后者还有一个功能就是和源代码标记@Deprecated同样的功能，在JDK1.4版本之后，该功能被@Deprecated所取代。]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/05/10/java_deprecated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个隐藏了将近2年的Bug</title>
		<link>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/</link>
		<comments>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 17:48:59 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=152</guid>
		<description><![CDATA[最近在维护华中科技大学电信系的电子档案库，发现了一个隐藏了将近2年的Bug，记录如下： 需求：一个科研项目有一定的工作量，而每个项目有很多参与人，需要为每个参与人设置其工作量分配额度。当用户添加了一个项目时，需要同时添加其参与人: 实现：当用户录入了科研项目信息之后，点击“添加参与人”的按钮，转向到选择参与人的页面，可以勾选任意数目的参与人，点击“保存”按钮后返回科研项目信息页面。 在执行保存选择的参与人信息时，检查所选择的人员是否已经在科研项目的参与人中存在的代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 for &#40;Iterator&#60;string&#62; iterator = selectedMemberList.iterator&#40;&#41;; iterator.hasNext&#40;&#41;;&#41; &#123; ParticipatorBean participatorBean = new ParticipatorBean&#40;&#41;; long teacherId = Long.parseLong&#40;iterator.next&#40;&#41;&#41;; Teacherbasicinfo teacher = ServiceProvider.getTeacherInfoService&#40;&#41;.findById&#40;teacherId&#41;; Long id = &#8230; <a href="http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java int型转换中文大写数字表示方法</title>
		<link>http://www.zhlwish.com/2010/01/21/java-int-to-chinese-number/</link>
		<comments>http://www.zhlwish.com/2010/01/21/java-int-to-chinese-number/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 10:10:22 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=150</guid>
		<description><![CDATA[之前写过一篇博客，记录的是如何将Java中文大写数字转int型，今天遇到的问题是将Java int型转换成中文大写数字表示。 下面是程序，很容易理解，不过，只支持10000以内的数字转换： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 &#8230; <a href="http://www.zhlwish.com/2010/01/21/java-int-to-chinese-number/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/01/21/java-int-to-chinese-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scala要点(1)</title>
		<link>http://www.zhlwish.com/2009/11/15/scala-outline/</link>
		<comments>http://www.zhlwish.com/2009/11/15/scala-outline/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:42:38 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=69</guid>
		<description><![CDATA[注：本文是本人在了解scala过程中的一些要点笔记而已，仅帮助学过的朋友进行一下回忆，也供本人以后快速复习用。 scala有两种变量类型，val与var，val型变量初始化了就不能再改变，var则可以改变 scala可以自动推断变量类型，如val name = “zhlwish”  scala定义函数: def add(x: Int, y: Int): Int = if (x &#62; y) x else y   for语句写法： for(arg &#60;- args) println(arg)   foreach是List类型的一个函数，调用方法args.foreach((arg: String) =&#62; println(arg))，看起来是lamda表达式   数组只能如下定义： val names = new Array(3) //默认构造器构造 val &#8230; <a href="http://www.zhlwish.com/2009/11/15/scala-outline/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/15/scala-outline/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Java中文大写数字转int型</title>
		<link>http://www.zhlwish.com/2009/11/15/java-chinese-number-to-int/</link>
		<comments>http://www.zhlwish.com/2009/11/15/java-chinese-number-to-int/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:34:38 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=62</guid>
		<description><![CDATA[暂时不支持万以上级别，后面会加上这个。道理很简单，但我搜了一下google，找到的代码没有几个能直接用，所以分享下，直接贴代码了：     public static int chnNumToIntConverter(String chnNum){         HashMap&#60;String, Integer&#62; numbers = new HashMap&#60;String, Integer&#62;();         numbers.put(“零”, 0);         numbers.put(“一”, 1);         numbers.put(“二”, 2);         numbers.put(“三”, 3);         numbers.put(“四”, 4);         numbers.put(“五”, 5); &#8230; <a href="http://www.zhlwish.com/2009/11/15/java-chinese-number-to-int/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/15/java-chinese-number-to-int/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Working copy path &#8216;*&#8217; does not exist in repository的解决方法</title>
		<link>http://www.zhlwish.com/2009/11/15/working-copy-path-does-not-exist-in-repository/</link>
		<comments>http://www.zhlwish.com/2009/11/15/working-copy-path-does-not-exist-in-repository/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:28:12 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=55</guid>
		<description><![CDATA[开发中对一个working copy进行update操作的时候出现了标题所示的错误，因为在update之前对其进行了switch操作，因此猜想可能是因为这个缘故，上网查了一下，找到一篇文章《SVN merger errors: Working copy path &#8216;*&#8217; does not exist in repo》。 按照其描述的方法并不能解决我的问题，但是让我对.svn文件夹下的这个entry文件产生了兴趣，仔细的看了一下，发现这个文件里面有一行是写的版本号，紧接着下一行就是文件夹路径，但是这个文件夹路径是错误的。 对其进行了改正后，重新update，正常了，看来是svn的一个bug吧。]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/15/working-copy-path-does-not-exist-in-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个ant的build.xml文件实例</title>
		<link>http://www.zhlwish.com/2009/11/15/ant-build-xml-example/</link>
		<comments>http://www.zhlwish.com/2009/11/15/ant-build-xml-example/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:15:09 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ant]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=43</guid>
		<description><![CDATA[很简单，很实用，写完之后，发现，嘿嘿！我居然可以不翻doc写build文件了。 &#38;lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&#38;gt; &#38;lt;project name=&#34;dian_bid&#34; basedir=&#34;.&#34; default=&#34;deploy&#34;&#38;gt; &#160;  &#38;lt;property name=&#34;source&#34; location=&#34;src&#34; /&#38;gt;  &#38;lt;property name=&#34;resource&#34; location=&#34;res&#34; /&#38;gt;  &#38;lt;property name=&#34;test-srouce&#34; location=&#34;test&#34; /&#38;gt;  &#38;lt;property name=&#34;release-resource&#34; location=&#34;release&#34; /&#38;gt;  &#38;lt;property name=&#34;dest&#34; location=&#34;dest&#34; /&#38;gt; &#160;  &#38;lt;property name=&#34;webroot&#34; location=&#34;web&#34;/&#38;gt;  &#38;lt;property name=&#34;tomcat-root&#34; location=&#34;D:/Java/apache-tomcat-a&#34;/&#38;gt; &#160;  &#38;lt;target name=&#34;clean&#34;&#38;gt; &#8230; <a href="http://www.zhlwish.com/2009/11/15/ant-build-xml-example/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/15/ant-build-xml-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java中的静态导入：import static</title>
		<link>http://www.zhlwish.com/2009/11/15/java-import-static/</link>
		<comments>http://www.zhlwish.com/2009/11/15/java-import-static/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 22:14:04 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=4</guid>
		<description><![CDATA[静态导入是JDK1.5里面的新的特性 一般我们常写 import java.util.*; 意思是导入util包下的所有类，然后使用下面的语句用sort对alist进行排序。 Collections.sort(alist); 在jdk1.5中，我们可以写 import static java.util.Collections.*; 意思是导入Collections类的所有静态方法（注意只是静态方法），这样我们可以使用下面的语句达到同样的效果： sort(alist); 读到这里，可能很多人就要想了，System.out.println(“”);应该也可以写简单一点吧（我开始也是这么想的）。不好意思，呵呵，println是out的实例方法，非静态方法，不能用上面的简写的。 但是可以用一种变通的方法，自己实现一个静态的println，然后调用这个就行了。 import的作用就是告诉编译器，当你遇到无法解析的名字时，去某个路径找。所以当编译器遇到sort后，就在java.util.Collections下找到了sort这个名字（函数签名），然后再找是否有匹配的函数。结果以下的奇怪东西就有意思了： import static java.util.Arrays.sort; import static java.util.Collections.sort; 两个sort毫无冲突，因为这两个类没有相同的sort函数（函数签名不一样），邻里融洽。 其实这种方法真是很无奈。]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/15/java-import-static/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

