KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ErrorViewPart


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal;
12
13 import org.eclipse.core.runtime.IStatus;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.internal.part.StatusPart;
16 import org.eclipse.ui.part.ViewPart;
17
18 /**
19  * This part is shown instead the views with errors.
20  *
21  * @since 3.3
22  */

23 public class ErrorViewPart extends ViewPart {
24
25     private IStatus error;
26
27     /**
28      * Creates instance of the class
29      */

30     public ErrorViewPart() {
31     }
32
33     /**
34      * Creates instance of the class
35      */

36     public ErrorViewPart(IStatus error) {
37         this.error = error;
38     }
39
40     /*
41      * (non-Javadoc)
42      *
43      * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
44      */

45     public void createPartControl(Composite parent) {
46         if (error != null) {
47             new StatusPart(parent, error);
48         }
49     }
50
51     /*
52      * (non-Javadoc)
53      *
54      * @see org.eclipse.ui.part.ViewPart#setPartName(java.lang.String)
55      */

56     public void setPartName(String JavaDoc newName) {
57         super.setPartName(newName);
58     }
59
60     /*
61      * (non-Javadoc)
62      *
63      * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
64      */

65     public void setFocus() {
66     }
67
68 }
69
Popular Tags