Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Part toolbar refresh issue
Part toolbar refresh issue [message #964085] Tue, 30 October 2012 08:44 Go to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1301
Registered: July 2012
Senior Member
Hi,

I noticed an issue related to refreshing part toolbars introduced with 4.2.1.
In fact I notice this in a view which is part of an Eclipse plugin. But as it works in 4.2 and not in 4.2.1 I'll assume it is related to the compatibility layer.

What am I trying to do?

I have a view that contains two menu items in the view toolbar. My plugin.xml looks like this:
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:MyView">
         <command
               commandId="ToggleViewModeCommand"
               icon="icons/toggledetailpane_co.gif"
               style="push"
               tooltip="Toggle the view mode between simple and detail view">
         </command>
         <command
               commandId="TogglePresentationCommand"
               style="push"
               tooltip="Toggle the table presentation between flat and hierarchical">
            <visibleWhen
                  checkEnabled="false">
               <with
                     variable="sourceprovider.detailview">
                  <equals
                        value="ENABLED">
                  </equals>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>


Clicking the one menu item triggers a command which modifies a variable in my source provider. The set-method in my source provider looks like this
	public void setDetailViewEnabled(boolean enable) {
		this.enabled = enable;
		String value = enabled ? ENABLED : DISABLED;
		fireSourceChanged(ISources.WORKBENCH, DETAIL_VIEW, value);
	}

I'm using the source provider mechanism explained in the tutorial by Lars Vogel: http://www.vogella.com/articles/EclipseCommandsAdvanced/article.html#commmands_sourceprovider

With the Eclipse 4.2 IDE the result was a refresh of the view toolbar whenever the value in the source provider changed. So the command toggled from visible to invisible state regarding the specified value.

After the update to 4.2.1 the view toolbar isn't refreshed automatically. But the view toolbar will render correctly when I resize it afterwards. So it seems to me that the refresh isn't working correctly since the update.

As it seems to be related to the compatibility layer IMHO this is the correct forum. If I'm wrong then please tell me where to ask the question.

Greez,
Dirk
Re: Part toolbar refresh issue [message #964323 is a reply to message #964085] Tue, 30 October 2012 12:38 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1301
Registered: July 2012
Senior Member
Found a bug in bugzilla about this. Searching in the right place sometimes helps.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=368466

It was already fixed but seems to be added with 4.2.1 again. So I reopened the bug.

Please correct me if I'm wrong.
Previous Topic:Double Click Event prob
Next Topic:Saving addon state
Goto Forum:
  


Current Time: Thu Oct 02 02:22:15 GMT 2014

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

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