用Ctrl+C与Ctrl+V进行复制黏贴,
通过 KeyHandler 往 GraphicalEditorWithPalette 中注册
sharedKeyHandler.put(KeyStroke.getReleased((char) 0x03, 99,SWT.CTRL), new CopyNodeAction(this)); //复制
sharedKeyHandler.put(KeyStroke.getReleased((char) 0x16, 118,SWT.CTRL), new PasteNodeAction(this)); //黏贴
复制时,调式到 CopyNodeAction 的 calculateEnabled() 时
IStructuredSelection s = (IStructuredSelection) this.getSelection();
得到的 s 为 null,也就是说得不到选中的东西,请问各位,是什么原因。
通过 KeyHandler 往 GraphicalEditorWithPalette 中注册
sharedKeyHandler.put(KeyStroke.getReleased((char) 0x03, 99,SWT.CTRL), new CopyNodeAction(this)); //复制
sharedKeyHandler.put(KeyStroke.getReleased((char) 0x16, 118,SWT.CTRL), new PasteNodeAction(this)); //黏贴
复制时,调式到 CopyNodeAction 的 calculateEnabled() 时
IStructuredSelection s = (IStructuredSelection) this.getSelection();
得到的 s 为 null,也就是说得不到选中的东西,请问各位,是什么原因。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货