站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

VariableInputDialog (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.util
Class VariableInputDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.netbeans.modules.vcscore.util.VariableInputDialog
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class VariableInputDialog
extends JPanel

Dialog that enables users to set variable values before running the command.

See Also:
Serialized Form

Nested Class Summary
static interface VariableInputDialog.FilePromptDocumentListener
           
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String PROP_VAR_CHANGED
          This property (which name has the variable name appended) is fired when a variable value has changed.
static String PROP_VARIABLES_CHANGED
          This property (which name has the variable name appended) is fired when a variable value has changed.
static String VAR_AUTO_FILL
          The name of the variable, that contains pairs of variables and commands.
static String VAR_CANCEL_DIALOG_BY_PRECOMMAND
          When the value of this variable is true, the dialog will be canceled.
static String VAR_PLEASE_WAIT_TEXT
          The suffix of a variable name, that is checked for the text that is presented to the user while the pre-command is running.
static String VAR_UPDATE_CHANGED_FROM_SELECTOR
          When a map of variables contains this one (with value of true) after the selector command finish, the components are updated with values of returned variables.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VariableInputDialog(VcsDescribedCommand dcmd, VariableInputDescriptor inputDescriptor, boolean expert, Hashtable vars)
          Creates new form VariableInputDialog.
VariableInputDialog(VcsDescribedCommand dcmd, VariableInputDescriptor inputDescriptor, boolean expert, Hashtable vars, boolean rapidVariablesAssignment, boolean dynamicVarChanges)
          Creates new form VariableInputDialog.
 
Method Summary
 void addCloseListener(ActionListener closeListener)
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
 ActionListener getActionListener()
           
 VariableInputDialog.FilePromptDocumentListener getFilePromptDocumentListener()
           
 VariableInputDescriptor getGlobalInputDescriptor()
          Get the global input decriptor from which this dialog was created.
 Component getInitialFocusedComponent()
          Get the component, that should have the initial focus in this dialog.
 VariableInputDescriptor getInputDescriptor()
          Get the input decriptor from which this dialog was created.
 boolean getPromptForEachFile()
          Whether to prompt for variables for each file separately or use these variables for all files.
 Hashtable getUserParamsValuesTable()
          Get the table of additional user variables labels and values.
 String[] getVarAskValues()
          Get the variable ask values.
 JPanel getVariableInputPanel()
          Getter for the variable input panel.
 String[] getVarPromptValues()
          Get the variable prompt values.
 boolean hasDefaults()
          Tests currently edited values for being usable as defaults.
 boolean isValidInput()
          Test, whether the input in this dialog is valid and variables can be assigned.
 void processActions()
           
 void setCmdName(String cmdDisplayName)
           
 void setComponentsToPreprocess(List componentsToPreprocess)
           
 void setExec(String exec)
          Deprecated. nop method
 void setExecutionContext(CommandExecutionContext executionContext, Hashtable vars)
          Set the VCS file system, that is needed to execute the selector command and the variables table.
 void setFilePromptDocumentListener(VariableInputDialog.FilePromptDocumentListener docListener)
           
 void setFilePromptDocumentListener(VariableInputDialog.FilePromptDocumentListener docListener, Object docIdentif)
           
 void setGlobalInput(VariableInputDescriptor inputDescriptor)
           
 void setPromptEach(boolean prompt)
          Set whether the initial state of the check box for prompt on next file.
 void setUserParamsPromptLabels(Table varLabels, String advancedName)
          Create additional user labels and text fields.
 void showPromptEach(boolean show)
          Set whether to show check box for prompt on next file.
 void storeDefaults()
          Takes currently edited values and store them as new defaults.
 void updateVariableValues(Hashtable vars)
          Use this method to supply new variable values to the components.
 void updateVariableValuesSubset(Hashtable vars)
          Use this method to supply some new variable values to the components.
 VariableInputValidator validateComponents()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VAR_UPDATE_CHANGED_FROM_SELECTOR

public static final String VAR_UPDATE_CHANGED_FROM_SELECTOR
When a map of variables contains this one (with value of true) after the selector command finish, the components are updated with values of returned variables.

See Also:
Constant Field Values

VAR_CANCEL_DIALOG_BY_PRECOMMAND

public static final String VAR_CANCEL_DIALOG_BY_PRECOMMAND
When the value of this variable is true, the dialog will be canceled.

See Also:
Constant Field Values

VAR_PLEASE_WAIT_TEXT

public static final String VAR_PLEASE_WAIT_TEXT
The suffix of a variable name, that is checked for the text that is presented to the user while the pre-command is running.

See Also:
Constant Field Values

PROP_VAR_CHANGED

public static final String PROP_VAR_CHANGED
This property (which name has the variable name appended) is fired when a variable value has changed.

See Also:
Constant Field Values

PROP_VARIABLES_CHANGED

public static final String PROP_VARIABLES_CHANGED
This property (which name has the variable name appended) is fired when a variable value has changed.

See Also:
Constant Field Values

VAR_AUTO_FILL

public static final String VAR_AUTO_FILL
The name of the variable, that contains pairs of variables and commands. When the variables listed here change their value, the corresponding command is executed to fill values of remaining variables. This can be used to automatically fill in VCS configuartion, when it can be obtained from local configuration files.

See Also:
Constant Field Values
Constructor Detail

VariableInputDialog

public VariableInputDialog(VcsDescribedCommand dcmd,
                           VariableInputDescriptor inputDescriptor,
                           boolean expert,
                           Hashtable vars)
Creates new form VariableInputDialog. This JPanel should be used with DialogDescriptor to get the whole dialog.

Parameters:
dcmd - the command that is subject of customization
inputDescriptor - the input descriptor
expert - the expert mode
vars - the filesystem variables

VariableInputDialog

public VariableInputDialog(VcsDescribedCommand dcmd,
                           VariableInputDescriptor inputDescriptor,
                           boolean expert,
                           Hashtable vars,
                           boolean rapidVariablesAssignment,
                           boolean dynamicVarChanges)
Creates new form VariableInputDialog. This JPanel should be used with DialogDescriptor to get the whole dialog.

Parameters:
dcmd - the command that is subject of customization
inputDescriptor - the input descriptor
expert - the expert mode
vars - the filesystem variables
rapidVariablesAssignment - If true, assign the variable values as soon as possible, even before the user has finished explicitely the input (by focus lost, etc.). Currently this makes any difference only for textfields, which listen on key typed events and update the variables immediately.
dynamicVarChanges - Whether the variables might be updated via updateVariableValues(java.util.Hashtable) method. The components will count with the possibility that the variable values can change and therefore a more "interactive" mode will be set.
Method Detail

setFilePromptDocumentListener

public void setFilePromptDocumentListener(VariableInputDialog.FilePromptDocumentListener docListener)

setFilePromptDocumentListener

public void setFilePromptDocumentListener(VariableInputDialog.FilePromptDocumentListener docListener,
                                          Object docIdentif)

setCmdName

public void setCmdName(String cmdDisplayName)

getFilePromptDocumentListener

public VariableInputDialog.FilePromptDocumentListener getFilePromptDocumentListener()

getInputDescriptor

public VariableInputDescriptor getInputDescriptor()
Get the input decriptor from which this dialog was created.

Returns:
The variable input descriptor or null.

getGlobalInputDescriptor

public VariableInputDescriptor getGlobalInputDescriptor()
Get the global input decriptor from which this dialog was created.

Returns:
The global variable input descriptor or null.

getInitialFocusedComponent

public Component getInitialFocusedComponent()
Get the component, that should have the initial focus in this dialog.


storeDefaults

public final void storeDefaults()
Takes currently edited values and store them as new defaults.


hasDefaults

public final boolean hasDefaults()
Tests currently edited values for being usable as defaults.


firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)

