Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.jdt.actions
Class RegexFindDialog  view RegexFindDialog download RegexFindDialog.java

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended bycom.port80.eclipse.jdt.actions.RegexFindDialog

public class RegexFindDialog
extends org.eclipse.jface.dialogs.Dialog


Nested Class Summary
private  class RegexFindDialog.ElementLoader
          Since TableViewer.getItems() and TableItem.getText() requires to run in the display thread, table entries are loaded in the contructor for now instead of in the thread.run().
private  class RegexFindDialog.StatusReporter
           
 
Nested classes inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
private static boolean DEBUG
           
private  boolean fAbort
           
private  int fAnchor
           
private  org.eclipse.swt.widgets.Button fButtonFind
           
private  org.eclipse.swt.widgets.Button fButtonFindBackward
           
private  org.eclipse.swt.widgets.Button fButtonSelectAll
           
private  org.eclipse.swt.widgets.Button fCaseSensitive
           
private  org.eclipse.swt.graphics.Color fColorBlack
           
private  org.eclipse.swt.graphics.Color fColorRed
           
private static RegexFindDialog fDefault
           
private  java.util.List fElements
           
private  boolean fError
           
private  int fFound
           
private  org.eclipse.jface.viewers.LabelProvider fLabelProvider
           
private  java.lang.String[] fLabels
           
private  boolean fLoaded
           
private  org.eclipse.swt.widgets.Combo fPattern
           
private static java.util.List fPatterns
           
private static org.apache.oro.text.perl.Perl5Util fReEngine
           
private  int fStart
           
private  org.eclipse.swt.widgets.Label fStatus
           
private  org.eclipse.jface.viewers.Viewer fViewer
           
private static org.eclipse.swt.graphics.Point fWindowPosition
           
private static int MAX_PERSISTENT
           
private static java.lang.String NAME
           
private static int STATUS_PERIOD
           
private static int WIDTH
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
private RegexFindDialog(org.eclipse.swt.widgets.Shell parentShell)
          Constructor for RegexReplaceDialog.
 
Method Summary
(package private)  void actionClose()
           
(package private)  void actionFind()
           
(package private)  void actionFindBackward()
           
(package private)  void actionSelectAll()
           
protected  void constrainShellSize()
          Constrain the shell size to be no larger than the display bounds.
