[jbosstools-issues] [JBoss JIRA] (JBIDE-9953) Always show Push dialog and add what number of resources will be commited

Snjezana Peco (Commented) (JIRA) jira-events at lists.jboss.org
Thu Nov 3 16:14:45 EDT 2011


    [ https://issues.jboss.org/browse/JBIDE-9953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639883#comment-12639883 ] 

Snjezana Peco commented on JBIDE-9953:
--------------------------------------

The issue happens the ExpressPublishMethod.requestApproval method. It calls MessageBox as follows:

MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);

which creates a dialog that is independent of the main Eclipse shell and can be hidden (depending on a OS).

The solution is to use active shell that can be got in the following way:

private static Shell getActiveShell() {
	Display display = Display.getDefault();
	final Shell[] ret = new Shell[1];
	display.syncExec(new Runnable() {

		public void run() {
			ret[0] = Display.getCurrent().getActiveShell();
		}
		
	});
	return ret[0];
}
	
I recommend using the MessageDialog class (included in the patch) instead of the MessageBox class.
I am using this technique in the project examples plugin and haven't had similar issues yet.
Attached is a patch.



                
> Always show Push dialog and add what number of resources will be commited
> -------------------------------------------------------------------------
>
>                 Key: JBIDE-9953
>                 URL: https://issues.jboss.org/browse/JBIDE-9953
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>            Reporter: Max Rydahl Andersen
>            Assignee: Rob Stryker
>            Priority: Blocker
>             Fix For: 3.3.0.M4
>
>         Attachments: jbide-9953.patch, JBIDE-9953.patch, Screenshot.png, winxp-dump.txt
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list