Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 182126 Details for
Bug 148039
tableitem.setItemHeight or tableitem.setBounds needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
setTreeItemHeight Workaround using Java Reflection on Win32
Snippet.java (text/x-java-source), 992 bytes, created by
Greg B
on 2010-10-31 23:42:54 EDT
(
hide
)
Description:
setTreeItemHeight Workaround using Java Reflection on Win32
Filename:
MIME Type:
Creator:
Greg B
Created:
2010-10-31 23:42:54 EDT
Size:
992 bytes
patch
obsolete
>package snippet; > >import java.lang.reflect.InvocationTargetException; >import java.lang.reflect.Method; > >import org.eclipse.swt.widgets.Tree; > >public class Snippet { > > /** > * Use Java Reflection to call protected Tree#setItemHeight(int). > * > * @param tree Tree on which to adjust item height. > * @param itemHeight height in pixels to allow for each item. > */ > public static void setTreeItemHeight(final Tree tree, final int itemHeight) { > try { > // Search class hierarchy for protected setter method > final Method setter = Tree.class.getDeclaredMethod( > "setItemHeight", int.class); > setter.setAccessible(true); > setter.invoke(tree, Integer.valueOf(itemHeight)); > } catch (NoSuchMethodException e) { > // ignore > } catch (IllegalArgumentException e) { > // ignore > } catch (IllegalAccessException e) { > // ignore > } catch (InvocationTargetException e) { > // ignore > } > } > >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 148039
: 182126