/**
* Creates the details tab.
*/
private void createDetailsTab()
{
SashForm detailsForm = new SashForm( tabFolder, SWT.VERTICAL );
detailsForm.setLayout( new FillLayout() );
Composite hierarchyContainer = new Composite( detailsForm, SWT.NONE );
GridLayout hierarchyLayout = new GridLayout( 1, false );
hierarchyLayout.marginTop = 10;
hierarchyLayout.marginWidth = 10;
hierarchyContainer.setLayout( hierarchyLayout );
BaseWidgetUtils.createLabel( hierarchyContainer, Messages
.getString( "CertificateInfoComposite.CertificateHierarchyLabel" ), 1 ); //$NON-NLS-1$
hierarchyTreeViewer = new TreeViewer( hierarchyContainer );
hierarchyTreeViewer.getTree().setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) );
hierarchyTreeViewer.setContentProvider( new HierarchyContentProvider() );
hierarchyTreeViewer.setLabelProvider( new HierarchyLabelProvider() );
hierarchyTreeViewer.addSelectionChangedListener( new ISelectionChangedListener()
{
public void selectionChanged( SelectionChangedEvent event )
{
populateCertificateTree();
}
} );
Composite certificateContainer = new Composite( detailsForm, SWT.NONE );
GridLayout certificateLayout = new GridLayout( 1, false );
certificateLayout.marginWidth = 10;
certificateContainer.setLayout( certificateLayout );
BaseWidgetUtils.createLabel( certificateContainer, Messages
.getString( "CertificateInfoComposite.CertificateFieldsLabel" ), 1 ); //$NON-NLS-1$
certificateTree = new Tree( certificateContainer, SWT.BORDER );
certificateTree.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) );
certificateTree.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( final SelectionEvent e )
{
TreeItem item = ( TreeItem ) e.item;
if ( ( item != null ) && ( item.getData() != null ) )
{
valueText.setText( item.getData().toString() );
}
else
{
valueText.setText( StringUtils.EMPTY );
}
}
} );
Composite valueContainer = new Composite( detailsForm, SWT.NONE );
GridLayout valueLayout = new GridLayout( 1, false );
valueLayout.marginWidth = 10;
valueLayout.marginBottom = 10;
valueContainer.setLayout( valueLayout );
BaseWidgetUtils.createLabel( valueContainer,
Messages.getString( "CertificateInfoComposite.FieldValuesLabel" ), 1 ); //$NON-NLS-1$
valueText = new Text( valueContainer, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY );
valueText.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) );
valueText.setFont( JFaceResources.getFont( JFaceResources.TEXT_FONT ) );
valueText.setBackground( detailsForm.getBackground() );
// create tab
detailsForm.setWeights( new int[]
{ 1, 2, 1 } );
detailsTab = new TabItem( tabFolder, SWT.NONE, DETAILS_TAB_INDEX );
detailsTab.setText( Messages.getString( "CertificateInfoComposite.Details" ) ); //$NON-NLS-1$
detailsTab.setControl( detailsForm );
}