protected  org.eclipse.swt.widgets.Control createButtonBar(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the contents of this dialog's button bar.
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
          The Dialog implementation of this Window method creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size.
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the contents of the upper part of this dialog (above the button bar).
(package private)  void dispose()
           
private  boolean find(java.lang.String pat, int start)
           
private  boolean findBackward(java.lang.String pat, int start)
           
private  int findSelectedElement(org.eclipse.jface.viewers.Viewer viewer)
           
static RegexFindDialog getDefault(org.eclipse.swt.widgets.Shell shell, org.eclipse.jface.viewers.AbstractTreeViewer viewer)
           
static RegexFindDialog getDefault(org.eclipse.swt.widgets.Shell shell, org.eclipse.jface.viewers.TableViewer viewer)
           
private  void getElements(org.eclipse.jface.viewers.AbstractTreeViewer viewer, org.eclipse.jface.viewers.ITreeContentProvider provider, java.lang.Object[] parents, java.util.List ret)
           
(package private)  org.eclipse.swt.widgets.Label getStatus()
           
private  void init(org.eclipse.jface.viewers.Viewer viewer)
           
(package private)  void load(org.eclipse.jface.viewers.AbstractTreeViewer viewer, org.eclipse.jface.viewers.IStructuredSelection selection)
           
(package private)  void load(org.eclipse.jface.viewers.TableViewer viewer, org.eclipse.jface.viewers.IStructuredSelection selection)
           
(package private)  void loadCompleted()
           
(package private)  void patternChanged(org.eclipse.swt.events.ModifyEvent event)
           
private  void savePattern(java.lang.String pat)
           
private  void setEnableActions(boolean enable)
           
private  void setSelection(int index)
           
private  void setSelections(com.port80.util.struct.IntList a)
           
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

MAX_PERSISTENT

private static final int MAX_PERSISTENT
See Also:
Constant Field Values

STATUS_PERIOD

private static final int STATUS_PERIOD
See Also:
Constant Field Values

WIDTH

private static final int WIDTH
See Also:
Constant Field Values

fDefault

private static RegexFindDialog fDefault

fWindowPosition

private static org.eclipse.swt.graphics.Point fWindowPosition

fPatterns

private static java.util.List fPatterns

fReEngine

private static org.apache.oro.text.perl.Perl5Util fReEngine

fViewer

private org.eclipse.jface.viewers.Viewer fViewer

fElements

private java.util.List fElements

fLabels

private java.lang.String[] fLabels

fLabelProvider

private org.eclipse.jface.viewers.LabelProvider fLabelProvider

fStart

private int fStart

fFound

private int fFound

fAnchor

private int fAnchor

fAbort

private boolean fAbort

fLoaded

private boolean fLoaded

fError

private boolean fError

fPattern

private org.eclipse.swt.widgets.Combo fPattern

fButtonFind

private org.eclipse.swt.widgets.Button fButtonFind

fButtonFindBackward

private org.eclipse.swt.widgets.Button fButtonFindBackward

fButtonSelectAll

private org.eclipse.swt.widgets.Button fButtonSelectAll

fCaseSensitive

private org.eclipse.swt.widgets.Button fCaseSensitive

fStatus

private org.eclipse.swt.widgets.Label fStatus

fColorRed

private org.eclipse.swt.graphics.Color fColorRed

fColorBlack

private org.eclipse.swt.graphics.Color fColorBlack
Constructor Detail

RegexFindDialog

private RegexFindDialog(org.eclipse.swt.widgets.Shell parentShell)
Constructor for RegexReplaceDialog.

Method Detail

getDefault

public static RegexFindDialog getDefault(org.eclipse.swt.widgets.Shell shell,
                                         org.eclipse.jface.viewers.AbstractTreeViewer viewer)

getDefault

public static RegexFindDialog getDefault(org.eclipse.swt.widgets.Shell shell,
                                         org.eclipse.jface.viewers.TableViewer viewer)

init

private void init(org.eclipse.jface.viewers.Viewer viewer)

dispose

void dispose()

loadCompleted

void loadCompleted()

findSelectedElement

private int findSelectedElement(org.eclipse.jface.viewers.Viewer viewer)

constrainShellSize

protected void constrainShellSize()
Description copied from class: org.eclipse.jface.window.Window
Constrain the shell size to be no larger than the display bounds.


createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.dialogs.Dialog
The Dialog implementation of this Window method creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size. It then calls the createDialogArea and createButtonBar methods to create the dialog area and button bar, respectively. Overriding createDialogArea and createButtonBar are recommended rather than overriding this method.


createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.dialogs.Dialog
Creates and returns the contents of the upper part of this dialog (above the button bar).

The Dialog implementation of this framework method creates and returns a new Composite with standard margins and spacing.

The returned control's layout data must be an instance of GridData. This method must not modify the parent's layout.

Subclasses must override this method but may call super as in the following example:

 Composite composite = (Composite) super.createDialogArea(parent);
 //add controls to composite as necessary
 return composite;
 


createButtonBar

protected org.eclipse.swt.widgets.Control createButtonBar(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.dialogs.Dialog
Creates and returns the contents of this dialog's button bar.

The Dialog implementation of this framework method lays out a button bar and calls the createButtonsForButtonBar framework method to populate it. Subclasses may override.

The returned control's layout data must be an instance of GridData.


setEnableActions

private void setEnableActions(boolean enable)

savePattern

private void savePattern(java.lang.String pat)

find

private boolean find(java.lang.String pat,
                     int start)

findBackward

private boolean findBackward(java.lang.String pat,
                             int start)

setSelections

private void setSelections(com.port80.util.struct.IntList a)

setSelection

private void setSelection(int index)

getStatus

org.eclipse.swt.widgets.Label getStatus()

actionClose

void actionClose()

actionSelectAll

void actionSelectAll()

actionFind

void actionFind()

actionFindBackward

void actionFindBackward()

patternChanged

void patternChanged(org.eclipse.swt.events.ModifyEvent event)

load

void load(org.eclipse.jface.viewers.AbstractTreeViewer viewer,
          org.eclipse.jface.viewers.IStructuredSelection selection)

load

void load(org.eclipse.jface.viewers.TableViewer viewer,
          org.eclipse.jface.viewers.IStructuredSelection selection)

getElements

private void getElements(org.eclipse.jface.viewers.AbstractTreeViewer viewer,
                         org.eclipse.jface.viewers.ITreeContentProvider provider,
                         java.lang.Object[] parents,
                         java.util.List ret)