当我们使用 SWT 在 eclipse 插件开发中按下向导标题栏中的最大化按钮时,宽度Composite
正在发生变化。
我该如何克服这个问题?
注意:我没有使用KFace、WizardDialog
、Shell
、Display
。我只在使用Composite
,我的主要课程正在实施IWizard
。
public void createControl(Composite parent)
{
// TODO Auto-generated method stub
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
/*GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 10;
//gridLayout.makeColumnsEqualWidth = true;
//gridLayout.numColumns = 2;*/
Composite operationsListComposite = new Composite(composite, SWT.NONE);
operationsListComposite.setLayout(new GridLayout(2,false));
operationsListComposite.setLayoutData(new GridData(
GridData.FILL_HORIZONTAL));
Label operationLabel = new Label(operationsListComposite, SWT.NONE);
operationLabel.setText("");
//Label emptyLabel = new Label(operationsListComposite, SWT.NONE);
//emptyLabel.setText("");
Label adapterLabel = new Label(operationsListComposite, SWT.NONE);
adapterLabel.setText("");
fileGroupsList = new List(operationsListComposite,SWT.BORDER
| SWT.V_SCROLL | SWT.H_SCROLL);
fileGroupsList.add("JSP1");
fileGroupsList.add("JSP2");
fileGroupsList.add("JSP3");
fileGroupsList.add("JSP4");
fileGroupsList.addListener(SWT.Selection, this);
//operationsTree = new Tree(operationsListComposite,SWT.BORDER
// | SWT.V_SCROLL | SWT.H_SCROLL);
//operationsTree.addListener(SWT.Selection, this);
GridData data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.grabExcessHorizontalSpace = true;
data.heightHint = 150;
data.widthHint=100;
//operationsTree.setLayoutData(data);
fileGroupsList.setLayoutData(data);
//filesList = new List(operationsListComposite,SWT.BORDER
// | SWT.V_SCROLL | SWT.H_SCROLL);
Composite css1Composite = new Composite(operationsListComposite, SWT.BORDER);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
//gridData.horizontalSpan= 2;
gridData.grabExcessHorizontalSpace = true;
css1Composite.setLayoutData(gridData);
GridLayout grpL = new GridLayout(3,false);
grpL.verticalSpacing=0;
css1Composite.setLayout(grpL);
}}