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 235838
Collapse All | Expand All

(-)versioning.util/src/org/netbeans/modules/versioning/util/common/VCSCommitParameters.java (-13 / +13 lines)
Lines 58-64 Link Here
58
import javax.swing.JLabel;
58
import javax.swing.JLabel;
59
import javax.swing.JPanel;
59
import javax.swing.JPanel;
60
import javax.swing.JScrollPane;
60
import javax.swing.JScrollPane;
61
import javax.swing.JTextArea;
61
import javax.swing.JEditorPane;
62
import javax.swing.LayoutStyle.ComponentPlacement;
62
import javax.swing.LayoutStyle.ComponentPlacement;
63
import org.netbeans.modules.versioning.util.StringSelector;
63
import org.netbeans.modules.versioning.util.StringSelector;
64
import org.netbeans.modules.versioning.util.TemplateSelector;
64
import org.netbeans.modules.versioning.util.TemplateSelector;
Lines 111-117 Link Here
111
        changeSupport.addChangeListener(listener);
111
        changeSupport.addChangeListener(listener);
112
    }
112
    }
113
    
113
    
114
    public static JLabel createRecentMessagesLink(final JTextArea text, final Preferences preferences) {
114
    public static JLabel createRecentMessagesLink(final JEditorPane text, final Preferences preferences) {
115
        JLabel recentLink = new JLabel();
115
        JLabel recentLink = new JLabel();
116
        recentLink.setIcon(new ImageIcon(VCSCommitParameters.class.getResource("/org/netbeans/modules/versioning/util/resources/recent_messages.png"))); // NOI18N
116
        recentLink.setIcon(new ImageIcon(VCSCommitParameters.class.getResource("/org/netbeans/modules/versioning/util/resources/recent_messages.png"))); // NOI18N
117
        recentLink.setToolTipText(getMessage("CTL_CommitForm_RecentMessages")); // NOI18N            
117
        recentLink.setToolTipText(getMessage("CTL_CommitForm_RecentMessages")); // NOI18N            
Lines 126-139 Link Here
126
        return recentLink;
126
        return recentLink;
127
    }
127
    }
128
    
128
    
129
    protected JLabel getRecentMessagesLink(final JTextArea text) {
129
    protected JLabel getRecentMessagesLink(final JEditorPane text) {
130
        if(recentLink == null) {
130
        if(recentLink == null) {
131
            recentLink = createRecentMessagesLink(text, preferences);
131
            recentLink = createRecentMessagesLink(text, preferences);
132
        }
132
        }
133
        return recentLink;
133
        return recentLink;
134
    }
134
    }
135
    
135
    
136
    protected static JLabel createMessagesTemplateLink(final JTextArea text, final Preferences preferences, final String helpCtxId) {
136
    protected static JLabel createMessagesTemplateLink(final JEditorPane text, final Preferences preferences, final String helpCtxId) {
137
        JLabel templateLink = new JLabel();
137
        JLabel templateLink = new JLabel();
138
        templateLink.setIcon(new ImageIcon(VCSCommitParameters.class.getResource("/org/netbeans/modules/versioning/util/resources/load_template.png"))); // NOI18N
138
        templateLink.setIcon(new ImageIcon(VCSCommitParameters.class.getResource("/org/netbeans/modules/versioning/util/resources/load_template.png"))); // NOI18N
139
        templateLink.setToolTipText(getMessage("CTL_CommitForm_LoadTemplate")); // NOI18N            
139
        templateLink.setToolTipText(getMessage("CTL_CommitForm_LoadTemplate")); // NOI18N            
Lines 148-154 Link Here
148
        return templateLink;
148
        return templateLink;
149
    }
149
    }
150
    
150
    
151
    protected JLabel getMessagesTemplateLink(final JTextArea text, String helpCtxId) {
151
    protected JLabel getMessagesTemplateLink(final JEditorPane text, String helpCtxId) {
152
        if(templateLink == null) {
152
        if(templateLink == null) {
153
            templateLink = createMessagesTemplateLink(text, preferences, helpCtxId);
153
            templateLink = createMessagesTemplateLink(text, preferences, helpCtxId);
154
        }
154
        }
Lines 159-165 Link Here
159
        return NbBundle.getMessage(VCSCommitParameters.class, msgKey);
159
        return NbBundle.getMessage(VCSCommitParameters.class, msgKey);
160
    } 
160
    } 
161
    
161
    
