Package org.springframework.ide.eclipse.beans.ui.namespaces

Examples of org.springframework.ide.eclipse.beans.ui.namespaces.INamespaceDefinition


        Node currAttributeNode = beanAttributes.item(i);
        String currAttributeName = currAttributeNode.getNodeName();
        String uri = currAttributeNode.getNodeValue();
        if (isUnknownNamespace(currAttributeName, uri, namespaceDefinitionList)) {
          String schemaVersion = getSchemaVersionFromXml(uri);
          INamespaceDefinition namespaceDefinition = new DefaultNamespaceDefinition(attributeNameToPrefix(
              currAttributeName, uri), uri, schemaVersion, StsUiImages.XML_FILE.createImage());
          if (!"".equals(schemaVersion)) {
            this.selectedNamespaceVersionMap.put(namespaceDefinition, schemaVersion);
          }
          namespaceDefinitionList.add(namespaceDefinition);
View Full Code Here


  private Object[] getPreselectedElements() {
    Set<INamespaceDefinition> checkedElements = new HashSet<INamespaceDefinition>();
    Object[] availableNamespaces = ((IStructuredContentProvider) xsdViewer.getContentProvider()).getElements(null);

    for (Object currAvailableNamespace : availableNamespaces) {
      INamespaceDefinition currNamespaceDefinition = (INamespaceDefinition) currAvailableNamespace;
      if (existsInConfiguration(currNamespaceDefinition)) {
        checkedElements.add(currNamespaceDefinition);
        String existingVersion = getSchemaVersionFromXml(currNamespaceDefinition.getNamespaceURI());
        if (!"".equals(existingVersion)) {
          selectedNamespaceVersionMap.put(currNamespaceDefinition, existingVersion);
        }
      }
    }
View Full Code Here

  private boolean namespaceAttributeExistsInList(String attributeName, String namespaceUri,
      List<INamespaceDefinition> namespaces) {
    String namespacePrefix = attributeNameToPrefix(attributeName, namespaceUri);
    for (INamespaceDefinition namespaceDefinition : namespaces) {
      INamespaceDefinition currNamespaceDefinition = namespaceDefinition;
      if (currNamespaceDefinition.getNamespacePrefix(file).equals(namespacePrefix)
          || namespaceUri.equalsIgnoreCase(currNamespaceDefinition.getNamespaceURI())) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  public class XsdLabelProvider extends LabelProvider {

    @Override
    public Image getImage(Object element) {
      if (element instanceof INamespaceDefinition) {
        INamespaceDefinition xsdDef = (INamespaceDefinition) element;
        return xsdDef.getNamespaceImage();
      }
      return BeansUIImages.getImage(BeansUIImages.IMG_OBJS_XSD);
    }
View Full Code Here

    }

    @Override
    public String getText(Object element) {
      if (element instanceof INamespaceDefinition) {
        INamespaceDefinition xsdDef = (INamespaceDefinition) element;
        return xsdDef.getNamespacePrefix(file) + " - " + xsdDef.getNamespaceURI();
      }
      return "";
    }
View Full Code Here

    return getText(element);
  }

  public Image getImage(Object element) {
    if (element instanceof INamespaceDefinition) {
      INamespaceDefinition xsdDef = (INamespaceDefinition) element;
      return xsdDef.getNamespaceImage();
    }
    return BeansUIImages.getImage(BeansUIImages.IMG_OBJS_XSD);
  }
View Full Code Here

    return BeansUIImages.getImage(BeansUIImages.IMG_OBJS_XSD);
  }

  public String getText(Object element) {
    if (element instanceof INamespaceDefinition) {
      INamespaceDefinition xsdDef = (INamespaceDefinition) element;
      return xsdDef.getNamespacePrefix(resource) + " - " + xsdDef.getNamespaceURI(); //$NON-NLS-1$
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

    super.refresh();
  }

  @Override
  public void selectionChanged(IFormPart part, ISelection selection) {
    INamespaceDefinition oldDefinition = selectedNamespaceDefinition;
    selectedNamespaceDefinition = null;

    IStructuredSelection sel = (IStructuredSelection) selection;
    if (sel != null) {
      Object obj = sel.getFirstElement();
View Full Code Here

      if (rootElement == null) {
        // Create a beans element and add the default namespace
        rootElement = doc.createElement(BeansSchemaConstants.ELEM_BEANS);
        doc.appendChild(rootElement);

        INamespaceDefinition defNamespace = NamespaceUtils.getDefaultNamespaceDefinition();
        if (defNamespace != null) {
          if (!xsdViewer.getChecked(defNamespace)) {
            xsdViewer.setChecked(defNamespace, true);
          }
          rootElement.setAttribute(ConfigCoreUtils.ATTR_DEFAULT_NAMESPACE, defNamespace.getNamespaceURI());
        }
        rootElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$ //$NON-NLS-2$
      }

      // Check again so we don't add the default namespace twice
View Full Code Here

    Set<INamespaceDefinition> checkedElements = new HashSet<INamespaceDefinition>();
    Object[] availableNamespaces = ((IStructuredContentProvider) getViewer().getContentProvider())
        .getElements(getConfigEditor().getDomDocument());

    for (Object currAvailableNamespace : availableNamespaces) {
      INamespaceDefinition currNamespaceDefinition = (INamespaceDefinition) currAvailableNamespace;
      if (existsInConfiguration(currNamespaceDefinition)) {
        checkedElements.add(currNamespaceDefinition);
        selectedNamespaces.add(currNamespaceDefinition);
        String existingVersion = ConfigCoreUtils.getSelectedSchemaLocation(getConfigEditor().getDomDocument(),
            currNamespaceDefinition.getNamespaceURI());
        if (!"".equals(existingVersion)) { //$NON-NLS-1$
          selectedVersions.put(currNamespaceDefinition, existingVersion);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.ui.namespaces.INamespaceDefinition

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.