Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cc02faf5a28d7f24fefbd6d6e2e4932a04fdfceb (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
/*******************************************************************************
 * Copyright (c) 2011 Wind River Systems, Inc. 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:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tcf.filesystem.ui.internal.testers;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;

/**
 * The property tester of a ColumnViewerEditorActivationEvent. 
 * The properties include "isEditorActivation" which calculates
 * if the event will trigger a cell editing action.
 */
public class EditorActivationEventPropertyTester extends PropertyTester {

	/**
	 * Create an instance.
	 */
	public EditorActivationEventPropertyTester() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
	 */
	@Override
	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
		Assert.isTrue(receiver instanceof ColumnViewerEditorActivationEvent);
		ColumnViewerEditorActivationEvent event = (ColumnViewerEditorActivationEvent) receiver;
		if (property.equals("isEditorActivation")) { //$NON-NLS-1$
			return event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
		}
		return false;
	}
}

Back to the top