Home » Eclipse Projects » Remote Application Platform (RAP) » RAP Tree - moveable columns not working(setMoveable(true) for Tree columns doesn't work)
RAP Tree - moveable columns not working [message #1018755] |
Thu, 14 March 2013 12:21 |
|
Before I open a bug, could someone confirm if this is indeed a bug, or working as designed in RAP... basically I have a Tree which has setMoveable(true) for all columns, but if I try to actually drag the columns around to change their order, the 'ghost' of the column header gets left on the display and no re-ordering is done.
Same code works ok in SWT.
Just to note, I'm using quite a recent Nightly of RAP from a few days ago.
Snippet:
/* DEMONSTRATES RAP ISSUE WITH COLUMN MOVE IN RAP */
package bug.snippet;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
public class Bugsy {
private Display display;
private Shell shell;
private Tree tree;
public void begin() {
System.out.println("BugSnippy Starting...");
// create Shell
display = new Display();
shell = new Shell(display, SWT.TITLE|SWT.BORDER|SWT.CLOSE);
shell.setText("Bug Snippet");
shell.setBackground(new Color(null, new RGB(192,192,192)));
FormLayout layout = new FormLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.marginLeft = 10;
layout.marginTop = 10;
layout.marginRight = 10;
layout.marginBottom = 10;
layout.spacing = 0;
shell.setLayout(layout);
// create the Tree
tree = new Tree(shell, SWT.MULTI|SWT.FULL_SELECTION);
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
FormData fd = new FormData();
fd.left = new FormAttachment(0, 10);
fd.top = new FormAttachment(0, 10);
fd.width = 800;
fd.height = 600;
tree.setLayoutData(fd);
// create the columns
for (int j = 0; j < 10; j++) {
TreeColumn tc = new TreeColumn(tree, SWT.NONE);
tc.setMoveable(true);
tc.setResizable(true);
tc.setText("Col"+j);
tc.setWidth(100+j*5);
}
// populate some data
for (int i = 0; i < 100; i++) {
TreeItem it = new TreeItem(tree, SWT.NONE);
String[] data = new String[10];
for (int j = 0; j < 10; j++) {
data[j] = "Row"+i+" Col"+j;
}
it.setText(data);
}
shell.layout();
shell.open();
//SWT ONLY: while (!shell.isDisposed()) {
//SWT ONLY: if (!display.readAndDispatch())
//SWT ONLY: display.sleep();
//SWT ONLY: }
//SWT ONLY: display.dispose();
System.out.println("BugSnippy Done!");
}
}
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
Re: RAP Tree - moveable columns not working [message #1018826 is a reply to message #1018755] |
Thu, 14 March 2013 14:39 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
Your snippet works fine for me in FF, IE and Chrome. What browser/OS are
you using? Can you give a screenshot?
Greetings,
Tim
Am 14.03.2013 13:21, schrieb John Gymer:
> Before I open a bug, could someone confirm if this is indeed a bug, or
> working as designed in RAP... basically I have a Tree which has
> setMoveable(true) for all columns, but if I try to actually drag the
> columns around to change their order, the 'ghost' of the column header
> gets left on the display and no re-ordering is done.
> Same code works ok in SWT.
>
> Just to note, I'm using quite a recent Nightly of RAP from a few days ago.
>
> Snippet:
>
>
> /* DEMONSTRATES RAP ISSUE WITH COLUMN MOVE IN RAP */
> package bug.snippet;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.graphics.Color;
> import org.eclipse.swt.graphics.RGB;
> import org.eclipse.swt.layout.FormAttachment;
> import org.eclipse.swt.layout.FormData;
> import org.eclipse.swt.layout.FormLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Tree;
> import org.eclipse.swt.widgets.TreeColumn;
> import org.eclipse.swt.widgets.TreeItem;
>
> public class Bugsy {
> private Display display;
> private Shell shell;
> private Tree tree;
>
> public void begin() {
> System.out.println("BugSnippy Starting...");
>
> // create Shell
> display = new Display();
> shell = new Shell(display, SWT.TITLE|SWT.BORDER|SWT.CLOSE);
> shell.setText("Bug Snippet");
> shell.setBackground(new Color(null, new RGB(192,192,192)));
> FormLayout layout = new FormLayout();
> layout.marginWidth = 0;
> layout.marginHeight = 0;
> layout.marginLeft = 10;
> layout.marginTop = 10;
> layout.marginRight = 10;
> layout.marginBottom = 10;
> layout.spacing = 0;
> shell.setLayout(layout);
>
> // create the Tree
> tree = new Tree(shell, SWT.MULTI|SWT.FULL_SELECTION);
> tree.setHeaderVisible(true);
> tree.setLinesVisible(true);
> FormData fd = new FormData();
> fd.left = new FormAttachment(0, 10);
> fd.top = new FormAttachment(0, 10);
> fd.width = 800;
> fd.height = 600;
> tree.setLayoutData(fd);
>
> // create the columns
> for (int j = 0; j < 10; j++) {
> TreeColumn tc = new TreeColumn(tree, SWT.NONE);
> tc.setMoveable(true);
> tc.setResizable(true);
> tc.setText("Col"+j);
> tc.setWidth(100+j*5);
> }
>
> // populate some data
> for (int i = 0; i < 100; i++) {
> TreeItem it = new TreeItem(tree, SWT.NONE);
> String[] data = new String[10];
> for (int j = 0; j < 10; j++) {
> data[j] = "Row"+i+" Col"+j;
> }
> it.setText(data);
> }
>
> shell.layout();
>
> shell.open();
> //SWT ONLY: while (!shell.isDisposed()) {
> //SWT ONLY: if (!display.readAndDispatch())
> //SWT ONLY: display.sleep();
> //SWT ONLY: }
> //SWT ONLY: display.dispose();
>
> System.out.println("BugSnippy Done!");
> }
>
> }
>
>
> Thanks, John
>
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | | | | | |
Goto Forum:
Current Time: Wed May 08 04:54:23 GMT 2024
Powered by FUDForum. Page generated in 0.04724 seconds
|