1 11 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 31 public class AlertSection extends PDESection { 32 private FormText text; 33 private String noItemsText = PDEPlugin.getResourceString("AlertSection.default.noAlerts"); 39 public AlertSection(PDEFormPage page, Composite parent) { 40 super(page, parent, Section.TWISTIE|Section.EXPANDED); 41 createClient(getSection(), page.getEditor().getToolkit()); 42 43 } 44 47 protected void createClient(Section section, FormToolkit toolkit) { 48 section.setText(PDEPlugin.getResourceString("AlertSection.title")); text = toolkit.createFormText(section, true); 51 text.setImage("warning", PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); text.setImage("error", PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); section.setClient(text); 54 } 55 public void refresh() { 56 text.setText(getAlerts(), true, false); 57 super.refresh(); 58 } 59 private String getAlerts() { 60 67 return noItemsText; 68 } 69 } | Popular Tags |