@Override protected String resolve(TemplateContext context) { String selection= context.getVariable(SELECTION); if (selection == null) return ""; //$NON-NLS-1$ return selection; }
@Override protected String resolve(TemplateContext context) { String selection= context.getVariable(SELECTION); if (selection == null) return ""; //$NON-NLS-1$ return selection; }
@Override protected String resolve(TemplateContext context) { return context.getVariable(getType()); } }
/** * Returns an instance of the type resolved by the receiver available in <code>context</code>. * To resolve means to provide a binding to a concrete text object (a * <code>String</code>) in the given context. * <p> * The default implementation looks up the type in the context.</p> * * @param context the context in which to resolve the type * @return the name of the text object of this type, or <code>null</code> if it cannot be determined */ protected String resolve(TemplateContext context) { return context.getVariable(getType()); }
@Override protected String resolve(TemplateContext context) { return context.getVariable(getType()); } }
protected String resolve(TemplateContext context) { return context.getVariable(getType()); } }
/** * Returns an instance of the type resolved by the receiver available in <code>context</code>. * To resolve means to provide a binding to a concrete text object (a * <code>String</code>) in the given context. * <p> * The default implementation looks up the type in the context.</p> * * @param context the context in which to resolve the type * @return the name of the text object of this type, or <code>null</code> if it cannot be determined */ protected String resolve(TemplateContext context) { return context.getVariable(getType()); }
private boolean isSelectionBasedMatch(Template template, TemplateContext context) { String pattern = template.getPattern(); Set<String> vars = new HashSet<String>(); Matcher matcher = VARIABLE_PATTERN.matcher(pattern); while (matcher.find()) { String variableName = matcher.group(1); if (vars.add(variableName)) { String variable = context.getVariable(variableName); if (variable != null && variable.length() > 0) { return true; } } } return false; }
private void resolveWithParams(TemplateVariable variable, TemplateContext context, List<String> params) { String selection= context.getVariable(SELECTION); if (selection != null && !selection.isEmpty()) { variable.setValue(selection); } else { String defaultValue= params.get(0); variable.setValue(defaultValue); } variable.setUnambiguous(true); variable.setResolved(true); } }
private void resolveWithParams(TemplateVariable variable, TemplateContext context, List<String> params) { String selection= context.getVariable(SELECTION); if (selection != null && !selection.isEmpty()) { variable.setValue(selection); } else { String defaultValue= params.get(0); variable.setValue(defaultValue); } variable.setUnambiguous(true); variable.setResolved(true); } }