Template / Textual File Editor
LLBLGen Pro designer embeds a full template editor which can also be used to edit textual files. To edit a template, open the Template Bindings Viewer and select the template files to edit as described in the Template Bindings Viewer editor documentation, or drag & drop a template file or text file on the LLBLGen Pro designer to open it in its editor.
The Template editor with a .lpt template
To have the designer open the file dragged/dropped onto it, it has to be started by the same user as the windows explorer, otherwise Windows will not allow it. Example, if the designer runs as administrator and Windows explorer as the normal user, dragging/dropping files onto the designer won't work.
Which text file formats are recognized and which elements are available through the text editor are described below.
In the stand-alone designer, to undo text in the text editor, use
Ctrl-Z
, as Ctrl-Shift-Z
is for global undo on the model. Local re-do
is defined as Ctrl-Y
. See also Undo / Redo of Changes.
To save a file, press Ctrl-Shift-S
. Pressing Ctrl-S
saves the
project, not the file you are editing.
The Text Editor's editing component accepts all key-strokes, which means
that if you have a text editor tab as the active tab and you want to
activate a menu option through a key-stroke, e.g. code generation
through F7
or deleting an element from the project explorer by pressing
DEL, it won't work, as the key is accepted by the active tab and handled
there, as in a multi-doc environment, the active tab always has the
focus as 'active'. In these situations, use the mouse or tab away from
the text editor tab.
Recognized text-file formats
The following formats are recognized when dragged onto the LLBLGen Pro designer. This is done through the file extension and when recognized, the Text editor will set its language selectors accordingly:
File extension | Output language | Logic language |
---|---|---|
.asa | HTML | |
.asax | HTML | |
.asp | HTML | |
.ascx | HTML | |
.ashx | HTML | |
.aspx | HTML | |
.csproj | XML | |
.cs | C# | |
.dbml | XML | |
.edmx | XML | |
.framework | XML | |
.frameworksettings | XML | |
.html | HTML | |
.htm | HTML | |
.language | XML | |
.lpt | C# | C# |
.platform | XML | |
.preset | XML | |
.sql | SQL | |
.tasks | XML | |
.template | C# | TDL |
.templatebindings | XML | |
.txt | Plain Text | |
.typeimports | XML | |
.vb | VB.NET | |
.vbproj | XML | |
.xaml | XML | |
.xml | XML | |
.xsd | XML | |
.xslt | XML |
When a file is an XML based file, and it contains a namespace declaration, the XSD is looked up in the set of XSD files shipped with LLBLGen Pro or in the list of XSD files shipped with VS.NET, in the folder specified in the designer preferences. This XSD will help the Text Editor to provide basic intellisense. When the file is a C# or VB.NET code file and not a template, intellisense is also provided. When a logic language is selected for a C# / VB.NET template file, intellisense isn't provided due to a limitation in the editor component used.
Output Language and Logic language selectors
At the top of the Text Editor there are two language selectors: the
Output Language selector and the optional Logic Language selector. These
selectors are used to set the background parser for the text and, if
applicable, the intellisense. Intellisense is provided when the Output
language is either XML, C# or VB.NET and the Logic language is
disabled. Logic language is enabled for .lpt and .template template
files. In these template files, the Logic language is the language the
template logic statements are written in, the code between the <% %>
markers in .lpt
templates and the code between <[ ]>
markers in .template
templates.
Editing tools
The Text Editor comes with its own toolbar, which is added to the main toolbar space in the designer UI and visible when a Text Editor tab is active. It provides buttons for the well known tools like cut/copy/paste/delete selected/find/replace/indent and unindent. It also adds a 'save all' button to the main toolbar for new/open/save a project at the left of the toolbar space. The following tools are available to you in the editor:
- Find / replace
- There's basic find/replace implemented for a
text editor (local file only, not cross- files open in the editor),
which allows multi-line search/replace. Open it by pressing
Ctrl-F
. - Goto line
- To go to a specific line, press cntrl-G to bring up a small dialog to specify the line number you want to go to in the editor.
- Refactor
- There's basic refactor support for templates, i.e.
.template
files (TDL templates) and.lpt
files (lpt templates). Refactorings are selectable through the Edit -> Refactor main menu.