Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to use the ComboBoxCellEditor to impl dierect edit?
https://www.eclipse.org/forums/index.php/mv/msg/74965/234095/#msg_234095
Originally posted by: sundaolin.126.com
In the editpart,i do this :
protected void performDirectEdit() {
if (directEditManager == null) {
directEditManager = new CDPDBDirectEditManager(this,
ComboBoxCellEditor.class, new CDPDBCellEditorLocator(
getFigure()));
}
directEditManager.show();
}
In the direct edit manager:
protected void initCellEditor() {
CCombo c = (CCombo)getCellEditor().getControl();
c.add("aaa");
c.add("bbb");
getCellEditor().setValue(new Integer(0));
}
In the locator:
Label label = ((ConnectionFigure)figure).getLabel();
Rectangle rect = label.getBounds().getCopy();
figure.translateToAbsolute(rect);
CCombo c = (CCombo)celleditor.getControl();
c.setBounds(rect.x, rect.y, rect.width, rect.height);
return;
but, it seems no use.
I debug the program, and find that the initCellEditor() method doesn't
run.(neither the relocate() method).