Examples of ICatalogElement


Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

    List result = new ArrayList();
    ICatalogElement[] elements = (ICatalogElement[]) catalogElements
        .toArray(new ICatalogElement[catalogElements.size()]);
    for (int i = 0; i < elements.length; i++)
    {
      ICatalogElement element = elements[i];
      if (element.getType() == type)
      {
        result.add(element);
      }
    }
    return result;
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

    InternalResolver()
    {
      synchronized (catalogElements) {
        for (Iterator i = catalogElements.iterator(); i.hasNext();)
        {
          ICatalogElement catalogElement = (ICatalogElement) i.next();
          if (catalogElement.getType() == ICatalogElement.TYPE_ENTRY)
          {
            ICatalogEntry entry = (ICatalogEntry) catalogElement;
            Map map = getEntryMap(entry.getEntryType());
            map.put(entry.getKey(), entry);
          }
          else if (catalogElement.getType() == ICatalogElement.TYPE_REWRITE)
          {
            IRewriteEntry entry = (IRewriteEntry) catalogElement;
            if (entry.getEntryType() == IRewriteEntry.REWRITE_TYPE_SYSTEM)
            {
              rewriteSystemList.add(entry);
            }
            else
            {
              rewriteUriList.add(entry);
            }
          }
          else if (catalogElement.getType() == ICatalogElement.TYPE_SUFFIX)
          {
            ISuffixEntry entry = (ISuffixEntry) catalogElement;
            if (entry.getEntryType() == ISuffixEntry.SUFFIX_TYPE_SYSTEM)
            {
              suffixSystemList.add(entry);
            }
            else
            {
              suffixUriList.add(entry);
            }
          }
          else if (catalogElement.getType() == ICatalogElement.TYPE_DELEGATE)
          {
            IDelegateCatalog delegate = (IDelegateCatalog) catalogElement;
            if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_PUBLIC)
            {
              delegatePublicList.add(delegate);
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

  protected void performNew() {

    // ICatalogEntry newEntry =
    // (ICatalogEntry)workingUserCatalog.createCatalogElement(ICatalogElement.TYPE_ENTRY);
    EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_NEW_DIALOG_TITLE, workingUserCatalog);
    ICatalogElement element = dialog.getCatalogElement();
    if (dialog.getReturnCode() == Window.OK) {
      workingUserCatalog.addCatalogElement(element);
      tableViewer.setSelection(new StructuredSelection(element), true);
      tableViewer.refresh();
    }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

  protected void performEdit() {
    ISelection selection = tableViewer.getSelection();
    Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;

    if (selectedObject instanceof ICatalogElement) {
      ICatalogElement oldEntry = (ICatalogElement) selectedObject;
      ICatalogElement newEntry = (ICatalogElement) ((CatalogElement) oldEntry).clone();

      EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_EDIT_DIALOG_TITLE, newEntry, workingUserCatalog);
      if (dialog.getReturnCode() == Window.OK) {
        // delete the old value if the 'mapFrom' has changed
        //
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

      IStructuredSelection structuredSelection = (IStructuredSelection)selection;
      Iterator iterator = structuredSelection.iterator();
      while(iterator.hasNext()) {
        Object selectedObject = iterator.next();
        if (selectedObject instanceof ICatalogElement) {
          ICatalogElement catalogElement = (ICatalogElement) selectedObject;
          workingUserCatalog.removeCatalogElement(catalogElement);
        }
      }
    }
  }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

      Object selectedObject = structuredSelection.getFirstElement();
      if (selectedObject instanceof ICatalogElement) {
        ICatalogElement[] elements = ((Catalog) workingUserCatalog).getCatalogElements();
        // dw List entriesList = new ArrayList(elements.length);
        for (int i = 0; i < elements.length; i++) {
          ICatalogElement element = elements[i];
          isEditable = selectedObject.equals(element);
          if (isEditable) {
            break;
          }
        }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

    List result = new ArrayList();
    ICatalogElement[] elements = (ICatalogElement[]) catalogElements
        .toArray(new ICatalogElement[catalogElements.size()]);
    for (int i = 0; i < elements.length; i++)
    {
      ICatalogElement element = elements[i];
      if (element.getType() == type)
      {
        result.add(element);
      }
    }
    return result;
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

   
    InternalResolver()
    {
      for (Iterator i = catalogElements.iterator(); i.hasNext();)
      {
        ICatalogElement catalogElement = (ICatalogElement) i.next();
        if (catalogElement.getType() == ICatalogElement.TYPE_ENTRY)
        {
          ICatalogEntry entry = (ICatalogEntry) catalogElement;
          Map map = getEntryMap(entry.getEntryType());
          map.put(entry.getKey(), entry);
        }
        else if (catalogElement.getType() == ICatalogElement.TYPE_REWRITE)
        {
          IRewriteEntry entry = (IRewriteEntry) catalogElement;
          if (entry.getEntryType() == IRewriteEntry.REWRITE_TYPE_SYSTEM)
          {
            rewriteSystemList.add(entry);
          }
          else
          {
            rewriteUriList.add(entry);
          }
        }
        else if (catalogElement.getType() == ICatalogElement.TYPE_SUFFIX)
        {
          ISuffixEntry entry = (ISuffixEntry) catalogElement;
          if (entry.getEntryType() == ISuffixEntry.SUFFIX_TYPE_SYSTEM)
          {
            suffixSystemList.add(entry);
          }
          else
          {
            suffixUriList.add(entry);
          }
        }
        else if (catalogElement.getType() == ICatalogElement.TYPE_DELEGATE)
        {
          IDelegateCatalog delegate = (IDelegateCatalog) catalogElement;
          if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_PUBLIC)
          {
            delegatePublicList.add(delegate);
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

      if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
      {
       Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
        continue;
      }
      ICatalogElement catalogElement = catalog.createCatalogElement(type);
      if (catalogElement instanceof ICatalogEntry)
      {
        ICatalogEntry entry = (ICatalogEntry) catalogElement;
        entry.setKey(key);
    String resolvedPath = resolvePath(entryURI);
    entry.setURI(resolvedPath);
        String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); // optional
        if (id != null && !id.equals("")) //$NON-NLS-1$
        {
          entry.setId(id);
        }
      }
      // process any other attributes
      for (int j = 0; j < childElement.getAttributeNames().length; j++)
      {
        String attrName = childElement.getAttributeNames()[j];
        if (!attrName.equals(OASISCatalogConstants.ATTR_URI) && !attrName.equals(OASISCatalogConstants.ATTR_NAME) && !attrName.equals(OASISCatalogConstants.ATTR_PUBLIC_ID)
            && !attrName.equals(OASISCatalogConstants.ATTR_SYSTEM_ID) && !attrName.equals(OASISCatalogConstants.ATTR_CATALOG) && !attrName.equals(OASISCatalogConstants.ATTR_ID)
            && !attrName.equals(OASISCatalogConstants.ATTR_BASE))
        {
          String attrValue = childElement.getAttribute(attrName);
          if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
          {
            catalogElement.setAttributeValue(attrName, attrValue);
          }
        }
      }
      catalog.addCatalogElement(catalogElement);
    }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement

     * could allow to copy and edit entry and then replace it in catalog. Entry
     * replacement will signal ICatalogEvent @return
     */
    public Object clone()
    {
    ICatalogElement element = ownerCatalog.createCatalogElement(type);
      String[] attributes = getAttributes();  
      for (int i = 0; i < attributes.length; i++)
      {
        String attrName = attributes[i];
        String attrValue = getAttributeValue(attrName);
        element.setAttributeValue(attrName, attrValue);
      }
    element.setOwnerCatalog(ownerCatalog);
    element.setId(id);
    element.setBase(base);
      return element;
    }
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.