Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gmf-dev] palette tool for creating object from a template

I'm trying to put tools on the palette that will create objects that are copies of template objects. The palette runtime is straight forward and this kind of request seems to fit within a local subclass of GMF CreateViewAndElementRequest, for instance:

public TemplateObjectCreateRequest(IElementType type, final EObject templateObject, PreferencesHint preferencesHint) {
        super(
                new ViewAndElementDescriptor(
                    new CreateElementRequestAdapter(
                        new CreateElementRequest(type)), preferencesHint));
        this.templateObject = templateObject;
    }

Does this sound like a good approach? I'm now at the stage of implementing the create policy for this request and have gotten stuck there.

I'm off to read the runtime docs but any advice would be great, thanks.
Greg Jansen


Back to the top