|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.rse.ui.dialogs.SystemPromptDialog
org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog
public class SystemRenameSingleDialog
Dialog for renaming a single resource. Used when only one item selected.
This is a re-usable dialog that you can use directly, or via the SystemCommonRenameAction
action.
To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed.
If those objects adapt to ISystemRemoteElementAdapter
or
ISystemRemoteElementAdapter
, the dialog will offer built-in error checking.
If the input object does not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you
should call setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)
to
specify a validator that is called to verify the user-typed new name is valid. Further, to show the type value
of the input object, it should implement ISystemTypedObject
.
This dialog does not do the actual renames. Rather, it will return the user-typed new name. This is
queriable via getNewName()
, after testing that SystemPromptDialog.wasCancelled()
is false.
SystemCommonRenameAction
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window |
---|
Window.IExceptionHandler |
Field Summary | |
---|---|
static boolean |
COLLISION_MODE
|
Fields inherited from class org.eclipse.jface.dialogs.Dialog |
---|
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, 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 | |
---|---|
SystemRenameSingleDialog(Shell shell)
Constructor |
|
SystemRenameSingleDialog(Shell shell,
boolean copyCollisionMode,
Object inputObject,
ISystemValidator nameValidator)
Constructor with an input object and validator This constructor is in copy/move dialogs when there is a collision |
|
SystemRenameSingleDialog(Shell shell,
boolean copyCollisionMode,
Object inputObject,
ISystemValidator nameValidator,
List nameInUse)
Constructor with an input object and validator This constructor is in copy/move dialogs when there is a collision |
|
SystemRenameSingleDialog(Shell shell,
String title)
Constructor with a title |
Method Summary | |
---|---|
protected boolean |
checkIfWillBeFilteredOut(Object remoteObject,
String newName)
If renaming a remote object, which is listed in a tree view under an expanded filter, this tests to see if the rename will cause that object to suddenly not meet the filtering criteria of the parent filter, and hence disappear. |
protected Control |
createInner(Composite parent)
Called by createContents method. |
protected ISystemMessageLine |
createMessageLine(Composite c)
Create message line. |
boolean |
getCopyCollisionMode()
Query if this dialog is the result of a copy/move name collision. |
String |
getDescription()
|
protected Control |
getInitialFocusControl()
Return the Control to be given initial focus. |
protected Object |
getInputElement(Object inputObject)
Returns the selected element given the current input, which is an IStructuredSelection. |
String |
getNewName()
Returns the user-entered new name |
String[] |
getNewNameArray()
Returns the user-entered new name as an array for convenience to ISystemRenameTarget hosts. |
protected ISystemRemoteElementAdapter |
getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. |
protected ValidatorUniqueString |
getUniqueNameValidator(Object inputElement,
ISystemValidator nameValidator)
Given an input element and externally-suppplied name validator for it, determine if we need to augment that validator with one that will check for uniqueness, and if so create and return that uniqueness validator |
protected ISystemViewElementAdapter |
getViewAdapter(Object o)
Returns the implementation of ISystemViewElement for the given object. |
void |
handleEvent(Event e)
Handles events generated by controls on this page. |
boolean |
isPageComplete()
This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons. |
protected boolean |
processOK()
Called when user presses OK button. |
void |
run()
Runnable method |
void |
setCopyCollisionMode(boolean copyCollisionMode)
Indicate this dialog is the result of a copy/move name collision. |
void |
setDescription(String description)
|
void |
setInputObject(Object inputObject)
Override of parent. |
void |
setNameValidator(ISystemValidator nameValidator)
Set the validator for the new name,as supplied by the adaptor for name checking. |
void |
setPageComplete()
Inform caller of page-complete status of this form |
void |
setPromptLabel(String label,
String tooltip)
Set the label and tooltip of the prompt. |
static String |
trimTrailing(String text)
Trim leading blanks |
protected SystemMessage |
validateNameInput()
Called directly as user types. |
protected SystemMessage |
validateNameInput(String theNewName)
Called directly from verify. |
boolean |
verify()
Verifies all input. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean COLLISION_MODE
Constructor Detail |
---|
public SystemRenameSingleDialog(Shell shell)
public SystemRenameSingleDialog(Shell shell, String title)
public SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator)
shell
- The parent dialogcopyCollisionMode
- true if this is being called because of a name collision on a copy or move operationinputObject
- The object that is being renamed, or on a copy/move the object in the target container which already exists. Used to get the old name and the name validatornameValidator
- The name validator to use. Can be null, in which case it is queried from the adapter of the input objectpublic SystemRenameSingleDialog(Shell shell, boolean copyCollisionMode, Object inputObject, ISystemValidator nameValidator, List nameInUse)
shell
- The parent dialogcopyCollisionMode
- true if this is being called because of a name
collision on a copy or move operationinputObject
- The object that is being renamed, or on a copy/move
the object in the target container which already exists. Used
to get the old name and the name validatornameValidator
- The name validator to use. Can be null, in which
case it is queried from the adapter of the input objectnameInUse
- the List of names that have been previously selected for
other files that are to be renamed for multiple file renaming.Method Detail |
---|
public void setPromptLabel(String label, String tooltip)
public void setCopyCollisionMode(boolean copyCollisionMode)
public boolean getCopyCollisionMode()
public void setNameValidator(ISystemValidator nameValidator)
protected ISystemMessageLine createMessageLine(Composite c)
createMessageLine
in class SystemPromptDialog
protected Control getInitialFocusControl()
SystemPromptDialog
getInitialFocusControl
in class SystemPromptDialog
SystemPromptDialog.getInitialFocusControl()
protected Control createInner(Composite parent)
SystemPromptDialog
createInner
in class SystemPromptDialog
SystemPromptDialog.createInner(Composite)
public void setInputObject(Object inputObject)
setInputObject
in interface ISystemPromptDialog
setInputObject
in class SystemPromptDialog
public void run()
run
in interface Runnable
run
in class SystemPromptDialog
protected ValidatorUniqueString getUniqueNameValidator(Object inputElement, ISystemValidator nameValidator)
protected Object getInputElement(Object inputObject)
protected ISystemViewElementAdapter getViewAdapter(Object o)
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
protected boolean processOK()
processOK
in class SystemPromptDialog
public static String trimTrailing(String text)
public boolean verify()
protected boolean checkIfWillBeFilteredOut(Object remoteObject, String newName)
protected SystemMessage validateNameInput()
protected SystemMessage validateNameInput(String theNewName)
public boolean isPageComplete()
public void setPageComplete()
public String getNewName()
public String[] getNewNameArray()
public void setDescription(String description)
setDescription
in interface IDialogPage
setDescription
in class SystemPromptDialog
public String getDescription()
getDescription
in interface IDialogPage
getDescription
in class SystemPromptDialog
public void handleEvent(Event e)
SystemPromptDialog
handleEvent
in interface Listener
handleEvent
in class SystemPromptDialog
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |