Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Creation Icons
Creation Icons [message #420696] Tue, 08 July 2008 05:42 Go to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi,

I don't want to provide my own creation icons and of course I don't want
to use the generated default ones.
If I just delete the generated ones I get icons that are nicely overlaid
with the plus sign at runtime.
This is what I want but after each re-generation I have to delete the
generated icons again to get this effect.

I found the generator setting "Creation Icons" and set it to false.
Now the creation icons are no longer generated.
BUT: At runtime the plus sign is no longer overlaid ;-(

Any ideas how to get obj16 images + overlaid plus sign - manual deletion
of generated creation icons?

Does this relate somehow?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974

Cheers
/Eike


Re: Creation Icons [message #420699 is a reply to message #420696] Tue, 08 July 2008 10:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020607080101080200060602
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

Comments below.

Eike Stepper wrote:
> Hi,
>
> I don't want to provide my own creation icons and of course I don't
> want to use the generated default ones.
> If I just delete the generated ones I get icons that are nicely
> overlaid with the plus sign at runtime.
> This is what I want but after each re-generation I have to delete the
> generated icons again to get this effect.
>
> I found the generator setting "Creation Icons" and set it to false.
> Now the creation icons are no longer generated.
> BUT: At runtime the plus sign is no longer overlaid ;-(
>
> Any ideas how to get obj16 images + overlaid plus sign - manual
> deletion of generated creation icons?
The item provider template has this guard.

<%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
/**
* This returns the icon image for {@link
org.eclipse.emf.edit.command.CreateChildCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
<%if (genModel.useClassOverrideAnnotation()) {%>
@Override
<%}%>
public Object getCreateChildImage(Object owner, Object feature,
Object child, <%=genModel.getImportedName(genModel.useGenerics() ?
"java.util.Collection<?>" : "java.util.Collection")%> selection)
{
if (feature instanceof
<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
&&
<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
{

<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
entry =
(<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
feature = entry.getEStructuralFeature();
child = entry.getValue();
}

if (feature instanceof
<%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%> &&
child instanceof
<%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
{
String name = "full/obj16/" +
((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >

try
{
return getResourceLocator().getImage(name);
}
catch (Exception e)
{

< %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
}
}

return super.getCreateChildImage(owner, feature, child,
selection);
}

<%}%>

I'm not sure how this method being missing induces the behavior problem
you describe.
>
> Does this relate somehow?
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>
> Cheers
> /Eike

--------------020607080101080200060602
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
Comments below.<br>
<br>
Eike Stepper wrote:
<blockquote cite="mid:g4uunt$8n0$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I don't want to provide my own creation icons and of course I don't
want to use the generated default ones.
<br>
If I just delete the generated ones I get icons that are nicely
overlaid with the plus sign at runtime.
<br>
This is what I want but after each re-generation I have to delete the
generated icons again to get this effect.
<br>
<br>
I found the generator setting "Creation Icons" and set it to false.
<br>
Now the creation icons are no longer generated.
<br>
BUT: At runtime the plus sign is no longer overlaid ;-(
<br>
<br>
Any ideas how to get obj16 images + overlaid plus sign - manual
deletion of generated creation icons?
<br>
</blockquote>
The item provider template has this guard. <br>
<blockquote><small>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creation Icons [message #420701 is a reply to message #420699] Tue, 08 July 2008 11:46 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040607030105040709010104
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ed,

I'm still not sure if what I described is the expected behaviour or
otherwise what I could do against it.
Would it help you if send you my small model plugins or attach them to a
Bugzilla?

Cheers
/Eike



Ed Merks schrieb:
> Eike,
>
> Comments below.
>
> Eike Stepper wrote:
>> Hi,
>>
>> I don't want to provide my own creation icons and of course I don't
>> want to use the generated default ones.
>> If I just delete the generated ones I get icons that are nicely
>> overlaid with the plus sign at runtime.
>> This is what I want but after each re-generation I have to delete the
>> generated icons again to get this effect.
>>
>> I found the generator setting "Creation Icons" and set it to false.
>> Now the creation icons are no longer generated.
>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>
>> Any ideas how to get obj16 images + overlaid plus sign - manual
>> deletion of generated creation icons?
> The item provider template has this guard.
>
> <%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
> /**
> * This returns the icon image for {@link
> org.eclipse.emf.edit.command.CreateChildCommand}.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> <%if (genModel.useClassOverrideAnnotation()) {%>
> @Override
> <%}%>
> public Object getCreateChildImage(Object owner, Object
> feature, Object child,
> <%=genModel.getImportedName(genModel.useGenerics() ?
> "java.util.Collection<?>" : "java.util.Collection")%> selection)
> {
> if (feature instanceof
> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
> &&
> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
> {
>
> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
> entry =
> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
> feature = entry.getEStructuralFeature();
> child = entry.getValue();
> }
>
> if (feature instanceof
> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
> && child instanceof
> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
> {
> String name = "full/obj16/" +
> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>
> try
> {
> return getResourceLocator().getImage(name);
> }
> catch (Exception e)
> {
>
> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
> }
> }
>
> return super.getCreateChildImage(owner, feature, child,
> selection);
> }
>
> <%}%>
>
> I'm not sure how this method being missing induces the behavior
> problem you describe.
>>
>> Does this relate somehow?
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>
>> Cheers
>> /Eike

--------------040607030105040709010104
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ed,<br>
<br>
I'm still not sure if what I described is the expected behaviour or
otherwise what I could do against it.<br>
Would it help you if send you my small model plugins or attach them to
a Bugzilla?<br>
<br>
Cheers<br>
/Eike<br>
<br>
<br>
<br>
Ed Merks schrieb:
<blockquote cite="mid:g4vh3a$uei$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
Comments below.<br>
<br>
Eike Stepper wrote:
<blockquote cite="mid:g4uunt$8n0$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I don't want to provide my own creation icons and of course I don't
want to use the generated default ones. <br>
If I just delete the generated ones I get icons that are nicely
overlaid with the plus sign at runtime. <br>
This is what I want but after each re-generation I have to delete the
generated icons again to get this effect. <br>
<br>
I found the generator setting "Creation Icons" and set it to false. <br>
Now the creation icons are no longer generated. <br>
BUT: At runtime the plus sign is no longer overlaid ;-( <br>
<br>
Any ideas how to get obj16 images + overlaid plus sign - manual
deletion of generated creation icons? <br>
</blockquote>
The item provider template has this guard. <br>
<blockquote><small>


Re: Creation Icons [message #420703 is a reply to message #420701] Tue, 08 July 2008 12:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090705030908030502060809
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

If you want to send me a sample showing what you've changed, that's a
good start. I imagine if you're doing something (hand changed some
code) to overlay an image you'd be able to change that code to fetch the
object image you want to overlay...


Eike Stepper wrote:
> Ed,
>
> I'm still not sure if what I described is the expected behaviour or
> otherwise what I could do against it.
> Would it help you if send you my small model plugins or attach them to
> a Bugzilla?
>
> Cheers
> /Eike
>
>
>
> Ed Merks schrieb:
>> Eike,
>>
>> Comments below.
>>
>> Eike Stepper wrote:
>>> Hi,
>>>
>>> I don't want to provide my own creation icons and of course I don't
>>> want to use the generated default ones.
>>> If I just delete the generated ones I get icons that are nicely
>>> overlaid with the plus sign at runtime.
>>> This is what I want but after each re-generation I have to delete
>>> the generated icons again to get this effect.
>>>
>>> I found the generator setting "Creation Icons" and set it to false.
>>> Now the creation icons are no longer generated.
>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>
>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>> deletion of generated creation icons?
>> The item provider template has this guard.
>>
>> <%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
>> /**
>> * This returns the icon image for {@link
>> org.eclipse.emf.edit.command.CreateChildCommand}.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @generated
>> */
>> <%if (genModel.useClassOverrideAnnotation()) {%>
>> @Override
>> <%}%>
>> public Object getCreateChildImage(Object owner, Object
>> feature, Object child,
>> <%=genModel.getImportedName(genModel.useGenerics() ?
>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>> {
>> if (feature instanceof
>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>> &&
>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>> {
>>
>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>> entry =
>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>> feature = entry.getEStructuralFeature();
>> child = entry.getValue();
>> }
>>
>> if (feature instanceof
>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>> && child instanceof
>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>> {
>> String name = "full/obj16/" +
>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>
>> try
>> {
>> return getResourceLocator().getImage(name);
>> }
>> catch (Exception e)
>> {
>>
>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>> }
>> }
>>
>> return super.getCreateChildImage(owner, feature, child,
>> selection);
>> }
>>
>> <%}%>
>>
>> I'm not sure how this method being missing induces the behavior
>> problem you describe.
>>>
>>> Does this relate somehow?
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>
>>> Cheers
>>> /Eike

--------------090705030908030502060809
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
If you want to send me a sample showing what you've changed, that's a
good start.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creation Icons [message #420704 is a reply to message #420703] Tue, 08 July 2008 12:17 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030803080703040007000006
Content-Type: multipart/alternative;
boundary="------------050507040709040207000208"


--------------050507040709040207000208
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit



Ed Merks schrieb:
> Eike,
>
> If you want to send me a sample showing what you've changed, that's a
> good start. I imagine if you're doing something (hand changed some
> code) to overlay an image you'd be able to change that code to fetch
> the object image you want to overlay...
Actually I didn't change anything with respect to creation icons except
that I deleted the generated icons.
I attached the small model plugin+edit+editor. It's just a prototype at
the moment.

Just to be clear: If I set Creation Icons to false in the GenModel, is
the runtime expected to overlay the plus sign or not?

Cheers
/Eike


>
>
> Eike Stepper wrote:
>> Ed,
>>
>> I'm still not sure if what I described is the expected behaviour or
>> otherwise what I could do against it.
>> Would it help you if send you my small model plugins or attach them
>> to a Bugzilla?
>>
>> Cheers
>> /Eike
>>
>>
>>
>> Ed Merks schrieb:
>>> Eike,
>>>
>>> Comments below.
>>>
>>> Eike Stepper wrote:
>>>> Hi,
>>>>
>>>> I don't want to provide my own creation icons and of course I don't
>>>> want to use the generated default ones.
>>>> If I just delete the generated ones I get icons that are nicely
>>>> overlaid with the plus sign at runtime.
>>>> This is what I want but after each re-generation I have to delete
>>>> the generated icons again to get this effect.
>>>>
>>>> I found the generator setting "Creation Icons" and set it to false.
>>>> Now the creation icons are no longer generated.
>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>
>>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>>> deletion of generated creation icons?
>>> The item provider template has this guard.
>>>
>>> <%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
>>> /**
>>> * This returns the icon image for {@link
>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>> * <!-- begin-user-doc -->
>>> * <!-- end-user-doc -->
>>> * @generated
>>> */
>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>> @Override
>>> <%}%>
>>> public Object getCreateChildImage(Object owner, Object
>>> feature, Object child,
>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>>> {
>>> if (feature instanceof
>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>> &&
>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>> {
>>>
>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>> entry =
>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>> feature = entry.getEStructuralFeature();
>>> child = entry.getValue();
>>> }
>>>
>>> if (feature instanceof
>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>> && child instanceof
>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>> {
>>> String name = "full/obj16/" +
>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>
>>> try
>>> {
>>> return getResourceLocator().getImage(name);
>>> }
>>> catch (Exception e)
>>> {
>>>
>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>> }
>>> }
>>>
>>> return super.getCreateChildImage(owner, feature, child,
>>> selection);
>>> }
>>>
>>> <%}%>
>>>
>>> I'm not sure how this method being missing induces the behavior
>>> problem you describe.
>>>>
>>>> Does this relate somehow?
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>
>>>> Cheers
>>>> /Eike

--------------050507040709040207000208
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Ed Merks schrieb:
<blockquote cite="mid:g4vlda$kbv$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
If you want to send me a sample showing what you've changed, that's a
good start.


Re: Creation Icons [message #420711 is a reply to message #420704] Tue, 08 July 2008 14:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090507050100020104090407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

It does this, so if it can't find a named icon, it gets the image for
the child and overlays the "+":

public Object getCreateChildImage(Object owner, Object feature,
Object child, Collection<?> selection)
{
if (feature instanceof EStructuralFeature &&
FeatureMapUtil.isFeatureMap((EStructuralFeature)feature))
{
FeatureMap.Entry entry = (FeatureMap.Entry)child;
feature = entry.getEStructuralFeature();
child = entry.getValue();
}

if (feature instanceof EReference)
{
EStructuralFeature eFeature = (EStructuralFeature)feature;
String name = "full/ctool16/Create" +
eFeature.getEContainingClass().getName() + "_" + eFeature.getName();

if (child instanceof EObject)
{
name += "_" + ((EObject)child).eClass().getName();
}

try
{
return getResourceLocator().getImage(name);
}
catch (Exception e)
{
List<Object> images = new ArrayList<Object>();
IItemLabelProvider itemLabelProvider =

(IItemLabelProvider)((ComposeableAdapterFactory)adapterFacto ry).getRootAdapterFactory().adapt(child,
IItemLabelProvider.class);
images.add(itemLabelProvider.getImage(child));

images.add(EMFEditPlugin.INSTANCE.getImage("full/ovr16/CreateChild "));
return
new ComposedImage(images)
{
@Override
public List<Point> getDrawPoints(Size size)
{
List<Point> result = super.getDrawPoints(size);
result.get(1).x = size.width - 7;
return result;
}
};
}
}

return EMFEditPlugin.INSTANCE.getImage("full/ctool16/CreateChild");
}

For me it looks like this:



Isn't that what you're getting?


Eike Stepper wrote:
>
>
> Ed Merks schrieb:
>> Eike,
>>
>> If you want to send me a sample showing what you've changed, that's a
>> good start. I imagine if you're doing something (hand changed some
>> code) to overlay an image you'd be able to change that code to fetch
>> the object image you want to overlay...
> Actually I didn't change anything with respect to creation icons
> except that I deleted the generated icons.
> I attached the small model plugin+edit+editor. It's just a prototype
> at the moment.
>
> Just to be clear: If I set Creation Icons to false in the GenModel, is
> the runtime expected to overlay the plus sign or not?
>
> Cheers
> /Eike
>
>
>>
>>
>> Eike Stepper wrote:
>>> Ed,
>>>
>>> I'm still not sure if what I described is the expected behaviour or
>>> otherwise what I could do against it.
>>> Would it help you if send you my small model plugins or attach them
>>> to a Bugzilla?
>>>
>>> Cheers
>>> /Eike
>>>
>>>
>>>
>>> Ed Merks schrieb:
>>>> Eike,
>>>>
>>>> Comments below.
>>>>
>>>> Eike Stepper wrote:
>>>>> Hi,
>>>>>
>>>>> I don't want to provide my own creation icons and of course I
>>>>> don't want to use the generated default ones.
>>>>> If I just delete the generated ones I get icons that are nicely
>>>>> overlaid with the plus sign at runtime.
>>>>> This is what I want but after each re-generation I have to delete
>>>>> the generated icons again to get this effect.
>>>>>
>>>>> I found the generator setting "Creation Icons" and set it to false.
>>>>> Now the creation icons are no longer generated.
>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>
>>>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>>>> deletion of generated creation icons?
>>>> The item provider template has this guard.
>>>>
>>>> <%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
>>>> /**
>>>> * This returns the icon image for {@link
>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>> * <!-- begin-user-doc -->
>>>> * <!-- end-user-doc -->
>>>> * @generated
>>>> */
>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>> @Override
>>>> <%}%>
>>>> public Object getCreateChildImage(Object owner, Object
>>>> feature, Object child,
>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>>>> {
>>>> if (feature instanceof
>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>> &&
>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>> {
>>>>
>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>> entry =
>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>> feature = entry.getEStructuralFeature();
>>>> child = entry.getValue();
>>>> }
>>>>
>>>> if (feature instanceof
>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>> && child instanceof
>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>> {
>>>> String name = "full/obj16/" +
>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>
>>>> try
>>>> {
>>>> return getResourceLocator().getImage(name);
>>>> }
>>>> catch (Exception e)
>>>> {
>>>>
>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>> }
>>>> }
>>>>
>>>> return super.getCreateChildImage(owner, feature, child,
>>>> selection);
>>>> }
>>>>
>>>> <%}%>
>>>>
>>>> I'm not sure how this method being missing induces the behavior
>>>> problem you describe.
>>>>>
>>>>> Does this relate somehow?
>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>
>>>>> Cheers
>>>>> /Eike

--------------090507050100020104090407
Content-Type: multipart/related;
boundary="------------050308050304030401000705"


--------------050308050304030401000705
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
It does this, so if it can't find a named icon, it gets the image for
the child and overlays the "+":<br>
<blockquote><small>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creation Icons [message #420718 is a reply to message #420711] Tue, 08 July 2008 15:47 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080004070105000005090302
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ed,

Comments below...


Ed Merks schrieb:
> Eike,
>
> [...] For me it looks like this:
>
>
>
> Isn't that what you're getting?
Yes, but I get this only because I manually deleted the generated
creation icons.
Now if I re-generate I always have to re-delete them, too.

Please try setting the "Creation Icons" property to false and
re-generate the model.
Then the icon files will be missing (as they should).
But the icons generated at runtime are also missing the plus sign:



You see?

Cheers
/Eike


>
>
> Eike Stepper wrote:
>>
>>
>> Ed Merks schrieb:
>>> Eike,
>>>
>>> If you want to send me a sample showing what you've changed, that's
>>> a good start. I imagine if you're doing something (hand changed
>>> some code) to overlay an image you'd be able to change that code to
>>> fetch the object image you want to overlay...
>> Actually I didn't change anything with respect to creation icons
>> except that I deleted the generated icons.
>> I attached the small model plugin+edit+editor. It's just a prototype
>> at the moment.
>>
>> Just to be clear: If I set Creation Icons to false in the GenModel,
>> is the runtime expected to overlay the plus sign or not?
>>
>> Cheers
>> /Eike
>>
>>
>>>
>>>
>>> Eike Stepper wrote:
>>>> Ed,
>>>>
>>>> I'm still not sure if what I described is the expected behaviour or
>>>> otherwise what I could do against it.
>>>> Would it help you if send you my small model plugins or attach them
>>>> to a Bugzilla?
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>>
>>>>
>>>> Ed Merks schrieb:
>>>>> Eike,
>>>>>
>>>>> Comments below.
>>>>>
>>>>> Eike Stepper wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I don't want to provide my own creation icons and of course I
>>>>>> don't want to use the generated default ones.
>>>>>> If I just delete the generated ones I get icons that are nicely
>>>>>> overlaid with the plus sign at runtime.
>>>>>> This is what I want but after each re-generation I have to delete
>>>>>> the generated icons again to get this effect.
>>>>>>
>>>>>> I found the generator setting "Creation Icons" and set it to false.
>>>>>> Now the creation icons are no longer generated.
>>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>>
>>>>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>>>>> deletion of generated creation icons?
>>>>> The item provider template has this guard.
>>>>>
>>>>> <%if (!genModel.isCreationIcons() && genClass.isModelRoot()) {%>
>>>>> /**
>>>>> * This returns the icon image for {@link
>>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>>> * <!-- begin-user-doc -->
>>>>> * <!-- end-user-doc -->
>>>>> * @generated
>>>>> */
>>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>>> @Override
>>>>> <%}%>
>>>>> public Object getCreateChildImage(Object owner, Object
>>>>> feature, Object child,
>>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>>>>> {
>>>>> if (feature instanceof
>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>>> &&
>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>>> {
>>>>>
>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>>> entry =
>>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>>> feature = entry.getEStructuralFeature();
>>>>> child = entry.getValue();
>>>>> }
>>>>>
>>>>> if (feature instanceof
>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>>> && child instanceof
>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>>> {
>>>>> String name = "full/obj16/" +
>>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>>
>>>>> try
>>>>> {
>>>>> return getResourceLocator().getImage(name);
>>>>> }
>>>>> catch (Exception e)
>>>>> {
>>>>>
>>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>>> }
>>>>> }
>>>>>
>>>>> return super.getCreateChildImage(owner, feature,
>>>>> child, selection);
>>>>> }
>>>>>
>>>>> <%}%>
>>>>>
>>>>> I'm not sure how this method being missing induces the behavior
>>>>> problem you describe.
>>>>>>
>>>>>> Does this relate somehow?
>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>>
>>>>>> Cheers
>>>>>> /Eike

--------------080004070105000005090302
Content-Type: multipart/related;
boundary="------------070306070801090805020503"


--------------070306070801090805020503
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ed,<br>
<br>
Comments below...<br>
<br>
<br>
Ed Merks schrieb:
<blockquote cite="mid:g4vu5f$p7e$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
[...] For me it looks like this:<br>
<blockquote><img src="cid:part1.05000806.04080900@sympedia.de" alt=""><br>
</blockquote>
<br>
Isn't that what you're getting?<br>
</blockquote>
Yes, but I get this only because I manually deleted the generated
creation icons.<br>
Now if I re-generate I always have to re-delete them, too.<br>
<br>
Please try setting the "Creation Icons" property to false and
re-generate the model.<br>
Then the icon files will be missing (as they should).<br>
But the icons generated at runtime are also missing the plus sign:<br>
<br>


Re: Creation Icons [message #420719 is a reply to message #420718] Tue, 08 July 2008 16:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040900080704000705060602
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

I'm not even sure why we generate that stupid method since the call to
super does mostly the same thing, although it tries to find the explicit
icon first, and does it more nicely given that it uses the overlay...


Eike Stepper wrote:
> Ed,
>
> Comments below...
>
>
> Ed Merks schrieb:
>> Eike,
>>
>> [...] For me it looks like this:
>>
>>
>>
>> Isn't that what you're getting?
> Yes, but I get this only because I manually deleted the generated
> creation icons.
> Now if I re-generate I always have to re-delete them, too.
>
> Please try setting the "Creation Icons" property to false and
> re-generate the model.
> Then the icon files will be missing (as they should).
> But the icons generated at runtime are also missing the plus sign:
>
>
>
> You see?
>
> Cheers
> /Eike
>
>
>>
>>
>> Eike Stepper wrote:
>>>
>>>
>>> Ed Merks schrieb:
>>>> Eike,
>>>>
>>>> If you want to send me a sample showing what you've changed, that's
>>>> a good start. I imagine if you're doing something (hand changed
>>>> some code) to overlay an image you'd be able to change that code to
>>>> fetch the object image you want to overlay...
>>> Actually I didn't change anything with respect to creation icons
>>> except that I deleted the generated icons.
>>> I attached the small model plugin+edit+editor. It's just a prototype
>>> at the moment.
>>>
>>> Just to be clear: If I set Creation Icons to false in the GenModel,
>>> is the runtime expected to overlay the plus sign or not?
>>>
>>> Cheers
>>> /Eike
>>>
>>>
>>>>
>>>>
>>>> Eike Stepper wrote:
>>>>> Ed,
>>>>>
>>>>> I'm still not sure if what I described is the expected behaviour
>>>>> or otherwise what I could do against it.
>>>>> Would it help you if send you my small model plugins or attach
>>>>> them to a Bugzilla?
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>>
>>>>>
>>>>> Ed Merks schrieb:
>>>>>> Eike,
>>>>>>
>>>>>> Comments below.
>>>>>>
>>>>>> Eike Stepper wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I don't want to provide my own creation icons and of course I
>>>>>>> don't want to use the generated default ones.
>>>>>>> If I just delete the generated ones I get icons that are nicely
>>>>>>> overlaid with the plus sign at runtime.
>>>>>>> This is what I want but after each re-generation I have to
>>>>>>> delete the generated icons again to get this effect.
>>>>>>>
>>>>>>> I found the generator setting "Creation Icons" and set it to false.
>>>>>>> Now the creation icons are no longer generated.
>>>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>>>
>>>>>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>>>>>> deletion of generated creation icons?
>>>>>> The item provider template has this guard.
>>>>>>
>>>>>> <%if (!genModel.isCreationIcons() &&
>>>>>> genClass.isModelRoot()) {%>
>>>>>> /**
>>>>>> * This returns the icon image for {@link
>>>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>>>> * <!-- begin-user-doc -->
>>>>>> * <!-- end-user-doc -->
>>>>>> * @generated
>>>>>> */
>>>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>>>> @Override
>>>>>> <%}%>
>>>>>> public Object getCreateChildImage(Object owner, Object
>>>>>> feature, Object child,
>>>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>>>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>>>>>> {
>>>>>> if (feature instanceof
>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>>>> &&
>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>>>> {
>>>>>>
>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>>>> entry =
>>>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>>>> feature = entry.getEStructuralFeature();
>>>>>> child = entry.getValue();
>>>>>> }
>>>>>>
>>>>>> if (feature instanceof
>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>>>> && child instanceof
>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>>>> {
>>>>>> String name = "full/obj16/" +
>>>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>>>
>>>>>> try
>>>>>> {
>>>>>> return getResourceLocator().getImage(name);
>>>>>> }
>>>>>> catch (Exception e)
>>>>>> {
>>>>>>
>>>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> return super.getCreateChildImage(owner, feature,
>>>>>> child, selection);
>>>>>> }
>>>>>>
>>>>>> <%}%>
>>>>>>
>>>>>> I'm not sure how this method being missing induces the behavior
>>>>>> problem you describe.
>>>>>>>
>>>>>>> Does this relate somehow?
>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike

--------------040900080704000705060602
Content-Type: multipart/related;
boundary="------------010509050700030203010504"


--------------010509050700030203010504
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
I'm not even sure why we generate that stupid method since the call to
super does mostly the same thing, although it tries to find the
explicit icon first, and does it more nicely given that it uses the
overlay...<br>
<br>
<br>
Eike Stepper wrote:
<blockquote cite="mid:g50272$ijo$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Ed,<br>
<br>
Comments below...<br>
<br>
<br>
Ed Merks schrieb:
<blockquote cite="mid:g4vu5f$p7e$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
[...] For me it looks like this:<br>
<blockquote><img src="cid:part1.03010803.06020201@gmail.com" alt=""><br>
</blockquote>
<br>
Isn't that what you're getting?<br>
</blockquote>
Yes, but I get this only because I manually deleted the generated
creation icons.<br>
Now if I re-generate I always have to re-delete them, too.<br>
<br>
Please try setting the "Creation Icons" property to false and
re-generate the model.<br>
Then the icon files will be missing (as they should).<br>
But the icons generated at runtime are also missing the plus sign:<br>
<br>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creation Icons [message #420720 is a reply to message #420719] Tue, 08 July 2008 16:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030204090609030404090402
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ed Merks schrieb:
> Eike,
>
> I'm not even sure why we generate that stupid method since the call to
> super does mostly the same thing, although it tries to find the
> explicit icon first, and does it more nicely given that it uses the
> overlay...
And is the missing plus sign now expected or not?
I.e. should I file a Bugzilla or just reopen
https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974 ?

I also found these:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=114657
https://bugs.eclipse.org/bugs/show_bug.cgi?id=131376

Cheers
/Eike

>
>
> Eike Stepper wrote:
>> Ed,
>>
>> Comments below...
>>
>>
>> Ed Merks schrieb:
>>> Eike,
>>>
>>> [...] For me it looks like this:
>>>
>>>
>>>
>>> Isn't that what you're getting?
>> Yes, but I get this only because I manually deleted the generated
>> creation icons.
>> Now if I re-generate I always have to re-delete them, too.
>>
>> Please try setting the "Creation Icons" property to false and
>> re-generate the model.
>> Then the icon files will be missing (as they should).
>> But the icons generated at runtime are also missing the plus sign:
>>
>>
>>
>> You see?
>>
>> Cheers
>> /Eike
>>
>>
>>>
>>>
>>> Eike Stepper wrote:
>>>>
>>>>
>>>> Ed Merks schrieb:
>>>>> Eike,
>>>>>
>>>>> If you want to send me a sample showing what you've changed,
>>>>> that's a good start. I imagine if you're doing something (hand
>>>>> changed some code) to overlay an image you'd be able to change
>>>>> that code to fetch the object image you want to overlay...
>>>> Actually I didn't change anything with respect to creation icons
>>>> except that I deleted the generated icons.
>>>> I attached the small model plugin+edit+editor. It's just a
>>>> prototype at the moment.
>>>>
>>>> Just to be clear: If I set Creation Icons to false in the GenModel,
>>>> is the runtime expected to overlay the plus sign or not?
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>>
>>>>>
>>>>>
>>>>> Eike Stepper wrote:
>>>>>> Ed,
>>>>>>
>>>>>> I'm still not sure if what I described is the expected behaviour
>>>>>> or otherwise what I could do against it.
>>>>>> Would it help you if send you my small model plugins or attach
>>>>>> them to a Bugzilla?
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ed Merks schrieb:
>>>>>>> Eike,
>>>>>>>
>>>>>>> Comments below.
>>>>>>>
>>>>>>> Eike Stepper wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I don't want to provide my own creation icons and of course I
>>>>>>>> don't want to use the generated default ones.
>>>>>>>> If I just delete the generated ones I get icons that are nicely
>>>>>>>> overlaid with the plus sign at runtime.
>>>>>>>> This is what I want but after each re-generation I have to
>>>>>>>> delete the generated icons again to get this effect.
>>>>>>>>
>>>>>>>> I found the generator setting "Creation Icons" and set it to
>>>>>>>> false.
>>>>>>>> Now the creation icons are no longer generated.
>>>>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>>>>
>>>>>>>> Any ideas how to get obj16 images + overlaid plus sign - manual
>>>>>>>> deletion of generated creation icons?
>>>>>>> The item provider template has this guard.
>>>>>>>
>>>>>>> <%if (!genModel.isCreationIcons() &&
>>>>>>> genClass.isModelRoot()) {%>
>>>>>>> /**
>>>>>>> * This returns the icon image for {@link
>>>>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>>>>> * <!-- begin-user-doc -->
>>>>>>> * <!-- end-user-doc -->
>>>>>>> * @generated
>>>>>>> */
>>>>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>>>>> @Override
>>>>>>> <%}%>
>>>>>>> public Object getCreateChildImage(Object owner, Object
>>>>>>> feature, Object child,
>>>>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>>>>> "java.util.Collection<?>" : "java.util.Collection")%> selection)
>>>>>>> {
>>>>>>> if (feature instanceof
>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>>>>> &&
>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>>>>> {
>>>>>>>
>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>>>>> entry =
>>>>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>>>>> feature = entry.getEStructuralFeature();
>>>>>>> child = entry.getValue();
>>>>>>> }
>>>>>>>
>>>>>>> if (feature instanceof
>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>>>>> && child instanceof
>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>>>>> {
>>>>>>> String name = "full/obj16/" +
>>>>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>>>>
>>>>>>> try
>>>>>>> {
>>>>>>> return getResourceLocator().getImage(name);
>>>>>>> }
>>>>>>> catch (Exception e)
>>>>>>> {
>>>>>>>
>>>>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> return super.getCreateChildImage(owner, feature,
>>>>>>> child, selection);
>>>>>>> }
>>>>>>>
>>>>>>> <%}%>
>>>>>>>
>>>>>>> I'm not sure how this method being missing induces the behavior
>>>>>>> problem you describe.
>>>>>>>>
>>>>>>>> Does this relate somehow?
>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike

--------------030204090609030404090402
Content-Type: multipart/related;
boundary="------------080209010405080205060609"


--------------080209010405080205060609
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ed Merks schrieb:
<blockquote cite="mid:g50389$sgv$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
I'm not even sure why we generate that stupid method since the call to
super does mostly the same thing, although it tries to find the
explicit icon first, and does it more nicely given that it uses the
overlay...<br>
</blockquote>
And is the missing plus sign now expected or not?<br>
I.e. should I file a Bugzilla or just reopen <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974">https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974</a>
?<br>
<br>
I also found these:<br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=114657">https://bugs.eclipse.org/bugs/show_bug.cgi?id=114657</a><br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=131376">https://bugs.eclipse.org/bugs/show_bug.cgi?id=131376</a><br>
<br>
Cheers<br>
/Eike<br>
<br>
<blockquote cite="mid:g50389$sgv$1@build.eclipse.org" type="cite"><br>
<br>
Eike Stepper wrote:
<blockquote cite="mid:g50272$ijo$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Ed,<br>
<br>
Comments below...<br>
<br>
<br>
Ed Merks schrieb:
<blockquote cite="mid:g4vu5f$p7e$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Eike,<br>
<br>
[...] For me it looks like this:<br>
<blockquote><img src="cid:part1.04000107.09010108@sympedia.de"
alt=""><br>
</blockquote>
<br>
Isn't that what you're getting?<br>
</blockquote>
Yes, but I get this only because I manually deleted the generated
creation icons.<br>
Now if I re-generate I always have to re-delete them, too.<br>
<br>
Please try setting the "Creation Icons" property to false and
re-generate the model.<br>
Then the icon files will be missing (as they should).<br>
But the icons generated at runtime are also missing the plus sign:<br>
<br>


Re: Creation Icons [message #420722 is a reply to message #420720] Tue, 08 July 2008 17:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000501050509000308050508
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

Looking at the older bug, it seems to be doing exactly what the bugzilla
said, but I'm not sure if the base ItemProviderAdapter was changed later
to make the generated override pointless (and less functional). In any
case, I think we need to revisit this with a new bugzilla, and probably
just avoid generating that method at all...


Eike Stepper wrote:
> Ed Merks schrieb:
>> Eike,
>>
>> I'm not even sure why we generate that stupid method since the call
>> to super does mostly the same thing, although it tries to find the
>> explicit icon first, and does it more nicely given that it uses the
>> overlay...
> And is the missing plus sign now expected or not?
> I.e. should I file a Bugzilla or just reopen
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974 ?
>
> I also found these:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=114657
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=131376
>
> Cheers
> /Eike
>
>>
>>
>> Eike Stepper wrote:
>>> Ed,
>>>
>>> Comments below...
>>>
>>>
>>> Ed Merks schrieb:
>>>> Eike,
>>>>
>>>> [...] For me it looks like this:
>>>>
>>>>
>>>>
>>>> Isn't that what you're getting?
>>> Yes, but I get this only because I manually deleted the generated
>>> creation icons.
>>> Now if I re-generate I always have to re-delete them, too.
>>>
>>> Please try setting the "Creation Icons" property to false and
>>> re-generate the model.
>>> Then the icon files will be missing (as they should).
>>> But the icons generated at runtime are also missing the plus sign:
>>>
>>>
>>>
>>> You see?
>>>
>>> Cheers
>>> /Eike
>>>
>>>
>>>>
>>>>
>>>> Eike Stepper wrote:
>>>>>
>>>>>
>>>>> Ed Merks schrieb:
>>>>>> Eike,
>>>>>>
>>>>>> If you want to send me a sample showing what you've changed,
>>>>>> that's a good start. I imagine if you're doing something (hand
>>>>>> changed some code) to overlay an image you'd be able to change
>>>>>> that code to fetch the object image you want to overlay...
>>>>> Actually I didn't change anything with respect to creation icons
>>>>> except that I deleted the generated icons.
>>>>> I attached the small model plugin+edit+editor. It's just a
>>>>> prototype at the moment.
>>>>>
>>>>> Just to be clear: If I set Creation Icons to false in the
>>>>> GenModel, is the runtime expected to overlay the plus sign or not?
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Eike Stepper wrote:
>>>>>>> Ed,
>>>>>>>
>>>>>>> I'm still not sure if what I described is the expected behaviour
>>>>>>> or otherwise what I could do against it.
>>>>>>> Would it help you if send you my small model plugins or attach
>>>>>>> them to a Bugzilla?
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Ed Merks schrieb:
>>>>>>>> Eike,
>>>>>>>>
>>>>>>>> Comments below.
>>>>>>>>
>>>>>>>> Eike Stepper wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I don't want to provide my own creation icons and of course I
>>>>>>>>> don't want to use the generated default ones.
>>>>>>>>> If I just delete the generated ones I get icons that are
>>>>>>>>> nicely overlaid with the plus sign at runtime.
>>>>>>>>> This is what I want but after each re-generation I have to
>>>>>>>>> delete the generated icons again to get this effect.
>>>>>>>>>
>>>>>>>>> I found the generator setting "Creation Icons" and set it to
>>>>>>>>> false.
>>>>>>>>> Now the creation icons are no longer generated.
>>>>>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>>>>>
>>>>>>>>> Any ideas how to get obj16 images + overlaid plus sign -
>>>>>>>>> manual deletion of generated creation icons?
>>>>>>>> The item provider template has this guard.
>>>>>>>>
>>>>>>>> <%if (!genModel.isCreationIcons() &&
>>>>>>>> genClass.isModelRoot()) {%>
>>>>>>>> /**
>>>>>>>> * This returns the icon image for {@link
>>>>>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>>>>>> * <!-- begin-user-doc -->
>>>>>>>> * <!-- end-user-doc -->
>>>>>>>> * @generated
>>>>>>>> */
>>>>>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>>>>>> @Override
>>>>>>>> <%}%>
>>>>>>>> public Object getCreateChildImage(Object owner, Object
>>>>>>>> feature, Object child,
>>>>>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>>>>>> "java.util.Collection<?>" : "java.util.Collection")%>
>>>>>>>> selection)
>>>>>>>> {
>>>>>>>> if (feature instanceof
>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>>>>>> &&
>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>>>>>> {
>>>>>>>>
>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>>>>>> entry =
>>>>>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>>>>>> feature = entry.getEStructuralFeature();
>>>>>>>> child = entry.getValue();
>>>>>>>> }
>>>>>>>>
>>>>>>>> if (feature instanceof
>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>>>>>> && child instanceof
>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>>>>>> {
>>>>>>>> String name = "full/obj16/" +
>>>>>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>>>>>
>>>>>>>> try
>>>>>>>> {
>>>>>>>> return getResourceLocator().getImage(name);
>>>>>>>> }
>>>>>>>> catch (Exception e)
>>>>>>>> {
>>>>>>>>
>>>>>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>> return super.getCreateChildImage(owner, feature,
>>>>>>>> child, selection);
>>>>>>>> }
>>>>>>>>
>>>>>>>> <%}%>
>>>>>>>>
>>>>>>>> I'm not sure how this method being missing induces the behavior
>>>>>>>> problem you describe.
>>>>>>>>>
>>>>>>>>> Does this relate somehow?
>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>> /Eike

--------------000501050509000308050508
Content-Type: multipart/related;
boundary="------------070405090000080502020705"


--------------070405090000080502020705
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
Looking at the older bug, it seems to be doing exactly what the
bugzilla said, but I'm not sure if the base ItemProviderAdapter was
changed later to make the generated override pointless (and less
functional).


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creation Icons [message #420723 is a reply to message #420722] Tue, 08 July 2008 17:21 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020507060401050007070803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Ed Merks schrieb:
> Eike,
>
> Looking at the older bug, it seems to be doing exactly what the
> bugzilla said, but I'm not sure if the base ItemProviderAdapter was
> changed later to make the generated override pointless (and less
> functional). In any case, I think we need to revisit this with a new
> bugzilla, and probably just avoid generating that method at all...
https://bugs.eclipse.org/240026

>
>
> Eike Stepper wrote:
>> Ed Merks schrieb:
>>> Eike,
>>>
>>> I'm not even sure why we generate that stupid method since the call
>>> to super does mostly the same thing, although it tries to find the
>>> explicit icon first, and does it more nicely given that it uses the
>>> overlay...
>> And is the missing plus sign now expected or not?
>> I.e. should I file a Bugzilla or just reopen
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974 ?
>>
>> I also found these:
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=114657
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=131376
>>
>> Cheers
>> /Eike
>>
>>>
>>>
>>> Eike Stepper wrote:
>>>> Ed,
>>>>
>>>> Comments below...
>>>>
>>>>
>>>> Ed Merks schrieb:
>>>>> Eike,
>>>>>
>>>>> [...] For me it looks like this:
>>>>>
>>>>>
>>>>>
>>>>> Isn't that what you're getting?
>>>> Yes, but I get this only because I manually deleted the generated
>>>> creation icons.
>>>> Now if I re-generate I always have to re-delete them, too.
>>>>
>>>> Please try setting the "Creation Icons" property to false and
>>>> re-generate the model.
>>>> Then the icon files will be missing (as they should).
>>>> But the icons generated at runtime are also missing the plus sign:
>>>>
>>>>
>>>>
>>>> You see?
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>>
>>>>>
>>>>>
>>>>> Eike Stepper wrote:
>>>>>>
>>>>>>
>>>>>> Ed Merks schrieb:
>>>>>>> Eike,
>>>>>>>
>>>>>>> If you want to send me a sample showing what you've changed,
>>>>>>> that's a good start. I imagine if you're doing something (hand
>>>>>>> changed some code) to overlay an image you'd be able to change
>>>>>>> that code to fetch the object image you want to overlay...
>>>>>> Actually I didn't change anything with respect to creation icons
>>>>>> except that I deleted the generated icons.
>>>>>> I attached the small model plugin+edit+editor. It's just a
>>>>>> prototype at the moment.
>>>>>>
>>>>>> Just to be clear: If I set Creation Icons to false in the
>>>>>> GenModel, is the runtime expected to overlay the plus sign or not?
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Eike Stepper wrote:
>>>>>>>> Ed,
>>>>>>>>
>>>>>>>> I'm still not sure if what I described is the expected
>>>>>>>> behaviour or otherwise what I could do against it.
>>>>>>>> Would it help you if send you my small model plugins or attach
>>>>>>>> them to a Bugzilla?
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> /Eike
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Ed Merks schrieb:
>>>>>>>>> Eike,
>>>>>>>>>
>>>>>>>>> Comments below.
>>>>>>>>>
>>>>>>>>> Eike Stepper wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I don't want to provide my own creation icons and of course I
>>>>>>>>>> don't want to use the generated default ones.
>>>>>>>>>> If I just delete the generated ones I get icons that are
>>>>>>>>>> nicely overlaid with the plus sign at runtime.
>>>>>>>>>> This is what I want but after each re-generation I have to
>>>>>>>>>> delete the generated icons again to get this effect.
>>>>>>>>>>
>>>>>>>>>> I found the generator setting "Creation Icons" and set it to
>>>>>>>>>> false.
>>>>>>>>>> Now the creation icons are no longer generated.
>>>>>>>>>> BUT: At runtime the plus sign is no longer overlaid ;-(
>>>>>>>>>>
>>>>>>>>>> Any ideas how to get obj16 images + overlaid plus sign -
>>>>>>>>>> manual deletion of generated creation icons?
>>>>>>>>> The item provider template has this guard.
>>>>>>>>>
>>>>>>>>> <%if (!genModel.isCreationIcons() &&
>>>>>>>>> genClass.isModelRoot()) {%>
>>>>>>>>> /**
>>>>>>>>> * This returns the icon image for {@link
>>>>>>>>> org.eclipse.emf.edit.command.CreateChildCommand}.
>>>>>>>>> * <!-- begin-user-doc -->
>>>>>>>>> * <!-- end-user-doc -->
>>>>>>>>> * @generated
>>>>>>>>> */
>>>>>>>>> <%if (genModel.useClassOverrideAnnotation()) {%>
>>>>>>>>> @Override
>>>>>>>>> <%}%>
>>>>>>>>> public Object getCreateChildImage(Object owner, Object
>>>>>>>>> feature, Object child,
>>>>>>>>> <%=genModel.getImportedName(genModel.useGenerics() ?
>>>>>>>>> "java.util.Collection<?>" : "java.util.Collection")%>
>>>>>>>>> selection)
>>>>>>>>> {
>>>>>>>>> if (feature instanceof
>>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>
>>>>>>>>> &&
>>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil ")%>.isFeatureMap((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature ")%>)feature))
>>>>>>>>> {
>>>>>>>>>
>>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry
>>>>>>>>> entry =
>>>>>>>>> (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap ")%>.Entry)child;
>>>>>>>>> feature = entry.getEStructuralFeature();
>>>>>>>>> child = entry.getValue();
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> if (feature instanceof
>>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EReference ")%>
>>>>>>>>> && child instanceof
>>>>>>>>> <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")% >)
>>>>>>>>> {
>>>>>>>>> String name = "full/obj16/" +
>>>>>>>>> ((EObject)child).eClass().getName();<%=genModel.getNonNLS()% >
>>>>>>>>>
>>>>>>>>> try
>>>>>>>>> {
>>>>>>>>> return getResourceLocator().getImage(name);
>>>>>>>>> }
>>>>>>>>> catch (Exception e)
>>>>>>>>> {
>>>>>>>>>
>>>>>>>>> < %=genClass.getGenPackage().getImportedEditPluginClassName()% >.INSTANCE.log(e);
>>>>>>>>> }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> return super.getCreateChildImage(owner, feature,
>>>>>>>>> child, selection);
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> <%}%>
>>>>>>>>>
>>>>>>>>> I'm not sure how this method being missing induces the
>>>>>>>>> behavior problem you describe.
>>>>>>>>>>
>>>>>>>>>> Does this relate somehow?
>>>>>>>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85974
>>>>>>>>>>
>>>>>>>>>> Cheers
>>>>>>>>>> /Eike

--------------020507060401050007070803
Content-Type: multipart/related;
boundary="------------030700030505010309080403"


--------------030700030505010309080403
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ed Merks schrieb:
<blockquote cite="mid:g506tb$a1p$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
Eike,<br>
<br>
Looking at the older bug, it seems to be doing exactly what the
bugzilla said, but I'm not sure if the base ItemProviderAdapter was
changed later to make the generated override pointless (and less
functional).


Previous Topic:Associations lost when converting from UML
Next Topic:[EMF.edit] Properties edition, provide default values ?
Goto Forum:
  


Current Time: Thu Apr 25 18:58:18 GMT 2024

Powered by FUDForum. Page generated in 0.04354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top