0

当我在对话框上使用 TableCombo 时,我无法从 Nebula 中选择一个项目,但是当我尝试在查看器上使用它时,它工作得很好。

public class MyDialog extends TitleAreaDialog {
    @Override
    protected Control createDialogArea( Composite parent ) {
        Composite area = (Composite) super.createDialogArea( parent );
        Composite container = new Composite( area, SWT.NONE );
        FillLayout fill = new FillLayout( SWT.VERTICAL );
        fill.marginHeight = 5;
        fill.marginWidth = 5;
        container.setLayout( fill );
        container.setLayoutData( new GridData(SWT.FILL, SWT.FILL, true, true) );

        new MyTableComboViewer( container );
        return container;
    }

    private class MyTableComboViewer extends TableComboViewer {

        public MyTableComboViewer() {
            super( parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.READ_ONLY );

            setContentProvider( new TableComboContentProvider() );
            setLabelProvider( new TableComboLabelProvider() );
        }
    }
}
4

0 回答 0