Thank you, Alexei.
I understand your thoughts. Have some questions to
you.
1. What have I to do to add the text to commit
message and to show it on the screen of commitdialog. When I add some text to ICommitDialog. getMessage() implementation
– this text adds to commit message (I can see it in my repository), but it
does not adds to MyDialog.panel.comment.message. So how can I do it?
2. The problem which I placed
in my previous post is very strange.
In some ways I have no
access to different parts of the plugin. For example:
2.1. Example1
public class SBMDialog extends DefaultDialog implements ICommitDialog{
private String someCommentHeaderMessage = “text”;
public SBMDialog(Shell parentShell,
ICommentDialogPanel panel) {
super(parentShell, panel);
this.panel = panel;
…
}
private void addTextToCommentPane() {
JOptionPane.showMessageDialog(frame,
"Eggs are
not supposed to be green.",
"Message", JOptionPane.WARNING_MESSAGE);
// TODO Auto-generated method stub
CommentComposite
commentComposite = ((SBMCommitPanel)panel).getCommentComposite();
JOptionPane.showMessageDialog(frame,
"Eggs are
not supposed to be red.",
"Message", JOptionPane.WARNING_MESSAGE);
String
message = " NewMessage " + commentComposite.getMessage() + someCommentHeaderMessage;
commentComposite.setMessage(message);
commentComposite.insertText(" Inserted Text");
commentComposite.saveChanges();
}
}
public class SBMCommitPanel
extends CommitPanel {
private Button associateIssueButton;
protected IResource []resources;
public SBMCommitPanel(IResource[] resources, int msgType) {
super(resources, msgType);
}
public void saveChanges() {
super.saveChanges();
}
public CommentComposite getCommentComposite()
{
return this.comment;
}
}
It is a part of code. So, when addTextToCommentPane() invokes, I see
only "Eggs
are not supposed to be green.", but I doesn’t see "Eggs are not supposed to be red.". And nothing changes in
comment.message. So I think, it seems some error appears and eclipse doesn’t
show it to me.
In my previous post I discussed buttonPressed method. So, it seems
the same problems appears – nothing happens when it should be the concrete
methods invocation.
2.2 Example 2
This is also little problem.
public class SBMCommitActionFactory implements ICommitActionFactory {
private SBMDialog dialog;
private ICommitDialog commitDialog;
public ICommitDialog getCommitDialog(final Shell shell,
Collection
allFilesToCommit, final ICommentDialogPanel commentPanel) {
commitDialog = new ICommitDialog() {
public String getMessage() {
return "TASKS: " + dialog.getCommentHeaderMessage() + " ; COMMENT: " + commentPanel.getMessage();
}
public int open() {
dialog = new SBMDialog(new Shell(shell), commentPanel);
return dialog.open();
}
};
return commitDialog;
}
This code is works. But the code down does not:
public class SBMCommitActionFactory implements ICommitActionFactory {
private SBMDialog dialog;
private ICommitDialog commitDialog;
public ICommitDialog getCommitDialog(final Shell shell,
Collection
allFilesToCommit, final ICommentDialogPanel commentPanel) {
commitDialog = new SBMCommitDialog(shell,
allFilesToCommit,
commentPanel,
dialog, commentHeaderMessage);
return
commitDialog;
}
public class SBMCommitDialog implements ICommitDialog {
private Shell shell;
private Collection allFilesToCommit;
private ICommentDialogPanel commentDialogPanel;
private SBMDialog dialog;
public SBMCommitDialog(final Shell shell, Collection allFilesToCommit,
final ICommentDialogPanel commentDialogPanel,
SBMDialog dialog, StringBuffer commentHeaderMessage) {
super();
this.shell = shell;
this.allFilesToCommit = allFilesToCommit;
this.commentDialogPanel = commentDialogPanel;
this.dialog = dialog;
}
public String getMessage() {
return "<testCommitMessage=124>
" + commentDialogPanel.getMessage();
}
public int open() {
dialog = new SBMDialog(new Shell(shell), commentDialogPanel);
return dialog.open();
}
}
Don’t
you think, it’s very strange. I think, that the solution of all these examples
and the exemple in my prev. post are the same.
Can
anybody help me to solve this problems?
_________
With best regards,
Andrey Pavlenko