de.frag.umlplugin.uml.command
Class AbstractAddDependentClassesCommand

java.lang.Object
  extended by de.frag.umlplugin.uml.command.AbstractDiagramCommand
      extended by de.frag.umlplugin.uml.command.AbstractAddDependentClassesCommand
All Implemented Interfaces:
DiagramCommand
Direct Known Subclasses:
AddDependentClassesCommand, AddExtendedClassesCommand, AddExtendingClassesCommand, AddFieldClassesCommand, AddUsedClassesCommand, AddUsingClassesCommand

public abstract class AbstractAddDependentClassesCommand
extends AbstractDiagramCommand

Abstract base class for adding depending classes to diagram.


Field Summary
protected  java.lang.String qualifiedClassName
           
 
Fields inherited from class de.frag.umlplugin.uml.command.AbstractDiagramCommand
COMMAND_CLASS, COMMAND_ELEMENT_NAME, PSI_CLASS, SOURCE_CLASS, TARGET_CLASS, USAGE_TYPE
 
Constructor Summary
AbstractAddDependentClassesCommand(java.lang.String qualifiedClassName)
           
 
Method Summary
protected  void addAdditionalInfo(org.jdom.Element commandElement)
          Adds additional information (attributes or child elements) to given element.
protected  void addClasses(UMLDiagram diagram, DependencyCollection classes, boolean subjectIsSourceNode)
          Adds given classes to diagram and creates edges to these nodes.
protected abstract  void addDependentClasses(UMLDiagram diagram, com.intellij.psi.PsiClass psiClass)
          Adds classes dependent to specified class to given diagram.
 boolean canExecute(UMLDiagram diagram)
          Checks whether this command can be executed ot not.
 void execute(UMLDiagram diagram)
          Executes some action on a diagram.
 void renameClasses(ClassRenamer renamer)
          Renames all contained class names.
 
Methods inherited from class de.frag.umlplugin.uml.command.AbstractDiagramCommand
createElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qualifiedClassName

protected java.lang.String qualifiedClassName
Constructor Detail

AbstractAddDependentClassesCommand

public AbstractAddDependentClassesCommand(@NotNull
                                          java.lang.String qualifiedClassName)
Method Detail

execute

public void execute(@NotNull
                    UMLDiagram diagram)
Description copied from interface: DiagramCommand
Executes some action on a diagram.

Parameters:
diagram - diagram

addDependentClasses

protected abstract void addDependentClasses(@NotNull
                                            UMLDiagram diagram,
                                            @NotNull
                                            com.intellij.psi.PsiClass psiClass)
Adds classes dependent to specified class to given diagram.

Parameters:
diagram - diagram
psiClass - subject class

addClasses

protected void addClasses(@NotNull
                          UMLDiagram diagram,
                          @NotNull
                          DependencyCollection classes,
                          boolean subjectIsSourceNode)
Adds given classes to diagram and creates edges to these nodes.

Parameters:
diagram - diagram to add nodes to
classes - collection of classes
subjectIsSourceNode - true, if subject is source node; false otherwise

canExecute

public boolean canExecute(@NotNull
                          UMLDiagram diagram)
Description copied from interface: DiagramCommand
Checks whether this command can be executed ot not.

Parameters:
diagram - diagram
Returns:
true, if command can be executed; false otherwise

addAdditionalInfo

protected void addAdditionalInfo(@NotNull
                                 org.jdom.Element commandElement)
Description copied from class: AbstractDiagramCommand
Adds additional information (attributes or child elements) to given element.

Overrides:
addAdditionalInfo in class AbstractDiagramCommand
Parameters:
commandElement - command element to add additional information to

renameClasses

public void renameClasses(@NotNull
                          ClassRenamer renamer)
Renames all contained class names.

Parameters:
renamer - renamer that will rename classes to keep class names in sync after refactorings were applied.