Examples of TemplateFactory


Examples of org.expressme.webwind.template.TemplateFactory

        catch (Exception e) { }
        return null;
    }

    public static TemplateFactory createTemplateFactory(String name) {
        TemplateFactory tf = tryInitTemplateFactory(name);
        if (tf==null)
            tf = tryInitTemplateFactory(TemplateFactory.class.getPackage().getName() + "." + name + TemplateFactory.class.getSimpleName());
        if (tf==null) {
            log.warn("Cannot init template factory '" + name + "'.");
            throw new ConfigException("Cannot init template factory '" + name + "'.");
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

    private void updateUIBasedOnTemplate() {
        Object[] allChecked = listViewer.getCheckedElements();
        if (allChecked.length == 0) {
            return;
        }
        TemplateFactory selectedFactory = (TemplateFactory)allChecked[0];
        Template selectedTemplate = selectedFactory.createTemplate();
        int orientation = selectedTemplate.getPreferredOrientation();
        if (orientation == Template.ORIENTATION_LANDSCAPE) {
            landscapeButton.setSelection(true);
            portraitButton.setSelection(false);
        }
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

     *
     * @return a template
     */
    private Template getTemplate() {
          
        TemplateFactory templateFactory = page1.getTemplateFactory();
        Template template = templateFactory.createTemplate();
               
        return template;
    }
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

    private void updateUIBasedOnTemplate() {
        Object[] allChecked = listViewer.getCheckedElements();
        if (allChecked.length == 0) {
            return;
        }
        TemplateFactory selectedFactory = (TemplateFactory)allChecked[0];
        Template selectedTemplate = selectedFactory.createTemplate();
        int orientation = selectedTemplate.getPreferredOrientation();
    }
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

   
    Iterator iter = templates.entrySet().iterator();
    for(int i = 0; iter.hasNext(); i++) {
        Map.Entry entry = (Map.Entry) iter.next();
       
        TemplateFactory templateFactory = (TemplateFactory) entry.getValue();
       
        templateIds.add(i, entry.getKey());
       
        if (defaultTemplate.equals(templateFactory.getName())) {
            list.select(i);
        }
       
        list.add(templateFactory.getName());
    }
       
    return composite;
    }
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

        String defaultTemplate = PrintingPlugin.getDefault().getPluginPreferences().getString(
                PrintingPlugin.PREF_DEFAULT_TEMPLATE);

        ListDialog dialog = createTemplateChooserDialog(templateFactories);

        TemplateFactory templateFactory = (TemplateFactory) PrintingPlugin.getDefault()
                .getTemplateFactories().get(defaultTemplate);

        dialog.setInitialSelections(new Object[]{templateFactory});
        int result = dialog.open();
        if (result == Window.CANCEL || dialog.getResult().length == 0) {
            return null;
        }

        Template template = null;

        templateFactory = ((TemplateFactory) dialog.getResult()[0]);

        if (templateFactory == null) {
            PrintingPlugin.log(Messages.CreatePageAction_error_cannotFindDefaultTemplate, null);

            TemplateFactory firstAvailable = (TemplateFactory) templateFactories.values()
                    .iterator().next();
            if (firstAvailable == null) {
                PrintingPlugin.log(
                        "Unable to locate any templates, resorting to hard coded default.", null); //$NON-NLS-1$
                template = new BasicTemplateFactory().createTemplate();
            } else {
                template = firstAvailable.createTemplate();
            }
        } else {
            template = templateFactory.createTemplate();
        }
        return template;
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

     *
     * @return a template
     */
    private Template getTemplate() {
          
        TemplateFactory templateFactory = page1.getTemplateFactory();
        Template template = templateFactory.createTemplate();
               
        return template;
    }
View Full Code Here

Examples of org.locationtech.udig.printing.ui.TemplateFactory

                    }
                }
                else if( "template".equals( element.getName() )){
                    final String id = element.getAttribute("id"); //$NON-NLS-1$
                    final IConfigurationElement remember = element;                           
                    TemplateFactory fakeFactory = new TemplateFactory(){
                        public Template createTemplate() {
                            try {
                                Object created = remember.createExecutableExtension("class"); //$NON-NLS-1$
                                if( created instanceof Template){
                                    return (Template) created;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.