• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.ide.common.layout;
18 
19 import com.android.ide.common.api.DropFeedback;
20 import com.android.ide.common.api.IDragElement;
21 import com.android.ide.common.api.INode;
22 
23 /**
24  * An ignored layout is a layout that should not be treated as a layout by the
25  * visual editor (usually because the widget extends a layout class we recognize
26  * and support, but where the widget is more restrictive in how it manages its
27  * children so we don't want to expose the normal configuration options).
28  * <p>
29  * For example, the ZoomControls widget is not user-configurable as a
30  * LinearLayout even though it extends it. Our ZoomControls rule is therefore a
31  * subclass of this {@link IgnoredLayoutRule} class.
32  */
33 public abstract class IgnoredLayoutRule extends BaseLayoutRule {
34     @Override
onDropEnter(INode targetNode, Object targetView, IDragElement[] elements)35     public DropFeedback onDropEnter(INode targetNode, Object targetView, IDragElement[] elements) {
36         // Do nothing; this layout rule corresponds to a layout that
37         // should not be handled as a layout by the visual editor - usually
38         // because some widget is extending a layout for implementation purposes
39         // but does not want to expose configurability of the base layout in the
40         // editor.
41         return null;
42     }
43 }
44