HuaweiTech/eclipse-integration-cloudfoundry — pull request #5 by bluebreezecf (2014-09-17 09:37:35+00:00)
Title: Realize the feature of application replacement for the cloud applications which have no relations with the local projects

- If there is already a cloud application with the same name as the local project, a drag-and-drop operation will cause a confirmation dialog presented.

![issue4_confirmationdialog](https://cloud.githubusercontent.com/assets/7316500/4300597/9fdbeaf2-3e46-11e4-8b6e-31b746325b21.PNG)

If the user press 'Cancel' button, it does noting; while choosing 'OK', the background will delete the corresponding CloudFoundryApplicationModule locally (and not touch the cloud application in CF), create a new Module using the dropped project, package the selected java project, use the generated war to replace
the cloud application by calling CloudFoundryClient.uploadApplication(appName, warFile) .

-If just right click the cloud application which has no relation with the local project, the context menu will show a 'Replace' item.

![issue4_rightmenu](https://cloud.githubusercontent.com/assets/7316500/4300937/d02304c2-3e49-11e4-8886-c2b884e6755d.PNG)

If click the 'Replace' menu item, a dialog to select the replacing project is shown.

![issue4_rightmenuselectiondialog](https://cloud.githubusercontent.com/assets/7316500/4301041/3cee32b0-3e4b-11e4-97cb-9c5342613539.PNG)

Then press 'OK' button a confirmation dialog is presented,

![issue4_rightmenuconfirmdialog](https://cloud.githubusercontent.com/assets/7316500/4301097/ae9a2f04-3e4b-11e4-9201-693ee291c937.PNG)

If choosing 'OK', the background will do the same things to replace the cloud application.In both of the above scenes, the new generated war file will push and replace the contents of the cloud application, the relation between the local project and the cloud application will also be established. So the further code modification can use the 'Update and Restart' button

![issue4_relationestablished](https://cloud.githubusercontent.com/assets/7316500/4301231/d924c422-3e4c-11e4-8535-75e0d851a612.PNG)