Java 类org.eclipse.jface.text.templates.persistence.TemplateStore 实例源码

项目:KaiZen-OpenAPI-Editor    文件:JsonSourceViewerConfiguration.java   
protected JsonContentAssistProcessor createContentAssistProcessor(ContentAssistant ca) {
    return new JsonContentAssistProcessor(ca, null){

@Override
protected TemplateStore getTemplateStore() {
    return null;
}

@Override
protected ContextTypeRegistry getContextTypeRegistry() {
    return null;
}

@Override
protected String getContextTypeId(Model model, String path) {
    return null;
}};
 }
项目:Eclipse-Postfix-Code-Completion    文件:CompatibilityTemplateStore.java   
/**
 * Removes any duplicates from a template store. Duplicate user added templates
 * are copied over their contributed siblings. If isCodeTemplates is true,
 * any user added templates are then removed.
 *
 * @param store
 * @param isCodeTemplates
 */
public static void pruneDuplicates(TemplateStore store, boolean isCodeTemplates) {
    TemplatePersistenceData[] datas= store.getTemplateData(true);
    for (int i= datas.length - 1; i >= 0; i--) {
        TemplatePersistenceData data= datas[i];
        if (data.isUserAdded()) {
            // find a contributed template that is similar and check it
            TemplatePersistenceData similar= findSimilarTemplate(datas, data.getTemplate(), isCodeTemplates);
            if (similar != data && !similar.isUserAdded()) {
                similar.setTemplate(data.getTemplate());
                store.delete(data);
            }
        }
    }

    if (isCodeTemplates) {
        datas= store.getTemplateData(true);
        for (int i= datas.length - 1; i >= 0; i--) {
            if (datas[i].isUserAdded())
                store.delete(datas[i]);
        }
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompatibilityTemplateStore.java   
/**
 * Removes any duplicates from a template store. Duplicate user added templates
 * are copied over their contributed siblings. If isCodeTemplates is true,
 * any user added templates are then removed.
 *
 * @param store
 * @param isCodeTemplates
 */
public static void pruneDuplicates(TemplateStore store, boolean isCodeTemplates) {
    TemplatePersistenceData[] datas= store.getTemplateData(true);
    for (int i= datas.length - 1; i >= 0; i--) {
        TemplatePersistenceData data= datas[i];
        if (data.isUserAdded()) {
            // find a contributed template that is similar and check it
            TemplatePersistenceData similar= findSimilarTemplate(datas, data.getTemplate(), isCodeTemplates);
            if (similar != data && !similar.isUserAdded()) {
                similar.setTemplate(data.getTemplate());
                store.delete(data);
            }
        }
    }

    if (isCodeTemplates) {
        datas= store.getTemplateData(true);
        for (int i= datas.length - 1; i >= 0; i--) {
            if (datas[i].isUserAdded())
                store.delete(datas[i]);
        }
    }
}
项目:eclipsensis    文件:EclipseNSISPlugin.java   
/**
 * Returns this plug-in's template store.
 *
 * @return the template store of this plug-in instance
 */
public TemplateStore getTemplateStore()
{
    if (mTemplateStore == null) {
        mTemplateStore= new ContributionTemplateStore(getContextTypeRegistry(),
                        NSISPreferences.getInstance().getPreferenceStore(),
                        INSISEditorPreferenceConstants.CUSTOM_TEMPLATES);
        try {
            mTemplateStore.load();
        }
        catch (IOException e) {
            log(e);
        }
    }
    return mTemplateStore;
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Generate the _config.php file
    Template configTemplateToCompile;
    if(isFrameworkLayout) {
        configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.framework.config");
    }else {
        configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.config");
    }

    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:fluentmark    文件:FluentMkTemplateCompletionProcessor.java   
@SuppressWarnings("deprecation")
@Override
protected Template[] getTemplates(String contextTypeId) {
    if (contextType.getId().equals(contextTypeId)) {
        Template[] computedTemplates = null;
        if (templates != null) {
            computedTemplates = templates.getTemplate().toArray(new Template[templates.getTemplate().size()]);
        }
        TemplateStore templateStore = CustomTemplateAccess.getInstance().getTemplateStore();
        if (templateStore != null) {
            Template[] customTemplates = templateStore.getTemplates(contextTypeId);
            if (customTemplates != null && customTemplates.length > 0) {
                if (computedTemplates == null) {
                    computedTemplates = customTemplates;
                } else {
                    List<Template> allTempaltes = new ArrayList<Template>(
                            computedTemplates.length + customTemplates.length);
                    allTempaltes.addAll(Arrays.asList(computedTemplates));
                    allTempaltes.addAll(Arrays.asList(customTemplates));
                    computedTemplates = allTempaltes.toArray(new Template[allTempaltes.size()]);
                }
            }
        }
        if (computedTemplates != null) {
            for (Template template : computedTemplates) {
                String pattern = template.getPattern();
                pattern = pattern.replace("\r\n", "\n");
                pattern = pattern.replace("\n", Strings.EOL);
                template.setPattern(pattern);                   
            }
            return computedTemplates;
        }
    }
    return NO_TEMPLATES;
}
项目:KaiZen-OpenAPI-Editor    文件:KaizenTemplatePreferences.java   
public KaizenTemplatePreferences(SourceViewerConfiguration sourceViewerConfiguration,
        IPreferenceStore preferenceStore, TemplateStore templateStore, ContextTypeRegistry contextTypeRegistry) {
    this.sourceViewerConfiguration = sourceViewerConfiguration;
    setPreferenceStore(preferenceStore);
    setTemplateStore(templateStore);
    setContextTypeRegistry(contextTypeRegistry);
}
项目:Eclipse-Postfix-Code-Completion    文件:StubUtility.java   
/**
 * Only to be used by tests
 * 
 * @param templateId the template id
 * @param pattern the new pattern
 * @param project not used
 */
public static void setCodeTemplate(String templateId, String pattern, IJavaProject project) {
    TemplateStore codeTemplateStore= JavaPlugin.getDefault().getCodeTemplateStore();
    TemplatePersistenceData data= codeTemplateStore.getTemplateData(templateId);
    Template orig= data.getTemplate();
    Template copy= new Template(orig.getName(), orig.getDescription(), orig.getContextTypeId(), pattern, true);
    data.setTemplate(copy);
}
项目:Eclipse-Postfix-Code-Completion    文件:NewElementWizard.java   
protected void warnAboutTypeCommentDeprecation() {
    String key= IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED;
    if (OptionalMessageDialog.isDialogEnabled(key)) {
        TemplateStore templates= JavaPlugin.getDefault().getTemplateStore();
        boolean isOldWorkspace= templates.findTemplate("filecomment") != null && templates.findTemplate("typecomment") != null; //$NON-NLS-1$ //$NON-NLS-2$
        if (!isOldWorkspace) {
            OptionalMessageDialog.setDialogEnabled(key, false);
        }
        String title= NewWizardMessages.NewElementWizard_typecomment_deprecated_title;
        String message= NewWizardMessages.NewElementWizard_typecomment_deprecated_message;
        OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);
    }
}
项目:idecore    文件:ApexClassTemplateSelectionPage.java   
public ApexClassTemplateSelectionPage(final ComponentModel componentModel, final TemplateStore templateStore) {
    super(
        componentModel,
        ApexClassTemplateContextType.ID,
        templateStore,
        ApexClassTemplateSelectionPage.class.getSimpleName(),
        NewWizardMessages.ClassTemplate_desc
    );
}
项目:idecore    文件:ApexTriggerTemplateSelectionPage.java   
public ApexTriggerTemplateSelectionPage(final ComponentModel componentModel, final TemplateStore templateStore) {
    super(
        componentModel,
        ApexTriggerTemplateContextType.ID,
        templateStore,
        ApexTriggerTemplateSelectionPage.class.getSimpleName(),
        NewWizardMessages.TriggerTemplate_desc
    );
}
项目:idecore    文件:ApexComponentTemplateSelectionPage.java   
public ApexComponentTemplateSelectionPage(final TemplateStore templateStore) {
    super(
        ApexComponentTemplateContextType.ID,
        templateStore,
        ApexComponentTemplateSelectionPage.class.getSimpleName(),
        NewWizardMessages.ComponentTemplate_desc
    );
}
项目:idecore    文件:ApexPageTemplateSelectionPage.java   
public ApexPageTemplateSelectionPage(final TemplateStore templateStore) {
    super(
        ApexPageTemplateContextType.ID,
        templateStore,
        ApexPageTemplateSelectionPage.class.getSimpleName(),
        NewWizardMessages.PageTemplate_desc
    );
}
项目:idecore    文件:AbstractTemplateSelectionPage.java   
/**
 * Creates a new wizard page with the given name, title, and image.
 *
 * @param contextTypeId where the templates are registered in the template store
 * @param templateStore the source of the templates
 * @param pageName the name of the page
 * @param description the description text for this dialog page, or <code>null</code> if none
 */
protected AbstractTemplateSelectionPage(
    final String contextTypeId,
    final TemplateStore templateStore,
    final String pageName,
    final String description
) {
    super(pageName, NewWizardMessages.WizardPage_0, null);
    setDescription(description);
    this.contextTypeId = contextTypeId;
    this.templateStore = templateStore;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:StubUtility.java   
/**
 * Only to be used by tests
 * 
 * @param templateId the template id
 * @param pattern the new pattern
 * @param project not used
 */
public static void setCodeTemplate(String templateId, String pattern, IJavaProject project) {
    TemplateStore codeTemplateStore= JavaPlugin.getDefault().getCodeTemplateStore();
    TemplatePersistenceData data= codeTemplateStore.getTemplateData(templateId);
    Template orig= data.getTemplate();
    Template copy= new Template(orig.getName(), orig.getDescription(), orig.getContextTypeId(), pattern, true);
    data.setTemplate(copy);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NewElementWizard.java   
protected void warnAboutTypeCommentDeprecation() {
    String key= IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED;
    if (OptionalMessageDialog.isDialogEnabled(key)) {
        TemplateStore templates= JavaPlugin.getDefault().getTemplateStore();
        boolean isOldWorkspace= templates.findTemplate("filecomment") != null && templates.findTemplate("typecomment") != null; //$NON-NLS-1$ //$NON-NLS-2$
        if (!isOldWorkspace) {
            OptionalMessageDialog.setDialogEnabled(key, false);
        }
        String title= NewWizardMessages.NewElementWizard_typecomment_deprecated_title;
        String message= NewWizardMessages.NewElementWizard_typecomment_deprecated_message;
        OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);
    }
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.defaultpage");
    PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
  //Generate the Page.php file
    Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.defaultpage");
    PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss23.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:eclipse-silverstripedt    文件:SilverStripePDTPlugin.java   
/**
 * Returns the template store for the xml editor templates.
 * 
 * @return the template store for the xml editor templates
 */
public TemplateStore getTemplateStore() {
    if (templateStore == null) {
        templateStore = new SilverStripeTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "ca.edchipman.silverstripepdt.SilverStripe.templates");

        try {
            templateStore.load();
        } catch (IOException e) {
            Logger.logException(e);
        }
    }
    return templateStore;
}
项目:eclipse-silverstripedt    文件:SilverStripePDTPlugin.java   
/**
 * Returns the template store for the xml editor templates.
 * 
 * @return the template store for the xml editor templates
 */
public TemplateStore getCATemplateStore() {
    if (caTemplateStore == null) {
        caTemplateStore = new SilverStripeTemplateStore(getCATemplateContextRegistry(), getPreferenceStore(), "ca.edchipman.silverstripepdt.contentassist.templates");

        try {
            caTemplateStore.load();
        } catch (IOException e) {
            Logger.logException(e);
        }
    }
    return caTemplateStore;
}
项目:eclipse-silverstripedt    文件:SSTemplateCompletionProcessor.java   
protected Template[] getTemplates(String contextTypeId) {
    Template templates[] = null;

    TemplateStore store = getTemplateStore();
    if (store != null)
        templates = store.getTemplates(contextTypeId);

    return templates;
}
项目:eclipse-silverstripedt    文件:NewSilverStripeClassWizardTemplatePage.java   
public TemplateStore getSSTemplateStore() {
TemplateStore templateStore = new SilverStripeTemplateStore(getTemplatesContextTypeRegistry(), getPreferenceStore(), "ca.edchipman.silverstripepdt.SilverStripe.classtemplates");

      try {
          templateStore.load();
      } catch (IOException e) {
          Logger.logException(e);
      }

      return templateStore;
  }
项目:eclipse-silverstripedt    文件:NewSilverStripeProjectCreator.java   
/**
 * Performs the SilverStripe version specific tasks when creating new project layout project
 * @param project Destination project
 * @param monitor Monitor to update when creating the layout
 * @param templateRegistry Template registry to look through
 * @param isFrameworkLayout If the project is a framework only project this is set to true
 * @throws CoreException 
 */
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
    //Generate the Page.php file
    if(isFrameworkLayout==false) {
        Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.defaultpage");
        PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
        new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
    }


    //Create the config folder
    IPath ymlConfigPath = new Path("_config");
    if (ymlConfigPath.segmentCount() > 0) {
        IFolder folder=project.getFolder(ymlConfigPath);
        CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 10));
    } else {
        monitor.worked(10);
    }


    //Create config.yml
    Template ymlConfigTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.ymlconfig");
    PHPTemplateStore.CompiledTemplate ymlConfigTemplate=PHPTemplateStore.compileTemplate(templateRegistry, ymlConfigTemplateToCompile, project.getName()+"/_config", "config.yml");
    new SilverStripeFileCreator().createFile(wizard, project.getName()+"/_config", "config.yml", monitor, ymlConfigTemplate.string, ymlConfigTemplate.offset, true);


    //Generate the _config.php file
    Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss31.config");
    PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
    new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
项目:dsl-devkit    文件:CheckTemplateProposalProvider.java   
@Inject
public CheckTemplateProposalProvider(final TemplateStore templateStore, final ContextTypeRegistry registry, final ContextTypeIdHelper helper) {
  super(templateStore, registry, helper);
}
项目:dsl-devkit    文件:CheckCfgTemplateProposalProvider.java   
@Inject
public CheckCfgTemplateProposalProvider(final TemplateStore templateStore, final ContextTypeRegistry registry, final ContextTypeIdHelper helper) {
  super(templateStore, registry, helper);
  this.templateStore = templateStore;
}
项目:bts    文件:TemplateContentProvider.java   
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
    fStore= (TemplateStore) newInput;
}
项目:bts    文件:DefaultUiModule.java   
public Class<? extends TemplateStore> bindTemplateStore() {
    return XtextTemplateStore.class;
}
项目:bts    文件:DefaultTemplateProposalProvider.java   
@Inject
public DefaultTemplateProposalProvider(TemplateStore templateStore, ContextTypeRegistry registry, ContextTypeIdHelper helper) {
    this.templateStore = templateStore;
    this.registry = registry;
    this.helper = helper;
}
项目:bts    文件:XtextTemplatePreferencePage.java   
public TemplateStore getTemplateStoreInternal() {
    return templateStoreInternal;
}
项目:bts    文件:XtextTemplatePreferencePage.java   
public void setTemplateStoreInternal(TemplateStore templateStoreInternal) {
    this.templateStoreInternal = templateStoreInternal;
    setTemplateStore(templateStoreInternal);
}
项目:bts    文件:XtextTemplatePreferencePage.java   
@Inject
public XtextTemplatePreferencePage(IPreferenceStore preferenceStore, ContextTypeRegistry registry, TemplateStore templateStore) {
    setPreferenceStore(preferenceStore);
    setContextTypeRegistry(registry);
    setTemplateStore(templateStore);
}
项目:statecharts    文件:SGenTemplateProposalProvider.java   
@Inject
public SGenTemplateProposalProvider(TemplateStore templateStore, ContextTypeRegistry registry,
        ContextTypeIdHelper helper) {
    super(templateStore, registry, helper);
    this.helper = helper;
}
项目:KaiZen-OpenAPI-Editor    文件:SwaggerContentAssistProcessor.java   
@Override
protected TemplateStore getTemplateStore() {
    return Activator.getDefault().getTemplateStore();
}
项目:KaiZen-OpenAPI-Editor    文件:OpenApi3ContentAssistProcessor.java   
@Override
protected TemplateStore getTemplateStore() {
       return Activator.getDefault().getTemplateStore();
}
项目:brainfuck    文件:BfActivator.java   
public TemplateStore getTemplateStore() {
    return this.templateStore;
}