use of org.eclipse.jface.text.templates.TemplateVariableResolver in project che by eclipse.
the class JavaPlugin method registerJavaContext.
/**
* Registers the given Java template context.
*
* @param registry the template context type registry
* @param id the context type id
* @param parent the parent context type
* @since 3.4
*/
private static void registerJavaContext(ContributionContextTypeRegistry registry, String id, TemplateContextType parent) {
TemplateContextType contextType = registry.getContextType(id);
Iterator<TemplateVariableResolver> iter = parent.resolvers();
while (iter.hasNext()) contextType.addResolver(iter.next());
}
use of org.eclipse.jface.text.templates.TemplateVariableResolver in project webtools.sourceediting by eclipse.
the class TestTemplateContextTypeXSL method testDateVariableAvailable.
@Test
public void testDateVariableAvailable() throws Exception {
TemplateContextTypeXSL contextType = new TemplateContextTypeXSL();
Iterator<TemplateVariableResolver> variables = contextType.resolvers();
while (variables.hasNext()) {
TemplateVariableResolver resolver = variables.next();
if (resolver.getType().equals("date")) {
return;
}
}
fail("Date variable resolver was not found.");
}
use of org.eclipse.jface.text.templates.TemplateVariableResolver in project webtools.sourceediting by eclipse.
the class TestTemplateContextTypeXSL method testWordSelectionVariableAvailable.
@Test
public void testWordSelectionVariableAvailable() throws Exception {
TemplateContextTypeXSL contextType = new TemplateContextTypeXSL();
Iterator<TemplateVariableResolver> variables = contextType.resolvers();
while (variables.hasNext()) {
TemplateVariableResolver resolver = variables.next();
if (resolver.getType().equals("word_selection")) {
return;
}
}
fail("Word Selection variable resolver was not found.");
}
use of org.eclipse.jface.text.templates.TemplateVariableResolver in project webtools.sourceediting by eclipse.
the class TestTemplateContextTypeXSL method testLineSelectionVariableAvailable.
@Test
public void testLineSelectionVariableAvailable() throws Exception {
TemplateContextTypeXSL contextType = new TemplateContextTypeXSL();
Iterator<TemplateVariableResolver> variables = contextType.resolvers();
while (variables.hasNext()) {
TemplateVariableResolver resolver = variables.next();
if (resolver.getType().equals("line_selection")) {
return;
}
}
fail("Line Selection variable resolver was not found.");
}
use of org.eclipse.jface.text.templates.TemplateVariableResolver in project webtools.sourceediting by eclipse.
the class TestTemplateContextTypeXSL method testCursorVariableAvailable.
@Test
public void testCursorVariableAvailable() throws Exception {
TemplateContextTypeXSL contextType = new TemplateContextTypeXSL();
Iterator<TemplateVariableResolver> variables = contextType.resolvers();
while (variables.hasNext()) {
TemplateVariableResolver resolver = variables.next();
if (resolver.getType().equals("cursor")) {
return;
}
}
fail("Cursor variable resolver was not found.");
}
Aggregations