KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > common > notify > impl > AdapterImpl


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: AdapterImpl.java,v 1.3 2005/06/08 06:19:08 nickb Exp $
16  */

17 package org.eclipse.emf.common.notify.impl;
18
19
20 import org.eclipse.emf.common.notify.Adapter;
21 import org.eclipse.emf.common.notify.Notification;
22 import org.eclipse.emf.common.notify.Notifier;
23
24
25
26 /**
27  * An extensible adapter implementation.
28  */

29 public class AdapterImpl implements Adapter.Internal
30 {
31   /**
32    * The last notifier set to this adapter.
33    */

34   protected Notifier target = null;
35
36   /**
37    * Creates an instance.
38    */

39   public AdapterImpl()
40   {
41   }
42
43   /**
44    * Returns <code>false</code>
45    * @param type the type.
46    * @return <code>false</code>
47    */

48   public boolean isAdapterForType(Object JavaDoc type)
49   {
50     return false;
51   }
52
53   /**
54    * Does nothing; clients may override so that it does something.
55    */

56   public void notifyChanged(Notification msg)
57   {
58   }
59
60   /*
61    * Javadoc copied from interface.
62    */

63   public Notifier getTarget()
64   {
65     return target;
66   }
67
68   /*
69    * Javadoc copied from interface.
70    */

71   public void setTarget(Notifier newTarget)
72   {
73     target = newTarget;
74   }
75
76   /*
77    * Javadoc copied from interface.
78    */

79   public void unsetTarget(Notifier oldTarget)
80   {
81     if (target == oldTarget)
82     {
83       setTarget(null);
84     }
85   }
86 }
87
Popular Tags