KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > plugin > AlertSection


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

11 /*
12  * Created on Feb 26, 2004
13  *
14  * To change the template for this generated file go to
15  * Window - Preferences - Java - Code Generation - Code and Comments
16  */

17 package org.eclipse.pde.internal.ui.editor.plugin;
18
19 import org.eclipse.pde.internal.ui.*;
20 import org.eclipse.pde.internal.ui.editor.*;
21 import org.eclipse.swt.widgets.*;
22 import org.eclipse.ui.*;
23 import org.eclipse.ui.forms.widgets.*;
24
25 /**
26  * @author dejan
27  *
28  * To change the template for this generated type comment go to
29  * Window - Preferences - Java - Code Generation - Code and Comments
30  */

31 public class AlertSection extends PDESection {
32     private FormText text;
33     private String JavaDoc noItemsText = PDEPlugin.getResourceString("AlertSection.default.noAlerts"); //$NON-NLS-1$
34
/**
35      * @param page
36      * @param parent
37      * @param style
38      */

39     public AlertSection(PDEFormPage page, Composite parent) {
40         super(page, parent, Section.TWISTIE|Section.EXPANDED);
41         createClient(getSection(), page.getEditor().getToolkit());
42
43     }
44     /* (non-Javadoc)
45      * @see org.eclipse.pde.internal.ui.neweditor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
46      */

47     protected void createClient(Section section, FormToolkit toolkit) {
48         section.setText(PDEPlugin.getResourceString("AlertSection.title")); //$NON-NLS-1$
49
//toolkit.createCompositeSeparator(section);
50
text = toolkit.createFormText(section, true);
51         text.setImage("warning", PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); //$NON-NLS-1$
52
text.setImage("error", PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); //$NON-NLS-1$
53
section.setClient(text);
54     }
55     public void refresh() {
56         text.setText(getAlerts(), true, false);
57         super.refresh();
58     }
59     private String JavaDoc getAlerts() {
60         /*StringBuffer buf = new StringBuffer();
61         buf.append("<form>");
62         buf.append("<li style=\"image\" value=\"warning\"><a>This plug-in has a version that is not compatible with the target platform.</a></li>");
63         buf.append("<li style=\"image\" value=\"warning\"><a>This plug-in does not have build.properties file and cannot be deployed properly.</a></li>");
64         buf.append("<li style=\"image\" value=\"error\"><a>You realize, of course, that coding in this plug-in is pretty pathetic, don't you?</a></li>");
65         buf.append("</form>");
66         return buf.toString();*/

67         return noItemsText;
68     }
69 }
Popular Tags