Mercurial > projects > dwt-addons
diff dwtx/jface/text/templates/TemplateContextType.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | f70d9508c95c |
children |
line wrap: on
line diff
--- a/dwtx/jface/text/templates/TemplateContextType.d Wed Aug 27 14:49:30 2008 +0200 +++ b/dwtx/jface/text/templates/TemplateContextType.d Mon Sep 08 00:51:37 2008 +0200 @@ -70,7 +70,7 @@ private /* final */ String fId= null; /** Variable resolvers used by this content type. */ - private const Map fResolvers= new HashMap(); + private const Map fResolvers; /** The name of the context type. */ private String fName= null; @@ -92,6 +92,8 @@ * @param name the name of the context type */ public this(String id, String name) { + fResolvers= new HashMap(); + Assert.isNotNull(id); Assert.isNotNull(name); fId= id; @@ -100,7 +102,7 @@ /** * Returns the id of the context type. - * + * * @return the id of the receiver */ public String getId() { @@ -127,6 +129,7 @@ * </p> */ public this() { + fResolvers= new HashMap(); } /** @@ -271,8 +274,8 @@ IDocument document= new Document(buffer.getString()); MultiTextEdit edit= new MultiTextEdit(0, document.getLength()); - edit.addChildren((TextEdit[]) positions.toArray(new TextEdit[positions.size()])); - edit.addChildren((TextEdit[]) edits.toArray(new TextEdit[edits.size()])); + edit.addChildren(arraycast!(TextEdit)( positions.toArray())); + edit.addChildren(arraycast!(TextEdit)( edits.toArray())); edit.apply(document, TextEdit.UPDATE_REGIONS); positionsToVariables(positions, variables); @@ -282,7 +285,7 @@ /** * Resolves a single variable in a context. Resolving is delegated to the registered resolver. - * + * * @param variable the variable to resolve * @param context the context in which to resolve the variable * @since 3.3