psmith 2003/12/19 02:10:06 Modified: src/java/org/apache/log4j/chainsaw/receivers ReceiversPanel.java Log: removed the Edit Receiver action, the plugin editor now accomodates this function. Also placed the Plugin property editor within a Split pane so it can be resized. Revision Changes Path 1.4 +12 -30 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.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ReceiversPanel.java 19 Dec 2003 06:54:28 -0000 1.3 +++ ReceiversPanel.java 19 Dec 2003 10:10:06 -0000 1.4 @@ -93,6 +93,7 @@ import javax.swing.JPopupMenu; import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.JTextField; import javax.swing.JToolBar; import javax.swing.JTree; @@ -142,7 +143,6 @@ * @author Scott Debogy <[EMAIL PROTECTED]> */ public class ReceiversPanel extends JPanel { - final Action editReceiverButtonAction; final Action newReceiverButtonAction; final Action pauseReceiverButtonAction; final Action playReceiverButtonAction; @@ -157,6 +157,8 @@ private final ReceiverToolbar buttonPanel; private final Runnable updateReceiverTree; + private final JSplitPane splitter = new JSplitPane(); + private final PluginPropertyEditorPanel pluginEditorPanel = new PluginPropertyEditorPanel(); public ReceiversPanel(final LogUI logui) { @@ -258,22 +260,6 @@ newReceiverButtonAction.setEnabled(true); - editReceiverButtonAction = - new AbstractAction() { - public void actionPerformed(ActionEvent e) { - JOptionPane.showMessageDialog(logui, "Not Implemented yet, sorry"); - } - }; - editReceiverButtonAction.putValue( - Action.SMALL_ICON, new ImageIcon(ChainsawIcons.ICON_EDIT_RECEIVER)); - editReceiverButtonAction.putValue( - Action.SHORT_DESCRIPTION, - "Edits the configuration of the selected Receiver"); - editReceiverButtonAction.putValue(Action.NAME, "Edit Receiver"); - editReceiverButtonAction.setEnabled(false); - editReceiverButtonAction.putValue( - Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_E)); - playReceiverButtonAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { @@ -406,10 +392,16 @@ this.addMouseListener(popupListener); JComponent component = receiversTree; - - add(new JScrollPane(component), BorderLayout.CENTER); + JScrollPane pane = new JScrollPane(component); + + splitter.setOrientation(JSplitPane.VERTICAL_SPLIT); + + splitter.setTopComponent(pane); + splitter.setBottomComponent(pluginEditorPanel); + + splitter.setResizeWeight(0.7); add(buttonPanel, BorderLayout.NORTH); - add(pluginEditorPanel, BorderLayout.SOUTH); + add(splitter, BorderLayout.CENTER); /** @@ -612,11 +604,9 @@ } if (object instanceof Receiver) { - editReceiverButtonAction.setEnabled(true); newReceiverButtonAction.setEnabled(true); shutdownReceiverButtonAction.setEnabled(true); } else { - editReceiverButtonAction.setEnabled(false); shutdownReceiverButtonAction.setEnabled(false); newReceiverButtonAction.setEnabled(true); } @@ -822,8 +812,6 @@ add(pauseReceiverButtonAction); add(shutdownReceiverButtonAction); addSeparator(); - add(editReceiverButtonAction); - addSeparator(); final Receiver r = getCurrentlySelectedReceiver(); add(createLevelRadioButton(r, Level.DEBUG)); @@ -867,7 +855,6 @@ JMenuItem startAll = new JMenuItem(startAllAction); add(newReceiverButtonAction); - add(editReceiverButtonAction); addSeparator(); add(startAll); @@ -1145,12 +1132,7 @@ newReceiverButton.setText(null); newReceiverButton.addMouseListener(new PopupListener(newReceiverPopup)); - SmallButton editReceiverButton = - new SmallButton(editReceiverButtonAction); - editReceiverButton.setText(null); - add(newReceiverButton); - add(editReceiverButton); addSeparator(); add(playReceiverButton);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]