Phillipus/archi — pull request #64 by mbd (2014-03-31 21:13:38+00:00)
Title: Find replace in name feature (see issue #48)

This is a first stab at adding a "search and replace in names for the selected elements".

(The issue for this is here: https://github.com/Phillipus/archi/issues/48)

How to use: Select a bunch of elements/relations in a view/diagram, then rightclick to show the context menu, choose "Replace", enter from string, click ok, enter to string, click ok, and presto: many names may have changed. (Test with eg. a copy of a model, to eliminate "(copy)" from many labels.).

Although this is a pull request, it should probably be regarded as a review request:

- You may not want this functionality at all (but it is useful to me! Please accept it at some point! :-) )

- I was (am) quite confused about the structure of the code. I started out implementing some stuff in the tree part of the editor, then migrateted to the diagram part of the code. It seems to me, that the diagram part uses a number of approaches for the relations between actions, commands and the stuff that actually does something. Perhaps I am just confused. I have mentioned in the code, where I have found "inspiration" - feel free to comment on it.

- Just spotted : Seems there is some dead code there in the thress files that are changed. Sorry about that, hope you can still be persuaded to review the rest. (Might be dead, might be needed for the global stuff?)

- I have no idea if the stuff I check for is relevant, this includes locking, INameable and possibly other stuff. (Directions much appreciated).

- The user input is proof-of-concept, would probably be better with a single dialog, but I have never created a dialog in Java, so I wanted to check the approach with you before I spend hours trying to build a dialog (Is there a GUI tool for this? Or just something to rough something out?)

- Replace is a sucky generic diffuse word - I lack a better (non-native english speaker here).

- Actions on the main menu, tree view, and toolbar is lacking (could use hints on how to get them there. Seems "Rename" is implemented 1.5 times?).

- No docs or help (I can probably write this without much instruction).

- No key binding support (Needed? Where to look for info on how to add?)

And, probably much more. A review would be great...