SheetTable.java 文件源码

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

项目:incubator-netbeans 作者:
/**
 * Select (and start editing) the given property.
 * @param fd
 * @param startEditing
 */
public void select( FeatureDescriptor fd, boolean startEditing ) {
    PropertySetModel psm = getPropertySetModel();
    final int index = psm.indexOf( fd );
    if( index < 0 ) {
        return; //not in our list
    }

    getSelectionModel().setSelectionInterval( index, index );
    if( startEditing && psm.isProperty( index ) ) {
        editCellAt( index, 1, new MouseEvent( SheetTable.this, 0, System.currentTimeMillis(), 0, 0, 0, 1, false) );
        SwingUtilities.invokeLater( new Runnable() {
            @Override
            public void run() {
                SheetCellEditor cellEditor = getEditor();
                if( null != cellEditor ) {
                    InplaceEditor inplace = cellEditor.getInplaceEditor();
                    if( null != inplace && null != inplace.getComponent() ) {
                        inplace.getComponent().requestFocus();
                    }
                }
            }
        });
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号