??xml version="1.0" encoding="utf-8" standalone="yes"?>99久re热视频这里只有精品6,成人一区二区三区视频在线观看,久热av在线http://www.aygfsteel.com/GEF/archive/2009/03/29/262712.html子非?/dc:creator>子非?/author>Sun, 29 Mar 2009 05:27:00 GMThttp://www.aygfsteel.com/GEF/archive/2009/03/29/262712.html阅读全文
]]>- eclipse.ini内存讄各参数含义(转)http://www.aygfsteel.com/GEF/archive/2009/03/28/262575.html子非?/dc:creator>子非?/author>Sat, 28 Mar 2009 03:54:00 GMThttp://www.aygfsteel.com/GEF/archive/2009/03/28/262575.htmlhttp://www.aygfsteel.com/GEF/comments/262575.htmlhttp://www.aygfsteel.com/GEF/archive/2009/03/28/262575.html#Feedback1http://www.aygfsteel.com/GEF/comments/commentRss/262575.htmlhttp://www.aygfsteel.com/GEF/services/trackbacks/262575.html阅读全文

]]> - java.lang.OutOfMemoryError: PermGen space及其解决Ҏ(?http://www.aygfsteel.com/GEF/archive/2009/03/28/262560.html子非?/dc:creator>子非?/author>Sat, 28 Mar 2009 02:09:00 GMThttp://www.aygfsteel.com/GEF/archive/2009/03/28/262560.html阅读全文

]]> - 深入研究java对String字符串对象的创徏以及理(?http://www.aygfsteel.com/GEF/archive/2009/03/28/262558.html子非?/dc:creator>子非?/author>Sat, 28 Mar 2009 01:18:00 GMThttp://www.aygfsteel.com/GEF/archive/2009/03/28/262558.html阅读全文

]]> - Eclipse 快捷键定Ӟ转)http://www.aygfsteel.com/GEF/archive/2008/10/06/232671.html子非?/dc:creator>子非?/author>Mon, 06 Oct 2008 07:18:00 GMThttp://www.aygfsteel.com/GEF/archive/2008/10/06/232671.html转自Qhttp://lemon.javaeye.com/blog/51480
http://www.aygfsteel.com/fhawk/archive/2007/01/16/28993.html
利用IKeyBindingService接口为Actionl定快捷键:
1?br style="font-family: " />
讄commands extension
<extension
point = "org.eclipse.ui.commands">
<!-- activeKeyConfiguration用来说明所l定快捷键的初始讄 -->
<activeKeyConfiguration value="org.eclipse.ui.defaultAcceleratorConfiguration"/>
<!-- 如果快捷键设|有多套Q可以添加多个类?nbsp;-->
<category
name="intelliPlatform.Category1"
description="Test description"
id="intelliPlatform.Category1"/>
<!-- 其中id个command的IDQ相关的action通过q个ID标志扑ֈq个command -->
<command
name="intelliPlatform.command.DataSource"
category="intelliPlatform.Category1"
description="数据源配|?
id="com.longtop.intelliplatform.ide.project.commands.DataSource"/>
<!-- 具体的快捷键讄Q其中command指定实际的coomand的ID -->
<keyBinding
command="com.longtop.intelliplatform.ide.project.commands.DataSource"
configuration="org.eclipse.ui.defaultAcceleratorConfiguration"
keySequence="Ctrl+Shift+D"/>
</extension>
以上是设|了plugin.xml中command extensionQƈ指定了keybindingQ在keybinding?br />
的keysequence中的字符串是讄的快捷键?nbsp;
------------
在具体的Action配置中,只要在其属性definitionId讄成command的ID卛_Q示例如下:
<action
label="Sample Action"
icon="icons/sample.gif"
class="cli.bacchus.portal.ui.actions.BacchusAction"
tooltip="Hello, Eclipse world"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
id="bacchus.portal.ui.actions.BacchusAction"
definitionId="com.longtop.intelliplatform.ide.project.commands.datesource">
</action>
注意Q当l相关的action讄完definitionID后,必须保证其中讄的command是有的,而且是正的Q否则有可能D该action昄不出来?br />
更具体的信息请参考eclipse开发参考中关于扩展点org.eclipse.ui.commands的详l描q?br />
------------
2?br />
建立Acion,在此建立的action可以是实现IAction接口的Q何类。比较方便的是?br />
org.eclipse.jface.ActionQ然后在新类中覆盖父cȝrunQ) Ҏ.

