Home » Eclipse Projects » Remote Application Platform (RAP) » TreeViewer RowTemplate Expander missing
TreeViewer RowTemplate Expander missing [message #1350193] |
Mon, 12 May 2014 10:46  |
Eclipse User |
|
|
|
Hello!
I would like to ask, that is there an example somewhere for a treeviewer with row template?
I am asking because i am implemented like the tableviewer example and i cannot use
the expander, because there aren't one.
I tried to create a custom image which selectable and do it by code behind with:
if (treeViewer.getExpandedState(object)) {
treeViewer.collapseToLevel(object, AbstractTreeViewer.ALL_LEVELS);
} else {
treeViewer.expandToLevel(object, 1);
} }
But i had problems when i tried to change the image when the item expanded or collapsed.
So, if i use rowtemplate can i use the default tree expander imgage and functionality somehow or i am doing something wrong and the expander shoud be there or its a bug?
Laszlo
|
|
| | | |
Re: TreeViewer RowTemplate Expander missing [message #1352724 is a reply to message #1352551] |
Tue, 13 May 2014 11:52   |
Eclipse User |
|
|
|
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 #1354396 is a reply to message #1352767] |
Wed, 14 May 2014 04:33  |
Eclipse User |
|
|
|
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: Wed Jul 23 18:33:37 EDT 2025
Powered by FUDForum. Page generated in 0.04541 seconds
|