Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Eclipse4/RCP/Modeled UI/Tags"

< Eclipse4‎ | RCP‎ | Modeled UI
Line 1: Line 1:
Most model elements support additional annotations called "tags".  These tags are free-form strings; the model renderer may interpret certain tags to configure how an element is to be rendered.  Several of these tags are defined on IPresentationEngine.
+
Most model elements support additional annotations called "tags". In addition to tags, a key/value store can also be defined which is called "persistedState".  The tags an persisted state are free-form; the model renderer may interpret certain tags or persisted state to configure how an element is to be rendered.  You can also use the tags and persisted state yourself to put information in the model.
 +
 
 +
[[file:tagsandstate.png|border]]
 +
 
  
 
{| class="wikitable" | style="margin:auto";cellpadding="50px"
 
{| class="wikitable" | style="margin:auto";cellpadding="50px"
|+ Eclipse E4 Model Tags
+
|+ Eclipse E4 Model Tags and Persisted State elements
 
|-
 
|-
 +
! style="width: 20%"| Type
 
! style="width: 20%"| Tag  
 
! style="width: 20%"| Tag  
! style="width: 50%"| Description  
+
! style="width: 40%"| Description  
 
! style="width: 15%"| Applies to  
 
! style="width: 15%"| Applies to  
 
! style="width: 15%"| Defined by
 
! style="width: 15%"| Defined by
Line 21: Line 25:
 
| MPart
 
| MPart
 
| [https://google.com/?q=IPresentationEngine.NO_MOVE IPresentationEngine.NO_MOVE]
 
| [https://google.com/?q=IPresentationEngine.NO_MOVE IPresentationEngine.NO_MOVE]
 +
 +
|-
 +
| NoTitle
 +
| Parts within a part stack can be annotated with a <code>"NoTitle"</code> tag to indicate that the part should not have a rendered title. 
 +
| MPart
 +
| [https://google.com/?q=IPresentationEngine.NO_TITLE IPresentationEngine.NO_TITLE]
  
 
|-
 
|-

Revision as of 10:22, 11 May 2022

Most model elements support additional annotations called "tags". In addition to tags, a key/value store can also be defined which is called "persistedState". The tags an persisted state are free-form; the model renderer may interpret certain tags or persisted state to configure how an element is to be rendered. You can also use the tags and persisted state yourself to put information in the model.

Tagsandstate.png


Eclipse E4 Model Tags and Persisted State elements
Type Tag Description Applies to Defined by


NoClose {false:true} Parts within a part stack can be annotated with a "NoClose" tag to indicate that the part should not be closeable. The SWT renderer will configure the corresponding CTabFolder to not display an "X" to close the part. MPartStack IPresentationEngine.NO_CLOSE
NoMove {false:true} A part can be annotated with a "NoMove" tag to indicate that the drag-and-drop system should not allow the user to move this part. MPart IPresentationEngine.NO_MOVE
NoTitle Parts within a part stack can be annotated with a "NoTitle" tag to indicate that the part should not have a rendered title. MPart IPresentationEngine.NO_TITLE
persistState {false:true} Whether the workbench should save and restore its state. Individual model elements can add it to their persistedState with the value of "false" to declare that they should not be persisted.  ?? IWorkbench.PERSIST_STATE




Parts within a part stack can be annotated with a "NoTitle" tag to indicate that the part should not have a rendered title. (Defined by IPresentationEngine.NO_TITLE)

MTrimBar

A TrimBar will replace ToolControls with a "stretch" tag with stretchable space. A ToolControl with "glue" will ensure its siblings are kept together on the same line. The following example will cause the "find" control to be placed flush right:

<menu:TrimBars>
  <menu:ToolControl contributionURI="platform:/plugin/blah/blah">
    <tags>stretch</tags>
  </menu:ToolControl>
  <menu:ToolControl elementId="com.example.find"
      contributionURI="platform:/plugin/com.example.find/com.example.FindTextField"/>
</menu:TrimBars>

(defined by TrimBarLayout)

Back to the top