private boolean showMargin = true;
	protected IFigure createFigure( )	{		Figure figure = new ReportElementFigure( ) {			private boolean showMargin = true;			{				getViewer( ).addPropertyChangeListener( new PropertyChangeListener( ) {					public void propertyChange( PropertyChangeEvent evt )					{						if ( DeferredGraphicalViewer.PROPERTY_MARGIN_VISIBILITY.equals( evt.getPropertyName( ) ) )						{							showMargin = ( (Boolean) evt.getNewValue( ) ).booleanValue( );							refresh( );							markDirty( true );						}					}				} );			}			protected void paintBorder( Graphics graphics )			{				//does nothing , figure paint itself.			}			public Insets getInsets( )			{				if ( showMargin )				{					if ( getBorder( ) != null )					{						return getBorder( ).getInsets( this );					}					return NO_INSETS;				}				return DEFAULT_MARGIN;			}			protected void paintFigure( Graphics graphics )			{				super.paintFigure( graphics );				graphics.setForegroundColor( ReportColorConstants.MarginBorderColor );				graphics.drawRectangle( getBounds( ).getCopy( )						.crop( getInsets( ) )						.crop( DEFAULT_CROP ) );				//				graphics.setForegroundColor(				// ReportColorConstants.MarginMarkerColor );				//				//				Rectangle rect = getBounds( ).getCopy( )				//						.crop( getBorder( ).getInsets( this ) )				//						.crop( DEFAULT_CROP );				//				//				graphics.drawLine( rect.x, rect.y, rect.x, rect.y - 27 );				//				graphics.drawLine( rect.x, rect.y, rect.x - 27, rect.y );				//				//				graphics.drawLine( rect.x + rect.width, rect.y, rect.x				//						+ rect.width, rect.y - 27 );				//				graphics.drawLine( rect.x + rect.width, rect.y, rect.x				//						+ rect.width				//						+ 27, rect.y );				//				//				graphics.drawLine( rect.x, rect.y + rect.height, rect.x,				// rect.y				//						+ rect.height				//						+ 27 );				//				graphics.drawLine( rect.x,				//						rect.y + rect.height,				//						rect.x - 27,				//						rect.y + rect.height );				//				//				graphics.drawLine( rect.x + rect.width,				//						rect.y + rect.height,				//						rect.x + rect.width + 27,				//						rect.y + rect.height );				//				graphics.drawLine( rect.x + rect.width,				//						rect.y + rect.height,				//						rect.x + rect.width,				//						rect.y + rect.height + 27 );			}			protected void paintChildren( Graphics graphics )			{				IFigure child;				for ( int i = 0; i < this.getChildren( ).size( ); i++ )				{					child = (IFigure) this.getChildren( ).get( i );					if ( child.isVisible( ) )					{						graphics.setClip( getBounds( ).getCopy( )								.intersect( child.getBounds( ) ) );						child.paint( graphics );						graphics.restoreState( );					}				}			}			/*			 * (non-Javadoc)			 * 			 * @see org.eclipse.draw2d.Figure#findDescendantAtExcluding(int,			 *      int, org.eclipse.draw2d.TreeSearch)			 */			protected IFigure findDescendantAtExcluding( int x, int y,					TreeSearch search )			{				PRIVATE_POINT.setLocation( x, y );				translateFromParent( PRIVATE_POINT );				if ( !getBounds( ).contains( PRIVATE_POINT ) )					return null;				IFigure fig;				for ( int i = getChildren( ).size( ); i > 0; )				{					i--;					fig = (IFigure) getChildren( ).get( i );					if ( fig.isVisible( ) )					{						fig = fig.findFigureAt( PRIVATE_POINT.x,								PRIVATE_POINT.y,								search );						if ( fig != null )							return fig;					}				}				//No descendants were found				return null;			}		};		figure.setOpaque( true );		ReportDesignLayout layout = new ReportDesignLayout( this );		SlotHandle slotHandle = ( (ReportDesignHandle) getModel( ) ).getMasterPages( );		Iterator iter = slotHandle.iterator( );		SimpleMasterPageHandle masterPageHandle = (SimpleMasterPageHandle) iter.next( );		Dimension size = getMasterPageSize( masterPageHandle );		Rectangle bounds = new Rectangle( 0, 0, size.width - 1, size.height - 1 );		layout.setInitSize( bounds );		figure.setLayoutManager( layout );		figure.setBorder( new ReportDesignMarginBorder( getMasterPageInsets( masterPageHandle ) ) );		figure.setBounds( bounds.getCopy( ) );		return figure;	}