IMenuCallback.java revision a0bccbddc52575255c5ce19c9d2c96d9639d26ca
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.eclipse.org/org/documents/epl-v10.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.ide.common.api;
18
19import java.util.List;
20
21/**
22 * Callback interface for a {@link RuleAction}. The callback performs the actual
23 * work of the action, and this level of indirection allows multiple actions (which
24 * typically do not have their own class, only their own instances) to share a single
25 * implementation callback class.
26 * <p>
27 * <b>NOTE: This is not a public or final API; if you rely on this be prepared
28 * to adjust your code for the next tools release.</b>
29 * </p>
30 */
31public interface IMenuCallback {
32    /**
33     * Performs the actual work promised by the {@link RuleAction}.
34     * @param action The action being applied.
35     * @param selectedNodes The nodes to apply the action to
36     * @param valueId For a Choices action, the string id of the selected choice
37     * @param newValue For a toggle or for a flag, true if the item is being
38     *            checked, false if being unchecked. For enums this is not
39     *            useful; however for flags it allows one to add or remove items
40     *            to the flag's choices.
41     */
42    void action(RuleAction action, List<? extends INode> selectedNodes, String valueId,
43            Boolean newValue);
44}
45