|
|
(18 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | == Introduction to Templates Completion ==
| |
| | | |
− | This page will soon contain in-detail information about the Code Recommenders Template Completion plugin and how it can be used, maintained and extended by developers.
| |
− |
| |
− | For the rest of this introduction we will present a short scenario which helps the developer to understand the major tasks and possible obstacles.
| |
− | In the following we will present the general [[#Architecture]] of the plugin by giving an overview of its components in [[#Components Overview]] and how they interact in [[#General Workflow]].
| |
− | We will further explain the most [[#Important Concepts]] which further helps understanding the system and are vital to know for working on the plugin.
| |
− |
| |
− | === Functionality ===
| |
− |
| |
− | Here we will give a short illustration about the main goals of this plugin.
| |
− |
| |
− | ; Default Eclipse SWT template for a new button:
| |
− | <source lang="java">
| |
− | ${buttonType:newType(org.eclipse.swt.widgets.Button)} ${button:newName(org.eclipse.swt.widgets.Button)}= new ${buttonType}(${parent:var(org.eclipse.swt.widgets.Composite)}, ${style:link(SWT.PUSH, SWT.TOGGLE, SWT.RADIO, SWT.CHECK, SWT.FLAT)});
| |
− | ${button}.setLayoutData(new ${type:newType(org.eclipse.swt.layout.GridData)}(SWT.${horizontal:link(BEGINNING, CENTER, END, FILL)}, SWT.${vertical:link(CENTER, TOP, BOTTOM, FILL)}, ${hex:link(false, true)}, ${vex:link(false, true)}));
| |
− | ${button}.setText(${word_selection}${});
| |
− | ${imp:import(org.eclipse.swt.SWT)}${cursor}
| |
− | </source>
| |
− |
| |
− | The task of this Plugin is to dynamically construct such templates depending on the context, i.e. depending on at which position completion was triggered (e.g. Button b<^Space>) and what has already been done with the observed variable, and the information about frequent patterns in such a context, as obtained from other [[Recommenders]] components.
| |
− |
| |
− | == Architecture ==
| |
− |
| |
− | This section will contain a general overview about the whole plugin and how its components interact.
| |
− |
| |
− | === Components Overview ===
| |
− |
| |
− | This subsection will give a short description of each component and display the dependencies between them.
| |
− |
| |
− | [[Image:Recommenders templates arch.png|thumb|Dependencies between components]]
| |
− |
| |
− | {| border="1" cellpadding="4" cellspacing="0"
| |
− | |+ Table of Plugin components and short description of their roles.
| |
− | ! style="background: #ffdead;" | Package / Class
| |
− | ! style="background: #ffdead;" | Description
| |
− | |-
| |
− | ! style="background: #efefef;" | .templates
| |
− | ! style="background: #efefef;" | Description coming soon.
| |
− | |-
| |
− | | CompletionProposalsBuilder
| |
− | | Transforms PatternRecommendations into IJavaCompletionProposals which are applied on the editor content when the propoals is selected from the completion proposals menu.
| |
− | |-
| |
− | | CompletionTargetVariableBuilder
| |
− | | Extracts the CompletionTargetVariable from an IIntelligentCompletionContext.
| |
− | |-
| |
− | | PatternRecommender
| |
− | | Description coming soon.
| |
− | |-
| |
− | | TemplatesCompletionModule
| |
− | | Description coming soon.
| |
− | |-
| |
− | | TemplatesCompletionProposalComputer
| |
− | | Description coming soon.
| |
− | |-
| |
− | | TemplatesPlugin
| |
− | | Description coming soon.
| |
− | |-
| |
− | ! style="background: #efefef;" | .templates.code
| |
− | ! style="background: #efefef;" | Description coming soon.
| |
− | |-
| |
− | | CodeBuilder
| |
− | | Description coming soon.
| |
− | |-
| |
− | | MethodCallFormatter
| |
− | | Description coming soon.
| |
− | |-
| |
− | | MethodFormatter
| |
− | | Description coming soon.
| |
− | |-
| |
− | ! style="background: #efefef;" | .templates.types
| |
− | ! style="background: #efefef;" | Description coming soon.
| |
− | |-
| |
− | | CompletionTargetVariable
| |
− | | Description coming soon.
| |
− | |-
| |
− | | JavaTemplateProposal
| |
− | | Description coming soon.
| |
− | |-
| |
− | | MethodCall
| |
− | | Description coming soon.
| |
− | |-
| |
− | | PatternRecommendation
| |
− | | Description coming soon.
| |
− | |}
| |
− |
| |
− | === General Workflow ===
| |
− |
| |
− | In this subsection we will illustrate how the components interact when responding to a completion request.
| |
− |
| |
− | == Important Concepts ==
| |
− |
| |
− | This section will consider how the most important components work in detail.
| |
− |
| |
− | === Target Variables ===
| |
− |
| |
− | This subsection will explain what information we need for template proposals in how it is encapsulated.
| |
− |
| |
− | === Pattern Recommender ===
| |
− |
| |
− | Here we will explain how the pattern recommender communicates which other plugins of the code recommenders system to obtain relevant patterns.
| |
− |
| |
− | === Code Builder ===
| |
− |
| |
− | This subsection will shortly illustrate how Eclipse templates work and how we generate them from our mined patterns.
| |