Just to track this somewhere. Probably one of the most important feature?
Do you think this would be hard to do? Probably it would work similarly like
copying project? Question is just what would mean "renaming CNB". Maybe just:
1) Closing project (removing from suite for components)
2) Adjusting build.xml, manifest.mf, nbproject/project.xml
3) Appending it to the suite for components
Too naive I feel :) Refactoring of packages would be nice to have, but probably
very hard to implement. And also something what the user can do later.
Also I forgot about e.g. TopComponent setting and wstcref files. And there is
probably more. But if we know them it should be hard to adjust those files as well.
> But if we know them it should be hard to adjust those files as well.
Yup, I meant "... it should *not* be hard...". However I'm not quite sure :)
Replacing all occurrences of the CNB in and of itself should not be hard, even
if you go into .settings files and so on. But doing this with the IDE open -
well, I don't know. Probably difficult to get everything to update cleanly.
There are dozens of listeners that would need to get notified of everything,
just a mess.
BTW Honza - this falls into the category of "things that don't sound hard but
that may be impractical because of usage of the listener pattern".
> Probably difficult to get everything to update cleanly. There are dozens of
> listeners that would need to get notified of everything, just a mess.
I thought that when you:
1) properly close a project (with ProjectState.notifyDeleted) plus detaching
needed listeners - there is now method NbModuleProject.notifyDeleting which
tries to do something similar, so might need to be enhanced.
Or ideally all listener should be detached automatically when some other
listener noticed that a project going to be deleted, i.e. no need to call
NbModuleProject.notifyDeleting(). (but this is rather implementation detail)
2) then do the "replace"
3) Do the open (ProjectManager.find(), OpenedHook, ...)
that it could work, or not? What else listen after the step1? Might be that
dependen projects would be confused for a while - hmm, that could be problem.
Just curious :)
Don't know in detail, just suspect it will be hard. If you have ideas, don't let
me stop you...