1.如果选中的是目录,则在资源管理器中打开这个目录(而不是在它的上级选中该目录);2.如果选中的是文件,则资源管理器中打开所在的文件夹并选中这个文件;另外,顺便把新的xp风格图标给拿了过来。
easyexplore的cvs地址是anonymous@easystruts.cvs.sourceforge.net:/cvsroot/easystruts,下载源码之后发现easyexplore已经悄悄的更新了,多了“执行外部命令”等功能,图标也改成xp风格,不过多了一层子菜单,感觉不如原来方便,而且我只对explore这个功能感兴趣,所以只取回org/sf/easyexplore/EasyExplorePlugin.java,org/sf/easyexplore/actions/EasyExploreAction.java和org/sf/easyexplore/preferences/EasyExplorePreferencePage.java三个文件的1.1版本进行修改。代码是相当的简单:
在EasyExplorePlugin.java中改变defaultTagert的值:
protected void initializeDefaultPreferences(IPreferenceStore store) {
String defaultTarget = "shell_open_command {0}";
String osName = System.getProperty("os.name");
if ( osName.indexOf("Windows") != -1 ) {
defaultTarget = "explorer.exe /e,";
}
else if ( osName.indexOf("Mac") != -1 ) {
defaultTarget = "open";
}
store.setDefault(EasyExplorePreferencePage.P_TARGET, defaultTarget);
}
在EasyExploreAction.java中增加一个判断条件,如果选中的文件那么在资源管理器中也选中之:
public void run(IAction action) {
try {
if ( "unknown".equals(selected) ) {
MessageDialog.openInformation(new Shell(),"Easy Explore","Unable to explore " + selectedClass.getName());
EasyExplorePlugin.log("Unable to explore " + selectedClass);
return;
}
File directory = null;
if ( selected instanceof IResource ) {
directory= new File(((IResource)selected).getLocation().toOSString());
} else if ( selected instanceof File ) {
directory= (File) selected;
}
String target = EasyExplorePlugin.getDefault().getTarget();
if (!EasyExplorePlugin.getDefault().isSupported()) {
MessageDialog.openInformation(new Shell(),"Easy Explore",
"This platform (" +
System.getProperty("os.name") +
") is currently unsupported.\n" +
"You can try to provide the correct command to execute in the Preference dialog.\n" +
"If you succeed, please be kind to post your discovery on EasyExplore website http://sourceforge.net/projects/easystruts,\n" +
"or by email farialima@users.sourceforge.net. Thanks !");
return;
}
if(directory.isFile()
&& System.getProperty("os.name").indexOf("Windows") != -1 ) {
target = target.trim() + "/select,";
}
if ( target.indexOf("{0}") == -1 ) {
target = target.trim() + " {0}";
}
target = MessageFormat.format(target, new String[]{directory.toString()});
try {
EasyExplorePlugin.log("running: "+target);
Runtime.getRuntime().exec(target);
} catch ( Throwable t ) {
MessageDialog.openInformation(new Shell(),"Easy Explore","Unable to execute " +target);
EasyExplorePlugin.log(t);
}
} catch (Throwable e) {
EasyExplorePlugin.log(e);
}
}
分享到:
相关推荐
easy explorer eclipse插件 改造的easyexplore插件 easy explorer eclipse插件
eclipse-easyexplore插件.用于eclipse快速打开文件(文件夹)所在位置。安装方法:解压放到Eclipse目录下,记得改links目录下.link文件里路径。
easyexplore eclipse插件 easy explore
附件中包含了eclipse的svn插件和easyexplore插件,只需要将附件解压,然后将links和more两个文件夹复制到eclipse的安装目录下即可使用。
easyexplore 很多人已经在eclipse中有使用,但可能有些人需要用到MyEclipse中,在此我将分享一下在使用的一些心得。方便那些有需要的PY
easyexplore,快速打开文件位置,比其他easyexplore插件更强大,可打开java文件所在位置
eclipse插件easyexplore 基于org.sf.easyexplore_1.0.4版本实现 4.5版本可用。直接将jar插件放进Eclipse的Plugins目录下即可。
官方的EasyExplore插件在配置了/select选项后,选中的是当前文件父文件夹。此文件为修改过源代码、重新编译过的jar,当操作文件时,选中当前文件;当操作文件夹时,选中当前文件夹。使用方法:放到plugins下。
非常好用的eclipse开发插件 在eclipse中右键打开文件位置 网上这个东西非常难找,所以 我放上一个!
eclipse插件easyexplore 基于org.sf.easyexplore_1.0.4版本实现 eclipse4.5、eclipse4.7版本可用
eclipse插件easyexplore,这个插件是打开在eclipse中选定文件所在的目录, 附:安装方法
快速定位文件资源, 在eclipse打开的文件编辑页面,右键后,就能打开该文件在本地资源的相应文件夹 很方便
easyexplore
eclipse(myeclipse)的easyexplore和反编译插件 easyexplore当右键点击easy explore时,能快速定位到本地资源文件。 反编译插件是让我们在开发时,能够看到引入jar文件的源代码,看到具体的实现过程,是开发时很重要...
eclipse中的插件 easyexplore_1.0.4.zip 方便查找目录
eclipse插件easyexplore 基于org.sf.easyexplore_1.0.4版本实现 4.5版本可用。直接将jar插件放进Eclipse的Plugins目录下即可。
NULL 博文链接:https://regbin.iteye.com/blog/1153425
org.easyexplore_1.0.1.zip
博文链接:https://blueskylan.iteye.com/blog/250053
easyexplore1.0.4.rar