summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGalileo Perez2012-08-29 17:10:21 (EDT)
committerRoberto Sanchez2012-08-29 17:10:21 (EDT)
commitaf5c1f87495b2c22b7f5062bcc7af3b844c86127 (patch)
treea3c3c4e2c2f87c64d9c860b0f37b6abf67c9013c
parentfd351f5d3c247653aad28530c74964fadf5a5c97 (diff)
downloadwebtools.common-af5c1f87495b2c22b7f5062bcc7af3b844c86127.zip
webtools.common-af5c1f87495b2c22b7f5062bcc7af3b844c86127.tar.gz
webtools.common-af5c1f87495b2c22b7f5062bcc7af3b844c86127.tar.bz2
[387884] TVT/DVT3.8:TCT131: DEU: Search... button truncatedv201208292200
-rw-r--r--plugins/org.eclipse.wst.common.frameworks.ui/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java20
2 files changed, 20 insertions, 2 deletions
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.common.frameworks.ui/META-INF/MANIFEST.MF
index e344a2e..18602c1 100644
--- a/plugins/org.eclipse.wst.common.frameworks.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.common.frameworks.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.wst.common.frameworks.ui; singleton:=true
-Bundle-Version: 1.2.200.qualifier
+Bundle-Version: 1.2.201.qualifier
Bundle-Activator: org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin
Bundle-Localization: plugin
Export-Package: org.eclipse.wst.common.frameworks.internal.datamodel.ui;x-internal:=true,
diff --git a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java
index 15067f1..a73c39f 100644
--- a/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java
+++ b/plugins/org.eclipse.wst.common.frameworks.ui/wtp_ui/org/eclipse/wst/common/frameworks/internal/ui/NewProjectGroup.java
@@ -13,6 +13,8 @@ package org.eclipse.wst.common.frameworks.internal.ui;
import java.io.File;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -20,6 +22,9 @@ import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -35,7 +40,7 @@ import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
-public class NewProjectGroup implements IProjectCreationPropertiesNew {
+public class NewProjectGroup implements IProjectCreationPropertiesNew{
private IDataModel model;
public Text projectNameField = null;
protected Text locationPathField = null;
@@ -133,6 +138,19 @@ public class NewProjectGroup implements IProjectCreationPropertiesNew {
GridDataFactory.defaultsFor(browseButton).applyTo(browseButton);
browseButton.setFont(font);
browseButton.setText(defBrowseButtonLabel);
+ GC gc = new GC(projectGroup);
+ gc.setFont(projectGroup.getFont());
+ FontMetrics fontMetrics = gc.getFontMetrics();
+ gc.dispose();
+ int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
+ Object layoutData = browseButton.getLayoutData();
+ //This if statement fixes the truncated value of the browse button text
+ if (layoutData instanceof GridData){
+ GridData dataForBrowseButton = (GridData) layoutData;
+ Point minButtonSize = browseButton.computeSize(SWT.DEFAULT,SWT.DEFAULT, true);
+ dataForBrowseButton.widthHint = Math.max(widthHint, minButtonSize.x);
+ browseButton.setLayoutData(dataForBrowseButton);
+ }
browseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {