Package org.eclipse.wst.xml.core.internal.contentmodel.util

Examples of org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo


    ICatalogEntry[] entries = catalog.getCatalogEntries();
    for (int i = 0; i < entries.length; i++) {
      ICatalogEntry entry = entries[i];
      if ((entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) && entry.getURI().endsWith(".xsd")) { //$NON-NLS-1$
        if (!isAlreadyDeclared(entry.getKey())) {
          NamespaceInfo namespaceInfo = new NamespaceInfo(entry.getKey(), "xx", null); //$NON-NLS-1$
          list.add(namespaceInfo);
        }
      }
    }
  }
View Full Code Here


  }

  public void computeAddablePrefixes(List addableList, List exisitingList) {
    HashMap map = new HashMap();
    for (Iterator i = exisitingList.iterator(); i.hasNext();) {
      NamespaceInfo info = (NamespaceInfo) i.next();
      if (info.prefix != null) {
        map.put(info.prefix, info);
      }
    }
    for (Iterator i = addableList.iterator(); i.hasNext();) {
      NamespaceInfo info = (NamespaceInfo) i.next();
      if (info.uri != null) {
        String prefix = (String) preferredPrefixTable.get(info.uri);
        info.prefix = getUniquePrefix(map, prefix, info.uri);
        map.put(info.prefix, info);
      }
View Full Code Here

  }

  protected boolean isAlreadyDeclared(String namespaceURI) {
    boolean result = false;
    for (Iterator i = existingNamespaces.iterator(); i.hasNext();) {
      NamespaceInfo namespaceInfo = (NamespaceInfo) i.next();
      if (namespaceURI.equals(namespaceInfo.uri)) {
        result = true;
        break;
      }
    }
View Full Code Here

    public Image getColumnImage(Object object, int columnIndex) {
      Image result = null;
      int columnCode = getColumnCode(columnIndex);
      if (columnCode == COLUMN_LOCATION_HINT) {
        NamespaceInfo info = (NamespaceInfo) object;
        if ((info.locationHint == null) || info.locationHint.trim().equals("")) { //$NON-NLS-1$
          // Comment this out until we solve the alignment/(space
          // for image being allocated
          // to prefix column) ......
          // result =
View Full Code Here

      return result;
    }

    public String getColumnText(Object object, int column) {
      NamespaceInfo info = (NamespaceInfo) object;
      String result = null;
      int columnCode = getColumnCode(column);
      switch (columnCode) {
        case COLUMN_PREFIX : {
          result = info.prefix;
View Full Code Here

    public void mouseDown(MouseEvent e) {
      TableItem item = getTable().getItem(new Point(e.x, e.y));
      if (item != null) {
        Object obj = item.getData();
        if (obj != null) {
          NamespaceInfo info = (NamespaceInfo) obj;
          TableColumn col = getTable().getColumn(0);
          if (e.x < col.getWidth()) // if the point falls within
                        // the
          // Select column then perform
          // check/uncheck
          {
            String currentState = (String) info.getProperty("checked"); //$NON-NLS-1$
            System.out.println("currentState" + currentState); //$NON-NLS-1$
            if ((currentState == null) || currentState.equals("false")) //$NON-NLS-1$
            {
              info.setProperty("checked", "true"); //$NON-NLS-1$ //$NON-NLS-2$
            }
            else {
              info.setProperty("checked", "false"); //$NON-NLS-1$ //$NON-NLS-2$
            }
            refresh();
          }
        }
      }
View Full Code Here

      performDelayedUpdate();
    }
  }

  public void performNew() {
    NamespaceInfo info = new NamespaceInfo();
    EditNamespaceInfoDialog dialog = invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, info);
    if (dialog.getReturnCode() == Window.OK) {
      namespaceInfoList.add(info);
      performDelayedUpdate();
    }
View Full Code Here

  }

  public void updateButtonEnabledState() {
    ISelection selection = tableViewer.getSelection();
    Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
    NamespaceInfo info = (NamespaceInfo) selectedObject;
    editButton.setEnabled(info != null);
    deleteButton.setEnabled((info != null) && (info.getProperty("unremovable") == null)); //$NON-NLS-1$
  }
View Full Code Here

    public Image getColumnImage(Object object, int columnIndex) {
      return null;
    }

    public String getColumnText(Object object, int column) {
      NamespaceInfo info = (NamespaceInfo) object;
      String result = null;
      switch (column) {
        case 0 : {
          result = info.uri;
          break;
View Full Code Here

      if (namespaceInfoList == null) {
        return defaultPrefix;
      }
      Vector v = new Vector();
      for (int i = 0; i < namespaceInfoList.size(); i++) {
        NamespaceInfo nsinfo = (NamespaceInfo) namespaceInfoList.get(i);
        if (nsinfo.prefix != null) {
          v.addElement(nsinfo.prefix);
        }
      }
      if (v.contains(defaultPrefix)) {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo

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.