public class SourceTargetPanel
extends javax.swing.JPanel
implements javax.swing.event.ListSelectionListener, java.awt.event.ActionListener, javax.swing.event.PopupMenuListener, com.lf.commons.model.ConfigurableUnit
File
and VFSURI
are used, FileObject
's can be
specified e.g. to add new entries (converted to VFSURI
with some extra information file/folder).
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JButton |
buttonAddFile_I18N |
protected javax.swing.JButton |
buttonAddURL_I18N |
protected javax.swing.JButton |
buttonDelete_I18N |
protected javax.swing.JButton |
buttonDown_I18N |
protected javax.swing.JButton |
buttonShowFile_I18N |
protected javax.swing.JButton |
buttonShowURL_I18N |
protected javax.swing.JButton |
buttonUp_I18N |
protected boolean |
dropEnabled
Is this component a dropping target?
|
protected java.lang.Object[] |
errors
The erroneous entries to highlight.
|
static java.lang.String |
ID_NONE_TEMPLATE
The "None" template item identifier.
|
protected SyncWindow |
parent
Parental window.
|
protected javax.swing.JPopupMenu |
popupMenu
Context menu for the sources table.
|
protected javax.swing.JTable |
table |
protected java.lang.Class[] |
tableClasses
Column names of the sources list used by the model.
|
protected java.lang.String[] |
tableColumns
Column names of the sources list used by the model.
|
protected java.lang.Object[][] |
tableData
List of sources currently displayed by the list.
|
protected javax.swing.JToggleButton |
toggleButtonAdjust_I18N |
protected javax.swing.JToolBar |
toolBar |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
SourceTargetPanel()
Constructor method for i18n purposes and the GUI editing only.
|
SourceTargetPanel(SyncWindow parent)
Constructor of this form.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Called whenever the one of the components was activated.
|
void |
addEntry(java.lang.Object source)
Adds a new source.
|
void |
configureUnit(java.lang.String id,
com.lf.commons.config.Configuration config)
Restores values from persistent data stores.
|
javax.swing.JButton |
getButtonDelete()
Provides the
JButton to delete entries. |
javax.swing.JComboBox |
getComboBoxTemplates()
Provides the
JComboBox showing the generate/refresh templates. |
boolean |
getDropEnabled()
Getter for the drop gesture (default:
false ). |
java.lang.Object[] |
getEntries(boolean fileobject)
Provides the entries currently managed by this panel (original
VFSURI objects). |
java.lang.String |
getGenerateTemplate()
Provides the currently selected generate/refresh template.
|
javax.swing.JTable |
getTable()
Provides the
JTable showing the entries. |
protected boolean |
moveRowSource(int row,
int offset)
Move an existing source one position up.
|
void |
popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
Popup menu was cancelled.
|
void |
popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
Popup menu will become invisible.
|
void |
popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
Popup menu will become visible.
|
boolean |
removeEntry(java.lang.Object source)
Remove an existing source.
|
void |
setDropEnabled(boolean enable)
Setter for the drop gesture (default:
false ). |
void |
setEntries(java.lang.Object[] entries)
Sets the entries to be managed by this panel, existing entries are removed.
|
void |
setErrors(java.lang.Object[] entries)
Sets the entries with errors to highlight.
|
void |
setParent(SyncWindow parent)
Setter for the parental window.
|
protected void |
setupTable()
Configures the table with source files/directories.
|
void |
storeUnit(java.lang.String id,
com.lf.commons.config.Configuration config)
Stores the current configuration values persistently.
|
static void |
storeUnit(java.lang.String id,
com.lf.commons.config.Configuration config,
java.lang.Object[] entries,
java.lang.String gentemplate,
boolean refresh,
boolean autoadjust)
Stores the given configuration values persistently.
|
void |
unitRegistered(com.lf.commons.model.ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was registered with a model.
|
void |
unitUnregistered(com.lf.commons.model.ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was unregistered with a model.
|
protected void |
updateButtons()
Updates the source table button (enabled/disabled).
|
protected void |
updateTemplates()
Updates the templates as configured by
GenerateOptionsWindow . |
void |
valueChanged(javax.swing.event.ListSelectionEvent event)
Reacts on table selection changes.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String ID_NONE_TEMPLATE
protected SyncWindow parent
protected java.lang.String[] tableColumns
protected java.lang.Class[] tableClasses
protected java.lang.Object[][] tableData
protected javax.swing.JPopupMenu popupMenu
protected boolean dropEnabled
protected java.lang.Object[] errors
protected javax.swing.JToolBar toolBar
protected javax.swing.JButton buttonAddFile_I18N
protected javax.swing.JButton buttonAddURL_I18N
protected javax.swing.JButton buttonDelete_I18N
protected javax.swing.JButton buttonShowFile_I18N
protected javax.swing.JButton buttonShowURL_I18N
protected javax.swing.JToggleButton toggleButtonAdjust_I18N
protected javax.swing.JButton buttonUp_I18N
protected javax.swing.JButton buttonDown_I18N
protected javax.swing.JTable table
public SourceTargetPanel()
public SourceTargetPanel(SyncWindow parent)
parent
- Window parentjava.lang.NullPointerException
- If a parameter is null
public void setParent(SyncWindow parent)
parent
- Window parentprotected void setupTable()
public void addEntry(java.lang.Object source)
source
- The source object (either File
, VFSURI
or FileObject
)java.lang.IllegalArgumentException
- If a parameter is invalidjava.lang.NullPointerException
- If a parameter is invalidpublic boolean removeEntry(java.lang.Object source)
source
- The source object (either File
or VFSURI
, not FileObject
)java.lang.IllegalArgumentException
- If a parameter is invalidjava.lang.NullPointerException
- If a parameter is invalidpublic java.lang.Object[] getEntries(boolean fileobject)
VFSURI
objects).
fileobject
- Return FileObject
instead of VFSURI
File
or VFSURI
)public void setEntries(java.lang.Object[] entries)
entries
- The ordered entries (either File
, FileObject
, or VFSURI
)protected boolean moveRowSource(int row, int offset)
row
- The row index to moveoffset
- offset=-1 position up, or offset=1 position downprotected void updateButtons()
public void configureUnit(java.lang.String id, com.lf.commons.config.Configuration config)
configureUnit
in interface com.lf.commons.model.ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic void storeUnit(java.lang.String id, com.lf.commons.config.Configuration config)
storeUnit
in interface com.lf.commons.model.ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic static void storeUnit(java.lang.String id, com.lf.commons.config.Configuration config, java.lang.Object[] entries, java.lang.String gentemplate, boolean refresh, boolean autoadjust)
id
- The unique identifier for the instanceconfig
- The configurationentries
- The entriesgentemplate
- The generate template IDrefresh
- Refresh mode?autoadjust
- Auto-adjust mode?public void unitRegistered(com.lf.commons.model.ApplicationModel model, java.lang.String id)
unitRegistered
in interface com.lf.commons.model.ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void unitUnregistered(com.lf.commons.model.ApplicationModel model, java.lang.String id)
unitUnregistered
in interface com.lf.commons.model.ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void setDropEnabled(boolean enable)
false
).
enable
- Enable dropping?public boolean getDropEnabled()
false
).
public javax.swing.JTable getTable()
JTable
showing the entries.
public javax.swing.JButton getButtonDelete()
JButton
to delete entries.
protected void updateTemplates()
GenerateOptionsWindow
.
public javax.swing.JComboBox getComboBoxTemplates()
JComboBox
showing the generate/refresh templates.
public java.lang.String getGenerateTemplate()
null
otherwisepublic void setErrors(java.lang.Object[] entries)
entries
- The erroneous entriespublic void valueChanged(javax.swing.event.ListSelectionEvent event)
valueChanged
in interface javax.swing.event.ListSelectionListener
event
- The eventpublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- The event objectpublic void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
popupMenuCanceled
in interface javax.swing.event.PopupMenuListener
e
- Event to be processedpublic void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeInvisible
in interface javax.swing.event.PopupMenuListener
e
- Event to be processedpublic void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeVisible
in interface javax.swing.event.PopupMenuListener
e
- Event to be processedCopyright © 2005-2015 Leisenfels UG. All rights reserved.