|
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.javacvs.customizers; import java.util.*; import org.openide.util.*; import org.netbeans.lib.cvsclient.command.watchers.WatchersCommand; import org.netbeans.lib.cvsclient.command.Command; import org.netbeans.modules.javacvs.FsWatchers; import java.beans.Customizer; import javax.accessibility.*; /** * Customizer for the CvsWatchers command. * @author mkleint */ public class WatchersParamInput extends javax.swing.JPanel implements Customizer { /** Creates new form WatchersParamInput */ private FsWatchers watchersCommand; private List commandList; private CustomizerPropChangeSupport support; public WatchersParamInput() { initComponents(); initAccessibility(); if (support == null) { support = new CustomizerPropChangeSupport(this); } cbLocal.setMnemonic(bundle.getString("WatchersParamInput.cbLocal.mnemonic").charAt(0)); //NOI18N java.awt.event.ActionListener actionList = new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { setData(); } }; cbLocal.addActionListener(actionList); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ private void initComponents() {//GEN-BEGIN:initComponents java.awt.GridBagConstraints gridBagConstraints; cbLocal = new javax.swing.JCheckBox(); setLayout(new java.awt.GridBagLayout()); cbLocal.setText(org.openide.util.NbBundle.getBundle(WatchersParamInput.class).getString("WatchersParamInput.cbLocal.text")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 12, 11, 11); add(cbLocal, gridBagConstraints); }//GEN-END:initComponents protected void setData() { if (commandList != null) { Iterator it = commandList.iterator(); FsWatchers fsCheck = null; while (it.hasNext()) { fsCheck = (FsWatchers)it.next(); setData(fsCheck); } if (fsCheck != null) { support.firePropertyChange(fsCheck); } } else { setData(watchersCommand); support.firePropertyChange(watchersCommand); } } protected void setData(FsWatchers command) { if (command != null) { command.setRecursive(!cbLocal.isSelected()); } } protected void getData(FsWatchers command) { cbLocal.setSelected(!command.isRecursive()); support.firePropertyChange(command); } /** * The Customizer's setObject method. However the customizer accepts both the * FsWatchers instance and a list of FsWatchers instances. In case of a list, * it loads switches from the first comand in row, however sets all the instances. */ public void setObject(java.lang.Object obj) { if (obj instanceof FsWatchers) { watchersCommand = (FsWatchers)obj; getData(watchersCommand); commandList = null; } if (obj instanceof List) { commandList = (List)obj; watchersCommand = null; if (commandList.size() > 0) { FsWatchers add = (FsWatchers)commandList.get(0); getData(add); } } } public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener) { if (support == null) { support = new CustomizerPropChangeSupport(this); } support.removePropertyChangeListener(propertyChangeListener); } public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener) { if (support == null) { support = new CustomizerPropChangeSupport(this); } support.addPropertyChangeListener(propertyChangeListener); } protected void firePropertyChange(java.lang.String str, java.lang.Object obj, java.lang.Object obj2) { if (support == null) { support = new CustomizerPropChangeSupport(this); } support.firePropertyChange(str, obj, obj2); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox cbLocal; // End of variables declaration//GEN-END:variables private static final java.util.ResourceBundle bundle = NbBundle.getBundle(StatusParamInput.class); //NOI18N private void initAccessibility() { AccessibleContext context = this.getAccessibleContext(); context.setAccessibleDescription(bundle.getString("ACSD_StatusParamInput")); context = cbLocal.getAccessibleContext(); context.setAccessibleDescription(bundle.getString("ACSD_StatusParamInput.cbLocal")); } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.