1 package net.suberic.util.gui.propedit; 2 3 public class PropertyValueVetoException extends Exception { 4 5 String propertyName; 6 String rejectedValue; 7 String reason; 8 PropertyEditorListener listener; 9 String message = null; 10 11 14 public PropertyValueVetoException(String pProperty, String pRejectedValue, String pReason, PropertyEditorListener pListener) { 15 propertyName = pProperty; 16 rejectedValue = pRejectedValue; 17 reason = pReason; 18 listener = pListener; 19 } 20 21 24 public PropertyValueVetoException(String pMessage) { 25 message = pMessage; 26 } 27 28 31 public String getProperty() { 32 return propertyName; 33 } 34 35 38 public String getRejectedValue() { 39 return rejectedValue; 40 } 41 42 45 public String getReason() { 46 return reason; 47 } 48 49 52 public PropertyEditorListener getListener() { 53 return listener; 54 } 55 56 59 public String getMessage() { 60 if (message == null) 61 return "Error changing value " + getProperty() + " to '" + getRejectedValue() + "': " + getReason(); 62 else 63 return message; 64 } 65 } 66 | Popular Tags |