String prefix= getPrefix(); IDocument doc= fPatternEditor.getDocument(); try { String pattern= doc.get(prefix.length(), doc.getLength() - prefix.length()); return new Template(fNameText.getText(), fDescriptionText.getText(), getContextId(fContextCombo.getText()), pattern); } catch (BadLocationException e) { return null; }
return fTemplate;
	public Template getTemplate() {		String prefix= getPrefix();		IDocument doc= fPatternEditor.getDocument();		try {			String pattern= doc.get(prefix.length(), doc.getLength() - prefix.length());			return new Template(fNameText.getText(), fDescriptionText.getText(), getContextId(fContextCombo.getText()), pattern);		} catch (BadLocationException e) {			return null;		}	}