|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun * Microsystems, Inc. All Rights Reserved. */ /* * ConfigBeanNode.java * * Created on August 15, 2001, 4:29 PM */ package org.netbeans.modules.j2ee.deployment.config.ui; import org.openide.ErrorManager; import org.openide.nodes.*; import org.openide.util.HelpCtx; import org.openide.util.actions.*; import org.netbeans.modules.j2ee.deployment.config.*; import org.netbeans.modules.j2ee.deployment.plugins.api.DConfigBeanProperties; import java.util.*; import java.beans.*; import java.awt.Image; import java.awt.Component; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import javax.enterprise.deploy.spi.DConfigBean; /** * * @author gfink * @author Jeri Lockhart * @version */ public class ConfigBeanNode extends AbstractNode { final ConfigBeanStorage bean; final BeanInfo info; final DConfigBeanProperties extraProps; public ConfigBeanNode(ConfigBeanStorage bean) { super(new ConfigChildren(bean)); this.bean = bean; info = ConfigUtils.createBeanInfo(bean.getConfigBean()); extraProps = bean.getStorage().getServer().getDConfigBeanProperties(bean.getConfigBean()); bean.addChildrenChangeListener((ConfigChildren) getChildren()); } public void updateKeys() { ((ConfigChildren)getChildren()).updateKeys(); } public void updateKey(Object key) { ((ConfigChildren)getChildren()).updateKey(key); } public String getDisplayName() { if(extraProps != null) return extraProps.getDisplayName(); if(info == null) return bean.getClass().toString(); return info.getBeanDescriptor().getDisplayName(); } private static final javax.swing.Action[] EMPTY_ACTIONS = new javax.swing.Action[0]; public javax.swing.Action[] getActions(boolean context) { return EMPTY_ACTIONS; } public HelpCtx getHelpCtx() { if(extraProps != null) { String helpId = extraProps.getHelpId(); if(helpId != null) return new HelpCtx(helpId); } return HelpCtx.DEFAULT_HELP; } public Image getIcon(int type) { if(info != null) { Image icon = info.getIcon(type); if(icon != null) return icon; } return super.getIcon(type); } public Image getOpenedIcon(int type) { if(info != null) { Image icon = info.getIcon(type); if(icon != null) return icon; } return super.getOpenedIcon(type); } public Sheet createSheet() { Sheet ret = new Sheet(); Sheet.Set set = ConfigUtils.createSheet(bean); set.setName(getDisplayName()); ret.put(set); return ret; } public DConfigBean getBean() { return bean.getConfigBean(); } /** Get the customizer. * @return |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.