Bug 26388 - Package Explorer does not position on files
Summary: Package Explorer does not position on files
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Billy Biggs CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 25618 30335 34085 34482 34485 34707 57782 65043 65158 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-14 13:51 EST by Andrew Irvine CLA
Modified: 2005-04-22 09:00 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Irvine CLA 2002-11-14 13:51:45 EST
Eclipse 20021114, default configuration (no customizations)

I have noticed the package explorer does not always bring the class file 
selected into view.

With a new workspace I import the UI modules from CVS (select Head -> Modules -
> platform-ui).  I then import all required binary plugins via the import 
facility.  At this point in the java perspective I have no open editors and 
the package explorer tree is collapsed.

Now open the type "volume" via the type selection dialog (ctrl-shift-t).  Note 
the package explorer does not position correctly.  If you scroll down you will 
see the proper expansion has occurred, and volume is selected.  Now select the 
class "welcomeeditor".  The package explorer positions correctly.  Finally 
select the class "swt".  Again the package explorer positions correctly.  Now 
select the class "writer".  The package explorer does not correctly position.  
Note this class is right after "volume" so no expansions were required, only a 
reposition.

Now try the sequence swt, volume, writer.  Volume is not correctly done, but 
writer is.

The swt, writer, volume.  Writer is not done correctly, but volume is.

I close all editors and collapse the tree between each try.
Works on Windows XP and linux-motif
Comment 1 Dirk Baeumer CLA 2002-11-18 12:39:59 EST
Moving to SWT. Seems to be a Linux-GTk bug since it works under Windows/XP and 
Linux Motif.
Comment 2 Christophe Cornu CLA 2002-11-19 10:39:55 EST
Chrix to investigate and advise
Comment 3 Andrew Irvine CLA 2003-01-28 11:16:05 EST
*** Bug 30335 has been marked as a duplicate of this bug. ***
Comment 4 Jared Burns CLA 2003-01-28 12:16:35 EST
The problem is not limited to class files.

From Bug 30335, Dirk said:
"We are calling setSelection(selection, true) at StructuredViewer."
Comment 5 Andrew Irvine CLA 2003-02-05 13:38:49 EST
Still an issue in 20030205 (m5 candidate load).  Note in this load the Package 
Explorer view no longer automatically positions, you must request such a 
positioning either via alt-shift-s or Navigate->Show In.  When you do request 
a "Show In" the Package Explorer view does not position on the file.

Same problem in the Navigator view.
GTK only.
Comment 6 Andrew Irvine CLA 2003-02-06 16:25:22 EST
This appears to be working in 20030206.  Christophe, is this be design or 
accident?
Comment 7 Victor Lewis CLA 2003-02-11 15:05:17 EST
I am seeing this behavior in 200302061700 on Win2k with JDK 1.4.0 as well.
Comment 8 Andrew Irvine CLA 2003-02-11 15:56:25 EST
In reference to comment #7.  What you are seeing is new functionality 
introduced for R2.1 M5.  Please see bug 30002 for more details.  I am quite 
confident the behaviour you are seeing has nothing to do with this bug, which 
was gtk specific.
Comment 9 Andrew Irvine CLA 2003-02-21 18:17:41 EST
Eclipse 200302211557

It is not working again.
RH 8.0, gtk 2.0.2
Comment 10 Christophe Cornu CLA 2003-02-24 11:45:25 EST
Can't reproduce on my machine with RC1 - and appears to be working again for 
Andrew.

Jared, is it still a problem for you with RC1?
Comment 11 Jared Burns CLA 2003-02-24 13:10:56 EST
If the tree node containing the file has already been expanded, the node will
be revealed. However, the following will still yield failure in the 20030221
build:
1. Click the "Collapse All" button in the package explorer.
2. Select a type in the outline view for a Java editor and select
Navigate->Show In->Package Explorer
3. You can see the project containing the file expand in the package explorer,
but the tree does not scroll to reveal the file.
Comment 12 Andrew Irvine CLA 2003-03-11 09:11:03 EST
*** Bug 34482 has been marked as a duplicate of this bug. ***
Comment 13 Veronika Irvine CLA 2003-03-11 11:35:10 EST
*** Bug 34485 has been marked as a duplicate of this bug. ***
Comment 14 Veronika Irvine CLA 2003-03-11 11:38:11 EST
*** Bug 25618 has been marked as a duplicate of this bug. ***
Comment 15 Veronika Irvine CLA 2003-03-11 11:39:09 EST
Christophe, this is being reported quite a bit.  Increasing the priority to P2.
Comment 16 Andrew Irvine CLA 2003-03-11 15:14:19 EST
*** Bug 34707 has been marked as a duplicate of this bug. ***
Comment 17 Veronika Irvine CLA 2003-03-12 15:03:41 EST
Approved for RC3 by Veronika.
Comment 18 Veronika Irvine CLA 2003-03-12 15:09:42 EST
Approved by Mike for RC3.
Comment 19 Christophe Cornu CLA 2003-03-12 16:46:34 EST
Fixed version v>20030312
Comment 20 Andrew Irvine CLA 2003-03-19 10:34:00 EST
Eclipse I20030318
RH 8.0

