Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-11-19 05:02:54 -0500
committerUwe Stieber2011-11-19 05:04:15 -0500
commit01b5eb562e64a6e6b08e127bc0e98d0fc55b22bf (patch)
tree4ea4f0871606f33972be5cda6052bf2298328797 /target_explorer/plugins/org.eclipse.tcf.te.ui.swt
parent0ea222247e75e36f8b5ccefabb82d2c04c7e6dec (diff)
downloadorg.eclipse.tcf-01b5eb562e64a6e6b08e127bc0e98d0fc55b22bf.tar.gz
org.eclipse.tcf-01b5eb562e64a6e6b08e127bc0e98d0fc55b22bf.tar.xz
org.eclipse.tcf-01b5eb562e64a6e6b08e127bc0e98d0fc55b22bf.zip
Target Explorer: Make note composite minimum characters per line customizable
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.ui.swt')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/widgets/NoteCompositeHelper.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/widgets/NoteCompositeHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/widgets/NoteCompositeHelper.java
index ee48fa805..8fbd08710 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/widgets/NoteCompositeHelper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/widgets/NoteCompositeHelper.java
@@ -65,9 +65,32 @@ public class NoteCompositeHelper {
* the title of the note
* @param message
* the message for the note
+ *
* @return the composite for the note
*/
public static Composite createNoteComposite(Font font, Composite composite, String title, String message) {
+ return createNoteComposite(font, composite, title, message, SWT.DEFAULT);
+ }
+
+ /**
+ * Creates a composite with a highlighted Note entry and a message text.
+ * This is designed to take up the full width of the page.
+ *
+ * @see PreferencePage#createNoteComposite, this is a plain copy of that!
+ * @param font
+ * the font to use
+ * @param composite
+ * the parent composite
+ * @param title
+ * the title of the note
+ * @param message
+ * the message for the note
+ * @param minCharsPerLine
+ * the minimum number of characters per line. Defaults to '65' if less than '20'.
+ *
+ * @return the composite for the note
+ */
+ public static Composite createNoteComposite(Font font, Composite composite, String title, String message, int minCharsPerLine) {
Composite messageComposite = new NoteComposite(composite, SWT.NONE);
GridLayout messageLayout = new GridLayout();
@@ -115,7 +138,7 @@ public class NoteCompositeHelper {
* needed
*/
layoutData = new GridData(GridData.FILL_HORIZONTAL);
- layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(messageLabel, 65);
+ layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(messageLabel, minCharsPerLine >= 20 ? minCharsPerLine : 65);
messageLabel.setLayoutData(layoutData);
return messageComposite;

Back to the top