Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Disable RCP Preferences, ActionSets, Views
Disable RCP Preferences, ActionSets, Views [message #448684] Fri, 28 April 2006 04:54 Go to next message
Eclipse UserFriend
Originally posted by: rpitt.ivis.com

Hi,

We have an RCP application that is quite basic and we there are some things
in the RCP that we don't use.
Therefore there are preferences, actionsets, views and perspectives that we
don't want visible.

To remove them from our application, we go into the relevant RCP jars and
comment out parts of the plugin.xml.

For example, we don't use the Resource perspective and so comment out this
in the plugin.xml of org.eclipse.ui.ide:
------------------------------------------------------------ ---------
<extension point="org.eclipse.ui.perspectives">
<perspective name="%Perspective.resourcePerspective"
icon="icons/full/eview16/resource_persp.gif"
class="org.eclipse.ui.internal.ide.ResourcePerspective"
id="org.eclipse.ui.resourcePerspective">
</perspective>
</extension>

<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.ui.resourcePerspective">
<showInPart
id="org.eclipse.ui.views.ResourceNavigator">
</showInPart>
</perspectiveExtension>
</extension>
------------------------------------------------------------ ---------

I have tried to do this declaratively from our plugin_customization.ini but
can't find the way to do it.

Any ideas?
Richard Pitt
Re: Disable RCP Preferences, ActionSets, Views [message #448715 is a reply to message #448684] Fri, 28 April 2006 17:14 Go to previous messageGo to next message
Eclipse UserFriend
You are making this too hard. You should just not include plug-ins like
org.eclipse.ui.ide as a dependency for your application. Also, make
sure its not included on your launch config. A basic RCP app should
only need org.eclipse.ui and org.eclipse.core.runtime.

Try using the new project wizard, saying "yes" to the question about
creating an RCP app and selecting one of the templates. Then
right-click on the project and choose Run As...Eclipse application.
That will show you the launch configuration for a barebones RCP
application.

Richard Pitt wrote:
> Hi,
>
> We have an RCP application that is quite basic and we there are some things
> in the RCP that we don't use.
> Therefore there are preferences, actionsets, views and perspectives that we
> don't want visible.
>
> To remove them from our application, we go into the relevant RCP jars and
> comment out parts of the plugin.xml.
>
> For example, we don't use the Resource perspective and so comment out this
> in the plugin.xml of org.eclipse.ui.ide:
> ------------------------------------------------------------ ---------
> <extension point="org.eclipse.ui.perspectives">
> <perspective name="%Perspective.resourcePerspective"
> icon="icons/full/eview16/resource_persp.gif"
> class="org.eclipse.ui.internal.ide.ResourcePerspective"
> id="org.eclipse.ui.resourcePerspective">
> </perspective>
> </extension>
>
> <extension point="org.eclipse.ui.perspectiveExtensions">
> <perspectiveExtension
> targetID="org.eclipse.ui.resourcePerspective">
> <showInPart
> id="org.eclipse.ui.views.ResourceNavigator">
> </showInPart>
> </perspectiveExtension>
> </extension>
> ------------------------------------------------------------ ---------
>
> I have tried to do this declaratively from our plugin_customization.ini but
> can't find the way to do it.
>
> Any ideas?
> Richard Pitt
>
>
>
Re: Disable RCP Preferences, ActionSets, Views [message #448777 is a reply to message #448715] Tue, 02 May 2006 04:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rpitt.ivis.com

Thanks for the comment, but we already have the minimum set of plugins that
are necessary for our application.

This is a problem with wanting to use a plugin, but not expose all the
actionsets and preferences that it gives us.

Another example, we use the org.eclipse.ui.editors plugin, but the menu it
contributes: "File | Convert Line Delimiters" is not used by our users. In
fact it is a confusing concept for them and should not be visible to them.

Any other suggestions out there? This must be a common use case for RCP
applications.

- Richard.


"Amber Beerends" <abeerends@cerner.com> wrote in message
news:e2u0kg$ghf$1@utils.eclipse.org...
> You are making this too hard. You should just not include plug-ins like
> org.eclipse.ui.ide as a dependency for your application. Also, make sure
> its not included on your launch config. A basic RCP app should only need
> org.eclipse.ui and org.eclipse.core.runtime.
>
> Try using the new project wizard, saying "yes" to the question about
> creating an RCP app and selecting one of the templates. Then right-click
> on the project and choose Run As...Eclipse application. That will show you
> the launch configuration for a barebones RCP application.
>
> Richard Pitt wrote:
>> Hi,
>>
>> We have an RCP application that is quite basic and we there are some
>> things in the RCP that we don't use.
>> Therefore there are preferences, actionsets, views and perspectives that
>> we don't want visible.
>>
>> To remove them from our application, we go into the relevant RCP jars and
>> comment out parts of the plugin.xml.
>>
>> For example, we don't use the Resource perspective and so comment out
>> this
>> in the plugin.xml of org.eclipse.ui.ide:
>> ------------------------------------------------------------ ---------
>> <extension point="org.eclipse.ui.perspectives">
>> <perspective name="%Perspective.resourcePerspective"
>> icon="icons/full/eview16/resource_persp.gif"
>>
>> class="org.eclipse.ui.internal.ide.ResourcePerspective"
>> id="org.eclipse.ui.resourcePerspective">
>> </perspective>
>> </extension>
>>
>> <extension point="org.eclipse.ui.perspectiveExtensions">
>> <perspectiveExtension
>> targetID="org.eclipse.ui.resourcePerspective">
>> <showInPart
>> id="org.eclipse.ui.views.ResourceNavigator">
>> </showInPart>
>> </perspectiveExtension>
>> </extension>
>> ------------------------------------------------------------ ---------
>>
>> I have tried to do this declaratively from our plugin_customization.ini
>> but
>> can't find the way to do it.
>>
>> Any ideas?
>> Richard Pitt
>>
>>
Re: Disable RCP Preferences, ActionSets, Views [message #448781 is a reply to message #448777] Tue, 02 May 2006 08:05 Go to previous messageGo to next message
Eclipse UserFriend
Richard Pitt wrote:
> Thanks for the comment, but we already have the minimum set of plugins that
> are necessary for our application.
>
> This is a problem with wanting to use a plugin, but not expose all the
> actionsets and preferences that it gives us.
>
> Another example, we use the org.eclipse.ui.editors plugin, but the menu it
> contributes: "File | Convert Line Delimiters" is not used by our users. In
> fact it is a confusing concept for them and should not be visible to them.
>
> Any other suggestions out there? This must be a common use case for RCP
> applications.
>

There is the notion of Capabilities ...
Window>Preferences>General>Capabilities (they're known as activities in
the code).

You might be able to filter out some of the menu items that are
contributed from the plugin.xml by including them in some disabled
capabilities.

Search for capabilities and activites in the help.

Later,
PW
Re: Disable RCP Preferences, ActionSets, Views [message #449112 is a reply to message #448777] Wed, 10 May 2006 11:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tmuthuku.cisco.com

Hi Richard,
I am also facing the same problem like you.
But I removed the “convert line delimiters menu” by using the following
code.

//Removing convert line delimiters menu.
ActionSetRegistry reg =
WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
String actionSetId =
"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo";
for (int i = 0; i < actionSets.length; i++)
{
if (!actionSets[i].getId().equals(actionSetId))
continue;
IExtension ext = actionSets[i].getConfigurationElement()
getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}

But some unwanted perspectives are coming automatically in our RCP
application. Like ”resource", "Debug" & etc. We planned to develop our
application with some other two perspectives.
By using the following code, I can find the already added perspectives in
the workbench.

org.eclipse.ui.IPerspectiveRegistry reg =
PlatformUI.getWorkbench().getPerspectiveRegistry();
IPerspectiveDescriptor[] p = reg.getPerspectives();
for(int i=0;i<p.length;i++){
System.out.println("Perspective : "+i+" ID : "+p[i].getID()+"
Label : "+p[i].getLabel());
}

But I can’t remove the “org.eclipse.ui.resourcePerspective”.

Richard, if you find any solution for this kindly let me know.

Thanks,
M.S.Thiraviyakumar
Re: Disable RCP Preferences, ActionSets, Views [message #449174 is a reply to message #449112] Wed, 10 May 2006 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: childress.shapetechllc.com

Thiraviyakumar wrote:

> Hi Richard,
> I am also facing the same problem like you.
> But I removed the “convert line delimiters menu” by using the following
> code.

> //Removing convert line delimiters menu.
> ActionSetRegistry reg =
> WorkbenchPlugin.getDefault().getActionSetRegistry();
> IActionSetDescriptor[] actionSets = reg.getActionSets();
> String actionSetId =
> "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo";
> for (int i = 0; i < actionSets.length; i++)
> {
> if (!actionSets[i].getId().equals(actionSetId))
> continue;
> IExtension ext = actionSets[i].getConfigurationElement()
> getDeclaringExtension();
> reg.removeExtension(ext, new Object[] { actionSets[i] });
> }

Thanks for this. I've been asking about the same question and not getting
anywhere.

Where did you put this code? I put it in
ApplicationWorkbenchWindowAdvisor.preWindowOpen(). It does remove the
menuItem from the File menu. But, it didn't remove the icon from the
toolbar for this action.

Do you know how I would get the icon removed from the toolbar?


Ken...
Re: Disable RCP Preferences, ActionSets, Views [message #449175 is a reply to message #449174] Wed, 10 May 2006 17:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: childress.shapetechllc.com

Ken Childress wrote:

> Thiraviyakumar wrote:

>> Hi Richard,
>> I am also facing the same problem like you.
>> But I removed the “convert line delimiters menu” by using the following
>> code.

>> //Removing convert line delimiters menu.
>> ActionSetRegistry reg =
>> WorkbenchPlugin.getDefault().getActionSetRegistry();
>> IActionSetDescriptor[] actionSets = reg.getActionSets();
>> String actionSetId =
>> "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo";
>> for (int i = 0; i < actionSets.length; i++)
>> {
>> if (!actionSets[i].getId().equals(actionSetId))
>> continue;
>> IExtension ext = actionSets[i].getConfigurationElement()
>> getDeclaringExtension();
>> reg.removeExtension(ext, new Object[] { actionSets[i] });
>> }

> Thanks for this. I've been asking about the same question and not getting
> anywhere.

> Where did you put this code? I put it in
> ApplicationWorkbenchWindowAdvisor.preWindowOpen(). It does remove the
> menuItem from the File menu. But, it didn't remove the icon from the
> toolbar for this action.

> Do you know how I would get the icon removed from the toolbar?

I made a mistake here. It's the icon on the toolbar for, Invalid Menu
Extension (Path is invalid): org.eclipse.ui.edit.text.gotoLastEditPosition
this that I'm trying to also remove.

Any ideas on this?


Ken...
Re: Disable RCP Preferences, ActionSets, Views [message #449623 is a reply to message #449175] Tue, 16 May 2006 23:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tmuthuku.cisco.com

Hi Ken,
By using the following code, we can find actionSetID's of all actionSets
added in the ActionSetRegistry. Based on those IDs, we can remove.

//To find the Action Sets added in ActionSetRegistry
ActionSetRegistry reg =
WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
for (int i = 0; i < actionSets.length; i++)
{
System.out.println("ACTION SET : "+i+" ID : "+actionSets[i].getID());
}

Thanks,
M.S.Thiraviyakumar
Re: Disable RCP Preferences, ActionSets, Views [message #449624 is a reply to message #449623] Tue, 16 May 2006 23:54 Go to previous message
Eclipse UserFriend
Originally posted by: tmuthuku.cisco.com

Hi,
Here once again, I am explaining about my issue related to Prespectives.
In our Eclipse RCP application some perspectives like ”resource", "Debug"
& etc. are coming automatically. I tried with out including the plugin
org.eclipse.ui.ide. But I was getting some other errors. Because it is
necessary for our application. I think, I have to remove these through
code( like “org.eclipse.ui.resourcePerspective” & etc.).
Pls. let me know, if you find any solution for this.

Thanks,
M.S.Thiraviyakumar
Previous Topic:Help:The reason for the error messages?
Next Topic:[Intro pages]"No standby content available"?!!???
Goto Forum:
  


Current Time: Sat Aug 30 15:00:19 EDT 2025

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

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

Back to the top