Examples of IPropertyDescriptor


Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

    descriptor.setDescription(DOMNamespaceHelper.computeName(attrDecl, fNode, null));
    return descriptor;
  }

  protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
    IPropertyDescriptor descriptor = null;
    CMDataType attrType = attrDecl.getAttrType();

    if (attrType != null) {
      // handle declarations that provide FIXED/ENUMERATED values
      if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

      attrMap = allAttributes;
    }

    List descriptorList = new ArrayList();
    List names = new ArrayList();
    IPropertyDescriptor descriptor;

    CMAttributeDeclaration attrDecl = null;

    // add descriptors for existing attributes
    NamedNodeMap attributes = fNode.getAttributes();
    if (attributes != null) {
      for (int i = 0; i < attributes.getLength(); i++) {
        Attr attr = (Attr) attributes.item(i);
        // if metainfo is present for this attribute, use the
        // CMAttributeDeclaration to derive a descriptor
        if (attrMap != null) {
          String attrName = attr.getName();
          if (fCaseSensitive) {
            attrDecl = (CMAttributeDeclaration) attrMap.getNamedItem(attrName);
          }
          else {
            attrDecl = null;
            for (int j = 0; j < attrMap.getLength(); j++) {
              if (!fCaseSensitive && attrMap.item(j).getNodeName().equalsIgnoreCase(attrName)) {
                attrDecl = (CMAttributeDeclaration) attrMap.item(j);
                break;
              }
            }
          }
        }
        // be consistent: if there's metainfo, use *that* as the
        // descriptor ID
        descriptor = null;
        if (attrDecl != null) {
          String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
          if (!names.contains(attrName)) {
            descriptor = createPropertyDescriptor(attrDecl, attr);
            if (descriptor != null)
              names.add(attrName);
          }
        }
        else {
          if (!names.contains(attr.getName())) {
            descriptor = createDefaultPropertyDescriptor(attr.getName());
            if (descriptor != null)
              names.add(attr.getName());
          }
        }
        if (descriptor != null) {
          descriptorList.add(descriptor);
        }
      }
    }

    // add descriptors from the metainfo that are not yet listed
    if (attrMap != null) {
      for (int i = 0; i < attrMap.getLength(); i++) {
        attrDecl = (CMAttributeDeclaration) attrMap.item(i);
        String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
        if (!names.contains(attrName)) {
          IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
          if (holdDescriptor != null) {
            names.add(attrName);
            descriptorList.add(holdDescriptor);
          }
        }
      }
    }

    // add MQE-based descriptors
    if (ed != null && fNode.getNodeType() == Node.ELEMENT_NODE) {
      List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
      for (int i = 0; i < nodes.size(); i++) {
        CMNode node = (CMNode) nodes.get(i);
        if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
          attrDecl = (CMAttributeDeclaration) node;
          String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
          if (!names.contains(attrName)) {
            IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
            if (holdDescriptor != null) {
              names.add(attrName);
              descriptorList.add(holdDescriptor);
            }
          }
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

      for (int i = 0; i < attrMap.getLength(); i++) {
        attrDecl = (CMAttributeDeclaration) attrMap.item(i);
        String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
        if (fCaseSensitive) {
          if (!descriptorNames.contains(attrName)) {
            IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
            if (descriptor != null) {
              descriptorNames.add(attrName);
              descriptors.add(descriptor);
            }
          }
        }
        else {
          boolean exists = false;
          for (int j = 0; j < descriptorNames.size(); j++) {
            exists = (descriptorNames.get(j).toString().equalsIgnoreCase(attrName)) || exists;
          }
          if (!exists) {
            descriptorNames.add(attrName);
            IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
            if (descriptor != null) {
              descriptorNames.add(attrName);
              descriptors.add(descriptor);
            }
          }
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

  public XMLTableTreePropertyDescriptorFactory() {
    super();
  }

  protected IPropertyDescriptor createPropertyDescriptorHelper(String name, Element element, CMNode cmNode) {
    IPropertyDescriptor result = null;

    ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
    String[] valuesArray = null;
    if (mq != null) {
      valuesArray = mq.getPossibleDataTypeValues(element, cmNode);
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

    return result;
  }

  public IPropertyDescriptor createTextPropertyDescriptor(Text text) {
    IPropertyDescriptor result = null;
    Node parentNode = text.getParentNode();
    if ((parentNode != null) && (parentNode.getNodeType() == Node.ELEMENT_NODE)) {
      Element parentElement = (Element) parentNode;
      ModelQuery mq = ModelQueryUtil.getModelQuery(text.getOwnerDocument());
      CMElementDeclaration ed = null;
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

  public DOMPropertyDescriptorFactory() {
  }

  public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
    IPropertyDescriptor result = null;

    String attributeName = attr.getName();

    ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

  public IPropertyDescriptor createProcessingInstructionPropertyDescriptor(ProcessingInstruction pi) {
    return createDefaultPropertyDescriptor(HACK);
  }

  public IPropertyDescriptor createPropertyDescriptor(Object object) {
    IPropertyDescriptor result = null;
    if (object instanceof Node) {
      Node node = (Node) object;
      int nodeType = node.getNodeType();
      switch (nodeType) {
        case Node.ATTRIBUTE_NODE : {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

        Constraint constraint = vertex.getConstraint();
        if ( constraint == null ) {
            return;
        }
        IPropertyDescriptor prop = new PropertyDescriptor( CONSTRAINT,
                                                           CONSTRAINT_CAP );
        addProperty( prop,
                     constraint.toString(),
                     descriptorList,
                     valueMap );
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

        continue;
      }

      String id = descriptor.getName();
      String displayName = PropertyDescriptors.getReadablePropertyName(descriptor);
      IPropertyDescriptor propertyDest = null;
      if (propertyType == Boolean.class || propertyType == boolean.class) {
        propertyDest = new BooleanPropertyDescriptor(id, displayName);
      } else if (propertyType == String.class) {
        propertyDest = new TextPropertyDescriptor(id, displayName);
      } else if (propertyType.isPrimitive() || Number.class.isAssignableFrom(propertyType) || Date.class.isAssignableFrom(propertyType)) {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

    if (node != null) {
      final IMessageManager mmng = form.getMessageManager();

      form.setText(node.getPatternName());

      IPropertyDescriptor idDescriptor = null;
      IPropertyDescriptor descriptionDescriptor = null;

      IPropertyDescriptor[] propertyDescriptors = node.getPropertyDescriptors();

      for (int i = 0; i < 2; i++) {
        for (IPropertyDescriptor descriptor : propertyDescriptors) {
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.