Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Enable handler based on active page in multi-page editor
Enable handler based on active page in multi-page editor [message #773109] Sat, 31 December 2011 14:08 Go to next message
Timothy Vogel is currently offline Timothy VogelFriend
Messages: 82
Registered: July 2009
Member
Does anyone have an example of enabling a command handler based on the active page of a multi-page editor?

I can enable based on the overall editor via activeEditorId but can't figure out a way to discriminate between pages of the editor. I have tried activePartId in an expression as below, where each <value> in the <or> is a section or page that I want the handler enabled. The handler is still always inactive.

Thanks for reading my question and any help you can provide!

      <definition
            id="rewindPageActive">
         <with
               variable="activePartId">
            <or>
               <equals
                     value="editor.RedesignWireSection">
               </equals>
               <equals
                     value="editor.RedesignWindingSection">
               </equals>
               <equals
                     value="editor.RedesignElectricalSection">
               </equals>
               <equals
                     value="editor.RedesignDensitiesSection">
               </equals>
               <equals
                     value="editor.RedesignCoilsSection">
               </equals>
               <equals
                     value="editor.RedesignCircMilSection">
               </equals>
               <equals
                     value="editor.RewindMotor">
               </equals></or>
         </with>
      </definition>
Re: Enable handler based on active page in multi-page editor [message #774732 is a reply to message #773109] Wed, 04 January 2012 13:52 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The inner editors in a MultiPageEditorPart are not visible to the workbench, only the outer editor and its activeEditorId. You can write a property tester to test the active page in your MPEP, and you can use a page change listener and methods like org.eclipse.ui.services.IEvaluationService.requestEvaluation(String) to notify of a page change so it can be re-evaluated.

PW


Re: Enable handler based on active page in multi-page editor [message #775754 is a reply to message #774732] Fri, 06 January 2012 16:26 Go to previous message
Timothy Vogel is currently offline Timothy VogelFriend
Messages: 82
Registered: July 2009
Member
Paul,
Thanks for your reply and direction. I will try this approach.

Timothy Vogel
Previous Topic:Upgrade from Helios to Indigo
Next Topic:Why develop an Eclipse plugin?
Goto Forum:
  


Current Time: Fri Apr 26 17:35:02 GMT 2024

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

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

Back to the top