0

I have added a ColorPropertyDescriptor to the Shapes example in GEF, however this displays as "RGB {0, 0, 0}" when a shape is selected, and only changes to a ColorCellEditor with button on the right hand side and coloured button on the选择属性时的左侧。

即使未选择该属性,如何显示 ColorCellEditor?

4

1 回答 1

0

我找到了解决方案:需要创建新的子类。

采用:

  • ColorPropertyDescriptor1 extends ColorPropertyDescriptor
    • 方法ColorPropertyDescriptor1#getLabelProvider应该返回ColorPropertyLabelProvider
    • 当我们单击属性值时,方法ColorPropertyDescriptor1#createPropertyEditor应该返回以更改表示。ColorPickerCellEditor
  • ColorPropertyLabelProvider extends LabelProvider 方法ColorPropertyLabelProvider#getImageColorPropertyLabelProvider#getText应该返回颜色方块和注释。见ColorPropertyDescriptor
  • ColorDialogCellEditor extends DialogCellEditor. 见ColorCellEditor
于 2012-06-28T13:48:40.843 回答