001 /*
002 * CreoleResource.java
003 *
004 * Copyright (c) 2008, The University of Sheffield.
005 *
006 * This file is part of GATE (see http://gate.ac.uk/), and is free
007 * software, licenced under the GNU Library General Public License,
008 * Version 2, June 1991 (in the distribution as file licence.html,
009 * and also available at http://gate.ac.uk/gate/licence.html).
010 *
011 * Ian Roberts, 27/Jul/2008
012 *
013 * $Id: CreoleResource.java 12430 2010-04-04 00:00:40Z ian_roberts $
014 */
015
016 package gate.creole.metadata;
017
018 import gate.Factory;
019 import gate.Resource;
020
021 import java.lang.annotation.Documented;
022 import java.lang.annotation.ElementType;
023 import java.lang.annotation.Retention;
024 import java.lang.annotation.RetentionPolicy;
025 import java.lang.annotation.Target;
026
027 /**
028 * Annotates a CREOLE resource type. This annotation should only be used
029 * on classes or interfaces that implement the {@link Resource} interface
030 * (directly or indirectly).
031 */
032 @Documented
033 @Target( {ElementType.TYPE})
034 @Retention(RetentionPolicy.RUNTIME)
035 public @interface CreoleResource {
036 /**
037 * The name of the resource, as it will appear in the GATE GUI. If
038 * unspecified, defaults to the bare name of the resource class (without its
039 * package).
040 */
041 String name() default "";
042
043 /**
044 * Is the resource private? If true, this resource type will not
045 * appear in the menus of the GATE GUI, though it is still possible to
046 * create it in code using {@link Factory#createResource}.
047 */
048 boolean isPrivate() default false;
049
050 /**
051 * A descriptive comment about this resource, which appears in the
052 * tooltip in the GUI.
053 */
054 String comment() default "";
055
056 /**
057 * A help URL about this resource, which is used to
058 * display the help page in the GATE help browser.
059 */
060 String helpURL() default "";
061
062 /**
063 * Defines any instances of this resource that should be created
064 * automatically when the plugin is loaded.
065 */
066 AutoInstance[] autoinstances() default {};
067
068 /**
069 * The interface implemented by this resource. For example, a document
070 * implementation should specify "gate.Document" here.
071 */
072 String interfaceName() default "";
073
074 /**
075 * The path (in the {@link Class#getResource} sense) to the icon used
076 * to represent this resource in the GUI. A path starting with a
077 * forward slash is treated as an absolute path, a relative path
078 * (without the leading slash) is interpreted relative to
079 * gate/resources/img.
080 */
081 String icon() default "";
082
083 /**
084 * The name of the resource class that this resource is responsible
085 * for displaying in the GUI. Only relevant for visual resources.
086 */
087 String resourceDisplayed() default "";
088
089 /**
090 * The annotation type that this resource displays. Only relevant for
091 * annotation editor resources.
092 */
093 String annotationTypeDisplayed() default "";
094
095 /**
096 * The GUI type of this resource. Only relevant for visual resources.
097 */
098 GuiType guiType() default GuiType.NONE;
099
100 /**
101 * Is this resource the "main" viewer for its target resource type?
102 * Only relevant for visual resources.
103 */
104 boolean mainViewer() default false;
105
106 /**
107 * Is this resource a 'tool' (i.e. should its published actions be
108 * added to the Tools menu)?
109 */
110 boolean tool() default false;
111 }
|