Package org.locationtech.udig.printing.ui

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


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

    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

   
    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

        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

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

                    }
                }
                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

Related Classes of org.locationtech.udig.printing.ui.TemplateFactory

Copyright © 2018 www.massapicom. 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.