this.marginWidth = 10;
this.marginHeight = 10;
setLayoutData( gdfill() );
setLayout( glayout( 1, 0, 0 ) );
final SapphireEditorPagePart part = getPart();
final Listener pagePartListener = new FilteredListener<OutlineHeaderTextEvent>()
{
@Override
protected void handleTypedEvent( final OutlineHeaderTextEvent event )
{
refreshOutlineHeaderText();
}
};
part.attach( pagePartListener );
refreshOutlineHeaderText();
final Composite client = toolkit.createComposite( this );
client.setLayout( glayout( 1, 0, 0 ) );
this.managedForm = managedForm;
final MasterDetailsContentOutline contentTree = outline();
final FilteredTree filteredTree = createContentOutline( client, contentTree, true );
this.treeViewer = filteredTree.getViewer();
this.tree = this.treeViewer.getTree();
this.sectionPart = new org.eclipse.ui.forms.SectionPart( this );
this.managedForm.addPart( this.sectionPart );
contentTree.attach
(
new FilteredListener<MasterDetailsContentOutline.SelectionChangedEvent>()
{
@Override
protected void handleTypedEvent( final MasterDetailsContentOutline.SelectionChangedEvent event )
{
handleSelectionChangedEvent( event.selection() );
}
}
);
final ToolBar toolbar = new ToolBar( this, SWT.FLAT | SWT.HORIZONTAL );
setTextClient( toolbar );
final SapphireActionGroup actions = part.getActions( CONTEXT_EDITOR_PAGE_OUTLINE_HEADER );
final SapphireActionPresentationManager actionPresentationManager
= new SapphireActionPresentationManager( MasterDetailsEditorPage.this.presentation, actions );
final SapphireToolBarActionPresentation toolbarActionsPresentation = new SapphireToolBarActionPresentation( actionPresentationManager );
toolbarActionsPresentation.setToolBar( toolbar );
toolbarActionsPresentation.render();
final SapphireKeyboardActionPresentation keyboardActionsPresentation = new SapphireKeyboardActionPresentation( actionPresentationManager );
keyboardActionsPresentation.attach( filteredTree.getFilterControl() );
keyboardActionsPresentation.render();
toolkit.paintBordersFor( this );
setClient( client );
this.tree.addDisposeListener
(
new DisposeListener()
{
public void widgetDisposed( final DisposeEvent event )
{
part.detach( pagePartListener );
}
}
);
}