Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Input Dialog - Textarea
Input Dialog - Textarea [message #650558] Tue, 25 January 2011 14:19 Go to next message
akoeck is currently offline akoeckFriend
Messages: 62
Registered: December 2010
I need a dialog for simple textinput.
The text could be relative long, so I need a bigger textarea than the one row taxtarea of the Input Dialog.
Can I make that textarea bigger, or do I have to write my own Dialog?
If so, how do i create a bigger textarea?

Thanks in advance.
Re: Input Dialog - Textarea [message #650641 is a reply to message #650558] Tue, 25 January 2011 19:29 Go to previous message
Carsten Habicht is currently offline Carsten HabichtFriend
Messages: 14
Registered: January 2011
Junior Member
You don't have to: the InputDialog is meant to be subclassed. Smile
Here is what I'd write it if I didn't have to fear anybody ever reading the code:

        InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "Test", "Please input text.",
            "Test-Text", null) {

           * Override this method to make the text field multilined
           * and give it a scroll bar. But...
          protected int getInputTextStyle() {
            return SWT.MULTI | SWT.BORDER | SWT.V_SCROLL;

           * still is just one line high.
           * This hack is not very nice, but at least it gets the job done... ;o)
          protected Control createDialogArea(Composite parent) {
            Control res = super.createDialogArea(parent);
            ((GridData) this.getText().getLayoutData()).heightHint = 100;
            return res;

Sylphen - Ihr Systemhaus in Mittelhessen -
Previous Topic:[Databinding] Master-detail-binding and validators
Next Topic:[Drag and Drop] DnD within same TreeViewer
Goto Forum:

Current Time: Mon Jun 25 14:05:36 GMT 2018

Powered by FUDForum. Page generated in 0.01502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top