Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IWorkbenchActivitySupport results in two sets of toolbar buttons?
IWorkbenchActivitySupport results in two sets of toolbar buttons? [message #330617] Tue, 05 August 2008 16:34
Eclipse UserFriend
Originally posted by: dlacerte.counterpath.com

If I call IWorkbenchActivitySupport.setEnabledActivityIds() I get two sets
of toolbar buttons.

I have a preference page declared as:

<!-- Preferences "Telephony Accounts" page -->
<extension
point = "org.eclipse.ui.preferencePages">
<page id="CounterPath.Preferences.Accounts.AccountsPage"
class="CounterPath.Preferences.Accounts.AccountsPage"
name="Telephony Accounts">
</page>
</extension>
<!-- An activity to allow us to show/hide the "Telephony Accounts" page
-->
<extension
point="org.eclipse.ui.activities">
<activity
name="Telephony Accounts"
description="Telephony Accounts Preferences"
id="CounterPath.Preferences.AccountsPageActivity">
</activity>
<activityPatternBinding
activityId="CounterPath.Preferences.AccountsPageActivity"
pattern="PALS/CounterPath\.Preferences\.Accounts\.AccountsPage ">
</activityPatternBinding>
<defaultEnablement id="CounterPath.Preferences.AccountsPageActivity" />
</extension>


I make the following call to show or hide it (in this test I am showing
it):

IWorkbenchActivitySupport workbenchActivitySupport =
PlatformUI.getWorkbench().getActivitySupport();
IActivityManager activityManager =
workbenchActivitySupport.getActivityManager();
HashSet enabledIds = new HashSet(activityManager.getEnabledActivityIds());
if (value)
{
if (enabledIds.add("CounterPath.Preferences.AccountsPageActivity "))
workbenchActivitySupport.setEnabledActivityIds(enabledIds);
}
else
{
if (enabledIds.remove("CounterPath.Preferences.AccountsPageActivity "))
workbenchActivitySupport.setEnabledActivityIds(enabledIds);
}


And in a DIFFERENT plugin I have the following toolbar declared:

<extension
point="com.ibm.rcp.ui.controlSets">
<controlSet
align="left"
id="CounterPath.NotesToolbar.ToolbarContribution.set"
label="SMC Plug-in Toolbar"
visible="true">
<toolBar
id="CounterPath.NotesToolbar.ToolbarContribution.bar"
path="BEGIN_GROUP"/>
<control
class="CounterPath.NotesToolbar.ToolbarContribution"
id="CounterPath.NotesToolbar.ToolbarContribution"

toolbarPath="CounterPath.NotesToolbar.ToolbarContribution.bar "/>
</controlSet>
</extension>

When I make the call to setEnabledActivityIds() I get two sets of buttons
in this toolbar but if I comment out that call I get a single set.
Previous Topic:Re: Ganymede hangs at loading workbench
Next Topic:How to get Project Path from File in Editor?
Goto Forum:
  


Current Time: Mon Dec 30 17:18:19 GMT 2024

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

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

Back to the top