001/**
002 * Copyright (C) 2006-2019 Talend Inc. - www.talend.com
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.talend.sdk.component.api.component;
017
018import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
019import static java.lang.annotation.ElementType.PACKAGE;
020import static java.lang.annotation.ElementType.TYPE;
021import static java.lang.annotation.RetentionPolicy.RUNTIME;
022
023import java.lang.annotation.Retention;
024import java.lang.annotation.Target;
025
026import org.talend.sdk.component.api.meta.Documentation;
027
028import lombok.Getter;
029import lombok.RequiredArgsConstructor;
030
031@Documentation("Associate an icon to a component, "
032        + "only supported on components - `@PartitionMapper`, `@Processor`, `@Emitter` - and "
033        + "configurations - `@DataStore` and `@DataSet` - classes.")
034@Target({ TYPE, PACKAGE, ANNOTATION_TYPE })
035@Retention(RUNTIME)
036public @interface Icon {
037
038    /**
039     * @return the icon to associate to the component.
040     */
041    IconType value() default IconType.CUSTOM;
042
043    /**
044     * @return the custom icon key (not in {@link IconType}) to use if {@link Icon#value()} is {@link IconType#CUSTOM}.
045     */
046    String custom() default "";
047
048    /**
049     * Icons from http://talend.surge.sh/icons/.
050     * It is recommended for custom components to use vendor specific icons and not reuse Talend built-in icons.
051     */
052    @RequiredArgsConstructor
053    enum IconType {
054        @Deprecated
055        ACTIVEMQ("activemq"),
056        @Deprecated
057        ACTIVITY("activity"),
058        @Deprecated
059        AGGREGATE("aggregate"),
060        @Deprecated
061        APACHE("apache"),
062        @Deprecated
063        API_DESIGNER_COLORED("api-designer-colored"),
064        @Deprecated
065        API_DESIGNER_NEGATIVE("api-designer-negative"),
066        @Deprecated
067        API_DESIGNER_POSITIVE("api-designer-positive"),
068        @Deprecated
069        API_TESTER_COLORED("api-tester-colored"),
070        @Deprecated
071        API_TESTER_NEGATIVE("api-tester-negative"),
072        @Deprecated
073        API_TESTER_POSITIVE("api-tester-positive"),
074        @Deprecated
075        ARROW_LEFT("arrow-left"),
076        @Deprecated
077        ARROW_RIGHT("arrow-right"),
078        @Deprecated
079        AWS_KINESIS("aws-kinesis"),
080        @Deprecated
081        AZURE_EVENT_HUBS("azure-event-hubs"),
082        @Deprecated
083        BADGE("badge"),
084        @Deprecated
085        BADGE_OUTLINE("badge-outline"),
086        @Deprecated
087        BEAM("beam"),
088        @Deprecated
089        BELL("bell"),
090        @Deprecated
091        BELL_NOTIFICATION("bell-notification"),
092        @Deprecated
093        BIGQUERY("bigquery"),
094        @Deprecated
095        BLOCK("block"),
096        @Deprecated
097        BOARD("board"),
098        @Deprecated
099        BUBBLES("bubbles"),
100        @Deprecated
101        BURGER("burger"),
102        @Deprecated
103        CALENDAR_MOVE("calendar-move"),
104        @Deprecated
105        CAMPAIGNS("campaigns"),
106        @Deprecated
107        CARET_DOWN("caret-down"),
108        @Deprecated
109        CARRIAGE_RETURN("carriage-return"),
110        @Deprecated
111        CASSANDRA("cassandra"),
112        @Deprecated
113        CHAIN("chain"),
114        @Deprecated
115        CHARACTER("character"),
116        @Deprecated
117        CHARTS("charts"),
118        @Deprecated
119        CHECK("check"),
120        @Deprecated
121        CHECK_CIRCLE("check-circle"),
122        @Deprecated
123        CHECK_PLUS("check-plus"),
124        @Deprecated
125        CHEVRON_END("chevron-end"),
126        @Deprecated
127        CHEVRON_LEFT("chevron-left"),
128        @Deprecated
129        CLOCK("clock"),
130        @Deprecated
131        CLOUD_ENGINE("cloud-engine"),
132        @Deprecated
133        CLOUD_UPGRADE("cloud-upgrade"),
134        @Deprecated
135        CLUSTER("cluster"),
136        @Deprecated
137        COG("cog"),
138        @Deprecated
139        COLUMN_CHOOSER("column-chooser"),
140        @Deprecated
141        COMPONENT_KIT_NEGATIVE("component-kit-negative"),
142        @Deprecated
143        COMPONENT_KIT_POSITIVE("component-kit-positive"),
144        @Deprecated
145        COMPONENT_NEGATIVE("component-negative"),
146        @Deprecated
147        COMPONENT_POSITIVE("component-positive"),
148        @Deprecated
149        CONNECTIONS("connections"),
150        @Deprecated
151        CONTAINS("contains"),
152        @Deprecated
153        COUCHBASE("couchbase"),
154        @Deprecated
155        CREDITS_ENGINE("credits-engine"),
156        @Deprecated
157        CROSS("cross"),
158        @Deprecated
159        CROSSHAIRS("crosshairs"),
160        @Deprecated
161        DATAGRID("datagrid"),
162        @Deprecated
163        DATAPREP("dataprep"),
164        @Deprecated
165        DATASETS("datasets"),
166        @Deprecated
167        DATASTORE("datastore"),
168        @Deprecated
169        DATASTREAMS_COLORED("datastreams-colored"),
170        @Deprecated
171        DATASTREAMS_NEGATIVE("datastreams-negative"),
172        @Deprecated
173        DATASTREAMS_POSITIVE("datastreams-positive"),
174        @Deprecated
175        DATA_FABRIC_COLORED("data-fabric-colored"),
176        @Deprecated
177        DATA_MODELS("data-models"),
178        @Deprecated
179        DB_INPUT("db-input"),
180        @Deprecated
181        DOWNLOAD("download"),
182        @Deprecated
183        DRAG("drag"),
184        @Deprecated
185        DRAG_AND_DROP("drag-and-drop"),
186        @Deprecated
187        DROPPER("dropper"),
188        @Deprecated
189        ELASTIC("elastic"),
190        @Deprecated
191        ELLIPSIS("ellipsis"),
192        @Deprecated
193        EMPTY_CALENDAR("empty-calendar"),
194        @Deprecated
195        EMPTY_CELL("empty-cell"),
196        @Deprecated
197        EMPTY_CHAR("empty-char"),
198        @Deprecated
199        EMPTY_SPACE("empty-space"),
200        @Deprecated
201        ENVIRONMENT("environment"),
202        @Deprecated
203        EQUAL("equal"),
204        @Deprecated
205        EXPANDED("expanded"),
206        @Deprecated
207        EXPORT_HISTORY("export-history"),
208        @Deprecated
209        EYE("eye"),
210        @Deprecated
211        EYE_SLASH("eye-slash"),
212        @Deprecated
213        FIELDGLASS("fieldglass"),
214        @Deprecated
215        FIELD_SELECTOR("field-selector"),
216        @Deprecated
217        FILES_O("files-o"),
218        @Deprecated
219        FILE_COG("file-cog"),
220        @Deprecated
221        FILE_COMPRESSED("file-compressed"),
222        @Deprecated
223        FILE_CONNECT_O("file-connect-o"),
224        @Deprecated
225        FILE_CSV_O("file-csv-o"),
226        @Deprecated
227        FILE_DATABASE_O("file-database-o"),
228        @Deprecated
229        FILE_HDFS_O("file-hdfs-o"),
230        @Deprecated
231        FILE_JOB_O("file-job-o"),
232        @Deprecated
233        FILE_JSON_O("file-json-o"),
234        @Deprecated
235        FILE_MOVE("file-move"),
236        @Deprecated
237        FILE_O("file-o"),
238        @Deprecated
239        FILE_S3_O("file-s3-o"),
240        @Deprecated
241        FILE_SALESFORCE("file-salesforce"),
242        @Deprecated
243        FILE_TXT_O("file-txt-o"),
244        @Deprecated
245        FILE_XLSX_O("file-xlsx-o"),
246        @Deprecated
247        FILE_XLS_O("file-xls-o"),
248        @Deprecated
249        FILE_XML_O("file-xml-o"),
250        @Deprecated
251        FILTER("filter"),
252        @Deprecated
253        FILTER_COLUMN("filter-column"),
254        @Deprecated
255        FILTER_ROW("filter-row"),
256        @Deprecated
257        FLINK("flink"),
258        @Deprecated
259        FLINK_O("flink-o"),
260        @Deprecated
261        FLOW("flow"),
262        @Deprecated
263        FLOW_O("flow-o"),
264        @Deprecated
265        FLOW_SOURCE_O("flow-source-o"),
266        @Deprecated
267        FLOW_STEP_O("flow-step-o"),
268        @Deprecated
269        FLOW_TARGET_O("flow-target-o"),
270        @Deprecated
271        FLOW_UNDER_PLAN("flow-under-plan"),
272        @Deprecated
273        FLOW_UNFINISHED("flow-unfinished"),
274        @Deprecated
275        FOLDER("folder"),
276        @Deprecated
277        FOLDER_CLOSED("folder-closed"),
278        @Deprecated
279        FOLDER_SHARED("folder-shared"),
280        @Deprecated
281        FOLDER_SHARED_OWNER("folder-shared-owner"),
282        @Deprecated
283        FOLDER_SHARED_USER("folder-shared-user"),
284        @Deprecated
285        FULLSCREEN("fullscreen"),
286        @Deprecated
287        GOOGLE_DATAFLOW("google-dataflow"),
288        @Deprecated
289        GROUP_CIRCLE("group-circle"),
290        @Deprecated
291        HADOOP("hadoop"),
292        @Deprecated
293        HAND_POINTER("hand-pointer"),
294        @Deprecated
295        HIERARCHICAL_VIEW("hierarchical-view"),
296        @Deprecated
297        HOME("home"),
298        @Deprecated
299        INFO_CIRCLE("info-circle"),
300        @Deprecated
301        JMS("jms"),
302        @Deprecated
303        KAFKA("kafka"),
304        @Deprecated
305        LAUNCH("launch"),
306        @Deprecated
307        LAUNCHER("launcher"),
308        @Deprecated
309        LESS_THAN("less-than"),
310        @Deprecated
311        LESS_THAN_EQUAL("less-than-equal"),
312        @Deprecated
313        LICENSE("license"),
314        @Deprecated
315        LINK("link"),
316        @Deprecated
317        LOCAL_STORAGE("local-storage"),
318        @Deprecated
319        LOCK("lock"),
320        @Deprecated
321        LOCKED("locked"),
322        @Deprecated
323        LOGO("logo"),
324        @Deprecated
325        LOGO_COLORED("logo-colored"),
326        @Deprecated
327        LOGO_SQUARE("logo-square"),
328        @Deprecated
329        MARKETO("marketo"),
330        @Deprecated
331        MDM_COLORED("mdm-colored"),
332        @Deprecated
333        MDM_NEGATIVE("mdm-negative"),
334        @Deprecated
335        MDM_POSITIVE("mdm-positive"),
336        @Deprecated
337        MINUS_CIRCLE("minus-circle"),
338        @Deprecated
339        MONGODB("mongodb"),
340        @Deprecated
341        MORE_THAN("more-than"),
342        @Deprecated
343        MORE_THAN_EQUAL("more-than-equal"),
344        @Deprecated
345        MOST_TRUSTED("most-trusted"),
346        @Deprecated
347        NETSUITE("netsuite"),
348        @Deprecated
349        NETWORK("network"),
350        @Deprecated
351        NORMALIZE("normalize"),
352        @Deprecated
353        NOTE("note"),
354        @Deprecated
355        NOT_EQUAL("not-equal"),
356        @Deprecated
357        OPENER("opener"),
358        @Deprecated
359        OVERVIEW("overview"),
360        @Deprecated
361        PANEL_OPENER_BOTTOM("panel-opener-bottom"),
362        @Deprecated
363        PANEL_OPENER_RIGHT("panel-opener-right"),
364        @Deprecated
365        PENCIL("pencil"),
366        @Deprecated
367        PHONE("phone"),
368        @Deprecated
369        PIE_CHARTS("pie-charts"),
370        @Deprecated
371        PIN("pin"),
372        @Deprecated
373        PLACEHOLDER("placeholder"),
374        @Deprecated
375        PLAY("play"),
376        @Deprecated
377        PLUS("plus"),
378        @Deprecated
379        PLUS_CIRCLE("plus-circle"),
380        @Deprecated
381        POSTGRESQL("postgresql"),
382        @Deprecated
383        POWER_OFF("power-off"),
384        @Deprecated
385        PROJECTS("projects"),
386        @Deprecated
387        PROMOTION_PIPELINES("promotion-pipelines"),
388        @Deprecated
389        PUBSUB("pubsub"),
390        @Deprecated
391        PYTHON("python"),
392        @Deprecated
393        QUESTION_CIRCLE("question-circle"),
394        @Deprecated
395        QUOTES("quotes"),
396        @Deprecated
397        RAW_DATA("raw-data"),
398        @Deprecated
399        REDO("redo"),
400        @Deprecated
401        REFRESH("refresh"),
402        @Deprecated
403        REMOTE_ENGINE("remote-engine"),
404        @Deprecated
405        REPLICATE("replicate"),
406        @Deprecated
407        REST("rest"),
408        @Deprecated
409        ROLES("roles"),
410        @Deprecated
411        SAMPLE("sample"),
412        @Deprecated
413        SCHEDULER("scheduler"),
414        @Deprecated
415        SEARCH("search"),
416        @Deprecated
417        SEMANTIC("semantic"),
418        @Deprecated
419        SEND("send"),
420        @Deprecated
421        SHARE_ALT("share-alt"),
422        @Deprecated
423        SHARING_DEFAULT("sharing-default"),
424        @Deprecated
425        SHARING_OWNER("sharing-owner"),
426        @Deprecated
427        SHARING_USER("sharing-user"),
428        @Deprecated
429        SHIELD("shield"),
430        @Deprecated
431        SHIELD_FULL("shield-full"),
432        @Deprecated
433        SHIELD_FULL_CHECK("shield-full-check"),
434        @Deprecated
435        SHOW_UNASSIGNED_TASKS("show_unassigned_tasks"),
436        @Deprecated
437        SLIDERS("sliders"),
438        @Deprecated
439        SMILEY_ANGRY("smiley-angry"),
440        @Deprecated
441        SMILEY_ENTHUSIAST("smiley-enthusiast"),
442        @Deprecated
443        SMILEY_NEUTRAL("smiley-neutral"),
444        @Deprecated
445        SMILEY_SATISFIED("smiley-satisfied"),
446        @Deprecated
447        SMILEY_SLEEP("smiley-sleep"),
448        @Deprecated
449        SMILEY_UNHAPPY("smiley-unhappy"),
450        @Deprecated
451        SORT("sort"),
452        @Deprecated
453        SORT_19("sort-19"),
454        @Deprecated
455        SORT_91("sort-91"),
456        @Deprecated
457        SORT_ASC("sort-asc"),
458        @Deprecated
459        SORT_AZ("sort-az"),
460        @Deprecated
461        SORT_DESC("sort-desc"),
462        @Deprecated
463        SORT_ZA("sort-za"),
464        @Deprecated
465        SPARK("spark"),
466
467        STAR("star"), // used by the starter and not really vendor specific so ok to keep
468
469        @Deprecated
470        STOP("stop"),
471        @Deprecated
472        STREAMS("streams"),
473        @Deprecated
474        TABLE("table"),
475        @Deprecated
476        TAGS("tags"),
477        @Deprecated
478        TASKS("tasks"),
479        @Deprecated
480        TDC_COLORED("tdc-colored"),
481        @Deprecated
482        TDC_NEGATIVE("tdc-negative"),
483        @Deprecated
484        TDC_POSITIVE("tdc-positive"),
485        @Deprecated
486        TDP_COLORED("tdp-colored"),
487        @Deprecated
488        TDP_NEGATIVE("tdp-negative"),
489        @Deprecated
490        TDP_POSITIVE("tdp-positive"),
491        @Deprecated
492        TDS_COLORED("tds-colored"),
493        @Deprecated
494        TDS_NEGATIVE("tds-negative"),
495        @Deprecated
496        TDS_POSITIVE("tds-positive"),
497        @Deprecated
498        TIC_COLORED("tic-colored"),
499        @Deprecated
500        TIC_NEGATIVE("tic-negative"),
501        @Deprecated
502        TIC_POSITIVE("tic-positive"),
503        @Deprecated
504        TILES("tiles"),
505        @Deprecated
506        TMC_COLORED("tmc-colored"),
507        @Deprecated
508        TMC_NEGATIVE("tmc-negative"),
509        @Deprecated
510        TMC_POSITIVE("tmc-positive"),
511        @Deprecated
512        TRANSFORMER_WINDOW("transformer-window"),
513        @Deprecated
514        TRASH("trash"),
515        @Deprecated
516        TYPE_CONVERTER("type-converter"),
517        @Deprecated
518        UNDO("undo"),
519        @Deprecated
520        UNION("union"),
521        @Deprecated
522        UNLOCKED("unlocked"),
523        @Deprecated
524        UPLOAD("upload"),
525        @Deprecated
526        USER_CIRCLE("user-circle"),
527        @Deprecated
528        VERSIONING("versioning"),
529        @Deprecated
530        WARNING("warning"),
531        @Deprecated
532        WEBHOOK("webhook"),
533        @Deprecated
534        WINDOW("window"),
535        @Deprecated
536        WORD("word"),
537        @Deprecated
538        WORKSPACES("workspaces"),
539        @Deprecated
540        WORLD("world"),
541        @Deprecated
542        ZOOMIN("zoomin"),
543        @Deprecated
544        ZOOMOUT("zoomout"),
545
546        CUSTOM("custom"), // default and only recommended mode now
547
548        @Deprecated // use a specific icon as much as possible
549        DEFAULT("default");
550
551        @Getter
552        private final String key;
553    }
554}