01: /*******************************************************************************
02: * Copyright (c) 2005, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.core.runtime.IStatus;
13: import org.eclipse.swt.widgets.Composite;
14: import org.eclipse.ui.internal.part.StatusPart;
15: import org.eclipse.ui.part.ViewPart;
16:
17: /**
18: * This part is shown instead the views with errors.
19: *
20: * @since 3.3
21: */
22: public class ErrorViewPart extends ViewPart {
23:
24: private IStatus error;
25:
26: /**
27: * Creates instance of the class
28: */
29: public ErrorViewPart() {
30: }
31:
32: /**
33: * Creates instance of the class
34: */
35: public ErrorViewPart(IStatus error) {
36: this .error = error;
37: }
38:
39: /*
40: * (non-Javadoc)
41: *
42: * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
43: */
44: public void createPartControl(Composite parent) {
45: if (error != null) {
46: new StatusPart(parent, error);
47: }
48: }
49:
50: /*
51: * (non-Javadoc)
52: *
53: * @see org.eclipse.ui.part.ViewPart#setPartName(java.lang.String)
54: */
55: public void setPartName(String newName) {
56: super .setPartName(newName);
57: }
58:
59: /*
60: * (non-Javadoc)
61: *
62: * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
63: */
64: public void setFocus() {
65: }
66:
67: }
|