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

  • SEARCH
  • Home
  • 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 6062181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:01:19+00:00 2026-05-23T09:01:19+00:00

The case is that the TopTaskGroup(left one) can grab excess vertical space while resizing

  • 0

The case is that the TopTaskGroup(left one) can “grab excess vertical space” while resizing windowenter image description here, but the NewTaskGroup(the right one), after adding a TooBar on it(see the createAddBtnOnGroup method), it doesn’t grow as you resize the window. Why is that?

(I have a shell instance with 2-column GridLayout)

enter image description here

Code is here:

private void createTaskWidgets() {
    createTopTaskGroup();
    createNewTaskGroup();
}

private void createTopTaskGroup() {
    Group topTasksGroup = new Group(shell, SWT.SHADOW_NONE);
    topTasksGroup.setText(TaskConsts.TOP_TASK_LIST);

    topTasksTable = new TaskTable(topTasksGroup, TaskTable.SORT_BY_VOTES, iteration, this);
    topTasksTable.setLayoutData(getTableGridData() );

    topTasksGroup.setLayout(new GridLayout() );
    topTasksGroup.setLayoutData(getTableGridData() );
    topTasksGroup.pack();
}

private void createNewTaskGroup() {
    Group newTasksGroup = new Group(shell, SWT.SHADOW_NONE);
    newTasksGroup.setText(TaskConsts.NEW_TASK_LIST);

    newTasksTable = new TaskTable(newTasksGroup, TaskTable.SORT_BY_CREATION_TIME, iteration, this);
    topTasksTable.setLayoutData(getTableGridData() );

    ToolBar actionToolBar = createAddBtnOnGroup(newTasksGroup);

    newTasksGroup.setLayout(new GridLayout() );
    newTasksGroup.setLayoutData(getTableGridData() );
    newTasksGroup.layout();
    newTasksGroup.pack();

    // set actionToolBar's location to newTasksGroup's right-top position
    actionToolBar.setLocation(
            newTasksGroup.getLocation().x + newTasksGroup.getSize().x
                    - actionToolBar.getSize().x - 5,
            newTasksGroup.getLocation().y - 2);
}

private GridData getTableGridData() {
    GridData gridData = new GridData(0, SWT.FILL, false, true);
    return gridData;
}

private ToolBar createAddBtnOnGroup(Group newTasksGroup) {
    ToolBar actionToolBar = new ToolBar(newTasksGroup, SWT.HORIZONTAL | SWT.RIGHT);

    addTaskToolItem = new ToolItem(actionToolBar, SWT.PUSH | SWT.RIGHT);
    addTaskToolItem.setImage(new Image(display, TaskConsts.ICON_PLUS));

    final MainWindow mainWindow = this;
    addTaskToolItem.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            new CreateTask(getShell(), mainWindow);
        }
    });

    GridData gridData = new GridData();
    gridData.exclude = true;
    actionToolBar.setLayoutData(gridData);

    actionToolBar.pack();

    return actionToolBar;
}

private void organize() {
    GridLayout gridLayout = new GridLayout(2, false);
    shell.setLayout(gridLayout);
    shell.pack();
}

Thanks in advance~

  • 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-23T09:01:20+00:00Added an answer on May 23, 2026 at 9:01 am

    Thanks for your excellent problem description!

    It seems to me that this is a simple copy-paste bug.

    The fourth line in your createNewTaskGroup method should not be

    topTasksTable.setLayoutData(getTableGridData() );
    

    but

    newTasksTable.setLayoutData(getTableGridData() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched for this but I can't seem to find a similar case that
The use case is that I use one development machine for different source trees.
I might be stupid and you need to excuse me in that case...but I
It's often the case that I can write a nice tight little VB.NET function,
My question is probably very simple but it could also be the case that
I am doing some server side form validation and in the case that one
Is it the case that the entire restful verb is under a single all
I have a case that keeps coming up where I'm using a ListView or
We have a business case that would be perfect for multiple BackgroundWorkers. As an
I think that it used to the be the case that in Liferay 4,

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.