Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [subversive-dev] Commit Dialog extension

Hello Andrey.
 
You are wrong in fact. You do not need to change org.eclipse.team.svn.ui plug-in.
All you have to is to create your own plug-in, that contains the text below in its plug-in.xml:

<extension point="org.eclipse.team.svn.ui.commit"> <commit class="your_package.MyCommitActionFactory"/></extension>

And then when running your plug-in near Subversive will make the last to use your ICommitActionFactory implementation.
 
Best regards, Alexei Goncharov.
Subversive Team.
 

From: subversive-dev-bounces@xxxxxxxxxxx [mailto:subversive-dev-bounces@xxxxxxxxxxx] On Behalf Of Andrey Pavlenko
Sent: Wednesday, December 17, 2008 1:31 PM
To: subversive-dev@xxxxxxxxxxx
Subject: [subversive-dev] Commit Dialog extension

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

 

**********************************************************************

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

**********************************************************************

 


Back to the top