Java 禁用SWT中的窗口大小调整-使用复合
我正在开发一个eclipse插件,它几乎没有向导页面。我需要向导窗口大小保持不变,同时禁用“最大化和最小化”,“窗口禁用调整大小” 关键是我没有使用SHELL。我使用的是COMPOSITE,它没有任何样式位 我该怎么做?我只是提供了整个代码的一部分:Java 禁用SWT中的窗口大小调整-使用复合,java,widget,swt,Java,Widget,Swt,我正在开发一个eclipse插件,它几乎没有向导页面。我需要向导窗口大小保持不变,同时禁用“最大化和最小化”,“窗口禁用调整大小” 关键是我没有使用SHELL。我使用的是COMPOSITE,它没有任何样式位 我该怎么做?我只是提供了整个代码的一部分: public void createControl(Composite parent) { // TODO Auto-generated method stub composite = new Composite(parent,
public void createControl(Composite parent)
{
// TODO Auto-generated method stub
composite = new Composite(parent, SWT.NONE );
composite.setLayout(new GridLayout());
Composite selectAdapterComposite = new Composite(composite, SWT.NONE);
FormLayout reportOptionsCompositeLayout = new FormLayout();
reportOptionsCompositeLayout.marginHeight = 1;
reportOptionsCompositeLayout.marginWidth = 1;
selectAdapterComposite.setLayout(reportOptionsCompositeLayout);
buttonInterfaceSelection = new Button(selectAdapterComposite,SWT.RADIO);
//SWT.CHECK);
buttonInterfaceSelection.setText("Generate adapter using interface !");
buttonInterfaceSelection.setSelection(true);
buttonInterfaceSelection.addListener(SWT.Selection, this);
FormData exportInToExcelButtonData = new FormData();
exportInToExcelButtonData.left = new FormAttachment(null, 5);
buttonInterfaceSelection.setLayoutData(exportInToExcelButtonData);
// One Text Box
Label searchBoxLabel = new Label(selectAdapterComposite, SWT.None);
searchBoxLabel.setText("Search to select [Type to get the results below]");
FormData destinationLabelData = new FormData();
destinationLabelData.top = new FormAttachment(buttonInterfaceSelection, 10);
destinationLabelData.left = new FormAttachment(null, 5);
searchBoxLabel.setLayoutData(destinationLabelData);
searchTextBox = new Text(selectAdapterComposite, SWT.BORDER);
searchTextBox.setSize(20, 2);
FormData searchTextBoxData = new FormData();
searchTextBoxData.top = new FormAttachment(searchBoxLabel, 8);
searchTextBoxData.left = new FormAttachment(null, 5);
// destinationFolderPathData.left = new
// FormAttachment(destinationLabel,15);
searchTextBoxData.width = 400;
searchTextBox.addListener(SWT.Modify, this);
searchTextBox.setEnabled(true);
searchTextBox.setLayoutData(searchTextBoxData);
.
.
.
.
.
setControl(composite);
}
请帮帮我 您的代码片段与您的问题无关。关键词是向导。创建该向导时,它需要一个
Shell
,因此您可以在那里设置其样式位
向导对话框的构造函数:
外壳式钻头示例:
谢谢你的回复。。。我是swt的新手,你的回答给了我一个我以前不知道的重要信息。现在,我花了一些时间浏览widgets文档,发现了一些东西 复合:此类的实例是能够包含其他控件的控件 Shell:此类的实例表示桌面或“窗口管理器”正在管理的“窗口” 我意识到我对贝壳和复合材料的理解是错误的 结论:所以我必须依赖SHELL来提供窗口大小调整控件,而使用复合控件并不能提供任何大小调整选项 如果我错了,请纠正我。。希望这对其他noob也有用。。。 谢谢 附言:现在我明白了,我的代码段与我的问题无关,因为我正在处理其他人的代码,并试图对其进行一些更改。我不是在SHELL(在其他类中创建)中进行更改,而是在COMPOSITE中进行更改
public WizardDialog(Shell parentShell, IWizard newWizard)
parentShell.setShellStyle(parentShell.getShellStyle() | (~SWT.RESIZE));