Package javax.help.Map

Examples of javax.help.Map.ID


      } else {
    objHS = hs;
      }
  }
  try {
      ID id = ID.create(helpID, objHS);
      if (id == null) {
    id = objHS.getHomeID();
      }
      if (hb != null) {
    hb.setCurrentID(id);
View Full Code Here


     *
     * @param url A URL
     * @return The closest ID in this map to the given URL
     */
    public ID getClosestID(URL url) {
  ID back = null;
  // See if there is an exact match
  back = getIDFromURL(url);
  if (back != null) {
      return back;
  }
View Full Code Here

        }
       
        HelpModelEvent e = (HelpModelEvent) history.elementAt(index);
        // set the historyIndex so it is ready to take the next event...
        historyIndex = index-1;
        ID id = e.getID();
        URL url = e.getURL();
        JHelpNavigator navigator = e.getNavigator();
        if (id != null) {
            // try to set the ID
            try {
View Full Code Here

        Vector newHistory = new Vector();
        int index = historyIndex;
       
        for(int i = 0; i < size; i++){
            HelpModelEvent evt = (HelpModelEvent)history.elementAt(i);
            ID id = evt.getID();
            debug(" update id "+id);
            URL url = evt.getURL();
            debug(" update url " +url);
            if ((id != null) && (id.hs != hs)) {
                debug(" remain - "+id);
                newHistory.addElement(history.elementAt(i));
            }
            else if (url != null) {
                //find out if there is a matching ID for this URL
                ID idcan = hs.getCombinedMap().getIDFromURL(url);
                if(idcan == null){
                    debug(" remain > "+idcan);
                    newHistory.addElement(history.elementAt(i));
                }
            }
View Full Code Here

     
  setVisibility(topNode);

     
  if (index.getModel() != null) {
      ID id = index.getModel().getCurrentID();
      if (id != null) {
    DefaultMutableTreeNode selectedNode = findID(topNode, id);
    selectNode(selectedNode);
      }
  }
View Full Code Here

    }

    // Process and idChanged event

    public synchronized void idChanged(HelpModelEvent e) {
  ID id = e.getID();
  HelpModel helpModel = index.getModel();
  debug("idChanged("+e+")");

  if (e.getSource() != helpModel) {
      debug("Internal inconsistency!");
      debug("  "+e.getSource()+" != "+helpModel);
      throw new Error("Internal error");
  }

  if (id == null) {
      id = helpModel.getHelpSet().getCombinedMap().getClosestID(e.getURL());
  }
  TreePath s = tree.getSelectionPath();
  if (s != null) {
      Object o = s.getLastPathComponent();
      // should require only a TreeNode
      if (o instanceof DefaultMutableTreeNode) {
    DefaultMutableTreeNode tn = (DefaultMutableTreeNode) o;
    IndexItem item = (IndexItem) tn.getUserObject();
    if (item != null) {
        ID nId = item.getID();
        if (nId != null && nId.equals(id)) {
      return;
        }
    }
      }
  }
View Full Code Here

  if (id == null) {
      return null;
  }
  IndexItem item = (IndexItem) node.getUserObject();
  if (item != null) {
      ID testID = item.getID();
      debug("  testID: "+testID);
      if (testID != null && testID.equals(id)) {
    return node;
      }
  }
  int size = node.getChildCount();
  for (int i=0; i<size ; i++) {
View Full Code Here

   * A HomeID is found.
   */

  public void processHomeID(HelpSet hs,
          String value) {
      ID homeID = hs.getHomeID();
      if ((homeID == null) || homeID.equals("")) {
    //parsingError("helpset.wrongHomeID", value, homeID.id);
                hs.setHomeID(value);
            }else{
                parsingError("helpset.wrongHomeID", value, homeID.id);
            }
View Full Code Here

   * A HomeID is found.
   */

  public void processHomeID(HelpSet hs,
          String value) {
      ID homeID = hs.getHomeID();
      if ((homeID == null) || homeID.equals("")) {
    //parsingError("helpset.wrongHomeID", value, homeID.id);
                hs.setHomeID(value);
            }else{
                parsingError("helpset.wrongHomeID", value, homeID.id);
            }
View Full Code Here

   
    public void idChanged(HelpModelEvent e) {
        debug("idChanged("+e+")");
       
        //next values
        ID id = e.getID();
        contentTitle = e.getHistoryName();
        URL nurl = e.getURL();
        String nURL = null;
        if (nurl != null)
            nURL = nurl.toExternalForm();
       
        //current values
        ID currentID = null;
        String currentURL = null;
        String currentName = null;
  FavoritesItem item = null;
       
        HelpModel helpModel = favorites.getModel();
       
       
        if (e.getSource() != helpModel) {
            debug("Internal inconsistency!");
            debug("  "+e.getSource()+" != "+helpModel);
            throw new Error("Internal error");
        }
       
        TreePath s = tree.getSelectionPath();
        if (s != null) {
            Object o = s.getLastPathComponent();
            // should require only a TreeNode
            if (o instanceof DefaultMutableTreeNode) {
                DefaultMutableTreeNode tn = (DefaultMutableTreeNode) o;
                item = (FavoritesItem) tn.getUserObject();
                if (item != null){
                    currentID = (Map.ID) dataMap.get(item);
                    currentURL = item.getURLSpec();
                    currentName = item.getName();
                }
                if((currentName != null) && (currentName.equals(contentTitle))){
                    if(currentID != null)
                        if(currentID.equals(id))
                            return;
                    if(currentURL != null)
                        if(currentURL.equals(nURL))
                            return;
                }
View Full Code Here

TOP

Related Classes of javax.help.Map.ID

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.