Eclipse插件开发调试篇

  • 介绍
本文介绍如何定制一种适合自己项目调试的方式。
  • 扩展点 org.eclipse.debug.ui.launchShortcuts
[codesyntax lang="xml"]
<extension
 point="org.eclipse.debug.ui.launchShortcuts">
 <shortcut class="surenpi.com.dev.debugger.surenpi.comShortcut"
 	icon="icons/surenpi.com16x16.png"
 	id="surenpi.com.dev.debugger.launchShortcuts"
 	label="surenpi.comDebug"
 	modes="run,debug">
 	<configurationType
 		id="surenpi.com.dev.debugger.launchConfigurationTypes"/>
 	<contextualLaunch>
 		<enablement>
 			<with variable="selection">
 				<count value="1">
 				</count>
 				<iterate>
 					<or>
 						<test
 							property="org.eclipse.debug.ui.matchesPattern"
 							value="*.xml">
 						</test>
 					</or>
		         		<or>
		                    <adapt type="org.eclipse.core.resources.IFile">
		                       <test property="org.eclipse.core.resources.name" value="pom.xml"/>
		                    </adapt>
		                    <adapt type="org.eclipse.core.resources.IProject">
		                       <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.m2e.core.maven2Nature"/>
		                    </adapt>
		                 </or>
 				</iterate>
 			</with>
 		</enablement>
 	</contextualLaunch>
 </shortcut>
</extension>
[/codesyntax] 以上扩展点用于在项目或者文件上右键运行的配置。 对应的实现类如下; [codesyntax lang="php"]
/**
* surenpi.com
*/

import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;

/**
 * @author surenpi.com
 * @since jdk1.6
 * 2015年8月10日
 */
public class GboatShortcut implements ILaunchShortcut {

	@Override
	public void launch(ISelection arg0, String arg1) {
		System.out.println("public void launch(ISelection arg0, String arg1) {");
	}

	@Override
	public void launch(IEditorPart arg0, String arg1) {
		System.out.println("public void launch(IEditorPart arg0, String arg1) {");
	}

}
[/codesyntax]

转载于:https://my.oschina.net/surenpi/blog/816865

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值