| How and Where to Discuss and	Potentially Report a bug for TextActionHandler [message #327043] | 
Mon, 07 April 2008 10:59  | 
 
Eclipse User  | 
 | 
 | 
   | 
 
I posted this to newcommers and someone suggested I post it here. 
 
I am having a couple problems with  
'org.eclipse.ui.actions.TextActionHandler' and I think one of them is a  
bug and another is somewhere in between. I would like to go to the right  
newsgroup to discuss it first then if it is a problem and not just me  
using it improperly to file the proper bug and feature requests. 
 
Thanks for your help pointing me in the right direction, 
~jake 
 
--:DETAILS:-- 
************************** 
The potential bug is that if I do the following when creating an  
editorPart: 
----------- 
textActionHandler = new  
TextActionHandler(this.getViewSite().getActionBars()); 
textActionHandler.setSelectAllAction(copyAction); 
textActionHandler.addText(textbox1); 
textActionHandler.addText(textbox1); 
..... 
setFocus(){viewer.getControl()} 
------------- 
I cannot get the editor to recognize my copy command for the viewer till I  
click on a registered text box for the actionhandler and then click back  
to the viewer. I think it has to do with the fact that the  
TextActionHandler automatically registers the last added Text control as  
the 'activeControl' and throws listeners on it. The only way to get the  
listeners deactivated and return control to the registered copyAction is  
to activate and deactivate one of the registered Text controls added to  
the TextActionHandler. ************************** 
This is the what I am using to solve the problem for now. 
// FIXME: Dirty Dirty Hack to deactivate the text control from the  
textActionHandler 
// Create temp swt text for the purposes of adding and removing it from  
textactionhandler 
// This will cause the activeTextController to be set to null 
Text aText = new Text( partComposite, SWT.NONE ); 
getTextActionHandler().addText( aText ); 
getTextActionHandler().removeText( aText ); 
 
// Since I don't want this text as part of the part I need to hide it now  
and relayout 
GridData gd = (GridData) aText.getLayoutData(); 
if (gd != null) { 
gd.exclude = true; 
} 
aText.setVisible( false ); 
aText.setEnabled( false ); 
partComposite.layout(); 
 
******************** 
Related feature requests for Text Action Handler: 
The only time that the TextActionHandler registers its actions via  
'actionBar.setGlobalActionHandler()' is in its constructor. If somehow I  
accidently or purposely register something else temporarily with the  
globalActionHandler there is no way for me to reregister the  
TextActionHandler actions no method along the lines of  
(textActionHandler.registerGlobalActions()). Also there is no method to  
deactivate/unset the the activeTextControl in the TextActionHandler along  
the lines of (textActionHandler.setActiveTextControl(null))
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03389 seconds