Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-21 11:40:52 +0000
committerTobias Schwarz2014-02-21 11:40:52 +0000
commit3e48d55da1cfd6ef643645e5e2f8bfc0dfb75304 (patch)
treee917b2facda2f3492cd7bb8ae9ac3be59b60feee /target_explorer
parent61e43dd7f597e06b498c29663abf9db7c8520636 (diff)
downloadorg.eclipse.tcf-3e48d55da1cfd6ef643645e5e2f8bfc0dfb75304.tar.gz
org.eclipse.tcf-3e48d55da1cfd6ef643645e5e2f8bfc0dfb75304.tar.xz
org.eclipse.tcf-3e48d55da1cfd6ef643645e5e2f8bfc0dfb75304.zip
Target Explorer: add possibility to format button text
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java
index 58803e6c8..ebafd9309 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java
@@ -1181,11 +1181,15 @@ public class BaseEditBrowseTextControl extends AbstractDecoratedDialogPageContro
Button button = toolkit != null ? toolkit.createButton(parent, null, SWT.PUSH) : new Button(parent, SWT.PUSH);
// add a whitespace at the beginning and at the end of the button text to make the
// button visibly broader than the label itself.
- button.setText(" " + getButtonLabel().trim() + " "); //$NON-NLS-1$ //$NON-NLS-2$
+ button.setText(formatButtonLabel(getButtonLabel()));
return button;
}
+ protected String formatButtonLabel(String label) {
+ return " " + (label != null ? label.trim() : Messages.BaseEditBrowseTextControl_button_label) + " "; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
/**
* Configure the given button control before the control is set visible. Subclasses may use
* this hook to configure the button control for their specific needs and to register any
@@ -1209,7 +1213,7 @@ public class BaseEditBrowseTextControl extends AbstractDecoratedDialogPageContro
// If not yet set, assure that the buttons fill in the available space
if (button.getLayoutData() == null) {
GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
- layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(button, SWTControlUtil.getText(button).length() + 4);
+ layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(button, formatButtonLabel(getButtonLabel()).length());
button.setLayoutData(layoutData);
}
}

Back to the top