我需要隐藏一个复合材料(以及所有儿童).只需设置即可setVisible(false)
保留复合材料的空间.
Composite outer = new Composite(parent, SWT.NONE);
outer.setLayout(new GridLayout(1,false));
outer.setLayoutData(new GridData(GridData.FILL_BOTH) );
Composite compToHide = new MyComposite(outer, SWT.NONE);
compToHide.setLayout(new GridLayout());
compToHide.setVisible(false);
Run Code Online (Sandbox Code Playgroud)