psmith 2003/12/18 22:54:28 Modified: src/java/org/apache/log4j/chainsaw/receivers ReceiversPanel.java Log: Start of the context sensitive help for the Plugins. You can right click on a Plugin within the Receivers panel and choose the Help menu item. This will eventually show the JavaDoc for that class. Currently, however this is just changing back to the Welcome page. Revision Changes Path 1.3 +17 -0 jakarta-log4j/src/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java Index: ReceiversPanel.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReceiversPanel.java 19 Dec 2003 03:21:36 -0000 1.2 +++ ReceiversPanel.java 19 Dec 2003 06:54:28 -0000 1.3 @@ -115,6 +115,7 @@ import org.apache.log4j.chainsaw.LogUI; import org.apache.log4j.chainsaw.PopupListener; import org.apache.log4j.chainsaw.SmallButton; +import org.apache.log4j.chainsaw.help.HelpManager; import org.apache.log4j.chainsaw.icons.ChainsawIcons; import org.apache.log4j.chainsaw.icons.LevelIconFactory; import org.apache.log4j.chainsaw.icons.LineIconFactory; @@ -146,6 +147,7 @@ final Action pauseReceiverButtonAction; final Action playReceiverButtonAction; final Action shutdownReceiverButtonAction; + private final Action showReceiverHelpAction; private final Action startAllAction; private final JPopupMenu popupMenu = new ReceiverPopupMenu(); private final JTree receiversTree = new JTree(); @@ -325,6 +327,19 @@ Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_S)); shutdownReceiverButtonAction.setEnabled(false); + + showReceiverHelpAction = new AbstractAction("Help"){ + + public void actionPerformed(ActionEvent e) { + Receiver receiver = getCurrentlySelectedReceiver(); + if(receiver!=null) { + HelpManager.getInstance().showHelpForClass(receiver.getClass()); + } + + }}; + + showReceiverHelpAction.putValue(Action.SMALL_ICON, new ImageIcon(ChainsawIcons.HELP)); + showReceiverHelpAction.putValue(Action.SHORT_DESCRIPTION, "Displays the JavaDoc page for this Plugin"); startAllAction = new AbstractAction( @@ -818,6 +833,8 @@ addSeparator(); add(createLevelRadioButton(r, Level.OFF)); add(createLevelRadioButton(r, Level.ALL)); + addSeparator(); + add(showReceiverHelpAction); } private JRadioButtonMenuItem createLevelRadioButton(
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]