1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 package com.sun.star.wizards.web;
24 
25 import com.sun.star.awt.VclWindowPeerAttribute;
26 
27 /**
28  * @author rpiterman
29  *
30  * To change the template for this generated type comment go to
31  * Window>Preferences>Java>Code Generation>Code and Comments
32  */
33 public interface ErrorHandler
34 {
35 
36     public static final String MESSAGE_INFO = "infobox";
37     public static final String MESSAGE_QUESTION = "querybox";
38     public static final String MESSAGE_ERROR = "errorbox";
39     public static final String MESSAGE_WARNING = "warningbox";
40     public static int BUTTONS_OK = VclWindowPeerAttribute.OK;
41     public static int BUTTONS_OK_CANCEL = VclWindowPeerAttribute.OK_CANCEL;
42     public static int BUTTONS_YES_NO = VclWindowPeerAttribute.YES_NO;
43     public static int RESULT_CANCEL = 0;
44     public static int RESULT_OK = 1;
45     public static int RESULT_YES = 2;
46     public static int DEF_OK = VclWindowPeerAttribute.DEF_OK;
47     public static int DEF_CANCEL = VclWindowPeerAttribute.DEF_CANCEL;
48     public static int DEF_YES = VclWindowPeerAttribute.DEF_YES;
49     public static int DEF_NO = VclWindowPeerAttribute.DEF_NO;
50     /**
51      * Error type for fatal errors which should abort application
52      * execution. Should actually never be used :-)
53      */
54     public static final int ERROR_FATAL = 0;
55     /**
56      * An Error type for errors which should stop the current process.
57      */
58     public static final int ERROR_PROCESS_FATAL = 1;
59     /**
60      * An Error type for errors to which the user can choose, whether
61      * to continue or to abort the current process.
62      * default is abort.
63      */
64     public static final int ERROR_NORMAL_ABORT = 2;
65     /**
66      * An Error type for errors to which the user can choose, whether
67      * to continue or to abort the current process.
68      * default is continue.
69      */
70     public static final int ERROR_NORMAL_IGNORE = 3;
71     /**
72      * An error type for warnings which requires user interaction.
73      * (a question :-) )
74      * Default is abort (cancel).
75      */
76     public static final int ERROR_QUESTION_CANCEL = 4;
77     /**
78      * An error type for warnings which requires user interaction
79      * (a question :-) )
80      * Default is to continue (ok).
81      */
82     public static final int ERROR_QUESTION_OK = 5;
83     /**
84      * An error type for warnings which requires user interaction.
85      * (a question :-) )
86      * Default is abort (No).
87      */
88     public static final int ERROR_QUESTION_NO = 6;
89     /**
90      * An error type for warnings which requires user interaction
91      * (a question :-) )
92      * Default is to continue (Yes).
93      */
94     public static final int ERROR_QUESTION_YES = 7;
95     /**
96      * An error type which is just a warning...
97      */
98     public static final int ERROR_WARNING = 8;
99     /**
100      * An error type which just tells the user something
101      * ( like "you look tired! you should take a bath! and so on)
102      */
103     public static final int ERROR_MESSAGE = 9;
104 
105     /**
106      * @param ex the exception that accured
107      * @param arg an object as help for recognizing the exception
108      * @param ix an integer which helps for detailed recognizing of the exception
109      * @param errorType one of the int constants defined by this Interface
110      * @return true if the execution should continue, false if it should stop.
111      */
error(Exception ex, Object arg, int ix, int errorType)112     public boolean error(Exception ex, Object arg, int ix, int errorType);
113 }
114