Bug 14887 - Outline Refactor->Delete member scrolls away from context
Summary: Outline Refactor->Delete member scrolls away from context
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 4849
Blocks:
  Show dependency tree
 
Reported: 2002-04-29 21:57 EDT by Randy Hudson CLA
Modified: 2009-08-30 02:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2002-04-29 21:57:58 EDT
If I select a method from the outline view and select delete, the method is 
deleted, and the source editor is scrolled all the way to the top of the 
class.  No matter what type of item you delete, the source editor then scrolls 
to the enclosing class.  IMO, the page should not scroll during this operation.
Comment 1 Kai-Uwe Maetzel CLA 2002-06-04 12:21:42 EDT
This happens when the outline page selection follows the cursor and does not 
happen otherwise. There is no easy, clean fix for this. Post 2.0.
Comment 2 Randy Hudson CLA 2002-06-04 13:08:53 EDT
This is a result of the Source View following the Outline, not vice-versa.  
When the method is deleted, the TreeItem for the enclosing Type is selected on 
Windows.
Comment 3 Kai-Uwe Maetzel CLA 2002-06-05 04:05:38 EDT
If you delete a tree item, the selection go to next item and not to the parent.
Comment 4 Randy Hudson CLA 2002-06-05 09:25:22 EDT
The selection goes to the parent.  Run this code on Windows:
package tree;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.*;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.*;

public class SWTTreeTest {

static TreeItem item;

public static void main(String args[]){
	Display display = new Display();
	final Shell shell = new Shell(display);
	
	shell.setSize(600, 600);
	shell.setLocation(100,100);

	final Tree tree = new Tree(shell , SWT.SINGLE);
	item = new TreeItem(tree, 0);
	item.setText("Item3");
	new TreeItem(item, 0).setText("Item");
	item = new TreeItem(item, 0);
	item.setText("Item 2");
	tree.setBounds(10, 10, 100, 100);

	tree.setSelection(new TreeItem[]{item});

	Button b = new Button(shell, 0);
	b.setText("Delete Last");
	b.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
//			tree.setSelection(new TreeItem[0]);
			item.dispose();
		}
	});
	b.setBounds(20,190,120,50);
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) 
			display.sleep();
	}
	display.dispose();
}

}
Comment 5 Randy Hudson CLA 2002-06-05 09:27:39 EDT
Nevermind.  It only goes to the parent in the case where there is not a Next 
TreeItem.
Comment 6 Eclipse Webmaster CLA 2009-08-30 02:38:33 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.