Java Code Examples for org.eclipse.jface.resource.JFaceColors#getBannerBackground()
The following examples show how to use
org.eclipse.jface.resource.JFaceColors#getBannerBackground() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CrosstabGrandTotalDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
private Composite createTitleArea( Composite parent ) { int heightMargins = 3; int widthMargins = 8; final Composite titleArea = new Composite( parent, SWT.NONE ); FormLayout layout = new FormLayout( ); layout.marginHeight = heightMargins; layout.marginWidth = widthMargins; titleArea.setLayout( layout ); Display display = parent.getDisplay( ); Color background = JFaceColors.getBannerBackground( display ); GridData layoutData = new GridData( GridData.FILL_HORIZONTAL ); layoutData.heightHint = 20 + ( heightMargins * 2 ); titleArea.setLayoutData( layoutData ); titleArea.setBackground( background ); titleArea.addPaintListener( new PaintListener( ) { public void paintControl( PaintEvent e ) { e.gc.setForeground( titleArea.getDisplay( ) .getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ) ); Rectangle bounds = titleArea.getClientArea( ); bounds.height = bounds.height - 2; bounds.width = bounds.width - 1; e.gc.drawRectangle( bounds ); } } ); Label label = new Label( titleArea, SWT.NONE ); label.setBackground( background ); label.setFont( FontManager.getFont( label.getFont( ).toString( ), 10, SWT.BOLD ) ); label.setText( getTitle( ) ); UIUtil.bindHelp( parent, IHelpContextIds.INSERT_EDIT_GRAND_TOTAL_DIALOG_ID ); return titleArea; }
Example 2
Source File: CrosstabPageBreakDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
private Composite createTitleArea( Composite parent ) { int heightMargins = 3; int widthMargins = 8; final Composite titleArea = new Composite( parent, SWT.NONE ); FormLayout layout = new FormLayout( ); layout.marginHeight = heightMargins; layout.marginWidth = widthMargins; titleArea.setLayout( layout ); Display display = parent.getDisplay( ); Color background = JFaceColors.getBannerBackground( display ); GridData layoutData = new GridData( GridData.FILL_HORIZONTAL ); layoutData.heightHint = 20 + ( heightMargins * 2 ); titleArea.setLayoutData( layoutData ); titleArea.setBackground( background ); titleArea.addPaintListener( new PaintListener( ) { public void paintControl( PaintEvent e ) { e.gc.setForeground( titleArea.getDisplay( ) .getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ) ); Rectangle bounds = titleArea.getClientArea( ); bounds.height = bounds.height - 2; bounds.width = bounds.width - 1; e.gc.drawRectangle( bounds ); } } ); Label label = new Label( titleArea, SWT.NONE ); label.setBackground( background ); label.setFont( FontManager.getFont( label.getFont( ).toString( ), 10, SWT.BOLD ) ); label.setText( getTitle( ) ); return titleArea; }
Example 3
Source File: CrosstabSubTotalDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
private Composite createTitleArea( Composite parent ) { int heightMargins = 3; int widthMargins = 8; final Composite titleArea = new Composite( parent, SWT.NONE ); FormLayout layout = new FormLayout( ); layout.marginHeight = heightMargins; layout.marginWidth = widthMargins; titleArea.setLayout( layout ); Display display = parent.getDisplay( ); Color background = JFaceColors.getBannerBackground( display ); GridData layoutData = new GridData( GridData.FILL_HORIZONTAL ); layoutData.heightHint = 20 + ( heightMargins * 2 ); titleArea.setLayoutData( layoutData ); titleArea.setBackground( background ); titleArea.addPaintListener( new PaintListener( ) { public void paintControl( PaintEvent e ) { e.gc.setForeground( titleArea.getDisplay( ) .getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ) ); Rectangle bounds = titleArea.getClientArea( ); bounds.height = bounds.height - 2; bounds.width = bounds.width - 1; e.gc.drawRectangle( bounds ); } } ); Label label = new Label( titleArea, SWT.NONE ); label.setBackground( background ); label.setFont( FontManager.getFont( label.getFont( ).toString( ), 10, SWT.BOLD ) ); label.setText( getTitle( ) ); return titleArea; }
Example 4
Source File: GroupDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Creates the title area * * @param parent * the parent composite */ private void createTitleArea( Composite parent ) { int heightMargins = 3; int widthMargins = 8; final Composite titleArea = new Composite( parent, SWT.NONE ); FormLayout layout = new FormLayout( ); layout.marginHeight = heightMargins; layout.marginWidth = widthMargins; titleArea.setLayout( layout ); Display display = parent.getDisplay( ); Color background = JFaceColors.getBannerBackground( display ); GridData layoutData = new GridData( GridData.FILL_HORIZONTAL ); layoutData.heightHint = 20 + ( heightMargins * 2 ); titleArea.setLayoutData( layoutData ); titleArea.setBackground( background ); titleArea.addPaintListener( new PaintListener( ) { public void paintControl( PaintEvent e ) { e.gc.setForeground( titleArea.getDisplay( ) .getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ) ); Rectangle bounds = titleArea.getClientArea( ); bounds.height = bounds.height - 2; bounds.width = bounds.width - 1; e.gc.drawRectangle( bounds ); } } ); Label label = new Label( titleArea, SWT.NONE ); label.setBackground( background ); label.setFont( FontManager.getFont( label.getFont( ).toString( ), 10, SWT.BOLD ) ); label.setText( GROUP_DLG_AREA_MSG ); }