aboutsummaryrefslogtreecommitdiffstats
path: root/rule_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'rule_api/src')
-rw-r--r--rule_api/src/com/android/ide/common/api/AbstractViewRule.java6
-rw-r--r--rule_api/src/com/android/ide/common/api/IViewRule.java11
2 files changed, 17 insertions, 0 deletions
diff --git a/rule_api/src/com/android/ide/common/api/AbstractViewRule.java b/rule_api/src/com/android/ide/common/api/AbstractViewRule.java
index 068580f..e23a567 100644
--- a/rule_api/src/com/android/ide/common/api/AbstractViewRule.java
+++ b/rule_api/src/com/android/ide/common/api/AbstractViewRule.java
@@ -63,6 +63,12 @@ public class AbstractViewRule implements IViewRule {
}
@Override
+ @Nullable
+ public String getDefaultActionId(@NonNull INode node) {
+ return null;
+ }
+
+ @Override
public void paintSelectionFeedback(@NonNull IGraphics graphics, @NonNull INode parentNode,
@NonNull List<? extends INode> childNodes, @Nullable Object view) {
}
diff --git a/rule_api/src/com/android/ide/common/api/IViewRule.java b/rule_api/src/com/android/ide/common/api/IViewRule.java
index b16df26..88b795f 100644
--- a/rule_api/src/com/android/ide/common/api/IViewRule.java
+++ b/rule_api/src/com/android/ide/common/api/IViewRule.java
@@ -102,6 +102,17 @@ public interface IViewRule {
void addContextMenuActions(@NonNull List<RuleAction> actions, @NonNull INode node);
/**
+ * Returns the id of the default action to invoke for this view, typically when the
+ * user presses F2. The id should correspond to the {@link RuleAction#getId()} returned
+ * by one of the actions added by {@link #addContextMenuActions(List, INode)}.
+ *
+ * @param node the primary selected node
+ * @return the id of default action, or null if none is default
+ */
+ @Nullable
+ String getDefaultActionId(@NonNull INode node);
+
+ /**
* Invoked by the Rules Engine to ask the parent layout for the set of layout actions
* to display in the layout bar. The layout rule should add these into the provided
* list. The order the items are added in does not matter; the