Bug 31305 - [CCombo] Truncated string into the information tab of the feature editor
Summary: [CCombo] Truncated string into the information tab of the feature editor
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Duong Nguyen CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 39342 151714 (view as bug list)
Depends on:
Blocks: 54175
  Show dependency tree
 
Reported: 2003-02-07 10:09 EST by Pascal Rapicault CLA
Modified: 2019-11-06 09:29 EST (History)
14 users (show)

See Also:


Attachments
Snapshot of CCombo test (4.41 KB, image/jpeg)
2007-03-27 15:39 EDT, Duong Nguyen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2003-02-07 10:09:52 EST
Create a new feature using the wizard.
Open the feature.xml, go into the information tab and you will notice
that the default value of the "section" field is truncated.
Comment 1 Dejan Glozic CLA 2003-02-22 22:00:00 EST
Moving to SWT for comment - this is an old problem related to CCombo that 
refuses to go away. Here is the scenario:

1) Create a new Feature project. Use any name and accept all the defaults.
2) When the feature manifest editor opens, go to the 'Information' page. 

Notice now the text in the read-only combo is truncated at the beginning.

The actual implementation for this section is in the following class:

org.eclipse.pde.internal.ui.editor.feature.InfoSection

The CCombo control is created in 'createContents' and the items
are set in 'initializeSectionCombo'.



Comment 2 Veronika Irvine CLA 2003-06-27 08:38:37 EDT
*** Bug 39342 has been marked as a duplicate of this bug. ***
Comment 3 Srimanth CLA 2003-08-04 13:48:56 EDT
Opened a wsa.prereq.workbench defect# 258934 for this problem. Basically the
starting characters are chopped off when selecting an entry. It has been my
observation that the problem happens only when the selection of an entry happens
after the shell has been opened and the layout has been performed. If the
selection has been done before the layout, then everything works fine.
Comment 4 Grant Gayed CLA 2006-08-03 09:23:27 EDT
*** Bug 151714 has been marked as a duplicate of this bug. ***
Comment 5 Steve Northover CLA 2007-03-27 14:43:59 EDT
I cannot recreate the problem using the steps that Dejan has given.  The 'Information' page has changed and no longer contains a CCombo.
Comment 6 Steve Northover CLA 2007-03-27 14:50:09 EDT
Grant, running the code from bug 151714 (a duplicate) does not show the problem for me in Eclipse 3.3 M6.  I am on XP, does the problem happen for you on Windows 2000?
Comment 7 Duong Nguyen CLA 2007-03-27 14:54:30 EDT
I'll test it out on my W2K machine.
Comment 8 Duong Nguyen CLA 2007-03-27 15:39:53 EDT
Created attachment 62145 [details]
Snapshot of CCombo test

The problem appears to happen for W2K only.
Comment 9 Steve Northover CLA 2007-03-27 15:46:41 EDT
Sri, I will look into the problem on Windows 2000.  Meanwhile, can you confirm that "wsa.prereq.workbench defect# 258934" works on XP but fails on 2000?
Comment 10 Steve Northover CLA 2007-03-27 18:20:27 EDT
Here is what is happening:  When CCombo calls selectAll() on the text control inside, the i-beam is placed at the end of the text.  Windows scrolls to show the i-beam and when the text control is small, it scrolls to the left.  Then, the CCombo is resized to be bigger (such that the scrolled text could be shown without scrolling) and the text is not scrolled because text does not scroll on resize.

I have no idea how to fix this so CANTFIX for 3.3.  I'm waiting for a brainwave.
Comment 11 Raji Akella CLA 2008-02-26 10:53:56 EST
Any plans to fix this in 3.4?
Comment 12 Mike Wilson CLA 2008-03-27 14:33:23 EDT
If there is no plan to fix this, why is it still open?
Comment 13 Steve Northover CLA 2008-04-03 18:42:23 EDT
Reading this 
Comment 14 Steve Northover CLA 2008-04-03 18:44:56 EDT
The problem only happens on Windows 2000.  We WONTFIX this.
Comment 15 Viliam Durina CLA 2008-10-07 04:01:30 EDT
This problem reproduces on Windows XP as well, when the the theme is "Windows Classic" - most people I know use it, though they are all technicians and probably prefer its simpler look...

There is a quite good workaround: 

        CCombo combo = new CCombo(outer, SWT.READ_ONLY | SWT.BORDER) {
            @Override
            public void select(int index) {
                super.select(index);
                setSelection(new Point(0, 0));
            }
        };
        combo.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                combo.setSelection(new Point(0, 0));
            }
        });
        combo.addFocusListener(new FocusAdapter() {
            @Override
            public void focusLost(FocusEvent e) {
                combo.setSelection(new Point(0, 0));
            }
        });

But first you have to remove the "final" keyword from CCombo.java and compile SWT for yourself (see https://bugs.eclipse.org/235968, Fixed > 080714).

Viliam
Comment 16 Eric Rizzo CLA 2008-10-07 11:02:55 EDT
If SWT officially supports XP running the Classic theme, shouldn't this bug be re-opened?
Comment 17 Duong Nguyen CLA 2008-10-07 11:10:53 EDT
I was able to replicate the problem with Windowx XP using the Classic theme.
Comment 18 Ralph Schuster CLA 2011-05-03 10:34:19 EDT
This is open for more than 2,5 years and not yet solved??? I am still running into that ugly bug on WinXP with Eclipse 3.4 and since subclassing is not allowed I cannot fix it without recompiling all SWT.

Can someone please fix it or give a solution to it?
Comment 19 Ralph Schuster CLA 2011-05-03 10:39:59 EDT
Additional note. The described fix above works only when also overriding checkSubclass():

CCombo rc = new CCombo(parent, SWT.FLAT) {
     @Override
     public void select(int index) {
          super.select(index);
          setSelection(new Point(0, 0));
     }
     protected void checkSubclass () {}
};

However, it is nasty to use this workaround :(
Comment 20 Randy Fredrick CLA 2011-11-07 16:55:06 EST
Seeing this issue on Windows 7 running Indigo and this worked for us:
					_combo.getShell().getDisplay().asyncExec(new Runnable()
{
@Override
public void run()
{
_combo.setSelection(new Point(0, 0));
int len = _combo.getItem(ii).length();
_combo.setSelection(new Point(len, len));
}
});
Comment 21 Randy Fredrick CLA 2011-11-07 17:03:37 EST
Seeing this issue on Windows 7 running Indigo and this worked for us:
					_combo.getShell().getDisplay().asyncExec(new Runnable()
{
@Override
public void run()
{
_combo.setSelection(new Point(0, 0));
int len = _combo.getItem(ii).length();
_combo.setSelection(new Point(len, len));
}
});
Comment 22 Eclipse Genie CLA 2019-11-06 09:29:49 EST
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.

--
The automated Eclipse Genie.