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.*; |
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; |
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(); |
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; |
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) |
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 |
} |