|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.cvsclient.commands.annotate; import java.io.File; import java.util.*; import org.netbeans.modules.cvsclient.FsCommandFactory; import org.netbeans.lib.cvsclient.command.annotate.AnnotateCommand; import org.netbeans.lib.cvsclient.command.annotate.AnnotateInformation; import org.netbeans.modules.javacvs.commands.CvsAnnotate; /** * * @author Milos Kleint */ public class AnnotateDisplayer extends org.netbeans.modules.javacvs.events.CommandDisplayerAdapter { private CvsAnnotate command; private boolean isDir = false; private File[] files; private LinkedList resultList; /** Creates new StatusDisplayer */ public AnnotateDisplayer(CvsAnnotate comm) { command = comm; } /** * this method is called after library's commands execution */ public void showAfterEachExecute() { if (isDir) { AnnotateTreeInfoPanel treePanel = (AnnotateTreeInfoPanel)FsCommandFactory.findOpenDisplayer( files[0], AnnotateTreeInfoPanel.class, null); if (treePanel == null) { treePanel = new AnnotateTreeInfoPanel(files[0], command); } else { treePanel.setCommand(command); } treePanel.setDataToDisplay(resultList); treePanel.displayOutputData(); } } /** * this method is called before any of the library's commands * that is stored in the queue in FileSystemCommand, is run. * @param currentCommand shows the command that will be executed. */ public void showBeforeEachExecute(org.netbeans.lib.cvsclient.command.Command currentCommand) { AnnotateCommand com = (AnnotateCommand)currentCommand; resultList = new LinkedList(); files = com.getFiles(); if (files[0].isDirectory()) { isDir = true; } else { isDir = false; } } /** * this one is called when the command's execution fails for any reason. */ public void showExecutionFailed(Exception exception) { } /** * When the library command's builder generates a FileInfoContainer object, the * Displayer is notified. * @param info - the generated information object */ public void showFileInfoGenerated(org.netbeans.lib.cvsclient.command.FileInfoContainer info) { if (info == null) return; if (isDir) { resultList.add(info); } else { File fl = info.getFile(); // find or create statusInfoPanel AnnotateInfoPanel panel = (AnnotateInfoPanel)FsCommandFactory.findOpenDisplayer( fl, AnnotateInfoPanel.class, null); if (panel == null) { panel = new AnnotateInfoPanel(command); } AnnotateInformation infoSt = (AnnotateInformation)info; panel.setData(infoSt); panel.displayOutputData(); } } /** * This is the last method to be called in the displayer. * Is called when the execution finishes. Any filan touchups can be made here. */ public void showFinishedCommand() { } /** * This method is the first one that is called during execution. * Here any initial setup of the displayer can be made. */ public void showStartCommand() { } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.