AI2 Component  (Version nb184)
ComponentCategory.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2017 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 
7 package com.google.appinventor.components.common;
8 
9 import java.util.HashMap;
10 import java.util.Map;
11 
15 //public enum ComponentCategory {
16 // // TODO(user): i18n category names
17 // USERINTERFACE(MESSAGES.UIComponentPallette()),
18 // LAYOUT(MESSAGES.layoutComponentPallette()),
19 // MEDIA(MESSAGES.mediaComponentPallette()),
20 // ANIMATION(MESSAGES.drawanimationComponentPallette()),
21 // SENSORS(MESSAGES.sensorsComponentPallette()),
22 // SOCIAL(MESSAGES.socialComponentPallette()),
23 // STORAGE(MESSAGES.storageComponentPallette()),
24 // CONNECTIVITY(MESSAGES.connectivityComponentPallette()),
25 // LEGOMINDSTORMS(MESSAGES.legoComponentPallette()),
26 // //EXPERIMENTAL(MESSAGES.experimentalComponentPallette()),
27 // INTERNAL(MESSAGES.internalUseComponentPallette()),
28 // // UNINITIALIZED is used as a default value so Swing libraries can still compile
29 // UNINITIALIZED(MESSAGES.uninitializedComponentPallette());
30 //
31 //
32 // // Mapping of component categories to names consisting only of lower-case letters,
33 // // suitable for appearing in URLs.
34 // private static final Map<String, String> DOC_MAP = new HashMap<String, String>();
35 // static {
36 // DOC_MAP.put(MESSAGES.UIComponentPallette(), "userinterface");
37 // DOC_MAP.put(MESSAGES.layoutComponentPallette(), "layout");
38 // DOC_MAP.put(MESSAGES.mediaComponentPallette(), "media");
39 // DOC_MAP.put(MESSAGES.drawanimationComponentPallette(), "animation");
40 // DOC_MAP.put(MESSAGES.sensorsComponentPallette(), "sensors");
41 // DOC_MAP.put(MESSAGES.socialComponentPallette(), "social");
42 // DOC_MAP.put(MESSAGES.storageComponentPallette(), "storage");
43 // DOC_MAP.put(MESSAGES.connectivityComponentPallette(), "connectivity");
44 // DOC_MAP.put(MESSAGES.legoComponentPallette(), "legomindstorms");
45 // //DOC_MAP.put(MESSAGES.experimentalComponentPallette(), "experimental");
46 // }
47 
48  public enum ComponentCategory {
49  // TODO(user): i18n category names
50  USERINTERFACE("User Interface"),
51  LAYOUT("Layout"),
52  MEDIA("Media"),
53  ANIMATION("Drawing and Animation"),
54  MAPS("Maps"),
55  SENSORS("Sensors"),
56  SOCIAL("Social"),
57  STORAGE("Storage"),
58  CONNECTIVITY("Connectivity"),
59  LEGOMINDSTORMS("LEGO\u00AE MINDSTORMS\u00AE"),
60  EXPERIMENTAL("Experimental"),
61  EXTENSION("Extension"),
62  INTERNAL("For internal use only"),
63  // UNINITIALIZED is used as a default value so Swing libraries can still compile
64  UNINITIALIZED("Uninitialized");
65 
66 
67  // Mapping of component categories to names consisting only of lower-case letters,
68  // suitable for appearing in URLs.
69  private static final Map<String, String> DOC_MAP = new HashMap<String, String>();
70  static {
71  DOC_MAP.put("User Interface", "userinterface");
72  DOC_MAP.put("Layout", "layout");
73  DOC_MAP.put("Media", "media");
74  DOC_MAP.put("Drawing and Animation", "animation");
75  DOC_MAP.put("Maps", "maps");
76  DOC_MAP.put("Sensors", "sensors");
77  DOC_MAP.put("Social", "social");
78  DOC_MAP.put("Storage", "storage");
79  DOC_MAP.put("Connectivity", "connectivity");
80  DOC_MAP.put("LEGO\u00AE MINDSTORMS\u00AE", "legomindstorms");
81  DOC_MAP.put("Experimental", "experimental");
82  DOC_MAP.put("Extension", "extension");
83  }
84 
85 
86  private String name;
87 
88  private ComponentCategory(String categoryName) {
89  name = categoryName;
90  }
91 
99  public String getName() {
100  return name;
101  }
102 
111  public String getDocName() {
112  return DOC_MAP.get(name);
113  }
114 }
com.google.appinventor.components.common.ComponentCategory.USERINTERFACE
USERINTERFACE
Definition: ComponentCategory.java:50
com.google.appinventor.components.common.ComponentCategory.UNINITIALIZED
UNINITIALIZED
Definition: ComponentCategory.java:64
com.google.appinventor.components.common.ComponentCategory.MEDIA
MEDIA
Definition: ComponentCategory.java:52
com.google.appinventor.components.common.ComponentCategory.MAPS
MAPS
Definition: ComponentCategory.java:54
com.google.appinventor.components.common.ComponentCategory.getName
String getName()
Definition: ComponentCategory.java:99
com.google.appinventor.components.common.ComponentCategory.EXPERIMENTAL
EXPERIMENTAL
Definition: ComponentCategory.java:60
com.google.appinventor.components.common.ComponentCategory.SENSORS
SENSORS
Definition: ComponentCategory.java:55
com.google.appinventor.components.common.ComponentCategory.INTERNAL
INTERNAL
Definition: ComponentCategory.java:62
com.google.appinventor.components.common.ComponentCategory.LEGOMINDSTORMS
LEGOMINDSTORMS
Definition: ComponentCategory.java:59
com.google.appinventor.components.common.ComponentCategory.CONNECTIVITY
CONNECTIVITY
Definition: ComponentCategory.java:58
com.google.appinventor.components.common.ComponentCategory.getDocName
String getDocName()
Definition: ComponentCategory.java:111
com.google.appinventor.components.common.ComponentCategory
Definition: ComponentCategory.java:48
com.google.appinventor.components.common.ComponentCategory.STORAGE
STORAGE
Definition: ComponentCategory.java:57
com.google.appinventor.components.common.ComponentCategory.ANIMATION
ANIMATION
Definition: ComponentCategory.java:53
com.google.appinventor.components.common.ComponentCategory.LAYOUT
LAYOUT
Definition: ComponentCategory.java:51
com.google.appinventor.components.common.ComponentCategory.SOCIAL
SOCIAL
Definition: ComponentCategory.java:56
com.google.appinventor.components.common.ComponentCategory.EXTENSION
EXTENSION
Definition: ComponentCategory.java:61