|
|||||||||
| Home >> All >> com >> port80 >> eclipse >> jdt >> [ actions overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.port80.eclipse.jdt.actions
Class RegexReplaceDialog

java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
com.port80.eclipse.jdt.actions.RegexReplaceDialog
- public class RegexReplaceDialog
- extends org.eclipse.jface.dialogs.Dialog
| Nested Class Summary | |
private class |
RegexReplaceDialog.PatternChanged
|
| Nested classes inherited from class org.eclipse.jface.window.Window |
org.eclipse.jface.window.Window.IExceptionHandler |
| 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 |
RegexReplaceDialog(org.eclipse.swt.widgets.Shell parentShell,
org.eclipse.ui.texteditor.ITextEditor editor)
Constructor for RegexReplaceDialog. |
| Method Summary | |
(package private) void |
actionClose()
|
(package private) void |
actionFind()
|
(package private) void |
actionHistoryPrev()
|
(package private) void |
actionReplaceAll()
|
(package private) void |
actionReplaceClose()
|
(package private) void |
actionReplaceFind()
|
(package private) int |
adjustOffset(java.lang.String pat,
java.lang.StringBuffer buf)
Adjust fOffset after replace. |
private void |
appendHistory(int offset,
int len)
|
boolean |
close()
Closes this window, disposes its shell, and removes this window from its window manager (if it has one). |
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). |
void |
dispose()
|
private java.lang.String |
escapeReplaceString(java.lang.String s)
|
(package private) boolean |
find(java.lang.String pat,
java.lang.String opt)
|
(package private) boolean |
find1(java.lang.String pat,
java.lang.String opt)
A simplified version of find() for actionReplaceAll to avoid accessing UI, eg. |
private java.lang.String |
fixPatternForReplace(java.lang.String s)
Since we perfrom replace on the matched string of the previous find action, the leading look behind and trailing look ahead are not included in the matched string. |
static RegexReplaceDialog |
getDefault(org.eclipse.swt.widgets.Shell shell,
org.eclipse.ui.texteditor.ITextEditor editor)
|
(package private) org.eclipse.ui.texteditor.ITextEditor |
getEditor()
|
(package private) java.lang.String |
getSearchOptions()
|
(package private) void |
init(org.eclipse.ui.texteditor.ITextEditor editor)
|
(package private) void |
patternChanged(org.eclipse.swt.events.ModifyEvent event)
|
(package private) boolean |
replace(java.lang.String pat,
java.lang.String replace,
java.lang.String opt,
java.lang.StringBuffer buf)
|
(package private) void |
replaceAllDone(java.lang.StringBuffer buf,
int[] offset,
int[] replaced)
|
private void |
savePattern(java.lang.String pat)
|
private void |
saveReplace(java.lang.String replace)
|
(package private) void |
setEnableFind(boolean enable)
|
(package private) void |
setEnablePrev(boolean b)
|
(package private) void |
setEnableReplace(boolean enable)
|
private int |
skipTill(char delim,
java.lang.String s,
int start)
|
private boolean |
wrap()
|
| 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
WIDTH
private static final int WIDTH
- See Also:
- Constant Field Values
fDefault
private static RegexReplaceDialog fDefault
fWindowPosition
private static org.eclipse.swt.graphics.Point fWindowPosition
fPatterns
private static java.util.List fPatterns
fReplaces
private static java.util.List fReplaces
fReEngine
private static org.apache.oro.text.perl.Perl5Util fReEngine
fParent
private org.eclipse.swt.widgets.Shell fParent
fEditor
private org.eclipse.ui.texteditor.ITextEditor fEditor
fDoc
private org.eclipse.jface.text.IDocument fDoc
fMatchInput
org.apache.oro.text.regex.PatternMatcherInput fMatchInput
fStart
int fStart
fEnd
org.eclipse.jface.text.Position fEnd
fOffset
int fOffset
fAnchor
int fAnchor
fLastReplaced
int fLastReplaced
fHistory
com.port80.util.struct.IntList fHistory
fPatternChangedHandler
RegexReplaceDialog.PatternChanged fPatternChangedHandler
isWrapped
boolean isWrapped
fReplaceAllRunning
boolean fReplaceAllRunning
fPattern
private org.eclipse.swt.widgets.Combo fPattern
fReplace
private org.eclipse.swt.widgets.Combo fReplace
fButtonReplaceAll
private org.eclipse.swt.widgets.Button fButtonReplaceAll
fButtonReplaceClose
private org.eclipse.swt.widgets.Button fButtonReplaceClose
fButtonRelaceFind
private org.eclipse.swt.widgets.Button fButtonRelaceFind
fButtonFind
private org.eclipse.swt.widgets.Button fButtonFind
fButtonPrev
private org.eclipse.swt.widgets.Button fButtonPrev
fButtonNext
private org.eclipse.swt.widgets.Button fButtonNext
fSingleLine
private org.eclipse.swt.widgets.Button fSingleLine
fCaseSensitive
private org.eclipse.swt.widgets.Button fCaseSensitive
fButtonClose
private org.eclipse.swt.widgets.Button fButtonClose
fStatus
private org.eclipse.swt.widgets.Label fStatus
| Constructor Detail |
RegexReplaceDialog
private RegexReplaceDialog(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.ui.texteditor.ITextEditor editor)
- Constructor for RegexReplaceDialog.
| Method Detail |
getDefault
public static RegexReplaceDialog getDefault(org.eclipse.swt.widgets.Shell shell, org.eclipse.ui.texteditor.ITextEditor editor)
dispose
public void dispose()
init
void init(org.eclipse.ui.texteditor.ITextEditor editor)
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
Dialogimplementation of thisWindowmethod 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 thecreateDialogAreaandcreateButtonBarmethods to create the dialog area and button bar, respectively. OverridingcreateDialogAreaandcreateButtonBarare 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
Dialogimplementation of this framework method creates and returns a newCompositewith 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
superas 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
Dialogimplementation of this framework method lays out a button bar and calls thecreateButtonsForButtonBarframework method to populate it. Subclasses may override.The returned control's layout data must be an instance of
GridData.
close
public boolean close()
- Description copied from class:
org.eclipse.jface.window.Window - Closes this window, disposes its shell, and removes this
window from its window manager (if it has one).
This framework method may be extended (
super.closemust be called).
getEditor
org.eclipse.ui.texteditor.ITextEditor getEditor()
setEnableFind
void setEnableFind(boolean enable)
setEnableReplace
void setEnableReplace(boolean enable)
setEnablePrev
void setEnablePrev(boolean b)
find
boolean find(java.lang.String pat, java.lang.String opt)
find1
boolean find1(java.lang.String pat, java.lang.String opt)
- A simplified version of find() for actionReplaceAll to avoid accessing UI, eg. fStatus.
replace
boolean replace(java.lang.String pat, java.lang.String replace, java.lang.String opt, java.lang.StringBuffer buf)
appendHistory
private void appendHistory(int offset,
int len)
actionClose
void actionClose()
actionFind
void actionFind()
actionReplaceFind
void actionReplaceFind()
actionReplaceClose
void actionReplaceClose()
actionReplaceAll
void actionReplaceAll()
replaceAllDone
void replaceAllDone(java.lang.StringBuffer buf, int[] offset, int[] replaced)
actionHistoryPrev
void actionHistoryPrev()
getSearchOptions
java.lang.String getSearchOptions()
patternChanged
void patternChanged(org.eclipse.swt.events.ModifyEvent event)
savePattern
private void savePattern(java.lang.String pat)
saveReplace
private void saveReplace(java.lang.String replace)
wrap
private boolean wrap()
adjustOffset
int adjustOffset(java.lang.String pat, java.lang.StringBuffer buf)
- Adjust fOffset after replace. If 'pat' ends with '$' and current offset is at end of line,
advance fOffset to next line.
fixPatternForReplace
private java.lang.String fixPatternForReplace(java.lang.String s)
- Since we perfrom replace on the matched string of the previous find action,
the leading look behind and trailing look ahead are not included in the matched string.
Have to adjust the pattern for that. Since the pattern is already matched, the
zero-width pattern is not actually required, we just remove them from the pattern.
NOTE: As of jarkata-oro-2.0.6, it do not support look behind yet.
skipTill
private int skipTill(char delim,
java.lang.String s,
int start)
escapeReplaceString
private java.lang.String escapeReplaceString(java.lang.String s)
|
|||||||||
| Home >> All >> com >> port80 >> eclipse >> jdt >> [ actions overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC