01 /*
02 * SPDX-License-Identifier: Apache-2.0
03 *
04 * Copyright 2008-2017 the original author or authors.
05 *
06 * Licensed under the Apache License, Version 2.0 (the "License");
07 * you may not use this file except in compliance with the License.
08 * You may obtain a copy of the License at
09 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 package griffon.core.controller;
19
20 import griffon.core.artifact.GriffonController;
21
22 import javax.annotation.Nonnull;
23 import javax.annotation.Nullable;
24
25 /**
26 * @author Andres Almiray
27 * @since 2.0.0
28 */
29 public interface Action {
30 String KEY_ACTION_NAME = "actionName";
31 String KEY_NAME = "name";
32 String KEY_ENABLED = "enabled";
33
34 /**
35 * Returns the metadata of this action.
36 *
37 * @since 2.11.0
38 */
39 @Nonnull
40 ActionMetadata getActionMetadata();
41
42 @Nonnull
43 String getActionName();
44
45 /**
46 * Returns the fully qualified name of this action.</p>
47 * The value should be the controller's full class name and the action's name joined by a period.
48 *
49 * @return the fully qualified name of this action.
50 *
51 * @since 2.1.0
52 */
53 @Nonnull
54 String getFullyQualifiedName();
55
56 @Nullable
57 String getName();
58
59 void setName(@Nullable String name);
60
61 boolean isEnabled();
62
63 void setEnabled(boolean enabled);
64
65 @Nonnull
66 ActionManager getActionManager();
67
68 @Nonnull
69 GriffonController getController();
70
71 @Nonnull
72 Object getToolkitAction();
73
74 void execute(Object... args);
75
76 void initialize();
77 }
|