• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 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.eclipse.adt.internal.resources;
18 
19 
20 
21 /**
22  * Information needed to represent a View or ViewGroup (aka Layout) item
23  * in the layout hierarchy, as extracted from the main android.jar and the
24  * associated attrs.xml.
25  */
26 public class DeclareStyleableInfo {
27     /** The style name, never null. */
28     private String mStyleName;
29     /** Attributes for this view or view group. Can be empty but never null. */
30     private AttributeInfo[] mAttributes;
31     /** Short javadoc. Can be null. */
32     private String mJavaDoc;
33     /** Optional name of the parents stylable. Can be null. */
34     private String[] mParents;
35 
36     /**
37      * Creates a new {@link DeclareStyleableInfo}.
38      *
39      * @param styleName The name of the style. Should not be empty nor null.
40      * @param attributes The initial list of attributes. Can be null.
41      */
DeclareStyleableInfo(String styleName, AttributeInfo[] attributes)42     public DeclareStyleableInfo(String styleName, AttributeInfo[] attributes) {
43         mStyleName = styleName;
44         mAttributes = attributes == null ? new AttributeInfo[0] : attributes;
45     }
46 
47     /** Returns style name */
getStyleName()48     public String getStyleName() {
49         return mStyleName;
50     }
51 
52     /** Returns the attributes for this view or view group. Maybe empty but not null. */
getAttributes()53     public AttributeInfo[] getAttributes() {
54         return mAttributes;
55     }
56 
57     /** Sets the list of attributes for this View or ViewGroup. */
setAttributes(AttributeInfo[] attributes)58     public void setAttributes(AttributeInfo[] attributes) {
59         mAttributes = attributes;
60     }
61 
62     /** Returns a short javadoc */
getJavaDoc()63     public String getJavaDoc() {
64         return mJavaDoc;
65     }
66 
67     /** Sets the javadoc. */
setJavaDoc(String javaDoc)68     public void setJavaDoc(String javaDoc) {
69         mJavaDoc = javaDoc;
70     }
71 
72     /** Sets the name of the parents styleable. Can be null. */
setParents(String[] parents)73     public void setParents(String[] parents) {
74         mParents = parents;
75     }
76 
77     /** Returns the name of the parents styleable. Can be null. */
getParents()78     public String[] getParents() {
79         return mParents;
80     }
81 }
82