Search in sources :

Example 6 with ITemplateGroup

use of com.archimatetool.templates.model.ITemplateGroup in project archi by archimatetool.

the class CanvasTemplateManager method loadInbuiltTemplates.

@Override
protected ITemplateGroup loadInbuiltTemplates() {
    ITemplateGroup group = new TemplateGroup(Messages.CanvasTemplateManager_0);
    File folder = CanvasEditorPlugin.INSTANCE.getTemplatesFolder();
    if (folder.exists()) {
        for (File file : folder.listFiles()) {
            if (file.getName().toLowerCase().endsWith(CANVAS_TEMPLATE_FILE_EXTENSION)) {
                ITemplate template = new CanvasModelTemplate();
                template.setFile(file);
                group.addTemplate(template);
            }
        }
    }
    return group;
}
Also used : ITemplateGroup(com.archimatetool.templates.model.ITemplateGroup) TemplateGroup(com.archimatetool.templates.model.TemplateGroup) ITemplateGroup(com.archimatetool.templates.model.ITemplateGroup) ITemplate(com.archimatetool.templates.model.ITemplate) File(java.io.File)

Aggregations

ITemplateGroup (com.archimatetool.templates.model.ITemplateGroup)6 TemplateGroup (com.archimatetool.templates.model.TemplateGroup)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 ITemplate (com.archimatetool.templates.model.ITemplate)3 File (java.io.File)2 IInputValidator (org.eclipse.jface.dialogs.IInputValidator)2 InputDialog (org.eclipse.jface.dialogs.InputDialog)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 TableColumnLayout (org.eclipse.jface.layout.TableColumnLayout)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1