[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Disable "Delete From Diagram"

El dia Tue, 24 Feb 2009 08:08:01 +0100, en/na Arne va escriure:
Hi Arne, 

go to the plugin.xml file, and then all you have to do is :

       <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>

under the extension point : 

  <extension 
point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">


This is what i have for an element of my model : ActivyEditPart.
 

	<extension 
point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
      <?gmfgen generated="false"?>
       <contributionItemProvider 
class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider"
            checkPluginLoaded="false">
         <Priority name="Low"/>

 <popupContribution 
class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
            <popupStructuredContributionCriteria 
objectClass="com.isoco.iwf.designer.bpmn.diagram.edit.parts.ActivityEditPart"/
>
            <popupPredefinedItem id="addNoteLinkAction" remove="true"/>
            <popupPredefinedItem id="fileMenu" remove="true"/>
           <popupPredefinedItem id="cut" path="/editMenu/copyGroup" 
remove="true"/>
			<popupPredefinedItem id="copy" path="/editMenu/
copyGroup" remove="true"/>
			<popupPredefinedItem id="paste" path="/editMenu/
copyGroup" remove="true"/>    
            <popupPredefinedItem id="deleteFromDiagramAction" 
remove="true"/>
            <popupPredefinedItem id="deleteFromModelAction" 
remove="false"/>
            <popupPredefinedItem id="formatMenu" remove="true"/>
            <popupPredefinedItem id="filtersMenu" remove="true"/>
            <popupPredefinedItem id="showPropertiesViewAction" 
remove="true"/>
            <popupPredefinedItem id="properties" remove="true"/>
         </popupContribution>
hope it helps. 


> Hello all,
> 
> my Diagram Editor is synchronised to a model. The "Delete From Diagram"
> Action is disabled for all elements... except for one. I don't think i
> made something different on creating that element.
> 
> The only difference i see, is that the element, where the "Delete From
> Diagram" Action is available, is a Association that can have an other
> association as source or target.
> 
> However, is there a way to manually disable the "Delete From Diagram"
> Action?
> 
> I was looking around in the corresponding Edit-Policy class, but
> couldn't find a command that gets created from that class, that is
> responsible for the action.
> 
> Thx in advance, Arne