Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Multiple decorators : expected behaviour?
Multiple decorators : expected behaviour? [message #726093] Fri, 16 September 2011 10:31 Go to previous message
Hernan Gonzalez is currently offline Hernan Gonzalez
Messages: 146
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
The method ToolBehaviorProvider.getDecorators() returns an array of Decorators for a pictogram element. What is the expected behaviour when more than one is returned? I expected that they were displayed side by side, but it seems I was too optimistic Razz

For example, in the tutorial:

public class TutorialToolBehaviorProvider extends DefaultToolBehaviorProvider {
 ...
  @Override
  public IDecorator[] getDecorators(PictogramElement pe) {
    IFeatureProvider featureProvider = getFeatureProvider();
    Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
    if (bo instanceof EClass) {
        IDecorator imageRenderingDecorator1 = new ImageDecorator(IPlatformImageConstants.IMG_ECLIPSE_ERROR);
        imageRenderingDecorator1.setMessage("Error");
        IDecorator imageRenderingDecorator2 = new ImageDecorator(IPlatformImageConstants.IMG_ECLIPSE_INFORMATION);
        imageRenderingDecorator2.setMessage("Info"); 
        return new IDecorator[] { imageRenderingDecorator1,imageRenderingDecorator2};
    }
    return super.getDecorators(pe);
  }


The two images are placed one in top of the other - only the last one is visible. Is this right?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Multiple PictogramElements for single BusinessElement
Next Topic:Does Graphiti support fill patterns?
Goto Forum:
  


Current Time: Wed May 22 17:24:35 EDT 2013

Powered by FUDForum. Page generated in 0.01613 seconds