This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 64195
Collapse All | Expand All

(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/settings/HistorySettings.java (+11 lines)
Lines 48-53 Link Here
48
    public static final String PROP_SOCKS_PROXY_HOST = "socksProxyHost"; // NOI18N
48
    public static final String PROP_SOCKS_PROXY_HOST = "socksProxyHost"; // NOI18N
49
    public static final String PROP_SOCKS_PROXY_PORT = "socksProxyPort"; // NOI18N
49
    public static final String PROP_SOCKS_PROXY_PORT = "socksProxyPort"; // NOI18N
50
    
50
    
51
    /** Latest cvs messages */
52
    public static final String PROP_LATEST_COMMENTS="latestComments"; // NOI18N
53
    
51
    /** Creates new instance, for externalizion purposes only. */
54
    /** Creates new instance, for externalizion purposes only. */
52
    public HistorySettings() {        
55
    public HistorySettings() {        
53
    }
56
    }
Lines 128-133 Link Here
128
    
131
    
129
    public void setCvsRoots(List values) {
132
    public void setCvsRoots(List values) {
130
        setRecent(PROP_CVS_ROOTS, values);
133
        setRecent(PROP_CVS_ROOTS, values);
134
    }
135
    
136
    public List getLatestCommitMessages() {
137
        return getRecent(PROP_LATEST_COMMENTS);
138
    }
139
    
140
    public void setLatestCommitMessages(List values) {
141
        setRecent(PROP_LATEST_COMMENTS, values);
131
    }
142
    }
132
143
133
    public List getCheckoutDirectory() {
144
    public List getCheckoutDirectory() {
(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/settings/HistorySettingsBeanInfo.java (-4 / +6 lines)
Lines 37-56 Link Here
37
    private static final int PROPERTY_cvsRoots = 1;
37
    private static final int PROPERTY_cvsRoots = 1;
38
    private static final int PROPERTY_httpProxyHost = 2;
38
    private static final int PROPERTY_httpProxyHost = 2;
39
    private static final int PROPERTY_httpProxyPort = 3;
39
    private static final int PROPERTY_httpProxyPort = 3;
40
    private static final int PROPERTY_showCheckoutCompleted = 4;
40
    private static final int PROPERTY_latestCommitMessages = 4;
41
    private static final int PROPERTY_socksProxyHost = 5;
41
    private static final int PROPERTY_showCheckoutCompleted = 5;
42
    private static final int PROPERTY_socksProxyPort = 6;
42
    private static final int PROPERTY_socksProxyHost = 6;
43
    private static final int PROPERTY_socksProxyPort = 7;
43
44
44
    // Property array 
45
    // Property array 
45
    /*lazy PropertyDescriptor*/
46
    /*lazy PropertyDescriptor*/
46
    private static PropertyDescriptor[] getPdescriptor(){
47
    private static PropertyDescriptor[] getPdescriptor(){
47
        PropertyDescriptor[] properties = new PropertyDescriptor[7];
48
        PropertyDescriptor[] properties = new PropertyDescriptor[8];
48
    
49
    
49
        try {
50
        try {
50
            properties[PROPERTY_checkoutDirectory] = new PropertyDescriptor ( "checkoutDirectory", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getCheckoutDirectory", "setCheckoutDirectory" );
51
            properties[PROPERTY_checkoutDirectory] = new PropertyDescriptor ( "checkoutDirectory", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getCheckoutDirectory", "setCheckoutDirectory" );
51
            properties[PROPERTY_cvsRoots] = new PropertyDescriptor ( "cvsRoots", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getCvsRoots", "setCvsRoots" );
52
            properties[PROPERTY_cvsRoots] = new PropertyDescriptor ( "cvsRoots", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getCvsRoots", "setCvsRoots" );
52
            properties[PROPERTY_httpProxyHost] = new PropertyDescriptor ( "httpProxyHost", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getHttpProxyHost", "setHttpProxyHost" );
53
            properties[PROPERTY_httpProxyHost] = new PropertyDescriptor ( "httpProxyHost", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getHttpProxyHost", "setHttpProxyHost" );
53
            properties[PROPERTY_httpProxyPort] = new PropertyDescriptor ( "httpProxyPort", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getHttpProxyPort", "setHttpProxyPort" );
54
            properties[PROPERTY_httpProxyPort] = new PropertyDescriptor ( "httpProxyPort", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getHttpProxyPort", "setHttpProxyPort" );
55
            properties[PROPERTY_latestCommitMessages] = new PropertyDescriptor ( "latestCommitMessages", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getLatestCommitMessages", "setLatestCommitMessages" );
54
            properties[PROPERTY_showCheckoutCompleted] = new PropertyDescriptor ( "showCheckoutCompleted", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getShowCheckoutCompleted", "setShowCheckoutCompleted" );
56
            properties[PROPERTY_showCheckoutCompleted] = new PropertyDescriptor ( "showCheckoutCompleted", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getShowCheckoutCompleted", "setShowCheckoutCompleted" );
55
            properties[PROPERTY_socksProxyHost] = new PropertyDescriptor ( "socksProxyHost", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getSocksProxyHost", "setSocksProxyHost" );
57
            properties[PROPERTY_socksProxyHost] = new PropertyDescriptor ( "socksProxyHost", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getSocksProxyHost", "setSocksProxyHost" );
56
            properties[PROPERTY_socksProxyPort] = new PropertyDescriptor ( "socksProxyPort", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getSocksProxyPort", "setSocksProxyPort" );
58
            properties[PROPERTY_socksProxyPort] = new PropertyDescriptor ( "socksProxyPort", org.netbeans.modules.versioning.system.cvss.settings.HistorySettings.class, "getSocksProxyPort", "setSocksProxyPort" );
(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle.properties (+1 lines)
Lines 30-35 Link Here
30
CTL_CommitDialog_Title_Multi = {0} files
30
CTL_CommitDialog_Title_Multi = {0} files
31
31
32
CTL_CommitForm_Message=Commit &Message\:
32
CTL_CommitForm_Message=Commit &Message\:
33
CTL_CommitForm_PreviousMessage=-- previously entered message -- 
33
MNE_CommitForm_Message=M
34
MNE_CommitForm_Message=M
34
CTL_CommitForm_Locally=Run locally (-l)
35
CTL_CommitForm_Locally=Run locally (-l)
35
CTL_CommitForm_Revision=Commit to revision (-r)\:
36
CTL_CommitForm_Revision=Commit to revision (-r)\:
(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/commit/CommitAction.java (-1 / +8 lines)
Lines 13-18 Link Here
13
13
14
package org.netbeans.modules.versioning.system.cvss.ui.actions.commit;
14
package org.netbeans.modules.versioning.system.cvss.ui.actions.commit;
15
15
16
import org.netbeans.modules.versioning.system.cvss.settings.HistorySettings;
16
import org.openide.util.NbBundle;
17
import org.openide.util.NbBundle;
17
import org.openide.util.HelpCtx;
18
import org.openide.util.HelpCtx;
18
import org.openide.DialogDescriptor;
19
import org.openide.DialogDescriptor;
Lines 44-50 Link Here
44
 */
45
 */
45
public class CommitAction extends AbstractSystemAction {
46
public class CommitAction extends AbstractSystemAction {
46
    
47
    
47
    private static CommitCommand   commandTemplate = new CommitCommand();
48
    private static CommitCommand   commandTemplate = new CommitCommand() ;        
48
49
49
    public CommitAction() {
50
    public CommitAction() {
50
        setIcon(null);
51
        setIcon(null);
Lines 89-94 Link Here
89
        }
90
        }
90
        
91
        
91
        CommitCommand cmd = new CommitCommand();
92
        CommitCommand cmd = new CommitCommand();
93
                
92
        cmd.setDisplayName(NbBundle.getMessage(CommitAction.class, "BK0001"));
94
        cmd.setDisplayName(NbBundle.getMessage(CommitAction.class, "BK0001"));
93
        copy (cmd, commandTemplate);
95
        copy (cmd, commandTemplate);
94
        
96
        
Lines 120-125 Link Here
120
        dialog.setVisible(true);
122
        dialog.setVisible(true);
121
        if (descriptor.getValue() != commit) return;
123
        if (descriptor.getValue() != commit) return;
122
124
125
        String commitMessage = settings.getCommitMessage();
126
        
127
        if (commitMessage.trim().length() != 0 ) {
128
            HistorySettings.addRecent(HistorySettings.PROP_LATEST_COMMENTS, settings.getCommitMessage());
129
        }
123
        settings.updateCommand(cmd);
130
        settings.updateCommand(cmd);
124
        copy(commandTemplate, cmd);
131
        copy(commandTemplate, cmd);
125
        cmd.setFiles(roots);
132
        cmd.setFiles(roots);
(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/commit/CommitSettings.form (-5 / +22 lines)
Lines 43-53 Link Here
43
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
43
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
44
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
44
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
45
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
45
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
46
    <AuxValue 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"/>
46
  </AuxValues>
47
  </AuxValues>
47
48
48
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
49
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
49
  <SubComponents>
50
  <SubComponents>
50
    <Component class="javax.swing.JLabel" name="jLabel2">
51
    <Component class="javax.swing.JLabel" name="messageLabel">
51
      <Properties>
52
      <Properties>
52
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
53
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
53
          <ComponentRef name="taMessage"/>
54
          <ComponentRef name="taMessage"/>
Lines 70-76 Link Here
70
        </Constraint>
71
        </Constraint>
71
      </Constraints>
72
      </Constraints>
72
    </Component>
73
    </Component>
73
    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
74
    <Container class="javax.swing.JScrollPane" name="messageScroll">
74
      <Constraints>
75
      <Constraints>
75
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
76
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
76
          <GridBagConstraints gridX="0" gridY="1" gridWidth="0" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="1.0" weightY="0.0"/>
77
          <GridBagConstraints gridX="0" gridY="1" gridWidth="0" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="1.0" weightY="0.0"/>
Lines 90-96 Link Here
90
        </Component>
91
        </Component>
91
      </SubComponents>
92
      </SubComponents>
92
    </Container>
93
    </Container>
93
    <Component class="javax.swing.JLabel" name="jLabel3">
94
    <Component class="javax.swing.JLabel" name="filesLabel">
94
      <Properties>
95
      <Properties>
95
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
96
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
96
          <ResourceString bundle="org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle.properties" key="CTL_CommitForm_FilesToCommit" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
97
          <ResourceString bundle="org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle.properties" key="CTL_CommitForm_FilesToCommit" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
Lines 106-112 Link Here
106
      </AuxValues>
107
      </AuxValues>
107
      <Constraints>
108
      <Constraints>
108
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
109
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
109
          <GridBagConstraints gridX="0" gridY="2" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="5" anchor="23" weightX="0.0" weightY="0.0"/>
110
          <GridBagConstraints gridX="0" gridY="3" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="5" anchor="23" weightX="0.0" weightY="0.0"/>
110
        </Constraint>
111
        </Constraint>
111
      </Constraints>
112
      </Constraints>
112
    </Component>
113
    </Component>
Lines 121-127 Link Here
121
      </Properties>
122
      </Properties>
122
      <Constraints>
123
      <Constraints>
123
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
124
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
124
          <GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="1.0" weightY="0.0"/>
125
          <GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="1.0" weightY="0.0"/>
126
        </Constraint>
127
      </Constraints>
128
    </Component>
129
    <Component class="javax.swing.JComboBox" name="messageHistory">
130
      <Properties>
131
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
132
          <StringArray count="0"/>
133
        </Property>
134
      </Properties>
135
      <Events>
136
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="messageHistoryActionPerformed"/>
137
        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="messageHistoryFocusLost"/>
138
      </Events>
139
      <Constraints>
140
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
141
          <GridBagConstraints gridX="0" gridY="2" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="1.0" weightY="0.0"/>
125
        </Constraint>
142
        </Constraint>
126
      </Constraints>
143
      </Constraints>
127
    </Component>
144
    </Component>
(-)javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/commit/CommitSettings.java (-41 / +92 lines)
Lines 13-22 Link Here
13
13
14
package org.netbeans.modules.versioning.system.cvss.ui.actions.commit;
14
package org.netbeans.modules.versioning.system.cvss.ui.actions.commit;
15
15
16
import java.awt.event.ItemEvent;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.ResourceBundle;
16
import org.netbeans.lib.cvsclient.command.commit.CommitCommand;
20
import org.netbeans.lib.cvsclient.command.commit.CommitCommand;
17
import org.netbeans.modules.versioning.system.cvss.*;
21
import org.netbeans.modules.versioning.system.cvss.*;
18
import org.netbeans.modules.versioning.system.cvss.settings.CvsModuleConfig;
22
import org.netbeans.modules.versioning.system.cvss.settings.CvsModuleConfig;
19
import org.netbeans.modules.versioning.spi.VersioningListener;
23
import org.netbeans.modules.versioning.spi.VersioningListener;
24
import org.netbeans.modules.versioning.system.cvss.settings.HistorySettings;
20
import org.netbeans.modules.versioning.util.ListenersSupport;
25
import org.netbeans.modules.versioning.util.ListenersSupport;
21
26
22
import javax.swing.event.TableModelListener;
27
import javax.swing.event.TableModelListener;
Lines 28-34 Link Here
28
33
29
/**
34
/**
30
 * Customization of commits.
35
 * Customization of commits.
31
 * 
36
 *
32
 * @author Maros Sandor
37
 * @author Maros Sandor
33
 */
38
 */
34
public class CommitSettings extends javax.swing.JPanel implements PropertyChangeListener, TableModelListener {
39
public class CommitSettings extends javax.swing.JPanel implements PropertyChangeListener, TableModelListener {
Lines 40-61 Link Here
40
    static final String COLUMN_NAME_PATH    = "path";
45
    static final String COLUMN_NAME_PATH    = "path";
41
    
46
    
42
    static final Object EVENT_SETTINGS_CHANGED = new Object();
47
    static final Object EVENT_SETTINGS_CHANGED = new Object();
43
48
    
44
    private CommitTable     commitTable;
49
    private CommitTable     commitTable;
45
50
    
46
    public static class CommitFile {
51
    public static class CommitFile {
47
        private final CommitOptions options;
52
        private final CommitOptions options;
48
        private final CvsFileNode   node;
53
        private final CvsFileNode   node;
49
54
        
50
        public CommitFile(CvsFileNode node, CommitOptions options) {
55
        public CommitFile(CvsFileNode node, CommitOptions options) {
51
            this.node = node;
56
            this.node = node;
52
            this.options = options;
57
            this.options = options;
53
        }
58
        }
54
59
        
55
        public CommitOptions getOptions() {
60
        public CommitOptions getOptions() {
56
            return options;
61
            return options;
57
        }
62
        }
58
63
        
59
        public CvsFileNode getNode() {
64
        public CvsFileNode getNode() {
60
            return node;
65
            return node;
61
        }
66
        }
Lines 66-86 Link Here
66
        setPreferredSize(new Dimension(ss.width / 2, ss.height / 5 * 2));
71
        setPreferredSize(new Dimension(ss.width / 2, ss.height / 5 * 2));
67
        init();
72
        init();
68
    }
73
    }
69
74
    
70
    /**
75
    /**
71
     * Set columns to display in the Commit table.
76
     * Set columns to display in the Commit table.
72
     * 
77
     *
73
     * @param cols array of column names
78
     * @param cols array of column names
74
     */ 
79
     */
75
    void setColumns(String[] cols) {
80
    void setColumns(String[] cols) {
76
        commitTable.setColumns(cols);
81
        commitTable.setColumns(cols);
77
    }
82
    }
78
83
    
79
    /**
84
    /**
80
     * Set file nodes to display in the Commit table.
85
     * Set file nodes to display in the Commit table.
81
     * 
86
     *
82
     * @param nodes array of nodes
87
     * @param nodes array of nodes
83
     */ 
88
     */
84
    void setNodes(CvsFileNode[] nodes) {
89
    void setNodes(CvsFileNode[] nodes) {
85
        commitTable.setNodes(nodes);
90
        commitTable.setNodes(nodes);
86
    }
91
    }
Lines 96-115 Link Here
96
        listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
101
        listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
97
        taMessage.selectAll();
102
        taMessage.selectAll();
98
    }
103
    }
99
104
    
100
    public void removeNotify() {
105
    public void removeNotify() {
101
        commitTable.getTableModel().removeTableModelListener(this);
106
        commitTable.getTableModel().removeTableModelListener(this);
102
        CvsModuleConfig.getDefault().removePropertyChangeListener(this);
107
        CvsModuleConfig.getDefault().removePropertyChangeListener(this);
103
        super.removeNotify();
108
        super.removeNotify();
104
    }
109
    }
105
110
    
106
    public void propertyChange(PropertyChangeEvent evt) {
111
    public void propertyChange(PropertyChangeEvent evt) {
107
        if (CvsModuleConfig.PROP_COMMIT_EXCLUSIONS.equals(evt.getPropertyName())) {
112
        if (CvsModuleConfig.PROP_COMMIT_EXCLUSIONS.equals(evt.getPropertyName())) {
108
            commitTable.dataChanged();
113
            commitTable.dataChanged();
109
            listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
114
            listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
110
        }
115
        }
111
    }
116
    }
112
117
    
113
    public CommitFile [] getCommitFiles() {
118
    public CommitFile [] getCommitFiles() {
114
        return commitTable.getCommitFiles();
119
        return commitTable.getCommitFiles();
115
    }
120
    }
Lines 118-128 Link Here
118
        initComponents();
123
        initComponents();
119
        errorLabel.setMinimumSize(errorLabel.getPreferredSize());
124
        errorLabel.setMinimumSize(errorLabel.getPreferredSize());
120
        errorLabel.setText("");
125
        errorLabel.setText("");
121
        jScrollPane1.setMinimumSize(jScrollPane1.getPreferredSize());
126
        messageScroll.setMinimumSize(messageScroll.getPreferredSize());
127
        
128
        List latestMessages = HistorySettings.getDefault().getLatestCommitMessages();
129
        String defaultMessage =  ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_PreviousMessage");
130
        messageHistory.addItem(defaultMessage);
131
        for (Iterator iter = latestMessages.iterator(); iter.hasNext();) {
132
            String message = (String) iter.next();
133
            messageHistory.addItem(message);
134
        }
135
        
122
        commitTable = new CommitTable();
136
        commitTable = new CommitTable();
123
        java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
137
        java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
124
        gridBagConstraints.gridx = 0;
138
        gridBagConstraints.gridx = 0;
125
        gridBagConstraints.gridy = 3;
139
        gridBagConstraints.gridy = 4;
126
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
140
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
127
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
141
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
128
        gridBagConstraints.weightx = 1.0;
142
        gridBagConstraints.weightx = 1.0;
Lines 133-157 Link Here
133
    void setErrorLabel(String htmlErrorLabel) {
147
    void setErrorLabel(String htmlErrorLabel) {
134
        errorLabel.setText(htmlErrorLabel);
148
        errorLabel.setText(htmlErrorLabel);
135
    }
149
    }
136
150
    
137
    public void setCommand(CommitCommand cmd) {
151
    public void setCommand(CommitCommand cmd) {
138
        taMessage.setText(cmd.getMessage());
152
        taMessage.setText(cmd.getMessage());
139
        if (cmd.getToRevisionOrBranch() != null) {
153
        if (cmd.getToRevisionOrBranch() != null) {
140
            tfRevision.setText(cmd.getToRevisionOrBranch());
154
            tfRevision.setText(cmd.getToRevisionOrBranch());
141
            cbRevision.setSelected(true);
155
            cbRevision.setSelected(true);
142
        } else {
156
        } else {
143
            cbRevision.setSelected(false);            
157
            cbRevision.setSelected(false);
144
        }
158
        }
145
        cbLocally.setSelected(!cmd.isRecursive());
159
        cbLocally.setSelected(!cmd.isRecursive());
146
    }
160
    }
147
161
    
148
    public void updateCommand(CommitCommand cmd) {
162
    public void updateCommand(CommitCommand cmd) {
149
        cmd.setMessage(taMessage.getText());
163
        cmd.setMessage(taMessage.getText());
150
        cmd.setRecursive(!cbLocally.isSelected());
164
        cmd.setRecursive(!cbLocally.isSelected());
151
        if (cbRevision.isSelected()) {
165
        if (cbRevision.isSelected()) {
152
            cmd.setToRevisionOrBranch(tfRevision.getText());
166
            cmd.setToRevisionOrBranch(tfRevision.getText());
153
        } else {
167
        } else {
154
            cmd.setToRevisionOrBranch(null);            
168
            cmd.setToRevisionOrBranch(null);
155
        }
169
        }
156
    }
170
    }
157
    
171
    
Lines 167-177 Link Here
167
        cbLocally = new javax.swing.JCheckBox();
181
        cbLocally = new javax.swing.JCheckBox();
168
        cbRevision = new javax.swing.JCheckBox();
182
        cbRevision = new javax.swing.JCheckBox();
169
        tfRevision = new javax.swing.JTextField();
183
        tfRevision = new javax.swing.JTextField();
170
        jLabel2 = new javax.swing.JLabel();
184
        messageLabel = new javax.swing.JLabel();
171
        jScrollPane1 = new javax.swing.JScrollPane();
185
        messageScroll = new javax.swing.JScrollPane();
172
        taMessage = new org.netbeans.modules.versioning.system.cvss.ui.components.KTextArea();
186
        taMessage = new org.netbeans.modules.versioning.system.cvss.ui.components.KTextArea();
173
        jLabel3 = new javax.swing.JLabel();
187
        filesLabel = new javax.swing.JLabel();
174
        errorLabel = new javax.swing.JLabel();
188
        errorLabel = new javax.swing.JLabel();
189
        messageHistory = new javax.swing.JComboBox();
175
190
176
        cbLocally.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("MNE_CommitForm_Locally").charAt(0));
191
        cbLocally.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("MNE_CommitForm_Locally").charAt(0));
177
        org.openide.awt.Mnemonics.setLocalizedText(cbLocally, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_Locally"));
192
        org.openide.awt.Mnemonics.setLocalizedText(cbLocally, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_Locally"));
Lines 181-203 Link Here
181
        setLayout(new java.awt.GridBagLayout());
196
        setLayout(new java.awt.GridBagLayout());
182
197
183
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 12, 0, 11)));
198
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 12, 0, 11)));
184
        jLabel2.setLabelFor(taMessage);
199
        messageLabel.setLabelFor(taMessage);
185
        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_Message"));
200
        org.openide.awt.Mnemonics.setLocalizedText(messageLabel, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_Message"));
186
        jLabel2.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(0, 0, 2, 0)));
201
        messageLabel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(0, 0, 2, 0)));
187
        gridBagConstraints = new java.awt.GridBagConstraints();
202
        gridBagConstraints = new java.awt.GridBagConstraints();
188
        gridBagConstraints.gridx = 0;
203
        gridBagConstraints.gridx = 0;
189
        gridBagConstraints.gridy = 0;
204
        gridBagConstraints.gridy = 0;
190
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
205
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
191
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LAST_LINE_START;
206
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LAST_LINE_START;
192
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
207
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
193
        add(jLabel2, gridBagConstraints);
208
        add(messageLabel, gridBagConstraints);
194
209
195
        taMessage.setColumns(30);
210
        taMessage.setColumns(30);
196
        taMessage.setLineWrap(true);
211
        taMessage.setLineWrap(true);
197
        taMessage.setRows(6);
212
        taMessage.setRows(6);
198
        taMessage.setTabSize(4);
213
        taMessage.setTabSize(4);
199
        taMessage.setWrapStyleWord(true);
214
        taMessage.setWrapStyleWord(true);
200
        jScrollPane1.setViewportView(taMessage);
215
        messageScroll.setViewportView(taMessage);
201
216
202
        gridBagConstraints = new java.awt.GridBagConstraints();
217
        gridBagConstraints = new java.awt.GridBagConstraints();
203
        gridBagConstraints.gridx = 0;
218
        gridBagConstraints.gridx = 0;
Lines 206-244 Link Here
206
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
221
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
207
        gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
222
        gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
208
        gridBagConstraints.weightx = 1.0;
223
        gridBagConstraints.weightx = 1.0;
209
        add(jScrollPane1, gridBagConstraints);
224
        add(messageScroll, gridBagConstraints);
210
225
211
        org.openide.awt.Mnemonics.setLocalizedText(jLabel3, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_FilesToCommit"));
226
        org.openide.awt.Mnemonics.setLocalizedText(filesLabel, java.util.ResourceBundle.getBundle("org/netbeans/modules/versioning/system/cvss/ui/actions/commit/Bundle").getString("CTL_CommitForm_FilesToCommit"));
212
        jLabel3.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 0, 0, 0)));
227
        filesLabel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 0, 0, 0)));
213
        gridBagConstraints = new java.awt.GridBagConstraints();
228
        gridBagConstraints = new java.awt.GridBagConstraints();
214
        gridBagConstraints.gridx = 0;
229
        gridBagConstraints.gridx = 0;
215
        gridBagConstraints.gridy = 2;
230
        gridBagConstraints.gridy = 3;
216
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
231
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
217
        gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
232
        gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
218
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
233
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
219
        add(jLabel3, gridBagConstraints);
234
        add(filesLabel, gridBagConstraints);
220
235
221
        errorLabel.setText("Y");
236
        errorLabel.setText("Y");
222
        errorLabel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(2, 0, 0, 0)));
237
        errorLabel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(2, 0, 0, 0)));
223
        gridBagConstraints = new java.awt.GridBagConstraints();
238
        gridBagConstraints = new java.awt.GridBagConstraints();
224
        gridBagConstraints.gridx = 0;
239
        gridBagConstraints.gridx = 0;
225
        gridBagConstraints.gridy = 4;
240
        gridBagConstraints.gridy = 5;
226
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
241
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
227
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
242
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
228
        gridBagConstraints.weightx = 1.0;
243
        gridBagConstraints.weightx = 1.0;
229
        add(errorLabel, gridBagConstraints);
244
        add(errorLabel, gridBagConstraints);
230
245
246
        messageHistory.addActionListener(new java.awt.event.ActionListener() {
247
            public void actionPerformed(java.awt.event.ActionEvent evt) {
248
                messageHistoryActionPerformed(evt);
249
            }
250
        });
251
        messageHistory.addFocusListener(new java.awt.event.FocusAdapter() {
252
            public void focusLost(java.awt.event.FocusEvent evt) {
253
                messageHistoryFocusLost(evt);
254
            }
255
        });
256
257
        gridBagConstraints = new java.awt.GridBagConstraints();
258
        gridBagConstraints.gridx = 0;
259
        gridBagConstraints.gridy = 2;
260
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
261
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
262
        gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
263
        gridBagConstraints.weightx = 1.0;
264
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
265
        add(messageHistory, gridBagConstraints);
266
231
    }
267
    }
232
    // </editor-fold>//GEN-END:initComponents
268
    // </editor-fold>//GEN-END:initComponents
233
    
269
270
    private void messageHistoryFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_messageHistoryFocusLost
271
        messageHistory.setSelectedIndex(0);
272
    }//GEN-LAST:event_messageHistoryFocusLost
273
    
274
    private void messageHistoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_messageHistoryActionPerformed
275
        int idx =  messageHistory.getSelectedIndex();
276
        if (idx == 0) {
277
            return;
278
        }
279
        
280
        String message = (String) messageHistory.getItemAt(idx);
281
        taMessage.setText(message);
282
    }//GEN-LAST:event_messageHistoryActionPerformed
283
        
234
    
284
    
235
    // Variables declaration - do not modify//GEN-BEGIN:variables
285
    // Variables declaration - do not modify//GEN-BEGIN:variables
236
    private javax.swing.JCheckBox cbLocally;
286
    private javax.swing.JCheckBox cbLocally;
237
    private javax.swing.JCheckBox cbRevision;
287
    private javax.swing.JCheckBox cbRevision;
238
    private javax.swing.JLabel errorLabel;
288
    private javax.swing.JLabel errorLabel;
239
    private javax.swing.JLabel jLabel2;
289
    private javax.swing.JLabel filesLabel;
240
    private javax.swing.JLabel jLabel3;
290
    private javax.swing.JComboBox messageHistory;
241
    private javax.swing.JScrollPane jScrollPane1;
291
    private javax.swing.JLabel messageLabel;
292
    private javax.swing.JScrollPane messageScroll;
242
    private org.netbeans.modules.versioning.system.cvss.ui.components.KTextArea taMessage;
293
    private org.netbeans.modules.versioning.system.cvss.ui.components.KTextArea taMessage;
243
    private javax.swing.JTextField tfRevision;
294
    private javax.swing.JTextField tfRevision;
244
    // End of variables declaration//GEN-END:variables
295
    // End of variables declaration//GEN-END:variables
Lines 246-257 Link Here
246
    public void tableChanged(TableModelEvent e) {
297
    public void tableChanged(TableModelEvent e) {
247
        listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
298
        listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
248
    }
299
    }
249
300
    
250
    ListenersSupport listenerSupport = new ListenersSupport(this);
301
    ListenersSupport listenerSupport = new ListenersSupport(this);
251
    public void addVersioningListener(VersioningListener listener) {
302
    public void addVersioningListener(VersioningListener listener) {
252
        listenerSupport.addListener(listener);
303
        listenerSupport.addListener(listener);
253
    }
304
    }
254
305
    
255
    public void removeVersioningListener(VersioningListener listener) {
306
    public void removeVersioningListener(VersioningListener listener) {
256
        listenerSupport.removeListener(listener);
307
        listenerSupport.removeListener(listener);
257
    }
308
    }

Return to bug 64195