Package com.iizigo.prop
Class PasteFeedback
- java.lang.Object
- com.iizigo.prop.PasteFeedback
- Direct Known Subclasses:
PasteFeedback.DropValidationFeedback
public class PasteFeedback extends java.lang.Object
Paste feed-back. This class is returned in response to the Designer Property Paste operation in order to provide visual feed-back on the operation, typically if the operation is allowed (if Paste was requested without perform the actual paste) or successful (if performed).The error message is set when the operation cannot be performed or failed. The feed-back members indicate how the operation would take place or has taken place.
- Author:
- Christopher Mindus
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PasteFeedback.DropValidationFeedback
Specialized class for validation "paste" where drop could take place in multiple places, e.g.
Field Summary
Fields Modifier and Type Field Description static PasteFeedback
ERR_ELEMENT_READ_ONLY
Standard error: "Element is read-only".static PasteFeedback
ERR_FILE_NOT_LOADED
Standard error: "Unsupported operation: file is not loaded".static PasteFeedback
ERR_INVALID_OPERATION
Standard error: "Invalid operation".static PasteFeedback
ERR_TARGET_DOES_NOT_SUPPORT_OPERATION
Standard error: "Target does not support operation".static PasteFeedback
ERR_TARGET_READ_ONLY
Standard error: "Target is read-only".int
feedBack
Feed-back value, -1 for not defined.static int
FEEDBACK_CANCELED_BY_USER
Feed-back for operation canceled by user due to e.g.static int
FEEDBACK_LINK_WITH_TARGET
Feed-back for link instead of paste with selected target.static int
FEEDBACK_PASTE_AFTER_TARGET_IN_PARENT
Feed-back for paste into selected container's parent after the target.static int
FEEDBACK_PASTE_BEFORE_TARGET_IN_PARENT
Feed-back for paste into selected container's parent before the target.static int
FEEDBACK_PASTE_IN_TARGET
Feed-back for paste into selected target container (non-index based target container).static int
FEEDBACK_PASTE_IN_TARGET_FOLDER
Feed-back for paste into selected container's folder parent (resource based).static int
FEEDBACK_VALID_DROPS
Feed-back for valid drops.java.lang.String
message
Error message, null indicates no error.static PasteFeedback
OK_CANCELED_BY_USER
Success: operation canceled by user due to e.g.static PasteFeedback
OK_LINK_WITH_TARGET
Success: link with target: feedBack = FEEDBACK_LINK_WITH_TARGET.static PasteFeedback
OK_PASTE_AFTER_TARGET_IN_PARENT
Success: paste after target in target parent: feedBack = FEEDBACK_AFTER_TARGET_IN_PARENT.static PasteFeedback
OK_PASTE_BEFORE_TARGET_IN_PARENT
Success: paste before target in target parent: feedBack = FEEDBACK_BEFORE_TARGET_IN_PARENT.static PasteFeedback
OK_PASTE_IN_TARGET
Success: paste in target: feedBack = FEEDBACK_IN_TARGET.static PasteFeedback
OK_PASTE_IN_TARGET_FOLDER
Success: paste in target folder: feedBack = FEEDBACK_IN_TARGET_FOLDER.org.eclipse.core.runtime.IStatus
status
Potential status code, if originating from a status, otherwise null.
Constructor Summary
Constructors Constructor Description PasteFeedback(java.lang.String message)
Constructor for paste not allowed or error in paste.PasteFeedback(org.eclipse.core.runtime.IStatus status)
Constructor for error message from status.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.core.runtime.IStatus
getStatus()
Gets a status out of the feed-back.boolean
isOK()
Checks for OK, i.e.protected java.lang.String
paramString()
Param-string is overridden in super classes.java.lang.String
toString()
Shows as string for debug.
Field Detail
ERR_TARGET_DOES_NOT_SUPPORT_OPERATION
public static final PasteFeedback ERR_TARGET_DOES_NOT_SUPPORT_OPERATION
Standard error: "Target does not support operation".
ERR_INVALID_OPERATION
public static final PasteFeedback ERR_INVALID_OPERATION
Standard error: "Invalid operation".
ERR_TARGET_READ_ONLY
public static final PasteFeedback ERR_TARGET_READ_ONLY
Standard error: "Target is read-only".
ERR_ELEMENT_READ_ONLY
public static final PasteFeedback ERR_ELEMENT_READ_ONLY
Standard error: "Element is read-only".
ERR_FILE_NOT_LOADED
public static final PasteFeedback ERR_FILE_NOT_LOADED
Standard error: "Unsupported operation: file is not loaded".
FEEDBACK_PASTE_IN_TARGET
public static final int FEEDBACK_PASTE_IN_TARGET
Feed-back for paste into selected target container (non-index based target container).- See Also:
- Constant Field Values
FEEDBACK_PASTE_IN_TARGET_FOLDER
public static final int FEEDBACK_PASTE_IN_TARGET_FOLDER
Feed-back for paste into selected container's folder parent (resource based).- See Also:
- Constant Field Values
FEEDBACK_PASTE_BEFORE_TARGET_IN_PARENT
public static final int FEEDBACK_PASTE_BEFORE_TARGET_IN_PARENT
Feed-back for paste into selected container's parent before the target.- See Also:
- Constant Field Values
FEEDBACK_PASTE_AFTER_TARGET_IN_PARENT
public static final int FEEDBACK_PASTE_AFTER_TARGET_IN_PARENT
Feed-back for paste into selected container's parent after the target.- See Also:
- Constant Field Values
FEEDBACK_LINK_WITH_TARGET
public static final int FEEDBACK_LINK_WITH_TARGET
Feed-back for link instead of paste with selected target.- See Also:
- Constant Field Values
FEEDBACK_CANCELED_BY_USER
public static final int FEEDBACK_CANCELED_BY_USER
Feed-back for operation canceled by user due to e.g. dialog boxes.- See Also:
- Constant Field Values
FEEDBACK_VALID_DROPS
public static final int FEEDBACK_VALID_DROPS
Feed-back for valid drops.- See Also:
- Constant Field Values
OK_PASTE_IN_TARGET
public static final PasteFeedback OK_PASTE_IN_TARGET
Success: paste in target: feedBack = FEEDBACK_IN_TARGET.
OK_PASTE_IN_TARGET_FOLDER
public static final PasteFeedback OK_PASTE_IN_TARGET_FOLDER
Success: paste in target folder: feedBack = FEEDBACK_IN_TARGET_FOLDER.
OK_PASTE_BEFORE_TARGET_IN_PARENT
public static final PasteFeedback OK_PASTE_BEFORE_TARGET_IN_PARENT
Success: paste before target in target parent: feedBack = FEEDBACK_BEFORE_TARGET_IN_PARENT.
OK_PASTE_AFTER_TARGET_IN_PARENT
public static final PasteFeedback OK_PASTE_AFTER_TARGET_IN_PARENT
Success: paste after target in target parent: feedBack = FEEDBACK_AFTER_TARGET_IN_PARENT.
OK_LINK_WITH_TARGET
public static final PasteFeedback OK_LINK_WITH_TARGET
Success: link with target: feedBack = FEEDBACK_LINK_WITH_TARGET.
OK_CANCELED_BY_USER
public static final PasteFeedback OK_CANCELED_BY_USER
Success: operation canceled by user due to e.g. dialog boxes.
message
public final java.lang.String message
Error message, null indicates no error.
status
public final org.eclipse.core.runtime.IStatus status
Potential status code, if originating from a status, otherwise null.
feedBack
public final int feedBack
Feed-back value, -1 for not defined.
Constructor Detail
PasteFeedback
public PasteFeedback(org.eclipse.core.runtime.IStatus status) throws java.lang.IllegalArgumentException
Constructor for error message from status. If status isOK(), this method will cause IllegalArgumentException!- Throws:
java.lang.IllegalArgumentException
- If status.isOK() is true.
PasteFeedback
public PasteFeedback(java.lang.String message)
Constructor for paste not allowed or error in paste.
Method Detail
isOK
public boolean isOK()
Checks for OK, i.e. that message is null, status is OK or INFO.
getStatus
public org.eclipse.core.runtime.IStatus getStatus()
Gets a status out of the feed-back.
toString
public java.lang.String toString()
Shows as string for debug.- Overrides:
toString
in classjava.lang.Object
paramString
protected java.lang.String paramString()
Param-string is overridden in super classes.