| Summary: | [StatusHandling] Workbench ILogDialog swallows dialog title if StatusManager is installed | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Samantha Chan <chanskw> | ||||||
| Component: | UI | Assignee: | Szymon Brandys <Szymon.Brandys> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | n.a.edgar, snorthov, steveshaw, susan, Tod_Creasey | ||||||
| Version: | 3.3 | ||||||||
| Target Milestone: | 3.3 M6 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 175174, 175257 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Samantha Chan
Created attachment 58681 [details]
screen capture
I can't reproduce this bug on 3.3 M5 (I20070209-1006). When I run the snippet, I see the title "Title" up in the title bar. This is the snippet I used...
package snippets;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MessageDialogBug {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
MessageDialog.openError(
shell,
"Title",
"Message" + "\n" + "Details");
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
I reproduced this as follows: 1. Create a new plugin project. From the wizard, the project will contribute a new popup menu. 2. In the project created, open the NewAction class 3. In the run method of the action, change #openInformation to #openError 4. Launch a runtime workspace and create a new file 5. Run the "New Action" from the sample plugin project. You will see that the title of the message dialog is "New Action was executed" Thanks for the steps. I've renamed the bug and marked the severity as "Major" since it is a regression of standard JFace behavior. The problem is that MessageDialog has been changed in 3.3 to use a generic status handler. MessageDialog.openError now passes the error dialog info to the installed ILogDialog. The default JFace ILogDialog simply passes the dialog title, message, and so forth to a message dialog, retaining the old behavior. But the workbench sets up its own ILogDialog, which uses a status handler to display the error. When it creates the status, it sets the status message to the message parameter, but does nothing with the title parameter. See the ILogDialog defined in JFaceUtil.initializeJFace(). Reassigning to Szymon, as I believe he is working in this code. *** Bug 174491 has been marked as a duplicate of this bug. *** Created attachment 59465 [details]
Fix
A few things to mention StatusAdapter has an API change by adding a getTitle and setTitle method. Do we think this is all we want or do we want a setProperty/getProperty so that we have some room for other attributes later? Did we need to rename StatusInfo to StatusAdapterInfo? More to the point why is this API in the dialog anyways? Why is the info useful? Isn't the StatusAdapter enough? No one refers getSelectedError() so I think we might want to consider removing it or making it package private. Are we not using showErrorFor(Job job, String title, String msg) anymore? If so we need to mark it as deprecated an give people a week to roll with the changes. Should addStatusAdapter(StatusAdapter statusAdapter) be publicÉ If so then we need to add this to an API request There are a lot of commented out methods. If there is some cleanup to be done here please attach it to another bug so that we can focus on this issue. JFaceUtil also ignores the displayMask. It doesn't look like the patch addresses this. It's also still ignoring the passed-in message. Back link for our bug db: #18468 Sorry, please ignore last comment. Mark as FIXED *** Bug 179823 has been marked as a duplicate of this bug. *** |