중첩

중첩되지 않은 부분에 있어 모든 부분은 블랙 박스입니다. 부분이 IPartFactory를 사용하여 중첩된 하위를 작성할 수 있지만, 올바르게 표시되더라도 중첩되지 않은 부분에 하위를 명시적으로 보여주진 않습니다. 다음 예제는 두 개의 중첩된 하위가 있는 보기를 보여줍니다.

/**
 * Example view containing a nested error log on the left and a nested property
 * view on the right.
 *
 * @since 3.1
 */
public class TestCompositeView {
   
    public TestCompositeView(Composite parent, IPartFactory factory) throws CoreException {       
        // Create PDE error log view
        ContainerContext logViewContext = new ContainerContext();   
        ISite logView = factory.createView(
                "org.eclipse.pde.runtime.LogView",
                parent, logViewContext, null);

        // Create Property view
        ContainerContext emptyContext = new ContainerContext();
        ISite propertiesView = factory.createView(IPageLayout.ID_PROP_SHEET, parent, emptyContext, null);

        // Construct layout
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        parent.setLayout(layout);

        // Arrange error log view
        GridData data1 = new GridData(GridData.FILL_BOTH);
        logView.getControl().setLayoutData(data1);
       
        // Arrange properties view
        GridData data2 = new GridData(GridData.FILL_BOTH);
        propertiesView.getControl().setLayoutData(data2);

    }
}