Package org.springframework.ide.eclipse.wizard.template.infrastructure

Examples of org.springframework.ide.eclipse.wizard.template.infrastructure.Template


        return null;
      }

      public Image getImage(Object element) {
        if (element instanceof Template) {
          Template template = (Template) element;
          Image templateImage = WizardImages.getImage(WizardImages.TEMPLATE_ICON);

          // Simple Project templates are bundled in the plugin,
          // therefore do not require download icon, since they are
          // not downloaded
          if (template instanceof SimpleProject
              || ((template.getItem().isLocal() || TemplateUtils.hasBeenDownloaded(template)) && !template
                  .getItem().isNewerVersionAvailable())) {
            return templateImage;
          }

          return WizardImages.getImage(new DecorationOverlayIcon(templateImage, new ImageDescriptor[] {
View Full Code Here


    notifyStatusChange(validateArea());
  }

  @Override
  protected IStatus validateArea() {
    Template template = model.selectedTemplate.getValue();
    IStatus status = Status.OK_STATUS;
    if (template != null) {

      String warning = getWarning(template);
View Full Code Here

    for (ContentItem item : sortedItems) {
      String templateId = item.getId();
      if (!templateIds.contains(templateId)) {

        Template template = new Template(item, null);

        templates.add(template);
        templateIds.add(templateId);
      }
    }

    // Add the Simple Projects
    List<SimpleProject> simpleProjects = getSimpleProjects();
    templates.addAll(simpleProjects);

    if (model.shouldShowSelfHostedProjects()) {

      IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
      for (IProject project : projects) {
        IFile templateFile = project.getFile(IContentConstants.TEMPLATE_DATA_FILE_NAME);
        IFile wizardFile = project.getFile(IContentConstants.WIZARD_DATA_FILE_NAME);
        if (templateFile.exists() && wizardFile.exists()) {
          File file = templateFile.getLocation().toFile();
          try {
            DocumentBuilder documentBuilder = ContentUtil.createDocumentBuilder();
            Document document = documentBuilder.parse(file);
            Element rootNode = document.getDocumentElement();
            if (rootNode != null) {
              NodeList children = rootNode.getChildNodes();
              for (int i = 0; i < children.getLength(); i++) {
                Node childNode = children.item(i);
                if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                  if ("descriptor".equals(childNode.getNodeName())) {
                    Descriptor descriptor = Descriptor.read(childNode);
                    ContentItem item = new ContentItem(descriptor.getId(), project);
                    item.setLocalDescriptor(descriptor);
                    descriptor.setUrl(project.getName());
                    ImageDescriptor icon = null;
                    Template template = new Template(item, icon);
                    templates.add(template);
                  }
                }
              }
            }
View Full Code Here

    }

  }

  public void refreshSelectedTemplateInViewer() {
    Template selectedTemplate = model.selectedTemplate.getValue();
    if (selectedTemplate != null && treeViewer != null && !treeViewer.getTree().isDisposed()) {
      treeViewer.refresh(selectedTemplate, true);
      treeViewer.setSelection(new StructuredSelection(selectedTemplate), true);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.wizard.template.infrastructure.Template

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.