1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 package org.netbeans.modules.xml.api.scenario; 20 21 /** 22 * <p> 23 * A ScenarioFactory creates scenarios of particular type, describes it and 24 * decides if that scenario type should be available for a particular DataObject type. 25 * A Scenario implementation is always constructed using a ScenarioFactory. 26 * The toString() method of a ScenarioFactory implementation should return the 27 * name of the scenario type created by this factory. 28 * </p> 29 * <p> 30 * A ScenarioFactory should be registered in XML layers at the folder, 31 * Plugins->XML->ScenarioFactories, like seen below. 32 * </p> 33 * <pre> 34 * <folder name="Plugins"> 35 * <folder name="XML"> 36 * <folder name="ScenarioFactories"> 37 * <file name="org-netbeans-modules-xsl-scenario-FileXSLScenarioFactory.instance"/> 38 * </folder> 39 * </folder> 40 * </folder> 41 * </pre> 42 * 43 * @author asgeir@dimonsoftware.com 44 * @deprecated Experimantal SPI 45 */ 46 public interface ScenarioFactory { 47 48 /** 49 * Creates a new scenario using this Factory. 50 * @return a newly constructed Scenario. 51 */ 52 Scenario createScenario(); 53 54 /** 55 * Get the name of the scenario type created by this Factory. 56 * @return The name of the scenario type created by this Factory. 57 */ 58 String getName(); //getDisplayName() 59 60 /** 61 * Get a more detailed describtion of the scenario type created by this factory. 62 * @return The describtion of the scenario type created by this factory. 63 */ 64 String getDescription(); 65 66 /** 67 * Decides if the scenario type created by this factory is allowed 68 * for this DataObject 69 * @param dataObject The DataObject which should be tested for this Factory. 70 * @return true if this factory should be allowed for that DataObject. 71 */ 72 boolean isEnabled(org.openide.loaders.DataObject dataObject); 73 74 /** @link dependency 75 * @label creates*/ 76 /*#Scenario lnkScenario;*/ 77 } 78