162
    private static void onBrowseRecentMessages(JTextArea text, Preferences preferences) {
162
    private static void onBrowseRecentMessages(JEditorPane text, Preferences preferences) {
163
        StringSelector.RecentMessageSelector selector = new StringSelector.RecentMessageSelector(preferences);    
163
        StringSelector.RecentMessageSelector selector = new StringSelector.RecentMessageSelector(preferences);    
164
        String message = selector.getRecentMessage(getMessage("CTL_CommitForm_RecentTitle"),  // NOI18N
164
        String message = selector.getRecentMessage(getMessage("CTL_CommitForm_RecentTitle"),  // NOI18N
165
                                               getMessage("CTL_CommitForm_RecentPrompt"),  // NOI18N
165
                                               getMessage("CTL_CommitForm_RecentPrompt"),  // NOI18N
Lines 169-175 Link Here
169
        }
169
        }
170
    }
170
    }
171
171
172
    private static void onTemplate(JTextArea text, Preferences preferences, String helpCtxId) {
172
    private static void onTemplate(JEditorPane text, Preferences preferences, String helpCtxId) {
173
        TemplateSelector ts = new TemplateSelector(preferences);
173
        TemplateSelector ts = new TemplateSelector(preferences);
174
        if(ts.show(helpCtxId)) {
174
        if(ts.show(helpCtxId)) {
175
            text.setText(ts.getTemplate());
175
            text.setText(ts.getTemplate());
Lines 244-250 Link Here
244
        private class ParametersPanel extends JPanel {
244
        private class ParametersPanel extends JPanel {
245
            private JScrollPane scrollpane = new JScrollPane();
245
            private JScrollPane scrollpane = new JScrollPane();
246
            private final JLabel messageLabel = new JLabel();        
246
            private final JLabel messageLabel = new JLabel();        
247
            private final JTextArea messageTextArea = new JTextArea();
247
            private final JEditorPane messageTextArea = new JEditorPane();
248
            private UndoRedoSupport um;                
248
            private UndoRedoSupport um;                
249
249
250
            public ParametersPanel() {
250
            public ParametersPanel() {
Lines 254-264 Link Here
254
                JLabel templateLink = getMessagesTemplateLink(messageTextArea, "org.netbeans.modules.versioning.util.common.TemplatePanel"); //NOI18N
254
                JLabel templateLink = getMessagesTemplateLink(messageTextArea, "org.netbeans.modules.versioning.util.common.TemplatePanel"); //NOI18N
255
                JLabel recentLink = getRecentMessagesLink(messageTextArea);
255
                JLabel recentLink = getRecentMessagesLink(messageTextArea);
256
256
257
                messageTextArea.setColumns(60);    //this determines the preferred width of the whole dialog
257
//                messageTextArea.setColumns(60);    //this determines the preferred width of the whole dialog
258
                messageTextArea.setLineWrap(true);
258
//                messageTextArea.setLineWrap(true);
259
                messageTextArea.setRows(4);
259
//                messageTextArea.setRows(4);
260
                messageTextArea.setTabSize(4);
260
//                messageTextArea.setTabSize(4);
261
                messageTextArea.setWrapStyleWord(true);
261
//                messageTextArea.setWrapStyleWord(true);
262
                messageTextArea.setMinimumSize(new Dimension(100, 18));
262
                messageTextArea.setMinimumSize(new Dimension(100, 18));
263
                scrollpane.setViewportView(messageTextArea);
263
                scrollpane.setViewportView(messageTextArea);
264
264
(-)versioning.util/src/org/netbeans/modules/versioning/util/UndoRedoSupport.java (-5 / +6 lines)
Lines 131-141 Link Here
131
                processDocumentChange();
131
                processDocumentChange();
132
                return;
132
                return;
133
            }
133
            }
134
            AbstractDocument.DefaultDocumentEvent event = (AbstractDocument.DefaultDocumentEvent) e.getEdit();
134
            UndoableEdit event = e.getEdit();
135
            if (event.getType().equals(DocumentEvent.EventType.CHANGE)) {
135
//            AbstractDocument.DefaultDocumentEvent event = (AbstractDocument.DefaultDocumentEvent) e.getEdit();
136
                edit.addEdit(e.getEdit());
136
//            if (event.getType().equals(DocumentEvent.EventType.CHANGE)) {
137
                return;
137
//                edit.addEdit(e.getEdit());
138
            }
138
//                return;
139
//            }
139
            int offsetChange = component.getCaretPosition() - lastOffset;
140
            int offsetChange = component.getCaretPosition() - lastOffset;
140
            int lengthChange = component.getDocument().getLength() - lastLength;
141
            int lengthChange = component.getDocument().getLength() - lastLength;
141
142

Return to bug 235838