Community
Participate
Working Groups
ampersand character interpreted incorrectly in Job's dialog (at least not consistent) If a job name contains an ampersand, it shows up fine in the job progress dialog title bar (even though it's kind of ugly looking), but it is interpreted as a mnemonic in the main message area. Having double ampersands does the trick in the main message area, but then the title bar area is not happy. Please see the attachment "double ampersands".
Created attachment 33750 [details] double ampersands The job name is set as "R&&e\&t&rieving Hosts to Host View" in this dialog. Notice that the double ampersands are interpreted differently between the title bar and the message area. The escaped ampersand is also interpretted differently. A plain looking ampersand is also interpreted differently. Only consistency seems to be not being consistent.
S
I realize that this is inconsistent but no mnemonics are not supported in the title bar on any platform that I know about. Applications need to know that they are setting text in a title bar.
I should have posed the problem more clearly. I am not saying mnemonics are needed in the title bar or in the message area. What I am struggling with is why ampersand is not taken literally in the message area. I don't see any purpose of supporting mnemonics in a plan text control (it's not like a menu item or command button). The inconsistency was just raised to point out that there is no good way of overcoming the problem; I want to display an ampersand character in the plan text area - double ampersands do the trick in the message area, but they mess up the title bar text. I set the job name once and the job name is displayed in the message area and the title bar automatically. I am not setting two texts differently. I think this is clearly a bug in my opinion. Please reconsider. Thanks.
Sorry to keep WONTFIX'ing you. An ampersand in a Label control (the thing you call "plan text control"), causes focus to go to the following control. You can try this out on XP in the Properties dialog. Invoke it from the desktop menu, give focus to the OK button (by stroking it) and try typing Alt+T. Focus will go to the combo box that is below the 'Theme:' label widget.
I follow the explanation in comment #5. But the problem is still there, and I tried to come up with a workaround. It turned out that it's simply not easy if not possible. The job name is internally used in the title bar as well as in the initial task message (that is, until a job monitor updates it). Even if I escape '&' with "&& " in the task message in the monitor.beginTask("..&&...", ...), the problem still exists because the main UI thread constructs the jobs dialog and shows the initial task message constructed from the job name. This is the case, until the job run method executes beingTask method (which happens to run in a worker thread, therefore, thread contention with the task message update). I paste some code I visited below (I used C++ notation to show the class namespace). protected void ProgressMonitorJobsDialog::configureShell(Shell shell) { super.configureShell(shell); shell.setText(job.getName()); <=== job dialog title bar is set here } protected Control ProgressMonitorJobsDialog::createDialogArea(Composite parent){ Control area = super.createDialogArea(parent); //Give the job info as the initial details getProgressMonitor().setTaskName( <==== task name is set here ProgressManager.getInstance().getJobInfo(this.job).getDisplayString()); return area; } String TaskInfo::getDisplayString() { if (totalWork == IProgressMonitor.UNKNOWN) return unknownProgress(); if (taskName == null) { return getDisplayStringWithoutTask(); } else { String[] messageValues = new String[3]; messageValues[0] = String.valueOf(getPercentDone()); messageValues[1] = jobInfo.getJob().getName(); messageValues[2] = taskName; return NLS.bind(ProgressMessages.JobInfo_DoneMessage, messageValues); } private String TaskInfo::unknownProgress() { if (taskName == null) { return jobInfo.getJob().getName(); } else { String[] messageValues = new String[2]; messageValues[0] = jobInfo.getJob().getName(); messageValues[1] = taskName; return NLS.bind(ProgressMessages.JobInfo_UnknownProgress, messageValues); } } I tried to override the job monitor or the job dialog, and it appears to be not possible to do it. Is there any way of providing (extending from the ones Ecipse implemented) custom job monitor or job dialog? My thought is that the task message in Job's dialog should be implemented not with Label control, but perhaps with more generic text or form controls. After all, the task message is not really a label, but a rather descriptive message. Is this something Ecipse guys can consider in the future releases? At the moment, there seems no good way of overcoming the problem.
Reopening for investigation by Job owners.
Over to you Tod...
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.