Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Why not just Draw Labels,Instead of creating one?
Why not just Draw Labels,Instead of creating one? [message #717686] Mon, 22 August 2011 04:37 Go to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
We have an application which is facing "out of handles" issue a lot,all system resources managed and optimized leaves as with only one issue,there are simply too many controls...
Also after counting the widgets in my application it was found that table items and labels were going into thousands,so after converting all tables to virtual,left as with the huge number of labels...

Labels normally have only one purpose in a typical scanario,i.e to show some text,so why not draw it on the parent instead of wasting a handle for the same...
But due to layouts and size computation it can not be done directly ,so i was wondering can there be a hack which can achieve this??
what are the potential issues if at all done?


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay

[Updated on: Mon, 22 August 2011 11:00]

Report message to a moderator

Re: Why not just Draw Labels,Instead of creating one? [message #718376 is a reply to message #717686] Wed, 24 August 2011 07:06 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
apart from label issue ,it would be a good feature to be able to add a dummy control which is considered in layout management but not rendered or resources allocated for the same.
taking the example of grid layout this can be done easily,if only the Gridlayout would not base its calculations upon getChildren method of the composite and had an option of adding a virtual control with a griddata specified.


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Why not just Draw Labels,Instead of creating one? [message #719850 is a reply to message #718376] Mon, 29 August 2011 08:29 Go to previous message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Ok ,Have come up with a solution assuming only gridlayout,

Three java files have been attached namely SWTGridExample.java,GridLayoutWithDummies.java and GridDataForDummies.java.

SWTGridExample is test class for testing the implementation,

dummyControlsTest tests adding of dummy control in a gridlayout and

dummyLabelTest tests adding dummy labels on a parent using GridLayoutWithDummies as layout and painting the text on the parent itself instead of a Label control.

griddata consideration of horizontal and vertical span not implemented and also there may be bugs with other properties..
but still the basic idea has been proven and all issues can be dealt with later..

Inputs and feedback are welcome,please use the implimentation as and when required without any restrictions Smile


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay

[Updated on: Mon, 05 September 2011 05:50]

Report message to a moderator

Previous Topic:No ToolTipText on Windows 7
Next Topic:MessageBox orientation
Goto Forum:
  


Current Time: Mon Dec 22 10:35:54 GMT 2014

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

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