/* (non-Javadoc)
* @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
*/
protected void createMasterPart( final IManagedForm managedForm, Composite parent )
{
FormToolkit toolkit = managedForm.getToolkit();
// Creating the Section
Section section = toolkit.createSection( parent, Section.TITLE_BAR | Section.DESCRIPTION );
section.setText( "All Interceptors" );
section
.setDescription( " Set the Interceptors used in the server. Use the \"Up\" and \"Down\" buttons to change the order." );
section.marginWidth = 10;
section.marginHeight = 5;
Composite client = toolkit.createComposite( section, SWT.WRAP );
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.makeColumnsEqualWidth = false;
layout.marginWidth = 2;
layout.marginHeight = 2;
client.setLayout( layout );
toolkit.paintBordersFor( client );
section.setClient( client );
// Creatig the Table and Table Viewer
Table table = toolkit.createTable( client, SWT.NONE );
GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 4 );
gd.heightHint = 20;
gd.widthHint = 100;
table.setLayoutData( gd );
final SectionPart spart = new SectionPart( section );
managedForm.addPart( spart );
viewer = new TableViewer( table );
viewer.addSelectionChangedListener( new ISelectionChangedListener()
{
public void selectionChanged( SelectionChangedEvent event )
{
managedForm.fireSelectionChanged( spart, event.getSelection() );
}
} );
viewer.setContentProvider( new ArrayContentProvider() );
viewer.setLabelProvider( new LabelProvider()
{
public Image getImage( Object element )
{
return ApacheDSConfigurationPlugin.getDefault().getImage(
ApacheDSConfigurationPluginConstants.IMG_INTERCEPTOR );
}
} );
// Creating the button(s)
addButton = toolkit.createButton( client, "Add...", SWT.PUSH ); //$NON-NLS-1$
addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
deleteButton = toolkit.createButton( client, "Delete", SWT.PUSH );
deleteButton.setEnabled( false );
deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
upButton = toolkit.createButton( client, "Up", SWT.PUSH );
upButton.setEnabled( false );
upButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
downButton = toolkit.createButton( client, "Down", SWT.PUSH );
downButton.setEnabled( false );
downButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
initFromInput();
addListeners();