IWorkbenchActivitySupport results in two sets of toolbar buttons? [message #330617] |
Tue, 05 August 2008 16:34 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02715 seconds