1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.netbeans.modules.office.loader; 25 26 import java.awt.Image; 27 import java.beans.*; 28 29 import org.openide.ErrorManager; 30 import org.openide.util.NbBundle; 31 import org.openide.util.Utilities; 32 33 public class OfficeDocumentDataLoaderBeanInfo extends SimpleBeanInfo { 34 35 // If you have additional properties: 36 /* 37 public PropertyDescriptor[] getPropertyDescriptors() { 38 try { 39 PropertyDescriptor myProp = new PropertyDescriptor("myProp", OfficeDocumentDataLoader.class); 40 myProp.setDisplayName(NbBundle.getMessage(OfficeDocumentDataLoaderBeanInfo.class, "PROP_myProp")); 41 myProp.setShortDescription(NbBundle.getMessage(OfficeDocumentDataLoaderBeanInfo.class, "HINT_myProp")); 42 return new PropertyDescriptor[] {myProp}; 43 } catch (IntrospectionException ie) { 44 ErrorManager.getDefault().notify(ie); 45 return null; 46 } 47 } 48 */ 49 getAdditionalBeanInfo()50 public BeanInfo[] getAdditionalBeanInfo() { 51 try { 52 // I.e. MultiFileLoader.class or UniFileLoader.class. 53 return new BeanInfo[] {Introspector.getBeanInfo(OfficeDocumentDataLoader.class.getSuperclass())}; 54 } catch (IntrospectionException ie) { 55 ErrorManager.getDefault().notify(ie); 56 return null; 57 } 58 } 59 getIcon(int type)60 public Image getIcon(int type) { 61 if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { 62 return Utilities.loadImage("org/openoffice/netbeans/modules/office/resources/OfficeIcon.gif"); 63 } else { 64 return Utilities.loadImage("org/openoffice/netbeans/modules/office/resources/OfficeIcon32.gif"); 65 } 66 } 67 68 } 69