Search in sources :

Example 1 with ResourceDetailViews

use of org.jboss.tools.openshift.internal.ui.server.ResourceDetailViews in project jbosstools-openshift by jbosstools.

the class ResourceSummaryDialog method createResourceDetails.

private void createResourceDetails(StructuredViewer viewer, Composite parent) {
    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    ExpandableComposite expandable = new ExpandableComposite(scrolledComposite, SWT.None);
    scrolledComposite.setContent(expandable);
    expandable.setText("Resource Details");
    expandable.setExpanded(true);
    expandable.setLayout(new FillLayout());
    Composite detailsContainer = new Composite(expandable, SWT.NONE);
    expandable.setClient(detailsContainer);
    expandable.addExpansionListener(new ExpansionAdapter() {

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            parent.update();
            parent.layout(true);
        }
    });
    DataBindingContext dbc = new DataBindingContext();
    IViewerObservableValue<Object> selectedResource = ViewerProperties.singlePostSelection().observe(viewer);
    new ResourceDetailViews(selectedResource, detailsContainer, dbc).createControls();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) DataBindingContext(org.eclipse.core.databinding.DataBindingContext) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent) ResourceDetailViews(org.jboss.tools.openshift.internal.ui.server.ResourceDetailViews)

Aggregations

DataBindingContext (org.eclipse.core.databinding.DataBindingContext)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)1 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)1 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)1 ResourceDetailViews (org.jboss.tools.openshift.internal.ui.server.ResourceDetailViews)1