Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How to trigger ICellModifier 's modify()?
How to trigger ICellModifier 's modify()? [message #1403801] Sun, 27 July 2014 19:00
yev xxxxx is currently offline yev xxxxxFriend
Messages: 17
Registered: July 2014
Junior Member
I have a TableViewer where one of the columns is a DialogCellEditor.
A provider is bounded to the treeviewer.

Whenever user changes a value in the table (dialogcelleditor) I want modify() method to be invoke in order to update the model.

The problem, modify() method is being invoked only once, even if I try to update value of other rows.

Full code is complex, some snippets if more needed please tell.

MyProvider is a provider bounded to a Table.

MyCellEditor extends DialogCellEditor{
 protected Object openDialogBox(Control cellEditorWindow) {
    editor = ...;
    if ( == Dialog.OK){	
      this.focusLost(); // I need this to remove the focus from editor, and invoke modify() of ICellModifier
public MyProvider  IStructuredContentProvider,ITableLabelProvider,IContentProvider,ICellModifier {
  public void modify(Object element, String property, Object value) {

I tried to debug jface code and started with stack trace when modify() method was triggered:

	MyProvider.modify(Object, String, Object)
	ColumnViewer$2.setValue(Object, Object)
	ColumnViewer$2(EditingSupport).saveCellEditorValue(CellEditor, ViewerCell)
	MyCellEditor(CellEditor).fireApplyEditorValue() line: 333	

On the next time when I updated the value modify() method wasn't triggered, the issue is with CellEditor.focusLost(): (jface code)

 protected void focusLost() {
		if (isActivated()) {  <= isActivated() is always false, even if I try to call this.activate

and this is the code of isActivated(): (jface code)
public boolean isActivated() {
	// Use the state of the visible style bit (getVisible()) rather than the
	// window's actual visibility (isVisible()) to get correct handling when
	// an ancestor control goes invisible, see bug 85331.
	return control != null && control.getVisible();

[Updated on: Tue, 29 July 2014 13:19]

Report message to a moderator

Previous Topic:Is there any way to get SourceViewer by a known StyledText?
Next Topic:Filter ComboBox content prior to its expansion
Goto Forum:

Current Time: Sat Apr 10 12:51:32 GMT 2021

Powered by FUDForum. Page generated in 0.01973 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top