|
|
|
Re: Customizing the Sirius tab bar for 3.x [message #1773081 is a reply to message #1773045] |
Thu, 21 September 2017 09:13 |
Pierre Guilet Messages: 250 Registered: June 2017 |
Senior Member |
|
|
Hi,
Yes you can.
A simple example removing the GMF cut action and the Sirius paste layout action:
<contributionItemProvider
class="org.eclipse.sirius.diagram.ui.internal.providers.SiriusContributionItemProvider"
checkPluginLoaded="false">
<Priority name="Medium"/>
<popupContribution class="org.eclipse.sirius.diagram.ui.tools.internal.menu.DiagramEditorContextMenuProvider">
<popupStructuredContributionCriteria objectClass="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"/>
<popupPredefinedItem
id="cut"
path="/editMenu/copyGroup"
remove="true"/>
<popupPredefinedItem
id="pasteLayoutAction"
path="/editMenu/copyFormatGroup"
remove="true"/>
</popupContribution>
</contributionItemProvider>
What is important with this extension mechanism is the priority system.
You want to remove action declared by sirius <contributionItemProvider class="org.eclipse.sirius.diagram.ui.internal.providers.SiriusContributionItemProvider"> <Priority name="Low" /> in org.eclipse.sirius.diagram.ui
So your contribution must have a higher priority than the sirius one that is Low
A higher priority means your contribution will be handled after the contribution with a lower priority.
Regards,
Pierre
Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
[Updated on: Thu, 21 September 2017 16:13] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Customizing the Sirius tab bar for 3.x [message #1773717 is a reply to message #1773672] |
Tue, 03 October 2017 13:16 |
Pierre Guilet Messages: 250 Registered: June 2017 |
Senior Member |
|
|
Hi,
To hide the menu you just have to hide all its action.
By using spy like I describe above I ended with these extension:
<extension
point="org.eclipse.ui.activities">
<activity
id="myActivity"
name="%activityName">
</activity>
<activityPatternBinding
activityId="myActivity"
isEqualityPattern="true"
pattern="org.eclipse.sirius.diagram.ui/org.eclipse.sirius.diagram.ui.command.hideElement">
</activityPatternBinding>
<activityPatternBinding
activityId="myActivity"
isEqualityPattern="true"
pattern="org.eclipse.sirius.diagram.ui/org.eclipse.sirius.diagram.ui.command.hideLabel">
</activityPatternBinding>
</extension>
and the same thing with equalitypattern to false:
<extension
point="org.eclipse.ui.activities">
<activity
id="myActivity"
name="%activityName">
</activity>
<activityPatternBinding
activityId="myActivity"
isEqualityPattern="false"
pattern="org.eclipse.sirius.diagram.ui.org.eclipse.sirius.diagram.ui.command.hideElement">
</activityPatternBinding>
<activityPatternBinding
activityId="myActivity"
isEqualityPattern="false"
pattern="org.eclipse.sirius.diagram.ui.org.eclipse.sirius.diagram.ui.command.hideLabel">
</activityPatternBinding>
</extension>
Regards,
Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.04949 seconds