01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.ui.tests.dialogs;
11:
12: import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.BuildpathModifierAction;
13:
14: /**
15: * Event that is fired from <code>PackageExplorerActionGroup</code>
16: * if some change on the available actions happens.
17: */
18: public class PackageExplorerActionEvent {
19:
20: private String[] fEnabledActionsDescriptions;
21: private BuildpathModifierAction[] fEnabledActions;
22:
23: /**
24: * Create a package explorer action event containing actions
25: * and their corresponding descriptions. It is allowed to
26: * provide arrays which are empty, <code>null</code> is not
27: * allowed.
28: *
29: * Also consider the case where there are no actions (the size is zero), but
30: * the description array contains one element which contains a statement for
31: * the fact that there are no actions.
32: *
33: * @param enabledActionsDescriptions an array of descriptions for the
34: * actions. The description at position 'i' must correspond to the action at
35: * position 'i'.
36: * @param enabledActions an array of actions
37: */
38: public PackageExplorerActionEvent(
39: String[] enabledActionsDescriptions,
40: BuildpathModifierAction[] enabledActions) {
41: fEnabledActionsDescriptions = enabledActionsDescriptions;
42: fEnabledActions = enabledActions;
43: }
44:
45: /**
46: * Get the available actions. To get the corresponding
47: * descriptions, <code>getEnabledActionsText()</code> can
48: * be used.
49: *
50: * @return an array of available actions, can be empty, but
51: * not <code>null</code>.
52: *
53: * @see #getEnabledActionsText()
54: */
55: public BuildpathModifierAction[] getEnabledActions() {
56: return fEnabledActions;
57: }
58:
59: /**
60: * Get the descriptions to the available actions.
61: *
62: * @return an array of descriptions corresponding to
63: * the available actions of <code>getEnabledActions</code>.
64: * Can be empty, but not <code>null</code>.
65: *
66: * @see #getEnabledActions()
67: */
68: public String[] getEnabledActionsText() {
69: return fEnabledActionsDescriptions;
70: }
71: }
|