Home » Eclipse Projects » Remote Application Platform (RAP) » TreeViewer RowTemplate Expander missing
| |
Re: TreeViewer RowTemplate Expander missing [message #1352201 is a reply to message #1352082] |
Tue, 13 May 2014 10:54 |
László Erős Messages: 5 Registered: September 2013 |
Junior Member |
|
|
Hello!
Thanks for the answer!
If i add a simple rowtemplate to the treeviewer the expander is disappear/not shown. I tried it even with the rap demo. Without rowtemplate everything ok works as usual.
Here are the steps i use:
Tree tree = new Tree(parent, SWT.NONE);
TreeViewer treeViewer = new TreeViewer(tree);
TreeViewerColumn twc = new TreeViewerColumn(treeViewer, SWT.NONE);
twc.setLabelProvider(new TreeLabelProvider());
treeViewer.setContentProvider(new TestTreeContentProvider());
Template test = new Template();
TextCell textCell = new TextCell(test);
textCell.setHorizontalAlignment(SWT.LEFT);
textCell.setBindingIndex(0);
textCell.setTop(0);
textCell.setLeft(0);
tree.setData(RWT.ROW_TEMPLATE, test);
treeViewer.setInput(getRoots());
Am i doing something wrong?
I also tried with different values on textcell for example setLeft(50), but still no expander.
Please confirm is it a bug?
László
[Updated on: Tue, 13 May 2014 10:57] Report message to a moderator
|
|
| |
Re: TreeViewer RowTemplate Expander missing [message #1352724 is a reply to message #1352551] |
Tue, 13 May 2014 15:52 |
László Erős Messages: 5 Registered: September 2013 |
Junior Member |
|
|
Hello! Tried with 2.3M3, no luck:
The browser html code of the tree:
<div tabindex="-1" style="position: absolute; background: none repeat scroll 0% 0% rgb(255, 255, 255); overflow: hidden; outline: medium none; z-index: 1; border-width: 0px; border-style: none; width: 475px; height: 626px; left: 0px; top: 0px;">
<div tabindex="1" style="position: absolute; cursor: default; overflow: hidden; outline: medium none; z-index: 1; border-width: 1px; border-style: solid; border-color: rgb(189, 189, 189); width: 475px; height: 626px; left: 0px; top: 0px;">
<div style="position: absolute; overflow: hidden; background: none repeat scroll 0% 0% rgb(255, 255, 255); outline: medium none; width: 473px; height: 624px; top: 0px;">
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; font-family: Verdana,"Lucida Sans",Arial,Helvetica,sans-serif; font-size: 14px; font-weight: normal; font-style: normal; width: 473px; height: 45px; left: 0px; top: 0px;">
<div class="rwt-cell" style="text-align: left; white-space: nowrap; text-overflow: ellipsis; position: absolute; overflow: hidden; z-index: 100; left: 21px; top: 0px; width: 200px; height: 45px; color: inherit;">Teszt1</div>
<div style="position: absolute; overflow: hidden; z-index: 2; background: -moz-linear-gradient(-90deg, rgb(235, 235, 235) 0%, rgb(213, 213, 213) 100%) repeat scroll 0% 0% transparent; left: 0px; top: 0px; width: 473px; height: 45px; display: none;"></div>
</div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; font-family: Verdana,"Lucida Sans",Arial,Helvetica,sans-serif; font-size: 14px; font-weight: normal; font-style: normal; width: 473px; height: 45px; left: 0px; top: 45px;">
<div class="rwt-cell" style="text-align: left; white-space: nowrap; text-overflow: ellipsis; position: absolute; overflow: hidden; z-index: 100; left: 37px; top: 0px; width: 200px; height: 45px; color: inherit;">Teszt2</div>
<div style="position: absolute; overflow: hidden; z-index: 2; background: -moz-linear-gradient(-90deg, rgb(235, 235, 235) 0%, rgb(213, 213, 213) 100%) repeat scroll 0% 0% transparent; left: 0px; top: 0px; width: 473px; height: 45px; display: none;"></div>
</div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; font-family: Verdana,"Lucida Sans",Arial,Helvetica,sans-serif; font-size: 14px; font-weight: normal; font-style: normal; width: 473px; height: 45px; left: 0px; top: 90px;">
<div class="rwt-cell" style="text-align: left; white-space: nowrap; text-overflow: ellipsis; position: absolute; overflow: hidden; z-index: 100; left: 37px; top: 0px; width: 200px; height: 45px; color: inherit;">Teszt3</div>
<div style="position: absolute; overflow: hidden; z-index: 2; background: -moz-linear-gradient(-90deg, rgb(235, 235, 235) 0%, rgb(213, 213, 213) 100%) repeat scroll 0% 0% transparent; left: 0px; top: 0px; width: 473px; height: 45px; display: none;"></div>
</div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 135px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 180px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 225px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 270px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 315px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 360px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 405px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 450px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 495px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 540px;"></div>
<div style="position: absolute; -moz-user-select: none; overflow: hidden; z-index: 0; color: rgb(74, 74, 74); outline: medium none; width: 473px; height: 45px; left: 0px; top: 585px;"></div>
</div>
<div style="position: absolute; overflow: hidden; background: none repeat scroll 0% 0% rgb(240, 240, 240); outline: medium none; z-index: 100000000; display: none; border-width: 0px; border-style: none; width: 473px; height: 20px; left: 0px;">
<div tabindex="1" style="position: absolute; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; background: url("rwt-resources/themes/images/a7b1f224.png") repeat scroll 0% 0%, none repeat scroll 0% 0% rgb(240, 240, 240); outline: medium none; border-width: 1px; border-style: solid; border-color: rgb(189, 189, 189); border-radius: 8px; width: 433px; height: 20px; left: 20px;"></div>
<div tabindex="1" style="position: absolute; background: url("rwt-resources/themes/images/614d82cb.png") repeat scroll 0% 0% transparent; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; outline: medium none; border-width: 0px; border-style: none; width: 20px; height: 20px;"></div>
<div tabindex="1" style="position: absolute; background: url("rwt-resources/themes/images/72c692fc.png") repeat scroll 0% 0% transparent; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; outline: medium none; border-width: 0px; border-style: none; width: 20px; height: 20px; right: 0px;"></div>
</div>
<div style="position: absolute; overflow: hidden; background: none repeat scroll 0% 0% rgb(240, 240, 240); outline: medium none; z-index: 100000000; display: none; border-width: 0px; border-style: none; width: 20px; height: 624px; top: 0px;">
<div tabindex="1" style="position: absolute; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; background: url("rwt-resources/themes/images/a7b1f224.png") repeat scroll 0% 0%, none repeat scroll 0% 0% rgb(240, 240, 240); outline: medium none; border-width: 1px; border-style: solid; border-color: rgb(189, 189, 189); border-radius: 8px; width: 20px; height: 2699px; top: 20px;"></div>
<div tabindex="1" style="position: absolute; background: url("rwt-resources/themes/images/67112e5c.png") repeat scroll 0% 0% transparent; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; outline: medium none; border-width: 0px; border-style: none; width: 20px; height: 20px;"></div>
<div tabindex="1" style="position: absolute; background: url("rwt-resources/themes/images/f402982d.png") repeat scroll 0% 0% transparent; overflow: hidden; -moz-user-select: none; cursor: default; color: rgb(74, 74, 74); text-align: center; outline: medium none; border-width: 0px; border-style: none; width: 20px; height: 20px; bottom: 0px;"></div>
</div>
</div>
</div>
The screenshot:
dl.dropboxusercontent.com/u/3810298/rowtemplateerror.jpg
The content provider and the treeobject:
private static class TestTreeContentProvider implements ITreeContentProvider {
@Override
public void dispose() {
}
@Override
public Object[] getChildren(Object parent) {
Object[] result = new Object[0];
if (parent instanceof TestTreeObject) {
result = ((TestTreeObject) parent).getChildren();
}
return result;
}
@Override
public Object[] getElements(Object parent) {
return getChildren(parent);
}
@Override
public Object getParent(Object child) {
Object result = null;
if (child instanceof TestTreeObject) {
result = ((TestTreeObject) child).getParent();
}
return result;
}
@Override
public boolean hasChildren(Object parent) {
boolean result = false;
if (parent instanceof TestTreeObject) {
result = ((TestTreeObject) parent).hasChildren();
}
return result;
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
private static class TestTreeObject {
private final List<TestTreeObject> children;
private String name;
private TestTreeObject parent;
public TestTreeObject(String name) {
setName(name);
children = new ArrayList<TestTreeObject>();
}
public void addChild(TestTreeObject child) {
children.add(child);
child.setParent(this);
}
public TestTreeObject[] getChildren() {
TestTreeObject[] result = new TestTreeObject[children.size()];
children.toArray(result);
return result;
}
public TestTreeObject getParent() {
return parent;
}
public String getTitle() {
return name;
}
public boolean hasChildren() {
return children.size() > 0;
}
public void removeChild(TestTreeObject child) {
children.remove(child);
child.setParent(null);
}
public void setName(String name) {
this.name = name;
}
public void setParent(TestTreeObject parent) {
this.parent = parent;
}
@Override
public String toString() {
return name;
}
}
The input:
TestTreeObject result = new TestTreeObject("");
TestTreeObject first = new TestTreeObject("Teszt1");
result.addChild(first);
first.addChild(new TestTreeObject("Teszt2"));
first.addChild(new TestTreeObject("Teszt3"));
You can see from the html and from the screenshot, that there is no expander div for the cell.
Please help me.
László
|
|
|
Re: TreeViewer RowTemplate Expander missing [message #1352767 is a reply to message #1352724] |
Tue, 13 May 2014 16:16 |
László Erős Messages: 5 Registered: September 2013 |
Junior Member |
|
|
Hello again!
I found the bug! Good news, its working, bad news, if you dont set the width of the TreeColumn, the expander not shown!
so:
Expander shown:
TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
treeColumn.setWidth(150);
Expander not shown:
TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
Please confirm the bug.
[Updated on: Tue, 13 May 2014 16:16] Report message to a moderator
|
|
|
Re: TreeViewer RowTemplate Expander missing [message #1354396 is a reply to message #1352767] |
Wed, 14 May 2014 08:33 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Okay, I figured it out, and it's rally a bug. I hope we can fix it in
time for the 2.3 release. Please open a bug report.
Am 13.05.2014 18:16, schrieb László Erős:
> Hello again!
>
> I found the bug! Good news, its working, bad news, if you dont set the
> width of the TreeColumn, the expander not shown!
>
> so:
>
> expander shown:
>
> TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
> treeColumn.setWidth(150);
>
>
> Expander not shown:
>
> TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
>
>
>
> Please confirm the bug.
--
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: Mon Sep 23 20:57:16 GMT 2024
Powered by FUDForum. Page generated in 0.04395 seconds
|