Package com.jidesoft.pane

Examples of com.jidesoft.pane.CollapsiblePanes


      {
        HermesBrowser.getBrowser().showErrorDialog("Unable to load filter history", e1) ;
      }
     
      getContentPane().setLayout(new BorderLayout());
      CollapsiblePanes panes = new CollapsiblePanes();

      CollapsiblePane descriptionPane = new CollapsiblePane("Using Filters");
      MultilineLabel label = new MultilineLabel(getDescription());
      label.setBorder(BorderFactory.createEmptyBorder(8, 10, 8, 10));
      descriptionPane.setContentPane(label);

      try
      {
         descriptionPane.setCollapsed(true);
      }
      catch (PropertyVetoException e)
      {
         log.warn(e.getMessage(), e);
      }

      CollapsiblePane comboPane = new CollapsiblePane("Saved Filters");
      comboPane.getContentPane().setLayout(new BoxLayout(comboPane.getContentPane(), BoxLayout.X_AXIS));
      JPanel comboPanel = new JPanel();
      comboPanel.setLayout(new BoxLayout(comboPanel, BoxLayout.X_AXIS));
      comboPanel.setBorder(BorderFactory.createEmptyBorder(8, 10, 8, 10));
      comboPane.setEmphasized(true);

      try
      {
         comboPane.setCollapsed(true);
      }
      catch (PropertyVetoException e)
      {
         log.warn(e.getMessage(), e);
      }

      filterCombo = new JComboBox(filterHistory);
      filterCombo.setEditable(false);
      comboPanel.add(filterCombo);
      comboPanel.add(comboFilterButton);
      comboPanel.add(comboRemoveFilterButton);
      comboPane.setContentPane(comboPanel);

      CollapsiblePane fieldPane = new CollapsiblePane("New Filter");
      JPanel fieldPanel = new JPanel();
      fieldPane.setEmphasized(true);
      fieldPanel.setLayout(new BoxLayout(fieldPanel, BoxLayout.X_AXIS));
      fieldPanel.setBorder(BorderFactory.createEmptyBorder(8, 10, 8, 10));
      fieldPanel.add(filterField);
      fieldPanel.add(textFilterButton);
      fieldPanel.add(textSaveFilterButton);
      fieldPane.setContentPane(fieldPanel);

      panes.add(fieldPane);
      panes.add(comboPane);
      panes.add(descriptionPane);

      panes.addExpansion();

      filterField.addActionListener(new ActionListener()
      {
         public void actionPerformed(ActionEvent e)
         {
View Full Code Here


    // one or more?
    if (headers.size() == 1) {
      return new YScrollPane(headers.entrySet().iterator().next().getValue().getPanelFromBuilder(withAutoSaveFunction));
    } else {
      // build basics
      CollapsiblePanes cp = new CollapsiblePanes();
      cp.setGap(0);
      cp.setBorder(BorderFactory.createEmptyBorder());
      cp.setBackground(SystemColor.window);

      // get elements
      Object[] keys = headers.keySet().toArray();
      Arrays.sort(keys);
      LinkedList<Object> obj = new LinkedList<Object>(Arrays.asList(keys));

      // build order
      LinkedList<String> erg = new LinkedList<String>();
      String cid;
      int sort;
      while (obj.size() > 0) {
        sort = headers.get(obj.get(0)).getSorting();
        cid = (String) obj.get(0);
        // add all elements
        for (final Object key : obj) {
          if (headers.get(key).getSorting() < sort) {
            sort = headers.get(key).getSorting();
            cid = (String) key;
          }
        }

        // remove it
        erg.add(cid);
        obj.remove(cid);
      }

      // add all elements
      for (final Object key : erg) {
        cp.add(headers.get(key).getPane(withAutoSaveFunction, this));
      }
      cp.addExpansion();

      return new YScrollPane(cp);
    }
  }
View Full Code Here

TOP

Related Classes of com.jidesoft.pane.CollapsiblePanes

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.