Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] SapphireEditorForXml dynamic model type

Hello Sapphire-ians, 

I have a case where I would like to dynamically switch the model type for a sapphire editor on open.  This is easy enough to do if I extend SapphireEditor.  However, this editor is going to be standard MasterDetailsPage with a source editor page, and I'd like to use SapphireEditorForXml and not have to copy all of that code into my own subclass of SapphireEditor.  So, I'd rather just extend the XMLeditor class, but when I do that I am unload to modify the portions sneak a peak at the file that is being opened, in Editor.init() to see the IEditorInput so that I can then call the API, setRootModelElementType(...).

All of the methods that I would be interested in overriding to do this are set to final in SapphireEditorForXml or its superclasses.  So my request would be one of the following:
  • Details on how to do this with current API or
  • make some finals methods in SapphireEditorForXml, non-final or
  • Introduce a new API/method in SapphireEditorForXml that sub-classes can override to perform this logic
I can submit a patch for this with some guidance if we choose door #2 or #3.  Thanks everyone!

--
Greg Amerson
Liferay, Inc.


Back to the top