Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Retarget Action does not work
Retarget Action does not work [message #463161] Wed, 07 February 2007 08:32
Eclipse UserFriend
Originally posted by: febro.gmx.net

Hi,

I have some problems with retarget actions... they always remain grey and stay inactive...

ApplicationActionBarAdvisor.java:
this.deleteAction = new RetargetAction(ITextEditorActionDefinitionIds.DELETE,"Delete");
        this.deleteAction.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE);
        register(this.deleteAction);
        
        this.formatProposalAction = new RetargetAction(IXMLActions.XML_FORMAT, "Format");
        his.formatProposalAction.setActionDefinitionId(IXMLActions.XML_FORMAT);
        this.formatProposalAction.setAccelerator(SWT.CTRL | SWT.SHIFT | 'F');
        register(this.formatProposalAction);
        
        this.contentAssistProposalAction = new RetargetAction(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, "ContentAssist");
        this.contentAssistProposalAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
        register(this.contentAssistProposalAction);


they are added to the menubar, of course...

Editor.createActions():
IAction a = new TextOperationAction(resourceBundle, "ContentFormatProposal.", this, ISourceViewer.FORMAT);
    a.setActionDefinitionId(IXMLActions.XML_FORMAT);
    a.setAccelerator(SWT.CTRL | SWT.SHIFT | 'F');
    setAction(IXMLActions.XML_FORMAT, a);
    getEditorSite().getActionBars().setGlobalActionHandler(IXMLActions.XML_FORMAT, a);
    
a = new TextOperationAction(resourceBundle, "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); 
a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
setAction(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, a);
getEditorSite().getActionBars().setGlobalActionHandler(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, a);
    
a = new TextOperationAction(resourceBundle,"Delete." ,this, ITextOperationTarget.DELETE); 
a.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE);
setAction(ITextEditorActionDefinitionIds.DELETE, a);
getEditorSite().getActionBars().setGlobalActionHandler(ITextEditorActionDefinitionIds.DELETE, a); 


but nothing happens... the entries in the menubar remain grey, the key-shortcuts are disabled, too.

Just the right-click-contextmenu works... here the actions are added and functional!

Editor.editorContextMenuAboutToShow(IMenuManager menu):
 
super.editorContextMenuAboutToShow(menu);

addAction(menu, IXMLActions.XML_FORMAT);
addAction(menu, ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); 
addAction(menu, ITextEditorActionDefinitionIds.DELETE);


please help! i have no idea whats wrong... maybe it is connected wih my other problem ("EditorContributor: only Constructor is called", http://eclipsezone.com/eclipse/forums/t90294.html)...

any ideas???
Felix
Previous Topic:Questions to MasterDetailsBlock
Next Topic:TreeViewer refresh
Goto Forum:
  


Current Time: Sat Sep 07 12:29:35 GMT 2024

Powered by FUDForum. Page generated in 0.03124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top