/** * Adds the ScrollablePopupMenuItem to the item list and to the parent. * Fires the event 'itemsWereAdded' on the parent pop up menu * * @param item * The item to add * @param details * The details for the 'itemsWereAdded' event */ protected void addItem(ScrollablePopupMenuItem item, String details) { int oldSize = items.size(); items.add(0, item); parent.add(item, 0, oldSize, items.size()); parent.fireItemsWereAdded (new ScrollablePopupMenuEvent(parent, ScrollablePopupMenuEvent.ITEMS_ADDED, 1, details)); }
/** * Adds the ScrollablePopupMenuItem to the item list and to the parent. * Fires the event 'itemsWereAdded' on the parent pop up menu * * @param item * The item to add * @param details * The details for the 'itemsWereAdded' event */ protected void addItem(ScrollablePopupMenuItem item, String details) { int oldSize = items.size(); items.add(0, item); parent.add(item, 0, oldSize, items.size()); parent.fireItemsWereAdded (new ScrollablePopupMenuEvent(parent, ScrollablePopupMenuEvent.ITEMS_ADDED, 1, details)); }
/** * Initializes this popup menu. */ private void init() { super.removeAll(); scrollPane = new JScrollPane(); scrollPane.setViewportView(menuPanel); scrollPane.setBorder(null); int minWidth = resources.getInteger("ScrollPane.minWidth"); int minHeight = resources.getInteger("ScrollPane.minHeight"); int maxWidth = resources.getInteger("ScrollPane.maxWidth"); int maxHeight = resources.getInteger("ScrollPane.maxHeight"); scrollPane.setMinimumSize(new Dimension(minWidth, minHeight)); scrollPane.setMaximumSize(new Dimension(maxWidth, maxHeight)); scrollPane.setHorizontalScrollBarPolicy (ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(scrollPane, BorderLayout.CENTER); addFooter(new DefaultScrollablePopupMenuItem(this, "")); }
/** * Initializes this popup menu. */ private void init() { super.removeAll(); scrollPane = new JScrollPane(); scrollPane.setViewportView(menuPanel); scrollPane.setBorder(null); int minWidth = resources.getInteger("ScrollPane.minWidth"); int minHeight = resources.getInteger("ScrollPane.minHeight"); int maxWidth = resources.getInteger("ScrollPane.maxWidth"); int maxHeight = resources.getInteger("ScrollPane.maxHeight"); scrollPane.setMinimumSize(new Dimension(minWidth, minHeight)); scrollPane.setMaximumSize(new Dimension(maxWidth, maxHeight)); scrollPane.setHorizontalScrollBarPolicy (ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(scrollPane, BorderLayout.CENTER); addFooter(new DefaultScrollablePopupMenuItem(this, "")); }
/** * Adds the footer item to this pop up menu. */ private void addFooter(ScrollablePopupMenuItem footer) { this.footer = footer; this.footer.setEnabled(false); add((Component)this.footer, BorderLayout.SOUTH); }
/** * Adds the footer item to this pop up menu. */ private void addFooter(ScrollablePopupMenuItem footer) { this.footer = footer; this.footer.setEnabled(false); add((Component)this.footer, BorderLayout.SOUTH); }