本文整理汇总了Java中org.eclipse.ui.forms.widgets.Section.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Section.setLayout方法的具体用法?Java Section.setLayout怎么用?Java Section.setLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.forms.widgets.Section
的用法示例。
在下文中一共展示了Section.setLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBackCompatibilitySection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createBackCompatibilitySection() {
Section backCompatibilitySection = new Section(this, ExpandableComposite.TREE_NODE);
GridData backCompSectionGD = new GridData(SWT.FILL,SWT.FILL,true,false);
backCompSectionGD.verticalIndent=10;
backCompatibilitySection.setLayoutData(backCompSectionGD);
backCompatibilitySection.setLayout(new FillLayout());
backCompatibilitySection.setText(Messages.JavaExpressionEditorComposite_BackCompatibilitySection);
Composite composite = new Composite(backCompatibilitySection, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
Label lbl1 = new Label(composite, SWT.NONE);
lbl1.setText(Messages.JavaExpressionEditorComposite_ValueClassMessage);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
lbl1.setLayoutData(gd);
valueType = new ClassType(composite, Messages.JavaExpressionEditorComposite_ClassTypeDialogTitle);
valueType.addListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
valueClassName = valueType.getClassType();
}
});
backCompatibilitySection.setClient(composite);
}
示例2: createSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
static public Section createSection(FormToolkit toolkit, Composite parent, String title, int hSpan, int vSpan) {
Section section = toolkit.createSection(parent, Section.SHORT_TITLE_BAR);
GridData osectionGridData = new GridData(SWT.FILL, SWT.BEGINNING, false, false);
osectionGridData.horizontalSpan = hSpan;
osectionGridData.verticalSpan = vSpan;
osectionGridData.horizontalIndent = 5;
section.setLayoutData(osectionGridData);
section.setText(title);
GridLayout osectionGL = new GridLayout(1, true);
osectionGL.marginHeight = 0;
osectionGL.marginWidth = 0;
section.setLayout(osectionGL);
return section;
}
示例3: createPluginsSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createPluginsSection(Composite parent) {
Section sctnPlugins = createSection(parent, "Plug-ins");
sctnPlugins.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
sctnPlugins.setLayoutData(data);
FormText text = formToolkit.createFormText(sctnPlugins, true);
ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/cordovaplug_wiz.png");
text.setImage("plugin", idesc.createImage());
text.setText(PLUGINS_SECTION_CONTENT, true, false);
sctnPlugins.setClient(text);
text.addHyperlinkListener(this);
}
示例4: createPlanSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createPlanSection(Composite composite) {
//
Section planSection = toolkit.createSection(composite,
Section.TITLE_BAR
| ExpandableComposite.EXPANDED);
// Composite planComposite = toolkit.createComposite(planSection, SWT.NULL);
planComposite = toolkit.createComposite(planSection, SWT.NULL);
planSection.setText("Plan");
planSection.setLayout(new GridLayout(1, Boolean.TRUE));
planSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));
planSection.marginHeight = 20;
planSection.titleBarTextMarginWidth = 20;
planComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));
planComposite.setLayout(new GridLayout(1, Boolean.TRUE));
planSection.setClient(planComposite);
createReleasesSection(planComposite);
createTitleSection(planComposite);
createIterationsSection(planComposite);
}
示例5: createStaticSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
public static Composite createStaticSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns ) {
Section section;
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
SWT.WRAP );
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientTableWrapLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
示例6: createRoutesDomainsSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createRoutesDomainsSection() {
Section routeSection = toolkit.createSection(getSection().getParent(), Section.TITLE_BAR | Section.TWISTIE);
routeSection.setLayout(new GridLayout());
GridDataFactory.fillDefaults().grab(true, true).applyTo(routeSection);
routeSection.setText(Messages.ApplicationMasterPart_TEXT_ROUTES);
routeSection.setExpanded(true);
routeSection.clientVerticalSpacing = 0;
Composite client = toolkit.createComposite(routeSection);
client.setLayout(new GridLayout(1, false));
GridDataFactory.fillDefaults().grab(true, true).applyTo(client);
routeSection.setClient(client);
Button button = toolkit.createButton(client, Messages.ApplicationMasterPart_TEXT_REMOVE_BUTTON, SWT.PUSH);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(button);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
UIJob uiJob = new UIJob(Messages.ApplicationMasterPart_JOB_REMOVE_ROUTE) {
public IStatus runInUIThread(IProgressMonitor monitor) {
CloudRoutesWizard wizard = new CloudRoutesWizard(cloudServer);
WizardDialog dialog = new WizardDialog(editorPage.getEditorSite().getShell(), wizard);
dialog.open();
return Status.OK_STATUS;
}
};
uiJob.setSystem(true);
uiJob.setPriority(Job.INTERACTIVE);
uiJob.schedule();
}
});
}
示例7: createExportSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createExportSection(Composite parent) {
Section sctnExport = createSection(parent, "Export");
sctnExport.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
sctnExport.setLayoutData(data);
FormText text = formToolkit.createFormText(sctnExport, true);
ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/export_wiz.png");
text.setImage("export", idesc.createImage());
text.setText(EXPORT_SECTION_CONTENT, true, false);
sctnExport.setClient(text);
text.addHyperlinkListener(this);
}
示例8: createExpandableSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
public static Composite createExpandableSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns,
final boolean isInitialyExpanded ) {
Section section;
if ( isInitialyExpanded ) {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE |
SWT.WRAP );
} else {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE );
}
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientTableWrapLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
示例9: createGridStaticSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
public static Composite createGridStaticSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns ) {
Section section;
if (sectionDescription.length() > 0) {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
| SWT.WRAP);
section.setText(sectionTitle);
section.setDescription(sectionDescription);
} else {
section = toolkit.createSection(parent,
ExpandableComposite.TITLE_BAR | SWT.WRAP);
section.setText(sectionTitle);
}
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientGridLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
示例10: createGridExpandableSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
public static Composite createGridExpandableSection( final FormToolkit toolkit,
final Composite parent,
final String sectionTitle,
final String sectionDescription,
final int numOfColumns,
final boolean isInitialyExpanded ) {
Section section;
if ( isInitialyExpanded ) {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE |
SWT.WRAP );
} else {
section = toolkit.createSection( parent,
ExpandableComposite.TITLE_BAR |
Section.DESCRIPTION |
ExpandableComposite.TWISTIE );
}
section.setText( sectionTitle );
section.setDescription( sectionDescription );
toolkit.createCompositeSeparator( section );
section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) );
TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB );
section.setLayoutData( data );
gridExpandableSection = section;
Composite client = toolkit.createComposite( section );
client.setLayout( AlignFormLayoutFactory.createSectionClientGridLayout( false, numOfColumns ) );
section.setClient( client );
return client;
}
示例11: createReferenceBinding
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createReferenceBinding(DetailProviderParameter parameter, EObject model, final EditingDomain editingDomain, IItemPropertyDescriptor pd, Object feature) {
String displayName = pd.getDisplayName(model);
if (model instanceof MultiEObject) {
LogUtil.warn("Tables not supported for multiple selection - " + displayName);
return;
}
EReference reference = (EReference) feature;
Composite parent = parameter.getParent();
FormToolkit toolkit = parameter.getDetailFormToolkit();
Section section = DetailFormToolkit.createSection(toolkit, parent, displayName, null);
section.setLayout(new RowLayout(SWT.VERTICAL));
Composite composite = toolkit.createComposite(section);
section.setClient(composite);
GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(true).applyTo(composite);
Composite topButtonComposite = toolkit.createComposite(section, SWT.NO_BACKGROUND);
topButtonComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
section.setTextClient(topButtonComposite);
boolean editable = pd.canSetProperty(model);
final TreeTableViewer<EObject, EAttribute> viewer = EMFTreeTableUtils.createEMFTreeTableViewer(composite, reference, reference.getEReferenceType(), editingDomain, false, true, true, editable);
TreeTableComposite treeTableComposite = viewer.getTreeTableComposite();
GridDataFactory.fillDefaults().grab(true, false).applyTo(treeTableComposite);
if (editable) {
addEditButton(composite, displayName, editingDomain, toolkit, viewer);
populateTopButtonComposite(topButtonComposite, displayName, viewer, reference, editingDomain, model, editable, toolkit);
}
if (topButtonComposite.getChildren().length == 0) {
section.setTextClient(null);
}
viewer.setInput(model);
TreeColumn[] columns = viewer.getTree().getColumns();
for (TreeColumn column : columns) {
column.pack();
}
ISelectionChangedListener selectionChangedListener = parameter.getSelectionChangedListener();
if (selectionChangedListener != null) {
viewer.addSelectionChangedListener(selectionChangedListener);
}
}
示例12: createKarafJVMDetailsSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createKarafJVMDetailsSection(final IManagedForm managedForm, final Composite parent) {
final Section section = managedForm.getToolkit().createSection(
parent,
Section.TITLE_BAR
| Section.EXPANDED);
section.setText("JVM Information");
GridData data = new GridData(GridData.FILL_HORIZONTAL);
section.setLayout(new GridLayout(1, true));
section.setLayoutData(data);
data = new GridData(GridData.FILL_HORIZONTAL);
final Composite sectionClient = managedForm.getToolkit().createComposite(section);
sectionClient.setLayout(new GridLayout(2, true));
sectionClient.setLayoutData(data);
section.setClient(sectionClient);
managedForm.getToolkit().createLabel(sectionClient, "Virtual Machine");
vmVersion = managedForm.getToolkit().createText(sectionClient, "", SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
vmVersion.setLayoutData(data);
vmVersion.setEnabled(false);
managedForm.getToolkit().createLabel(sectionClient, "Vendor");
vmVendor = managedForm.getToolkit().createText(sectionClient, "", SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
vmVendor.setLayoutData(data);
vmVendor.setEnabled(false);
managedForm.getToolkit().createLabel(sectionClient, "Name");
vmName = managedForm.getToolkit().createText(sectionClient, "", SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
vmName.setLayoutData(data);
vmName.setEnabled(false);
}
示例13: createKarafPlatformDetailsSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createKarafPlatformDetailsSection(final IManagedForm managedForm, final Composite parent) {
final Section section = managedForm.getToolkit().createSection(
parent,
Section.TITLE_BAR
| Section.EXPANDED);
section.setText("Installation Details");
GridData data = new GridData(GridData.FILL_HORIZONTAL);
section.setLayout(new GridLayout(1, true));
section.setLayoutData(data);
data = new GridData(GridData.FILL_HORIZONTAL);
final Composite sectionClient = managedForm.getToolkit().createComposite(section);
sectionClient.setLayout(new GridLayout(2, true));
sectionClient.setLayoutData(data);
section.setClient(sectionClient);
managedForm.getToolkit().createLabel(sectionClient, "Name");
final String name = editor.getPlatformDetails().getName();
platformName = managedForm.getToolkit().createText(sectionClient, name, SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
platformName.setLayoutData(data);
platformName.setEnabled(false);
managedForm.getToolkit().createLabel(sectionClient, "Version");
final String version = editor.getPlatformDetails().getVersion();
platformVersion = managedForm.getToolkit().createText(sectionClient, version, SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
platformVersion.setLayoutData(data);
platformVersion.setEnabled(false);
managedForm.getToolkit().createLabel(sectionClient, "Description");
final String description = editor.getPlatformDetails().getDescription();
platformDescription = managedForm.getToolkit().createText(sectionClient, description, SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
platformDescription.setLayoutData(data);
platformDescription.setEnabled(false);
}
示例14: createFormContent
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
@Override
protected void createFormContent(final IManagedForm managedForm) {
runtimeDataProviderManager.addListener(runtimeDataProviderListener);
final GridLayout layout = new GridLayout(2, true);
GridData data = new GridData(GridData.FILL_BOTH);
managedForm.getForm().getBody().setLayout(layout);
managedForm.getForm().getBody().setLayoutData(data);
managedForm.getForm().setText("Runtime Details");
managedForm.getForm().setImage(KarafWorkbenchActivator.getDefault().getImageRegistry().get(KarafWorkbenchActivator.BUNDLE_OBJ_IMG));
final Section section = managedForm.getToolkit().createSection(
managedForm.getForm().getBody(),
Section.TITLE_BAR
| Section.EXPANDED);
section.setText("Bundles");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
section.setLayoutData(data);
section.setLayout(new GridLayout(1, true));
final Composite sectionClient = managedForm.getToolkit().createComposite(section);
sectionClient.setLayout(new GridLayout(1, false));
data = new GridData(GridData.FILL_HORIZONTAL);
sectionClient.setLayoutData(data);
section.setClient(sectionClient);
bundlesTable = managedForm.getToolkit().createTable(sectionClient, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
bundlesTable.setLinesVisible(true);
bundlesTable.setHeaderVisible(true);
data = new GridData(GridData.FILL_HORIZONTAL);
data.heightHint = 225;
bundlesTable.setLayoutData(data);
bundlesTable.setLayout(new FillLayout());
TableColumn col = new TableColumn(bundlesTable, SWT.LEFT);
col.setWidth(colWidth[0]);
col.setText("Name");
col = new TableColumn(bundlesTable, SWT.LEFT);
col.setWidth(colWidth[1]);
col.setText("Id");
col = new TableColumn(bundlesTable, SWT.LEFT);
col.setWidth(colWidth[2]);
col.setText("State");
col = new TableColumn(bundlesTable, SWT.LEFT);
col.setWidth(colWidth[3]);
col.setText("Location");
bundlesViewer = new TableViewer(bundlesTable);
bundlesViewer.setLabelProvider(new BundlesTableLabelProvider());
bundlesViewer.setContentProvider(new BundlesTableContentProvider());
bundlesViewer.setSorter(new BundleIdSorter());
managedForm.reflow(true);
for (final RuntimeDataProvider runtimeDataProvider : runtimeDataProviderManager.getServices()) {
final MBeanProvider mbeanProvider = (MBeanProvider) runtimeDataProvider.getAdapter(MBeanProvider.class);
if (mbeanProvider == null) {
continue;
}
final IPath rootDirecotry = getKarafPlatformRootPath(mbeanProvider);
if (editor.getKarafPlatform().getRootDirectory().equals(rootDirecotry)) {
bundlesViewer.setInput(runtimeDataProvider);
}
}
}
示例15: createTopContents
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createTopContents(Composite composite) {
// Layouts
GridData layoutData = new GridData(SWT.FILL,
SWT.FILL,
Boolean.TRUE,
Boolean.TRUE);
GridLayout layout = new GridLayout(2, Boolean.FALSE);
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
// General section
// ------- -------
Section generalSection = toolkit.createSection(composite,
Section.TITLE_BAR
| ExpandableComposite.EXPANDED);
generalSection.setText(GENERAL_SECTION_LABEL);
generalSection.setLayout(layout);
generalSection.setLayoutData(layoutData);
// Set composite into the section
// Composite generalSC = toolkit.createComposite(generalSection, SWT.NONE);
Composite generalSC = toolkit.createComposite(generalSection, SWT.NONE);
generalSC.setLayout(layout);
generalSC.setLayoutData(layoutData);
generalSection.setClient(generalSC);
// generalSC.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GREEN)); // TODO
// Schedule section
// -------- -------
Section scheduleSection = toolkit.createSection(composite,
Section.TITLE_BAR
| ExpandableComposite.EXPANDED);
scheduleSection.setText(SCHEDULE_SECTION_LABEL);
scheduleSection.setLayout(layout);
scheduleSection.setLayoutData(layoutData);
// Set composite into the section
Composite scheduleSC = toolkit.createComposite(scheduleSection, SWT.NONE);
scheduleSC.setLayout(layout);
scheduleSC.setLayoutData(layoutData);
scheduleSection.setClient(scheduleSC);
// scheduleSectionComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_YELLOW)); // TODO
// Memo section
// ---- -------
Section memoSection = toolkit.createSection(composite,
Section.TITLE_BAR
| ExpandableComposite.EXPANDED);
memoSection.setText(MEMO_SECTION_LABEL);
memoSection.setLayout(new GridLayout(2, Boolean.FALSE));
memoSection.setLayoutData(layoutData);
// Set composite into the section
Composite memoSC = toolkit.createComposite(memoSection, SWT.NONE);
memoSC.setLayout(layout);
memoSC.setLayoutData(layoutData);
memoSection.setClient(memoSC);
// memoSectionComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_YELLOW)); // TODO
// Fill sections
fillGeneralSection(generalSC);
fillScheduleSection(scheduleSC);
fillMemoSection(memoSC);
}