KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > text > build > PropertiesTextChangeListener


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.pde.internal.core.text.build;
12
13 import org.eclipse.jface.text.IDocument;
14 import org.eclipse.pde.core.IModelChangedEvent;
15 import org.eclipse.pde.internal.core.text.AbstractKeyValueTextChangeListener;
16 import org.eclipse.pde.internal.core.text.IDocumentKey;
17
18 public class PropertiesTextChangeListener extends AbstractKeyValueTextChangeListener {
19
20     public PropertiesTextChangeListener(IDocument document) {
21         super(document);
22     }
23
24     public void modelChanged(IModelChangedEvent event) {
25         Object JavaDoc[] objects = event.getChangedObjects();
26         for (int i = 0; i < objects.length; i++) {
27             Object JavaDoc object = objects[i];
28             IDocumentKey key = (IDocumentKey)object;
29             fOperationTable.remove(key);
30             switch (event.getChangeType()) {
31                 case IModelChangedEvent.REMOVE :
32                     deleteKey(key);
33                     break;
34                 default :
35                     modifyKey(key);
36             }
37         }
38     }
39
40 }
41
Popular Tags