Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5b3edb8af1f510bae8d721173e91670593c6cdac (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*******************************************************************************
 * Copyright (c) 2012, 2013 Tilera Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     William R. Swanson (Tilera Corporation)
 *     Marc Dumais (Ericsson) - Initial API and implementation (Bug 396268)
 *******************************************************************************/

package org.eclipse.cdt.visualizer.ui;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Event;

// ---------------------------------------------------------------------------
// VisualizerAction
// ---------------------------------------------------------------------------

/** Base class for visualizer actions.
 *  (Viewers are not required to use this class. This is simply a
 *  convenience wrapper for the standard Action class.)
 */
public class VisualizerAction extends Action {
	// --- members ---

	// --- constructors/destructors ---

	/** Constructor. */
	protected VisualizerAction() {
		// NOTE: this constructor is only intended for deriving classes
		// that need to construct the text/description/image attributes
		// programmatically.
	}

	/** Constructor. */
	public VisualizerAction(String text, int style) {
		super(text, style);
	}

	/** Constructor. */
	public VisualizerAction(String text, String description) {
		super(text);
		setDescription(description);
	}

	/** Constructor. */
	public VisualizerAction(String text, String description, ImageDescriptor image) {
		super(text, image);
		setDescription(description);
	}

	/** Constructor. */
	public VisualizerAction(String text, String description, ImageDescriptor enabledImage,
			ImageDescriptor disabledImage) {
		super(text, enabledImage);
		setDescription(description);
		setDisabledImageDescriptor(disabledImage);
	}

	/** Dispose method. */
	public void dispose() {
	}

	// --- methods ---

	/** Invoked when action is triggered. */
	public void run() {
	}

	/** Invoked when action is triggered,
	 *  with the event that caused it.
	 */
	public void runWithEvent(Event event) {
		run();
	}
}

Back to the top