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 61176 Details for
Bug 141106
TVT3.2:TCT376: RU: Truncation in DTD editor - Properties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
org.eclipse.wst.dtd.ui.patch
org.eclipse.wst.dtd.ui.patch (text/plain), 42.76 KB, created by
Amy Wu
on 2007-03-16 19:37:43 EDT
(
hide
)
Description:
org.eclipse.wst.dtd.ui.patch
Filename:
MIME Type:
Creator:
Amy Wu
Created:
2007-03-16 19:37:43 EDT
Size:
42.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.dtd.ui >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java,v >retrieving revision 1.4 >diff -u -r1.4 NotationSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,15 +11,12 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CLabel; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; >@@ -36,7 +33,6 @@ > > private CLabel publicIdLabel; > private CLabel systemIdLabel; >- private FontMetrics fFontMetrics; > > public void doHandleEvent(Event event) { > if (event.widget == publicIdText) { >@@ -64,13 +60,14 @@ > public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) { > super.createControls(parent, factory); > Composite composite = getWidgetFactory().createFlatFormComposite(parent); >- FormData data; > > // Create label first then attach other control to it > publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID); >- initializeFontMetrics(publicIdLabel); >- int labelWidth = getLabelWidth(publicIdLabel.getText()); >- data = new FormData(labelWidth, SWT.DEFAULT); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); >+ FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); > publicIdLabel.setLayoutData(data); >@@ -86,7 +83,10 @@ > > // Create label first then attach other control to it > systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID); >- labelWidth = getLabelWidth(systemIdLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE); >@@ -128,30 +128,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java,v >retrieving revision 1.4 >diff -u -r1.4 ContentModelTypeSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,17 +13,14 @@ > > import java.util.Iterator; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.CMBasicNode; >@@ -39,7 +36,6 @@ > > private CCombo typeCombo; > private String[] typeComboValues = {CMNode.ANY, CMNode.EMPTY, CMNode.PCDATA, CMNode.CHILDREN, CMNode.MIXED}; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -48,13 +44,14 @@ > public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) { > super.createControls(parent, factory); > Composite composite = getWidgetFactory().createFlatFormComposite(parent); >- FormData data; > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_TYPE); >- initializeFontMetrics(cLabel); >- int labelWidth = getLabelWidth(cLabel.getText()); >- data = new FormData(labelWidth, SWT.DEFAULT); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); >+ FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); > cLabel.setLayoutData(data); >@@ -123,30 +120,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java,v >retrieving revision 1.3 >diff -u -r1.3 OccurrenceSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java 17 May 2006 21:05:24 -0000 1.3 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,17 +11,14 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.CMRepeatableNode; >@@ -36,7 +33,6 @@ > > private CCombo occurrenceCombo; > private String[] occurrenceComboValues = {ONCE, ONE_OR_MORE, OPTIONAL, ZERO_OR_MORE}; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -48,8 +44,10 @@ > > // Create label first then attach other control to it > CLabel usageLabel = getWidgetFactory().createCLabel(composite, OCCURENCE); >- initializeFontMetrics(usageLabel); >- int labelWidth = getLabelWidth(usageLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -104,30 +102,4 @@ > setListenerEnabled(true); > } > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java,v >retrieving revision 1.3 >diff -u -r1.3 EntityTypeSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java 17 May 2006 21:05:24 -0000 1.3 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,18 +11,15 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.Entity; >@@ -37,7 +34,6 @@ > private CCombo typeCombo; > private String[] typeComboValues = {PARAMETER, GENERAL}; > private Button checkBox; >- private FontMetrics fFontMetrics; > > public static boolean isExternalEntity = false; > >@@ -51,8 +47,10 @@ > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(composite, ENTITY_TYPE); >- initializeFontMetrics(cLabel); >- int labelWidth = getLabelWidth(cLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -68,7 +66,10 @@ > typeCombo.setItems(typeComboValues); > > checkBox = getWidgetFactory().createButton(composite, EXTERNAL_ENTITY, SWT.CHECK); >- labelWidth = getLabelWidth(checkBox.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = checkBox.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.right = new FormAttachment(95, 0); >@@ -137,30 +138,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java,v >retrieving revision 1.4 >diff -u -r1.4 ContentModelNameSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,17 +13,14 @@ > > import java.util.Iterator; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.CMBasicNode; >@@ -38,7 +35,6 @@ > > private CCombo typeCombo; > private String[] typeComboValues = {CMNode.PCDATA}; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -50,8 +46,10 @@ > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_MODEL); >- initializeFontMetrics(cLabel); >- int labelWidth = getLabelWidth(cLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -109,30 +107,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java,v >retrieving revision 1.4 >diff -u -r1.4 AttributeDefaultSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,17 +11,14 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; >@@ -39,7 +36,6 @@ > private String[] usageComboValues = {IMPLIED, REQUIRED, FIXED, DTDPropertiesMessages._UI_DEFAULT}; > private Text defaultValueText; > private CLabel defaultValueLabel; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -51,8 +47,9 @@ > > // Create label first then attach other control to it > CLabel usageLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_USAGE); >- initializeFontMetrics(usageLabel); >- int labelWidth = getLabelWidth(usageLabel.getText()); >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -69,7 +66,10 @@ > > // Create label first then attach other control to it > defaultValueLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_DEFAULT_VALUE); >- labelWidth = getLabelWidth(defaultValueLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = defaultValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(usageLabel, +ITabbedPropertyConstants.VSPACE); >@@ -149,30 +149,4 @@ > } > } > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java,v >retrieving revision 1.3 >diff -u -r1.3 ContentModelGroupSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java 17 May 2006 21:05:24 -0000 1.3 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,17 +11,14 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.CMGroupNode; >@@ -34,7 +31,6 @@ > > private CCombo modelGroupCombo; > private String[] modelGroupComboValues = {SEQUENCE, CHOICE}; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -46,8 +42,10 @@ > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(composite, MODEL_GROUP); >- initializeFontMetrics(cLabel); >- int labelWidth = getLabelWidth(cLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -94,31 +92,4 @@ > } > } > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } >- > } >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java,v >retrieving revision 1.4 >diff -u -r1.4 NewEntitySection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -12,7 +12,6 @@ > package org.eclipse.wst.dtd.ui.internal.properties.section; > > import org.eclipse.core.resources.IFile; >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.ViewerFilter; > import org.eclipse.jface.window.Window; >@@ -21,13 +20,11 @@ > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Shell; >@@ -64,7 +61,6 @@ > private CCombo typeCombo; > private String[] typeComboValues = {PARAMETER, GENERAL}; > private PageBook pageBook; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -102,8 +98,10 @@ > > // Create label first then attach other control to it > CLabel nameLabel = getWidgetFactory().createCLabel(entityCommonComposite, NAME); //$NON-NLS-1$ >- initializeFontMetrics(nameLabel); >- int labelWidth = getLabelWidth(nameLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -119,7 +117,10 @@ > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(entityCommonComposite, ENTITY_TYPE); >- labelWidth = getLabelWidth(cLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(nameLabel, +ITabbedPropertyConstants.VSPACE); >@@ -159,7 +160,10 @@ > > // Create label first then attach other control to it > CLabel entityValueLabel = getWidgetFactory().createCLabel(internalEntityComposite, VALUE); //$NON-NLS-1$ >- int labelWidth = getLabelWidth(entityValueLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = entityValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -189,7 +193,10 @@ > > // Create label first then attach other control to it > CLabel publicIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, PUBLIC_ID); //$NON-NLS-1$ >- int labelWidth = getLabelWidth(publicIdLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -207,7 +214,10 @@ > // Create label first then attach other control to it > // Create System ID Label > CLabel systemIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, SYSTEM_ID); //$NON-NLS-1$ >- labelWidth = getLabelWidth(systemIdLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE); >@@ -363,30 +373,4 @@ > } > > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java,v >retrieving revision 1.3 >diff -u -r1.3 TypeSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java 17 May 2006 21:05:24 -0000 1.3 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,17 +11,14 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CCombo; > import org.eclipse.swt.custom.CLabel; > import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; > import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; > import org.eclipse.wst.dtd.core.internal.Attribute; >@@ -32,7 +29,6 @@ > > private CCombo typeCombo; > private String[] typeComboValues = {Attribute.CDATA, Attribute.ID, Attribute.IDREF, Attribute.IDREFS, Attribute.ENTITY, Attribute.ENTITIES, Attribute.NMTOKEN, Attribute.NMTOKENS, Attribute.ENUMERATED_NAME, Attribute.ENUMERATED_NOTATION}; >- private FontMetrics fFontMetrics; > > /** > * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, >@@ -41,12 +37,14 @@ > public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) { > super.createControls(parent, factory); > Composite composite = getWidgetFactory().createFlatFormComposite(parent); >- FormData data; > > // Create label first then attach other control to it > CLabel cLabel = getWidgetFactory().createCLabel(composite, TYPE); >- initializeFontMetrics(cLabel); >- int labelWidth = getLabelWidth(cLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); >+ FormData data = new FormData(labelWidth, SWT.DEFAULT); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); >@@ -91,30 +89,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java,v >retrieving revision 1.4 >diff -u -r1.4 EntityValueSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,15 +11,12 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CLabel; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; >@@ -39,7 +36,6 @@ > private CLabel valueLabel; > private CLabel publicIdLabel; > private CLabel systemIdLabel; >- private FontMetrics fFontMetrics; > > public void doHandleEvent(Event event) { > if (event.widget == valueText) { >@@ -75,13 +71,14 @@ > public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) { > super.createControls(parent, factory); > Composite composite = getWidgetFactory().createFlatFormComposite(parent); >- FormData data; > > // Create label first then attach other control to it > valueLabel = getWidgetFactory().createCLabel(composite, VALUE); >- initializeFontMetrics(valueLabel); >- int labelWidth = getLabelWidth(valueLabel.getText()); >- data = new FormData(labelWidth, SWT.DEFAULT); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = valueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); >+ FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); > valueLabel.setLayoutData(data); >@@ -97,7 +94,10 @@ > > // Create label first then attach other control to it > publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID); >- labelWidth = getLabelWidth(publicIdLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(valueLabel, +ITabbedPropertyConstants.VSPACE); >@@ -114,7 +114,10 @@ > > // Create label first then attach other control to it > systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID); >- labelWidth = getLabelWidth(systemIdLabel.getText()); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ labelWidth = Math.max(p.x, 98); > data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE); >@@ -179,30 +182,4 @@ > private boolean isExternalEntity() { > return EntityTypeSection.isExternalEntity; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file >Index: src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java >=================================================================== >RCS file: /cvsroot/webtools/wst/components/dtd/plugins/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java,v >retrieving revision 1.4 >diff -u -r1.4 NameSection.java >--- src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java 17 May 2006 21:05:24 -0000 1.4 >+++ src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java 16 Mar 2007 23:34:06 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,15 +11,12 @@ > *******************************************************************************/ > package org.eclipse.wst.dtd.ui.internal.properties.section; > >-import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CLabel; >-import org.eclipse.swt.graphics.FontMetrics; >-import org.eclipse.swt.graphics.GC; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.FormAttachment; > import org.eclipse.swt.layout.FormData; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; >@@ -30,7 +27,6 @@ > public class NameSection extends AbstractSection { > private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME; > private Text nameText; >- private FontMetrics fFontMetrics; > > public void doHandleEvent(Event event) { > if (event.widget == nameText) { >@@ -51,12 +47,13 @@ > super.createControls(parent, factory); > Composite composite = getWidgetFactory().createFlatFormComposite(parent); > >- FormData data; > // Create label first then attach other control to it > CLabel nameLabel = getWidgetFactory().createCLabel(composite, NAME); >- initializeFontMetrics(nameLabel); >- int labelWidth = getLabelWidth(nameLabel.getText()); >- data = new FormData(labelWidth, SWT.DEFAULT); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106 >+ Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); >+ int labelWidth = Math.max(p.x, 98); >+ FormData data = new FormData(labelWidth, SWT.DEFAULT); > data.left = new FormAttachment(0, 0); > data.top = new FormAttachment(0, 0); > nameLabel.setLayoutData(data); >@@ -96,30 +93,4 @@ > public boolean shouldUseExtraSpace() { > return false; > } >- >- /** >- * Initilize font metrics >- * >- * @param control >- */ >- private void initializeFontMetrics(Control control) { >- GC gc = new GC(control); >- gc.setFont(control.getFont()); >- fFontMetrics = gc.getFontMetrics(); >- gc.dispose(); >- } >- >- /** >- * Determine appropriate label width >- * >- * @param labelText >- * @return >- */ >- private int getLabelWidth(String labelText) { >- int labelWidth = 98; >- >- int pixels = Dialog.convertWidthInCharsToPixels(fFontMetrics, labelText.length() + 5); >- labelWidth = Math.max(pixels, labelWidth); >- return labelWidth; >- } > } >\ No newline at end of file
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 141106
:
40983
|
40984
|
40985
|
41014
|
41015
|
41799
|
43859
| 61176