public class CopyAction extends Action
{

public CopyAction()
{
setId("org.example.copyaction");
setActionDefinitionId("com.longtop.intelliplatform.ide.project.commands.DataSource");
}
}
3?br />
在创建CopyAction的instance之后Q将copyActionInstance用IKeyBindingServicel定?br />
指定的command?br />
获得IKeyBinddingservice的一U简单方式ؓQ?br />
IKeyBindingService keyBindingService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite().getKeyBindingService();
keyBindingService.registerAction(copyActionInstance);
注意Q?br />
1、action的definitionid和command定义的id必须一致?br />
2、当指定的keySequence与系l默认的冲突Ӟ如:在窗体的菜单栏中
指定了Edit->Copy(默认的快捷键为Ctrl+C),若将上面的keySequence改ؓ
M1+C(Ctrl+C)则系l默认的快捷?Ctrl+C)更改ؓCtrl+Insert。即RCP默认
的ؓ用户指定的优先,pȝ动态更新?br />
3、IKeyBindingService指定的快捷键是有作用范围的?br />
Z菜单l定快捷?/span>
主菜单的快捷键即?Alt + 菜单名称中带下划U的字母
定义主菜单快捷键只要在主菜单lable中确定的字母前面加上&字符卛_
如:
plugin.properties menulabel = &Intelliplatform
plugin_zh.properties menulabel = q_(&I)
Q注意:在该label引用的properties国际化文件中加,直接在plugin.xml中加好像无效Q此处存疑)

]]> - 待整理的东东http://www.aygfsteel.com/GEF/archive/2008/04/12/192480.html子非?/dc:creator>子非?/author>Sat, 12 Apr 2008 15:07:00 GMThttp://www.aygfsteel.com/GEF/archive/2008/04/12/192480.htmlJAVA中HashMap的成员遍?/span>
Ҏ一Q?nbsp;
Set entries;
entries=map.keySet();
Iterator iter=entries.iterator();
while(iter.hasNext()){
Object obj=iter.next();
System.out.println(obj+":"+map.get(obj));
}
Ҏ二:
Set entries;
entries=map.entrySet();
Iterator iter=entries.iterator();
while(iter.hasNext())
{
System.out.println(iter.next()+" ");
}
另外QJAVA?interface和class都可以作为对变量的声明?br />

public static void copyDirtoDest(String srcDir, String toDir)
{
Copy copyDir = new Copy();
copyDir.setOverwrite(true);
copyDir.setProject(new Project());
FileSet fileSet = new FileSet();
fileSet.setDir(new File(srcDir));
copyDir.addFileset(fileSet);
File dest = new File(toDir);

copyDir.setTodir(dest);
copyDir.execute();
}


public static void copyFiletoDestDir(String srcFile, String destDir)
{
Copy copy = new Copy();
copy.setProject(new Project());
copy.setFile(new File(srcFile));
copy.setTodir(new File(destDir));
copy.execute();
}


public static void makeDir(String dir)
{
Mkdir mkdir = new Mkdir();
mkdir.setProject(new Project());
mkdir.setDir(new File(dir));
mkdir.execute();
}


public static void copyFiletoDestandRename(String srcFile, String destFile)
{
Copy copyTask = new Copy();
copyTask.setProject(new Project());
copyTask.setFile(new File(srcFile));
copyTask.setTofile(new File(destFile));
copyTask.execute();
}


public static void moveFiletoDest(String srcFile, String destDir)
{
Move move = new Move();
move.setProject(new Project());
move.setFile(new File(srcFile));
move.setTodir(new File(destDir));
move.execute();
}
验证文g夹名U是否符合java包名规范
//弱验证(只要能被java支持的名Uͼ如中文名Uͼ
IStatus val = JavaConventions.validatePackageName(folder);

if (val.getSeverity() == IStatus.ERROR)
{
return false;
}

/** *//**
* 强验证:是否是严格符合命名规范的包名Q标识:以字母开_字母与数字的l合Q字母必都是小写?br />
* @param str1
* @return
*/

public static boolean isPackageName(String str1)
{
String regex = "^[a-z][a-z[\\d]]*";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(str1);
return m.matches();
}
hibernate3 hql 参数q问题
Hql中有中文参数Q如from test as c where c.name='张三'Q的话被译成sql的时候会出现q,解决ҎQ?br />
在Spring的配制文件applicationContext.xml文g中添加以下代码:
<property name="hibernateProperties">
<props>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
</props>
</property>
list转Array
(IAction[]) list.toArray(new IAction[0]);
(IAction[]) list.toArray(new IAction[list.size()]);

]]>- 有关插g工程构徏和打包的问题http://www.aygfsteel.com/GEF/archive/2008/02/20/180773.html子非?/dc:creator>子非?/author>Wed, 20 Feb 2008 02:10:00 GMThttp://www.aygfsteel.com/GEF/archive/2008/02/20/180773.html
打包时过滤文?br />
在build.properties中的bin.excludes加入要过滤的文g
Q例如:qojar包中所有文件夹下的CC配置文g.copyarea.dbQ应该填?bin.excludes = **/.copyarea.db Q?/span>
构徏时过滤文?/span>
Properties -> Java Compiler -> Building
NEnable project specific settings, 在Output folder栏的Filtered Resources中填写你要过滤的文g Q例如:qobin目录中所有文件夹下的CC配置文g.copyarea.dbQ应该填?*.copyarea.dbQ?/span>

]]> - JAVA奇技淫yhttp://www.aygfsteel.com/GEF/archive/2008/01/24/177449.html子非?/dc:creator>子非?/author>Thu, 24 Jan 2008 03:30:00 GMThttp://www.aygfsteel.com/GEF/archive/2008/01/24/177449.html内部c调用外部类对象Q{Q?/span>
内部cd以用外部类?this引用外部cȝ当前对象,然后可以用外部类的Q何属性和Ҏ?nbsp;

