Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 06b5562f9d8471d63fe7585ebf1c3df8362ad139 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*******************************************************************************
 *  Copyright (c) 2000, 2008 IBM Corporation and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 * 
 *  Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.pde.internal.core;

import org.eclipse.pde.core.IModel;
import org.eclipse.pde.core.IModelProviderEvent;

public class ModelProviderEvent implements IModelProviderEvent {
	private int types;
	private Object source;
	private IModel[] added;
	private IModel[] removed;
	private IModel[] changed;

	public ModelProviderEvent(Object source, int types, IModel[] added, IModel[] removed, IModel[] changed) {
		this.source = source;
		this.types = types;
		this.added = added;
		this.removed = removed;
		this.changed = changed;
	}

	@Override
	public IModel[] getAddedModels() {
		return (added == null) ? new IModel[0] : added;
	}

	@Override
	public IModel[] getRemovedModels() {
		return (removed == null) ? new IModel[0] : removed;
	}

	@Override
	public IModel[] getChangedModels() {
		return (changed == null) ? new IModel[0] : changed;
	}

	@Override
	public int getEventTypes() {
		return types;
	}

	@Override
	public Object getEventSource() {
		return source;
	}
}

Back to the top