projectviewer.importer
Class RootImporter

java.lang.Object
  extended byprojectviewer.importer.Importer
      extended byprojectviewer.importer.FileImporter
          extended byprojectviewer.importer.RootImporter
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ReImporter

public class RootImporter
extends FileImporter

Imports files and/or directories from the project root. Optionally, can remove all existing files under the root before doing a fresh import.

Version:
$Id: RootImporter.java 6409 2006-06-12 00:39:54Z vanza $
Author:
Marcelo Vanzin

Nested Class Summary
 
Nested classes inherited from class projectviewer.importer.Importer
Importer.NodeStructureChange, Importer.ShowNode
 
Field Summary
protected  java.lang.String oldRoot
           
protected  java.awt.Component parent
           
 
Fields inherited from class projectviewer.importer.FileImporter
fileCount, FILTER_MSG_INITIAL_IMPORT, FILTER_MSG_RE_IMPORT, FILTER_MSG_RECURSE, fnf
 
Fields inherited from class projectviewer.importer.Importer
added, fireEvent, postAction, project, removed, selected, viewer
 
Constructor Summary
RootImporter(VPTNode node, ProjectViewer viewer, boolean clean)
          Imports files from the root of the project.
RootImporter(VPTNode node, java.lang.String oldRoot, ProjectViewer viewer, java.awt.Component parent)
          Creates an Importer that uses a component other than the ProjectViewer as the parent of the dialogs shown to the user.
 
Method Summary
protected  ImportDialog getImportDialog()
           
protected  java.util.Collection internalDoImport()
          Asks if the user wants to import files from the chosen project root.
protected  void unregisterFiles(VPTDirectory dir)
          Unregisters all files in the directory from the project, recursively.
 
Methods inherited from class projectviewer.importer.FileImporter
addTree, showFileCount
 
Methods inherited from class projectviewer.importer.Importer
doImport, findDirectory, fireProjectEvent, importNode, importNode, loadImportFilterStatus, makePathTo, registerFile, run, saveImportFilterStatus, setViewerEnabled, unregisterFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected java.awt.Component parent

oldRoot

protected java.lang.String oldRoot
Constructor Detail

RootImporter

public RootImporter(VPTNode node,
                    java.lang.String oldRoot,
                    ProjectViewer viewer,
                    java.awt.Component parent)
Creates an Importer that uses a component other than the ProjectViewer as the parent of the dialogs shown to the user. If "oldRoot" is not null, files under this directory will be removed from the root node of the project.


RootImporter

public RootImporter(VPTNode node,
                    ProjectViewer viewer,
                    boolean clean)
Imports files from the root of the project. If "clean" is "true", the existing nodes that are below the root of the project will be removed before the importing.

Method Detail

internalDoImport

protected java.util.Collection internalDoImport()
Asks if the user wants to import files from the chosen project root.

Overrides:
internalDoImport in class FileImporter
Returns:
A collection of VPTNode instances.

unregisterFiles

protected void unregisterFiles(VPTDirectory dir)
Unregisters all files in the directory from the project, recursively.


getImportDialog

protected ImportDialog getImportDialog()
Overrides:
getImportDialog in class FileImporter