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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:44:22+00:00 2026-06-02T23:44:22+00:00

I manage to add a combo box on the IToolBarManager following the code listed

  • 0

I manage to add a combo box on the IToolBarManager following the code listed bellow. Now does anybody has any idea how to access the combo box that is created inside the IContributionItem from oustide that scope?

Kind Regards,
Kyriakos

IToolBarManager mgr = this.getViewSite().getActionBars().getToolBarManager();
IContributionItem comboCI = new ControlContribution("test") {
    protected Control createControl(Composite parent) {

        final Combo c = new Combo(parent, SWT.READ_ONLY);
        c.add("one");
        c.add("two");
        c.add("three");
        c.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 c.add("four");
              }
              });
        return c;
    }
};        

mgr.add(comboCI);
  • 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-02T23:44:25+00:00Added an answer on June 2, 2026 at 11:44 pm

    Put the combo variable inside ControlContribution class or IContributionItem interface and create a get method.

    class ControlContribution implements IContributionItem {
    
        protected Combo combo;
    
        public Combo getCombo(){
            return combo;
        }
    }
    

    This way, you don’t need to declare it inside the anonymous class.

    IContributionItem comboCI = new ControlContribution("test") {
    protected Control createControl(Composite parent) {
    
        combo = new Combo(parent, SWT.READ_ONLY);
        combo.add("one");
        combo.add("two");
        combo.add("three");
        combo.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 combo.add("four");
              }
              });
        return combo;
    }
    };  
    

    And you can call

    comboCI.getCombo();
    

    Obviously, the IContributionItem interface need to have getCombo() method

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

Sidebar

Related Questions

I have some code that loads the serial ports into a combo-box: List<String> tList
In Magento, when I'm creating a product from Catalog -> Manage Products -> Add
For declaration perspective the following is allowed IList<string> list= new string[3]; list.Add(Apple); list.Add(Manago); list.Add(Grapes);
I have a combo box defined as such <ComboBox Name=RoomDropDown Visibility={Binding Path=RoomDropDownVisible,Mode=OneWay,Converter={StaticResource BoolVisibilityConvertor}} ItemsSource={Binding
I have a combo box defined as such <ComboBox Name=RoomDropDown Visibility={Binding Path=RoomDropDownVisible,Mode=OneWay,Converter={StaticResource BoolVisibilityConvertor}} ItemsSource={Binding
I was able to manage rows(add, delete and reorder) of an uitableviewcell in navigation
I want to create a Java frontend to add/manage content in a Lotus notes
I need a little help with row count. i manage to add today and
I'm using System.DirectoryServices.AccountManagement namespace classes to add and manage users in AD, but I
Can i print out a url /admin/manage/products/add of a certain view in a template?

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.