Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Scrolling text in ScrollPane vertically
Scrolling text in ScrollPane vertically [message #768295] Mon, 19 December 2011 21:41 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
Hello,

In my figure I have a ScrollPane and want to scroll text there vertically, but I am only able to scroll horizontally. What am I doing wrong?

String text = "Some long text with...";

ScrollPane scrollpane = new ScrollPane(); 
Viewport viewport= new Viewport();
				
flowPage = new FlowPage();
textFlow = new TextFlow();
textFlow.setLayoutManager(new SimpleTextLayout(textFlow));
flowPage.add(textFlow);
textFlow.setText(text);
		
viewport.setContents(flowPage);
scrollpane.setViewport(viewport); 
		
add(scrollpane);


Thanks,
Alex
Re: Scrolling text in ScrollPane vertically [message #769144 is a reply to message #768295] Wed, 21 December 2011 13:31 Go to previous messageGo to next message
Arieh Bibliowicz is currently offline Arieh BibliowiczFriend
Messages: 18
Registered: June 2011
Junior Member
Hi Alex. I tried your code in my editor and it does display vertical scroll bars, only you have to re-size your figure until it is smaller than the height of the text. Try the same code with a number of newlines ("\n") in the middle and the scroll bar will probably show.
I had a different problem in my code: the scroll bars did not get my mouse clicks. I am sure there is no figure on top of them or things like that.
Any ideas anyone?

Arieh
Re: Scrolling text in ScrollPane vertically [message #769969 is a reply to message #769144] Fri, 23 December 2011 01:51 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 393
Registered: November 2009
Senior Member
Thanks vainolo, but I wonder how does it calculate that text is scrolled horizontally and not vertically? Could it be nature of TextFlow? I didn't find any properties that would set preference of the scroll bars.
Previous Topic:[Zest] anti-aliasing for edges
Next Topic:[Draw2d] Non-uniform shades of color in draw2d PolylineConnection.
Goto Forum:
  


Current Time: Thu Dec 18 22:26:40 GMT 2014

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

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