class OuterClass
{

public void show()
{
System.out.println("method of out class");
}

class InnerClass
{

public void showStr()
{
OuterClass.this.show()
}
}
String[] strs = str.split(",");
web.xml中配|tag-lib间接引用
<%@ taglib uri="http://www.ccb.cn/xmdc" prefix="xmdc"%>
在web.xml中增加下面的内容Q?/span>
<taglib>
<taglib-uri>http://www.ccb.cn/xmdc</taglib-uri>
<taglib-location>/WEB-INF/xmdc.tld</taglib-location>
</taglib>
颖反编译工h法反~译jdk1.5以上的class的解军_?/span>
下蝲可以反编?.5以上的jdk~译的class的新版本jad.exeQ替换掉在window路径下的颖用的老版本的 jad.exe Q小颖就好用了?/span>
其实颖也就是jad.exe的一个shellQ替换了好了?/span>
jad的下载地址Qhttp://www.kpdus.com/jad.html#download

]]> - copyPropertiesҎ分析(?http://www.aygfsteel.com/GEF/archive/2007/10/25/155789.html子非?/dc:creator>子非?/author>Thu, 25 Oct 2007 02:16:00 GMThttp://www.aygfsteel.com/GEF/archive/2007/10/25/155789.htmlBeanUtils和PropertyUtilscL许多开源框架中频繁使用的两个工P它们都能实现一个类中的属性拷贝到另一个类中,q个功能甚至是spring实现依赖注入的基。研I一下apache的comon包中如何实现q个两个工具Q可以发现它们都是用java.lang.reflect和java.beansq两个包下的几个cL实现的?
q里我们通过~写一个将一个类的所有属性拷贝到另一个类的相应属性的Ҏ来分析是如何实现拯功能?先把Ҏ放上来:

/** *//** 实现源cd性拷贝到目标cM
* @param source
* @param target
*/

public static void copyProperties(Object source, Object target)
{

try
{
//获取目标cȝ属性信?/span>
BeanInfo targetbean = Introspector.getBeanInfo(target.getClass());
PropertyDescriptor[] propertyDescriptors = targetbean.getPropertyDescriptors();
//Ҏ个目标类的属性查找setҎQƈq行处理

for (int i = 0; i < propertyDescriptors.length; i++)
{
PropertyDescriptor pro = propertyDescriptors[i];
Method wm = pro.getWriteMethod();

if (wm != null)
{//当目标类的属性具有setҎӞ查找源类中是否有相同属性的getҎ
BeanInfo sourceBean = Introspector.getBeanInfo(source.getClass());
PropertyDescriptor[] sourcepds = sourceBean.getPropertyDescriptors();

for (int j = 0; j < sourcepds.length; j++)
{

if (sourcepds[j].getName().equals(pro.getName()))
{ //匚w
Method rm = sourcepds[j].getReadMethod();
//如果Ҏ不可讉K(getҎ是私有的或不可达),则抛出SecurityException

if (!Modifier.isPublic(rm.getDeclaringClass().getModifiers()))
{
rm.setAccessible(true);
}
//获取对应属性get所得到的?/span>
Object value = rm.invoke(source,new Object[0]);

if (!Modifier.isPublic(wm.getDeclaringClass().getModifiers()))
{
wm.setAccessible(true);
}
//调用目标cd应属性的setҎ对该属性进行填?/span>

wm.invoke((Object) target, new Object[]
{ value });
break;
}
}
}
}

} catch (IntrospectionException e)
{
e.printStackTrace();

} catch (IllegalArgumentException e)
{
e.printStackTrace();

} catch (IllegalAccessException e)
{
e.printStackTrace();

} catch (InvocationTargetException e)
{
e.printStackTrace();
}
}

两个工具的其他方法实现虽然有点差?但原理都跟上面的例子差不?有兴的话可以写个测试类试试是否可以使用.
转自Q?http://lemonfamily.blogdriver.com/lemonfamily/1240784.html

]]>
վ֩ģ壺
|
|
麣|
|
¡|
ͤ|
|
|
|
ٹ|
ɽ|
|
ľ|
캵|
|
|
|
|
|
ǰ|
½|
|
|
|
㺺|
|
|
Ӧ|
Ԫ|
ˮ|
|
躣|
ʡ|
ͨ|
|
|
ӳ|
ɽʡ|
ʡ|
½|
佭|