/* * Copyright (c) 2003, KNOPFLERFISH project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * - Neither the name of the KNOPFLERFISH project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.knopflerfish.service.desktop; import org.osgi.framework.BundleContext; import javax.swing.JComponent; import javax.swing.Icon; /** * * Interface for services wishing to become visible as components in * the desktop Swing window. * *
* The desktop window can be extended by new components, displaying * bundle details. To extend the desktop, create and register an instance * of SwingBundleDisplayer. *
** In fact, all internal views in the desktop bundle * are created by such services. *
* ** Additionally, displayers may provide an icon which will be displayed * next to the name/description. *
* ** The bundle selection is described by an BundleSelectionModel, * and displayer should be prepared to display different content * depending on which bundles are selected. To modify the selection * (and thus update all other registered displayers), use the * setSelection and clearSelection methods in the * BundleSelectionModel *
* ** Value is org.knopflerfish.service.desktop.displayer.name *
*/ public final static String PROP_NAME = "org.knopflerfish.service.desktop.displayer.name"; /** * Service Property (String) ** Value is org.knopflerfish.service.desktop.displayer.description *
*/ public final static String PROP_DESCRIPTION = "org.knopflerfish.service.desktop.displayer.description"; /** * Service Property (Boolean) ** Value is org.knopflerfish.service.desktop.displayer.isdetail *
*/ public final static String PROP_ISDETAIL = "org.knopflerfish.service.desktop.displayer.isdetail"; /** * Create the actual component that should be displayed. * ** New components must be created for each createJComponent * call. *
*/ public JComponent createJComponent(); /** * Perform any necessary cleanup operations. * * @param comp Component previously created by createJComponent */ public void disposeJComponent(JComponent comp); /** * @param model Selection model describing which bundles are * selected. The actual bundle list must be managed * by the displayer itself. */ public void setBundleSelectionModel(BundleSelectionModel model); /** * Get a large icon (48x48) for the displayer. * ** null can be returned if no icon is provided. *
*/ public Icon getLargeIcon(); /** * Get a smaller icon (22x22) for the displayer. * ** null can be returned if no icon is provided. *
*/ public Icon getSmallIcon(); /** * Allow access to another bundle context than the displayer's * own. This might be used to set a remote bundle context. * ** This method might never be called - the displayer should * in that case use its own context. The normal case is to start * with the displayer's own context and later switch to another * context. *
* *
* If