KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > dialogs > ErrorPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 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.dialogs;
12
13 import org.eclipse.jface.resource.JFaceColors;
14 import org.eclipse.swt.SWT;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.swt.widgets.Text;
18 import org.eclipse.ui.internal.WorkbenchMessages;
19
20 /**
21  * A page that is used to indicate an error in loading a page within the
22  * workbench.
23  *
24  * @since 3.0
25  */

26 public class ErrorPreferencePage extends EmptyPreferencePage {
27
28     /*
29      * (non-Javadoc)
30      *
31      * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
32      */

33     protected Control createContents(Composite parent) {
34         Text text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
35         text.setForeground(JFaceColors.getErrorText(text.getDisplay()));
36         text.setBackground(text.getDisplay().getSystemColor(
37                 SWT.COLOR_WIDGET_BACKGROUND));
38         text.setText(WorkbenchMessages.ErrorPreferencePage_errorMessage);
39         return text;
40     }
41 }
42
Popular Tags