Bug 236626 - Add delete action to DD node in Project Explorer tree.
Summary: Add delete action to DD node in Project Explorer tree.
Status: CLOSED DUPLICATE of bug 289767
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2   Edit
Assignee: Petya Sabeva CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard:
Keywords:
Depends on: 272288
Blocks:
  Show dependency tree
 
Reported: 2008-06-11 09:45 EDT by Chemi CLA
Modified: 2010-05-28 08:17 EDT (History)
2 users (show)

See Also:


Attachments
Delete EJBs 3.0 Action (20.02 KB, patch)
2009-04-13 04:14 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete EJB 3.0 Action (17.94 KB, patch)
2009-04-24 08:21 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete EJB 3.0 Action (17.74 KB, patch)
2009-04-24 09:51 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete EJB 3.0 Action (22.82 KB, patch)
2009-06-26 02:18 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete ejb from DD tree action (30.63 KB, patch)
2009-06-26 11:12 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete ejb from DD tree action (30.71 KB, patch)
2009-07-01 02:16 EDT, Petya Sabeva CLA
no flags Details | Diff
Delete EJBs (45.36 KB, patch)
2009-07-16 07:46 EDT, Petya Sabeva CLA
no flags Details | Diff
project (4.30 KB, application/zip)
2009-07-17 07:00 EDT, Dimitar Giormov CLA
no flags Details
delete ejb (45.76 KB, patch)
2009-07-17 07:49 EDT, Petya Sabeva CLA
no flags Details | Diff
delete action (45.81 KB, patch)
2009-07-17 08:21 EDT, Petya Sabeva CLA
kaloyan: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chemi CLA 2008-06-11 09:45:46 EDT
It would be nice if I can remove EJBs from my project directly deleting them from the DD Node in the Project Explorer View.

Currently, it seems I have to go to the code and delete or the classes related to my EJB (the EJB itself and the interfaces).

Thanks,

   Chemi.
Comment 1 Kaloyan Raev CLA 2008-06-11 10:58:15 EDT
I think we could consider adding a Remove action in the maintenance release. 

However, the situation with deleting the interfaces is a little bit delicate, because:
  - the interfaces can be just in the classpath of the EJB project, but not a Java source files of the project itself.
  - several beans could share one and the same business interface. Deleting one of them together with the interface would corrupt the others. 

May be upon calling the Remove action a dialog should popup to the user explicitly asking which interfaces to delete. Chemi, what is your opinion on this? 
Comment 2 Chemi CLA 2008-06-11 14:04:13 EDT
I didn't consider the scenarios you commented. I was just thinking in EJBs with no shared code between them, and all EJBs contained in the source files of the project.

But yes, I agree with you. It could be an option.
Comment 3 Kaloyan Raev CLA 2008-07-22 11:10:21 EDT
I think it is safer to consider this enhancement for the next major release. 
Comment 4 kiril mitov CLA 2008-08-14 03:32:16 EDT
Using the model of the project one can check if an interface of a bean is implemented by other beans. 

This way the dialog might be open only when a bean interface is not implemented by other beans.
Comment 5 Petya Sabeva CLA 2009-04-13 04:14:48 EDT
Created attachment 131613 [details]
Delete EJBs 3.0 Action
Comment 6 Petya Sabeva CLA 2009-04-24 08:21:04 EDT
Created attachment 133107 [details]
Delete EJB 3.0 Action
Comment 7 Petya Sabeva CLA 2009-04-24 09:51:02 EDT
Created attachment 133119 [details]
Delete EJB 3.0 Action

In this patch a dialog with available removable interfaces is opened only if the business interfaces are source files and are not implemented by other beans.
Comment 8 Dimitar Giormov CLA 2009-04-27 03:43:26 EDT
Petya:

Looks really good, but is missing a few touches,
1. put some icons for the labels, so the user can see the types of the interfaces.
2. place the bean in the space as well and the interfaces as children
3. enable multi-selection for beans.
Comment 9 Petya Sabeva CLA 2009-06-26 02:18:49 EDT
Created attachment 140177 [details]
Delete EJB 3.0 Action
Comment 10 Petya Sabeva CLA 2009-06-26 11:12:01 EDT
Created attachment 140244 [details]
Delete ejb from DD tree action

This patch supports deletion of session bean 2.x interfaces too.
Comment 11 Petya Sabeva CLA 2009-07-01 02:16:03 EDT
Created attachment 140569 [details]
Delete ejb from DD tree action
Comment 12 Dimitar Giormov CLA 2009-07-10 05:14:39 EDT
Hi Petya,

last request :)
During removal of Message Driven Bean there is no confirmation dialog, since this operation cannot be undone.
This is true for 2.x entity beans as well, as well as Entities are not removed from ejb-jar.xml

Comment 13 Petya Sabeva CLA 2009-07-16 07:46:04 EDT
Created attachment 141758 [details]
Delete EJBs

There are already confirmation dialogs, when a Message-driven bean or an Entity is trying to be removed . And with this patch, the action removes EJB of any type from the ejb-jar.xml.
Comment 14 Dimitar Giormov CLA 2009-07-17 06:58:59 EDT
Hi Petya,

I got this exception with the attached project.
Comment 15 Dimitar Giormov CLA 2009-07-17 07:00:16 EDT
Created attachment 141868 [details]
project

java.lang.NullPointerException
	at org.eclipse.jst.jee.ui.internal.navigator.ejb.DeleteEJBAction.deleteBean(DeleteEJBAction.java:81)
	at org.eclipse.jst.jee.ui.internal.navigator.ejb.DeleteEJBAction.run(DeleteEJBAction.java:69)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
Comment 16 Dimitar Giormov CLA 2009-07-17 07:10:00 EDT
I could not reproduce the problem this is something local I guess.
Committing the changes.
Comment 17 Petya Sabeva CLA 2009-07-17 07:49:54 EDT
Created attachment 141871 [details]
delete ejb

Avoid the NullPointerException if there is no existing ejb-jar.xml in the project.
Comment 18 Petya Sabeva CLA 2009-07-17 08:21:46 EDT
Created attachment 141872 [details]
delete action

Avoid ClassCastException when deleting interfaces.
Comment 19 Kaloyan Raev CLA 2009-09-17 13:05:49 EDT
The more generic bug 289767 is open to replace the several bugs that are related to refactoring Java EE artifacts.

*** This bug has been marked as a duplicate of bug 289767 ***