KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > launching > VMListener


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.launching;
12
13 import org.eclipse.jdt.launching.IVMInstall;
14 import org.eclipse.jdt.launching.IVMInstallChangedListener;
15 import org.eclipse.jdt.launching.PropertyChangeEvent;
16
17 /**
18  * Simple VM listener that reports whether VM settings have changed.
19  *
20  * @since 3.2
21  *
22  */

23 public class VMListener implements IVMInstallChangedListener {
24     
25     private boolean fChanged = false;
26
27     /* (non-Javadoc)
28      * @see org.eclipse.jdt.launching.IVMInstallChangedListener#defaultVMInstallChanged(org.eclipse.jdt.launching.IVMInstall, org.eclipse.jdt.launching.IVMInstall)
29      */

30     public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
31         fChanged = true;
32     }
33
34     /* (non-Javadoc)
35      * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmAdded(org.eclipse.jdt.launching.IVMInstall)
36      */

37     public void vmAdded(IVMInstall vm) {
38         fChanged = true;
39     }
40
41     /* (non-Javadoc)
42      * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmChanged(org.eclipse.jdt.launching.PropertyChangeEvent)
43      */

44     public void vmChanged(PropertyChangeEvent event) {
45         fChanged = true;
46     }
47
48     /* (non-Javadoc)
49      * @see org.eclipse.jdt.launching.IVMInstallChangedListener#vmRemoved(org.eclipse.jdt.launching.IVMInstall)
50      */

51     public void vmRemoved(IVMInstall vm) {
52         fChanged = true;
53     }
54     
55     public boolean isChanged() {
56         return fChanged;
57     }
58
59 }
60
Popular Tags