Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349912 - Papyrus Palette
Summary: Papyrus Palette
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 348529 350152
Blocks:
  Show dependency tree
 
Reported: 2011-06-21 04:47 EDT by Alexandre Cortier CLA
Modified: 2013-02-12 03:40 EST (History)
1 user (show)

See Also:


Attachments
Papyrus Palette (1) (87.41 KB, text/xml)
2011-06-22 07:50 EDT, Alexandre Cortier CLA
no flags Details
Papyrus Palette (2) (137.17 KB, text/xml)
2011-06-22 07:50 EDT, Alexandre Cortier CLA
no flags Details
Papyrus Palette (3) (20.27 KB, text/xml)
2011-06-22 07:51 EDT, Alexandre Cortier CLA
no flags Details
Screen capture - Step_1 (12.83 KB, image/jpeg)
2011-06-23 02:57 EDT, Alexandre Cortier CLA
no flags Details
Screen capture - Step_2 (86.00 KB, image/jpeg)
2011-06-23 03:28 EDT, Alexandre Cortier CLA
no flags Details
Screen shot - Step 3 (63.89 KB, image/jpeg)
2011-06-23 03:30 EDT, Alexandre Cortier CLA
no flags Details
Screen shot - Step 4 (124.92 KB, image/jpeg)
2011-06-23 03:30 EDT, Alexandre Cortier CLA
no flags Details
Screen shot - Step 5 (53.12 KB, image/jpeg)
2011-06-23 03:31 EDT, Alexandre Cortier CLA
no flags Details
Error log 1 (9.94 KB, text/plain)
2011-06-23 03:33 EDT, Alexandre Cortier CLA
no flags Details
Error log 2 (28.95 KB, text/plain)
2011-06-23 03:33 EDT, Alexandre Cortier CLA
no flags Details
Small example for custom palette reuse (11.09 KB, application/octet-stream)
2011-06-23 05:02 EDT, Yann Tanguy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Cortier CLA 2011-06-21 04:47:58 EDT
Hy,

I have a problem using customized Palettes in MDT Papyrus.
I have defined a palette extending the editor org.eclipse.papyrus.sysml.diagram.blockdefinition.

I defined several elements (say E1, E2, E3). These elements are SysML Part with a set of applied stereotypes on it (say S1,S2,S3,S4).


In a block  definition diagram, I create a SysML Block. Then I used my customized palette to define new 'extended' Parts. 

For instance, my palette configuration is the following : 
- S1,S2,S3 are applied on E1
- S1,S2,S4 are applied on E2

--> I can defined a new customized SysML Part, say E1.
    - It works
--> Then I try to create an other elemet, say E2.
    - I obtained an erratic behavior : a Part is created with the following stereotypes : S1,S2,S3,S4
--> If I choose  other elements in my palette (say E3)
    - same bug : a part is created but applied stereotypes  on it do not correspond to what it is expected.

Alexandre Cortier
Comment 1 Yann Tanguy CLA 2011-06-22 04:58:52 EDT
Can you attach the palette xml file ?
It should be located in your workspace under ".metadata\.plugins\org.eclipse.papyrus.diagram.common".

Which Papyrus version are you currently using ?
Comment 2 Alexandre Cortier CLA 2011-06-22 07:50:29 EDT
Created attachment 198388 [details]
Papyrus Palette (1)
Comment 3 Alexandre Cortier CLA 2011-06-22 07:50:57 EDT
Created attachment 198389 [details]
Papyrus Palette (2)
Comment 4 Alexandre Cortier CLA 2011-06-22 07:51:18 EDT
Created attachment 198390 [details]
Papyrus Palette (3)
Comment 5 Alexandre Cortier CLA 2011-06-22 07:55:52 EDT
See the palettes that I Have defined in attachment.

I work on Eclipse Modeling Indigo RC4 with the 0.8.0 version of Papyrus.

Notice that I have defined static profiles. I'm currently in a development phase : I launch a second Eclipse in runtime to test my profiles and defined my palettes...

