Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Change height of TreeItems in TreeViewer(After changing height of the treeItems they seem to overlap each other)
Change height of TreeItems in TreeViewer [message #1721421] Wed, 27 January 2016 11:28 Go to next message
Lars t Christmas is currently offline Lars t ChristmasFriend
Messages: 8
Registered: October 2015
Junior Member
Hello there,

im using a treeviewer in my application as a main feature. Due to the issue that it contains a lot of items i want to change the default height of the shown items. They should all take the same minimal height. I found the following solution, but it does not work exactly as i wish it to do:

trieeViewer.getTree().setData(RWT.CUSTOM_ITEM_HEIGHT, 20);

But after setting the height to 20, the tree looks ok but if you take a closer look charakters in the text label like a "g" or "p" are slidely cut on their bottom side. And when you select an item the marked selection area overlaps the upper item a bit and seems to be overlapped by the underlying item as well. (pictures below). Any idea how to fix that selection area and the problem that the text label seems to be cut off and is not placed exactly in the center of a treeItems area?

without setting the custom_item_height bit it looks like:
index.php/fa/24774/0/
but the space taken by the items is to large for my usecase

it should look like:
index.php/fa/24773/0/
but here the problem discribed above appears.

Any ideas?


Best regards

lars
  • Attachment: Unbenannt.PNG
    (Size: 7.12KB, Downloaded 260 times)
  • Attachment: 123.PNG
    (Size: 8.17KB, Downloaded 271 times)
Re: Change height of TreeItems in TreeViewer [message #1721440 is a reply to message #1721421] Wed, 27 January 2016 13:44 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
you can reduce the cell padding on top/bottom by themeing:

Tree-Cell {
padding: 1px 3px 1px 3px;
}

HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Change height of TreeItems in TreeViewer [message #1721616 is a reply to message #1721440] Thu, 28 January 2016 16:03 Go to previous messageGo to next message
Lars t Christmas is currently offline Lars t ChristmasFriend
Messages: 8
Registered: October 2015
Junior Member
Hi Ivan,

thanks for your quick reply. I implemented your suggestion by using the UI themes extension point:

<extension
point="org.eclipse.rap.ui.themes">
<themeContribution
file="Theme/themes.css"
themeId="pro.p1.PDT.TreeViewerTheme">
</themeContribution>
</extension>

But nothing changed in the appearance of my tree. I set an invalid input in the css file and my server threw an error on startup so it notes the css file. (if no error is in it no message is thrown).

I never used css theming before so it seems im doing sth wrong here

I tried all these "commands?" in the css file:

Tree-Cell {
padding: 1px 3px 1px 3px;
background-color: #000000;
}
Tree-RowOverlay {
background-color: #000000;
color: inherit;
background-image: none;
}

TreeItem:hover {
color: #00ff00;
background-color: #b5b5b5;
background-image: none;
}

TreeItem:selected {
color: #ff0080;
background-color: #ff8000;
background-image: none;
}
Tree {
background-color: #000000;
}

but none seems to have any impact.

What am i missing?

greetings, lars
Re: Change height of TreeItems in TreeViewer [message #1721618 is a reply to message #1721616] Thu, 28 January 2016 16:13 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
if you provide a complete theme (with all the CSS elements defined and
your own theme ID) you have to set this theme in your application with
"org.eclipse.rap.ui.branding" extension point. If you want to contribute
only a small change to the default theme use default theme ID
"org.eclipse.rap.rwt.theme.Default". More information about branding in
RAP Developers Guide [1].

[1]
https://eclipse.org/rap/developers-guide/devguide.php?topic=branding.html&version=3.0
[2]
http://download.eclipse.org/rt/rap/doc/3.0/guide/reference/theming/index.html

HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Change height of TreeItems in TreeViewer [message #1721697 is a reply to message #1721618] Fri, 29 January 2016 09:56 Go to previous message
Lars t Christmas is currently offline Lars t ChristmasFriend
Messages: 8
Registered: October 2015
Junior Member
Hi Ivan,

thank you very much, setting the theme's id to "org.eclipse.rap.rwt.theme.Default" brought it to work as intended Smile

Now your previous advice to set the padding of the cell worked as well.

Greetings, lars
Previous Topic:War Deployment Eclipse e4 RAP
Next Topic:Embed RAP panel with components in an HTML page
Goto Forum:
  


Current Time: Thu Apr 18 15:54:59 GMT 2024

Powered by FUDForum. Page generated in 0.02126 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top