: new NullTokenMarker());
: jEdit.getMode("text").createTokenMarker());
	public void print(View view)	{		PrintJob job = view.getToolkit().getPrintJob(view,name,null);		if(job == null)			return;		view.showWaitCursor();		int topMargin;		int leftMargin;		int bottomMargin;		int rightMargin;		int ppi = job.getPageResolution();		try		{			topMargin = (int)(Float.valueOf(jEdit.getProperty(				"print.margin.top")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			topMargin = ppi / 2;		}		try		{			leftMargin = (int)(Float.valueOf(jEdit.getProperty(				"print.margin.left")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			leftMargin = ppi / 2;		}		try		{			bottomMargin = (int)(Float.valueOf(jEdit.getProperty(				"print.margin.bottom")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			bottomMargin = topMargin;		}		try		{			rightMargin = (int)(Float.valueOf(jEdit.getProperty(				"print.margin.right")).floatValue() * ppi);		}		catch(NumberFormatException nf)		{			rightMargin = leftMargin;		}		boolean printHeader = jEdit.getBooleanProperty("print.header");		boolean printFooter = jEdit.getBooleanProperty("print.footer");		boolean printLineNumbers = jEdit.getBooleanProperty("print.lineNumbers");		boolean syntax = jEdit.getBooleanProperty("print.syntax");		String header = path;		String footer = new Date().toString();		TokenMarker tokenMarker = (syntax ? this.tokenMarker			: new NullTokenMarker());		SyntaxStyle[] styles = view.getTextArea().getPainter().getStyles();		TabExpander expander = null;		Graphics gfx = null;		String fontFamily = jEdit.getProperty("print.font");		int fontSize;		try		{			fontSize = Integer.parseInt(jEdit.getProperty(				"print.fontsize"));		}		catch(NumberFormatException nf)		{			fontSize = 10;		}		int fontStyle;		try		{			fontStyle = Integer.parseInt(jEdit.getProperty(				"print.fontstyle"));		}		catch(NumberFormatException nf)		{			fontStyle = Font.PLAIN;		}		Font font = new Font(fontFamily,fontStyle,fontSize);		FontMetrics fm = null;		Dimension pageDimension = job.getPageDimension();		int pageWidth = pageDimension.width;		int pageHeight = pageDimension.height;		int y = 0;		int tabSize = 0;		int lineHeight = 0;		int page = 0;		int lineCount = getDefaultRootElement().getElementCount();		int lineNumberDigits = (int)Math.ceil(Math.log(			lineCount) / Math.log(10));		for(int i = 0; i < lineCount; i++)		{			if(gfx == null)			{				page++;				gfx = job.getGraphics();				gfx.setFont(font);				fm = gfx.getFontMetrics();				lineHeight = fm.getHeight();				tabSize = getTabSize() * fm.charWidth(' ');				expander = new PrintTabExpander(leftMargin,tabSize);				y = topMargin + lineHeight - fm.getDescent()					- fm.getLeading();				if(printHeader)				{					gfx.setColor(Color.lightGray);					gfx.fillRect(leftMargin,topMargin,pageWidth						- leftMargin - rightMargin,lineHeight);					gfx.setColor(Color.black);					gfx.drawString(header,leftMargin,y);					y += lineHeight;				}			}			y += lineHeight;			gfx.setColor(Color.black);			gfx.setFont(font);			int x = leftMargin;			if(printLineNumbers)			{				int lineNumberWidth = fm.charWidth('0') * lineNumberDigits;				String lineNumber = String.valueOf(i + 1);				gfx.drawString(lineNumber,(leftMargin + lineNumberWidth)					- fm.stringWidth(lineNumber),y);				x += lineNumberWidth + fm.charWidth('0');			}			tokenMarker.paintSyntaxLine(this,i,				styles,expander,gfx,Color.white,x,y);			int bottomOfPage = pageHeight - bottomMargin - lineHeight;			if(printFooter)				bottomOfPage -= lineHeight * 2;			if(y >= bottomOfPage || i == lineCount - 1)			{				if(printFooter)				{					y = pageHeight - bottomMargin;					gfx.setColor(Color.lightGray);					gfx.setFont(font);					gfx.fillRect(leftMargin,y - lineHeight,pageWidth						- leftMargin - rightMargin,lineHeight);					gfx.setColor(Color.black);					y -= (lineHeight - fm.getAscent());					gfx.drawString(footer,leftMargin,y);					Integer[] args = { new Integer(page) };					String pageStr = jEdit.getProperty("print.page",args);					int width = fm.stringWidth(pageStr);					gfx.drawString(pageStr,pageWidth - rightMargin						- width,y);				}				gfx.dispose();				gfx = null;			}		}		job.end();		view.hideWaitCursor();	}