1 21 22 package com.izforge.izpack.panels; 23 24 import java.awt.LayoutManager2 ; 25 import java.util.ArrayList ; 26 27 import javax.swing.JLabel ; 28 29 import com.izforge.izpack.Info; 30 import com.izforge.izpack.gui.IzPanelLayout; 31 import com.izforge.izpack.gui.LabelFactory; 32 import com.izforge.izpack.gui.LayoutConstants; 33 import com.izforge.izpack.installer.InstallData; 34 import com.izforge.izpack.installer.InstallerFrame; 35 import com.izforge.izpack.installer.IzPanel; 36 37 42 public class HelloPanel extends IzPanel 43 { 44 45 48 private static final long serialVersionUID = 3257848774955905587L; 49 50 56 public HelloPanel(InstallerFrame parent, InstallData idata) 57 { 58 this(parent, idata, new IzPanelLayout()); 59 } 60 61 70 71 public HelloPanel(InstallerFrame parent, InstallData idata, LayoutManager2 layout) 72 { 73 super(parent, idata, layout); 80 String str; 82 str = parent.langpack.getString("HelloPanel.welcome1") + idata.info.getAppName() + " " 83 + idata.info.getAppVersion() + parent.langpack.getString("HelloPanel.welcome2"); 84 JLabel welcomeLabel = LabelFactory.create(str, parent.icons.getImageIcon("host"), LEADING); 85 add(welcomeLabel, NEXT_LINE); 89 add(IzPanelLayout.createParagraphGap()); 96 97 ArrayList authors = idata.info.getAuthors(); 98 int size = authors.size(); 99 if (size > 0) 100 { 101 str = parent.langpack.getString("HelloPanel.authors"); 102 JLabel appAuthorsLabel = LabelFactory.create(str, parent.icons 103 .getImageIcon("information"), LEADING); 104 add(appAuthorsLabel, LayoutConstants.NEXT_LINE); 114 115 JLabel label; 116 for (int i = 0; i < size; i++) 117 { 118 Info.Author a = (Info.Author) authors.get(i); 119 String email = (a.getEmail() != null && a.getEmail().length() > 0) ? (" <" 120 + a.getEmail() + ">") : ""; 121 label = LabelFactory.create(" - " + a.getName() + email, parent.icons 122 .getImageIcon("empty"), LEADING); 123 add(label, NEXT_LINE); 124 } 125 add(IzPanelLayout.createParagraphGap()); 126 } 127 128 if (idata.info.getAppURL() != null) 129 { 130 str = parent.langpack.getString("HelloPanel.url") + idata.info.getAppURL(); 131 JLabel appURLLabel = LabelFactory.create(str, parent.icons.getImageIcon("bookmark"), 132 LEADING); 133 add(appURLLabel, LayoutConstants.NEXT_LINE); 134 } 135 getLayoutHelper().completeLayout(); 137 } 138 139 144 public boolean isValidated() 145 { 146 return true; 147 } 148 } 149 | Popular Tags |