else{ try { int customWidth = (int)DimensionValue.parse( key ).getMeasure( ); if(DimensionValue.parse( key ).getUnits( ).equals( DesignChoiceConstants.UNITS_PX ))gc.setLineWidth( customWidth ); } catch (Exception e) { ExceptionHandler.handle( e ); } }
	public Image getImage( Object item, int width, int height, Control control,			Control parent )	{		assert control != null;		assert parent != null;		Color foreground = parent.getForeground( );		Color background = parent.getBackground( );		Color rectColor = control.getBackground( );		Display display = parent.getDisplay( );		Color shadowColor = display.getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW );		Color hShadowColor = display.getSystemColor( SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW );		PaletteData palette = new PaletteData( new RGB[]{				foreground.getRGB( ),				background.getRGB( ),				shadowColor.getRGB( ),				hShadowColor.getRGB( ),				rectColor.getRGB( )		} );		ImageData imageData = new ImageData( width - 2, height, 8, palette );		imageData.transparentPixel = 1;		Image image = new Image( display, imageData );		GC gc = new GC( image );		// gc.setBackground( background );		gc.fillRectangle( 0, 0, width, height );		gc.setForeground( rectColor );		Rectangle r = image.getBounds( );		gc.setLineWidth( 4 );		gc.drawRectangle( r.x, r.y, r.width - 1, r.height - 1 );		gc.setLineWidth( 1 );		gc.setForeground( foreground );		String key = null;		if ( item instanceof String )			key = (String) item;		else if ( item instanceof IChoice )			key = ( (IChoice) item ).getName( );		if ( DesignChoiceConstants.LINE_STYLE_NONE.equals( key ) )		{			Point textSize = gc.textExtent( item.toString( ) );			gc.drawString( LINE_STYLE_NONE, 5, ( height - textSize.y ) / 2 );		}		else if ( DesignChoiceConstants.LINE_STYLE_DOUBLE.equals( key ) )		{			gc.drawLine( 4, height / 2 - 1, width - 4, height / 2 - 1 );			gc.drawLine( 4, height / 2 + 1, width - 4, height / 2 + 1 );		}		else		{			if ( DesignChoiceConstants.LINE_STYLE_DOTTED.equals( key ) )				gc.setLineStyle( SWT.LINE_DOT );			else if ( DesignChoiceConstants.LINE_STYLE_DASHED.equals( key ) )				gc.setLineStyle( SWT.LINE_DASH );			else if ( DesignChoiceConstants.LINE_STYLE_SOLID.equals( key ) )				gc.setLineStyle( SWT.LINE_SOLID );			else if ( DesignChoiceConstants.LINE_WIDTH_THIN.equals( key ) )				gc.setLineWidth( 1 );			else if ( DesignChoiceConstants.LINE_WIDTH_MEDIUM.equals( key ) )				gc.setLineWidth( 2 );			else if ( DesignChoiceConstants.LINE_WIDTH_THICK.equals( key ) )				gc.setLineWidth( 3 );			gc.drawLine( 4, height / 2, width - 4, height / 2 );		}		gc.dispose( );		return image;	}