1 19 20 package org.netbeans.modules.websvc.wsitconf.ui; 21 22 import org.openide.util.NbBundle; 23 import org.openide.windows.TopComponent; 24 25 import java.awt.*; 26 27 30 public class ErrorTopComponent extends TopComponent { 31 32 static final long serialVersionUID=6021472310161712674L; 33 private boolean initialized = false; 34 35 private String error = ""; 36 37 public ErrorTopComponent(String error) { 38 this.error = error; 39 setLayout(new BorderLayout()); 40 } 41 42 @Override 43 protected String preferredID(){ 44 return "WSITTopComponent"; } 46 47 50 private void doInitialize() { 51 initAccessibility(); 52 add(new ErrorJPanel(error)); 53 setFocusable(true); 54 } 55 56 @Override 57 public int getPersistenceType() { 58 return TopComponent.PERSISTENCE_ALWAYS; 59 } 60 61 private void initAccessibility(){ 62 getAccessibleContext().setAccessibleDescription( 63 NbBundle.getMessage(ErrorTopComponent.class, "ACS_Tab_DESC")); } 65 66 69 @Override 70 public void addNotify() { 71 if (!initialized) { 72 initialized = true; 73 doInitialize(); 74 } 75 super.addNotify(); 76 } 77 78 90 @Override 91 protected void componentShowing() { 92 if (!initialized) { 93 initialized = true; 94 doInitialize(); 95 } 96 super.componentShowing(); 97 } 98 99 } 100 101 | Popular Tags |