@Override public String getDisplayString() { return fVariable.getType() + " - " + fVariable.getDescription(); //$NON-NLS-1$ }
protected String resolve(TemplateContext context) { return super.resolve(context); } }
private static TemplateVariableResolver createResolver(IConfigurationElement element) throws CoreException { try { String type= element.getAttribute(TYPE); if (type != null) { TemplateVariableResolver resolver= (TemplateVariableResolver) element.createExecutableExtension(CLASS); if (resolver.getType() != null) { throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, resolver.getClass() + "() must call super() and not set the variable's type", null)); //$NON-NLS-1$ } resolver.setType(type); if (resolver.getDescription() != null) { throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, resolver.getClass() + "() must call super() and not set the variable's description", null)); //$NON-NLS-1$ } String desc= element.getAttribute(DESCRIPTION); resolver.setDescription(desc == null ? "" : desc); //$NON-NLS-1$ return resolver; } } catch (ClassCastException e) { throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateVariableResolver.class.getName(), e)); //$NON-NLS-1$ } return null; } }
/** * Creates an instance of <code>TemplateVariableResolver</code>. * * @param type the name of the type * @param description the description for the type */ protected TemplateVariableResolver(String type, String description) { setType(type); setDescription(description); }
/** * 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 */ public void resolve(TemplateVariable variable, TemplateContext context) { String type= variable.getType(); TemplateVariableResolver resolver= fResolvers.get(type); if (resolver == null) resolver= new TemplateVariableResolver(type, ""); //$NON-NLS-1$ resolver.resolve(variable, context); }
public String getType() { return decorated.getType(); }
@Override public String getAdditionalProposalInfo() { return fResolver.getDescription(); }
@Override public String getDisplayString() { return fResolver.getType(); }
@Override public String getAdditionalProposalInfo() { return fResolver.getDescription(); }
/** * Creates an instance of <code>TemplateVariableResolver</code>. * * @param type the name of the type * @param description the description for the type */ protected TemplateVariableResolver(String type, String description) { setType(type); setDescription(description); }
/** * 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 */ public void resolve(TemplateVariable variable, TemplateContext context) { String type= variable.getType(); TemplateVariableResolver resolver= fResolvers.get(type); if (resolver == null) resolver= new TemplateVariableResolver(type, ""); //$NON-NLS-1$ resolver.resolve(variable, context); }
public String getDisplayString() { return fVariable.getType() + " - " + fVariable.getDescription(); //$NON-NLS-1$ }
public String getDisplayString() { return fResolver.getType(); }
public void resolve(TemplateVariable variable, TemplateContext context) { super.resolve(variable, context); }
public String getAdditionalProposalInfo() { return fResolver.getDescription(); }
private static TemplateVariableResolver createResolver(IConfigurationElement element) throws CoreException { try { String type= element.getAttribute(TYPE); if (type != null) { TemplateVariableResolver resolver= (TemplateVariableResolver) element.createExecutableExtension(CLASS); resolver.setType(type); String desc= element.getAttribute(DESCRIPTION); resolver.setDescription(desc == null ? "" : desc); //$NON-NLS-1$ return resolver; } } catch (ClassCastException e) { throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateVariableResolver.class.getName(), e)); //$NON-NLS-1$ } return null; } }
@Override public String getDisplayString() { return fVariable.getType() + " - " + fVariable.getDescription(); //$NON-NLS-1$ }
@Override public String getDisplayString() { return fResolver.getType(); }
/** * Returns all possible bindings available in <code>context</code>. The default * implementation simply returns an array which contains the result of * {@link #resolve(TemplateContext)}, or an empty array if that call returns * <code>null</code>. * * @param context the context in which to resolve the type * @return an array of possible bindings of this type in <code>context</code> */ protected String[] resolveAll(TemplateContext context) { String binding= resolve(context); if (binding == null) return new String[0]; return new String[] { binding }; }
public String getDescription() { return decorated.getDescription(); }