Examples of TemplateStore


Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

      }
    }
  }
 
  private ArrayList<ArrayList<String>> getTemplates(String type) {
    TemplateStore storage = storeFactory(type);
    Template[] templates = storage.getTemplates();
    ArrayList<ArrayList<String>> output = new ArrayList<ArrayList<String>>();
   
    for (Template template : templates) {
      ArrayList<String> templateItem = new ArrayList<String>();
     
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

  }

  protected Template[] getTemplates(String contextTypeId) {
    Template templates[] = null;

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

    return templates;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

  }

  protected Template[] getTemplates(String contextTypeId) {
    Template templates[] = null;

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

    return templates;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

      }
      return tapestryTemplates == null ? null : tapestryTemplates.toArray(new Template[0]);
    }
    else{
      Template templates[] = null;
      TemplateStore store = getTemplateStore();
      if (store != null) {
        templates = store.getTemplates(contextTypeId);
      }

      return templates;
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

    String payload = gson.toJson(userData);
    ctx.execJSFunction("javaLoadUserData", payload);
  }
 
  private ArrayList<ArrayList<String>> getTemplates(String type) {
    TemplateStore storage = storeFactory(type);
    Template[] templates = storage.getTemplates();
    ArrayList<ArrayList<String>> output = new ArrayList<ArrayList<String>>();
   
    for (Template template : templates) {
      ArrayList<String> templateItem = new ArrayList<String>();
     
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

        //just create an empty to complete the line (that needs 3 items in the layout)
        Label label = new Label(topLevel, SWT.NONE);
        label.setText("");

        if (shouldCreateTemplates()) {
            final TemplateStore templateStore = TemplateHelper.getTemplateStore();
            if (templateStore != null) {
                TemplatePersistenceData[] templateData = templateStore.getTemplateData(false);
                if (templateData != null && templateData.length > 0) {
                    //create the template selection
                    label = new Label(topLevel, SWT.NONE);
                    label.setText("Template");

                    templateList = new List(topLevel, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
                    fillTemplateOptions(templateData, templateList);

                    //if in the text, pressing down should go to the templates list
                    textName.addKeyListener(new KeyListener() {

                        public void keyPressed(KeyEvent e) {
                        }

                        public void keyReleased(KeyEvent e) {
                            if (e.keyCode == SWT.ARROW_DOWN) {
                                templateList.setFocus();
                                e.doit = false;
                            }
                        }
                    });

                    textName.addTraverseListener(new TraverseListener() {

                        public void keyTraversed(TraverseEvent e) {
                            if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
                                templateList.setFocus();
                                e.doit = false;
                            }
                        }
                    });

                    Link link = new Link(topLevel, SWT.NONE);
                    link.setText("<a>Config...</a>");

                    link.addSelectionListener(new SelectionListener() {
                        public void widgetSelected(SelectionEvent e) {
                            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null,
                                    "org.python.pydev.prefs.template", null, null);
                            dialog.open();
                            //Fill it after having the settings edited.
                            TemplatePersistenceData[] templateData = templateStore.getTemplateData(false);
                            if (templateData != null && templateData.length > 0) {
                                fillTemplateOptions(templateData, templateList);
                            } else {
                                fillTemplateOptions(new TemplatePersistenceData[0], templateList);
                            }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

      String templateName = PHPUiPlugin.getDefault().getPreferenceStore()
          .getString(PreferenceConstants.NEW_PHP_FILE_TEMPLATE);
      if (templateName == null || templateName.length() == 0) {
        return true;
      }
      TemplateStore templateStore = PHPUiPlugin.getDefault()
          .getCodeTemplateStore();
      Template template = templateStore.findTemplate(templateName);
      if (template == null) {
        return true;
      }
      // compile the template and insert the text into the new document
      CompiledTemplate compiledTemplate = PHPTemplateStore
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

    }
  }

  protected Template[] getTemplates(String contextTypeId) {
    Template templates[] = null;
    TemplateStore store = getTemplateStore();
    if (store != null)
      templates = store.getTemplates(contextTypeId);

    return templates;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

    }
  }

  protected Template[] getTemplates(String contextTypeId) {
    Template templates[] = null;
    TemplateStore store = getTemplateStore();
    if (store != null)
      templates = store.getTemplates(contextTypeId);

    return templates;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.persistence.TemplateStore

    if (project == null) {
      fProjectStore = null;
    } else {
      final ScopedPreferenceStore projectSettings = new ScopedPreferenceStore(
          new ProjectScope(project), PHPUiPlugin.ID);
      fProjectStore = new TemplateStore(projectSettings, KEY) {
        /*
         * Make sure we keep the id of added code templates - add
         * removes it in the usual add() method
         */
        public void add(TemplatePersistenceData data) {
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.