作者:佚名 | 来源:网络 | 添加时间:2006-06-11 21:34:15 | 人气:3781
public class ManageBreakpointRulerActionDelegate extends AbstractRulerActionDelegate{
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
return new ManageBreakpointRulerAction(rulerInfo, editor);
}
}
public class ManageBreakpointRulerAction extends Action implements IUpdate{
private IVerticalRulerInfo rulerInfo;
private ITextEditor textEditor;
private String BPmarkerType ; //当点Marker的类型
private List allMarkers; //当前鼠标点击行所有的Marker
private String addBP; //Action 的显示名称
public ManageBreakpointRulerAction(IVerticalRulerInfo ruler, ITextEditor editor){
this.rulerInfo = ruler;
this.textEditor = editor;
BPmarkerType = IBreakpoint.BREAKPOINT_MARKER;
addBP = "添加/删除断点"; //$NON-NLS-1$
setText(this.addBP);
}
public void update() {
this.allMarkers = this.fetchBPMarkerList();
}
public void run(){
if(this.allMarkers.isEmpty())
this.addMarker();
else
this.removeMarkers(this.allMarkers);
}
}