本文整理汇总了Java中org.eclipse.ui.forms.SectionPart类的典型用法代码示例。如果您正苦于以下问题:Java SectionPart类的具体用法?Java SectionPart怎么用?Java SectionPart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SectionPart类属于org.eclipse.ui.forms包,在下文中一共展示了SectionPart类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableSection
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* enables a section by given id. More precisely, this
* means setting the enablement state of any child of the
* section that is a {@link Composite} but not a {@link Section}
* to enabled.
*/
public void enableSection(String id, boolean enabled)
{
SectionPart part = sectionParts.get(id);
if (part == null)
{
throw new IllegalArgumentException("No section for id");
}
Section section = part.getSection();
Control[] children = section.getChildren();
for (int i = 0; i < children.length; i++)
{
if (children[i] instanceof Composite)
{
enableSectionComposite((Composite) children[i], enabled);
}
}
}
示例2: bindSection
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* Adds a section to the manager
* @param section
* @param id
* @param pageId
*/
public void bindSection(SectionPart sectionPart, String id, String pageId)
{
// store the section
sectionParts.put(id, sectionPart);
// store the page id
pageForSection.put(id, pageId);
Vector<String> sectionIds = sectionsForPage.get(pageId);
if (sectionIds == null)
{
sectionIds = new Vector<String>();
sectionsForPage.put(pageId, sectionIds);
}
sectionIds.add(id);
}
示例3: bindAttribute
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* Bind an attribute name <code>attributeName</code> to the viewer <code>attributeViewer</code> location in the section part <code>sectionPart</code>
* This method should be called after the section is bound to the section id and page using {@link DataBindingManager#bindSection(SectionPart, String, String)} method
* @param attributeName
* @param attributeViewer
* @param sectionPart
*/
public void bindAttribute(String attributeName, Object attributeViewer, SectionPart sectionPart)
{
// bind the viewer
viewerForAttribute.put(attributeName, attributeViewer);
// bind the section id
Enumeration<String> enumeration = sectionParts.keys();
while (enumeration.hasMoreElements())
{
String sectionId = enumeration.nextElement();
SectionPart registeredPart = sectionParts.get(sectionId);
if (registeredPart.equals(sectionPart))
{
sectionForAttribute.put(attributeName, sectionId);
break;
}
}
}
示例4: expandSection
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* expands a section by given section id
*/
public void expandSection(String id)
{
SectionPart part = sectionParts.get(id);
if (part == null)
{
throw new IllegalArgumentException("No section for id");
}
if (!part.getSection().isExpanded())
{
part.getSection().setExpanded(true);
}
}
示例5: createFormContent
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
@Override
protected void createFormContent(IManagedForm managedForm) {
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText(getTitle());
form.setImage(MuleImages.GLOBALS_TITLE_IMAGE);
//set the layout.
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 1;
layout.makeColumnsEqualWidth = true;
form.getBody().setLayout(layout);
//configure the toolbar buttons
configureFormToolbarButtons(toolkit, form);
//add the two sections.
SectionPart toolBar = addButtons(toolkit, form);
managedForm.addPart(toolBar);
TableWrapData toolbarData = new TableWrapData(TableWrapData.FILL_GRAB);
toolbarData.rowspan = 1;
toolbarData.valign = TableWrapData.FILL;
toolBar.getSection().setLayoutData(toolbarData);
GradleDependenciesTablePart depsTable = addDependenciesTable(toolkit, form);
managedForm.addPart(depsTable);
TableWrapData depsTableData = new TableWrapData(TableWrapData.FILL_GRAB);
depsTableData.rowspan = 2;
depsTableData.valign = TableWrapData.FILL;
depsTable.getSection().setLayoutData(depsTableData);
this.table = depsTable;
table.refreshData();
}
示例6: expandPropertiesSection
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* Expands the properties table.
*/
public void expandPropertiesSection() {
final SectionPart section = getDataBindingManager().getSection(SEC_WHAT_TO_CHECK_PROPERTIES);
section.getSection().setExpanded(true);
}
示例7: createMasterPart
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
// final ScrolledForm form = managedForm.getForm();
IEditorInput input = page.getEditor().getEditorInput();
FormToolkit toolkit = managedForm.getToolkit();
Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
section.setText(Messages.getString("NamespaceDetailsBlock.sname")); //$NON-NLS-1$
section.setDescription(Messages.getString("NamespaceDetailsBlock.sdesc")); //$NON-NLS-1$
section.marginWidth = 10;
section.marginHeight = 5;
Composite client = toolkit.createComposite(section, SWT.WRAP);
Composite headerContainer = toolkit.createComposite(client, SWT.WRAP);
toolkit.createLabel(headerContainer, "Select editor", SWT.NULL);
//TODO Remove combo
@SuppressWarnings("unused")
final ComboPart comboPart = new ComboPart(headerContainer, toolkit, toolkit.getBorderStyle());
headerContainer.setVisible(false);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 2;
layout.marginHeight = 2;
headerContainer.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = 20;
gd.widthHint = 100;
gd.horizontalSpan = 2;
headerContainer.setLayoutData(gd);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 2;
layout.marginHeight = 2;
client.setLayout(layout);
Tree t = toolkit.createTree(client, SWT.NULL);
gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 20;
gd.widthHint = 100;
t.setLayoutData(gd);
toolkit.paintBordersFor(client);
Button collapseButton = toolkit.createButton(client, Messages.getString("Collapse"), SWT.PUSH); //$NON-NLS-1$
gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
collapseButton.setLayoutData(gd);
section.setClient(client);
final SectionPart spart = new SectionPart(section);
managedForm.addPart(spart);
viewer = new TreeViewer(t);
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
managedForm.fireSelectionChanged(spart, event.getSelection());
}
});
viewer.setContentProvider(new NamespaceContentProvider());
viewer.setLabelProvider(new NamespaceLabelProvider());
if (input != null) {
viewer.setInput(new StudioUIFormEditorInput(input));
} else {
viewer.setInput(new StudioUIFormEditorInput());
}
viewer.expandToLevel(5);
collapseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
viewer.collapseAll();
}
});
configureMenu(viewer);
}
示例8: getSection
import org.eclipse.ui.forms.SectionPart; //导入依赖的package包/类
/**
* Retrieves the section by id
* @param sectionId
* @return the section part, or <code>null</code> if not found
*/
public SectionPart getSection(String sectionId)
{
return (SectionPart) sectionParts.get(sectionId);
}