Community
Participate
Working Groups
org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.updateMessage() only allows showing Error or normal messages from tabs, though the setMessage method has by default a WARNING level. I will post a small patch that allows launch configuration tabs to supply warning messages that gets displayed as warnings in the dialog.
Created attachment 219586 [details] Add extension interface and support warning in dialog Add extension interface org.eclipse.debug.ui.ILaunchConfigurationTab2 to be implemented by tabs that want to provide warning messages. Warning messages take priority over normal messages.
Sounds like a reasonable request. Mike, has this come up before?
No requests like this in the past. Couple of nit-picks: 1. Don't need the null check -> if (tab != null && tab instanceof ILaunchConfigurationTab2) 2. need to update the copyright for LaunchConfigurationTabGroupViewer 3. Unless you want to attribute the code to IBM, you should update the copyright for ILaunchConfigureationTab2 :) 4. There are no @since tags on the new interface + getWarningMessage() method It might also be nice to implement this in the platform / JDT debug / the examples so people can see a real life example of its use / test it.
Created attachment 219778 [details] Handle feedback (In reply to comment #3) [mhussein] Thanks a lot for your comments, please find an updated patch handling them, see details below. > No requests like this in the past. Couple of nit-picks: > > 1. Don't need the null check -> if (tab != null && tab instanceof > ILaunchConfigurationTab2) [mhussein] Done. > 2. need to update the copyright for LaunchConfigurationTabGroupViewer [mhussein] Done. > 3. Unless you want to attribute the code to IBM, you should update the > copyright for ILaunchConfigureationTab2 :) [mhussein] I wouldn't mind doing so, we are all in the same boat :) Updated it, thanks for the note. > 4. There are no @since tags on the new interface + getWarningMessage() method [mhussein] Added to the interface. > > It might also be nice to implement this in the platform / JDT debug / the > examples so people can see a real life example of its use / test it. [mhussein] To do this I need a place that logically has a warning message that is currently either displayed as error or normal, do you know of any? I tried to look at usages of getErrorMessage, but mostly are exceptions or real errors. I can add a get/set to AbstractLaunchConfigurationTab like normal and error if this will make it more obvious to implementors. Please let me know if you want me to do so.
(In reply to comment #4) Hmm, for some reason I cannot apply either of the patches - Git is complaining they are not valid patch formats... Looking at the code you should have ILaunchConfigurationTab2 extend ILaunchConfigurationTab. > [mhussein] To do this I need a place that logically has a warning message > that is currently either displayed as error or normal, do you know of any? > I tried to look at usages of getErrorMessage, but mostly are exceptions or > real errors. You could add a new tab / logic to the PDA example in org.eclipse.debug.examples.ui > > I can add a get/set to AbstractLaunchConfigurationTab like normal and error > if this will make it more obvious to implementors. Please let me know if you > want me to do so. Yes that would be good since we encourage people to use the abstract class. You should also add a change that AbstractLaunchConfigurationTab implements the new interface - which will still be binary compatible: http://wiki.eclipse.org/Evolving_Java-based_APIs_2#Evolving_API_Classes It might also be a good idea to go through the backlog of bugs to see if there are any other requests to extend ILaunchConfigurationTab that we could include in the new extension.
Created attachment 220202 [details] Handle feedback - add example usage (In reply to comment #5) > (In reply to comment #4) > > Hmm, for some reason I cannot apply either of the patches - Git is > complaining they are not valid patch formats... > [mhussein] I have recreated my local branch, please check the new patch and let me know if you have any issues. > Looking at the code you should have ILaunchConfigurationTab2 extend > ILaunchConfigurationTab. > [mhussein] Done. > > [mhussein] To do this I need a place that logically has a warning message > > that is currently either displayed as error or normal, do you know of any? > > I tried to look at usages of getErrorMessage, but mostly are exceptions or > > real errors. > > You could add a new tab / logic to the PDA example in > org.eclipse.debug.examples.ui > [mhussein] I added a warning message to the existing tab in case the program is not a file, will attach a screenshot. Do I need to change the example instructions to ask users to do the same? > > > > I can add a get/set to AbstractLaunchConfigurationTab like normal and error > > if this will make it more obvious to implementors. Please let me know if you > > want me to do so. > > Yes that would be good since we encourage people to use the abstract class. > You should also add a change that AbstractLaunchConfigurationTab implements > the new interface - which will still be binary compatible: > http://wiki.eclipse.org/Evolving_Java-based_APIs_2#Evolving_API_Classes > [mhussein] Done. Thanks for the link. > It might also be a good idea to go through the backlog of bugs to see if > there are any other requests to extend ILaunchConfigurationTab that we could > include in the new extension. [mhussein] I tried quick search and only found https://bugs.eclipse.org/bugs/show_bug.cgi?id=160016 https://bugs.eclipse.org/bugs/show_bug.cgi?id=136115 With my inexperienced eye, I don't think they are relevant at all. Please let me know if you think otherwise.
Created attachment 220203 [details] Warning message in PDA example
Moving out to next milestone.
Comment on attachment 220202 [details] Handle feedback - add example usage Patch works nicely.
Pushed patch with minor copyright / version updates to: http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=231ef131428719fb986eaa67511186dd9ec341fb Thank you very much for this cool new feature Mohamed!
Verified with I20121029-0800 Interestingly, the warning message does not prevent you from launching, which seems correct.