📄 textwizardpage.java
字号:
/**
* Copyright (c) 2003-2006 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.ui.internal.migration;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
/**
* A simple wizard page to display some text to the user.
* <p />
* Copyright (c) 2003-2006 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.1 $
* <br>
* $Date: 2006/03/06 00:55:27 $
* <br>
* @author Craig Setera
*/
public class TextWizardPage extends WizardPage {
private String text;
/**
* Construct a new wizard page.
*
* @param pageName
* @param text
*/
public TextWizardPage(String pageName, String title, String description, String text) {
super(pageName);
setTitle(title);
setDescription(description);
this.text = text;
}
/**
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 400;
gd.widthHint = 400;
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new FillLayout());
composite.setLayoutData(composite);
setControl(composite);
// Sets up the toolkit and form
FormToolkit toolkit = new FormToolkit(getShell().getDisplay());
Form form = toolkit.createForm(composite);
form.getBody().setLayout(new TableWrapLayout());
FormText formText = toolkit.createFormText(form.getBody(), true);
formText.setText(text, true, false);
TableWrapData twd = new TableWrapData();
twd.maxHeight = 400;
twd.maxWidth = 400;
formText.setLayoutData(twd);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -