KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > JonasProjectChangeListener


1 package com.bull.eclipse.jonas;
2
3 /*
4  * (c) Copyright Bull SA 2003.
5  * All Rights Reserved.
6  */

7
8 import org.eclipse.core.resources.IProject;
9 import org.eclipse.core.resources.IResourceChangeEvent;
10 import org.eclipse.core.resources.IResourceChangeListener;
11 import org.eclipse.swt.widgets.Display;
12 //MANUimport org.eclipse.ui.IWorkbenchWindow;
13
//MANUimport org.eclipse.ui.PlatformUI;
14

15 public class JonasProjectChangeListener implements IResourceChangeListener, JonasPluginResources {
16
17     /*
18      * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
19      */

20     public void resourceChanged(IResourceChangeEvent event) {
21         if( event.getResource() instanceof IProject) {
22             final JonasProject project = JonasProject.create((IProject)event.getResource());
23             if(project != null) {
24
25                 Display.getDefault().syncExec(
26                     new Runnable JavaDoc() {
27                         public void run() {
28                             /*MANU
29                             IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
30
31                             String[] labels = {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL};
32                             MessageDialog dialog = new MessageDialog(
33                                 window.getShell(),
34                                 WIZARD_PROJECT_REMOVE_TITLE,
35                                 null,
36                                 WIZARD_PROJECT_REMOVE_DESCRIPTION,
37                                 MessageDialog.QUESTION,
38                                 labels,
39                                 1);
40                                 
41                             if (dialog.open() == MessageDialog.OK ) {
42                                 try {
43                                     project.removeContextInServerXML();
44                                 } catch (Exception ex) {
45                                     JonasLauncherPlugin.log(ex.getMessage());
46                                 }
47                                     
48                             }MANU*/

49                         }
50                     }
51                 );
52
53     
54             }
55         }
56     }
57
58 }
59
Popular Tags