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

(-)plugin.xml (+2 lines)
Lines 1-6 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
2
<?eclipse version="3.0"?>
3
<plugin>
3
<plugin>
4
   <extension-point id="CommitCommentArea" name="CommitCommentArea" schema="schema/CommitCommentArea.exsd"/>
5
   
4
6
5
    
7
    
6
<!-- *************** Synchronize Wizards **************** -->
8
<!-- *************** Synchronize Wizards **************** -->
(-)schema/CommitCommentArea.exsd (+102 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.team.cvs.ui" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.team.cvs.ui" id="CommitCommentArea" name="CommitCommentArea"/>
7
      </appInfo>
8
      <documentation>
9
         [Enter description of this extension point.]
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appInfo>
16
            <meta.element />
17
         </appInfo>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <element ref="commentArea"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appInfo>
43
                  <meta.attribute translatable="true"/>
44
               </appInfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="commentArea">
51
      <complexType>
52
         <attribute name="class" type="string" use="required">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appInfo>
58
                  <meta.attribute kind="java" basedOn="org.eclipse.team.internal.ccvs.ui.CommitCommentArea:"/>
59
               </appInfo>
60
            </annotation>
61
         </attribute>
62
      </complexType>
63
   </element>
64
65
   <annotation>
66
      <appInfo>
67
         <meta.section type="since"/>
68
      </appInfo>
69
      <documentation>
70
         [Enter the first release in which this extension point appears.]
71
      </documentation>
72
   </annotation>
73
74
   <annotation>
75
      <appInfo>
76
         <meta.section type="examples"/>
77
      </appInfo>
78
      <documentation>
79
         [Enter extension point usage example here.]
80
      </documentation>
81
   </annotation>
82
83
   <annotation>
84
      <appInfo>
85
         <meta.section type="apiinfo"/>
86
      </appInfo>
87
      <documentation>
88
         [Enter API information here.]
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appInfo>
94
         <meta.section type="implementation"/>
95
      </appInfo>
96
      <documentation>
97
         [Enter information about supplied implementation of this extension point.]
98
      </documentation>
99
   </annotation>
100
101
102
</schema>
(-)src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java (-8 / +29 lines)
Lines 19-24 Link Here
19
import java.util.*;
19
import java.util.*;
20
20
21
import org.eclipse.core.resources.IProject;
21
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.runtime.*;
22
import org.eclipse.jface.action.*;
23
import org.eclipse.jface.action.*;
23
import org.eclipse.jface.commands.ActionHandler;
24
import org.eclipse.jface.commands.ActionHandler;
24
import org.eclipse.jface.dialogs.*;
25
import org.eclipse.jface.dialogs.*;
Lines 55-61 Link Here
55
 */
56
 */
56
public class CommitCommentArea extends DialogArea {
57
public class CommitCommentArea extends DialogArea {
57
58
58
    private class TextBox implements ModifyListener, TraverseListener, FocusListener, Observer {
59
    protected class TextBox implements ModifyListener, TraverseListener, FocusListener, Observer {
59
        
60
        
60
        private final StyledText fTextField; // updated only by modify events
61
        private final StyledText fTextField; // updated only by modify events
61
        private final String fMessage;
62
        private final String fMessage;
Lines 323-329 Link Here
323
            return fText;
324
            return fText;
324
        }
325
        }
325
        
326
        
326
        private void setText(String text) {
327
        public void setText(String text) {
327
            if (text.length() == 0) {
328
            if (text.length() == 0) {
328
                fTextField.setText(fMessage);
329
                fTextField.setText(fMessage);
329
                fTextField.selectAll();
330
                fTextField.selectAll();
Lines 336-342 Link Here
336
        }
337
        }
337
    }
338
    }
338
    
339
    
339
    private static class ComboBox extends Observable implements SelectionListener, FocusListener {
340
    protected static class ComboBox extends Observable implements SelectionListener, FocusListener {
340
        
341
        
341
        private final String fMessage;
342
        private final String fMessage;
342
        private final String [] fComments;
343
        private final String [] fComments;
Lines 430-441 Link Here
430
    public static final String OK_REQUESTED = "OkRequested";//$NON-NLS-1$
431
    public static final String OK_REQUESTED = "OkRequested";//$NON-NLS-1$
431
    public static final String COMMENT_MODIFIED = "CommentModified";//$NON-NLS-1$
432
    public static final String COMMENT_MODIFIED = "CommentModified";//$NON-NLS-1$
432
    
433
    
433
    private TextBox fTextBox;
434
    protected TextBox fTextBox;
434
    private ComboBox fComboBox;
435
    protected ComboBox fComboBox;
435
    
436
    
436
    private IProject fMainProject;
437
    protected IProject fMainProject;
437
    private String fProposedComment;
438
    protected String fProposedComment;
438
    private Composite fComposite;
439
    protected Composite fComposite;
439
    
440
    
440
    /**
441
    /**
441
     * @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
442
     * @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
Lines 632-635 Link Here
632
        final String template = provider.getCommitTemplate();
633
        final String template = provider.getCommitTemplate();
633
        return template != null ? template : ""; //$NON-NLS-1$
634
        return template != null ? template : ""; //$NON-NLS-1$
634
    }
635
    }
636
    
637
	public static CommitCommentArea getCommitCommentArea() {
638
		
639
		// look for any extensions of the CommitCommentArea
640
		IExtensionRegistry reg = Platform.getExtensionRegistry();
641
		IConfigurationElement[] extensions = reg.getConfigurationElementsFor("org.eclipse.team.cvs.ui.CommitCommentArea");//$NON-NLS-1$
642
		
643
		// if we have some, return the first
644
		if (extensions != null && extensions.length > 0) {
645
			try {
646
				return (CommitCommentArea)extensions[0].createExecutableExtension("class");//$NON-NLS-1$
647
			}
648
			catch (CoreException e) {
649
				CVSUIPlugin.log(e);
650
			}
651
		}
652
		
653
		// if we're here, then either there were no extensions or something failed.  return the stock comment area.
654
		return new CommitCommentArea();
655
	}
635
}
656
}
(-)src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java (-1 / +1 lines)
Lines 47-53 Link Here
47
		super(parentShell, CVSUIMessages.ReleaseCommentDialog_title); 
47
		super(parentShell, CVSUIMessages.ReleaseCommentDialog_title); 
48
		int shellStyle = getShellStyle();
48
		int shellStyle = getShellStyle();
49
		setShellStyle(shellStyle | SWT.RESIZE | SWT.MAX);
49
		setShellStyle(shellStyle | SWT.RESIZE | SWT.MAX);
50
		commitCommentArea = new CommitCommentArea();
50
		commitCommentArea = CommitCommentArea.getCommitCommentArea();
51
		// Get a project from which the commit template can be obtained
51
		// Get a project from which the commit template can be obtained
52
		if (resourcesToCommit.length > 0) 
52
		if (resourcesToCommit.length > 0) 
53
		commitCommentArea.setProject(resourcesToCommit[0].getProject());
53
		commitCommentArea.setProject(resourcesToCommit[0].getProject());
(-)src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java (-1 / +1 lines)
Lines 61-67 Link Here
61
        
61
        
62
		int shellStyle = getShellStyle();
62
		int shellStyle = getShellStyle();
63
		setShellStyle(shellStyle | SWT.RESIZE | SWT.MAX);
63
		setShellStyle(shellStyle | SWT.RESIZE | SWT.MAX);
64
		commitCommentArea = new CommitCommentArea();
64
		commitCommentArea = CommitCommentArea.getCommitCommentArea();
65
		// Get a project from which the commit template can be obtained
65
		// Get a project from which the commit template can be obtained
66
		if (files.length > 0) 
66
		if (files.length > 0) 
67
		    commitCommentArea.setProject(files[0].getProject());
67
		    commitCommentArea.setProject(files[0].getProject());
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizardCommitPage.java (-1 / +1 lines)
Lines 85-91 Link Here
85
        setDescription(CVSUIMessages.CommitWizardCommitPage_2); 
85
        setDescription(CVSUIMessages.CommitWizardCommitPage_2); 
86
        
86
        
87
        fWizard= wizard;
87
        fWizard= wizard;
88
        fCommentArea= new CommitCommentArea();
88
        fCommentArea= CommitCommentArea.getCommitCommentArea();
89
        fCommentArea.setProposedComment(getProposedComment(resources));
89
        fCommentArea.setProposedComment(getProposedComment(resources));
90
        if (resources.length > 0)
90
        if (resources.length > 0)
91
            fCommentArea.setProject(resources[0].getProject());
91
            fCommentArea.setProject(resources[0].getProject());
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/ModeWizardSelectionPage.java (-1 / +1 lines)
Lines 787-793 Link Here
787
		((GridLayout)rightComposite.getLayout()).marginTop= verticalSpace;
787
		((GridLayout)rightComposite.getLayout()).marginTop= verticalSpace;
788
		
788
		
789
		final Group rightGroup= SWTUtils.createHVFillGroup(rightComposite, CVSUIMessages.ModeWizardSelectionPage_24, SWTUtils.MARGINS_DIALOG); 
789
		final Group rightGroup= SWTUtils.createHVFillGroup(rightComposite, CVSUIMessages.ModeWizardSelectionPage_24, SWTUtils.MARGINS_DIALOG); 
790
		(fCommentArea= new CommitCommentArea()).createArea(rightGroup);
790
		(fCommentArea= CommitCommentArea.getCommitCommentArea()).createArea(rightGroup);
791
		
791
		
792
		/**
792
		/**
793
		 * Set up the page
793
		 * Set up the page

Return to bug 329500