Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Subversive » commit dialog extension
commit dialog extension [message #39430] Wed, 17 December 2008 11:03
Andrey is currently offline AndreyFriend
Messages: 1
Registered: July 2009
Junior Member
Hello, everybody!
I have a problem in subversive extension.
I want to extend the commit dialog window in such way: when the "OK"
button pressed in commit dialog - new my window appears before the commit
process starts.
So, I created MyCommitDialog and MyCommitActionFactory classes in my
separate package.
MyCommitActionFactory looks like DefaultCommitAcionFactory, but itcalls
for MyCommitDialog instead of DefaultCommitDialog.


public class MyCommitActionFactory implements ICommitActionFactory {

public ICommitDialog getCommitDialog(final Shell shell, Collection
allFilesToCommit, final ICommentDialogPanel commentPanel) {
return new ICommitDialog() {
public String getMessage() {
return commentPanel.getMessage();
}

public int open() {
MyCommitDialog dialog = new MyCommitDialog(new Shell(shell),
commentPanel);
return dialog.open();
}
};
}
}

So, MyCommitDialog changes DefaultDialog to call ourWindow:

public class MyCommitDialog extends DefaultDialog{
private TaskSelectDialog taskSelectDialog;

public MyCommitDialog(Shell parentShell, IDialogPanel panel) {
super(parentShell, panel);
taskSelectDialog = new TaskSelectDialog();
}

protected void buttonPressed(int buttonId) {
if (IDialogConstants.OK_ID == buttonId) {
// Shows our dialog when OK button pressed
showTaskSelectDialog();
}
}

private void showTaskSelectDialog() {
taskSelectDialog.createAndShowGUI();
taskSelectDialog.addSubmitListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
preCommitAction();
}
});
}

private void preCommitAction() {
//after the button ok at my window presses the commit process continues
super.buttonPressed(IDialogConstants.OK_ID);
}
}
I added my package to SVNTeamUI.jar. Is that right?
So, the main question is - what have i do after my actions to make it work
(I mean to load my factory and my dialog instead of default)? I think I
have to change plugin.xml and commit.exsd files in
org.polarion.team.svn.ui_1.0.5 folder? So, if that right, how have I
change them? I didn't find anything on this topic...
Please, help me.
With best regards, Andrey Pavlenko.
Previous Topic:Subversive FS format error
Next Topic:NullPointer when checking out
Goto Forum:
  


Current Time: Thu Apr 25 23:41:49 GMT 2024

Powered by FUDForum. Page generated in 0.02753 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top