expression.setText( DEUtil.resolveNull( ( (DataItemHandle) designHandle ).getValueExpr( ) ) );
expression.setText( DEUtil.getColumnExpression( ( (DataItemHandle) designHandle ).getName( ) ) );
	protected Control createContents( Composite parent )	{		GridData gdata;		GridLayout glayout;		createTitleArea( parent );		Composite composite = new Composite( parent, 0 );		glayout = new GridLayout( );		glayout.marginHeight = 0;		glayout.marginWidth = 0;		glayout.verticalSpacing = 0;		composite.setLayout( glayout );		composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );		applyDialogFont( composite );		initializeDialogUnits( composite );		Composite innerParent = (Composite) createDialogArea( composite );		createButtonBar( composite );		Label lb = new Label( innerParent, SWT.NONE );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Condition" ) ); //$NON-NLS-1$		Composite condition = new Composite( innerParent, SWT.NONE );		condition.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );		glayout = new GridLayout( 5, false );		condition.setLayout( glayout );		expression = new Combo( condition, SWT.NONE );		gdata = new GridData( );		gdata.widthHint = 100;		expression.setLayoutData( gdata );		fillExpression( expression );		expression.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				if ( expression.getText( ).equals( VALUE_OF_THIS_DATA_ITEM )						&& designHandle instanceof DataItemHandle )				{					expression.setText( DEUtil.resolveNull( ( (DataItemHandle) designHandle ).getValueExpr( ) ) );				}				updateButtons( );			}		} );		expression.addModifyListener( new ModifyListener( ) {			public void modifyText( ModifyEvent e )			{				updateButtons( );			}		} );		Button expBuilder = new Button( condition, SWT.PUSH );		expBuilder.setText( "..." ); //$NON-NLS-1$		gdata = new GridData( );		gdata.heightHint = 20;		gdata.widthHint = 20;		expBuilder.setLayoutData( gdata );		expBuilder.setToolTipText( Messages.getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$		expBuilder.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				editValue( expression );			}		} );		operator = new Combo( condition, SWT.READ_ONLY );		for ( int i = 0; i < OPERATOR.length; i++ )		{			operator.add( OPERATOR[i][0] );		}		operator.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				String value = getValueForOperator( operator.getText( ) );				int vv = determineValueVisible( value );				if ( vv == 0 )				{					value1.setVisible( false );					value2.setVisible( false );					valBuilder1.setVisible( false );					valBuilder2.setVisible( false );					andLable.setVisible( false );				}				else if ( vv == 1 )				{					value1.setVisible( true );					valBuilder1.setVisible( true );					value2.setVisible( false );					valBuilder2.setVisible( false );					andLable.setVisible( false );				}				else if ( vv == 2 )				{					value1.setVisible( true );					value2.setVisible( true );					valBuilder1.setVisible( true );					valBuilder2.setVisible( true );					andLable.setVisible( true );				}				updateButtons( );			}		} );		value1 = createText( condition );		value1.addModifyListener( new ModifyListener( ) {			public void modifyText( ModifyEvent e )			{				updateButtons( );			}		} );		valBuilder1 = new Button( condition, SWT.PUSH );		valBuilder1.setText( "..." ); //$NON-NLS-1$		gdata = new GridData( );		gdata.heightHint = 20;		gdata.widthHint = 20;		valBuilder1.setLayoutData( gdata );		valBuilder1.setToolTipText( Messages.getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$		valBuilder1.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				editValue( value1 );			}		} );		createDummy( condition, 3 );		andLable = new Label( condition, SWT.NONE );		andLable.setText( Messages.getString( "HighlightRuleBuilderDialog.text.AND" ) ); //$NON-NLS-1$		andLable.setVisible( false );		createDummy( condition, 1 );		createDummy( condition, 3 );		value2 = createText( condition );		value2.addModifyListener( new ModifyListener( ) {			public void modifyText( ModifyEvent e )			{				updateButtons( );			}		} );		value2.setVisible( false );		valBuilder2 = new Button( condition, SWT.PUSH );		valBuilder2.setText( "..." ); //$NON-NLS-1$		gdata = new GridData( );		gdata.heightHint = 20;		gdata.widthHint = 20;		valBuilder2.setLayoutData( gdata );		valBuilder2.setToolTipText( Messages.getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$		valBuilder2.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				editValue( value2 );			}		} );		valBuilder2.setVisible( false );		if ( operator.getItemCount( ) > 0 )		{			operator.select( 0 );		}		lb = new Label( innerParent, SWT.NONE );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Format" ) ); //$NON-NLS-1$		Composite format = new Composite( innerParent, SWT.NONE );		format.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );		glayout = new GridLayout( 7, false );		format.setLayout( glayout );		lb = new Label( format, 0 );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Font" ) ); //$NON-NLS-1$		lb = new Label( format, 0 );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Size" ) ); //$NON-NLS-1$		lb = new Label( format, 0 );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Color" ) ); //$NON-NLS-1$		createDummy( format, 4 );		font = new Combo( format, SWT.READ_ONLY );		gdata = new GridData( );		gdata.widthHint = 100;		font.setLayoutData( gdata );		IChoiceSet fontSet = ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT,				StyleHandle.FONT_FAMILY_PROP );		font.setData( fontSet );		font.setItems( ChoiceSetFactory.getDisplayNamefromChoiceSet( fontSet,				new AlphabeticallyComparator( ) ) );		if ( SYSTEM_FONT_LIST != null && SYSTEM_FONT_LIST.length > 0 )		{			for ( int i = 0; i < SYSTEM_FONT_LIST.length; i++ )			{				font.add( SYSTEM_FONT_LIST[i] );			}		}		font.add( DEFAULT_CHOICE, 0 );		font.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				updatePreview( );			}		} );		if ( font.getItemCount( ) > 0 )		{			font.select( 0 );		}		size = new FontSizeBuilder( format, SWT.None );		if ( designHandle != null )		{			size.setDefaultUnit( designHandle.getPropertyHandle( StyleHandle.FONT_SIZE_PROP )					.getDefaultUnit( ) );		}		gdata = new GridData( );		gdata.widthHint = 120;		size.setLayoutData( gdata );		size.setFontSizeValue( null );		size.addListener( SWT.Modify, new Listener( ) {			public void handleEvent( Event event )			{				updatePreview( );			}		} );		color = new ColorBuilder( format, 0 );		gdata = new GridData( );		gdata.widthHint = 50;		color.setLayoutData( gdata );		color.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT,				StyleHandle.COLOR_PROP ) );		color.setRGB( null );		color.addListener( SWT.Modify, new Listener( ) {			public void handleEvent( Event event )			{				previewLabel.setForeground( ColorManager.getColor( color.getRGB( ) ) );				previewLabel.redraw( );			}		} );		Composite fstyle = new Composite( format, 0 );		gdata = new GridData( );		gdata.horizontalSpan = 4;		fstyle.setLayoutData( gdata );		fstyle.setLayout( new GridLayout( 4, false ) );		bold = createToggleButton( fstyle );		bold.setImage( ReportPlatformUIImages.getImage( AttributeConstant.FONT_WIDTH ) );		bold.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				isBoldChanged = true;				updatePreview( );			}		} );		italic = createToggleButton( fstyle );		italic.setImage( ReportPlatformUIImages.getImage( AttributeConstant.FONT_STYLE ) );		italic.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				isItalicChanged = true;				updatePreview( );			}		} );		underline = createToggleButton( fstyle );		underline.setImage( ReportPlatformUIImages.getImage( AttributeConstant.TEXT_UNDERLINE ) );		underline.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				isUnderlineChanged = true;				previewLabel.setUnderline( underline.getSelection( ) );				previewLabel.redraw( );			}		} );		linethrough = createToggleButton( fstyle );		linethrough.setImage( ReportPlatformUIImages.getImage( AttributeConstant.TEXT_LINE_THROUGH ) );		linethrough.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent e )			{				isLinethroughChanged = true;				previewLabel.setLinethrough( linethrough.getSelection( ) );				previewLabel.redraw( );			}		} );		Composite back = new Composite( innerParent, SWT.NONE );		back.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );		glayout = new GridLayout( 1, false );		back.setLayout( glayout );		lb = new Label( back, 0 );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.BackgroundColor" ) ); //$NON-NLS-1$		backColor = new ColorBuilder( back, 0 );		gdata = new GridData( );		gdata.widthHint = 50;		backColor.setLayoutData( gdata );		backColor.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT,				StyleHandle.BACKGROUND_COLOR_PROP ) );		backColor.setRGB( null );		backColor.addListener( SWT.Modify, new Listener( ) {			public void handleEvent( Event event )			{				previewLabel.setBackground( ColorManager.getColor( backColor.getRGB( ) ) );				previewLabel.redraw( );			}		} );		Composite preview = new Composite( innerParent, SWT.NONE );		glayout = new GridLayout( );		preview.setLayout( glayout );		gdata = new GridData( GridData.FILL_BOTH );		preview.setLayoutData( gdata );		lb = new Label( preview, SWT.NONE );		lb.setText( Messages.getString( "HighlightRuleBuilderDialog.text.Preview" ) ); //$NON-NLS-1$		Composite previewPane = new Composite( preview, SWT.BORDER );		glayout = new GridLayout( );		glayout.marginWidth = 0;		glayout.marginHeight = 0;		previewPane.setLayout( glayout );		gdata = new GridData( GridData.FILL_BOTH );		gdata.heightHint = 60;		previewPane.setLayoutData( gdata );		previewLabel = new PreviewLabel( previewPane, 0 );		previewLabel.setText( Messages.getString( "HighlightRuleBuilderDialog.text.PreviewContent" ) ); //$NON-NLS-1$		gdata = new GridData( GridData.FILL_BOTH );		previewLabel.setLayoutData( gdata );		updatePreview( );		lb = new Label( innerParent, SWT.SEPARATOR | SWT.HORIZONTAL );		lb.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );		syncViewProperties( );		updatePreview( );		updateButtons( );		return composite;	}