How to use the ComboBoxCellEditor to impl dierect edit? [message #234095] |
Fri, 11 May 2007 08:39 |
Eclipse User |
|
|
|
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).
why?
|
|
|
Powered by
FUDForum. Page generated in 0.02432 seconds