Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.providers
Class ApplicationModelFileDiagramDocumentProvider

java.lang.Object
  extended by FileDiagramDocumentProvider
      extended by com.ibm.etools.systems.application.visual.editor.providers.ApplicationModelFileDiagramDocumentProvider

public class ApplicationModelFileDiagramDocumentProvider
extends FileDiagramDocumentProvider

The DocumentProvider for persisted ApplicationModel file. This povider saves the model and diagram files with special naming conversion. The model and diagram files have same base name but different file extensions.


Field Summary
static String copyright
           
 
Constructor Summary
ApplicationModelFileDiagramDocumentProvider()
          Constructor.
 
Method Summary
protected  ISchedulingRule computeSaveSchedulingRule(IResource toCreateOrModify)
          Computes the scheduling rule needed to create or modify a resource.
protected  void disposeElementInfo(Object element, ElementInfo info)
           
protected  void doSaveAs(TransactionalEditingDomain domain, IFile file, Diagram diagram, Map options, IProgressMonitor monitor)
          Handles the saving of the diagram to a different file so that the model and diagram files are always created with same base names but different extensions.
protected  ISchedulingRule getSaveRule(Object element)
           
protected  void saveDocumentToFile(IDocument document, IFile file, boolean overwrite, IProgressMonitor monitor)
           
 
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
Constructor Detail

ApplicationModelFileDiagramDocumentProvider

public ApplicationModelFileDiagramDocumentProvider()
Constructor.

Method Detail

saveDocumentToFile

protected void saveDocumentToFile(IDocument document,
                                  IFile file,
                                  boolean overwrite,
                                  IProgressMonitor monitor)
                           throws CoreException
Throws:
CoreException

doSaveAs

protected void doSaveAs(TransactionalEditingDomain domain,
                        IFile file,
                        Diagram diagram,
                        Map options,
                        IProgressMonitor monitor)
                 throws CoreException
Handles the saving of the diagram to a different file so that the model and diagram files are always created with same base names but different extensions.

Parameters:
domain - the TransactionalEditingDomain we are saving in
file - the IFile to save to
diagram - Diagram that will be saved
options - save options or null
monitor - IProgressMonitor
Throws:
CoreException

getSaveRule

protected ISchedulingRule getSaveRule(Object element)

computeSaveSchedulingRule

protected ISchedulingRule computeSaveSchedulingRule(IResource toCreateOrModify)
Computes the scheduling rule needed to create or modify a resource. The 'create' rule for the last non-existing resource is returned no matter it is create or modify operation because model file will also be changed as the secondary file.

Parameters:
toCreateOrModify - the resource to create or modify
Returns:
the minimal scheduling rule needed to modify or create a resource

disposeElementInfo

protected void disposeElementInfo(Object element,
                                  ElementInfo info)

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.