Loss of my shape decoration [message #1786115] |
Wed, 25 April 2018 14:05  |
Eclipse User |
|
|
|
Hi,
All is in the title : when I close my diagram and open it again, I loose the decoration of my custom shape (but not the properties).
What I am doing wrong ?
|
|
|
|
Re: Loss of my shape decoration [message #1786161 is a reply to message #1786148] |
Thu, 26 April 2018 05:45   |
Eclipse User |
|
|
|
Hi Ralph,
Sorry for not giving more information.
I extended a DataObject and, a TextAnnotation and an Association.
The only one for which the decoration is not lost is the Association. Maybe because I didn't not put him in my extension model ?
Here is the code of the feature container of my DataObject extension :
public class DataIoBarrierFeatureContainer extends CustomShapeFeatureContainer {
@Override
protected IShapeFeatureContainer createFeatureContainer(IFeatureProvider fp) {
return new DataObjectFeatureContainer() {
@Override
public IAddFeature getAddFeature(IFeatureProvider fp) {
return new AddDataObjectFeature(fp) {
@Override
protected void decorateShape(IAddContext context, ContainerShape containerShape, DataObject businessObject) {
super.decorateShape(context, containerShape, businessObject);
}
};
}
@Override
public ICreateFeature getCreateFeature(IFeatureProvider fp) {
return new CreateDataObjectFeature(fp) {
@Override
public DataObject createBusinessObject(ICreateContext context) {
DataObject businessObject = (DataObject) super.createBusinessObject(context);
return businessObject;
}
@Override
public String getCreateImageId() {
return SampleImageProvider.getImageId(customTaskDescriptor, IconSize.SMALL);
}
@Override
public String getCreateLargeImageId() {
return SampleImageProvider.getImageId(customTaskDescriptor, IconSize.LARGE);
}
@Override
public String getCreateDescription() {
return "Create "+customTaskDescriptor.getName();
}
};
}
@Override
public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
return null;
}
@Override
public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
return null;
}
};
}
public String getId(EObject arg0) {
EStructuralFeature f = ModelDecorator.getAnyAttribute(arg0, "type");
if (f!=null) {
Object id = arg0.eGet(f);
if (TYPE_VALUE.equals(id))
return CUSTOM_TASK_ID;
}
return null;
}
}
And the customTask definition :
<customTask
category="Interoperability"
description="Data Interoperability Barrier"
featureContainer="com.hedadura16.DataIoBarrierFeatureContainer"
icon="InteroperabilityBarrier.png"
id="com.hedadura16.dataIoBarrierId"
name="Data Interoperability Barrier"
runtimeId="com.hedadura16.runtimeId"
type="DataObject">
<property name="type" value="DataIoBarrier">
</property>
</customTask>
It is very simple, but I loose it...
[Updated on: Thu, 26 April 2018 05:55] by Moderator
|
|
|
|
|
|
|
Re: Loss of my shape decoration [message #1792701 is a reply to message #1786814] |
Sun, 22 July 2018 12:06  |
Eclipse User |
|
|
|
Hi,
I'm trying and trying again, but without success...
I'm trying now to make an extension of a TextAnnotation without model (like in the dynamic example), but I still loose the shape when I reopen my diagram.
I don't understand why...
The property tab is ok. I can change the values of my parameters, but I can't keep the shape, and then I have a classic TextAnnotation which doesn't display the parameters.
The only extension keeping his shape is the Association, which is a modelExtension.
What could be the problem ?
[Updated on: Sun, 22 July 2018 12:15] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.28106 seconds