Community
Participate
Working Groups
Build Identifier: 3.5 I am trying to embed jface treeviewer inside a jpanel using swt awt bridge. I don't see the tree being displayed in the panel. When i add a SWT button it works. Is this possible? Reproducible: Always
can you please add a simple test scase that shows the problem ?
Following is sample code snippate. I have not added code for content provider and label provider. It don't show tree in the UI. If we add SWT button it works. final Canvas c = new Canvas(); c.setBounds( 10, 10, 200, 200 ); c.setBackground( Color.GRAY ); JPanel listPanel = new JPanel( new GridLayout( 2, 1 )); parentFrame.add( listPanel ); listPanel.add( c ); listPanel.setVisible( true ); parentFrame.setVisible( true ); final Display d = Display.getDefault(); d.asyncExec( new Runnable(){ @Override public void run() { Shell s = SWT_AWT.new_Shell( d, c ); TCComponent folder = null; s.setBackground( new org.eclipse.swt.graphics.Color( null, 100, 0, 50 ) ); s.setSize( 100, 100 ); s.setText( "A MessageBox Example" ); Composite mainSwtPanel = new Composite( s, SWT.BORDER ); TreeViewer tree = new TreeViewer( mainSwtPanel ); /* you can add your own content provider here */ tree.setContentProvider( new MyContentProvider() ); tree.setLabelProvider( new MyLabelProvider() ); tree.setInput( object ); } } );
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.