Bug 67275 - [RCP] RCP Plugin refactoring to exclude default views/perspective
Summary: [RCP] RCP Plugin refactoring to exclude default views/perspective
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks:
 
Reported: 2004-06-15 11:41 EDT by paul wuethrich CLA
Modified: 2007-06-20 15:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paul wuethrich CLA 2004-06-15 11:41:33 EDT
org.eclipse.ui.ide and org.eclipse.ui.views provide Resource perspective and 
Progress/Bookmark/Tasks/Property Sheet/Outline views which may not be required 
in an RCP application.

Creating bug based on response to newsgroup posting from Ed Burnette:

I don't know of an easier way but please file a bugzilla report
(www.eclipse.org > bugs) any time you find yourself hacking or copying the
Eclipse source in your RCP apps. Maybe further refactoring can make it
unnecessary in the next version. That's how RCP was born in the first place.

-- 
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

> "Michael Keppler" <michael.keppler@gmx.de> wrote in message
> news:cae6d7$r5k$1@eclipse.org...
> > Paul Wuethrich schrieb:
> >
> > > Also, I'm guessing the answer is the same for views since
> org.eclipse.ui.ide
> > > pulls in Outline, Bookmarks, Properties, Progress, Tasks which we do
not
> > > require??
> >
> > I had the problem the other way around: I needed the progress view but
> > did not need the IDE dependency. On filing a bug I was told to just copy
> > the progress view implementation manually so hacking the plugin might
> > also be a reasonable solution for your problem.
Comment 1 Nick Edgar CLA 2004-06-16 12:14:01 EDT
org.eclipse.ui.ide is not part of the RCP set of plug-ins.  It is the RCP app
for the Eclipse SDK.  Other RCP apps should not build on it unless they are part
of the IDE stack (e.g. the IBM Websphere and Rational development tool offerings).

RCP apps should build on org.eclipse.ui instead.

The progress view implementation is in org.eclipse.ui.workbench (a prerequisite
of org.eclipse.ui), but the XML for its view extension is in org.eclipse.ui.ide,
to avoid it appearing in the list of views for all RCP apps.  If an RCP app
wants to use it, it can copy the corresponding XML into its plugin.xml:

   <extension
         point="org.eclipse.ui.views">
      <view
            name="%Views.Progress"
            icon="icons/full/progress/pview.gif"
            category="org.eclipse.ui"
            class="org.eclipse.ui.internal.progress.JobView"
            id="org.eclipse.ui.views.ProgressView">
      </view>
   </extension>

The org.eclipse.ui.views plugin, which defines the Outline and Properties view,
is an optional RCP component.  RCP apps are not required to include this plugin,
but can do so if they want these views.
Comment 2 Nick Edgar CLA 2004-06-16 12:14:28 EDT
Should add this to the RCP FAQ.
Comment 3 paul wuethrich CLA 2004-06-16 12:36:16 EDT
In our case, the RCP app has a concept of a project and we therefore use the 
resource navigator which requires org.eclipse.ui.ide but do want the resource 
perspective.  I suppose we could reimplement that functionality but took the re-
use road for now.  Is that what you would suggest?
Comment 4 Nick Edgar CLA 2004-06-16 17:43:44 EDT
Sorry, you do or do not want the resource perspective?

It is possible to hide UI elements using the activities mechanism.

If you take the example at:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/activities/index.html

and modify it to have an activity with patternBindings matching the ids of the
bits you want to exclude, they will be hidden unless the activity is enabled
(which they're not by default).  If the activity has an associated category,
then it will appear in the activities dialog in the Help menu in the SDK, but it
is has no category then it will not.

Comment 5 Nick Edgar CLA 2004-06-16 17:51:33 EDT
Or, you could destructively modify the plugin.xml for org.eclipse.ui.ide to
remove the bits that you don't want.
Comment 6 paul wuethrich CLA 2004-06-16 18:56:54 EDT
Yes, we will be using the Navigator view but NOT the resource perspective (that 
was an omission-sorry).
Comment 7 David Bowen CLA 2005-07-05 19:56:46 EDT
>  If an RCP app
> wants to use it, it can copy the corresponding XML into its plugin.xml:
<snip>

Thanks Nick - that's just the information I needed to get rolling.
Comment 8 Nick Edgar CLA 2005-07-06 09:35:05 EDT
Note that due to the new extension factory mechanism in 3.1, it's no longer
necessary to refer to the internal view class from the view extension.
The extension to use for the Progress view in 3.1 is:

   <extension
         point="org.eclipse.ui.views">
      <view
            name="%Views.Progress"
            icon="icons/full/eview16/pview.gif"
            category="org.eclipse.ui"
            class="org.eclipse.ui.ExtensionFactory:progressView"
            id="org.eclipse.ui.views.ProgressView">
      </view>
   </extension>

See the ExtensionFactory class for the ids for other functionality (preference
pages and wizards) that can be used in RCP apps.
Comment 9 Nick Edgar CLA 2006-03-15 11:24:17 EST
Reassigning bugs in component areas that are changing ownership.
Comment 10 Boris Bokowski CLA 2007-06-20 15:28:25 EDT
It looks like what Paul asked for has been implemented or made available, so I'm closing this bug. Please reopen if you disagree.