Search in sources :

Example 1 with ConfigureOptionsAction

use of com.limegroup.gnutella.gui.options.ConfigureOptionsAction in project frostwire by frostwire.

the class LibraryExplorer method setupTree.

private void setupTree() {
    tree = new LibraryIconTree(model);
    tree.setRowHeight(TableSettings.DEFAULT_TABLE_ROW_HEIGHT.getValue());
    tree.setRootVisible(false);
    tree.setShowsRootHandles(false);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setCellRenderer(new NodeRenderer());
    tree.setDragEnabled(true);
    tree.setTransferHandler(new LibraryFilesTransferHandler(tree));
    ((BasicTreeUI) tree.getUI()).setExpandedIcon(null);
    ((BasicTreeUI) tree.getUI()).setCollapsedIcon(null);
    SkinPopupMenu popup = new SkinPopupMenu();
    popup.add(new SkinMenuItem(refreshAction));
    popup.add(new SkinMenuItem(exploreAction));
    popup.add(new SkinMenuItem(new ConfigureOptionsAction(OptionsConstructor.SHARED_KEY, I18n.tr("Configure Options"), I18n.tr("You can configure the FrostWire\'s Options."))));
    tree.addMouseListener(new DefaultMouseListener(new TreeMouseObserver(tree, popup)));
    tree.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent e) {
            if (LibraryUtils.isRefreshKeyEvent(e)) {
                refreshSelection(true);
            }
        }
    });
    treeSelectionListener = new LibraryExplorerTreeSelectionListener();
    tree.addTreeSelectionListener(treeSelectionListener);
    ToolTipManager.sharedInstance().registerComponent(tree);
}
Also used : SkinMenuItem(com.frostwire.gui.theme.SkinMenuItem) SkinPopupMenu(com.frostwire.gui.theme.SkinPopupMenu) KeyAdapter(java.awt.event.KeyAdapter) ConfigureOptionsAction(com.limegroup.gnutella.gui.options.ConfigureOptionsAction) DefaultMouseListener(com.limegroup.gnutella.gui.tables.DefaultMouseListener) KeyEvent(java.awt.event.KeyEvent) BasicTreeUI(javax.swing.plaf.basic.BasicTreeUI)

Example 2 with ConfigureOptionsAction

use of com.limegroup.gnutella.gui.options.ConfigureOptionsAction in project frostwire by frostwire.

the class AbstractLibraryTableMediator method buildListeners.

@Override
protected void buildListeners() {
    super.buildListeners();
    SEND_TO_FRIEND_ACTION = new SendToFriendAction();
    OPTIONS_ACTION = new ConfigureOptionsAction(OptionsConstructor.LIBRARY_KEY, tr("Options"), tr("You can configure the folders you share in FrostWire\'s Options."));
}
Also used : ConfigureOptionsAction(com.limegroup.gnutella.gui.options.ConfigureOptionsAction)

Aggregations

ConfigureOptionsAction (com.limegroup.gnutella.gui.options.ConfigureOptionsAction)2 SkinMenuItem (com.frostwire.gui.theme.SkinMenuItem)1 SkinPopupMenu (com.frostwire.gui.theme.SkinPopupMenu)1 DefaultMouseListener (com.limegroup.gnutella.gui.tables.DefaultMouseListener)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 BasicTreeUI (javax.swing.plaf.basic.BasicTreeUI)1