Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 364802
Collapse All | Expand All

(-)src/org/eclipse/swt/custom/TableEditor.java (-13 / +33 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.swt.custom;
11
package org.eclipse.swt.custom;
12
12
13
import org.eclipse.rwt.RWT;
14
import org.eclipse.rwt.lifecycle.PhaseEvent;
15
import org.eclipse.rwt.lifecycle.PhaseId;
16
import org.eclipse.rwt.lifecycle.PhaseListener;
13
import org.eclipse.swt.*;
17
import org.eclipse.swt.*;
14
import org.eclipse.swt.events.*;
18
import org.eclipse.swt.events.*;
15
import org.eclipse.swt.graphics.*;
19
import org.eclipse.swt.graphics.*;
Lines 76-82 Link Here
76
	TableItem item;
80
	TableItem item;
77
	int column = -1;
81
	int column = -1;
78
	ControlListener columnListener;
82
	ControlListener columnListener;
79
	Runnable timer;
83
//	Runnable timer;
80
	static final int TIMEOUT = 1500;
84
	static final int TIMEOUT = 1500;
81
/**
85
/**
82
* Creates a TableEditor for the specified Table.
86
* Creates a TableEditor for the specified Table.
Lines 96-106 Link Here
96
			layout ();
100
			layout ();
97
		}
101
		}
98
	};
102
	};
99
	timer = new SerializableRunnable () {
103
//	timer = new Runnable () {
100
		public void run() {
104
//		public void run() {
101
			layout ();
105
//			layout ();
102
		}
106
//		}
103
	};
107
//	};
104
108
105
	// To be consistent with older versions of SWT, grabVertical defaults to true
109
	// To be consistent with older versions of SWT, grabVertical defaults to true
106
	grabVertical = true;
110
	grabVertical = true;
Lines 164-170 Link Here
164
	table = null;
168
	table = null;
165
	item = null;
169
	item = null;
166
	column = -1;
170
	column = -1;
167
	timer = null;
171
//	timer = null;
168
	super.dispose();
172
	super.dispose();
169
}
173
}
170
/**
174
/**
Lines 185-201 Link Here
185
}
189
}
186
void resize () {
190
void resize () {
187
	layout();
191
	layout();
188
//	/*
192
	/*
189
//	 * On some platforms, the table scrolls when an item that
193
	 * On some platforms, the table scrolls when an item that
190
//	 * is partially visible at the bottom of the table is
194
	 * is partially visible at the bottom of the table is
191
//	 * selected.  Ensure that the correct row is edited by
195
	 * selected.  Ensure that the correct row is edited by
192
//	 * laying out one more time in a timerExec().
196
	 * laying out one more time in a timerExec().
193
//	 */
197
	 */
194
//	if (table != null) {
198
//	if (table != null) {
195
//		Display display = table.getDisplay();
199
//		Display display = table.getDisplay();
196
//		display.timerExec(-1, timer);
200
//		display.timerExec(-1, timer);
197
//		display.timerExec(TIMEOUT, timer);
201
//		display.timerExec(TIMEOUT, timer);
198
//	}
202
//	}
203
	// [rh] Adaption of the above code for RWT (see bug 364802)
204
	RWT.getLifeCycle().addPhaseListener( new PhaseListener() {
205
    public void beforePhase( PhaseEvent event ) {
206
    }
207
    
208
    public void afterPhase( PhaseEvent event ) {
209
      RWT.getLifeCycle().removePhaseListener( this );
210
      if( table != null && table.getDisplay() == Display.getCurrent() ) {
211
        layout();
212
      }
213
    }
214
215
    public PhaseId getPhaseId() {
216
      return PhaseId.PROCESS_ACTION;
217
    }
218
  } );
199
}
219
}
200
/**
220
/**
201
* Sets the zero based index of the column of the cell being tracked by this editor.
221
* Sets the zero based index of the column of the cell being tracked by this editor.

Return to bug 364802