|
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-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.cvsclient.commands; /** * * @author Milos Kleint */ import org.netbeans.modules.javacvs.events.CommandDisplayerAdapter; import org.netbeans.modules.javacvs.commands.*; import org.netbeans.modules.cvsclient.commands.update.*; import org.openide.*; import org.openide.util.NbBundle; import org.netbeans.lib.cvsclient.command.FileInfoContainer; import org.netbeans.lib.cvsclient.command.PipedFileInformation; import org.openide.DialogDisplayer; public class PipeToOutputDisplayer extends CommandDisplayerAdapter { private int openedCount = 0; private int maxCount = 15; private FileSystemCommand command; private org.netbeans.lib.cvsclient.admin.StandardAdminHandler admin; /** Creates new PipeToOutputDisplayer */ public PipeToOutputDisplayer(FileSystemCommand com) { command = com; admin = new org.netbeans.lib.cvsclient.admin.StandardAdminHandler(); } public void showFileInfoGenerated(FileInfoContainer info) { if (info instanceof PipedFileInformation) { try { org.netbeans.lib.cvsclient.admin.Entry entry = admin.getEntry(info.getFile()); if (entry != null) { if (entry.isBinary()) { //don't show binary files.. return; } } } catch (java.io.IOException exc) { } UpdateStdOutPanel panel = new UpdateStdOutPanel(command); PipedFileInformation pfInfo = (PipedFileInformation)info; panel.setData(pfInfo); panel.displayOutputData(); openedCount = openedCount + 1; if (openedCount >= maxCount) { String message = NbBundle.getMessage(PipeToOutputDisplayer.class, "PipeToOutputDisplayer.pipeOutputQuestion", new Integer(maxCount)); //NOI18N NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message, NotifyDescriptor.YES_NO_OPTION); Object returnValue = DialogDisplayer.getDefault().notify(nd); // System.out.println("return value=" + returnValue.getClass().getName() + " " + returnValue.toString()); if (NotifyDescriptor.Confirmation.NO_OPTION.equals(returnValue)) { command.hardCommandStop(); } else { maxCount = 200; } } } } } |
... 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.