无法在JFace TitleAreaDialog上选择Nebula TableComboViewer中的项目

时间:2017-02-24 02:34:11

标签: java eclipse-plugin jface nebula

当我在一个Dialog上使用它时,我无法从Nebula中选择TableCombo中的一个项目但是当我尝试在Viewer上使用它时,它可以正常工作。

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() );
        }
    }
}

0 个答案:

没有答案