logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw TableColorizingRenderer.java LogUI.java ChainsawToolBarAndMenus.java
Date Wed, 04 Jun 2003 05:02:35 GMT
sdeboy      2003/06/03 22:02:35

  Modified:    src/java/org/apache/log4j/chainsaw
                        TableColorizingRenderer.java LogUI.java
                        ChainsawToolBarAndMenus.java
  Log:
  Modified selected row color to default regardless of existing color filter.
  Corrected behavior oddities in find - now supports find/find next through
  evaluation of the text in the find field (if the text was previously empty or if the 
  text length is less than the last search, it finds from the top).
  F3 or the 'find next' button are how you  'find next'
  
  Revision  Changes    Path
  1.11      +4 -1      jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
  
  Index: TableColorizingRenderer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TableColorizingRenderer.java	3 Jun 2003 14:48:43 -0000	1.10
  +++ TableColorizingRenderer.java	4 Jun 2003 05:02:34 -0000	1.11
  @@ -191,7 +191,7 @@
       case ChainsawColumns.INDEX_ID_COL_NAME:
         idComponent.setText(value.toString());
         idComponent.setForeground(c.getForeground());
  -      color = isSelected ? c.getBackground() : COLOR_ODD;
  +      idComponent.setBackground(c.getBackground());
         c = idComponent;
   
         break;
  @@ -216,6 +216,9 @@
   
       default:
         break;
  +    }
  +    if (isSelected) {
  +		return c;
       }
   
       this.table = table;
  
  
  
  1.86      +28 -3     jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- LogUI.java	3 Jun 2003 14:48:43 -0000	1.85
  +++ LogUI.java	4 Jun 2003 05:02:34 -0000	1.86
  @@ -1581,11 +1581,37 @@
       }
   
       /**
  +     * Find from the top
  +     * @param text
  +     */
  +
  +	void findFromTop(String text) {
  +		find(0, text);
  +	}
  +		
  +
  +    /**
        * Finds the row with the specified text, and ensures it is made visible
        * @param text
        */
       void find(String text) {
  -      final int row = tableModel.find(table.getSelectedRow() + 1, text);
  +    	find(table.getSelectedRow(), text);
  +    }
  +
  +    /**
  +     * Finds the next row with the specified text, and ensures it is made visible
  +     * @param text
  +     */
  +    void findNext(String text) {
  +    	find(table.getSelectedRow() + 1, text);
  +    }
  +
  +    /**
  +     * Finds the row with the specified text starting at the specified row, and ensures
it is made visible
  +     * @param text
  +     */
  +    void find(int row, String text) {
  +      final int newRow = tableModel.find(row, text);
   
         if (text.length() == 0) {
           scrollToBottom.bypass(false);
  @@ -1594,9 +1620,8 @@
         }
   
         table.scrollToRow(
  -        row, table.columnAtPoint(table.getVisibleRect().getLocation()));
  +        newRow, table.columnAtPoint(table.getVisibleRect().getLocation()));
       }
  -
       /**
        * Docks this DockablePanel by hiding the JFrame and placing the
        * Panel back inside the LogUI window.
  
  
  
  1.31      +24 -14    jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
  
  Index: ChainsawToolBarAndMenus.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ChainsawToolBarAndMenus.java	3 Jun 2003 06:32:58 -0000	1.30
  +++ ChainsawToolBarAndMenus.java	4 Jun 2003 05:02:35 -0000	1.31
  @@ -151,6 +151,7 @@
     private final JRadioButtonMenuItem levelDisplayIcon = new JRadioButtonMenuItem("Icon");
     private final JRadioButtonMenuItem levelDisplayText = new JRadioButtonMenuItem("Text");
     private String levelDisplay = ChainsawConstants.LEVEL_DISPLAY_ICONS;
  +  private String lastFind = "";
   
     private final Action[] logPanelSpecificActions;
   
  @@ -265,18 +266,27 @@
       }
     }
   
  -  private void find() {
  +  private void find(boolean next) {
       LogUI.LogPanel logPanel = logui.getCurrentLogPanel();
   
       if (logPanel != null) {
  -      localFind(logPanel, findTextField);
  +      localFind(next, logPanel, findTextField);
       }
     }
   
  -  private void localFind(
  +  private void localFind(boolean next, 
       final LogUI.LogPanel logPanel, final JTextField theFindTextField) {
       if (!theFindTextField.getText().equals("")) {
  -      logPanel.find(theFindTextField.getText());
  +    	if (lastFind.length() == 0 || lastFind.length() > theFindTextField.getText().length())
{
  +    		logPanel.findFromTop(theFindTextField.getText());
  +    	} else {
  +    		if (next) {
  +	    		logPanel.findNext(theFindTextField.getText());
  +    		} else {
  +    			logPanel.find(theFindTextField.getText());
  +    		}
  +    	}
  +   		lastFind = theFindTextField.getText();    	
       } else {
         theFindTextField.requestFocus();
       }
  @@ -286,15 +296,15 @@
       field.getDocument().addDocumentListener(
         new DocumentListener() {
           public void insertUpdate(DocumentEvent e) {
  -          find();
  +          find(false);
           }
   
           public void removeUpdate(DocumentEvent e) {
  -          find();
  +          find(false);
           }
   
           public void changedUpdate(DocumentEvent e) {
  -          find();
  +          find(false);
           }
         });
     }
  @@ -305,7 +315,7 @@
       final Action action =
         new AbstractAction("Find Next") {
           public void actionPerformed(ActionEvent e) {
  -          find();
  +          find(true);
           }
         };
   
  @@ -920,26 +930,26 @@
       findField.getDocument().addDocumentListener(
         new DocumentListener() {
           public void insertUpdate(DocumentEvent e) {
  -          findInUndocked();
  +          findInUndocked(false);
           }
   
           public void removeUpdate(DocumentEvent e) {
  -          findInUndocked();
  +          findInUndocked(false);
           }
   
           public void changedUpdate(DocumentEvent e) {
  -          findInUndocked();
  +          findInUndocked(false);
           }
   
  -        private void findInUndocked() {
  -          localFind(logPanel, findField);
  +        private void findInUndocked(boolean next) {
  +          localFind(next, logPanel, findField);
           }
         });
   
       final Action undockedFindAction =
         new AbstractAction() {
           public void actionPerformed(ActionEvent e) {
  -          localFind(logPanel, findField);
  +          localFind(true, logPanel, findField);
           }
         };
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message