ArrayEditorCellModifier.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:convertigo-eclipse 作者:
public Object getValue(Object element, String property) {
    int columnIndex = Arrays.asList(tableViewer.getColumnProperties()).indexOf(property);

    CellEditor[] cellEditors = tableViewer.getCellEditors();
    CellEditor cellEditor = cellEditors[columnIndex];
    boolean isComboBoxEditor = cellEditor instanceof ComboBoxCellEditor;

    if (element instanceof Item) {
        element = ((Item) element).getData();
    }

    ArrayEditorRow row = (ArrayEditorRow) element;
    Object object = row.getValue(columnIndex);
    if (isComboBoxEditor) {
        int index = Arrays.asList(((ComboBoxCellEditor)cellEditor).getItems()).indexOf(object.toString());
        object = new Integer(index);
    }

    return object;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号