refactoring events (see post from 18.02.2004)


2005-04-30 02:56:44 AM
jbuilder4
Hi,
I have excactly done what you have descripted below. But it doesnt work!
I get the information about the read-only files in the Message pane but when
I press the checkout button nothing happens.
public class MyVCS extends VCS{
public MyVCS () {
VCSFactory.addVCS(this);...
I have this code in MyVCS class(s.b.)! Is that correct?
public UpdateAction getRefactorCheckoutAction(final UrlNode[] urlNodes,
final Component parentComponent,
final ChangeListener
changeListener) {
System.out.println("here");
UpdateAction checkoutAction = new UpdateAction( "Checkout Read-Only
Files", (char)0, "", VCSIcons.VCS_CHECKOUT) {
public void actionPerformed(ActionEvent e) {
System.out.println("here 3");
int zz = 0;
changeListener.stateChanged(new ChangeEvent(this));
}
};
return checkoutAction;
}
And I dont see my out.println?!!?!?!?!
The information I need is the url of all files which are read-only, so that
I can check they out.
Hopefully you can help me.
Best regards.
"Bill Joy" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
Quote
There is already an existing design for this in the VCS class. I think
this was introduced in JBuilder 9 time frame. The only requirement is
that the file where you initiate refactoring be already checked-out (since
the refactoring menus are disabled for read-only files).

When the refactoring process detects read-only files, it lists them in a
tab in the Message pane. From there, you can initate a checkout of the
read-only files if the active VCS implementation for the project overrides
the default behavior (which returns null instead of an UpdateAction).
Once all the files are checked-out (made not read-only), you can tell it
to continue with the refactoring.

public UpdateAction getRefactorCheckoutAction(
final UrlNode[] urlNodes,
final Component parentComponent,
final ChangeListener changeListener) {

UpdateAction checkoutAction = new UpdateAction(
"Checkout Read-Only Files",
(char)0,
"",
VCSIcons.VCS_CHECKOUT) {

public void actionPerformed(ActionEvent e) {
Dialog dlg = new MyCheckoutFiles(urlNodes);
dlg.show();
dlg.dispose();

changeListener.stateChanged(new ChangeEvent(this));
}

};

return checkoutAction;
}




"Jesper Sundien" < XXXX@XXXXX.COM >wrote in message
news:4215b99a$ XXXX@XXXXX.COM ...
>Is it possible to find out which files that will be edited when using the
>refactor mechanism of JBuilder?
>
>I am building a Perforce VCS integration and I need to find out which
>(read-only) files that has to be automatically opened for edit
>(checked-out) to avoid having to manually check-out all the files during
>refactoring.
>
>Thanks!
>
>/Jesper
>