X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/preferences/TemplateVariableProposal.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/preferences/TemplateVariableProposal.java index 5550d19..13ec454 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/preferences/TemplateVariableProposal.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/preferences/TemplateVariableProposal.java @@ -29,42 +29,54 @@ import org.eclipse.swt.widgets.Shell; public class TemplateVariableProposal implements ICompletionProposal { private TemplateVariableResolver fVariable; + private int fOffset; - private int fLength; + + private int fLength; + private ITextViewer fViewer; - + private Point fSelection; /** * Creates a template variable proposal. * - * @param variable the template variable - * @param offset the offset to replace - * @param length the length to replace - * @param viewer the viewer + * @param variable + * the template variable + * @param offset + * the offset to replace + * @param length + * the length to replace + * @param viewer + * the viewer */ - public TemplateVariableProposal(TemplateVariableResolver variable, int offset, int length, ITextViewer viewer) { - fVariable= variable; - fOffset= offset; - fLength= length; - fViewer= viewer; + public TemplateVariableProposal(TemplateVariableResolver variable, + int offset, int length, ITextViewer viewer) { + fVariable = variable; + fOffset = offset; + fLength = length; + fViewer = viewer; } - + /* * @see ICompletionProposal#apply(IDocument) */ public void apply(IDocument document) { try { - String variable= fVariable.getType().equals("dollar") ? "$$" : "${" + fVariable.getType() + '}'; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + String variable = fVariable.getType().equals("dollar") ? "$$" : "${" + fVariable.getType() + '}'; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ document.replace(fOffset, fLength, variable); - fSelection= new Point(fOffset + variable.length(), 0); + fSelection = new Point(fOffset + variable.length(), 0); } catch (BadLocationException e) { PHPeclipsePlugin.log(e); - Shell shell= fViewer.getTextWidget().getShell(); - MessageDialog.openError(shell, TemplatePreferencesMessages.getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$ + Shell shell = fViewer.getTextWidget().getShell(); + MessageDialog + .openError( + shell, + TemplatePreferencesMessages + .getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$ } }