org.eclipse.ui.forms.SectionPart Java Examples

The following examples show how to use org.eclipse.ui.forms.SectionPart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DataBindingManager.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * 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.
 */
private void enableSection(String id, boolean enabled)
{
    SectionPart part = sectionParts.get(id);
    if (part == null)
    {
        throw new IllegalArgumentException("No section for id [" + 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);
        }
    }
}
 
Example #2
Source File: DataBindingManager.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: DataBindingManager.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * 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;
        }
    }
}
 
Example #4
Source File: DataBindingManager.java    From tlaplus with MIT License 5 votes vote down vote up
/** 
 * 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);
    }
}
 
Example #5
Source File: AbstractSection.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Finish aggregate change action.
 */
protected void finishAggregateChangeAction() {

  editor.setFileDirty();
  editor.getTypePage().markStale();
  editor.getIndexesPage().markStale();
  editor.getCapabilityPage().markStale();
  SectionPart s = editor.getParameterPage().getParameterDelegatesSection();
  if (null != s)
    s.markStale();
  editor.getResourcesPage().markStale();
}
 
Example #6
Source File: DataBindingManager.java    From tlaplus with MIT License 2 votes vote down vote up
/**
 * 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);
}