Bug 370797 - [Theme] Papyrus should provide a support for CSS files on its diagrams
Summary: [Theme] Papyrus should provide a support for CSS files on its diagrams
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Camille Letavernier CLA
QA Contact:
URL:
Whiteboard: Editors
Keywords: plan
Depends on:
Blocks:
 
Reported: 2012-02-07 04:39 EST by Camille Letavernier CLA
Modified: 2012-06-21 05:50 EDT (History)
1 user (show)

See Also:
rschnekenburger: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Camille Letavernier CLA 2012-02-07 04:39:11 EST
Papyrus should provide a CSS Engine for GMF elements.

The CSS selectors should be based on the semantic model (e.g. UML), while the CSS properties should reflect the GMF Style properties, as well as some custom properties (e.g. UML Style properties defined in Papyrus).

The CSS stylesheets should be defined at three levels:

- Workspace
- Model
- Diagram

The CSS files should be editable either textually or graphically. The graphical editor should look like the current preferences page in Papyrus.
Comment 1 Camille Letavernier CLA 2012-02-23 08:43:30 EST
r7275~7277:

First draft of the CSS Support:

- GMF Notation Model is overridden with the CSS Implementation. This is potentially intrusive, although efforts have been made to avoid behavior changes outside of Papyrus.
- CSS Engine support in Papyrus
- Base theme added for UML

It is currently not possible to choose which CSS files are applied, nor to edit the existing ones.
Comment 2 Camille Letavernier CLA 2012-02-29 07:57:06 EST
r7301, r7311:

The following CSS Engines are supported:

- Base: OK
- Workspace: Runtime only (Not configurable ; A Sample CSS file is automatically applied). 
- Model: Runtime only (Not configurable ; currently unusable)
- Diagram: OK (Runtime + Property view)
- Local: OK (Runtime + Property view)

It is possible to apply CSS Classes, Style and ID on elements. Diagram and Model stylesheets can be either referenced (ie. external CSS files) or embedded (ie. stored in the *.notation model).

The tool supports all the GMF Style properties, plus a few Papyrus ones:

- elementIcon
- qualifiedNameDepth
- shadow

The CSS StyleSheet information is stored in the Notation model (EMF Objects + Custom GMF NamedStyles)
Comment 3 Camille Letavernier CLA 2012-03-02 07:51:01 EST
r7326:

The EMF model for CSS Stylesheets has been isolated in its own plug-in, so that it can be shipped along with Papyrus. This will avoid inconsistent models, even when the CSS plug-ins are not installed.

Implemented full support for Workspaces Themes.

Improved listeners and automatic refresh after modifications.
Comment 4 Camille Letavernier CLA 2012-03-02 11:45:12 EST
r7333 ~ r7337:

Added Facets & Customizations in the ModelExplorer to display the StyleSheets
Comment 5 Camille Letavernier CLA 2012-03-06 07:39:23 EST
r7355:

Minor fixes
Comment 6 Camille Letavernier CLA 2012-03-19 08:54:50 EDT
r7438~7441:

- Added an X-Text editor for CSS Stylesheets. The editor essentially works as a parser/serializer for manipulating CSS Files as EMF Models. Currently, the editor provides less support for editing CSS files in text mode than the standard CSS editor.
- Added an option to save the style of the selected View in a Stylesheet. This allows for editing a CSS stylesheet with a graphical tool
- Added suggestions for adding a CSS Class to an element. The suggestion lists all the CSS Classes which can be applied to the kind of element which is selected (Based on its element type, ie. the name of its metaclass). It is still possible to add a custom CSS Class (Which doesn't have to exist yet).
- The Appearance property view configuration has been split in two: the Style part of the Notation Metamodel (All Metaclasses extending Style), and the rest. An extension point has been added to override the behavior of the Style property view. This allows to keep the same property view for editing different kinds of objects (For example, the same Appearance property view can now be used to edit either the .notation model or a Stylesheet's Ruleset). Currently, Papyrus only provides one implementation of the Style handler, which edits the Notation model.
- A few widgets (from infra.widgets) have been improved to be used programmatically (Outside of the Property View).
Comment 7 Camille Letavernier CLA 2012-04-02 12:35:22 EDT
r7698, r7699:

Added more meaningful error messages to the "Create new style" dialog. The OK button is now disabled until the errors are fixed. Stylesheet widgets are now cleaned when another widget is used to select a stylesheet, to avoid confusion about what widget will actually be used.
Comment 8 Camille Letavernier CLA 2012-04-04 04:56:48 EDT
r7707:

Added support for Style edition dialog
Comment 9 Camille Letavernier CLA 2012-04-11 04:39:16 EDT
The task is complete
Comment 10 Camille Letavernier CLA 2012-04-26 07:49:17 EDT
r7976:

Added an extension point to disable the PreferencesInitializer when CSS support is enabled. This is necessary to avoid conflicts between the preferences-based theme and the CSS-based one.

The extension point is internal.
Comment 11 Camille Letavernier CLA 2012-04-26 07:53:34 EDT
r7978:

The previous commit wasn't complete
Comment 12 Camille Letavernier CLA 2012-06-21 05:50:50 EDT
r8391, r8392:

Custom style properties have been included to the "Export style" tool (elementIcon, shadow and qualifiedNameDepth)