kernel
Class PluginFilenames

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by kernel.Plugin
                      extended by kernel.PluginFilenames
All Implemented Interfaces:
MouseListener, ImageObserver, MenuContainer, Serializable, Comparable<Plugin>, EventListener, Accessible

public abstract class PluginFilenames
extends Plugin

All filenames plugins have to extend this abstract class and to redefine the execute method from Plugin.

Author:
Michel Deriaz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
static int FILTER_DIR
          Only the directories in the current directory.
static int FILTER_DIR_REC
          Only the directories in the current directory and sub-directories.
static int FILTER_FILE
          Only the files in the current directory.
static int FILTER_FILE_AND_DIR
          Only the files and directories in the current directory.
static int FILTER_FILE_REC
          Only the files in the current directory and sub-directories.
static int FILTER_NO
          No filter.
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Method Summary
 File getDir()
          Returns the current directory or null if there is no.
 int getFlags()
          Returns an integer in which each bit codes a flag.
 String getFlagsAsLiteral()
          Returns the literal form of the flags like (?
 String getFlagsAsString()
          Returns a String containing the names of all the ticked flags.
 String[] getNewFiles()
          Returns the list of the new files in the same order than printed on the screen, or null if empty.
 String[] getOldFiles(int filter)
          Returns the list of the old files in the same order than printed on the screen, or null if empty.
 String getReplace()
          Returns the content of the Replace by field.
 String getSearch()
          Returns the content of the Search field.
 String getSelectedText()
          Returns the selected text.
 String getText()
          Returns the current text to process.
 boolean isCANON_EQ()
          Indicates whether the CANON_EQ flag is ticked off.
 boolean isCASE_INSENSITIVE()
          Indicates whether the CASE_INSENSITIVE flag is ticked off.
 boolean isCOMMENTS()
          Indicates whether the COMMENTS flag is ticked off.
 boolean isUNICODE_CASE()
          Indicates whether the UNICODE_CASE flag is ticked off.
 void setCANON_EQ(boolean b)
          Ticks or unticks the CANON_EQ flag.
 void setCASE_INSENSITIVE(boolean b)
          Ticks or unticks the CASE_INSENSITIVE flag.
 void setCOMMENTS(boolean b)
          Ticks or unticks the COMMENTS flag.
 void setReplace(String text)
          Sets the content of the Replace by field.
 void setSearch(String text)
          Sets the content of the Search field.
 void setUNICODE_CASE(boolean b)
          Ticks or unticks the UNICODE_CASE flag.
 
Methods inherited from class kernel.Plugin
compareTo, execute, getAppLanguage, getDescription, getOwner, getPluginsDir, getSummary, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, readFile, setDescription, setSummary
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER_NO

public static final int FILTER_NO
No filter.

See Also:
Constant Field Values

FILTER_FILE

public static final int FILTER_FILE
Only the files in the current directory.

See Also:
Constant Field Values

FILTER_FILE_REC

public static final int FILTER_FILE_REC
Only the files in the current directory and sub-directories.

See Also:
Constant Field Values

FILTER_DIR

public static final int FILTER_DIR
Only the directories in the current directory.

See Also:
Constant Field Values

FILTER_DIR_REC

public static final int FILTER_DIR_REC
Only the directories in the current directory and sub-directories.

See Also:
Constant Field Values

FILTER_FILE_AND_DIR

public static final int FILTER_FILE_AND_DIR
Only the files and directories in the current directory.

See Also:
Constant Field Values
Method Detail

getSearch

public String getSearch()
Returns the content of the Search field.

Returns:
the content of the Search field

getReplace

public String getReplace()
Returns the content of the Replace by field.

Returns:
the content of the Replace by field

getText

public String getText()
Returns the current text to process.

Returns:
the current text

getSelectedText

public String getSelectedText()
Returns the selected text.

Returns:
the selected text

getDir

public File getDir()
Returns the current directory or null if there is no.

Returns:
the current directory or null if there is no

getOldFiles

public String[] getOldFiles(int filter)
Returns the list of the old files in the same order than printed on the screen, or null if empty. The filter can be FILTER_NO, FILTER_FILE, FILTER_FILE_REC, FILTER_DIR, FILTER_DIR_REC or FILTER_FILE_AND_DIR.

Returns:
the list of the old files, or null if empty

getNewFiles

public String[] getNewFiles()
Returns the list of the new files in the same order than printed on the screen, or null if empty.

Returns:
the list of the new files, or null if empty

getFlags

public int getFlags()
Returns an integer in which each bit codes a flag. To know what flags are ticked off, use the AND function. For example, ((getFlags() & Pattern.CANON_EQ) > 0) returns true if the CANON_EQ flag is ticked off.

Returns:
an integer in which each bit codes a flag

getFlagsAsLiteral

public String getFlagsAsLiteral()
Returns the literal form of the flags like (?ixu), or "" if no flags is ticked off. Note that there is not literal form for the CANON_EQ flag.

Returns:
the literal form of the flags

getFlagsAsString

public String getFlagsAsString()
Returns a String containing the names of all the ticked flags. For example, (getFlagsAsString().indexOf("CANON_EQ") > -1) returns true if the CANON_EQ flag is ticked off.

Returns:
a String containing the names of all the ticked flags

isCANON_EQ

public boolean isCANON_EQ()
Indicates whether the CANON_EQ flag is ticked off.

Returns:
true if CANON_EQ is ticked off; false otherwise

isCASE_INSENSITIVE

public boolean isCASE_INSENSITIVE()
Indicates whether the CASE_INSENSITIVE flag is ticked off.

Returns:
true if CASE_INSENSITIVE is ticked off; false otherwise

isCOMMENTS

public boolean isCOMMENTS()
Indicates whether the COMMENTS flag is ticked off.

Returns:
true if COMMENTS is ticked off; false otherwise

isUNICODE_CASE

public boolean isUNICODE_CASE()
Indicates whether the UNICODE_CASE flag is ticked off.

Returns:
true if UNICODE_CASE is ticked off; false otherwise

setSearch

public void setSearch(String text)
Sets the content of the Search field.

Parameters:
text - the content of the Search field

setReplace

public void setReplace(String text)
Sets the content of the Replace by field.

Parameters:
text - the content of the Replace by field

setCANON_EQ

public void setCANON_EQ(boolean b)
Ticks or unticks the CANON_EQ flag.

Parameters:
b - true to tick the flag; false to untick the flag

setCASE_INSENSITIVE

public void setCASE_INSENSITIVE(boolean b)
Ticks or unticks the CASE_INSENSITIVE flag.

Parameters:
b - true to tick the flag; false to untick the flag

setCOMMENTS

public void setCOMMENTS(boolean b)
Ticks or unticks the COMMENTS flag.

Parameters:
b - true to tick the flag; false to untick the flag

setUNICODE_CASE

public void setUNICODE_CASE(boolean b)
Ticks or unticks the UNICODE_CASE flag.

Parameters:
b - true to tick the flag; false to untick the flag