@Override public boolean isAutoInsertable() { if (isSelectionTemplate()) return false; return fTemplate.isAutoInsertable(); }
@Override public boolean isAutoInsertable() { if (isSelectionTemplate()) return false; return fTemplate.isAutoInsertable(); }
public boolean isAutoInsertable() { if (isSelectionTemplate()) return false; return fTemplate.isAutoInsertable(); }
public boolean isAutoInsertable() { return getTemplate().isAutoInsertable(); }
/** * Creates a copy of a template. * * @param template the template to copy */ public Template(Template template) { this(template.getName(), template.getDescription(), template.getContextTypeId(), template.getPattern(), template.isAutoInsertable()); }
/** * Creates a copy of a template. * * @param template the template to copy */ public Template(Template template) { this(template.getName(), template.getDescription(), template.getContextTypeId(), template.getPattern(), template.isAutoInsertable()); }
autoInsertable.setValue(template.isAutoInsertable() ? Boolean.toString(true) : Boolean.toString(false)); attributes.setNamedItem(autoInsertable);
autoInsertable.setValue(template.isAutoInsertable() ? Boolean.toString(true) : Boolean .toString(false)); attributes.setNamedItem(autoInsertable);
autoInsertable.setValue(template.isAutoInsertable() ? Boolean.toString(true) : Boolean.toString(false)); attributes.setNamedItem(autoInsertable);
fAutoInsertCheckbox.setSelection(fOriginalTemplate.isAutoInsertable());
fAutoInsertCheckbox.setSelection(fTemplate.isAutoInsertable());
fAutoInsertCheckbox.setSelection(fTemplate.isAutoInsertable());
fAutoInsertCheckbox.setSelection(fOriginalTemplate.isAutoInsertable());
public String getColumnText(Object element, int columnIndex) { TemplatePersistenceData data = (TemplatePersistenceData) element; Template template= data.getTemplate(); switch (columnIndex) { case 0: return template.getName(); case 1: TemplateContextType type= fContextTypeRegistry.getContextType(template.getContextTypeId()); if (type != null) return type.getName(); return template.getContextTypeId(); case 2: return template.getDescription(); case 3: return template.isAutoInsertable() ? TextEditorTemplateMessages.TemplatePreferencePage_on : ""; //$NON-NLS-1$ default: return ""; //$NON-NLS-1$ } } }
@Override public String getColumnText(Object element, int columnIndex) { TemplatePersistenceData data = (TemplatePersistenceData) element; Template template= data.getTemplate(); switch (columnIndex) { case 0: return template.getName(); case 1: TemplateContextType type= fContextTypeRegistry.getContextType(template.getContextTypeId()); if (type != null) return type.getName(); return template.getContextTypeId(); case 2: return template.getDescription(); case 3: return template.isAutoInsertable() ? TemplatesMessages.TemplatePreferencePage_on : ""; //$NON-NLS-1$ default: return ""; //$NON-NLS-1$ } } }
@Override public String getColumnText(Object element, int columnIndex) { TemplatePersistenceData data = (TemplatePersistenceData) element; Template template= data.getTemplate(); switch (columnIndex) { case 0: return template.getName(); case 1: TemplateContextType type= fContextTypeRegistry.getContextType(template.getContextTypeId()); if (type != null) return type.getName(); return template.getContextTypeId(); case 2: return template.getDescription(); case 3: return template.isAutoInsertable() ? TemplatesMessages.TemplatePreferencePage_on : ""; //$NON-NLS-1$ default: return ""; //$NON-NLS-1$ } } }
/** * Moves the selected template from one context to another. * * @param templates an array of template data * @param contextId the contextId * */ private void moveTemplates(TemplatePersistenceData[] templates, String contextId) { for (int i= 0; i < templates.length; i++) { Template t= templates[i].getTemplate(); templates[i].setTemplate(new Template(t.getName(), t.getDescription(), contextId, t .getPattern(), t.isAutoInsertable())); } saveTemplateStore(); fTreeViewer.setSelection(new StructuredSelection(templates), true); }
/** * Moves the selected template from one context to another. * * @param templates an array of template data * @param contextId the contextId * */ private void moveTemplates(TemplatePersistenceData[] templates, String contextId) { for (int i= 0; i < templates.length; i++) { Template t= templates[i].getTemplate(); templates[i].setTemplate(new Template(t.getName(), t.getDescription(), contextId, t .getPattern(), t.isAutoInsertable())); } saveTemplateStore(); fTreeViewer.setSelection(new StructuredSelection(templates), true); }
/** * Copy the selected templates to another context * * @param templates an array of template data * @param contextId the context id * */ private void copyTemplates(TemplatePersistenceData[] templates, String contextId) { TemplatePersistenceData[] newTemplates= new TemplatePersistenceData[templates.length]; for (int i= 0; i < templates.length; i++) { Template t= templates[i].getTemplate(); newTemplates[i]= new TemplatePersistenceData(new Template(t.getName(), t .getDescription(), contextId, t.getPattern(), t.isAutoInsertable()), true); getTemplateStore().add(newTemplates[i]); } saveTemplateStore(); refresh(); fTreeViewer.setSelection(new StructuredSelection(newTemplates), true); }
/** * Copy the selected templates to another context * * @param templates an array of template data * @param contextId the context id * */ private void copyTemplates(TemplatePersistenceData[] templates, String contextId) { TemplatePersistenceData[] newTemplates= new TemplatePersistenceData[templates.length]; for (int i= 0; i < templates.length; i++) { Template t= templates[i].getTemplate(); newTemplates[i]= new TemplatePersistenceData(new Template(t.getName(), t .getDescription(), contextId, t.getPattern(), t.isAutoInsertable()), true); getTemplateStore().add(newTemplates[i]); } saveTemplateStore(); refresh(); fTreeViewer.setSelection(new StructuredSelection(newTemplates), true); }