1 19 20 package org.netbeans.modules.welcome.content; 21 22 import java.awt.event.ActionEvent ; 23 import javax.swing.Action ; 24 25 29 public class SampleProjectLink extends LinkButton { 30 31 private String category; 32 private String template; 33 34 35 public SampleProjectLink( String category, String template, String title ) { 36 super( title, true ); 37 this.category = category; 38 this.template = template; 39 getAccessibleContext().setAccessibleName( title ); 40 getAccessibleContext().setAccessibleDescription( 41 BundleSupport.getAccessibilityDescription( "SampleProject", title ) ); 42 } 43 44 public void actionPerformed( ActionEvent e ) { 45 Action sampleProject = Utils.createSampleProjectAction(); 46 if( null != sampleProject ) { 47 if( null != category && category.trim().length() == 0 ) { 48 category = null; 49 } 50 sampleProject.putValue( "PRESELECT_CATEGORY", category ); 52 if( null != template && template.trim().length() == 0 ) { 53 template = null; 54 } 55 sampleProject.putValue( "PRESELECT_TEMPLATE", template ); 57 sampleProject.actionPerformed( e ); 58 } 59 } 60 } 61 | Popular Tags |