I use JFace DialogCellEditor
to show a button in a cell of a row of my JFace TableViewer
which triggers a dialog when activated. This behaviour works well with the following code but the button only appears when the cell of the table hosting the button is explicitly selected.
public class CompareDialogCellEditor extends DialogCellEditor {
public CompareDialogCellEditor(Composite parent) {
super(parent);
}
@Override
protected Button createButton(Composite parent) {
Button button = super.createButton(parent);
button.setText("");
button.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, IImageKeys.COMPARE_ICON).createImage());
return button;
}
@Override
protected Object openDialogBox(Control cellEditorWindow) {
MessageDialog.openInformation(cellEditorWindow.getShell(), "Test", "It works");
return null;
}
}
Is there a way to force the button to always appear in the table and not only when the cell is selected? (the same behaviour goes for a label set by the overridden method setContents(...)
)
Thanks