RotatedLabelGeneralPage class
In this class, the buildUI( ) method creates the content for the General page in the property editor, adding the following display text controls:
*Font
*Rotation Angle
*Size
Listing 23‑8 shows the code for the buildUI( ) method.
Listing 23‑8 The buildUI( ) method
public void buildUI( Composite parent )
{
super.buildUI( parent );
container.setLayout( WidgetUtil.createGridLayout( 5, 15 ) );
 
LibraryDescriptorProvider provider = new LibraryDescriptorProvider( );
librarySection = new TextSection( provider.getDisplayName( ),
container, true );
librarySection.setProvider( provider );
librarySection.setGridPlaceholder( 2, true );
addSection( RotatedLabelPageSectionID.LIBRARY,
librarySection );
 
// display text property
separatorSection = new SeperatorSection( container,
SWT.HORIZONTAL );
addSection( RotatedLabelPageSectionID.SEPARATOR,
separatorSection );
TextPropertyDescriptorProvider nameProvider =
new TextPropertyDescriptorProvider( "displayText",
ReportDesignConstants.EXTENDED_ITEM );
TextSection nameSection = new TextSection(
"Display text:", container, true );
nameSection.setProvider( nameProvider );
nameSection.setGridPlaceholder( 3, true );
nameSection.setWidth(200 );
addSection( RotatedLabelPageSectionID.DISPLAY_TEXT,
nameSection );
 
// rotation angle property
TextPropertyDescriptorProvider angleProvider =
new TextPropertyDescriptorProvider( "rotationAngle",
ReportDesignConstants.EXTENDED_ITEM );
TextSection angleSection =
new TextSection( "Rotation Angle:", container, true );
angleSection.setProvider( angleProvider );
angleSection.setGridPlaceholder( 3, true );
angleSection.setWidth( 200 );
addSection( RotatedLabelPageSectionID.ROTATION_ANGLE,
angleSection );
 
//font family property
ComboPropertyDescriptorProvider fontFamilyProvider =
new ComboPropertyDescriptorProvider(
StyleHandle.FONT_FAMILY_PROP,
ReportDesignConstants.STYLE_ELEMENT );
ComboSection fontFamilySection = new ComboSection(
fontFamilyProvider.getDisplayName( ), container, true );
fontFamilySection.setProvider( fontFamilyProvider );
fontFamilySection.setLayoutNum( 2 );
fontFamilySection.setWidth( 200 );
addSection( PageSectionId.LABEL_FONT_FAMILY,
fontFamilySection );
 
//font size property
FontSizePropertyDescriptorProvider fontSizeProvider =
new FontSizePropertyDescriptorProvider(
StyleHandle.FONT_SIZE_PROP,
ReportDesignConstants.STYLE_ELEMENT );
FontSizeSection fontSizeSection = new FontSizeSection(
fontSizeProvider.getDisplayName( ), container, true );
fontSizeSection.setProvider( fontSizeProvider );
fontSizeSection.setLayoutNum( 4 );
fontSizeSection.setGridPlaceholder( 2, true );
fontSizeSection.setWidth( 200 );
addSection( PageSectionId.LABEL_FONT_SIZE, fontSizeSection );
createSections( );
layoutSections( );
}