From fb99265a39142543b9f1b83a862aa93b819e5194 Mon Sep 17 00:00:00 2001 From: weisj Date: Tue, 27 Oct 2020 01:44:22 +0100 Subject: [PATCH] Add docs to JSplitButton. --- .../components/button/JSplitButton.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/components/button/JSplitButton.java b/core/src/main/java/com/github/weisj/darklaf/components/button/JSplitButton.java index 987245f9c..87adf22c4 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/button/JSplitButton.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/button/JSplitButton.java @@ -78,6 +78,11 @@ public JSplitButton(final String text, final Icon icon) { super(text, icon); } + /** + * Get the number of currently installed action listened. + * + * @return the number of action listeners installed. + */ public int getActionCount() { return listenerList.getListenerCount(ActionListener.class); } @@ -99,6 +104,11 @@ public void removeActionListener(final ActionListener l) { firePropertyChange(KEY_ACTION_REMOVED, l, null); } + /** + * Get the current action menu. If no menu is currently installed an empty one will be created. + * + * @return the action menu. + */ public JPopupMenu getActionMenu() { if (actionMenu == null) { actionMenu = new JPopupMenu(); @@ -106,6 +116,15 @@ public JPopupMenu getActionMenu() { return actionMenu; } + /** + * Set the action menu. + * + * @param actionMenu the new action menu. + */ + public void setActionMenu(final JPopupMenu actionMenu) { + this.actionMenu = actionMenu; + } + @Override public void updateUI() { super.updateUI(); @@ -113,8 +132,4 @@ public void updateUI() { SwingUtilities.updateComponentTreeUI(actionMenu); } } - - public void setActionMenu(final JPopupMenu actionMenu) { - this.actionMenu = actionMenu; - } }