Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.actions
Class DefaultTopologyExporter

java.lang.Object
  extended by com.ibm.etools.systems.application.visual.editor.actions.DefaultTopologyExporter
All Implemented Interfaces:
IApplicationDiagramModelExporter

public class DefaultTopologyExporter
extends Object
implements IApplicationDiagramModelExporter

Default implementation of IApplicationDiagramModelExporter which can generate topology from ApplicationModel and save it to a text file. This class will be enhanced in the future by externizing the report template.


Field Summary
protected  ApplicationModel appModel
           
protected  String artifactSeparater
           
static String copyright
           
protected  String groupSeparater
           
protected  int nameGap
           
protected static String newLineChar
           
protected  PrintWriter printWriter
           
protected  String sectionSeparater
           
protected  int separatorLength
           
protected  int tabPadding
           
protected  int titlePad
           
protected  String titleSeparater
           
 
Constructor Summary
DefaultTopologyExporter()
          Constructor.
 
Method Summary
protected  void closeOutputWriter()
          Close output writer.
 void copyToFile(List modelElements, IPath destination, IProgressMonitor monitor)
           
protected  void exportBinaryArtifact(BinaryArtifact binArtifact)
          Export single BinaryArtifact.
protected  int exportBinaryElements(ApplicationModel appModel, List binaryList)
          Export binary model elements.
protected  void exportOtherElements(ApplicationModel appModel, List otherList)
          Export other model elements.
protected  void exportSourceContainer(SourceContainer srcContainer)
          Export single source container.
protected  int exportSourceElements(ApplicationModel appModel, List sourceList)
          Export source model elements.
protected  PrintWriter getPrintWriter()
          Return printWriter.
protected  void handleCallblocksSummary(EList callableBlocks)
          Handle summary of callable blocks.
protected  void handleCalledBy(EList callableBlocks)
          Handle called by.
protected  void handleCalls(EList callableBlocks)
          Handle calls.
protected  void handleMainEntryPoint(MainEntryPoint mp)
          Handle main entry point.
protected  void handleModules(BinaryArtifact binArtifact)
          Process module section.
protected  void handleUsedBy(BinaryArtifact binArtifact)
          Process used by section.
protected  void handleUses(BinaryArtifact binArtifact)
          Process uses section.
protected  StringBuffer padding(int number)
          Pad with space.
protected  StringBuffer padding(int number, String paddingChars)
          Pad with space.
protected  boolean prepareOutputWriter(IPath destination)
          Prepare the output stream for saving topology.
protected  void processModelElements(ApplicationModelEditPart appModelEditPart)
          Process all model elements.
protected  List sortElements(List list, boolean ignoreCase)
           
protected  void writeBinaryArtifactSubTitle(BinaryArtifact binArtifact)
          Write binary artifact subtitle.
protected  void writeSeparator(String separaterChar)
          Write report separator.
protected  void writeSourceArtifactSubTitle(SourceContainer srcContainer)
          Write source artifact subtitile.
protected  void writeTitle()
          Write title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

appModel

protected ApplicationModel appModel

printWriter

protected PrintWriter printWriter

separatorLength

protected int separatorLength

titlePad

protected int titlePad

tabPadding

protected int tabPadding

nameGap

protected int nameGap

titleSeparater

protected String titleSeparater

groupSeparater

protected String groupSeparater

artifactSeparater

protected String artifactSeparater

sectionSeparater

protected String sectionSeparater

newLineChar

protected static final String newLineChar
Constructor Detail

DefaultTopologyExporter

public DefaultTopologyExporter()
Constructor.

Method Detail

copyToFile

public void copyToFile(List modelElements,
                       IPath destination,
                       IProgressMonitor monitor)
Specified by:
copyToFile in interface IApplicationDiagramModelExporter

prepareOutputWriter

protected boolean prepareOutputWriter(IPath destination)
Prepare the output stream for saving topology.

Parameters:
path -
Returns:

closeOutputWriter

protected void closeOutputWriter()
Close output writer.


processModelElements

protected void processModelElements(ApplicationModelEditPart appModelEditPart)
Process all model elements.


writeTitle

protected void writeTitle()
Write title.


writeSeparator

protected void writeSeparator(String separaterChar)
Write report separator.


sortElements

protected List sortElements(List list,
                            boolean ignoreCase)
Parameters:
appModel2 -

exportSourceElements

protected int exportSourceElements(ApplicationModel appModel,
                                   List sourceList)
Export source model elements.


exportSourceContainer

protected void exportSourceContainer(SourceContainer srcContainer)
Export single source container.

Parameters:
srcContainer -

writeSourceArtifactSubTitle

protected void writeSourceArtifactSubTitle(SourceContainer srcContainer)
Write source artifact subtitile.


handleCallblocksSummary

protected void handleCallblocksSummary(EList callableBlocks)
Handle summary of callable blocks.


handleMainEntryPoint

protected void handleMainEntryPoint(MainEntryPoint mp)
Handle main entry point.


handleCalledBy

protected void handleCalledBy(EList callableBlocks)
Handle called by.


handleCalls

protected void handleCalls(EList callableBlocks)
Handle calls.


exportBinaryElements

protected int exportBinaryElements(ApplicationModel appModel,
                                   List binaryList)
Export binary model elements.


exportBinaryArtifact

protected void exportBinaryArtifact(BinaryArtifact binArtifact)
Export single BinaryArtifact.

Parameters:
binArtifact -

writeBinaryArtifactSubTitle

protected void writeBinaryArtifactSubTitle(BinaryArtifact binArtifact)
Write binary artifact subtitle.


handleModules

protected void handleModules(BinaryArtifact binArtifact)
Process module section.


handleUsedBy

protected void handleUsedBy(BinaryArtifact binArtifact)
Process used by section.


handleUses

protected void handleUses(BinaryArtifact binArtifact)
Process uses section.


exportOtherElements

protected void exportOtherElements(ApplicationModel appModel,
                                   List otherList)
Export other model elements.


padding

protected StringBuffer padding(int number)
Pad with space.


padding

protected StringBuffer padding(int number,
                               String paddingChars)
Pad with space.


getPrintWriter

protected PrintWriter getPrintWriter()
Return printWriter.


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.