Author: dazarov
Date: 2009-01-14 09:54:36 -0500 (Wed, 14 Jan 2009)
New Revision: 13038
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3516
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java 2009-01-14
13:17:11 UTC (rev 13037)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java 2009-01-14
14:54:36 UTC (rev 13038)
@@ -11,7 +11,12 @@
package org.jboss.tools.common.model.ui.forms;
+import java.util.HashMap;
+
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -113,8 +118,22 @@
// section.setClient(composite);
section.setClient(client);
+ section.setFont(getFontFromMap(section.getFont().getDevice(),
section.getFont().getFontData()));
+
return control;
}
+
+ private HashMap<FontData[], Font> fonts = new HashMap<FontData[], Font>();
+
+ private Font getFontFromMap(Device device, FontData[] fontData){
+ if(fonts.containsKey(fontData))
+ return fonts.get(fontData);
+ else{
+ Font font = new Font(device, fontData);
+ fonts.put(fontData, font);
+ return font;
+ }
+ }
protected void reflow() {
if (control==null) return;