Search in sources :

Example 1 with RequirementWithResourceLabelProvider

use of org.bndtools.core.ui.resource.RequirementWithResourceLabelProvider in project bndtools by bndtools.

the class ResolutionFailurePanel method createControl.

public void createControl(final Composite parent) {
    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    composite = toolkit.createComposite(parent);
    composite.setLayout(new GridLayout(1, false));
    GridData gd;
    sectProcessingErrors = toolkit.createSection(composite, Section.TITLE_BAR | Section.EXPANDED);
    sectProcessingErrors.setText("Processing Errors:");
    processingErrorsText = toolkit.createText(sectProcessingErrors, "", SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
    sectProcessingErrors.setClient(processingErrorsText);
    ControlDecoration controlDecoration = new ControlDecoration(processingErrorsText, SWT.RIGHT | SWT.TOP);
    controlDecoration.setMarginWidth(2);
    controlDecoration.setDescriptionText("Double-click to view details");
    controlDecoration.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage());
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 600;
    gd.heightHint = 300;
    sectProcessingErrors.setLayoutData(gd);
    sectUnresolved = toolkit.createSection(composite, Section.TITLE_BAR | Section.TWISTIE);
    sectUnresolved.setText("Unresolved Requirements:");
    createUnresolvedViewToolBar(sectUnresolved);
    Tree treeUnresolved = toolkit.createTree(sectUnresolved, SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
    sectUnresolved.setClient(treeUnresolved);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    gd.widthHint = 600;
    gd.heightHint = 300;
    sectUnresolved.setLayoutData(gd);
    unresolvedViewer = new TreeViewer(treeUnresolved);
    unresolvedViewer.setContentProvider(new UnresolvedRequirementsContentProvider());
    unresolvedViewer.setLabelProvider(new RequirementWithResourceLabelProvider());
    setFailureViewMode();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) TreeViewer(org.eclipse.jface.viewers.TreeViewer) RequirementWithResourceLabelProvider(org.bndtools.core.ui.resource.RequirementWithResourceLabelProvider) GridData(org.eclipse.swt.layout.GridData) ControlDecoration(org.eclipse.jface.fieldassist.ControlDecoration) Tree(org.eclipse.swt.widgets.Tree)

Aggregations

RequirementWithResourceLabelProvider (org.bndtools.core.ui.resource.RequirementWithResourceLabelProvider)1 ControlDecoration (org.eclipse.jface.fieldassist.ControlDecoration)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Tree (org.eclipse.swt.widgets.Tree)1 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)1