Пример #1
0
 @Override
 public void actionPerformed(ActionEvent e) {
   for (LocalFileItem localFileItem : localFileItems) {
     friendFileList.removeFile(localFileItem.getFile());
   }
   GuiUtils.getMainFrame().repaint();
 }
Пример #2
0
    public FriendShareCheckBox(LocalFileList friendFileList, LocalFileItem localFileItem) {
      super(I18n.tr("Share"));
      this.friendFileList = friendFileList;
      this.localFile = localFileItem;
      setSelected(friendFileList.contains(localFileItem.getFile()));

      addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              if (isSelected()) {
                FriendShareCheckBox.this.friendFileList.addFile(localFile.getFile());
              } else {
                FriendShareCheckBox.this.friendFileList.removeFile(localFile.getFile());
              }
            }
          });
    }