title: Eclipse RCP application custom toolbar
body: <p>I am creating a custom toolbar for my RCP application.</p>
  
  <p><img src="https://i.stack.imgur.com/SEAFW.png" alt="enter image description here"></p>
  
  <ol>
  <li><p>As shown in figure I want to have a drop down box with three other text boxes. These are basically the input box and are interdependent. Right now each of these boxes are in separate classes. I want to bring them together in one class so it is easier to create listeners for each other.</p>
  
  <pre><code>protected void fillCoolBar(ICoolBarManager coolBar) {
  
  IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
  coolBar.add(toolbar);      
  
  Toolbar extraToolBar = new Toolbar("Toolbar");
  toolbar.add(extraToolBar);
  toolbar.add(new Separator());
  
  toolbar.add(new MyCombo("Demo Combo box"));
  toolbar.add(new Separator());
  
  toolbar.add(new IPaddress("Ip"));
  toolbar.add(new Separator());
  
  toolbar.add(new Mask("Mask"));
  toolbar.add(new Separator());
  
  toolbar.add(new Count("Count"));
  
  }
  
  public class IPaddress extends ControlContribution {
  
   Text textBox;
  
  
   public IPaddress(String id) {
       super(id);
      // TODO Auto-generated constructor stub
   }
  
   @Override
   protected Control createControl(Composite parent) {
  textBox = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP);
  textBox.setLayoutData(new GridData(GridData.FILL_BOTH));
  textBox.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent event) {
          Text text = (Text) event.widget;
          System.out.println(text.getText());
      } 
  });
  return textBox;
  }
  
  }
  </code></pre></li>
  <li><p>Thus I want to create a new custom Toolbar will all the functionalities that I want and then stick it to the original. But somehow it only shows an empty bar on the left.</p>
  
  <pre><code>protected Control createControl(Composite parent) {
  toolBar = new ToolBar(parent, SWT.FLAT |SWT.BORDER);
  
  Device dev = toolBar.getDisplay();
  
  try {
      newi = new Image(dev, "C:\\Users\\RahmanAs\\ChipcoachWorkspace\\ChipCoach\\icons\\FileClose.png");
      opei = new Image(dev, "C:\\Users\\RahmanAs\\ChipcoachWorkspace\\ChipCoach\\icons\\FileOpen.png");
  
  
  } catch (Exception e) {
      System.out.println("Cannot load images");
      System.out.println(e.getMessage());
      System.exit(1);
  }
  
  
  ToolItem item0 = new ToolItem (toolBar, SWT.PUSH);
  item0.setImage(newi);
  item0.setText("Hello");
  
  ToolItem item1 = new ToolItem(toolBar, SWT.PUSH);
  item1.setText("Push");
  
  ToolItem item2 = new ToolItem(toolBar, SWT.PUSH);
  item2.setText("Pull");
  
  
  return toolBar;
  
  
  }
  </code></pre></li>
  <li><p>I also have run buttons, which I created in the plugin using Vogella's tutorial. But I cannot program their placements in this way. (For example if I want them in the beginning.) Is there a way to create them programmatically?</p></li>
  </ol>