Author: snjeza
Date: 2009-04-20 13:51:00 -0400 (Mon, 20 Apr 2009)
New Revision: 14828
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
Log:
JBIDE-4205 The PixelConverter class is removed from the I20090415 build
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-04-20
16:31:17 UTC (rev 14827)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-04-20
17:51:00 UTC (rev 14828)
@@ -18,12 +18,15 @@
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock;
import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
-import org.eclipse.jdt.internal.ui.util.PixelConverter;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -35,6 +38,7 @@
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
+//import org.jboss.tools.seam.ui.xpl.PixelConverter;
/**
* Find in SeamPreferences the instruction to Framework for Severity preferences
@@ -155,7 +159,7 @@
private static final String ENABLED= JavaCore.ENABLED;
private static final String DISABLED= JavaCore.DISABLED;
- private PixelConverter fPixelConverter;
+ //private PixelConverter fPixelConverter;
private static Key[] getKeys() {
ArrayList<Key> keys = new ArrayList<Key>();
@@ -176,7 +180,7 @@
@Override
protected Control createContents(Composite parent) {
- fPixelConverter = new PixelConverter(parent);
+ //fPixelConverter = new PixelConverter(parent);
setShell(parent.getShell());
Composite mainComp = new Composite(parent, SWT.NONE);
@@ -188,7 +192,7 @@
Composite commonComposite = createStyleTabContent(mainComp);
GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
+ gridData.heightHint = convertHeightInCharsToPixels(parent,20);
commonComposite.setLayoutData(gridData);
validateSettings(null, null, null);
@@ -196,6 +200,15 @@
return mainComp;
}
+ private int convertHeightInCharsToPixels(Control control,int chars) {
+ Font font = control.getFont();
+ GC gc = new GC(font.getDevice());
+ gc.setFont(font);
+ FontMetrics fFontMetrics = gc.getFontMetrics();
+ gc.dispose();
+ return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars);
+ }
+
private Composite createStyleTabContent(Composite folder) {
String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
String[] enableDisableValues= new String[] {ENABLED, DISABLED};