Example #1
0
  /**
   * The constructor constructs all of the elements of this <tt>AbstractPaneItem</tt>.
   *
   * @param key the key for this <tt>AbstractPaneItem</tt> that the superclass uses to generate
   *     strings
   */
  public SharedDirPaneItem() {
    super(TITLE, LABEL);

    sharingPanel.setFileFilter(
        new FileFilter() {
          //		    private final FileManager fileManager = GuiCoreMediator.getFileManager();
          public boolean accept(File pathname) {
            return true;
            //                return fileManager.isFolderShareable(pathname, false);
          }
        });
    sharingPanel.getTree().setRootVisible(false);
    sharingPanel.getTree().setShowsRootHandles(true);

    JPanel buttonPanel = new JPanel(new BorderLayout());
    buttonPanel.setBorder(new EmptyBorder(0, 4, 0, 0));
    JPanel buttons = new JPanel(new BorderLayout());
    buttons.add(
        new JButton(new SelectSharedDirectoryAction(sharingPanel, sharingPanel)),
        BorderLayout.NORTH);
    buttons.add(Box.createVerticalStrut(4), BorderLayout.CENTER);
    buttons.add(new JButton(new RemoveSharedDirectoryAction(sharingPanel)), BorderLayout.SOUTH);
    buttonPanel.add(buttons, BorderLayout.NORTH);
    sharingPanel.addEastPanel(buttonPanel);
    add(sharingPanel);
  }