protected void createFormContent()

in plugins/org.apache.karaf.eik.workbench/src/main/java/org/apache/karaf/eik/workbench/ui/editor/KarafPlatformRuntimeFormPage.java [202:279]


    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);
            }
        }
    }