validateComponents

public VariableInputValidator validateComponents()

getActionListener

public ActionListener getActionListener()

addCloseListener

public void addCloseListener(ActionListener closeListener)

processActions

public void processActions()

isValidInput

public boolean isValidInput()
Test, whether the input in this dialog is valid and variables can be assigned.

Returns:
true if the input is valid, false otherwise

setExecutionContext

public void setExecutionContext(CommandExecutionContext executionContext,
                                Hashtable vars)
Set the VCS file system, that is needed to execute the selector command and the variables table.


updateVariableValues

public void updateVariableValues(Hashtable vars)
Use this method to supply new variable values to the components. If you gonna call this method, you should create this object via the constructor with "dynamicVarChanges" field, where you should pass "true". Otherwise some components might not be updated correctly.


updateVariableValuesSubset

public void updateVariableValuesSubset(Hashtable vars)
Use this method to supply some new variable values to the components. A subset of currently used variables is expected, therefore all variables that are not in this map remains unchanged in the dialog rather then being removed (unlike updateVariableValues(java.util.Hashtable) method). If you gonna call this method, you should create this object via the constructor with "dynamicVarChanges" field, where you should pass "true". Otherwise some components might not be updated correctly.


setExec

public void setExec(String exec)
Deprecated. nop method

Set the execution string.


setGlobalInput

public void setGlobalInput(VariableInputDescriptor inputDescriptor)

setUserParamsPromptLabels

public void setUserParamsPromptLabels(Table varLabels,
                                      String advancedName)
Create additional user labels and text fields.

Parameters:
varLabels - Table of labels and default values.

showPromptEach

public void showPromptEach(boolean show)
Set whether to show check box for prompt on next file. When not called default is true.

Parameters:
show - true to show, false not to show

setPromptEach

public void setPromptEach(boolean prompt)
Set whether the initial state of the check box for prompt on next file. When not called default is false.

Parameters:
prompt - the initial state

getVarPromptValues

public String[] getVarPromptValues()
Get the variable prompt values.


getVarAskValues

public String[] getVarAskValues()
Get the variable ask values.


getVariableInputPanel

public JPanel getVariableInputPanel()
Getter for the variable input panel. Use this panel if you need to use the panel in your own frame.

Returns:
The panel with variable inpout components.

getUserParamsValuesTable

public Hashtable getUserParamsValuesTable()
Get the table of additional user variables labels and values.


getPromptForEachFile

public boolean getPromptForEachFile()
Whether to prompt for variables for each file separately or use these variables for all files.


setComponentsToPreprocess

public void setComponentsToPreprocess(List componentsToPreprocess)

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.