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 8: Line 8:
 
|-
 
|-
 
! style="width: 20%"| Type  
 
! style="width: 20%"| Type  
! style="width: 20%"| Tag
+
! style="width: 20%"| Value
 
! style="width: 40%"| Description  
 
! style="width: 40%"| Description  
 
! style="width: 15%"| Applies to  
 
! style="width: 15%"| Applies to  
Line 15: Line 15:
  
 
|-
 
|-
| NoClose {false:true}
+
| Tag
 +
| NoClose
 
| Parts within a part stack can be annotated with a <code>"NoClose"</code> tag to indicate that the part should not be closeable. The SWT renderer will configure the corresponding <code>CTabFolder</code> to not display an "X" to close the part.
 
| Parts within a part stack can be annotated with a <code>"NoClose"</code> tag to indicate that the part should not be closeable. The SWT renderer will configure the corresponding <code>CTabFolder</code> to not display an "X" to close the part.
 
| MPartStack
 
| MPartStack
Line 21: Line 22:
  
 
|-
 
|-
| NoMove {false:true}
+
| Tag
 +
| NoMove
 
| A part can be annotated with a <code>"NoMove"</code> tag to indicate that the drag-and-drop system should not allow the user to move this part.
 
| A part can be annotated with a <code>"NoMove"</code> tag to indicate that the drag-and-drop system should not allow the user to move this part.
 
| MPart
 
| MPart
Line 27: Line 29:
  
 
|-
 
|-
 +
| Tag
 
| NoTitle
 
| 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.   
 
| 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.   
Line 33: Line 36:
  
 
|-
 
|-
 +
| State
 
| persistState {false:true}
 
| 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.
 
| 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.
Line 38: Line 42:
 
| [https://google.com/?q=IWorkbench.PERSIST_STATE IWorkbench.PERSIST_STATE]
 
| [https://google.com/?q=IWorkbench.PERSIST_STATE IWorkbench.PERSIST_STATE]
  
|}
+
|-
 
+
| Tag
 +
| stretch
 +
| A <code>TrimBar</code> will replace <code>ToolControl</code>s with a <code>"stretch"</code> tag with stretchable space.  A ToolControl with <code>"glue"</code> will ensure its siblings are kept together on the same line.  The following example will cause the <code>"find"</code> control to be placed flush right: <source lang="xml">
 +
<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>
 +
</source>
 +
| MTrimBar
 +
| [https://google.com/?q=TrimBarLayout.SPACER TrimBarLayout.SPACER]
  
 
+
|-
 
+
| Tag
 
+
| glue
 
+
| A <code>TrimBar</code> will replace <code>ToolControl</code>s with a <code>"stretch"</code> tag with stretchable space.  A ToolControl with <code>"glue"</code> will ensure its siblings are kept together on the same line.  The following example will cause the <code>"find"</code> control to be placed flush right: <source lang="xml">
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.  (Defined by <code>IPresentationEngine.NO_TITLE</code>)
+
 
+
== MTrimBar ==
+
 
+
A <code>TrimBar</code> will replace <code>ToolControl</code>s with a <code>"stretch"</code> tag with stretchable space.  A ToolControl with <code>"glue"</code> will ensure its siblings are kept together on the same line.  The following example will cause the <code>"find"</code> control to be placed flush right:
+
 
+
<source lang="xml">
+
 
<menu:TrimBars>
 
<menu:TrimBars>
 
   <menu:ToolControl contributionURI="platform:/plugin/blah/blah">
 
   <menu:ToolControl contributionURI="platform:/plugin/blah/blah">
Line 60: Line 69:
 
</menu:TrimBars>
 
</menu:TrimBars>
 
</source>
 
</source>
 +
| MTrimBar
 +
| [https://google.com/?q=TrimBarLayout.GLUE TrimBarLayout.GLUE]
  
(defined by TrimBarLayout)
+
|}

Revision as of 10:31, 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 Value Description Applies to Defined by


Tag NoClose 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
Tag NoMove 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
Tag 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
State 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
Tag stretch 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>
MTrimBar TrimBarLayout.SPACER
Tag glue 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>
MTrimBar TrimBarLayout.GLUE

Back to the top