logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw LogUI.java
Date Fri, 16 May 2003 03:52:21 GMT
psmith      2003/05/15 20:52:21

  Modified:    src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  Changed title of Frame.
  
  CTRL-LEFT_DBL_CLICK on a tab will now close the tab, including 
  clearing all held data (I hope).  The tab will be recreated if new events
  arrive that would normally go to that tab.
  
  Still want to create a Right click popup menu for the tab itself, and also
  create a X close icon to be inserted into the tab so a single click can close 
  it.
  
  Revision  Changes    Path
  1.50      +31 -14    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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- LogUI.java	15 May 2003 18:26:03 -0000	1.49
  +++ LogUI.java	16 May 2003 03:52:21 -0000	1.50
  @@ -180,7 +180,7 @@
      * including the Menu bar
      */
     public LogUI() {
  -    super("Log Viewer");
  +    super("Chainsaw v2 - Log Viewer");
   
       if (ChainsawIcons.WINDOW_ICON != null) {
         setIconImage(new ImageIcon(ChainsawIcons.WINDOW_ICON).getImage());
  @@ -322,7 +322,17 @@
                 LogPanel logPanel = getCurrentLogPanel();
   
                 if (logPanel != null) {
  -                logPanel.undock();
  +                if ((e.getModifiers() & InputEvent.CTRL_MASK) > 0) {
  +                  synchronized (tableModelMap) {
  +                    logPanel.clearModel();
  +                    tableModelMap.remove(logPanel.getIdentifier());
  +					tabbedPane.removeTabAt(tabIndex);
  +
  +//					TODO should also tidy up any other references to things... Might need to be able
to recover this pane again...
  +                  }
  +                } else {
  +                  logPanel.undock();
  +                }
                 }
               }
             }
  @@ -617,7 +627,8 @@
         table = (JSortTable) tableMap.get(ident);
       } else {
         tableModel =
  -        new DefaultSortTableModel(new Vector(), new Vector(columnNames), eventType);
  +        new DefaultSortTableModel(
  +          new Vector(), new Vector(columnNames), eventType);
         map = new HashMap();
         table = new JSortTable(tableModel);
         scrollToBottom = new ScrollToBottom(true);
  @@ -633,7 +644,6 @@
             }
           });
   
  -      //        TODO Give thisPanel an opportunity to load a Profile
         ProfileManager.getInstance().configure(thisPanel);
   
         System.out.println("Creating tab " + ident);
  @@ -1459,14 +1469,17 @@
         while (tok.hasMoreElements()) {
           String element = (String) tok.nextElement();
           TableColumn column = (TableColumn) columnNameMap.get(element);
  -        if (column==null) {
  -        	System.out.println("loadsettings - column " + element + " not found in tablecolumnmap");
  +
  +        if (column == null) {
  +          System.out.println(
  +            "loadsettings - column " + element
  +            + " not found in tablecolumnmap");
           } else {
  -        System.out.println(
  -          "Moving column " + element + " from index " + column.getModelIndex()
  -          + " to index " + index++);
  -        sortedColumnList.add(column);
  -        table.removeColumn(column);
  +          System.out.println(
  +            "Moving column " + element + " from index "
  +            + column.getModelIndex() + " to index " + index++);
  +          sortedColumnList.add(column);
  +          table.removeColumn(column);
           }
         }
   
  @@ -1487,11 +1500,15 @@
   
           try {
             int width = Integer.parseInt(element);
  -          if (index > columnModel.getColumnCount() - 1) {
  -          	System.out.println("loadsettings - failed attempt to set width for index " +
index + ", width " + element);
  +
  +          if (index > (columnModel.getColumnCount() - 1)) {
  +            System.out.println(
  +              "loadsettings - failed attempt to set width for index " + index
  +              + ", width " + element);
             } else {
  -	          columnModel.getColumn(index).setPreferredWidth(width);
  +            columnModel.getColumn(index).setPreferredWidth(width);
             }
  +
             index++;
           } catch (NumberFormatException e) {
             LogLog.error("Error decoding a Table width", e);
  
  
  

---------------------------------------------------------------------
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