Bug 422999 - No Separator option available under Model Fragment -> Add child
Summary: No Separator option available under Model Fragment -> Add child
Status: CLOSED INVALID
Alias: None
Product: e4
Classification: Eclipse Project
Component: Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jonas Helming CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 16:36 EST by Ozgur Cagdas CLA
Modified: 2015-09-14 06:14 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 Ozgur Cagdas CLA 2013-12-02 16:36:21 EST
In a Fragment's model editor, when you right click the Model Fragment and select Add child, the list of available elements does not contain the Separator element.

The simple work around is to create a Separator in the main application's e4xmi file, then copy and paste it into the Fragment.
Comment 1 Lars Vogel CLA 2013-12-03 04:23:55 EST
Thanks Ozguar for the bug report. Would you be interested to provide a Gerrit patch for this?
Comment 2 Ozgur Cagdas CLA 2013-12-03 16:37:47 EST
Hi,

I haven't got a patch in hand but I'm happy to look into it if that's all right to do it with my own pace. Given that I'll have to pull the Eclipse source, it is likely to take a while but this could be a good first task.

Regards,

Ozgur.
Comment 3 Lars Vogel CLA 2013-12-04 00:29:47 EST
> I haven't got a patch in hand but I'm happy to look into it if that's all
> right to do it with my own pace. Given that I'll have to pull the Eclipse
> source, it is likely to take a while but this could be a good first task.

Great to hear. This might help http://www.vogella.com/articles/Gerrit/article.html#eclipsegerritcontribution
Comment 4 Nobody - feel free to take it CLA 2014-01-20 10:17:37 EST
(In reply to Ozgur Cagdas from comment #2)
> Hi,
> 
> I haven't got a patch in hand but I'm happy to look into it if that's all
> right to do it with my own pace. Given that I'll have to pull the Eclipse
> source, it is likely to take a while but this could be a good first task.
> 
> Regards,
> 
> Ozgur.

Any update?
Comment 5 Lars Vogel CLA 2014-03-11 08:55:27 EDT
Dzmitry, if you like you can also fix this one.
Comment 6 Dmitry Spiridenok CLA 2014-03-14 05:40:17 EDT
OK, I'll have a look at it.
Comment 7 Dmitry Spiridenok CLA 2014-03-14 19:07:29 EDT
I think i would like to get some help solving this bug...

What I could find so far is that the list of elements for Fragment->Add Child is created during 
		registerEditor(FragmentPackageImpl.Literals.STRING_MODEL_FRAGMENT, ContextInjectionFactory.make(StringModelFragment.class, context));
    in 
/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java

If i look at the StringModelFragment class I see that it's very different from other classes that also create comparable lists (like PartStackEditor or TrimBarEditor). Whereas other editors create specific actions explicitly in their init() method, StringModelFragment performs some operations on model elements like ApplciationPackage, SubPackages, classifiers etc.

So I have two questions: 
1. Am I looking at the right class (StringModelFragment) for the list in Model Fragment->Add Child
2. If yes: I would like to get more info about the way StringModelFragment class works and the model elements it uses.

Some help is greatly appreciated!
Comment 8 Lars Vogel CLA 2014-03-20 09:55:55 EDT
(In reply to Dmitry Spiridenok from comment #7)

> So I have two questions: 
> 1. Am I looking at the right class (StringModelFragment) for the list in
> Model Fragment->Add Child
> 2. If yes: I would like to get more info about the way StringModelFragment
> class works and the model elements it uses.

I suggest to start it in a debugger and try it out.
Comment 9 Dmitry Spiridenok CLA 2014-03-20 17:40:01 EDT
(In reply to Lars Vogel from comment #8)
> 
> I suggest to start it in a debugger and try it out.

This is what i did (attaching a debugger) to get into StringModelFragment class. 

However I would like to have more information about the way StringModelFragment class is designed and works. In particular I would like to know why this class is different from all other *Editor classes (what is the idea behind it) and how it's configured which model elements the class gets.
Comment 10 Jonas Helming CLA 2015-09-14 06:13:06 EDT
The separator is available in the menu, it is called "MenuSeparator". This is because the menu items are not internationalized (icons are missing, too). I opened another bug for this: Bug 477348 

@Dmitry: Are you willing on providing a contribution for the other BR?

I am closing this as "invalid" although the report is of course valid, it only has a different cause.