1 19 20 package org.netbeans.modules.xml.multiview; 21 22 27 public class Error { 28 29 public static final int TYPE_FATAL=0; 30 public static final int TYPE_WARNING=1; 31 32 public static final int ERROR_MESSAGE=0; 33 public static final int WARNING_MESSAGE=1; 34 public static final int MISSING_VALUE_MESSAGE=2; 35 public static final int DUPLICATE_VALUE_MESSAGE=3; 36 37 private int errorType; 38 private int severityLevel; 39 private String errorMessage; 40 private javax.swing.JComponent focusableComponent; 41 private ErrorLocation errorLocation; 42 43 55 public Error(int errorType, String errorMessage, javax.swing.JComponent focusableComponent) { 56 this(TYPE_WARNING ,errorType, errorMessage, focusableComponent); 57 } 58 59 public Error(int severityLevel, int errorType, String errorMessage, javax.swing.JComponent focusableComponent) { 60 this.severityLevel=severityLevel; 61 this.errorType=errorType; 62 this.errorMessage=errorMessage; 63 this.focusableComponent=focusableComponent; 64 } 65 66 public Error(int errorType, String errorMessage, ErrorLocation errorLocation) { 67 this(TYPE_WARNING,errorType, errorMessage, errorLocation); 68 } 69 70 public Error(int severityLevel, int errorType, String errorMessage, ErrorLocation errorLocation) { 71 this.severityLevel=severityLevel; 72 this.errorType=errorType; 73 this.errorMessage=errorMessage; 74 this.errorLocation=errorLocation; 75 } 76 77 public int getSeverityLevel() { 78 return severityLevel; 79 } 80 81 public int getErrorType() { 82 return errorType; 83 } 84 85 public String getErrorMessage() { 86 return errorMessage; 87 } 88 89 public javax.swing.JComponent getFocusableComponent() { 90 return focusableComponent; 91 } 92 93 public ErrorLocation getErrorLocation() { 94 return errorLocation; 95 } 96 97 public boolean isEditError() { 98 return (focusableComponent!=null); 99 } 100 101 104 public static class ErrorLocation { 105 private Object key; 106 private String componentId; 107 108 public ErrorLocation (Object key, String componentId) { 109 this.key=key; 110 this.componentId=componentId; 111 } 112 113 public Object getKey() { 114 return key; 115 } 116 public String getComponentId() { 117 return componentId; 118 } 119 } 120 121 } 122 | Popular Tags |