diff options
author | ddunne | 2011-07-27 22:10:49 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-07-27 22:10:49 +0000 |
commit | 454a3ee89755a756bc6c882ca0d7a25839b5c09b (patch) | |
tree | d5f354b1a4374afe8d1358d1c3cf29172c33a8e2 /plugins/org.eclipse.osee.framework.ui.swt | |
parent | e3ac93ce6d1e887e957f693005c44a15a1663c5f (diff) | |
download | org.eclipse.osee-454a3ee89755a756bc6c882ca0d7a25839b5c09b.tar.gz org.eclipse.osee-454a3ee89755a756bc6c882ca0d7a25839b5c09b.tar.xz org.eclipse.osee-454a3ee89755a756bc6c882ca0d7a25839b5c09b.zip |
feature: Improve LabelComposite
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.swt')
2 files changed, 13 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/FontManager.java b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/FontManager.java index 74afb453fa0..bcc5a1e7207 100644 --- a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/FontManager.java +++ b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/FontManager.java @@ -38,6 +38,10 @@ public final class FontManager { return getFont("Courier New", 8, SWT.NONE); } + public static Font getCourierNew12Bold() { + return getFont("Courier New", 12, SWT.BOLD); + } + public static Font getFont(String fontName, int size, int swtType) { String hashKey = fontName + "-" + size + "-" + swtType; if (!fontMap.containsKey(hashKey)) { diff --git a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/LabelComposite.java b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/LabelComposite.java index 53d15189675..3a41a9c043b 100644 --- a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/LabelComposite.java +++ b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/LabelComposite.java @@ -28,10 +28,17 @@ public class LabelComposite extends Composite { setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setBackground(Displays.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + if (image != null) { + Label icon = new Label(this, SWT.NONE); + icon.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false)); + icon.setBackground(Displays.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + icon.setImage(image); + } + Label text = new Label(this, SWT.WRAP); - text.setFont(parent.getFont()); + text.setFont(FontManager.getCourierNew12Bold()); text.setBackground(Displays.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); - text.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true)); + text.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false)); text.setText(label); } } |