Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Add ControlContribution to Coolbar
Add ControlContribution to Coolbar [message #1067752] Wed, 10 July 2013 12:57
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 99
Registered: July 2009
Member
Hi,

I can add composite to coolbar on eclipse 3.7 this like


@Override
	protected void fillCoolBar(ICoolBarManager coolBar) {
		// TODO Auto-generated method stub
		super.fillCoolBar(coolBar);
		
		ToolBarManager toolBarManager = new ToolBarManager();
		coolBar.add(toolBarManager);
                toolBarManager.add(action);
		toolBarManager.add(action_1);
		toolBarManager.add(action_2);
		toolBarManager.add(new Separator());
		 
		ToolBarManager toolBarManager_1 = new ToolBarManager();
		coolBar.add(toolBarManager_1);
		toolBarManager_1.add(exitAction);
		
		
		IContributionItem comboItem = new ControlContribution("type321")
	      {
			
			 public void fill(CoolBar parent, int index) {
				CoolItem coolItem = new CoolItem(parent, SWT.NONE);
	            InfoComp panel = new InfoComp(parent, SWT.NONE, thisComp);
	           
	            coolItem.setControl(panel);
	            coolItem.setPreferredSize(
  	        		panel.computeSize(SWT.DEFAULT, SWT.DEFAULT));

	            
	         }

			@Override
			protected Control createControl(Composite parent) {
				
				return null;
			}

			
	      };

	     // coolBar.setLockLayout(false);
	      
	      try{
	      comboItem.setVisible(true);
	      coolBar.add(comboItem);
	      
	      coolBar.update(true);
	     
	      }
	      catch(Exception ex){
	    	  ex.printStackTrace();
	      }
	      
	}





this code not working in eclipse 4.3 . Not added InfoComp composite on collbar.

How can I find a solution this issue for eclipse 4.3

Best Regards,
Previous Topic:Discouraged Access
Next Topic:Minimum and Maximum view size in Eclipse 4
Goto Forum:
  


Current Time: Thu Dec 18 02:40:05 GMT 2014

Powered by FUDForum. Page generated in 3.07207 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software