If I have the package explorer synchronized with my editors then the 
positioning is correct.  However, if I do not have the package explorer 
synchronized, and then I decide to synchronize using button on package 
explorer, it does not correctly position to the active file.  Subsequent file 
switching is fine.

Likewise if the package explorer is not synchronized, and I select 'show in' 
via Navigator->Show in, the package explorer does not correctly position.
Comment 21 Andrew Irvine CLA 2003-03-19 12:00:33 EST
The classI was using was org.eclipse.ui.workbench/EditorWorkbook.  It appears 
to happen when the package expands to a large list.
Comment 22 Felipe Heidrich CLA 2003-04-14 10:38:33 EDT
*** Bug 34085 has been marked as a duplicate of this bug. ***
Comment 23 Christophe Cornu CLA 2003-04-14 13:09:23 EDT
Note. To reproduce case described in comment 20
GTK gtk_tree_view_expand_row is not synchronous when the depth is > 1. It is
executed after the gtk_tree_viewscroll_to_cell, which is synchronous. Flushing
the events is one way to fix it, but this could lead to other problems.

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("PR");

		final Tree tree = new Tree (shell, SWT.BORDER);
		tree.setSize (100, 100);
		shell.setSize (200, 200);

	final TreeItem[] items = new TreeItem[100];
		items[0] = new TreeItem(tree, 0);
		items[0].setText("elt"+0);
		int n = 50;
		for (int i = 1; i < n; i++) {
			items[i] = new TreeItem(items[i-1], 0);
			items[i].setText("child"+i);
		}
		for (int i = n; i < items.length; i++) {
			items[i] = new TreeItem(tree, 0);
			items[i].setText("elt "+i);
		}

		Button button = new Button(shell, SWT.PUSH);
		button.setBounds(120,0,50,20);
		button.setText("show");
		button.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event e) {
				tree.showItem(items[45]);
			}
		});

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}		
	}
}
Comment 24 Stefan Zechmeister CLA 2003-09-11 16:17:22 EDT
this defect is still not fixed in the 3.0 stream! still the behavior like
described in comment 20!
Comment 25 Christophe Cornu CLA 2004-06-04 09:50:45 EDT
*** Bug 65043 has been marked as a duplicate of this bug. ***
Comment 26 Steve Northover CLA 2004-06-07 10:27:28 EDT
NOTE:  This is a problem in GTK that we are unable to work around right now.  
Other GTK C applications have exactly the same problem.  I agree that it is 
serious but there may be nothing we can do.
Comment 27 Billy Biggs CLA 2004-06-09 17:11:43 EDT
I filed this bug against GtkTreeView to get their opinion:

http://bugzilla.gnome.org/show_bug.cgi?id=144059
Comment 28 Erich Gamma CLA 2004-06-10 12:11:04 EDT
*** Bug 65158 has been marked as a duplicate of this bug. ***
Comment 29 Billy Biggs CLA 2004-11-21 22:59:27 EST
*** Bug 57782 has been marked as a duplicate of this bug. ***
Comment 30 Steve Northover CLA 2005-04-11 22:06:51 EDT
If we can't work around this, we should file a bug against GTK and/or close 
this bug report.
Comment 31 Billy Biggs CLA 2005-04-20 22:59:52 EDT
As it turns out, this annoying bug was fixed as a side effect of the change for
bug 89665!  I am marking this bug as WORKSFORME.  Please re-open if this problem
still exists in builds since 3.1M6.

However, the example code that Chris gives in comment #23 still fails, as does
the code in the linked GTK+ bug report.  That example does not set the
selection, and so the scrolling fails.  Since all of the duplicates of this bug
are about the package explorer and resource navigator, I will close this bug and
file a new one about Chris' case.
Comment 32 Andrew Irvine CLA 2005-04-21 07:48:42 EDT
Please provide a reference the bug you are openning as per comment #31
Comment 33 Billy Biggs CLA 2005-04-21 08:50:34 EDT
I opened bug 92176 about the expand+scroll case.
Comment 34 Andrew Irvine CLA 2005-04-22 09:00:56 EDT
book keeping