📄 masterdetailsblock.jvt
字号:
import
org.eclipse.swt.SWT
org.eclipse.swt.layout.GridData
org.eclipse.swt.layout.GridLayout
org.eclipse.swt.widgets.Composite
org.eclipse.ui.forms.DetailsPart
org.eclipse.ui.forms.IManagedForm
org.eclipse.ui.forms.MasterDetailsBlock
org.eclipse.ui.forms.widgets.ExpandableComposite
org.eclipse.ui.forms.widgets.FormToolkit
org.eclipse.ui.forms.widgets.Section
method
/**
* Create the master details block
*/
public %TypeName% () {
// Create the master details block
}
method
/**
* Create contents of the master details block
* @param managedForm
* @param parent
*/
@Override
protected void createMasterPart(IManagedForm managedForm, Composite parent) {
FormToolkit toolkit = managedForm.getToolkit();
final GridLayout gridLayout = new GridLayout();
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
parent.setLayout(gridLayout);
final Section section = toolkit.createSection(parent,
ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
final GridData gridData = new GridData(GridData.FILL_BOTH);
section.setLayoutData(gridData);
section.setText("Empty Master Section");
final Composite composite = toolkit.createComposite(section, SWT.NONE);
toolkit.paintBordersFor(composite);
section.setClient(composite);
}
method
/**
* Register the pages
* @param part
*/
@Override
protected void registerPages(DetailsPart part) {
// Register the pages
}
method
/**
* Create the toolbar actions
* @param managedForm
*/
@Override
protected void createToolBarActions(IManagedForm managedForm) {
// Create the toolbar actions
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -