Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2009-02-03 14:36:22 +0000
committerMichael Rennie2009-02-03 14:36:22 +0000
commit1eb8442d1b9e2d26ecf563bada778bc2c4d799b5 (patch)
tree873ec98d714affb0ae8d34a79b744cc979267e08 /org.eclipse.ui.externaltools
parent5e8d63d1bb006550d37c19f7b2a745f56ec735e6 (diff)
downloadeclipse.platform.debug-1eb8442d1b9e2d26ecf563bada778bc2c4d799b5.tar.gz
eclipse.platform.debug-1eb8442d1b9e2d26ecf563bada778bc2c4d799b5.tar.xz
eclipse.platform.debug-1eb8442d1b9e2d26ecf563bada778bc2c4d799b5.zip
Bug 218074 button label truncations on External Tools Builders config dialog
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java42
1 files changed, 25 insertions, 17 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
index f090fa642..11dab4380 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -274,16 +274,18 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
*/
private Button createButton(Composite parent, String label) {
Button button = new Button(parent, SWT.PUSH);
- GridData data = new GridData();
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- button.setLayoutData(data);
button.setFont(parent.getFont());
button.setText(label);
button.setEnabled(false);
button.addSelectionListener(buttonListener);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.grabExcessHorizontalSpace = true;
+ button.setLayoutData(data);
+ int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
return button;
}
-
+
/* (non-Javadoc)
* Method declared on PreferencePage.
*/
@@ -787,19 +789,25 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
newButton.setEnabled(true);
Table builderTable= viewer.getTable();
TableItem[] items = builderTable.getSelection();
- boolean validSelection= items != null && items.length > 0;
- boolean enableEdit= validSelection;
- boolean enableRemove= validSelection;
- boolean enableUp= validSelection;
- boolean enableDown= validSelection;
- if (validSelection) {
+ boolean enableEdit = false;
+ boolean enableRemove = false;
+ boolean enableUp = false;
+ boolean enableDown = false;
+ if(items != null) {
+ boolean validSelection = items.length > 0;
+ enableEdit = validSelection;
+ enableRemove = validSelection;
+ enableUp = validSelection;
+ enableDown = validSelection;
if (items.length > 1) {
enableEdit= false;
}
int indices[]= builderTable.getSelectionIndices();
int max = builderTable.getItemCount();
- enableUp= indices[0] != 0;
- enableDown= indices[indices.length - 1] < max - 1;
+ if(indices.length > 0) {
+ enableUp = indices[0] != 0;
+ enableDown = indices[indices.length - 1] < max - 1;
+ }
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
Object data= item.getData();
@@ -1158,10 +1166,10 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
Map oldArgs= oldCommand.getArguments();
Map newArgs= newCommand.getArguments();
- if (oldArgs == null && newArgs != null) {
- return true;
- }
- if (oldArgs == null && newArgs == null) {
+ if (oldArgs == null) {
+ if(newArgs != null) {
+ return true;
+ }
continue;
}
if(oldArgs.size() != newArgs.size()) {

Back to the top