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 7846807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:42:49+00:00 2026-06-02T17:42:49+00:00

I want to add a combo box to the toolbar (coolbar) of eclipse using

  • 0

I want to add a combo box to the toolbar (coolbar) of eclipse using Eclipse Plug-in development API (not an RCP application). This combo box items should be dynamically added/removed.

I know that in RCP applications it is possible by following the link : http://www.thedeveloperspoint.com/?p=140

but I am looking at Eclipse plugin API.

Any help would be greatly appreciated.

Thanks
Syam

  • 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-06-02T17:42:51+00:00Added an answer on June 2, 2026 at 5:42 pm

    This can be done by using 2 steps.

    STEP 1: By using extension point mechanism create/add toolbar to the global toolbar (using locationURI as “toolbar:org.eclipse.ui.main.toolbar”)

      <extension
         point="org.eclipse.ui.menus">
        <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="com.company.module.toolbar"
               label="Sample">
            <control
                  class="com.company.module.ui.ComboToolbarContribution"
                  id="ratata">
            </control>
        </toolbar>
       </menuContribution>
     </extension>
    

    STEP 2: Implement the ComboToolbarContribution as follows.

    package com.company.module.ui;
    
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.layout.GridData;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Combo;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Control;
    import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
    
    public class ComboToolbarContribution extends
        WorkbenchWindowControlContribution {
    private Combo mReader;
    
    public ComboToolbarContribution() {
    
    }
    
    @Override
    protected Control createControl(Composite parent) {
        Composite container = new Composite(parent, SWT.NONE);
        GridLayout glContainer = new GridLayout(1, false);
        glContainer.marginTop = -1;
        glContainer.marginHeight = 0;
        glContainer.marginWidth = 0;
        container.setLayout(glContainer);
        GridData glReader = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
        glReader.widthHint = 280;
        mReader = new Combo(container, SWT.BORDER | SWT.READ_ONLY
                | SWT.DROP_DOWN);
        mReader.setLayoutData(glReader);
    
        return container;
    }
    
    @Override
    protected int computeWidth(Control control) {
        return 300;
    } }
    

    With the above 2 steps a combo box will be added to the global toolbar and user need to provide the global access to the combo box.

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

Sidebar

Related Questions

I want to add a series of strings to a combo box using std::for_each.
I want to add simple list/combo box with action script 3 . but i
I want to add editable combo box in GWT , so please tell me
I have created a jframe using net beans and add combo box to that.
I want to display member of combo box(add) in windows form before clicking drop
I want add my custom sidebar next right column all page. Please check this
I want to add an additional roadblock in my application to prevent automating it
I want to Add Values to my combobox in Datareader. This is my code,
I want to reset childcombo box after disabled by parent combo. Child combo box
I need to add the item in a combo box for a particular number

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.