Bug 105007 - [Contributions] Status line message label should allow for standard appearance (bevel border)
Summary: [Contributions] Status line message label should allow for standard appearanc...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P5 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-07-25 09:45 EDT by Florian Priester CLA
Modified: 2019-09-06 16:13 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Priester CLA 2005-07-25 09:45:14 EDT
Build id: I20050627-1435

The UI convention on Windows is to use a lowered bevel border for all
standard text-based items on the status bar of an application window,
including the primary message label.

Examples of well-known applications that follow this guideline include
Windows Explorer, Internet Explorer, Firefox, Thunderbird, OpenOffice,
WinZip and Notepad.

Eclipse itself had also used to do this, but its appearance was changed
for 3.0. There was a bug report (bug 63570) that requested keeping the
old look for the R2.1 presentation but following the technical reasoning
given in (the related) bug 63567 comment #2, it is likely that bug 63570
will eventually be resolved as WONTFIX.

Even if this happens, standalone applications built with JFace+SWT
should not be bound by decisions concerning the branding and appearance
of the Eclipse SDK. Developers of such apps should be free to give
their windows a more standards-compliant look if they choose to do so
(without having to modify the JFace library itself).

For this reason, this report requests that JFace provide a way of specifying
that the message label of the standard status line control should have a
lowered bevel border (SWT.SHADOW_IN) just like it had in 2.1. (The style
of subsequent items added to the status bar can already be controlled by
the programmer.)

The problem is the following line in StatusLine.java:
  fMessageLabel = new CLabel(this, SWT.NONE);//SWT.SHADOW_IN);
which in 2.1 read:
  fMessageLabel= new CLabel(this, SWT.SHADOW_IN);

(Since StatusLine is package-private, subclassing is not an option.)
Comment 1 Florian Priester CLA 2005-10-08 21:13:57 EDT
Workaround (terrible hack):

---

import org.eclipse.jface.action.*;
import org.eclipse.swt.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.widgets.*;

import java.lang.reflect.*;

public class MyStatusLineManager extends StatusLineManager {
  public Control createControl(Composite parent, int style) {
    Control ctrl = super.createControl(parent, style);
    
    try {
      Field fld = ctrl.getClass().getDeclaredField("fMessageLabel");
      fld.setAccessible(true);
      
      CLabel oldLbl = (CLabel) fld.get(ctrl);
      
      if ((oldLbl.getStyle() & SWT.SHADOW_IN) == 0) {
        CLabel newLbl = new CLabel((Composite) ctrl, SWT.SHADOW_IN);
        newLbl.setForeground(oldLbl.getForeground());
        newLbl.setText      (oldLbl.getText());
        newLbl.setImage     (oldLbl.getImage());
        
        try {
          fld.set(ctrl, newLbl);
          
          oldLbl.dispose();
        } catch (Exception ex) {
          newLbl.dispose();
        }
      }
    } catch (Exception ex) {
    }
    
    return ctrl;
  }
}
Comment 2 Tod Creasey CLA 2006-04-07 14:46:33 EDT
There are no plans to work on this feature
Comment 3 Ulrich Callmeier CLA 2006-07-06 03:19:16 EDT
(In reply to comment #2)
> There are no plans to work on this feature
> 

Could this be position be reconsidered? It seems like an easy and very useful thing to do. As it is, StatusLineManager is not usable for standalone JFace applications if one wants to have a standard look-and-feel under Windows.
Comment 4 Tod Creasey CLA 2006-07-06 07:27:59 EDT
If there is interest we can certainly reopen
Comment 5 Florian Priester CLA 2006-07-06 10:46:06 EDT
It should have been mentioned in comment #0 that the bevel appearance is
really only appropriate for the Windows Classic Theme. Under the XP Theme,
status bars usually have a different look.

This means that, as with bug 63570, the right thing would be to have a
native status bar control which SWT would have to provide (bug 88837)
and then make JFace (and the Eclipse SDK) use it.
Comment 6 Susan McCourt CLA 2006-07-06 13:05:35 EDT
I think this bug goes to Duong as part of contributions.  
Comment 7 Paul Webster CLA 2007-04-05 19:04:23 EDT
Assigning to component owner
PW
Comment 8 Eclipse Webmaster CLA 2019-09-06 16:13:06 EDT
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.