alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

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.customizer;

import org.openide.util.*;
import org.openide.*;

import javax.swing.event.*;
import java.awt.event.*;
import javax.swing.tree.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import org.netbeans.modules.javacvs.util.*;


import org.netbeans.modules.cvsclient.JavaCvsSettings;
import org.netbeans.modules.cvsclient.IndependantClient;
import org.netbeans.modules.javacvs.events.CommandErrorListener;
import org.netbeans.modules.cvsclient.FsCommandFactory;
import org.netbeans.modules.javacvs.events.CommandErrorEvent;
import org.netbeans.modules.cvsclient.commands.ErrorLogPanel;
import org.netbeans.modules.javacvs.commands.CvsCheckout;
/**
 *
 * @author  mkleint
 * @version 
 */
public class Cust4MountPanel extends org.netbeans.modules.vcscore.cmdline.RelativeMountPanel 
                             implements TreeSelectionListener, CommandErrorListener {
    private NbJavaCvsCustomizer customizer;
    private ArrayList listeners;
    private String workingDir;
    private JButton btnCheckout;
    
    static final long serialVersionUID = 5574652503187921114L;
    
    public Cust4MountPanel() {
        super();
        setPreferredSize(new Dimension(300, 300));
        //initComponents ();
   //     isValid = false;
        //trRelMount.addTreeSelectionListener(this);
/*        JPanel buttnPanel = new JPanel();
        buttnPanel.setLayout(new BoxLayout(buttnPanel, BoxLayout.Y_AXIS));
        btnCheckout = new javax.swing.JButton();
        btnCheckout.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/cvsclient/customizer/Bundle").getString("RelativeMountPanel.btnCheckout.text"));
        btnCheckout.setMnemonic (java.util.ResourceBundle.getBundle("org/netbeans/modules/cvsclient/customizer/Bundle").getString("RelativeMountPanel.btnCheckout.mnemonic").charAt (0));
        btnCheckout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCheckoutActionPerformed(evt);
            }
        });
        buttnPanel.add(btnCheckout);
        buttnPanel.add(javax.swing.Box.createVerticalStrut(12));
        add(buttnPanel, BorderLayout.NORTH);
 */
    }
    
/*    
  private void btnCheckoutActionPerformed(java.awt.event.ActionEvent evt) {
// Add your handling code here:
      performCheckout();
  }
 */

    public String getName() {
        return org.openide.util.NbBundle.getBundle(Cust4MountPanel.class).getString("Cust4MountPanel.mountDialogLabel"); // NOI18N
    }
    

/** Test whether the panel is finished and it is safe to proceed to the next one.
 * If the panel is valid, the "Next" (or "Finish") button will be enabled.
 * @return true if the user has entered satisfactory information
 */

/** Add a listener to changes of the panel's validity.
 * @param l the listener to add
 * @see #isValid
 */
    private synchronized void addChangeListener(ChangeListener l) {
        if (listeners == null) {
            listeners = new ArrayList ();
        }
        listeners.add (l);
    }
/** Remove a listener to changes of the panel's validity.
 * @param l the listener to remove
 */
    private synchronized void removeChangeListener(ChangeListener l) {
        if (listeners != null) {
            listeners.remove (l);
        }
    }
    
    private void fireChangeState() {
        ArrayList list;
        synchronized (this) {
            if (this.listeners == null)
                return;
            list = (ArrayList) this.listeners.clone();
        }
        ChangeEvent event = new ChangeEvent (this);
        for (int i=0; inull if no help is supplied
         */
        public HelpCtx getHelp() {
            return new HelpCtx(Cust4MountPanel.class);
        }


        public void addChangeListener (ChangeListener l) {
            ((Cust4MountPanel)this.getComponent()).addChangeListener (l);
        }

        public void removeChangeListener (ChangeListener l) {
            ((Cust4MountPanel)this.getComponent()).removeChangeListener (l);
        }

        public boolean isValid() {
            /*
            if (isValid) {
            if (customizer != null)
            customizer.setWait(false);
            }
            return isValid;
            */
            return true;
        }


        /** Provides the wizard panel with the current data--either
         * the default data or already-modified settings, if the user used the previous and/or next buttons.
         * This method can be called multiple times on one instance of WizardDescriptor.Panel.
         * @param settings the object representing wizard panel state, as originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
         */
        public void readSettings(Object settings) {
            if (settings instanceof NbJavaCvsCustomizer) {
                Cust4MountPanel p = (Cust4MountPanel) this.getComponent();
                p.customizer = (NbJavaCvsCustomizer)settings;
                //        isValid = false;
                p.setTreeModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
                p.setEnabledTree(false);
                //   waitForCheckout();
                p.workingDir = p.customizer.getWorkingDir().getAbsolutePath();
                p.initTree(p.workingDir, p.customizer.getRelMount());
//        isValid = true;
                p.setEnabledTree(true);
            }
        }


        /** Provides the wizard panel with the opportunity to update the
         * settings with its current customized state.
         * Rather than updating its settings with every change in the GUI, it should collect them,
         * and then only save them when requested to by this method.
         * Also, the original settings passed to {@link #readSettings} should not be modified (mutated);
         * rather, the (copy) passed in here should be mutated according to the collected changes.
         * This method can be called multiple times on one instance of WizardDescriptor.Panel.
         * @param settings the object representing a settings of the wizard
         */
        public void storeSettings(Object settings) {
            if (settings instanceof NbJavaCvsCustomizer) {
                Cust4MountPanel p = (Cust4MountPanel) this.getComponent();
                p.customizer = (NbJavaCvsCustomizer)settings;
                p.customizer.setRelMount(p.getRelMount());
            }
        }

    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.