View Javadoc
1   package com.atlassian.plugin.web.api;
2   
3   import com.atlassian.annotations.PublicApi;
4   
5   import javax.annotation.Nonnull;
6   import java.util.Map;
7   
8   /**
9    * Represents an abstract UI element with a number of commonly used properties.
10   * <p>
11   * Attributes returned by getters will not be escaped yet for whatever context they are inserted in. In other words if
12   * are accessing Webfragments to be included in a HTML page, properties returned by getters should be appropriately HTML
13   * escaped.
14   *
15   * @since v3.0.2
16   */
17  @PublicApi
18  public interface WebFragment {
19      /**
20       * @return the complete underlying web-fragment plugin key
21       */
22      String getCompleteKey();
23  
24      /**
25       * @return The label for the fragment
26       */
27      String getLabel();
28  
29      /**
30       * @return The title (tooltip) for the fragment
31       */
32      String getTitle();
33  
34      /**
35       * @return The style to apply to the fragment
36       */
37      String getStyleClass();
38  
39      /**
40       * @return The unique id for the fragment.
41       */
42      String getId();
43  
44      /**
45       * @return untyped params of this fragment
46       */
47      @Nonnull
48      Map<String, String> getParams();
49  
50      /**
51       * @return The weight for the fragment
52       */
53      int getWeight();
54  }