Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6199841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:15:36+00:00 2026-05-24T04:15:36+00:00

Ok so I would really like to be able to add a multiline (textarea)

  • 0

Ok so I would really like to be able to add a multiline (textarea) InputDialog to my ruble.

I’ve worked around the limitations in Ruble::UI and created my own module that I load with my ruble when I want more then the default dialogs the Ruble::UI provides. Because of this I’ve been able to add multiselect dialogs and even gotten the Multiline InputDialog to work by creating a override class and then passing the getTextStyle method my own values to make it multiline.

The problem comes in that the dialog displays a multiline text box but it’s height is still set to one line, so it essentially still just a single line box. I know from Eclipse plugin dev how to create the multiline dialog in Java, I just can’t figure out how to make it happen in a ruble using jruby.

Here is my current code in ruby

Used to request a Multi Dialog

  class MultiInputDialog < org.eclipse.jface.dialogs.InputDialog
    def getInputTextStyle
      org.eclipse.swt.SWT::MULTI | org.eclipse.swt.SWT::BORDER | org.eclipse.swt.SWT::V_SCROLL
    end
  end

And here is what the code to do it in Java would like.

Java override

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...
     */
    @Override
    protected int getInputTextStyle() {
      return SWT.MULTI | SWT.BORDER | SWT.V_SCROLL;
    }

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

So you can see I’ve figured out how to override the getInputTextStyle, but everthing I’ve tried to mimic the override of createDialogArea() has falied. Any suggestions or help would be greatly appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:15:37+00:00Added an answer on May 24, 2026 at 4:15 am

    Try this:

      class MultiInputDialog < org.eclipse.jface.dialogs.InputDialog
        def getInputTextStyle
          org.eclipse.swt.SWT::MULTI | org.eclipse.swt.SWT::BORDER | org.eclipse.swt.SWT::V_SCROLL
        end
        def createDialogArea(parent)
          control = super(parent)
          getText.getLayoutData.heightHint = 100;
          control
        end
      end
    

    Cheers,
    Max

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.