added annotate command node view.. BLD200203070100
authormkleint@netbeans.org
Wed, 06 Mar 2002 13:44:14 +0000
changeset 2086937968378db9
parent 2085 83adcac047ad
child 2087 f8ebca3826b6
added annotate command node view..
vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateInfoPanel.form
vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateInfoPanel.java
vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateTreeInfoPanel.java
vcscore/src/org/netbeans/modules/vcscore/ui/views/types/Bundle.properties
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateInfoPanel.form	Wed Mar 06 13:44:14 2002 +0000
     1.3 @@ -0,0 +1,114 @@
     1.4 +<?xml version="1.0" encoding="UTF-8" ?>
     1.5 +
     1.6 +<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
     1.7 +  <SyntheticProperties>
     1.8 +    <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
     1.9 +  </SyntheticProperties>
    1.10 +
    1.11 +  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
    1.12 +  <SubComponents>
    1.13 +    <Container class="javax.swing.JPanel" name="pnlHead">
    1.14 +      <Constraints>
    1.15 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.16 +          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
    1.17 +        </Constraint>
    1.18 +      </Constraints>
    1.19 +
    1.20 +      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
    1.21 +      <SubComponents>
    1.22 +        <Component class="javax.swing.JLabel" name="lblWorkFile">
    1.23 +          <Properties>
    1.24 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    1.25 +              <ResourceString bundle="org/netbeans/modules/vcscore/ui/Bundle.properties" key="AnnotateInfoPanel.lblWorkFile.text" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
    1.26 +            </Property>
    1.27 +            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
    1.28 +              <Connection component="txWorkFile" type="bean"/>
    1.29 +            </Property>
    1.30 +          </Properties>
    1.31 +          <Constraints>
    1.32 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.33 +              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" insetsBottom="5" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
    1.34 +            </Constraint>
    1.35 +          </Constraints>
    1.36 +        </Component>
    1.37 +        <Component class="javax.swing.JTextField" name="txWorkFile">
    1.38 +          <Properties>
    1.39 +            <Property name="editable" type="boolean" value="false"/>
    1.40 +            <Property name="text" type="java.lang.String" value="jTextField1"/>
    1.41 +            <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
    1.42 +              <Dimension value="[250, 21]"/>
    1.43 +            </Property>
    1.44 +          </Properties>
    1.45 +          <Constraints>
    1.46 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.47 +              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="2" gridHeight="1" fill="2" ipadX="1" ipadY="0" insetsTop="12" insetsLeft="6" insetsBottom="5" insetsRight="11" anchor="17" weightX="1.0" weightY="0.0"/>
    1.48 +            </Constraint>
    1.49 +          </Constraints>
    1.50 +        </Component>
    1.51 +        <Component class="javax.swing.JComboBox" name="cbRevisionList">
    1.52 +
    1.53 +          <Events>
    1.54 +            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbRevisionListActionPerformed"/>
    1.55 +          </Events>
    1.56 +          <Constraints>
    1.57 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.58 +              <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="11" anchor="17" weightX="0.0" weightY="0.0"/>
    1.59 +            </Constraint>
    1.60 +          </Constraints>
    1.61 +        </Component>
    1.62 +        <Component class="javax.swing.JComboBox" name="cbAuthorList">
    1.63 +
    1.64 +          <Events>
    1.65 +            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbAuthorListActionPerformed"/>
    1.66 +          </Events>
    1.67 +          <Constraints>
    1.68 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.69 +              <GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="12" insetsRight="11" anchor="17" weightX="0.0" weightY="0.0"/>
    1.70 +            </Constraint>
    1.71 +          </Constraints>
    1.72 +        </Component>
    1.73 +        <Component class="javax.swing.JLabel" name="lblRevision">
    1.74 +          <Properties>
    1.75 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    1.76 +              <ResourceString bundle="org/netbeans/modules/vcscore/ui/Bundle.properties" key="AnnotatePanel.lblRevision.text" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
    1.77 +            </Property>
    1.78 +            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
    1.79 +              <Connection component="cbRevisionRange" type="bean"/>
    1.80 +            </Property>
    1.81 +          </Properties>
    1.82 +          <Constraints>
    1.83 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.84 +              <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="2" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
    1.85 +            </Constraint>
    1.86 +          </Constraints>
    1.87 +        </Component>
    1.88 +        <Component class="javax.swing.JLabel" name="lblAuthor">
    1.89 +          <Properties>
    1.90 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    1.91 +              <ResourceString bundle="org/netbeans/modules/vcscore/ui/Bundle.properties" key="AnnotatePanel.lblAuthor" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
    1.92 +            </Property>
    1.93 +            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
    1.94 +              <Connection component="cbAuthorList" type="bean"/>
    1.95 +            </Property>
    1.96 +          </Properties>
    1.97 +          <Constraints>
    1.98 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
    1.99 +              <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="12" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
   1.100 +            </Constraint>
   1.101 +          </Constraints>
   1.102 +        </Component>
   1.103 +        <Component class="javax.swing.JComboBox" name="cbRevisionRange">
   1.104 +
   1.105 +          <Events>
   1.106 +            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbRevisionRangeActionPerformed"/>
   1.107 +          </Events>
   1.108 +          <Constraints>
   1.109 +            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   1.110 +              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
   1.111 +            </Constraint>
   1.112 +          </Constraints>
   1.113 +        </Component>
   1.114 +      </SubComponents>
   1.115 +    </Container>
   1.116 +  </SubComponents>
   1.117 +</Form>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateInfoPanel.java	Wed Mar 06 13:44:14 2002 +0000
     2.3 @@ -0,0 +1,525 @@
     2.4 +/*
     2.5 + *                 Sun Public License Notice
     2.6 + *
     2.7 + * The contents of this file are subject to the Sun Public License
     2.8 + * Version 1.0 (the "License"). You may not use this file except in
     2.9 + * compliance with the License. A copy of the License is available at
    2.10 + * http://www.sun.com/
    2.11 + *
    2.12 + * The Original Code is NetBeans. The Initial Developer of the Original
    2.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
    2.14 + * Microsystems, Inc. All Rights Reserved.
    2.15 + */
    2.16 +
    2.17 +package org.netbeans.modules.vcscore.ui.views.types;
    2.18 +
    2.19 +/**
    2.20 + *
    2.21 + * @author  mkleint
    2.22 + */
    2.23 +
    2.24 +import org.openide.util.*;
    2.25 +import java.util.*;
    2.26 +import java.io.File;
    2.27 +import javax.swing.event.*;
    2.28 +import javax.swing.*;
    2.29 +import javax.swing.table.DefaultTableCellRenderer;
    2.30 +import javax.swing.table.TableCellRenderer;
    2.31 +import javax.swing.table.TableColumnModel;
    2.32 +import javax.swing.table.TableColumn;
    2.33 +import javax.swing.table.DefaultTableColumnModel;
    2.34 +
    2.35 +import java.awt.GridBagConstraints;
    2.36 +import java.awt.event.*;
    2.37 +import java.awt.Dimension;
    2.38 +import java.lang.reflect.Method;
    2.39 +import org.netbeans.modules.vcscore.util.table.*;
    2.40 +import org.netbeans.modules.vcscore.ui.views.*;
    2.41 +
    2.42 +import org.openide.nodes.*;
    2.43 +
    2.44 +public class AnnotateInfoPanel extends SingleNodeView {
    2.45 +
    2.46 +    public static final String ANNOTATIONS_LIST = "ANNOTATIONS_LIST"; //NOI18N
    2.47 +    public static final String ANNOT_CONTENT = "ANNOT_CONTENT"; //NOI18N
    2.48 +    public static final String ANNOT_DATE_STRING = "ANNOT_DATE_STRING"; //NOI18N
    2.49 +    public static final String ANNOT_AUTHOR = "ANNOT_AUTHOR"; //NOI18N
    2.50 +    public static final String ANNOT_REVISION = "ANNOT_REVISION"; //NOI18N
    2.51 +    public static final String ANNOT_LINE_NUMBER = "ANNOT_LINE_NUMBER"; //NOI18N
    2.52 +    
    2.53 +    public static final String TYPE ="ANNOTATE"; //NOI18N
    2.54 +    
    2.55 +    private TableInfoModel modAnnotations = null;
    2.56 +    
    2.57 +    private static final int REVISION_COLUMN = 1;
    2.58 +    private static final int AUTHOR_COLUMN = 2;
    2.59 +    private static final java.awt.Color colorBoth = new java.awt.Color(255, 160, 180);
    2.60 +    private static final java.awt.Color colorRev = new java.awt.Color(180, 255, 180);
    2.61 +    private static final java.awt.Color colorAuth = new java.awt.Color(160, 200, 255);
    2.62 + 
    2.63 +    private FileVcsInfo currentInfo;
    2.64 +    private FileVcsInfo clearInfo;
    2.65 +    
    2.66 +    
    2.67 +    /** Creates new form AnnotatenfoPanel */
    2.68 +    DefaultComboBoxModel revModel;
    2.69 +    DefaultComboBoxModel authModel;
    2.70 +    String noRevisionSelected;
    2.71 +    String noAuthorSelected;
    2.72 +    List revSet;
    2.73 +    List authSet;
    2.74 +    TableView tblAnnotat;
    2.75 +    
    2.76 +    public AnnotateInfoPanel() {
    2.77 +        initComponents ();
    2.78 +        setPreferredSize(new java.awt.Dimension(750, 400));
    2.79 +        setMinimumSize(new java.awt.Dimension(750, 400));          
    2.80 +/*        tblAnnotat.setShowGrid(false);
    2.81 +        tblAnnotat.setBorder(null);
    2.82 +        tblAnnotat.setRowSelectionAllowed(true);
    2.83 +        tblAnnotat.setShowHorizontalLines(false);
    2.84 +        tblAnnotat.setShowVerticalLines(false);
    2.85 +        //tblAnnotat.setSelectionBackground(selectionBackground
    2.86 +        tblAnnotat.setIntercellSpacing(new Dimension(0, 0));
    2.87 + */
    2.88 +        
    2.89 +        java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    2.90 +        gridBagConstraints.gridx = 0;
    2.91 +        gridBagConstraints.gridy = 1;
    2.92 +        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    2.93 +        gridBagConstraints.ipady = 26;
    2.94 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    2.95 +        gridBagConstraints.weightx = 0.5;
    2.96 +        gridBagConstraints.weighty = 0.5;
    2.97 +        gridBagConstraints.insets = new java.awt.Insets(0, 12, 11, 11);
    2.98 +        modAnnotations = createModel();
    2.99 +        tblAnnotat = new AnnotateTableView(ANNOTATIONS_LIST, modAnnotations);
   2.100 +        tblAnnotat.setColumnModel(createColumnModel());
   2.101 +        add(tblAnnotat, gridBagConstraints);
   2.102 +        
   2.103 +        revModel = new DefaultComboBoxModel();
   2.104 +        authModel = new DefaultComboBoxModel();
   2.105 +        noRevisionSelected = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.noRevisionSelected");
   2.106 +        noAuthorSelected = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.noAuthorSelected");
   2.107 +        revSet = new LinkedList();
   2.108 +        authModel.addElement(noAuthorSelected);
   2.109 +        authSet = new LinkedList();
   2.110 +        cbRevisionList.setModel(revModel);
   2.111 +        cbAuthorList.setModel(authModel);
   2.112 +        String bigger = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.biggerThan");
   2.113 +        String smaller = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.smallerThan");
   2.114 +        String equals = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.equals");
   2.115 +        cbRevisionRange.setModel(new DefaultComboBoxModel(new Object[] {equals, bigger, smaller}));
   2.116 + 
   2.117 +        lblWorkFile.setDisplayedMnemonic(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.lblWorkFile.Mnem").charAt(0));
   2.118 +        lblRevision.setDisplayedMnemonic(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.lblRevision.Mnem").charAt(0));
   2.119 +        lblAuthor.setDisplayedMnemonic(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.lblAuthor.Mnem").charAt(0));
   2.120 +        txWorkFile.addFocusListener(new java.awt.event.FocusListener() {
   2.121 +            public void focusGained(java.awt.event.FocusEvent e) {
   2.122 +                txWorkFile.selectAll();
   2.123 +            }
   2.124 +            public void focusLost(java.awt.event.FocusEvent e) {
   2.125 +                txWorkFile.select(1,1);
   2.126 +            }
   2.127 +        }); 
   2.128 +        txWorkFile.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSD_AnnotatePanel.txWorkFile"));
   2.129 +//        spAnnotat.getAccessibleContext().setAccessibleName(NbBundle.getBundle(AnnotatePanel.class).getString("ACSN_AnnotatePanel.spAnnotat"));
   2.130 +//        spAnnotat.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotatePanel.class).getString("ACSD_AnnotatePanel.spAnnotat"));
   2.131 +        cbRevisionRange.getAccessibleContext().setAccessibleName(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSN_AnnotatePanel.cbRevisionRange"));
   2.132 +        cbRevisionRange.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSD_AnnotatePanel.cbRevisionRange"));
   2.133 +        cbRevisionList.getAccessibleContext().setAccessibleName(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSN_AnnotatePanel.cbRevisionList"));
   2.134 +        cbRevisionList.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSD_AnnotatePanel.cbRevisionList"));
   2.135 +        cbAuthorList.getAccessibleContext().setAccessibleName(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSN_AnnotatePanel.cbAuthorList"));
   2.136 +        cbAuthorList.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSD_AnnotatePanel.cbAuthorList"));
   2.137 +        this.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AnnotateInfoPanel.class).getString("ACSD_AnnotatePanel"));
   2.138 +        
   2.139 +        
   2.140 +        initClearInfo();
   2.141 +   }
   2.142 +    
   2.143 +    private void initClearInfo() {
   2.144 +        clearInfo = FileVcsInfoFactory.createBlankFileVcsInfo(AnnotateInfoPanel.TYPE, new File(""));
   2.145 +    }
   2.146 +    
   2.147 +    /** This method is called from within the constructor to
   2.148 +     * initialize the form.
   2.149 +     * WARNING: Do NOT modify this code. The content of this method is
   2.150 +     * always regenerated by the FormEditor.
   2.151 +     */
   2.152 +    private void initComponents() {//GEN-BEGIN:initComponents
   2.153 +        java.awt.GridBagConstraints gridBagConstraints;
   2.154 +
   2.155 +        pnlHead = new javax.swing.JPanel();
   2.156 +        lblWorkFile = new javax.swing.JLabel();
   2.157 +        txWorkFile = new javax.swing.JTextField();
   2.158 +        cbRevisionList = new javax.swing.JComboBox();
   2.159 +        cbAuthorList = new javax.swing.JComboBox();
   2.160 +        lblRevision = new javax.swing.JLabel();
   2.161 +        lblAuthor = new javax.swing.JLabel();
   2.162 +        cbRevisionRange = new javax.swing.JComboBox();
   2.163 +
   2.164 +        setLayout(new java.awt.GridBagLayout());
   2.165 +
   2.166 +        pnlHead.setLayout(new java.awt.GridBagLayout());
   2.167 +
   2.168 +        lblWorkFile.setText(org.openide.util.NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.lblWorkFile.text"));
   2.169 +        lblWorkFile.setLabelFor(txWorkFile);
   2.170 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.171 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.172 +        gridBagConstraints.insets = new java.awt.Insets(12, 12, 5, 0);
   2.173 +        pnlHead.add(lblWorkFile, gridBagConstraints);
   2.174 +
   2.175 +        txWorkFile.setEditable(false);
   2.176 +        txWorkFile.setText("jTextField1");
   2.177 +        txWorkFile.setPreferredSize(new java.awt.Dimension(250, 21));
   2.178 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.179 +        gridBagConstraints.gridwidth = 2;
   2.180 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
   2.181 +        gridBagConstraints.ipadx = 1;
   2.182 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.183 +        gridBagConstraints.weightx = 1.0;
   2.184 +        gridBagConstraints.insets = new java.awt.Insets(12, 6, 5, 11);
   2.185 +        pnlHead.add(txWorkFile, gridBagConstraints);
   2.186 +
   2.187 +        cbRevisionList.addActionListener(new java.awt.event.ActionListener() {
   2.188 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
   2.189 +                cbRevisionListActionPerformed(evt);
   2.190 +            }
   2.191 +        });
   2.192 +
   2.193 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.194 +        gridBagConstraints.gridx = 2;
   2.195 +        gridBagConstraints.gridy = 1;
   2.196 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.197 +        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 11);
   2.198 +        pnlHead.add(cbRevisionList, gridBagConstraints);
   2.199 +
   2.200 +        cbAuthorList.addActionListener(new java.awt.event.ActionListener() {
   2.201 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
   2.202 +                cbAuthorListActionPerformed(evt);
   2.203 +            }
   2.204 +        });
   2.205 +
   2.206 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.207 +        gridBagConstraints.gridx = 2;
   2.208 +        gridBagConstraints.gridy = 2;
   2.209 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.210 +        gridBagConstraints.insets = new java.awt.Insets(0, 6, 12, 11);
   2.211 +        pnlHead.add(cbAuthorList, gridBagConstraints);
   2.212 +
   2.213 +        lblRevision.setText(org.openide.util.NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.lblRevision.text"));
   2.214 +        lblRevision.setLabelFor(cbRevisionRange);
   2.215 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.216 +        gridBagConstraints.gridx = 0;
   2.217 +        gridBagConstraints.gridy = 1;
   2.218 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.219 +        gridBagConstraints.insets = new java.awt.Insets(0, 12, 2, 0);
   2.220 +        pnlHead.add(lblRevision, gridBagConstraints);
   2.221 +
   2.222 +        lblAuthor.setText(org.openide.util.NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotatePanel.lblAuthor"));
   2.223 +        lblAuthor.setLabelFor(cbAuthorList);
   2.224 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.225 +        gridBagConstraints.gridx = 0;
   2.226 +        gridBagConstraints.gridy = 2;
   2.227 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.228 +        gridBagConstraints.insets = new java.awt.Insets(0, 12, 12, 0);
   2.229 +        pnlHead.add(lblAuthor, gridBagConstraints);
   2.230 +
   2.231 +        cbRevisionRange.addActionListener(new java.awt.event.ActionListener() {
   2.232 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
   2.233 +                cbRevisionRangeActionPerformed(evt);
   2.234 +            }
   2.235 +        });
   2.236 +
   2.237 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.238 +        gridBagConstraints.gridx = 1;
   2.239 +        gridBagConstraints.gridy = 1;
   2.240 +        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
   2.241 +        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
   2.242 +        pnlHead.add(cbRevisionRange, gridBagConstraints);
   2.243 +
   2.244 +        gridBagConstraints = new java.awt.GridBagConstraints();
   2.245 +        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
   2.246 +        add(pnlHead, gridBagConstraints);
   2.247 +
   2.248 +    }//GEN-END:initComponents
   2.249 +
   2.250 +    private void cbRevisionRangeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbRevisionRangeActionPerformed
   2.251 +        // Add your handling code here:
   2.252 +//        tblAnnotat.revalidate();
   2.253 +        tblAnnotat.repaint();
   2.254 +    }//GEN-LAST:event_cbRevisionRangeActionPerformed
   2.255 +
   2.256 +    private void cbRevisionListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbRevisionListActionPerformed
   2.257 +        // Add your handling code here:        
   2.258 +        tblAnnotat.repaint();
   2.259 +//        tblAnnotat.revalidate();
   2.260 +    }//GEN-LAST:event_cbRevisionListActionPerformed
   2.261 +
   2.262 +    private void cbAuthorListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAuthorListActionPerformed
   2.263 +        // Add your handling code here:
   2.264 +//        tblAnnotat.tableChanged(new TableModelEvent(modAnnotations));
   2.265 +        tblAnnotat.repaint();
   2.266 +    }//GEN-LAST:event_cbAuthorListActionPerformed
   2.267 +    
   2.268 +  private void lstSymNamesValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lstSymNamesValueChanged
   2.269 +  }//GEN-LAST:event_lstSymNamesValueChanged
   2.270 +  
   2.271 +  
   2.272 +    // Variables declaration - do not modify//GEN-BEGIN:variables
   2.273 +    private javax.swing.JLabel lblRevision;
   2.274 +    private javax.swing.JPanel pnlHead;
   2.275 +    private javax.swing.JLabel lblAuthor;
   2.276 +    private javax.swing.JComboBox cbRevisionList;
   2.277 +    private javax.swing.JTextField txWorkFile;
   2.278 +    private javax.swing.JComboBox cbAuthorList;
   2.279 +    private javax.swing.JComboBox cbRevisionRange;
   2.280 +    private javax.swing.JLabel lblWorkFile;
   2.281 +    // End of variables declaration//GEN-END:variables
   2.282 +
   2.283 +    private static final long serialVersionUID = -2618655204542546204L;    
   2.284 +
   2.285 +  private TableColumnModel createColumnModel() {
   2.286 +      TableColumnModel model = new DefaultTableColumnModel();
   2.287 +      // linenum
   2.288 +      TableCellRenderer colorRenderer = new ColoringUpdateRenderer();
   2.289 +      TableColumn col = new TableColumn();
   2.290 +      col.setIdentifier("LineNum"); //NOI18N
   2.291 +      col.setModelIndex(0);
   2.292 +      col.setHeaderValue(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.LineNumColumn"));
   2.293 +      col.setMaxWidth(100);
   2.294 +      col.setMinWidth(50);
   2.295 +      col.setPreferredWidth(50);
   2.296 +      col.setCellRenderer(colorRenderer);
   2.297 +      model.addColumn(col);
   2.298 +      // revision
   2.299 +      col = new TableColumn();
   2.300 +      col.setIdentifier("Revision"); //NOI18N
   2.301 +      col.setModelIndex(1);
   2.302 +      col.setHeaderValue(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.RevisionColumn"));
   2.303 +      col.setMaxWidth(100);
   2.304 +      col.setMinWidth(50);
   2.305 +      col.setPreferredWidth(50);
   2.306 +      col.setCellRenderer(colorRenderer);
   2.307 +      model.addColumn(col);
   2.308 +      // author
   2.309 +      col = new TableColumn();
   2.310 +      col.setIdentifier("Author"); //NOI18N
   2.311 +      col.setModelIndex(2);
   2.312 +      col.setHeaderValue(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.AuthorColumn"));
   2.313 +      col.setMaxWidth(150);
   2.314 +      col.setMinWidth(50);
   2.315 +      col.setPreferredWidth(75);
   2.316 +      col.setCellRenderer(colorRenderer);
   2.317 +      model.addColumn(col);
   2.318 +      // date
   2.319 +      col = new TableColumn();
   2.320 +      col.setIdentifier("Date"); //NOI18N
   2.321 +      col.setModelIndex(3);
   2.322 +      col.setHeaderValue(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.DateColumn"));
   2.323 +      col.setMaxWidth(120);
   2.324 +      col.setMinWidth(10);
   2.325 +      col.setPreferredWidth(80);
   2.326 +      col.setCellRenderer(colorRenderer);
   2.327 +      model.addColumn(col);
   2.328 +      // message
   2.329 +      col = new TableColumn();
   2.330 +      col.setIdentifier("Text"); //NOI18N
   2.331 +      col.setModelIndex(4);
   2.332 +      col.setHeaderValue(NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.TextColumn"));
   2.333 +      col.setMaxWidth(500);
   2.334 +      col.setMinWidth(50);
   2.335 +      col.setPreferredWidth(200);
   2.336 +      col.setCellRenderer(colorRenderer);
   2.337 +      model.addColumn(col);
   2.338 +      return model;
   2.339 +  }        
   2.340 +    
   2.341 +  private TableInfoModel createModel() {
   2.342 +      TableInfoModel modAnnotations = new TableInfoModel();
   2.343 +      Class classa = FileVcsInfo.CompositeItem.class;
   2.344 +      String label0 = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.LineNumColumn");
   2.345 +      String label1 = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.AuthorColumn");
   2.346 +      String label2 = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.RevisionColumn");
   2.347 +      String label3 = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.DateColumn");
   2.348 +      String label4 = NbBundle.getBundle(AnnotateInfoPanel.class).getString("AnnotateInfoPanel.TextColumn");
   2.349 +        try {
   2.350 +            Method method1 = classa.getMethod("getAttribute", new Class[] {String.class}); // NOI18N
   2.351 +            Method method2 = classa.getMethod("getAttributeNonNull", new Class[] {String.class}); // NOI18N
   2.352 +            modAnnotations.setColumnDefinition(0, label0, method1, new Object[] { ANNOT_LINE_NUMBER }, true, new IntegerComparator());
   2.353 +            modAnnotations.setColumnDefinition(1, label1, method2, new Object[] { ANNOT_REVISION }, true, new RevisionComparator());
   2.354 +            modAnnotations.setColumnDefinition(2, label2, method2, new Object[] { ANNOT_AUTHOR }, true, null);
   2.355 +            modAnnotations.setColumnDefinition(3, label3, method2, new Object[] { ANNOT_DATE_STRING }, true, new DateComparator());
   2.356 +            modAnnotations.setColumnDefinition(4, label4, method2, new Object[] { ANNOT_CONTENT }, false, null);
   2.357 +        } catch (NoSuchMethodException exc) {
   2.358 +            Thread.dumpStack();
   2.359 +        } catch (SecurityException exc2) {
   2.360 +            Thread.dumpStack();
   2.361 +        }
   2.362 +      return modAnnotations;
   2.363 +  }
   2.364 +  
   2.365 +  private void setComboModel(List list, DefaultComboBoxModel model) {
   2.366 +      model.removeAllElements();
   2.367 +      Iterator it = list.iterator();
   2.368 +      while (it.hasNext()) {
   2.369 +          model.addElement(it.next());
   2.370 +      }
   2.371 +  }
   2.372 +
   2.373 +  
   2.374 +   private void setData(FileVcsInfo info) {
   2.375 +        currentInfo = info;
   2.376 +        if (info.getFile() != null) {
   2.377 +            txWorkFile.setText(info.getFile().getAbsolutePath());
   2.378 +        } else {
   2.379 +            txWorkFile.setText("");
   2.380 +        }
   2.381 +        FileVcsInfo.Composite comp = (FileVcsInfo.Composite)info.getAttribute(ANNOTATIONS_LIST);
   2.382 +        revSet.clear();
   2.383 +        authSet.clear();
   2.384 +        if (comp != null) {
   2.385 +            for (int i = 0; i < comp.getCount(); i++) {
   2.386 +                FileVcsInfo.CompositeItem item = comp.getRow(i);
   2.387 +                String rev = (String)item.getAttribute(ANNOT_REVISION);
   2.388 +                String auth = (String)item.getAttribute(ANNOT_AUTHOR);
   2.389 +                if (rev != null && (!revSet.contains(rev))) {
   2.390 +                    revSet.add(rev);
   2.391 +                }
   2.392 +                if (auth != null && (!authSet.contains(auth))) {
   2.393 +                    authSet.add(auth);
   2.394 +                }
   2.395 +            }
   2.396 +            Collections.sort(revSet, new RevisionComparator());
   2.397 +            Collections.sort(authSet);
   2.398 +            revSet.add(0, this.noRevisionSelected);
   2.399 +            authSet.add(0, this.noAuthorSelected);
   2.400 +            
   2.401 +        } else {
   2.402 +            revSet.add(this.noRevisionSelected);
   2.403 +            authSet.add(this.noAuthorSelected);
   2.404 +        }
   2.405 +        setComboModel(revSet, revModel);
   2.406 +        setComboModel(authSet, authModel);
   2.407 +    }
   2.408 +
   2.409 +  
   2.410 +  /**
   2.411 +   * Overriding the SingleNodeView method, to refresh the display
   2.412 +   */
   2.413 +  public void setContextNode(Node node) {
   2.414 +      super.setContextNode(node);
   2.415 +      Node infoNode = getContextNode();
   2.416 +      if (infoNode != null) {
   2.417 +          FileVcsInfo info = (FileVcsInfo)infoNode.getCookie(FileVcsInfo.class);
   2.418 +          if (info != null && info.getType().equals(TYPE)) {
   2.419 +              setData(info);
   2.420 +          } else {
   2.421 +              setData(clearInfo);
   2.422 +          }
   2.423 +      } else {
   2.424 +          setData(clearInfo);
   2.425 +      }
   2.426 +  }  
   2.427 +  
   2.428 +  boolean matchesAuthor(String author) {
   2.429 +      if (cbAuthorList.getSelectedIndex() != 0) {
   2.430 +          if (author.equals(cbAuthorList.getSelectedItem())) {
   2.431 +              return true;
   2.432 +          }
   2.433 +      }
   2.434 +      return false;
   2.435 +  }
   2.436 +  
   2.437 +  boolean matchesRevision(String revision) {
   2.438 +      if (cbRevisionList.getSelectedIndex() != 0) {
   2.439 +          TableInfoComparator comp = new RevisionComparator();
   2.440 +          int result = comp.compare(revision, cbRevisionList.getSelectedItem());
   2.441 +          if (result == 0 && cbRevisionRange.getSelectedIndex() == 0) {
   2.442 +              return true;
   2.443 +          }
   2.444 +          if (result == 1 && cbRevisionRange.getSelectedIndex() == 1) {
   2.445 +              return true;
   2.446 +          }
   2.447 +          if (result == -1 && cbRevisionRange.getSelectedIndex() == 2) {
   2.448 +              return true;
   2.449 +          }
   2.450 +      }
   2.451 +      return false;
   2.452 +  }
   2.453 +  
   2.454 +  /**
   2.455 +   * Utility method for fine-tuning of the table display.
   2.456 +   */
   2.457 +  
   2.458 +  /*
   2.459 +   public JTable getTableComponent() {
   2.460 +      return tblAnnotat;
   2.461 +  }
   2.462 +   */
   2.463 +  
   2.464 +   private class ColoringUpdateRenderer extends DefaultTableCellRenderer {
   2.465 +
   2.466 +       // a workaround because of bugparade issue : 4336152
   2.467 +        private java.awt.Color almostWhite = new java.awt.Color(254,254,254);  
   2.468 +       
   2.469 +        private static final long serialVersionUID = -8634243127049172822L;
   2.470 +        
   2.471 +        public ColoringUpdateRenderer() {
   2.472 +            super();
   2.473 +//            setOpaque(true);
   2.474 +        }
   2.475 +        
   2.476 +        public java.awt.Component getTableCellRendererComponent(javax.swing.JTable jTable, java.lang.Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
   2.477 +            java.awt.Component retValue;
   2.478 +            
   2.479 +            retValue = super.getTableCellRendererComponent(jTable, obj, isSelected, hasFocus, row, column);
   2.480 +
   2.481 +            if (isSelected) return retValue;
   2.482 +            String auth = AnnotateInfoPanel.this.modAnnotations.getValueAt(row, AnnotateInfoPanel.AUTHOR_COLUMN).toString();
   2.483 +            String rev = AnnotateInfoPanel.this.modAnnotations.getValueAt(row, AnnotateInfoPanel.REVISION_COLUMN).toString();
   2.484 +            boolean matchesAuthor = AnnotateInfoPanel.this.matchesAuthor(auth);
   2.485 +            boolean matchesRevision = AnnotateInfoPanel.this.matchesRevision(rev);
   2.486 +            if (matchesAuthor && matchesRevision) {
   2.487 +                retValue.setBackground(colorBoth);
   2.488 +                return retValue;
   2.489 +            }
   2.490 +            if (matchesAuthor) {
   2.491 +                retValue.setBackground(colorAuth);
   2.492 +                return retValue;
   2.493 +            }
   2.494 +            if (matchesRevision) {
   2.495 +                retValue.setBackground(colorRev);
   2.496 +                return retValue;
   2.497 +            } 
   2.498 +            
   2.499 +            retValue.setBackground(almostWhite);
   2.500 +            return retValue;
   2.501 +        }
   2.502 +        
   2.503 +    }  
   2.504 +   
   2.505 +   
   2.506 +   public static class AnnotateTableView extends TableView {
   2.507 +    
   2.508 +      public AnnotateTableView(String compositeAttributeName, TableInfoModel model) {
   2.509 +          super(compositeAttributeName, model);
   2.510 +      }
   2.511 +       
   2.512 +       /** Creates the list that will display the data.
   2.513 +        */
   2.514 +       protected JTable createTable() {
   2.515 +           JTable retValue;
   2.516 +           retValue = super.createTable();
   2.517 +           retValue.setShowGrid(false);
   2.518 +           retValue.setBorder(null);
   2.519 +           retValue.setRowSelectionAllowed(true);
   2.520 +           retValue.setShowHorizontalLines(false);
   2.521 +           retValue.setShowVerticalLines(false);
   2.522 +           //retValue.setSelectionBackground(selectionBackground
   2.523 +           retValue.setIntercellSpacing(new Dimension(0, 0));
   2.524 +           return retValue;
   2.525 +       }
   2.526 +       
   2.527 +   }
   2.528 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/ui/views/types/AnnotateTreeInfoPanel.java	Wed Mar 06 13:44:14 2002 +0000
     3.3 @@ -0,0 +1,51 @@
     3.4 +/*
     3.5 + *                 Sun Public License Notice
     3.6 + *
     3.7 + * The contents of this file are subject to the Sun Public License
     3.8 + * Version 1.0 (the "License"). You may not use this file except in
     3.9 + * compliance with the License. A copy of the License is available at
    3.10 + * http://www.sun.com/
    3.11 + *
    3.12 + * The Original Code is NetBeans. The Initial Developer of the Original
    3.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
    3.14 + * Microsystems, Inc. All Rights Reserved.
    3.15 + */
    3.16 +
    3.17 +package org.netbeans.modules.vcscore.ui.views.types;
    3.18 +
    3.19 +
    3.20 +import java.io.*;
    3.21 +import java.util.*;
    3.22 +import javax.swing.*;
    3.23 +import java.awt.event.*;
    3.24 +
    3.25 +import org.openide.util.*;
    3.26 +import org.openide.explorer.*;
    3.27 +
    3.28 +
    3.29 +import org.netbeans.modules.vcscore.ui.views.*;
    3.30 +
    3.31 +/**
    3.32 + *
    3.33 + * @author  mkleint
    3.34 + * @version
    3.35 + */
    3.36 +public class AnnotateTreeInfoPanel extends AbstractTreeInfoPanel  {
    3.37 +    
    3.38 +    private AnnotateInfoPanel panel;
    3.39 +    /** Creates new form StatusTreeInfoPanel */
    3.40 +    public AnnotateTreeInfoPanel() {
    3.41 +        super();
    3.42 +//        initPanelComponents();
    3.43 +        postInit();
    3.44 + //       recreateModel();
    3.45 +    }
    3.46 +    
    3.47 +    
    3.48 +    
    3.49 +  protected JComponent initPanel() {
    3.50 +      panel = new AnnotateInfoPanel();
    3.51 +      return panel;
    3.52 +  }
    3.53 +  
    3.54 +}
     4.1 --- a/vcscore/src/org/netbeans/modules/vcscore/ui/views/types/Bundle.properties	Tue Mar 05 18:13:18 2002 +0000
     4.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/ui/views/types/Bundle.properties	Wed Mar 06 13:44:14 2002 +0000
     4.3 @@ -122,3 +122,30 @@
     4.4  ACSD_StatusInfoPanel=Results of CVS Status command.
     4.5  ACSD_StatusInfoPanel.txRepFile=n/a
     4.6  
     4.7 +AnnotateInfoPanel.AuthorColumn=Author
     4.8 +AnnotateInfoPanel.RevisionColumn=Revision
     4.9 +AnnotateInfoPanel.DateColumn=Date
    4.10 +AnnotateInfoPanel.TextColumn=Line
    4.11 +AnnotateInfoPanel.LineNumColumn=Line Num
    4.12 +AnnotatePanel.lblRevision.text=Filter Revision\:
    4.13 +AnnotatePanel.lblRevision.Mnem=R
    4.14 +AnnotatePanel.lblAuthor=Filter by Author\:
    4.15 +AnnotatePanel.lblAuthor.Mnem=A
    4.16 +AnnotateInfoPanel.lblWorkFile.text=Filename\:
    4.17 +AnnotateInfoPanel.lblWorkFile.Mnem=F
    4.18 +AnnotatePanel.noRevisionSelected=<No Revision Selected>
    4.19 +AnnotatePanel.noAuthorSelected=<No Author selected>
    4.20 +AnnotatePanel.biggerThan=Newer than
    4.21 +AnnotatePanel.smallerThan=Older than
    4.22 +AnnotatePanel.equals=Equals
    4.23 +ACSD_AnnotatePanel=Dialog for CVS output annotate
    4.24 +ACSN_AnnotatePanel.cbRevisionRange=Select relation
    4.25 +ACSD_AnnotatePanel.cbRevisionRange=N/A
    4.26 +ACSN_AnnotatePanel.cbRevisionList=Select revision
    4.27 +ACSD_AnnotatePanel.cbRevisionList=N/A
    4.28 +ACSN_AnnotatePanel.cbAuthorList=Select author
    4.29 +ACSD_AnnotatePanel.cbAuthorList=N/A
    4.30 +ACSD_AnnotatePanel.txWorkFile=N/A
    4.31 +ACSN_AnnotatePanel.spAnnotat=Result in annotate list
    4.32 +ACSD_AnnotatePanel.spAnnotat=N/A
    4.33 +