Thanks.
Comment 6 Yann Tanguy CLA 2011-06-22 08:14:06 EDT
(In reply to comment #5)
> See the palettes that I Have defined in attachment.
> 
> I work on Eclipse Modeling Indigo RC4 with the 0.8.0 version of Papyrus.
> 
> Notice that I have defined static profiles. I'm currently in a development phase
> : I launch a second Eclipse in runtime to test my profiles and defined my
> palettes...
> 
> Thanks.

Let's separate concerns, do you have problems with each palette ?
- Palette_acortier_1308578475744 -> relates to IBD
- Palette_acortier_1308581267039 -> relates to BDD
- Palette_acortier_1308669931762 -> relates to Activity diagram ?

Then can you give the name of a button that has an incorrect behavior (ex: "System" or "Assembly" in the IBD related palette).
Comment 7 Alexandre Cortier CLA 2011-06-23 02:57:05 EDT
Created attachment 198446 [details]
Screen capture - Step_1
Comment 8 Alexandre Cortier CLA 2011-06-23 03:28:53 EDT
Created attachment 198447 [details]
Screen capture - Step_2
Comment 9 Alexandre Cortier CLA 2011-06-23 03:30:23 EDT
Created attachment 198448 [details]
Screen shot - Step 3
Comment 10 Alexandre Cortier CLA 2011-06-23 03:30:50 EDT
Created attachment 198449 [details]
Screen shot - Step 4
Comment 11 Alexandre Cortier CLA 2011-06-23 03:31:20 EDT
Created attachment 198450 [details]
Screen shot - Step 5
Comment 12 Alexandre Cortier CLA 2011-06-23 03:33:05 EDT
Created attachment 198451 [details]
Error log 1
Comment 13 Alexandre Cortier CLA 2011-06-23 03:33:28 EDT
Created attachment 198452 [details]
Error log 2
Comment 14 Alexandre Cortier CLA 2011-06-23 04:02:39 EDT
(In reply to comment #6)

> Let's separate concerns, do you have problems with each palette ?
> - Palette_acortier_1308578475744 -> relates to IBD
> - Palette_acortier_1308581267039 -> relates to BDD
> - Palette_acortier_1308669931762 -> relates to Activity diagram ?
> 
> Then can you give the name of a button that has an incorrect behavior (ex:
> "System" or "Assembly" in the IBD related palette).

Yes, I have a problem with each palette.
For instance  - Palette_acortier_1308581267039 -> relates to BDD
1/ I open Eclipse in runtime.
2/ In a BDD I use a palette element : TC_Activity. 
A TC_Activity is an operation with 4 stereotypes applied on it: 
- TC_Activity (sterotype wich extends Operation)
- NamingAndDescriptionData, DomainData, ValidationData : stereotypes which extends NamedElement
It works... See Screen Shots : Step_1, Step_2, Step_3.
It works but in the Console view of the Eclipse from which I launched the runtime I obtained errors (see log1.txt)

3/ Then I select an other element in the palette : EP
EP is an operation with 4 stereotypes applied on it : 
- TC_Activity (sterotype wich extends Operation)
- NamingAndDescriptionData, DomainData, ValidationData 

This time it doesn't work well (see screen shots Step_4, Step_5 and log 2)


In fact, it always works the first time (when I just launch the application).
Then I have an erratic behavior.

I probably made mistakes...

---------------------------------------------------
I have some other questions (so I will try to do something by myself) :
- I can't delete a palette : is-it a known bug ?
- The customized palettes are located in .metadata\.plugins\org.eclipse.papyrus.diagram.common. I thought that deleting the. xml, the palettes would be permanently removed. It is not the case... Is there an other location to configure palettes ?
- How can I reuse my customized palette in an other workspace ?
Comment 15 Yann Tanguy CLA 2011-06-23 05:02:01 EDT
Created attachment 198455 [details]
Small example for custom palette reuse
Comment 16 Yann Tanguy CLA 2011-06-23 05:13:05 EDT
> I have some other questions (so I will try to do something by myself) :
> - I can't delete a palette : is-it a known bug ?
> - The customized palettes are located in
> .metadata\.plugins\org.eclipse.papyrus.diagram.common. I thought that deleting
> the. xml, the palettes would be permanently removed. It is not the case... Is
> there an other location to configure palettes ?

Can you enter a bug for these previous issues.

> - How can I reuse my customized palette in an other workspace ?

I have added a small plug-in example that give some hints for custom palette reuse.
My workflow when I have to create palettes is:
- specify / test my palette with dynamic customization tool (what you did)
- save the xml file created by the tool
- create a plug-in and declare a palette for a diagram (see the example attached: the declaration is in the plugin.xml file)
- in general I prefer (re-)writting the final palette xml file myself (help yoursel with the palette xml created by dynamic customization tool - use an xml editor to make it readable)
- proceed iteratively : add a button -> test -> add a button ... (it may be easier for debug than copying the whole palette xml generated by the customization tool)
Comment 17 Yann Tanguy CLA 2011-06-23 05:21:14 EDT
> 2/ In a BDD I use a palette element : TC_Activity.
> A TC_Activity is an operation with 4 stereotypes applied on it:
> - TC_Activity (sterotype wich extends Operation)
> - NamingAndDescriptionData, DomainData, ValidationData : stereotypes which
> extends NamedElement
> It works... See Screen Shots : Step_1, Step_2, Step_3.
> It works but in the Console view of the Eclipse from which I launched the
> runtime I obtained errors (see log1.txt)
> 

The exception in log1.txt is related to a bug in the BDD (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348529). To make simple, the palette asks for stereotype application, then tries to make the stereotype visible in the diagram and fail doing this. The post action responsible for this is <postAction displayKind="TextIconStereotype" displayPlace="Compartment" id="org.eclipse.papyrus.postaction.changeStereotypeDisplayProvider"/>.

> 3/ Then I select an other element in the palette : EP
> EP is an operation with 4 stereotypes applied on it :
> - TC_Activity (sterotype wich extends Operation)
> - NamingAndDescriptionData, DomainData, ValidationData
> 
> This time it doesn't work well (see screen shots Step_4, Step_5 and log 2)
> 
> 
> In fact, it always works the first time (when I just launch the application).
> Then I have an erratic behavior.
> 
> I probably made mistakes...
> 

I don't know, really don't understand what happens at this point... I could not detect any obvious issue in the palette xml file (I mean for TC_App and EP)...
Comment 18 Alexandre Cortier CLA 2011-06-23 08:57:13 EDT
(In reply to comment #17)
> I don't know, really don't understand what happens at this point... I could not
> detect any obvious issue in the palette xml file (I mean for TC_App and EP)...

Thanks for your responses.

I follow your worflow  that give some hints for custom palette
reuse. (See below my  my palette definition) : is-it possible that the problem comes from the post-action "org.eclipse.papyrus.applystereotypeactionprovider" ?

I have the same problem : in fact, the list of stereotypes to apply seems not to be refresh (For instance, I create a System with the palette defined below. Then I create a Sub-System. The last created object has its own stereotypes, plus the stereotype define for System....



<?xml version="1.0" encoding="UTF-8" standalone="no"?><paletteDefinition><content>
<drawer iconpath="/icons/drawer.gif" id="Drawer__1308832824948" name="Test 1">
<aspectTool description="Create a new Part" iconpath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" id="blockdefinition.tool.system" name="System" refToolId="blockdefinition.tool.part">
<postAction id="org.eclipse.papyrus.applystereotypeactionprovider">
<stereotypesToApply>
<stereotype stereotypeName="SpaceStandards::SpaceSystemDataModel::Hardware::System"/>
<stereotype stereotypeName="SpaceStandards::CommonDatas::DomainData"/>
<stereotype stereotypeName="SpaceStandards::CommonDatas::NamingAndDescriptionData"/>
</stereotypesToApply>
</postAction>
</aspectTool>
<aspectTool description="Create a new Part" iconpath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" id="blockdefinition.tool.part_1308832909198" name="SubSystem" refToolId="blockdefinition.tool.part">
<postAction id="org.eclipse.papyrus.applystereotypeactionprovider">
<stereotypesToApply>
<stereotype stereotypeName="SpaceStandards::CommonDatas::DomainData"/>
<stereotype stereotypeName="SpaceStandards::CommonDatas::NamingAndDescriptionData"/>
<stereotype stereotypeName="SpaceStandards::SpaceSystemDataModel::Hardware::SubSystem"/>
/stereotypesToApply>
</postAction>
</aspectTool>
</drawer>
</content>
</paletteDefinition>
Comment 19 Yann Tanguy CLA 2011-06-23 09:45:04 EDT
(In reply to comment #18)
> 
> I follow your worflow  that give some hints for custom palette
> reuse. (See below my  my palette definition) : is-it possible that the problem
> comes from the post-action "org.eclipse.papyrus.applystereotypeactionprovider" ?
> 
> I have the same problem : in fact, the list of stereotypes to apply seems not to
> be refresh (For instance, I create a System with the palette defined below. Then
> I create a Sub-System. The last created object has its own stereotypes, plus the
> stereotype define for System....
> 

I managed to reproduce the problem (only in BDD not in Class Diagram by the way), it should be easier for debug...
Comment 20 Yann Tanguy CLA 2011-06-23 11:21:17 EDT
I fix a problem (https://bugs.eclipse.org/bugs/show_bug.cgi?id=350152) which is in my opinion responsible for the problems you get in the Block Definition Diagram, can you test ? 

(you should not need to re-create or modify your palette xml files to get this work)
Comment 21 Camille Letavernier CLA 2013-02-12 03:40:38 EST
Seems to be fixed, I close the task.