This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 402764 - Remove the MOpaque* and MRendered* model classes
Summary: Remove the MOpaque* and MRendered* model classes
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Paul Elder CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
: 427240 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-08 12:11 EST by Paul Webster CLA
Modified: 2014-03-31 12:08 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2013-03-08 12:11:35 EST
The MOpaque* classes just differentiate ICIs that should be treated as Opaque by our JFace-based renderers.

This can be better handled by a class.

PW
Comment 1 Paul Webster CLA 2013-03-08 12:12:07 EST
See http://wiki.eclipse.org/Eclipse4/API/UIModel

PW
Comment 2 Paul Webster CLA 2013-03-08 13:47:20 EST
We need to mark it as "@noreference not for use" for Kepler.

PW
Comment 3 Paul Elder CLA 2013-03-11 13:26:49 EDT
Proposed fix pushed to Gerrit:

https://git.eclipse.org/r/11058

Changes only effect Javadoc on EMF-generated interfaces. Note that fix also marks MRendered* as @noreference
Comment 4 Paul Webster CLA 2013-03-12 14:51:46 EDT
(In reply to comment #3)
> Proposed fix pushed to Gerrit:
> 
> https://git.eclipse.org/r/11058

I've reviewed it and it looks good.

Eric, if you review it, give it a +1, and then use the Publish and Submit button it should push it to the repo

PW
Comment 5 Paul Elder CLA 2013-03-13 09:25:54 EDT
Java doc updates have been verified in build 4.3.0.I20130312-2000.
Comment 6 Paul Elder CLA 2013-03-13 09:26:11 EDT
Verified in build 4.3.0.I20130312-2000.
Comment 7 Eric Moffatt CLA 2014-01-15 13:11:03 EST
Re-purposing the defect to handle the actual code changes needed to be able to *remove* these classes from the model...
Comment 8 Eric Moffatt CLA 2014-01-15 13:20:14 EST
Gerrit link for the initial work

  https://git.eclipse.org/r/20674

This operates on the following 'rules':

MOpaqueMenu / MRenderedMenu -> MMenu + "Opaque" / "Rendered" tag
MOpaqueToolBar / MRenderedToolBar -> MToolBar + "Opaque" / "Rendered" tag
MOpaqueMenuItem / MRenderedMenuItem -> MDirectMenuItem + "Opaque" / "Rendered" tag

For 'Opaque' elements the 'OpaqueItem' field has been replaced by a 'transientData' entry with the key "OpaqueItem".

For 'Remdered' elements the 'ContributionManager' field has been replaced by a 'transientData' entry with the key "ContributionManager".

This mostly seems to work except:

There are multiple 'File' menus in the main menu
There are *many* blank toolItems
Comment 9 Paul Webster CLA 2014-02-03 06:13:28 EST
*** Bug 427240 has been marked as a duplicate of this bug. ***
Comment 10 Lars Vogel CLA 2014-02-21 16:50:16 EST
Any chance we get this in Luna? Would be nice to have a simpler model to work with.
Comment 11 Paul Elder CLA 2014-02-24 09:15:13 EST
(In reply to Lars Vogel from comment #10)
> Any chance we get this in Luna? Would be nice to have a simpler model to
> work with.

Lars: Putting the finishing touches on it today. I'll need it well reviewed, but the plan is for it to be part of M6.
Comment 12 Paul Elder CLA 2014-02-24 10:01:37 EST
Completed patch:

https://git.eclipse.org/r/20674

This includes:
* all Eric's changes
* fix to issue noted in comment 8
* automatic migration of old models on load
* removal of MOpaque* and MRendered* classes from meta-model and generated code.

In testing, migration of models is a significant concern. Before launching a workbench to be migrated, make a backup copy of <workspace-loc>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

If there are any problems migrating, please attach this backup copy to this defect.
Comment 13 Paul Elder CLA 2014-02-25 09:18:59 EST
(In reply to comment #12)
> Completed patch:
> 
> https://git.eclipse.org/r/20674
> 

Pushed another revision:
1) actually deleted MOpaque* and MRendered* interfaces
2) got rid of broad use of magic strings "Opaque", "Rendered", "OpaqueItem" and "ContributionItem". Created OpaqueElementUtil and RenderedElementUtil utility classes that encapsulated the representation of Opaque and Rendered model elements, instead.
Comment 14 Paul Elder CLA 2014-02-26 10:06:35 EST
(In reply to Paul Elder from comment #13)
> (In reply to comment #12)
> > Completed patch:
> > 
> > https://git.eclipse.org/r/20674
> > 
> 

Published to master as:

https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f65e473bac989fc1d559242fbda5d4bff6a9d3e7

A second commit will follow shortly to fix up two minor issues mentioned on Paul Webster's review:

1) Opaque items it's always an IContributionItem, so the OpaqueElementUtils get and set methods could be better typed.

2) there were 2 or 3 locations where we associated the element with the ICI in the renderer but we don't set the opaque or rendered item.
Comment 15 Dani Megert CLA 2014-02-27 06:01:12 EST
Looks like this causes workbench corruption. See bug 429225 for details.
Comment 16 Lars Vogel CLA 2014-02-28 05:01:28 EST
e4 tools need to be adjusted, see Bug 429299
Comment 17 Paul Webster CLA 2014-03-05 06:17:28 EST
(In reply to Paul Elder from comment #14)
> 
> 1) Opaque items it's always an IContributionItem, so the OpaqueElementUtils
> get and set methods could be better typed.

I thought this was a good idea, but OpaqueElementUtils is in org.eclipse.e4.ui.workbench which can't see UI bundles like JFace, so we probably won't do this one.

> 
> 2) there were 2 or 3 locations where we associated the element with the ICI
> in the renderer but we don't set the opaque or rendered item.

Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9bb429fb6cddc9fe212cb78028f47f1189f03a17

PW
Comment 18 Paul Webster CLA 2014-03-06 15:36:55 EST
In 4.4.0.I20140305-2000

PW
Comment 19 Dani Megert CLA 2014-03-31 12:08:14 EDT
This causes bug 430593.