Changeset 4423


Ignore:
Timestamp:
2003-05-30T13:43:06+12:00 (21 years ago)
Author:
mdewsnip
Message:

Moved otherwise-unused formatPath function from GValueTree to here. Turns out it should have been using getFullPath anyway, so the formatPath function seems to be obsolete.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/MetadataXML.java

    r4364 r4423  
    155155        GValueNode node = (GValueNode)all_values.get(i);
    156156        TreePath path = new TreePath(node.getPath());
    157         String value = GValueTree.formatPath(null, path, true);
     157        String value = node.getFullPath(); // formatPath(null, path, true);
    158158        String index = model.getHIndex(value);
    159159        String alias = node.getAlias(index);
     
    173173    }
    174174
     175    /** Returns the given tree path as path formatted string (ie subject\subject\subject).
     176     * @param tree The <strong>JTree</strong> the TreePath came from. Used to determine if the root node should be encoded as well.
     177     * @param path A <strong>TreePath</strong> that you wish to encode to String.
     178     * @param full <i>true</i> if this is the full path (ie a leaf node), <i>false</i> otherwise.
     179     * @return A <strong>String</strong> encoding the information from the TreePath.
     180     * @see javax.swing.JTree
     181     * @see javax.swing.tree.TreePath
     182     */
     183//      static public String formatPath(JTree tree, TreePath path, boolean full) {
     184//      String text = "";
     185//      int i = 0;
     186//      if(tree == null || (!tree.isRootVisible() && !full)) {
     187//          i = 1;
     188//      }
     189//      for( ; i < path.getPathCount(); i++) {
     190//          GValueNode node = (GValueNode)path.getPathComponent(i);
     191//          text = text + node.toString();
     192//          if(node.getChildCount() > 0) {
     193//          text = text + "\\";
     194//          }
     195//      }
     196//      if(full && text.endsWith("\\")) {
     197//          return text.substring(0, text.length() - 1);
     198//      }
     199//      return text;
     200//      }
     201
    175202    static final private long showTime(String message, long time) {
    176203    if(time == -1) {
Note: See TracChangeset for help on using the changeset viewer.