- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个 Eclipse 插件,它在 Eclipse 自己的 AbstractTextEditor 中显示自定义多行标记。
这是我目前所拥有的:
一切正常,我的标记显示在编辑器中。但我需要自定义它们在 VerticalRuler 上的绘制方式,因此它们不仅显示为图标,而且显示为跨越受影响的源代码行的垂直线。
我知道,这可以通过实现 IAnnotationPresentation 并覆盖 paint() 来使用注释来完成。
但是我怎样才能对标记执行此操作呢?
编辑:这是我正在尝试实现的屏幕截图:
最佳答案
我通过贡献一个 RulerColumn(扩展点 org.eclipse.ui.workbench.texteditor.rulerColumns
)并将 markerAnnotationSpecification
配置为 not 包含 verticalRulerPreferenceKey
和 verticalRulerPreferenceValue
(因此它不会显示在默认的 AnnotationRulerColumn 上)。
如果有人还发现关于如何最好地实现 IContributedRulerColumn
的文档有点稀疏:似乎要走的路是子类化 AbstractContributedRulerColumn
并将方法委托(delegate)给AbstractRulerColumn
的子类。
例如:
public class MyRulerColumn extends AbstractContributedRulerColumn {
private IVerticalRulerColumn delegate = new AbstractRulerColumn() { … }
public void setModel(IAnnotationModel model) {
delegate.setModel(model);
}
…
}
自定义外观就像覆盖委托(delegate)中的一个 paint… 方法一样简单。
关于java - Eclipse:如何在垂直标尺上自定义标记的绘制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15207185/
我对 YAML 数据 block 有疑问。给定以下 pandoc 文档: --- papersize: a4 geometry: "left=1.5cm,right=1.5cm,top=3cm,bot
我对 YAML 数据 block 有疑问。给定以下 pandoc 文档: --- papersize: a4 geometry: "left=1.5cm,right=1.5cm,top=3cm,bot
在 Xcode 中,界面构建器是否具有某种可自定义的标尺(如 Photoshop 中的标尺)来帮助我正确定位元素? 我知道它会出现那些红线,但我的意思是你可以定位自己的线。 谢谢,丹。 最佳答案 我找
我有疑问。我正在编写像 this 这样的编辑器,我还想要一个标尺来添加它(它通过鼠标滚动(放大和缩小)更改值) 可是我做不到。我在 github 上尝试了所有标尺,但它们只运行 body 标签。 很遗
我更新了 chrome,当我打开 devtools 时,我看到了这个。 如何去掉标尺(上部和右侧的黑色部分)?它需要很大的空间,而且我有一个 13.3 英寸的小屏幕。 最佳答案 F12;左上角望远镜图
我是一名优秀的程序员,十分优秀!