Changeset 2199 for trunk/java-client


Ignore:
Timestamp:
2001-03-20T11:22:23+12:00 (23 years ago)
Author:
daven
Message:

error checking and empty document handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java

    r2198 r2199  
    271271      // get the result object from the SelectedIndex
    272272      // assume we only get here with events from resultsList
     273    int docLength = 0;
    273274      if (e.getValueIsAdjusting()) { return; }
    274275      Result result =  (Result) resultsList.getSelectedValue();
     
    300301           styledEditorKit.read( sr, defaultStyledDoc, 0);
    301302           documentPane.setDocument(defaultStyledDoc);
     303           docLength = defaultStyledDoc.getLength();
    302304           }
    303305           else { // treat as HTML
     
    305307           htmlEditorKit.read( sr, htmlDoc, 0);
    306308           documentPane.setStyledDocument( htmlDoc );
     309           docLength = htmlDoc.getLength();
    307310           }
    308311      } // end try
     
    316319      }
    317320
    318       if (documentPane.getLength > 0)
     321      if (docLength > 0)
    319322          documentPane.setCaretPosition(1);
    320323      // we might not be using htmlDoc at this point!!
Note: See TracChangeset for help on using the changeset viewer.