View Javadoc

1   /*
2    * Created on May 10, 2005, Copyright UC Regents
3    */
4   package org.telscenter.pas.steps;
5   
6   import java.awt.Image;
7   import java.beans.BeanDescriptor;
8   import java.beans.BeanInfo;
9   import java.beans.IntrospectionException;
10  import java.beans.Introspector;
11  import java.beans.PropertyDescriptor;
12  import java.beans.SimpleBeanInfo;
13  
14  import org.telscenter.pas.beans.PasStep;
15  import org.telscenter.pas.steps.icons.PasStepIconProvider;
16  
17  /***
18   * BeanInfo for Pas step type, <i>BrowseWeb</i>.
19   * 
20   * @author turadg
21   */
22  public class BrowseWebBeanInfo extends SimpleBeanInfo {
23  
24  	public BeanInfo[] getAdditionalBeanInfo() {
25  		try {
26  			BeanInfo[] additional = new BeanInfo[2];
27  			additional[0] = Introspector.getBeanInfo(PasStep.class);
28  			additional[1] = Introspector.getBeanInfo(AbstractUrlStep.class);
29  			return additional;
30  		} catch (Exception e) {
31  			return super.getAdditionalBeanInfo();
32  		}
33  	}
34  
35  	public Image getIcon(int iconKind) {
36  		return PasStepIconProvider.getIcon("web", iconKind); //$NON-NLS-1$
37  	}
38  
39  	public BeanDescriptor getBeanDescriptor() {
40  		BeanDescriptor d = new BeanDescriptor(BrowseWeb.class);
41  		d.setShortDescription(Messages.getString("BrowseWebBeanInfo.1")); //$NON-NLS-1$
42  		return d;
43  	}
44  
45  	public PropertyDescriptor[] getPropertyDescriptors() {
46  		try {
47  			PropertyDescriptor[] d = new PropertyDescriptor[2];
48  			d[0] = new PropertyDescriptor("navigationPolicy", BrowseWeb.class); //$NON-NLS-1$
49  			d[0].setDisplayName("Navigation Policy");
50  			d[0].setShortDescription("Where the learner is allowed to go");
51  			d[1] = new PropertyDescriptor("content", BrowseWeb.class); //$NON-NLS-1$
52  			d[1].setDisplayName("content");
53  			d[1].setShortDescription("content");
54  			return d;
55  		} catch (IntrospectionException e) {
56  			// TODO Auto-generated catch block
57  			return null;
58  		}
59  	}
60  
61  }