@OpenApiAll
public class ExportTool2
extends com.nomagic.magicreport.engine.ConcurrentTool
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT_NAME
Contains a context name.
|
static java.lang.String |
FILE_PROTOCOL |
Constructor and Description |
---|
ExportTool2()
Create an export tool.
|
ExportTool2(java.util.Observer observer)
Create an export tool with observer.
|
Modifier and Type | Method and Description |
---|---|
void |
consume(com.nomagic.magicreport.engine.ConcurrentTool.ConsumeObject consumeObject)
Consume a object.
|
protected org.w3c.dom.Element |
createAndExportElement(org.w3c.dom.Document document,
Element exportingElement,
boolean exportResources,
boolean exportLinkedFile,
com.nomagic.magicdraw.ui.ElementFilter filter)
Create XML element represents the
exportingElement and export the element into file. |
protected org.w3c.dom.Element |
createAndExportElement(org.w3c.dom.Document document,
Element exportingElement,
boolean exportResources,
boolean exportLinkedFile,
com.nomagic.magicdraw.ui.ElementFilter filter,
boolean isSmart)
Create XML element represents the
exportingElement and export the element into file. |
protected org.w3c.dom.Element |
createAndExportSmartElement(org.w3c.dom.Document document,
Element exportingElement,
boolean exportResources,
boolean exportLinkedFile,
com.nomagic.magicdraw.ui.ElementFilter filter)
Create XML element represents the
exportingElement and export the element into file. |
protected java.io.File |
createResourcesDir(java.lang.String resourcesLocation)
Create a resource directory.
|
void |
destroy()
Called by the engine to inform this tool is no longer use and that it should destroy any resources that it
has allocated.
|
java.lang.String |
exportAll(boolean exportResources,
boolean exportLinkedFile)
Export current opened project into file.
|
protected java.lang.String |
exportCustomImageHolder(BaseElement exportingElement)
Export the image for the element.
|
com.nomagic.magicreport.engine.ITool.Void |
exportElement(java.io.File exportingFile,
Element exportingElement,
boolean exportResources)
Export element to XML file.
|
com.nomagic.magicreport.engine.ITool.Void |
exportElement(java.io.File exportingFile,
Element exportingElement,
boolean exportResources,
boolean exportLinkedFile)
Export element to XML file.
|
com.nomagic.magicreport.engine.ITool.Void |
exportElement(java.io.File exportingFile,
Element exportingElement,
boolean exportResources,
boolean exportLinkedFile,
com.nomagic.magicdraw.ui.ElementFilter filter) |
com.nomagic.magicreport.engine.ITool.Void |
exportElementForTree(java.io.File exportingNodeFile,
Element exportingElement,
boolean exportResources,
com.nomagic.magicdraw.ui.ElementFilter filter)
Export element to XML file which is used for create tree.
|
protected java.lang.String |
exportIcon(BaseElement exportingElement)
Export the icon for element.
|
protected java.lang.String |
getElementType(Element element)
Return String representing element type.
|
static java.lang.String |
getHumanName(java.lang.String propertyName,
java.util.Map<java.lang.String,java.lang.String> nameMap)
Get human name of given property name.
|
protected java.lang.String |
getResourcesLocation()
Return location of resources directory.
|
protected boolean |
isAcceptProperty(Element exportingElement,
java.lang.String propertyName,
java.lang.Object propertyValue)
Return
true to include this property in the XML. |
void |
setRecursive(boolean isRecursive) |
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
public static final java.lang.String CONTEXT_NAME
public static final java.lang.String FILE_PROTOCOL
public ExportTool2()
public ExportTool2(java.util.Observer observer)
observer
- Observerpublic void setRecursive(boolean isRecursive)
public void consume(com.nomagic.magicreport.engine.ConcurrentTool.ConsumeObject consumeObject)
consume
in class com.nomagic.magicreport.engine.ConcurrentTool
consumeObject
- consume object.ConcurrentTool.consume(com.nomagic.magicreport.engine.ConcurrentTool.ConsumeObject)
public com.nomagic.magicreport.engine.ITool.Void exportElement(java.io.File exportingFile, Element exportingElement, boolean exportResources)
exportingFile
- exporting fileexportingElement
- exporting elementexportResources
- true if you want to export resources of this elementpublic com.nomagic.magicreport.engine.ITool.Void exportElement(java.io.File exportingFile, Element exportingElement, boolean exportResources, boolean exportLinkedFile)
exportingFile
- exporting fileexportingElement
- exporting elementexportResources
- true if you want to export resources of this elementexportLinkedFile
- true if you want to include linked files.public com.nomagic.magicreport.engine.ITool.Void exportElement(java.io.File exportingFile, Element exportingElement, boolean exportResources, boolean exportLinkedFile, com.nomagic.magicdraw.ui.ElementFilter filter)
protected boolean isAcceptProperty(Element exportingElement, java.lang.String propertyName, java.lang.Object propertyValue)
true
to include this property in the XML.exportingElement
- exporting element.propertyName
- property namepropertyValue
- property valuetrue
to include this property in the XML.public com.nomagic.magicreport.engine.ITool.Void exportElementForTree(java.io.File exportingNodeFile, Element exportingElement, boolean exportResources, com.nomagic.magicdraw.ui.ElementFilter filter)
exportingNodeFile
- exporting fileexportingElement
- export elementexportResources
- true if you want to export resources of this elementfilter
- element filterprotected java.lang.String getResourcesLocation()
protected java.io.File createResourcesDir(java.lang.String resourcesLocation) throws java.io.IOException
resourcesLocation
- resources locationjava.io.IOException
- if IO error occurs.protected java.lang.String exportIcon(BaseElement exportingElement) throws java.io.IOException
offer(ConsumeObject)
.exportingElement
- target elementjava.io.IOException
- if IO error occursprotected java.lang.String exportCustomImageHolder(BaseElement exportingElement) throws java.io.IOException
exportingElement
- target elementjava.io.IOException
- if IO error occursprotected org.w3c.dom.Element createAndExportElement(org.w3c.dom.Document document, Element exportingElement, boolean exportResources, boolean exportLinkedFile, com.nomagic.magicdraw.ui.ElementFilter filter) throws java.io.IOException
exportingElement
and export the element into file. Return
null
to cancel this element exporting.document
- XML documentexportingElement
- exporting elementexportResources
- true if you want to export resources of this elementexportLinkedFile
- true if you want to include linked files.filter
- element filter.java.io.IOException
- when IO error occured.protected org.w3c.dom.Element createAndExportSmartElement(org.w3c.dom.Document document, Element exportingElement, boolean exportResources, boolean exportLinkedFile, com.nomagic.magicdraw.ui.ElementFilter filter) throws java.io.IOException
exportingElement
and export the element into file. Return
null
to cancel this element exporting.document
- XML documentexportingElement
- exporting elementexportResources
- true if you want to export resources of this elementexportLinkedFile
- true if you want to include linked files.filter
- element filter.java.io.IOException
- when IO error occured.protected org.w3c.dom.Element createAndExportElement(org.w3c.dom.Document document, Element exportingElement, boolean exportResources, boolean exportLinkedFile, com.nomagic.magicdraw.ui.ElementFilter filter, boolean isSmart) throws java.io.IOException
exportingElement
and export the element into file. Return
null
to cancel this element exporting.document
- XML documentexportingElement
- exporting elementexportResources
- true if you want to export resources of this elementexportLinkedFile
- true if you want to include linked files.filter
- element filter.java.io.IOException
- when IO error occured.protected java.lang.String getElementType(Element element)
element
- elementpublic java.lang.String exportAll(boolean exportResources, boolean exportLinkedFile)
exportResources
- true if you want to export resources.exportLinkedFile
- true if you want to include linked files.public void destroy()
destroy
in class com.nomagic.magicreport.engine.ConcurrentTool
ConcurrentTool.destroy()
public static java.lang.String getHumanName(java.lang.String propertyName, java.util.Map<java.lang.String,java.lang.String> nameMap)
nameMap
is used, human name will be resolved by
nameMap
then resource string.propertyName
- a property namenameMap
- optional provides new name map from DSLManager.getPropertyNameMap(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element)
to resolve property
name from <<metaType>>