示例#1
0
 public Dimension getMinimumSize(JComponent c) {
   if (sp != null) {
     return ((ScrollPaneLayout) sp.getLayout()).minimumLayoutSize(sp);
   } else {
     return new Dimension(100, 100);
   }
 }
示例#2
0
  public void installUI(JComponent c) {
    searchnav = (JHelpSearchNavigator) c;
    HelpModel helpmodel = searchnav.getModel();

    searchnav.setLayout(new BorderLayout());
    searchnav.addPropertyChangeListener(this);
    searchnav.addComponentListener(this);
    if (helpmodel != null) {
      helpmodel.addHelpModelListener(this);
    }

    JLabel search =
        new JLabel(HelpUtilities.getString(HelpUtilities.getLocale(c), "search.findLabel"));
    searchparams = new JTextField("", 20);
    search.setLabelFor(searchparams);
    searchparams.addActionListener(searchAction);

    JPanel box = new JPanel();
    box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
    box.add(search);
    box.add(searchparams);

    searchnav.add("North", box);
    topNode = new DefaultMutableTreeNode();
    lastTOCnode = null;
    tree = new JTree(topNode);
    // public String convertValueToText(Object val
    TreeSelectionModel tsm = tree.getSelectionModel();
    tsm.addTreeSelectionListener(this);
    tree.setShowsRootHandles(false);
    tree.setRootVisible(false);
    sp = new JScrollPane();
    sp.getViewport().add(tree);
    searchnav.add("Center", sp);
    reloadData();
  }