eclipse command java_Java类org.eclipse.ui.commands.ICommand的实例源码 - 编程字典

/**

* Creates the controls that allow the user to specify the breakpoint's

* condition

* @param parent the composite in which the condition editor should be created

* @throws CoreException if an exception occurs accessing the breakpoint

*/

private void createConditionEditor(Composite parent) throws CoreException {

PyBreakpoint breakpoint = getBreakpoint();

String label = null;

ICommandManager commandManager = PlatformUI.getWorkbench().getCommandSupport().getCommandManager();

ICommand command = commandManager.getCommand("org.eclipse.ui.edit.text.contentAssist.proposals"); //$NON-NLS-1$

if (command != null) {

List keyBindings = command.getKeySequenceBindings();

if (keyBindings != null && keyBindings.size() > 0) {

IKeySequenceBinding binding = (IKeySequenceBinding) keyBindings.get(0);

label = StringUtils.format("E&nable Condition %s", binding.getKeySequence().format()); //$NON-NLS-1$

}

}

if (label == null) {

label = "E&nable Condition (code assist not available)"; //$NON-NLS-1$

}

Composite conditionComposite = new Group(parent, SWT.NONE);

conditionComposite.setFont(parent.getFont());

conditionComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

conditionComposite.setLayout(new GridLayout());

fEnableConditionButton = createCheckButton(conditionComposite, label);

fEnableConditionButton.setSelection(breakpoint.isConditionEnabled());

fEnableConditionButton.addSelectionListener(new SelectionAdapter() {

@Override

public void widgetSelected(SelectionEvent e) {

setConditionEnabled(fEnableConditionButton.getSelection());

}

});

fConditionEditor = new BreakpointConditionEditor(conditionComposite, this);

//fSuspendWhenLabel= createLabel(conditionComposite, "Suspend when:");

//fConditionIsTrue= createRadioButton(conditionComposite, "condition is \'tr&ue\'");

//fConditionIsTrue= createLabel(conditionComposite, "condition is \'tr&ue\'");

//fConditionHasChanged= createRadioButton(conditionComposite, "value of condition ch&anges");

// if (breakpoint.isConditionSuspendOnTrue()) {

// fConditionIsTrue.setSelection(true);

// } else {

// fConditionHasChanged.setSelection(true);

// }

setConditionEnabled(fEnableConditionButton.getSelection());

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值