This commit was manufactured by cvs2svn to create branch 'PDE_XML_Compare'.
Sprout from master 2006-01-30 08:06:21 UTC Wassim Melhem <wmelhem> '*** empty log message ***'
Delete:
ui/org.eclipse.pde.core/.classpath
ui/org.eclipse.pde.core/.cvsignore
ui/org.eclipse.pde.core/.options
ui/org.eclipse.pde.core/.project
ui/org.eclipse.pde.core/.settings/org.eclipse.jdt.core.prefs
ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
ui/org.eclipse.pde.core/about.html
ui/org.eclipse.pde.core/build.properties
ui/org.eclipse.pde.core/component.xml
ui/org.eclipse.pde.core/plugin.properties
ui/org.eclipse.pde.core/plugin.xml
ui/org.eclipse.pde.core/schema/javadoc.exsd
ui/org.eclipse.pde.core/schema/source.exsd
ui/org.eclipse.pde.core/schema/targetProfiles.exsd
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IBaseModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditableModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IIdentifiable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangeProvider.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedEvent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedListener.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProvider.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderEvent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderListener.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ISourceObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IWritable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ModelChangedEvent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuild.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildEntry.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensions.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragment.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragmentModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IMatchRules.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginAttribute.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtension.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtensionPoint.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginImport.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginLibrary.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginParent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginReference.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedExtensionsModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedPluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/AbstractModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BinaryRepositoryProvider.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EclipseHomeInitializer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EntryFileAdapter.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExecutionEnvironmentAnalyzer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExtensionsHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalFeatureModelManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchClasspathContainer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchInitializer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalModelManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelDelta.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureTable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FileAdapter.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ICoreConstants.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IEnvironmentVariables.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelDelta.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelListener.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFileAdapterFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangeProviderExtension.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangedListenerFilter.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IPluginModelListener.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavaElementChangeListener.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavadocLocationManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelEntry.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelProviderEvent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/NLResourceHelper.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEClasspathContainer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECore.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPluginConverter.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEState.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEStateHelper.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PlatformConfiguration.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelDelta.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginPathFinder.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredDependencyManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsClasspathContainer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsInitializer.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ResourceExtender.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SearchablePluginsManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocation.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocationManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetPlatform.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetProfileManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/WorkspaceModelManager.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLDefaultHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLPrintHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/Build.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildEntry.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/ExternalBuildModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/IBuildObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/WorkspaceBuildModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/Bundle.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragmentModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/WorkspaceBundleModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/AbstractFeatureModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/ExternalFeatureModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/Feature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureChild.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureData.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureImport.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInstallHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURL.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURLElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/IdentifiableObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/VersionableObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundle.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragment.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragmentModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelProvider.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IManifestHeader.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IEnvironment.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureChild.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureData.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureImport.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInstallHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURL.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURLElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IVersionable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IAboutInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IArgumentsInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IConfigurationFileInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IIntroInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ILauncherInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProduct.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductPlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ISplashInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IWindowImages.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IDocumentSection.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaAttribute.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchema.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttribute.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttributeProvider.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaComplexType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaCompositor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaDescriptor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaEnumeration.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaInclude.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObjectReference.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRepeatable.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRestriction.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRootElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaSimpleType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISite.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteArchive.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategoryDefinition.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteDescription.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IAdditionalLocation.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IArgumentsInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IEnvironmentInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IImplicitDependenciesInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ILocationInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITarget.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetJRE.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetPlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensions.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensionsModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractPluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AttributeChangedEvent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Extensions.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalFragmentModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Fragment.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/IdentifiablePluginObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ImportObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Plugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginAttribute.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtension.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtensionPoint.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginHandler.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginImport.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginLibrary.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginParent.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginReference.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceExtensionsModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceFragmentModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModelBase.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/AboutInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ConfigurationFileInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/IntroInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/LauncherInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/Product.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductPlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/SplashInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WindowImages.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WorkspaceProductModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/ChoiceRestriction.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/DocumentSection.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/EditableSchema.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/IncludedSchemaDescriptor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/RepeatableSchemaObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/Schema.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaAttribute.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaComplexType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaCompositor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaDescriptor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElementReference.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaEnumeration.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaInclude.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRegistry.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRootElement.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaSimpleType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaType.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/StorageSchemaDescriptor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/IPluginSearchResultCollector.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginJavaSearchUtil.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchInput.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchOperation.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchScope.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/AbstractSiteModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/ExternalSiteModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/IdentifiableObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/Site.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteArchive.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategoryDefinition.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteDescription.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/VersionableObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/WorkspaceSiteModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/AdditionalDirectory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ArgumentsInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/EnvironmentInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ImplicitDependenciesInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/LocationInfo.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/Target.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetFeature.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetJRE.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModelFactory.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetObject.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPlugin.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/WorkspaceTargetModel.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/IdUtil.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PatternConstructor.java
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PropertiesUtil.java
ui/org.eclipse.pde.core/targets/rcp.target
ui/org.eclipse.pde.core/targets/rcpWithSource.target
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/AbstractEditingModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentHandler.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentTextNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentAttribute.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentKey.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentRange.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentTextNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IEditingModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IReconcilingParticipant.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/XMLEditingModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/Build.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildEntry.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModelFactory.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BasePackageHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/Bundle.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleActivatorHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleClasspathHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleLocalizationHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModelFactory.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleNameHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleSymbolicNameHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleTextChangeListener.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVendorHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVersionHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/CompositeManifestHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExecutionEnvironment.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageObject.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/FragmentHostHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/IModelTextChangeListener.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/LazyStartHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ManifestHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PDEManifestElement.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageFriend.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleObject.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequiredExecutionEnvironmentHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/SingleManifestHeader.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/AbstractPluginDocumentHandler.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/NodeOffsetHandler.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginAttribute.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginBaseNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentHandler.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNodeFactory.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginElementNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionPointNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginImportNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginLibraryNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModel.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModelBase.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginObjectNode.java
ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginParentNode.java
ui/org.eclipse.pde.junit.runtime/.classpath
ui/org.eclipse.pde.junit.runtime/.cvsignore
ui/org.eclipse.pde.junit.runtime/.project
ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.jdt.core.prefs
ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.pde.prefs
ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF
ui/org.eclipse.pde.junit.runtime/about.html
ui/org.eclipse.pde.junit.runtime/build.properties
ui/org.eclipse.pde.junit.runtime/plugin.properties
ui/org.eclipse.pde.junit.runtime/plugin.xml
ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/CoreTestApplication.java
ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java
ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java
ui/org.eclipse.pde.runtime/.classpath
ui/org.eclipse.pde.runtime/.cvsignore
ui/org.eclipse.pde.runtime/.project
ui/org.eclipse.pde.runtime/.settings/org.eclipse.jdt.core.prefs
ui/org.eclipse.pde.runtime/META-INF/MANIFEST.MF
ui/org.eclipse.pde.runtime/about.html
ui/org.eclipse.pde.runtime/build.properties
ui/org.eclipse.pde.runtime/icons/dlcl16/clear.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/collapseall.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/export_log.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/filter_ps.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/find_obj.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/import_log.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/open_log.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/properties.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/refresh.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/remove.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/restore_log.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/th_horizontal.gif
ui/org.eclipse.pde.runtime/icons/dlcl16/th_vertical.gif
ui/org.eclipse.pde.runtime/icons/elcl16/clear.gif
ui/org.eclipse.pde.runtime/icons/elcl16/collapseall.gif
ui/org.eclipse.pde.runtime/icons/elcl16/export_log.gif
ui/org.eclipse.pde.runtime/icons/elcl16/filter_ps.gif
ui/org.eclipse.pde.runtime/icons/elcl16/find_obj.gif
ui/org.eclipse.pde.runtime/icons/elcl16/import_log.gif
ui/org.eclipse.pde.runtime/icons/elcl16/open_log.gif
ui/org.eclipse.pde.runtime/icons/elcl16/properties.gif
ui/org.eclipse.pde.runtime/icons/elcl16/refresh.gif
ui/org.eclipse.pde.runtime/icons/elcl16/remove.gif
ui/org.eclipse.pde.runtime/icons/elcl16/restore_log.gif
ui/org.eclipse.pde.runtime/icons/elcl16/th_horizontal.gif
ui/org.eclipse.pde.runtime/icons/elcl16/th_vertical.gif
ui/org.eclipse.pde.runtime/icons/eview16/error_log.gif
ui/org.eclipse.pde.runtime/icons/eview16/event_next.gif
ui/org.eclipse.pde.runtime/icons/eview16/event_prev.gif
ui/org.eclipse.pde.runtime/icons/eview16/hide_pane.gif
ui/org.eclipse.pde.runtime/icons/eview16/horizontal_view.gif
ui/org.eclipse.pde.runtime/icons/eview16/registry.gif
ui/org.eclipse.pde.runtime/icons/eview16/vertical_view.gif
ui/org.eclipse.pde.runtime/icons/obj16/error_st_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/error_stack.gif
ui/org.eclipse.pde.runtime/icons/obj16/ext_point_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/ext_points_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/extension_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/extensions_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/generic_xml_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/info_st_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/java_lib_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/ok_st_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/plugin_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/req_plugin_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/req_plugins_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/runtime_obj.gif
ui/org.eclipse.pde.runtime/icons/obj16/warning_st_obj.gif
ui/org.eclipse.pde.runtime/icons/ovr16/run_co.gif
ui/org.eclipse.pde.runtime/plugin.properties
ui/org.eclipse.pde.runtime/plugin.xml
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/IHelpContextIds.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/OverlayIcon.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialogAction.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/FilterDialog.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogEntry.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogSession.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewContentProvider.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/OpenLogDialog.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/TailInputStream.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementAdapter.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionAdapter.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointAdapter.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/IPluginFolder.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/LibraryPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ParentAdapter.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginObjectAdapter.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PrerequisitePropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySource.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySourceFactory.java
ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/TogglePropertiesAction.java
ui/org.eclipse.pde.ui.tests/.classpath
ui/org.eclipse.pde.ui.tests/.cvsignore
ui/org.eclipse.pde.ui.tests/.project
ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.jdt.core.prefs
ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.pde.prefs
ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/AbstractStructuredCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/BooleanSelectionCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CheckCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ChoiceSelectionCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CommandTarget.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/EditorCommandTarget.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ExpansionCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/FocusCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IIndexHandler.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IPlayable.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IRecorderListener.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWidgetResolver.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWritable.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/KeyCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/Macro.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommandShell.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroIndex.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroInstruction.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroManager.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroPlugin.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroUtil.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ModifyCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/StructuredSelectionCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ToggleStructuredCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ViewCommandTarget.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WaitCommand.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WidgetIdentifier.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WindowCommandTarget.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WizardCommandTarget.java
ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/XMLDefaultHandler.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultIndexHandler.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultWidgetResolver.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexAction.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexPage.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexWizard.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/NewMacroWizard.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/PlaybackAction.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordAction.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordBlock.java
ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/StopAction.java
ui/org.eclipse.pde.ui.tests/about.html
ui/org.eclipse.pde.ui.tests/build.properties
ui/org.eclipse.pde.ui.tests/icons/external_tools.gif
ui/org.eclipse.pde.ui.tests/icons/run_exc.gif
ui/org.eclipse.pde.ui.tests/icons/sample.gif
ui/org.eclipse.pde.ui.tests/icons/suspend_co.gif
ui/org.eclipse.pde.ui.tests/icons/terminate_co.gif
ui/org.eclipse.pde.ui.tests/plugin.xml
ui/org.eclipse.pde.ui.tests/schema/macroSupport.exsd
ui/org.eclipse.pde.ui.tests/scripts/macro1.emc
ui/org.eclipse.pde.ui.tests/scripts/macro10.emc
ui/org.eclipse.pde.ui.tests/scripts/macro11.emc
ui/org.eclipse.pde.ui.tests/scripts/macro12.emc
ui/org.eclipse.pde.ui.tests/scripts/macro13.emc
ui/org.eclipse.pde.ui.tests/scripts/macro14.emc
ui/org.eclipse.pde.ui.tests/scripts/macro15.emc
ui/org.eclipse.pde.ui.tests/scripts/macro16.emc
ui/org.eclipse.pde.ui.tests/scripts/macro17.emc
ui/org.eclipse.pde.ui.tests/scripts/macro18.emc
ui/org.eclipse.pde.ui.tests/scripts/macro19.emc
ui/org.eclipse.pde.ui.tests/scripts/macro2.emc
ui/org.eclipse.pde.ui.tests/scripts/macro20.emc
ui/org.eclipse.pde.ui.tests/scripts/macro21.emc
ui/org.eclipse.pde.ui.tests/scripts/macro22.emc
ui/org.eclipse.pde.ui.tests/scripts/macro23.emc
ui/org.eclipse.pde.ui.tests/scripts/macro24.emc
ui/org.eclipse.pde.ui.tests/scripts/macro25.emc
ui/org.eclipse.pde.ui.tests/scripts/macro26.emc
ui/org.eclipse.pde.ui.tests/scripts/macro27.emc
ui/org.eclipse.pde.ui.tests/scripts/macro28.emc
ui/org.eclipse.pde.ui.tests/scripts/macro29.emc
ui/org.eclipse.pde.ui.tests/scripts/macro3.emc
ui/org.eclipse.pde.ui.tests/scripts/macro4.emc
ui/org.eclipse.pde.ui.tests/scripts/macro5.emc
ui/org.eclipse.pde.ui.tests/scripts/macro6.emc
ui/org.eclipse.pde.ui.tests/scripts/macro7.emc
ui/org.eclipse.pde.ui.tests/scripts/macro8.emc
ui/org.eclipse.pde.ui.tests/scripts/macro9.emc
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/Catalog.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/PDETestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/AllImportTests.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsBinaryTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsSourceTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportFeatureTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportWithLinksTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/InitializeModelsPerfTest.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/SchemaPerfTest.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/NewSiteProjectTest.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/AllNewFeatureProjectTests.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/FeatureWithPluginTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/SimpleFeatureTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/AllNewProjectTests.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/BasicJavaPluginTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/LibraryPluginTestCase.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/NewProjectTest.java
ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/SimplePluginTestCase.java
ui/org.eclipse.pde.ui.tests/test.xmldiff --git a/ui/org.eclipse.pde.core/.classpath b/ui/org.eclipse.pde.core/.classpath
deleted file mode 100644
index 6252a70..0000000
--- a/ui/org.eclipse.pde.core/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="text"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ui/org.eclipse.pde.core/.cvsignore b/ui/org.eclipse.pde.core/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/ui/org.eclipse.pde.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/.options b/ui/org.eclipse.pde.core/.options
deleted file mode 100644
index f4e020b..0000000
--- a/ui/org.eclipse.pde.core/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# prints the time taken to read/write registry cache.
-org.eclipse.pde.core/debug=true
-org.eclipse.pde.core/cache=false
-org.eclipse.pde.core/classpath=false
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/.project b/ui/org.eclipse.pde.core/.project
deleted file mode 100644
index ba6d66d..0000000
--- a/ui/org.eclipse.pde.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.pde.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/ui/org.eclipse.pde.core/.settings/org.eclipse.jdt.core.prefs b/ui/org.eclipse.pde.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 09740a8..0000000
--- a/ui/org.eclipse.pde.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,49 +0,0 @@
-#Wed Nov 23 18:49:41 EST 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
deleted file mode 100644
index d740fa6..0000000
--- a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,41 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %name
-Bundle-SymbolicName: org.eclipse.pde.core; singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Activator: org.eclipse.pde.internal.core.PDECore
-Bundle-Vendor: %provider-name
-Bundle-Localization: plugin
-Export-Package: org.eclipse.pde.core,
- org.eclipse.pde.core.build,
- org.eclipse.pde.core.plugin,
- org.eclipse.pde.internal.core;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.build;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.bundle;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.feature;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.ibundle;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.ifeature;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.iproduct;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.ischema;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.isite;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.itarget;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.plugin;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.product;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.schema;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.search;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.site;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.target;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.text;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.text.build;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.text.bundle;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.text.plugin;x-friends:="org.eclipse.pde,org.eclipse.pde.ui",
- org.eclipse.pde.internal.core.util;x-friends:="org.eclipse.pde,org.eclipse.pde.ui"
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.team.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.update.configurator;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.text;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)"
-Eclipse-LazyStart: true
diff --git a/ui/org.eclipse.pde.core/about.html b/ui/org.eclipse.pde.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/ui/org.eclipse.pde.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/build.properties b/ui/org.eclipse.pde.core/build.properties
deleted file mode 100644
index 9e92d98..0000000
--- a/ui/org.eclipse.pde.core/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.properties,\
- .,\
- plugin.xml,\
- about.html,\
- .options,\
- META-INF/,\
- targets/
-src.includes = about.html,\
- schema/
-output.. = bin/
-source.. = src/,\
- text/
diff --git a/ui/org.eclipse.pde.core/component.xml b/ui/org.eclipse.pde.core/component.xml
deleted file mode 100644
index b3672c2..0000000
--- a/ui/org.eclipse.pde.core/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="PDE"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.pde" fragment="false"/><plugin id="org.eclipse.pde.build" fragment="false"/><plugin id="org.eclipse.pde.core" fragment="false"/><plugin id="org.eclipse.pde.doc.user" fragment="false"/><plugin id="org.eclipse.pde.junit.runtime" fragment="false"/><plugin id="org.eclipse.pde.runtime" fragment="false"/><plugin id="org.eclipse.pde.source" fragment="false"/><plugin id="org.eclipse.pde.ui" fragment="false"/><package name="org.eclipse.pde.core" exclusive="false"><type name="IModelProvider" subclass="false" instantiate="false"/><type name="IIdentifiable"/><type name="IModel"/><type name="IModelChangeProvider"/><type name="IEditableModel"/><type name="ISourceObject"/><type name="IEditable"/><type name="ModelChangedEvent"/><type name="IBaseModel"/><type name="IModelChangedListener"/><type name="IModelChangedEvent"/><type name="IModelProviderEvent"/><type name="IModelProviderListener"/><type name="IWritable"/></package><package name="org.eclipse.pde.core.plugin" exclusive="false"><type name="ISharedPluginModel" subclass="false" instantiate="false"/><type name="IExtensionsModelFactory"/><type name="IExtensions"/><type name="IPluginModelBase"/><type name="IPluginElement"/><type name="IFragmentModel"/><type name="IPluginModel"/><type name="IPluginParent"/><type name="IExtensionsModel"/><type name="IPluginBase"/><type name="IPluginModelFactory"/><type name="IPluginAttribute"/><type name="IPluginObject"/><type name="IPluginExtensionPoint"/><type name="IPlugin"/><type name="IFragment"/><type name="IPluginExtension"/><type name="ISharedExtensionsModel"/><type name="IPluginLibrary"/><type name="IMatchRules"/><type name="IPluginImport"/><type name="IPluginReference"/></package><package name="org.eclipse.pde.core.build" exclusive="false"><type name="IBuildModel" subclass="false" instantiate="false"/><type name="IBuildEntry"/><type name="IBuild"/><type name="IBuildModelFactory"/></package><package name="org.eclipse.pde.ui" exclusive="false"><type name="IPluginFieldData" subclass="false" instantiate="false"/><type name="IExtensionEditorWizard"/><type name="IBasePluginWizard"/><type name="IPluginContentWizard"/><type name="IFragmentFieldData"/><type name="IFieldData"/><type name="IExtensionWizard"/></package><package name="org.eclipse.pde.ui.templates" exclusive="false"><type name="ITemplateSection" subclass="false" instantiate="false"/><type name="AbstractTemplateSection" implement="false" instantiate="false"/><type name="BooleanOption" implement="false" subclass="false"/><type name="TemplateField" implement="false" instantiate="false"/><type name="IVariableProvider" subclass="false" instantiate="false"/><type name="OptionTemplateSection" implement="false" instantiate="false"/><type name="ChoiceOption" implement="false" subclass="false"/><type name="AbstractNewPluginTemplateWizard" implement="false" instantiate="false"/><type name="BaseOptionTemplateSection" implement="false" instantiate="false"/><type name="NewPluginTemplateWizard" implement="false" instantiate="false"/><type name="OptionTemplateWizardPage" implement="false" subclass="false"/><type name="TemplateOption" implement="false" instantiate="false"/><type name="StringOption" implement="false" subclass="false"/></package></component>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/plugin.properties b/ui/org.eclipse.pde.core/plugin.properties
deleted file mode 100644
index e0fd577..0000000
--- a/ui/org.eclipse.pde.core/plugin.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# PDE Core plugin.xml resources
-#
-name = Plug-in Development Core
-provider-name = Eclipse.org
-
-expoint.source.name = Code Source Locations
-expoint.javadoc.name = Javadoc Locations
-expoint.target.name = Target Profiles
-
-environment.description.0 = Minimum environment to run the OSGi framework 1.0
-environment.description.1 = Minimum environment to run the OSGi framework 1.1
-environment.description.2 = Java Runtime Environment 1.1
-environment.description.3 = Java 2 Platform, Standard Edition 1.2
-environment.description.4 = Java 2 Platform, Standard Edition 1.3
-environment.description.5 = Java 2 Platform, Standard Edition 1.4
-environment.description.6 = Java 2 Platform, Standard Edition 5.0
-environment.description.7 = CDC 1.0, Foundation 1.0
-environment.description.8 = CDC 1.1, Foundation 1.1
-
-profile.name.0 = Base RCP (with Source)
-profile.name.1 = Base RCP (Binary Only)
-environment.description.9 = Java Platform, Standard Edition 6.0
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/plugin.xml b/ui/org.eclipse.pde.core/plugin.xml
deleted file mode 100644
index 1e9149d..0000000
--- a/ui/org.eclipse.pde.core/plugin.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="source" name="%expoint.source.name" schema="schema/source.exsd"/>
- <extension-point id="javadoc" name="%expoint.javadoc.name" schema="schema/javadoc.exsd"/>
- <extension-point id="targetProfiles" name="%expoint.target.name" schema="schema/targetProfiles.exsd"/>
-
- <extension
- point="org.eclipse.jdt.core.classpathVariableInitializer">
- <classpathVariableInitializer
- variable="ECLIPSE_HOME"
- class="org.eclipse.pde.internal.core.EclipseHomeInitializer">
- </classpathVariableInitializer>
- </extension>
- <extension
- point="org.eclipse.team.core.repository">
- <repository
- class="org.eclipse.pde.internal.core.BinaryRepositoryProvider"
- id="org.eclipse.pde.core.BinaryRepositoryProvider">
- </repository>
- </extension>
- <extension
- point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- class="org.eclipse.pde.internal.core.RequiredPluginsInitializer"
- id="org.eclipse.pde.core.requiredPlugins"/>
- <classpathContainerInitializer
- class="org.eclipse.pde.internal.core.ExternalJavaSearchInitializer"
- id="org.eclipse.pde.core.externalJavaSearch"/>
- </extension>
- <extension
- point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="ini">
- </fileTypes>
- <fileTypes
- type="text"
- extension="product">
- </fileTypes>
- </extension>
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- namespace="org.eclipse.pde.core"
- properties="PluginNature"
- type="org.eclipse.core.runtime.IAdaptable"
- class="org.eclipse.pde.internal.core.ResourceExtender"
- id="org.eclipse.pde.core.IResourceExtender">
- </propertyTester>
- </extension>
- <extension
- point="org.eclipse.jdt.launching.executionEnvironments">
- <environment
- id="OSGi/Minimum-1.0"
- description="%environment.description.0"/>
- <environment
- id="OSGi/Minimum-1.1"
- description="%environment.description.1"/>
- <environment
- id="JRE-1.1"
- description="%environment.description.2"/>
- <environment
- id="J2SE-1.2"
- description="%environment.description.3"/>
- <environment
- id="J2SE-1.3"
- description="%environment.description.4"/>
- <environment
- id="J2SE-1.4"
- description="%environment.description.5"/>
- <environment
- id="J2SE-1.5"
- description="%environment.description.6"/>
- <environment
- id="CDC-1.0/Foundation-1.0"
- description="%environment.description.7"/>
- <environment
- id="CDC-1.1/Foundation-1.1"
- description="%environment.description.8"/>
- <environment
- id="JavaSE-1.6"
- description="%environment.description.9"/>
- <analyzer
- class="org.eclipse.pde.internal.core.ExecutionEnvironmentAnalyzer"
- id="org.eclipse.pde.core.eeAnalyzer"/>
- </extension>
- <extension
- point="org.eclipse.pde.core.targetProfiles">
- <profile
- id="org.eclipse.pde.core.rcpWithSource"
- name="%profile.name.0"
- path="targets/rcpWithSource.target"/>
- <profile
- id="org.eclipse.pde.core.binaryRCP"
- name="%profile.name.1"
- path="targets/rcp.target"/>
- </extension>
-
-</plugin>
diff --git a/ui/org.eclipse.pde.core/schema/javadoc.exsd b/ui/org.eclipse.pde.core/schema/javadoc.exsd
deleted file mode 100644
index 7a3eef0..0000000
--- a/ui/org.eclipse.pde.core/schema/javadoc.exsd
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.pde.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.pde.core" id="javadoc" name="Javadoc Attachments"/>
- </appInfo>
- <documentation>
- This extension point associates plug-ins with the javadoc location of the code they contain. PDE uses these mappings to automatically attach javadoc to plug-in libraries when it computes a plug-in's classpath.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="javadoc" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="javadoc">
- <complexType>
- <sequence>
- <element ref="plugin" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="path" type="string" use="required">
- <annotation>
- <documentation>
- The <code>path</code> is a URL or a path that is relative to the plug-in declaring the extension.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="archive" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- an optional attribute indicating if the javadoc is located inside an archive. If not specified, the default is <code>false</code>. This attribute should be used only if the <code>path</code> attribute specifies a relative path. This attribute has no effect if the <code>path</code> attribute specifies a URL.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="plugin">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- the id of the plug-in whose javadoc location is specified by the <code>path</code> attribute
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.2
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of the <code>javadoc</code> extension:
-<pre>
- <extension point="org.eclipse.pde.core.javadoc">
- <javadoc path="doc.zip!/references/api/" archive="true"/>
- <plugin id="com.example.abc"/>
- <plugin id="com.example.def"/>
- </javadoc>
-
- <javadoc path="http://www.sample-url.org/doc/"/>
- <plugin id="com.example.ghi"/>
- </javadoc>
-
- <javadoc path="doc/"/>
- <plugin id="com.example.jkl"/>
- </javadoc>
- </extension>
-</pre>
-
-In this example, the javadoc for two plug-ins: <code>com.example.abc</code> and <code>com.example.xyz</code> have their javadoc located in a <code>references/api/</code> directory inside a <code>doc.zip</code> ZIP file in the plug-in declaring this extension.
-
-The javadoc for plug-in <code>com.example.ghi</code> is located at <code>http://www.sample-url.org/doc/</code>.
-
-The javadoc for plug-in <code>com.example.jkl</code> is located in directory <code>doc</code> relative to the location of the plug-in declaring this extension.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- No Java code is requied for this extension point.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- Eclipse SDK comes with ISV documentation plug-ins that use this extension point.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.
-<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which
-accompanies this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- </documentation>
- </annotation>
-
-</schema>
diff --git a/ui/org.eclipse.pde.core/schema/source.exsd b/ui/org.eclipse.pde.core/schema/source.exsd
deleted file mode 100644
index 4cc4580..0000000
--- a/ui/org.eclipse.pde.core/schema/source.exsd
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.pde.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.pde.core" id="source" name="Source Locations"/>
- </appInfo>
- <documentation>
- This extension point allows PDE to find source archives for libraries in Eclipse plug-ins found in an Eclipse-based product. It is used to contribute locations that contain source archives. These locations are expected to contain the same layout as the 'plugins' directory.
-<p>
-For each plug-in or fragment, a directory in the form {id}_{version} should exist. The content of the directory corresponds to the plug-in/fragment location. It should contain source code zip file in the form {library name}src.zip where library name is the name of the Java library that matches the source code. For JAR'd plug-ins and libraries named '.', the source zip file must be named simply <code>src.zip</code>.
-<p>
-In addition, it should contain any file or directory specified in the build.properties using <code>src.includes</code> variable.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="location" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="location">
- <complexType>
- <attribute name="path" type="string" use="required">
- <annotation>
- <documentation>
- the relative path of the directory in the contributing plug-in where source content is stored. The folder must contain one or more directories in the form {id}_{version} where <code>id</code> is a matching plug-in or fragment identifier and <code>version</code> is the matching plugin/fragment version. These directories in turn should contain source archives and any other file or folder specified using <code>source.includes</code> variable in build.properties file of the corresponding plug-in/fragment.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of the <code>source</code> extension:
-<pre>
- <extension point = "org.eclipse.pde.core.source">
- <location path="src"/>
- </extension>
-</pre>
-
-In the example above, the source location <code>src</code> in the contributing plug-in has been registered.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- No Java code is requied for this extension point.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- Eclipse SDK comes with source plug-ins that contain source information for all the plug-ins and fragments in Eclipse SDK.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2004 IBM Corporation and others.
-<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which
-accompanies this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- </documentation>
- </annotation>
-
-</schema>
diff --git a/ui/org.eclipse.pde.core/schema/targetProfiles.exsd b/ui/org.eclipse.pde.core/schema/targetProfiles.exsd
deleted file mode 100644
index 3d9c1b2..0000000
--- a/ui/org.eclipse.pde.core/schema/targetProfiles.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.pde.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.pde.core" id="targetProfiles" name="Target Profiles"/>
- </appInfo>
- <documentation>
- An extension point to define and register target profiles. PDE gives the user the ability to choose and switch between profiles. The main content of a target profile resides in a .target file. This file contains a list of plug-ins and/or features, the target environment, execution environment and launching arguments.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="profile" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="profile">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique identifier for the target profile
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a human readable name of the target profile
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="path" type="string" use="required">
- <annotation>
- <documentation>
- the relative path of the target profile definition file in the contributing plug-in.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.2
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of the <code>targetProfile</code> extension:
-<pre>
- <extension point = "org.eclipse.pde.core.targetProfile">
- <profile
- id="org.eclipse.pde.core.rcpProfile"
- name="Eclipse RCP"
- path="targets/rcp.target"/>
- </extension>
-</pre>
-
-In the example above, the name and id of the target profile are declared in the plugin.xml, but its content is store in a <code>targets/rcp.target</code> located in the contributing plug-in.
-<br>
-The .target file must be created via <b>File > New > Other... > Plug-in Development > Target Profile</b> and must comply with the grammar of that file.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- No Java code is requied for this extension point.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- The <code>org.eclipse.pde.core</code> plug-in provides two extensions.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2004 IBM Corporation and others.
-<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which
-accompanies this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- </documentation>
- </annotation>
-
-</schema>
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IBaseModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IBaseModel.java
deleted file mode 100644
index 0106aaf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IBaseModel.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * A base generic model. Classes that implement this
- * interface are expected to be able to:
- * <ul>
- * <li>Dispose (clear all the data and reset)</li>
- * <li>Tell if they are editable</li>
- * <li>Tell if they contain valid data</li>
- * </ul>
- * @since 2.0
- */
-public interface IBaseModel extends IAdaptable {
- /**
- * Releases all the data in this model and
- * clears the state. A disposed model
- * can be returned to the normal state
- * by reloading.
- */
- void dispose();
- /**
- * Tests if this model has been disposed.
- * Disposed model cannot be used until
- * it is loaded/reloaded.
- * @return <code>true</code> if the model has been disposed
- */
- boolean isDisposed();
- /**
- * Tests if this model can be modified. Modification
- * of a model that is not editable will result
- * in CoreException being thrown.
- * @return <code>true</code> if this model can be modified
- */
- boolean isEditable();
- /**
- * Tests if this model valid. When models
- * are loaded from the file, they may pass the
- * syntax error checking and load all the model objects.
- * However, some of the objects may contain invalid
- * values that make the model unusable.
- * @return <code>true</code> only if the model can be safely used in all
- * computations.
- */
- boolean isValid();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditable.java
deleted file mode 100644
index 649e74b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditable.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-import java.io.PrintWriter;
-/**
- * Models that implement this interface indicate that
- * they can be changed. When a model is changed,
- * it becomes 'dirty'. This state can either be reset
- * (in case of a 'false alarm' or naturally set to
- * false as a result of saving the changes.
- * Models that implement this interface are expected
- * to be able to save in ASCII file format
- * (e.g. XML).
- * @since 2.0
- */
-public interface IEditable {
- /**
- * Tests whether the model marked as editable can be
- * edited. Even though a model is generally editable,
- * it can me marked as read-only because some condition
- * prevents it from changing state (for example,
- * the underlying resource is locked). While
- * read-only models can never be changed, editable
- * models can go in and out editable state during
- * their life cycle.
- *
- * @return <code>true</code> if model can be modified, <code>false</code>
- * otherwise.
- */
- public boolean isEditable();
- /**
- * Tests whether the model has been changed from the last clean
- * state.
- * @return <code>true</code> if the model has been changed and need saving
- */
- public boolean isDirty();
- /**
- * Saves the model into the provided writer.
- * The assumption is that the model can be
- * persisted in an ASCII output stream (for example, an XML file).
- * This method should clear the 'dirty' flag when
- * done.
- *
- * @param writer an object that should be used to
- * write ASCII representation of the model
- */
- public void save(PrintWriter writer);
- /**
- * Sets the dirty flag of the model. This method is
- * normally not intended to be used outside the model.
- * Most often, a dirty model should be saved to clear the flag.
- *
- * @param dirty a new value for the 'dirty' flag
- */
- void setDirty(boolean dirty);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditableModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditableModel.java
deleted file mode 100644
index 24f492c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IEditableModel.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-/**
- * Editable model is an editable object that can be saved. The classes
- * that implement this interface are responsible for calling the
- * method <code>save</code> of <code>IEditable</code> and supplying
- * the required <code>PrintWriter</code> object.
- *
- * @since 2.0
- */
-public interface IEditableModel extends IEditable {
-/**
- * Saves the editable model using the mechanism suitable for the
- * concrete model implementation. It is responsible for
- * wrapping the <code>IEditable.save(PrintWriter)</code> operation
- * and providing the print writer.
- */
- void save();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IIdentifiable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IIdentifiable.java
deleted file mode 100644
index a160efa..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IIdentifiable.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Classes implement this interface if
- * their instances need to be uniquely identified
- * using an id.
- *
- * @since 2.0
- */
-public interface IIdentifiable {
- /**
- * A property that will be carried by the change event
- * if 'id' field of this object is changed.
- */
- public static final String P_ID = "id"; //$NON-NLS-1$
- /**
- * Returns a unique id of this object.
- * @return the id of this object
- */
- public String getId();
- /**
- * Sets the id of this IIdentifiable to the provided value.
- * This method will throw CoreException if
- * object is not editable.
- *
- *@param id a new id of this object
- */
- void setId(String id) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModel.java
deleted file mode 100644
index cd36a4e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModel.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-/**
- * A generic model. Classes that implement this interface are expected to be
- * able to:
- * <ul>
- * <li>Load from an input stream
- * <li>Reload (reset, load, fire 'world change')
- * <li>Dispose (clear all the data and reset)
- * <li>Be associated with a resource (optional)
- * </ul>
- * If a model is not created from a workspace resource file, its underlying
- * resource will be <samp>null </samp>.
- *
- * @since 2.0
- */
-public interface IModel extends IBaseModel {
- /**
- * Returns a string found in the resource bundle associated with this model
- * for the provided key.
- *
- * @param key
- * the name to use for bundle lookup
- * @return the string for the key in the resource bundle, or the key itself
- * if not found
- */
- String getResourceString(String key);
- /**
- * Returns a workspace resource that this model is created from. Load/reload
- * operations are not directly connected with the resource (although they
- * can be). In some cases, models will load from a buffer (an editor
- * document) rather than a resource. However, the buffer will eventually be
- * synced up with this resource.
- * <p>
- * With the caveat of stepped loading, all other properties of the
- * underlying resource could be used directly (path, project etc.).
- *
- * @return a workspace resource (file) that this model is associated with,
- * or <samp>null </samp> if the model is not created from a
- * resource.
- */
- public IResource getUnderlyingResource();
- /**
- * Tests if this model is loaded and can be used.
- *
- * @return <code>true</code> if the model has been loaded
- */
- boolean isLoaded();
- /**
- * Tests if this model is in sync with the storage object it was loaded
- * from. Models loaded from resources are in sync if underlying resources
- * are in sync. Models loaded from files on the file systems are in sync if
- * the time stamp matches the model time stamp.
- *
- * @return <code>true</code> if the model is in sync with the file system.
- */
- boolean isInSync();
- /**
- * Returns the last modification time stamp. The model itself does not have
- * the time stamp. It is 'borrowed' from the underlying physical object.
- *
- * @return the time stamp of the underlying physical object.
- */
- long getTimeStamp();
- /**
- * Loads the model directly from an underlying resource. This method does
- * nothing if this model has no underlying resource or if there is a buffer
- * stage between the model and the resource.
- *
- * @throws CoreException
- * if errors are encountered during the loading.
- */
- public void load() throws CoreException;
- /**
- * Loads the model from the provided input stream. This method throws a
- * CoreException if errors are encountered during the loading. Upon
- * succesful load, 'isLoaded()' should return <samp>true </samp>.
- *
- * @param source
- * an input stream that should be parsed to load the model
- * @param outOfSync
- * if true, time stamp will not be updated to maintain
- * out-of-sync state of the model.
- * @throws CoreException
- * if errors are encountered during the loading.
- */
- public void load(InputStream source, boolean outOfSync)
- throws CoreException;
- /**
- * Reload is a version of 'load' operation that has the following steps:
- * <ul>
- * <li>Reset the model
- * <li>Load the model
- * <li>Fire "world changed" event
- * </ul>
- * Reload operation is used when a model that is already in use is
- * invalidated by a change in the underlying buffer or resource. Since we
- * don't know the extent of the change, the only safe thing to do is to
- * reparse the buffer to sync up. The event that is subsequently fired
- * should be used by listeners to discard all caches and/or fully refresh
- * views that shows any portion of the model.
- *
- * @param source
- * an input stream that should be parsed to load the model.
- * @param outOfSync
- * if true, the timestamp will not be updated to maintain
- * out-of-sync state of the model.
- * @throws CoreException
- * if errors are encountered during the reloading.
- */
- public void reload(InputStream source, boolean outOfSync)
- throws CoreException;
- /**
- * Returns whether this model needs to react to changes in source and
- * reconcile them. Only model instances used in editors need to perform this
- * task.
- *
- * @return <code>true</code> if this is a reconciling model,
- * <code>false</code> otherwise.
- */
- public boolean isReconcilingModel();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangeProvider.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangeProvider.java
deleted file mode 100644
index d92c81f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangeProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-/**
- * Classes that implement this interface are capable of notifying listeners
- * about model changes. Interested parties should implement
- * <samp>IModelChangedListener </samp> and add as listeners to be able to
- * receive change notification.
- *
- * @since 2.0
- */
-public interface IModelChangeProvider {
- /**
- * Adds the listener to the list of listeners that will be notified on model
- * changes.
- *
- * @param listener
- * a model change listener to be added
- */
- public void addModelChangedListener(IModelChangedListener listener);
- /**
- * Delivers change event to all the registered listeners.
- *
- * @param event
- * a change event that will be passed to all the listeners
- */
- public void fireModelChanged(IModelChangedEvent event);
- /**
- * Notifies listeners that a property of a model object changed. This is a
- * utility method that will create a model event and fire it.
- *
- * @param object
- * an affected model object
- * @param property
- * name of the property that has changed
- * @param oldValue
- * the old value of the property
- * @param newValue
- * the new value of the property
- */
- public void fireModelObjectChanged(Object object, String property,
- Object oldValue, Object newValue);
- /**
- * Takes the listener off the list of registered change listeners.
- *
- * @param listener
- * a model change listener to be removed
- */
- public void removeModelChangedListener(IModelChangedListener listener);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedEvent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedEvent.java
deleted file mode 100644
index 1ad9ec9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedEvent.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-/**
- * Model change events are fired by the model when it is changed from the last
- * clean state. Model change listeners can use these events to update
- * accordingly.
- *
- * @since 2.0
- */
-public interface IModelChangedEvent {
- /**
- * Indicates a change where one or more objects are added to the model.
- */
- int INSERT = 1;
- /**
- * Indicates a change where one or more objects are removed from the model.
- */
- int REMOVE = 2;
- /**
- * Indicates that the model has been reloaded and that listeners should
- * perform full refresh.
- */
- int WORLD_CHANGED = 99;
- /**
- * indicates that a model object's property has been changed.
- */
- int CHANGE = 3;
- /**
- * Returns the provider that fired this event.
- *
- * @return the event provider
- */
- public IModelChangeProvider getChangeProvider();
- /**
- * Returns an array of model objects that are affected by the change.
- *
- * @return array of affected objects
- */
- public Object[] getChangedObjects();
- /**
- * Returns a name of the object's property that has been changed if change
- * type is CHANGE.
- *
- * @return property that has been changed in the model object, or <samp>null
- * </samp> if type is not CHANGE or if more than one property has
- * been changed.
- */
- public String getChangedProperty();
- /**
- * When model change is of type <samp>CHANGE</samp>, this method is used to
- * obtain the old value of the property (before the change).
- *
- * @return the old value of the changed property
- */
- public Object getOldValue();
- /**
- * When model change is of type <samp>CHANGE</samp>, this method is used to
- * obtain the new value of the property (after the change).
- *
- * @return the new value of the changed property.
- */
- public Object getNewValue();
- /**
- * Returns the type of change that occured in the model (one of <samp>INSERT</samp>,
- * <samp>REMOVE</samp>, <samp>CHANGE</samp> or
- * <samp>WORLD_CHANGED </samp>).
- *
- * @return type of change
- */
- public int getChangeType();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedListener.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedListener.java
deleted file mode 100644
index 4df2e47..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelChangedListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-/**
- * Classes that need to be notified on model
- * changes should implement this interface
- * and add themselves as listeners to
- * the model they want to listen to.
- *
- * @since 2.0
- */
-public interface IModelChangedListener {
- /**
- * Called when there is a change in the model
- * this listener is registered with.
- *
- * @param event a change event that describes
- * the kind of the model change
- */
- public void modelChanged(IModelChangedEvent event);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProvider.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProvider.java
deleted file mode 100644
index 0fa713a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-import org.eclipse.core.resources.IFile;
-/**
- * Classes that implement this interface are responsible for holding a table of
- * models associated with the underlying objects. They have several
- * responsibilities:
- * <ul>
- * <li>To hold model objects in one place
- * <li>To allow requesters to connect to the models or to disconnect from them.
- * <li>To notify interested parties when models are added and removed.
- * </ul>
- * Model providers are responsible for listening to the workspace, updating
- * models whose underlying resources have been updated, and removing them from
- * the table when those resources have been deleted.
- *
- * @since 2.0
- */
-public interface IModelProvider {
- /**
- * Registers a listener that will be notified about changes in the managed
- * models.
- *
- * @param listener
- * the listener that will be registered
- */
- void addModelProviderListener(IModelProviderListener listener);
- /**
- * Returns the model for the provided file resource.
- *
- * @param file
- * the file resource we need the model for
- * @return the object that represents a structured representation of the
- * file content
- */
- public IModel getModel(IFile file);
- /**
- * Deregisters a listener from notification.
- *
- * @param listener
- * the listener to be deregistered
- */
- void removeModelProviderListener(IModelProviderListener listener);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderEvent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderEvent.java
deleted file mode 100644
index 48018bb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderEvent.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-/**
- * This event will be delivered to all model provider listeners when a model
- * managed by the model provider changes in some way.
- *
- * @since 2.0
- */
-public interface IModelProviderEvent {
- /**
- * Event is sent after the models have been added.
- */
- int MODELS_ADDED = 0x1;
- /**
- * Event is sent before the models will be removed.
- */
- int MODELS_REMOVED = 0x2;
- /**
- * Event is sent after the models have been changed.
- */
- int MODELS_CHANGED = 0x4;
-
- /**
- * Event is sent when the target platform changes
- *
- * @since 3.2
- */
- int TARGET_CHANGED = 0x8;
- /**
- * Returns the models that are added
- *
- * @return the models that have been added or an empty array
- */
- IModel[] getAddedModels();
- /**
- * Returns the models that are removed
- *
- * @return the models that have been removed or an empty array
- */
- IModel[] getRemovedModels();
- /**
- * Returns the models that has changed
- *
- * @return the models that has changed or an empty array
- */
- IModel[] getChangedModels();
- /**
- * Returns the combination of flags indicating type of event. In case of
- * multiple changes, flags are ORed together. (a combination of
- * MODEL_CHANGED, MODEL_ADDED, MODEL_REMOVED)
- *
- * @return the model change type
- */
- int getEventTypes();
- /**
- * Returns the object that fired this event.
- */
- Object getEventSource();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderListener.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderListener.java
deleted file mode 100644
index 9f5bdd5..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IModelProviderListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-
-/**
- * Classes should implement this interface in order to be able to register as
- * model provider listeners. They will be notified about events such as models
- * being added or removed. These changes are typically caused by the changes in
- * the workspace when models are built on top of workspace resources.
- *
- * @since 2.0
- */
-public interface IModelProviderListener {
- /**
- * Notifies the listener that models have been changed in the model
- * provider.
- *
- * @param event
- * the event that specifies the type of change
- */
- public void modelsChanged(IModelProviderEvent event);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ISourceObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ISourceObject.java
deleted file mode 100644
index 7b31ec0..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ISourceObject.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-/**
- * This interface indicates that a model object is created by parsing an
- * editable source file and can be traced back to a particular location in the
- * file.
- *
- * @since 2.0
- */
-public interface ISourceObject {
- /**
- * Returns the line in the source file where the source representation of
- * this object starts, or -1 if not known.
- *
- * @return the first line in the source file
- */
- public int getStartLine();
- /**
- * Returns the line in the source file where the source representation of
- * this object stops, or -1 if not known.
- *
- * @return the last line in the source file
- */
- public int getStopLine();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IWritable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IWritable.java
deleted file mode 100644
index 0073a7e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IWritable.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-import java.io.PrintWriter;
-/**
- * Classes that implement this interface can participate in saving the model to
- * the ASCII output stream using the provided writer.
- *
- * @since 2.0
- */
-public interface IWritable {
- /**
- * Writes the ASCII representation of the writable into the provider writer.
- * The writable should use the provided indent to write the stream starting
- * from the specified column number. Indent string should be written to the
- * writer after every new line.
- *
- * @param indent
- * a string that should be added after each new line to maintain
- * desired horizontal alignment
- * @param writer
- * a writer to be used to write this object's textual
- * representation
- */
- void write(String indent, PrintWriter writer);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ModelChangedEvent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ModelChangedEvent.java
deleted file mode 100644
index 40fe35e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/ModelChangedEvent.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core;
-/**
- * @see IModelChangedEvent
- *
- * @since 2.0
- */
-public class ModelChangedEvent implements IModelChangedEvent {
- private int type;
- private IModelChangeProvider provider;
- private Object[] changedObjects;
- private Object oldValue, newValue;
- private String changedProperty;
- /**
- * The constructor of the event.
- *
- * @param provider
- * the change provider
- * @param type
- * the event type
- * @param objects
- * the changed objects
- * @param changedProperty
- * or <samp>null </samp> if not applicable
- */
- public ModelChangedEvent(IModelChangeProvider provider, int type,
- Object[] objects, String changedProperty) {
- this.type = type;
- this.provider = provider;
- this.changedObjects = objects;
- this.changedProperty = changedProperty;
- }
- /**
- * A costructor that should be used for changes of object properties.
- *
- * @param provider
- * the event provider
- * @param object
- * affected object
- * @param changedProperty
- * changed property of the affected object
- * @param oldValue
- * the value before the change
- * @param newValue
- * the value after the change
- */
- public ModelChangedEvent(IModelChangeProvider provider, Object object,
- String changedProperty, Object oldValue, Object newValue) {
- this.type = CHANGE;
- this.provider = provider;
- this.changedObjects = new Object[]{object};
- this.changedProperty = changedProperty;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- /**
- * @see IModelChangedEvent#getChangeProvider
- */
- public IModelChangeProvider getChangeProvider() {
- return provider;
- }
- /**
- * @see IModelChangedEvent#getChangedObjects
- */
- public Object[] getChangedObjects() {
- return changedObjects;
- }
- /**
- * @see IModelChangedEvent#getChangedProperty
- */
- public String getChangedProperty() {
- return changedProperty;
- }
- /**
- * Returns the old property value.
- *
- * @return the value before the change
- */
- public Object getOldValue() {
- return oldValue;
- }
- /**
- * Returns the new property value.
- *
- * @return the value after the change
- */
- public Object getNewValue() {
- return newValue;
- }
- /**
- * Returns the event change type
- *
- * @return the event change type
- *
- * @see IModelChangedEvent#getChangeType
- */
- public int getChangeType() {
- return type;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuild.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuild.java
deleted file mode 100644
index ba3274b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuild.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.build;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IWritable;
-/**
- * The top-level model object of the model that is created from
- * "build.properties" file.
- *
- */
-public interface IBuild extends IWritable {
- /**
- * Adds a new build entry. This method can throw a CoreException if the
- * model is not editable.
- *
- * @param entry
- * an entry to be added
- */
- void add(IBuildEntry entry) throws CoreException;
- /**
- * Returns all the build entries in this object.
- *
- * @return an array of build entries
- */
- IBuildEntry[] getBuildEntries();
- /**
- * Returns the build entry with the specified name.
- *
- * @param name
- * name of the desired entry
- * @return the entry object with the specified name, or <samp>null</samp>
- * if not found.
- */
- IBuildEntry getEntry(String name);
- /**
- * Removes a build entry. This method can throw a CoreException if the model
- * is not editable.
- *
- * @param entry
- * an entry to be removed
- */
- void remove(IBuildEntry entry) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildEntry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildEntry.java
deleted file mode 100644
index cd53163..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildEntry.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.build;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IWritable;
-/**
- * Jar entry represents one 'library=folder list' entry
- * in plugin.jars file.
- */
-public interface IBuildEntry extends IWritable {
- /**
- * A property name for changes to the 'name' field.
- */
- public static final String P_NAME = "name"; //$NON-NLS-1$
- /**
- * The prefix for any key denoting the source folders that
- * should be compiled into a JAR. The suffix will
- * be the name of the JAR.
- */
- public static final String JAR_PREFIX = "source."; //$NON-NLS-1$
- /**
- * The prefix for any key denoting output folders for a particular
- * JAR. The suffix will be the name of the JAR.
- */
- public static final String OUTPUT_PREFIX = "output."; //$NON-NLS-1$
- /**
- * The name of the key that lists all the folders and files
- * to be included in the binary build.
- */
- public static final String BIN_INCLUDES = "bin.includes"; //$NON-NLS-1$
- /**
- * The name of the key that lists all the folders and files
- * to be included in the source build.
- */
- public static final String SRC_INCLUDES = "src.includes"; //$NON-NLS-1$
- /**
- * The name of the key that declares extra library entries to be added
- * to the class path at build time only..
- */
- public static final String JARS_EXTRA_CLASSPATH = "jars.extra.classpath"; //$NON-NLS-1$
- /**
- * The name of the key that declares possible plug-in dependencies
- */
- public static final String SECONDARY_DEPENDENCIES = "secondary.libs"; //$NON-NLS-1$
- /**
- * Adds the token to the list of token for this entry.
- * This method will throw a CoreException if
- * the model is not editable.
- *
- * @param token a name to be added to the list of tokens
- */
- void addToken(String token) throws CoreException;
- /**
- * Returns a model that owns this entry
- * @return build.properties model
- */
- IBuildModel getModel();
- /**
- * Returns the name of this entry.
- * @return the entry name
- */
- String getName();
- /**
- * Returns an array of tokens for this entry
- * @return array of tokens
- */
- String[] getTokens();
-
- /**
- * Returns true if the provided token exists in this entry.
- * @return true if the token exists in the entry
- */
- boolean contains(String token);
- /**
- * Removes the token from the list of tokens for this entry.
- * This method will throw a CoreException if
- * the model is not editable.
- *
- * @param token a name to be removed from the list of tokens
- */
- void removeToken(String token) throws CoreException;
- /**
- * Changes the name of the token without changing its
- * position in the list. This method will throw
- * a CoreException if the model is not editable.
- *
- * @param oldToken the old token name
- * @param newToken the new token name
- */
- void renameToken(String oldToken, String newToken) throws CoreException;
- /**
- * Sets the name of this build entry. This
- * method will throw a CoreException if
- * model is not editable.
- *
- * @param name the new name for the entry
- */
- void setName(String name) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModel.java
deleted file mode 100644
index c7fe88d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.build;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-/**
- * This model is created from the "build.properties" file
- * that defines what source folders in the plug-in are
- * to be used to build require plug-in Jars.
- * <p>
- * If this model is editable, isEditable() will return
- * true and the model instance will implement IEditable
- * interface. The model is capable of providing
- * change notification for the registered listeners.
- */
-public interface IBuildModel extends IModel, IModelChangeProvider {
- /**
- * Returns the top-level model object of this model.
- *
- * @return a build.properties top-level model object
- */
- IBuild getBuild();
- /**
- * Returns the factory that should be used
- * to create new instance of model objects.
- * @return the build.properties model factory
- */
- IBuildModelFactory getFactory();
- /**
- * Returns the location of the file
- * used to create the model.
- *
- * @return the location of the build.properties file
- * or <samp>null</samp> if the file
- * is in a workspace.
- */
- String getInstallLocation();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModelFactory.java
deleted file mode 100644
index ee2f599..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/build/IBuildModelFactory.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.build;
-
-/**
- * This model factory should be used to
- * create new instances of plugin.jars model
- * objects.
- */
-public interface IBuildModelFactory {
- /**
- * Creates a new build entry with
- * the provided name.
- * @return a new build.properties entry instance
- */
- IBuildEntry createEntry(String name);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensions.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensions.java
deleted file mode 100644
index ea9e718..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensions.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * A model object that contains the portion of the plug-in model
- * responsible for extensions and extension points. If
- * the plug-in contains OSGi manifest file, plugin.xml is
- * reduced to extensions and extension points only.
- *
- * @since 3.0
- */
-public interface IExtensions extends IPluginObject {
- /**
- * A model property that will be used when order of extensions
- * changes in this object.
- */
- String P_EXTENSION_ORDER = "extension_order"; //$NON-NLS-1$
- /**
- * Adds a new extension to this object. This
- * method will throw a CoreException if
- * model is not editable.
- *
- * @param extension the extension object
- */
- void add(IPluginExtension extension) throws CoreException;
- /**
- * Adds a new extension point to this object.
- * This method will throw a CoreException if the model is not editable.
- *
- * @param extensionPoint the extension point
- */
- void add(IPluginExtensionPoint extensionPoint) throws CoreException;
- /**
- * Returns extension points defined in this object.
- * @return an array of extension point objects
- */
- IPluginExtensionPoint[] getExtensionPoints();
- /**
- * Returns extensions defined in this object.
- *
- * @return an array of extension objects
- */
- IPluginExtension[] getExtensions();
- /**
- * Removes an extension from this object. This
- * method will throw a CoreException if
- * the model is not editable.
- *
- * @param extension the extension object
- */
- void remove(IPluginExtension extension) throws CoreException;
- /**
- * Removes an extension point from this object. This
- * method will throw a CoreException if
- * the model is not editable.
- *
- * @param extensionPoint the extension point object
- */
- void remove(IPluginExtensionPoint extensionPoint) throws CoreException;
- /**
- * Swaps the positions of the provided extensions
- * in the list of extensions.
- *
- * @param e1 the first extension object
- * @param e2 the second extension object
- */
- void swap(IPluginExtension e1, IPluginExtension e2) throws CoreException;
- /**
- * Returns the position of the extension in the receiver.
- * @param e the extension
- * @return the 0-based index of the extension in the receiver.
- */
- int getIndexOf(IPluginExtension e);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModel.java
deleted file mode 100644
index 2daedba..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModel.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-/**
- * This type of model is created by parsing the manifest file.
- * It serves as a base interface for both plug-in and
- * fragment models by holding data common to both.
- * If the file is a workspace resource, it will be
- * available as the underlying resource of the model.
- * The model may be read-only or editable.
- * It will also make a reference to the build.properties
- * model when created. The reference will be of the
- * same type as the model itself: if the model is
- * editable, it will attempt to obtain an exclusive
- * editable copy of build.properties model.
- * <p>
- * The plug-in model can be disabled. Disabling the
- * model will not change its data. Users of the
- * model will have to decide if the disabled state
- * if of any importance to them or not.
- * <p>
- * The model is capable of notifying listeners
- * about changes. An attempt to change a read-only
- * model will result in a CoreException.
- */
-public interface IExtensionsModel extends ISharedExtensionsModel {
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModelFactory.java
deleted file mode 100644
index 9140526..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IExtensionsModelFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-/**
- * This factory should be used to create
- * instances of the extensions model objects.
- *
- * @since 3.0
- */
-public interface IExtensionsModelFactory {
- /**
- * Creates a new attribute instance for the
- * provided element.
- *
- * @param element the parent element
- * @return the new attribute instance
- */
- IPluginAttribute createAttribute(IPluginElement element);
- /**
- * Creates a new element instance for the
- * provided parent.
- *
- * @param parent the parent element
- * @return the new element instance
- */
- IPluginElement createElement(IPluginObject parent);
- /**
- * Creates a new extension instance.
- * @return the new extension instance
- */
- IPluginExtension createExtension();
- /**
- * Creates a new extension point instance
- *
- * @return a new extension point
- */
- IPluginExtensionPoint createExtensionPoint();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragment.java
deleted file mode 100644
index 1e92f9b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragment.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * A model object that represents the content of the fragment.xml
- * file.
- */
-public interface IFragment extends IPluginBase {
- /**
- * A property that will be used to notify
- * that a plugin id has changed.
- */
- String P_PLUGIN_ID = "plugin-id"; //$NON-NLS-1$
- /**
- * A property that will be used to notify
- * that a plugin version has changed.
- */
- String P_PLUGIN_VERSION = "plugin-version"; //$NON-NLS-1$
- /**
- * A property that will be used to notify
- * that a plugin version match rule has changed.
- */
- String P_RULE = "match"; //$NON-NLS-1$
- /**
- * Returns the id of the fragment host.
- *
- * @return the host id
- */
- String getPluginId();
- /**
- * Returns the version of the fragment host.
- *
- * @return the host version
- */
- String getPluginVersion();
- /**
- * Returns an optional version match rule as defined in
- * IMatchRule interface.
- *
- * @return the match rule
- */
- int getRule();
- /**
- * Sets the id of the plug-in that will be the target of this fragment.
- * @param id the id of the referenced plug-in.
- * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
- */
- void setPluginId(String id) throws CoreException;
- /**
- * Sets the version of the plug-in that will be the target of this fragment.'
- * @param version the version of the referenced version.
- * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
- */
- void setPluginVersion(String version) throws CoreException;
- /**
- * Sets the optional version match rule as defined in IMatchRules. This
- * rule will be used when attempting to match the referenced plug-in
- * version.
- * @param rule the match rule to be used when locating the referenced the plug-in.
- * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
- */
- void setRule(int rule) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragmentModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragmentModel.java
deleted file mode 100644
index 8db9386..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IFragmentModel.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-
-/**
- * This type of model is created by parsing the manifest file.
- * If the file is a workspace resource, it will be
- * available as the underlying resource of the model.
- * The model may be read-only or editable.
- * It will also make a reference to the build properties
- * model when created. The reference will be of the
- * same type as the model itself: if the model is
- * editable, it will attempt to obtain an exclusive
- * editable copy of build.properties model.
- * <p>
- * The fragment model can be disabled. Disabling the
- * model will not change its data. Users of the
- * model will have to decide if the disabled state
- * if of any importance to them or not.
- * <p>
- * The model is capable of notifying listeners
- * about changes. An attempt to change a read-only
- * model will result in a CoreException.
- */
-public interface IFragmentModel extends IPluginModelBase {
- /**
- * Returns a top-level model object.
- *
- * @return a root model instance
- */
- IFragment getFragment();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IMatchRules.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IMatchRules.java
deleted file mode 100644
index 7bf71bf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IMatchRules.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-/**
- * This interface contains constants used throughout the plug-in
- * for plug-in reference matching. These rules are used to
- * control when determining if two compared versions are
- * equivalent.
- */
-public interface IMatchRules {
- /**
- * No rule.
- */
- int NONE = 0;
-
- /**
- * A match that is equivalent to the required version.
- */
- int EQUIVALENT = 1;
-
- /**
- * Attribute value for the 'equivalent' rule.
- */
- String RULE_EQUIVALENT = "equivalent"; //$NON-NLS-1$
- /**
- * A match that is compatible with the required version.
- */
- int COMPATIBLE = 2;
- /**
- * Attribute value for the 'compatible' rule.
- */
- String RULE_COMPATIBLE = "compatible"; //$NON-NLS-1$
- /**
- * An perfect match.
- */
- int PERFECT = 3;
-
- /**
- * Attribute value for the 'perfect' rule.
- */
- String RULE_PERFECT = "perfect"; //$NON-NLS-1$
- /**
- * A match requires that a version is greater or equal to the
- * specified version.
- */
- int GREATER_OR_EQUAL = 4;
- /**
- * Attribute value for the 'greater or equal' rule
- */
- String RULE_GREATER_OR_EQUAL = "greaterOrEqual"; //$NON-NLS-1$
- /**
- * An id match requires that the specified id is a prefix of
- * a candidate id.
- */
- int PREFIX = 5;
- /**
- * Attribute value for the 'prefix' id rule
- */
- String RULE_PREFIX = "prefix"; //$NON-NLS-1$
- /**
- * Table of rule names that match rule values defined in this
- * interface. It can be used directly against the rule values
- * used in plug-in models.
- */
- String[] RULE_NAME_TABLE =
- { "", RULE_EQUIVALENT, RULE_COMPATIBLE, RULE_PERFECT, RULE_GREATER_OR_EQUAL }; //$NON-NLS-1$
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPlugin.java
deleted file mode 100644
index 09f5297..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPlugin.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * A model object that represents the content of the plugin.xml
- * file.
- */
-public interface IPlugin extends IPluginBase {
- /**
- * A property that will be used when the plug-in activator
- * field is changed.
- */
- String P_CLASS_NAME = "class"; //$NON-NLS-1$
-
- /**
- * Returns a plug-in activator class name
- * @return plug-in activator class name or <samp>null</samp> if not specified.
- */
- String getClassName();
-
- /**
- * Sets the name of the plug-in activator class.
- * This method will throw a CoreException
- * if the model is not editable.
- *
- * @param className the new class name
- */
- void setClassName(String className) throws CoreException;
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginAttribute.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginAttribute.java
deleted file mode 100644
index 54af3a4..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginAttribute.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * An attribute of XML elements found in the plug-in.
- */
-public interface IPluginAttribute extends IPluginObject {
- /**
- * This property will be used to notify that the value
- * of the attribute has changed.
- */
- String P_VALUE = "value"; //$NON-NLS-1$
- /**
- * Returns the value of this attribute.
- *
- * @return the string value of the attribute
- */
- String getValue();
- /**
- * Sets the value of this attribute.
- * This method will throw a CoreExeption
- * if the model is not editable.
- *
- * @param value the new attribute value
- */
- void setValue(String value) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginBase.java
deleted file mode 100644
index c2b3377..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginBase.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-/**
- * A model object that represents the content of a plug-in or
- * fragment manifest. This object contains data that is common
- * for bo plug-ins and fragments.
- */
-public interface IPluginBase extends IExtensions, IIdentifiable {
- /**
- * A property that will be used to notify that
- * the provider name has changed.
- */
- String P_PROVIDER = "provider-name"; //$NON-NLS-1$
- /**
- * A property that will be used to notify
- * that a version has changed.
- */
- String P_VERSION = "version"; //$NON-NLS-1$
-
- /**
- * A property that will be used to notify
- * that library order in a plug-in has changed.
- */
- String P_LIBRARY_ORDER = "library_order"; //$NON-NLS-1$
-
- /**
- * A property that will be used to notify
- * that import order in a plug-in has changed.
- */
- String P_IMPORT_ORDER = "import_order"; //$NON-NLS-1$
-
- /**
- * A property that will be used to notify
- * that 3.0 release compatibility flag has been changed.
- */
- String P_SCHEMA_VERSION = "schema-version"; //$NON-NLS-1$
- /**
- * Adds a new library to this plugin.
- * This method will throw a CoreException if
- * model is not editable.
- *
- * @param library the new library
- */
- void add(IPluginLibrary library) throws CoreException;
-
- /**
- * Adds a new plug-in import to this plugin.
- * This method will throw a CoreException if
- * model is not editable.
- *
- * @param pluginImport the new import object
- */
- void add(IPluginImport pluginImport) throws CoreException;
- /**
- * Removes an import from the plugin. This
- * method will throw a CoreException if
- * the model is not editable.
- *
- * @param pluginImport the import object
- */
- void remove(IPluginImport pluginImport) throws CoreException;
- /**
- * Returns libraries referenced in this plug-in.
- *
- * @return an array of libraries
- */
- IPluginLibrary[] getLibraries();
- /**
- * Returns imports defined in this plug-in.
- *
- * @return an array of import objects
- */
- IPluginImport[] getImports();
- /**
- * Returns a name of the plug-in provider.
- *
- * @return plug-in provider name
- */
- String getProviderName();
- /**
- * Returns this plug-in's version
- * @return the version of the plug-in
- */
- String getVersion();
- /**
- * Removes a library from the plugin. This
- * method will throw a CoreException if
- * the model is not editable.
- *
- * @param library the library object
- */
- void remove(IPluginLibrary library) throws CoreException;
- /**
- * Sets the name of the plug-in provider.
- * This method will throw a CoreException
- * if the model is not editable.
- *
- * @param providerName the new provider name
- */
- void setProviderName(String providerName) throws CoreException;
- /**
- * Sets the version of the plug-in.
- * This method will throw a CoreException
- * if the model is not editable.
- *
- * @param version the new plug-in version
- */
- void setVersion(String version) throws CoreException;
- /**
- * Swaps the positions of the provided libraries
- * in the list of libraries. Libraries are looked up
- * by the class loader in the order of declaration.
- * If two libraries contain classes with the same
- * name, library order will determine which one is
- * encountered first.
- *
- * @param l1 the first library object
- * @param l2 the second library object
- */
- void swap(IPluginLibrary l1, IPluginLibrary l2) throws CoreException;
-
- /**
- * Swaps the positions of the plug-ins provided in
- * in the dependency list. This order is the one used
- * used by the classloader when loading classes.
- *
- * @param import1 the first import object
- * @param import2 the second import object
- */
- void swap(IPluginImport import1, IPluginImport import2) throws CoreException;
-
- /**
- * Returns version of the manifest grammar
- * @return version of the manifest grammar, or <samp>null</samp>
- */
- String getSchemaVersion();
- /**
- * Sets the R3.0 compatibility flag
- * @param schemaVersion version of the manifest grammar
- */
- void setSchemaVersion(String schemaVersion) throws CoreException;
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginElement.java
deleted file mode 100644
index ea67463..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginElement.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Classes that implement this interface model the
- * XML elements found in the plug-in model.
- */
-public interface IPluginElement extends IPluginParent {
- /**
- * A property name that will be used to notify
- * about element body text change.
- */
- String P_TEXT = "text"; //$NON-NLS-1$
- /**
- * A property name that will be used to notify
- * about global replacement of the element's attributes.
- */
- String P_ATTRIBUTES = "attributes"; //$NON-NLS-1$
-
- /**
- * A property name that will be used to notify individual
- * change in an element's attribute.
- */
- String P_ATTRIBUTE = "attribute"; //$NON-NLS-1$
- /**
- * Creates an identical copy of this XML element.
- * The new element will share the same model and
- * the parent.
- *
- * @return a copy of this element
- */
- IPluginElement createCopy();
- /**
- * Returns an attribute object whose name
- * matches the provided name.
- * @param name the name of the attribute
- * @return the attribute object, or <samp>null</samp> if not found
- */
- IPluginAttribute getAttribute(String name);
- /**
- * Returns all attributes currently defined in this element
- * @return an array of attribute objects that belong to this element
- */
- IPluginAttribute[] getAttributes();
- /**
- * Returns the number of attributes in this element.
- * @return number of attributes defined in this element
- */
- int getAttributeCount();
- /**
- * Returns the body text of this element.
- *
- * @return body text of this element or <samp>null</samp> if not set.
- */
- String getText();
- /**
- * Returns the schema for this element.
- * <p>This information is exposed here as implementation side-effect
- * and should not be used by clients.
- *
- * @return the schema for this element or <samp>null</samp> if not found.
- */
- Object getElementInfo();
- /**
- * Sets the attribute with the provided name
- * to the provided value. If attribute object
- * is not found, a new one will be created and
- * its value set to the provided value.
- * This method will throw a CoreException if
- * the model is not editable.
- *
- * @param name the name of the attribute
- * @param value the value to be set
- */
- void setAttribute(String name, String value) throws CoreException;
- /**
- * Sets the body text of this element
- * to the provided value. This method
- * will throw a CoreException if the
- * model is not editable.
- *
- * @param text the new body text of this element
- */
- void setText(String text) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtension.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtension.java
deleted file mode 100644
index 0dd9fc9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtension.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-
-/**
- * Classes that implement this interface model the extension
- * element found in the plug-in or fragment manifest.
- */
-public interface IPluginExtension extends IPluginParent, IIdentifiable {
- /**
- * A name of the property that will be used to
- * notify about the "point" change
- */
- String P_POINT = "point"; //$NON-NLS-1$
- /**
- * Returns the full Id of the extension point that this extension
- * is plugged into.
- */
- String getPoint();
- /**
- * Returns the schema for the extension point that this extension
- * is plugged into or <samp>null</samp> if not found.
- * <p>This method is an implementation detail - schema object
- * is not needed for clients outside PDE and should not be used.
- */
- Object getSchema();
- /**
- * Sets the value of the extension point Id
- * This method will throw a CoreException if
- * this model is not editable.
- * @param point the new extension point Id
- */
- void setPoint(String point) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtensionPoint.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtensionPoint.java
deleted file mode 100644
index c5349e2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginExtensionPoint.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-/**
- * Classes that implement this interface model an extension point
- * element specified in the plug-in manifest.
- */
-public interface IPluginExtensionPoint extends IPluginObject, IIdentifiable {
- /**
- * A property name that will be used to notify
- * about changes to the schema value.
- */
- String P_SCHEMA = "schema"; //$NON-NLS-1$
- /**
- * Returns the full extension point Id that
- * is composed as "pluginId.pointId". This full
- * Id will be used by extensions to reference this
- * extension point.
- *
- * @return a full extension point Id
- */
- String getFullId();
- /**
- * Returns the name of the extension point XML schema
- * that defines this extension point.
- *
- * @return XML extension point schema file name
- */
- String getSchema();
- /**
- * Sets the plug-in relative name of
- * the extension point schema file that
- * describes this extension point.
- * This method will throw a CoreException
- * if the model is not editable.
- */
- void setSchema(String schema) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginImport.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginImport.java
deleted file mode 100644
index ded5071..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginImport.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Objects that implement this interface represent references
- * to required plug-ins.
- */
-public interface IPluginImport extends IPluginObject, IPluginReference {
- /**
- * A name of the property that will be used to notify
- * about changes in the "reexported" field.
- */
- String P_REEXPORTED = "export"; //$NON-NLS-1$
- /**
- * A name of the property that will be used to notify
- * about changes in the "optional" field.
- */
- String P_OPTIONAL = "optional"; //$NON-NLS-1$
- /**
- * Tests whether the imported plug-in is reexported for
- * plug-ins that will use this plug-in.
- *
- * @return true if the required plug-in libraries are reexported
- */
- boolean isReexported();
- /**
- * Tests whether this import is optional. Optional imports will
- * not create an error condition when they cannot be resolved.
- *
- * @return true if this import is optional
- */
- boolean isOptional();
- /**
- * Sets whether the libraries of the required plug-in will
- * be reexported.
- * This method will throw a CoreException if the model
- * is not editable.
- *
- * @param value true if reexporting is desired
- */
- void setReexported(boolean value) throws CoreException;
- /**
- * Sets whether this import is optional. Optional imports will
- * not create an error condition when they cannot be resolved.
- *
- * @param value true if import is optional
- */
- void setOptional(boolean value) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginLibrary.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginLibrary.java
deleted file mode 100644
index fd1ddc9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginLibrary.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * The class that implements this interface represents a
- * reference to the library that is defined in the plug-in
- * manifest.
- */
-public interface IPluginLibrary extends IPluginObject {
- /**
- * A name of the property that will be used to
- * notify about changes of the "exported" field.
- */
- String P_EXPORTED = "export"; //$NON-NLS-1$
- /**
- * A name of the property that will be used to
- * notify about changes in the content filters.
- */
- String P_PACKAGES = "packages"; //$NON-NLS-1$
-
- /**
- * A name of the property that will be used to
- * notify about changes in the content filters.
- */
- String P_CONTENT_FILTERS = "contentFilters"; //$NON-NLS-1$
- /**
- * A name of the property that will be used to
- * notify about of the 'type' field.
- */
- String P_TYPE = "type"; //$NON-NLS-1$
- /**
- * A library type indicating the library contains code.
- */
- String CODE = "code"; //$NON-NLS-1$
- /**
- * A library type indicating the library contains resource files.
- */
- String RESOURCE = "resource"; //$NON-NLS-1$
- /**
- * Returns optional context filters that
- * should be applied to calculate what classes
- * to export from this library.
- *
- * @return an array of content filter strings
- */
- String[] getContentFilters();
-
- /**
- * Returns optional package prefixes that can be used
- * to make library lookup faster..
- *
- * @return an array of package prefixes
- */
- String[] getPackages();
- /**
- * Returns true if this library contains types
- * that will be visible to other plug-ins.
- *
- * @return true if there are exported types in the library
- */
- boolean isExported();
- /**
- * Returns true if all the types in this library
- * will be visible to other plug-ins.
- *
- * @return true if all the types are exported
- * in the library
- */
- boolean isFullyExported();
-
- /**
- * Returns a type of this library (CODE or RESOURCE)
- */
- String getType();
- /**
- * Sets the optional content filters for
- * this library. This method may throw
- * a CoreException if the model is not
- * editable.
- *
- * @param filters an array of filter strings
- */
- void setContentFilters(String[] filters) throws CoreException;
-
- /**
- * Export a particular package in a library.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param filter a package name
- */
- void addContentFilter(String filter) throws CoreException;
-
- /**
- * Remove a package from the export list.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param filter a package name
- */
- void removeContentFilter(String filter) throws CoreException;
-
-
- /**
- * Sets the optional package prefixes for this library.
- * This method may throw a CoreException if the model is not
- * editable.
- *
- * @param packages an array of package prefixes
- */
- void setPackages(String[] packages) throws CoreException;
- /**
- * Sets whether types in this library will be
- * visible to other plug-ins. This method
- * may throw a CoreException if the model is
- * not editable.
- */
- void setExported(boolean value) throws CoreException;
- /**
- * Sets the library type. Must be either CODE or RESOURCE.
- * @throws CoreException if the model is not editable.
- */
- void setType(String type) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModel.java
deleted file mode 100644
index 5aad8c1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-/**
- * This type of model is created by parsing the manifest file. If the file is
- * a workspace resource, it will be available as the underlying resource of the
- * model. The model may be read-only or editable. It will also make a reference
- * to the build.properties model when created. The reference will be of the same type
- * as the model itself: if the model is editable, it will attempt to obtain an
- * exclusive editable copy of build.properties model.
- * <p>
- * The plug-in model can be disabled. Disabling the model will not change its
- * data. Users of the model will have to decide if the disabled state if of any
- * importance to them or not.
- * <p>
- * The model is capable of notifying listeners about changes. An attempt to
- * change a read-only model will result in a CoreException.
- */
-public interface IPluginModel extends IPluginModelBase {
- /**
- * Returns a top-level model object.
- *
- * @return a root model instance
- */
- IPlugin getPlugin();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelBase.java
deleted file mode 100644
index e13da4e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelBase.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import java.net.URL;
-
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.build.IBuildModel;
-/**
- * This type of model is created by parsing the manifest file.
- * It serves as a base interface for both plug-in and
- * fragment models by holding data common to both.
- * If the file is a workspace resource, it will be
- * available as the underlying resource of the model.
- * The model may be read-only or editable.
- * It will also make a reference to the build.properties
- * model when created. The reference will be of the
- * same type as the model itself: if the model is
- * editable, it will attempt to obtain an exclusive
- * editable copy of build.properties model.
- * <p>
- * The plug-in model can be disabled. Disabling the
- * model will not change its data. Users of the
- * model will have to decide if the disabled state
- * if of any importance to them or not.
- * <p>
- * The model is capable of notifying listeners
- * about changes. An attempt to change a read-only
- * model will result in a CoreException.
- */
-public interface IPluginModelBase extends ISharedExtensionsModel, IModelChangeProvider {
- /**
- * Creates and return a top-level plugin model object
- *
- * @return a top-level model object representing a plug-in or a fragment.
- */
- IPluginBase createPluginBase();
- /**
- * Returns an associated build.properties model
- * that works in conjunction with this model.
- *
- * @return the matching plugin.jars model
- */
- IBuildModel getBuildModel();
- /**
- * Returns a top-level model object. Equivalent to
- * calling <pre>getPluginBase(true)</pre>.
- *
- * @return a top-level model object representing a plug-in or a fragment.
- */
- IPluginBase getPluginBase();
- /**
- * Returns a top-level model object.
- *
- * @param createIfMissing if true, root model object will
- * be created if not defined.
- *
- * @return a top-level model object
- */
- IPluginBase getPluginBase(boolean createIfMissing);
- /**
- * Returns </samp>true</samp> if this model is currently enabled.
- *
- *@return true if the model is enabled
- */
- boolean isEnabled();
- /**
- * Tests if this model is for the plug-in fragment.
- *
- * @return <code>true</code> if the model is for the fragment,
- * <code>false</code> otherwise.
- */
- boolean isFragmentModel();
- /**
- * Sets the enable state of the model.
- *
- * @param enabled the new enable state
- */
- void setEnabled(boolean enabled);
- /**
- * Returns the factory that can be used to
- * create new objects for this model
- * @return the plug-in model factory
- */
- IPluginModelFactory getPluginFactory();
- /**
- * Returns the location where property file containing
- * translations of names in this model can be found.
- *
- * @return the location of the property file with translations
- */
- URL getNLLookupLocation();
- /**
- * Returns the bundle description of the plug-in
- * in case the plug-in uses the new OSGi bundle layout.
- *
- * @return bundle description if this is an OSGi plug-in,
- * or <code>null</code> if the plug-in is in a classic
- * format.
- *
- * @since 3.0
- */
- BundleDescription getBundleDescription();
- /**
- * Associates the bundle description of the plug-in
- * with this model in case the plug-in uses the new
- * OSGi bundle layout.
- *
- * @param description bundle description to associate
- * with this model
- *
- * @since 3.0
- */
- void setBundleDescription(BundleDescription description);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelFactory.java
deleted file mode 100644
index bb9be28..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginModelFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-/**
- * This factory should be used to create
- * instances of the plug-in model objects.
- */
-public interface IPluginModelFactory extends IExtensionsModelFactory {
- /**
- * Creates a new plug-in import
- * @return a new plug-in import instance
- */
- IPluginImport createImport();
- /**
- * Creates a new library instance
- *
- *@return a new library instance
- */
- IPluginLibrary createLibrary();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginObject.java
deleted file mode 100644
index fb6a52c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginObject.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.pde.core.IWritable;
-/**
- * A base interface for all the objects in the plug-in model.
- */
-public interface IPluginObject extends IWritable, IAdaptable {
- /**
- * A property name that will be used to notify
- * that the "name" field has changed.
- */
- String P_NAME = "name"; //$NON-NLS-1$
- /**
- * Returns the model that owns this object.
- * @return the model instance
- */
- ISharedPluginModel getModel();
-
- /**
- * Returns the model that owns this object.
- * @return the model instance
- */
- IPluginModelBase getPluginModel();
- /**
- * Returns the name of this model object
- *@return the object name
- */
- String getName();
-
- /**
- * Returns true if this object is currently part of a model.
- * It is useful to ignore modification events of objects
- * that have not yet being added to the model or if they
- * have been removed.
- */
- boolean isInTheModel();
-
- /**
- * Set the value indicating whether the object is currently part of a model.
- * It is useful to ignore modification events of objects
- * that have not yet being added to the model or if they
- * have been removed.
- */
- void setInTheModel(boolean inModel);
-
- /**
- * Returns the translated name of this model object using
- * the result of 'getName()' call as a resource key.
- * @return the translated name or the original name if not found
- */
- String getTranslatedName();
-
- /**
- * Returns the parent of this model object.
- *
- * @return the object's parent
- */
- IPluginObject getParent();
- /**
- * Returns the top-level model object.
- *
- * @return the top-level model object
- */
- IPluginBase getPluginBase();
- /**
- * Returns a string by locating the provided
- * key in the resource bundle associated with
- * the model.
- *
- * @param key the name to use for resource bundle lookup
- * @return value in the resource bundle for
- * the provided key, or the key itself if
- * not found.
- */
- String getResourceString(String key);
- /**
- * Chances the name of this model object.
- * This method may throw a CoreException
- * if the model is not editable.
- *
- * @param name the new object name
- */
- void setName(String name) throws CoreException;
- /**
- * Returns <samp>true</samp> if this object has all
- * the required attributes set, <samp>false</samp> otherwise.
- * @return <samp>true</samp> if all the required attributes are set.
- */
- boolean isValid();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginParent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginParent.java
deleted file mode 100644
index 020c315..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginParent.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Classes that implement this interface are
- * capable of containing other plug-in objects.
- */
-public interface IPluginParent extends IPluginObject {
- /**
- * A property that will be used when firing notification
- * of the sibling swap.
- */
- String P_SIBLING_ORDER = "sibling_order"; //$NON-NLS-1$
- /**
- * Adds a child object at the specified index.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param index the location of the child
- * @param child the object to add
- */
- void add(int index, IPluginObject child) throws CoreException;
- /**
- * Adds a child object.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param child the object to add
- */
- void add(IPluginObject child) throws CoreException;
- /**
- * Returns the number of children
- * currently owned by this parent. Returns 0 if this is a lightweight model.
- *
- * @return the number of children
- */
- int getChildCount();
-
- /**
- * Returns the position of the child in this parent.
- * @param child a child of this parent
- * @return a 0-based index of the child
- */
- int getIndexOf(IPluginObject child);
- /**
- * Swaps the position of of the provided siblings
- * in the parent.
- * @param child1 the first child
- * @param child2 the second child
- * @throws CoreException thrown if the model is not editable.
- */
- void swap(IPluginObject child1, IPluginObject child2) throws CoreException;
- /**
- * Returns the children owned by this parent. Returns an empty array
- * if this is a lightweight model.
- *
- * @return an array of children
- */
- IPluginObject[] getChildren();
- /**
- * Removes a child object.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param child the object to remove
- */
- void remove(IPluginObject child) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginReference.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginReference.java
deleted file mode 100644
index 4f14e65..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/IPluginReference.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-/**
- * Object that implement this interface represent references of
- * plug-ins. Plug-ins are referenced using their identifiers,
- * and optionally versions and match rules.
- */
-public interface IPluginReference extends IIdentifiable, IMatchRules {
- /**
- * A name of the property that will be used to notify
- * about changes in the "match" field.
- */
- String P_MATCH = "match"; //$NON-NLS-1$
- /**
- * A name of the property that will be used to notify
- * about changes in the "version" field.
- */
- String P_VERSION = "version"; //$NON-NLS-1$
- /**
- * Returns the required match for the imported plug-in. The
- * choices are defined in IMatchRules interface.
- * @see IMatchRules
- * @return the desired type of the import plug-in match
- */
- int getMatch();
- /**
- * Returns the required version of the plug-in.
- *
- * @return required version or <samp>null</samp> if not set
- */
- String getVersion();
- /**
- * Sets the match type for the require plug-in.
- * This method will throw a CoreException if the model
- * is not editable.
- * @see IMatchRules
- * @param match the desired match type
- */
- void setMatch(int match) throws CoreException;
- /**
- * Sets the desired version of the required plug-in.
- * This method will throw a CoreException if
- * the model is not editable.
- *
- * @param version the required import plug-in version
- */
- void setVersion(String version) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedExtensionsModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedExtensionsModel.java
deleted file mode 100644
index 97df17b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedExtensionsModel.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-/**
- * This type of model is created by parsing the plug-in
- * manifest file but only takes the extensions and extension
- * points into account.
- *
- */
-public interface ISharedExtensionsModel extends ISharedPluginModel {
- /**
- * Returns a top-level model object. Equivalent to
- * calling <pre>getPluginBase(true)</pre>.
- * @return a top-level model object representing a plug-in or a fragment.
- */
- IExtensions getExtensions();
- /**
- * Returns a top-level model object.
- * @param createIfMissing if true, root model object will
- * be created if not defined.
- * @return a top-level model object
- */
- IExtensions getExtensions(boolean createIfMissing);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedPluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedPluginModel.java
deleted file mode 100644
index e821cb1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/core/plugin/ISharedPluginModel.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.core.plugin;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-/**
- * This type of model is created by parsing the manifest file.
- * It serves as a base interface for both plug-in and
- * fragment models by holding data common to both.
- * If the file is a workspace resource, it will be
- * available as the underlying resource of the model.
- * The model may be read-only or editable.
- * It will also make a reference to the build.properties
- * model when created. The reference will be of the
- * same type as the model itself: if the model is
- * editable, it will attempt to obtain an exclusive
- * editable copy of build.properties model.
- * <p>
- * The plug-in model can be disabled. Disabling the
- * model will not change its data. Users of the
- * model will have to decide if the disabled state
- * if of any importance to them or not.
- * <p>
- * The model is capable of notifying listeners
- * about changes. An attempt to change a read-only
- * model will result in a CoreException.
- */
-public interface ISharedPluginModel extends IModel, IModelChangeProvider {
- /**
- * Returns a factory object that should be used
- * to create new instances of the model objects.
- */
- IExtensionsModelFactory getFactory();
- /**
- * Returns a location of the file that was used
- * to create this model. The location can be that
- * of a directory or that of a JAR file.
- *
- * @return a location of the external model, or
- * <samp>null</samp> if the model is not created
- * from a resource or a file in the file system.
- */
- String getInstallLocation();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/AbstractModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/AbstractModel.java
deleted file mode 100644
index a36e6f8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/AbstractModel.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.IModelChangedListener;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.xml.sax.SAXException;
-
-public abstract class AbstractModel
- extends PlatformObject
- implements IModel, IModelChangeProviderExtension, Serializable {
- private transient List listeners;
- private boolean loaded;
- protected transient NLResourceHelper nlHelper;
- protected boolean disposed;
- private long timeStamp;
-
- public AbstractModel() {
- super();
- listeners = Collections.synchronizedList(new ArrayList());
- }
- public void addModelChangedListener(IModelChangedListener listener) {
- listeners.add(listener);
- }
- public void transferListenersTo(IModelChangeProviderExtension target, IModelChangedListenerFilter filter) {
- ArrayList removed=new ArrayList();
- for (int i=0; i<listeners.size(); i++) {
- IModelChangedListener listener = (IModelChangedListener)listeners.get(i);
- if (filter==null || filter.accept(listener)) {
- target.addModelChangedListener(listener);
- removed.add(listener);
- }
- }
- listeners.removeAll(removed);
- }
-
- protected NLResourceHelper createNLResourceHelper() {
- return null;
- }
-
- public NLResourceHelper getNLResourceHelper() {
- if (nlHelper == null)
- nlHelper = createNLResourceHelper();
- return nlHelper;
- }
-
- public void resetNLResourceHelper() {
- nlHelper = null;
- }
-
- public void dispose() {
- if (nlHelper != null) {
- nlHelper.dispose();
- nlHelper = null;
- }
- disposed = true;
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- IModelChangedListener [] list = (IModelChangedListener[])listeners.toArray(new IModelChangedListener[listeners.size()]);
- for (int i=0; i<list.length; i++) {
- IModelChangedListener listener = list[i];
- listener.modelChanged(event);
- }
- }
-
- public void fireModelObjectChanged(
- Object object,
- String property,
- Object oldValue,
- Object newValue) {
- fireModelChanged(
- new ModelChangedEvent(this, object, property, oldValue, newValue));
- }
-
- public String getResourceString(String key) {
- if (nlHelper == null) {
- nlHelper = createNLResourceHelper();
- }
- if (nlHelper == null)
- return key;
- if (key == null)
- return ""; //$NON-NLS-1$
- return nlHelper.getResourceString(key);
- }
- public IResource getUnderlyingResource() {
- return null;
- }
-
- protected boolean isInSync(File localFile) {
- return localFile.exists() && localFile.lastModified() == getTimeStamp();
- }
-
- public boolean isValid() {
- return !isDisposed() && isLoaded();
- }
-
- public final long getTimeStamp() {
- return timeStamp;
- }
-
- protected abstract void updateTimeStamp();
-
- protected void updateTimeStamp(File localFile) {
- if (localFile.exists())
- this.timeStamp = localFile.lastModified();
- }
-
- public boolean isDisposed() {
- return disposed;
- }
- public boolean isLoaded() {
- return loaded;
- }
-
- public void setLoaded(boolean loaded) {
- this.loaded = loaded;
- }
-
- public void removeModelChangedListener(IModelChangedListener listener) {
- listeners.remove(listener);
- }
-
- public void throwParseErrorsException(Throwable e) throws CoreException {
- Status status =
- new Status(
- IStatus.ERROR,
- PDECore.getPluginId(),
- IStatus.OK,
- PDECoreMessages.Errors_modelError,
- e);
- throw new CoreException(status);
- }
-
- protected SAXParser getSaxParser() throws ParserConfigurationException, SAXException, FactoryConfigurationError {
- return SAXParserFactory.newInstance().newSAXParser();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isReconcilingModel()
- */
- public boolean isReconcilingModel() {
- return false;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BinaryRepositoryProvider.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BinaryRepositoryProvider.java
deleted file mode 100644
index a739f45..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BinaryRepositoryProvider.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFileModificationValidator;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.team.IMoveDeleteHook;
-import org.eclipse.core.resources.team.IResourceTree;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.team.core.RepositoryProvider;
-
-public class BinaryRepositoryProvider extends RepositoryProvider {
- private IMoveDeleteHook moveDeleteHook;
- private IFileModificationValidator fileModificationValidator;
- class BinaryMoveDeleteHook implements IMoveDeleteHook {
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#deleteFile(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFile, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean deleteFile(
- IResourceTree tree,
- IFile file,
- int updateFlags,
- IProgressMonitor monitor) {
- if (isBinaryResource(file, true))
- tree.failed(createProblemStatus());
- else
- tree.standardDeleteFile(file, updateFlags, monitor);
- return true;
- }
-
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#deleteFolder(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFolder, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean deleteFolder(
- IResourceTree tree,
- IFolder folder,
- int updateFlags,
- IProgressMonitor monitor) {
- if (isBinaryResource(folder, true))
- tree.failed(createProblemStatus());
- else
- tree.standardDeleteFolder(folder, updateFlags, monitor);
- return true;
- }
-
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#deleteProject(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IProject, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean deleteProject(
- IResourceTree tree,
- IProject project,
- int updateFlags,
- IProgressMonitor monitor) {
- return false;
- }
-
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#moveFile(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFile, org.eclipse.core.resources.IFile, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean moveFile(
- IResourceTree tree,
- IFile source,
- IFile destination,
- int updateFlags,
- IProgressMonitor monitor) {
- if (isBinaryResource(source, false))
- tree.failed(createProblemStatus());
- else
- tree.standardMoveFile(source, destination, updateFlags, monitor);
- return true;
- }
-
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#moveFolder(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IFolder, org.eclipse.core.resources.IFolder, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean moveFolder(
- IResourceTree tree,
- IFolder source,
- IFolder destination,
- int updateFlags,
- IProgressMonitor monitor) {
- if (isBinaryResource(source, false))
- tree.failed(createProblemStatus());
- else
- tree.standardMoveFolder(source, destination, updateFlags, monitor);
- return true;
- }
-
- /**
- * @see org.eclipse.core.resources.team.IMoveDeleteHook#moveProject(org.eclipse.core.resources.team.IResourceTree, org.eclipse.core.resources.IProject, org.eclipse.core.resources.IProjectDescription, int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean moveProject(
- IResourceTree tree,
- IProject source,
- IProjectDescription description,
- int updateFlags,
- IProgressMonitor monitor) {
- return false;
- }
- }
-
- class BinaryFileModificationValidator
- implements IFileModificationValidator {
- /**
- * @see org.eclipse.core.resources.IFileModificationValidator#validateEdit(org.eclipse.core.resources.IFile, java.lang.Object)
- */
- public IStatus validateEdit(IFile[] files, Object context) {
- for (int i = 0; i < files.length; i++) {
- if (isBinaryResource(files[i], false)) {
- return createProblemStatus();
- }
- }
- return createOKStatus();
- }
-
- /**
- * @see org.eclipse.core.resources.IFileModificationValidator#validateSave(org.eclipse.core.resources.IFile)
- */
- public IStatus validateSave(IFile file) {
- if (isBinaryResource(file, false)) {
- return createProblemStatus();
- }
- return createOKStatus();
- }
- }
-
- public BinaryRepositoryProvider() {
- moveDeleteHook = new BinaryMoveDeleteHook();
- fileModificationValidator = new BinaryFileModificationValidator();
- }
-
- /**
- * @see org.eclipse.team.core.RepositoryProvider#configureProject()
- */
- public void configureProject() throws CoreException {
- IProject project = getProject();
- project.setPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY, PDECore.EXTERNAL_PROJECT_VALUE);
- }
-
- /**
- * @see org.eclipse.core.resources.IProjectNature#deconfigure()
- */
- public void deconfigure() throws CoreException {
- IProject project = getProject();
- project.setPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY, null);
- }
-
- /**
- * @see org.eclipse.team.core.RepositoryProvider#getFileModificationValidator()
- */
- public IFileModificationValidator getFileModificationValidator() {
- return fileModificationValidator;
- }
-
- /**
- * @see org.eclipse.team.core.RepositoryProvider#getID()
- */
- public String getID() {
- return PDECore.BINARY_REPOSITORY_PROVIDER;
- }
-
- /**
- * @see org.eclipse.team.core.RepositoryProvider#getMoveDeleteHook()
- */
- public IMoveDeleteHook getMoveDeleteHook() {
- return moveDeleteHook;
- }
-
- private boolean isBinaryResource(IResource resource, boolean excludeProjectChildren) {
- IContainer parent = resource.getParent();
-
- // Test for resource links
- if (!excludeProjectChildren || !(parent instanceof IProject)) {
- if (resource.isLinked())
- return true;
- }
-
- // Test for resources that are in linked folders
-
- while (parent instanceof IFolder) {
- IFolder folder = (IFolder) parent;
- if (folder.isLinked())
- return true;
- parent = folder.getParent();
- }
- return false;
- }
-
- private IStatus createProblemStatus() {
- String message = PDECoreMessages.BinaryRepositoryProvider_veto;
- return new Status(
- IStatus.ERROR,
- PDECore.PLUGIN_ID,
- IStatus.OK,
- message,
- null);
- }
-
- private IStatus createOKStatus() {
- return new Status(IStatus.OK, PDECore.PLUGIN_ID, IStatus.OK, "", //$NON-NLS-1$
- null);
- }
-
- public boolean canHandleLinkedResources() {
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
deleted file mode 100644
index 59d09fd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class ClasspathHelper {
-
- public static String getDevEntriesProperties(String fileName, boolean checkExcluded) {
- File file = new File(fileName);
- if (!file.exists()) {
- File directory = file.getParentFile();
- if (directory != null && (!directory.exists() || directory.isFile())) {
- directory.mkdirs();
- }
- }
- Properties properties = new Properties();
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- IPluginModelBase[] models = manager.getWorkspaceModels();
- for (int i = 0; i < models.length; i++) {
- String id = models[i].getPluginBase().getId();
- if (id == null)
- continue;
- String entry = writeEntry(getOutputFolders(models[i], checkExcluded));
- if (entry.length() > 0)
- properties.put(id, entry);
- }
- properties.put("@ignoredot@", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-
- FileOutputStream stream = null;
- try {
- stream = new FileOutputStream(fileName);
- properties.store(stream, ""); //$NON-NLS-1$
- stream.flush();
- return new URL("file:" + fileName).toString(); //$NON-NLS-1$
- } catch (IOException e) {
- PDECore.logException(e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- return getDevEntries(checkExcluded);
- }
-
- public static String getDevEntriesProperties(String fileName, Map map) {
- File file = new File(fileName);
- if (!file.exists()) {
- File directory = file.getParentFile();
- if (directory != null && (!directory.exists() || directory.isFile())) {
- directory.mkdirs();
- }
- }
- Properties properties = new Properties();
- Iterator iter = map.values().iterator();
- while (iter.hasNext()) {
- IPluginModelBase model = (IPluginModelBase)iter.next();
- if (model.getUnderlyingResource() != null) {
- String entry = writeEntry(getOutputFolders(model, true));
- if (entry.length() > 0)
- properties.put(model.getPluginBase().getId(), entry);
- }
- }
- properties.put("@ignoredot@", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-
- FileOutputStream stream = null;
- try {
- stream = new FileOutputStream(fileName);
- properties.store(stream, ""); //$NON-NLS-1$
- stream.flush();
- return new URL("file:" + fileName).toString(); //$NON-NLS-1$
- } catch (IOException e) {
- PDECore.logException(e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- return getDevEntries(true);
- }
-
- public static String getDevEntries(boolean checkExcluded) {
- IPluginModelBase[] models = PDECore.getDefault().getModelManager().getWorkspaceModels();
- ArrayList list = new ArrayList();
- for (int i = 0; i < models.length; i++) {
- String id = models[i].getPluginBase().getId();
- if (id == null || id.trim().length() == 0)
- continue;
- IPath[] paths = getOutputFolders(models[i], checkExcluded);
- for (int j = 0; j < paths.length; j++) {
- list.add(paths[j]);
- }
- }
- String entry = writeEntry((IPath[])list.toArray(new IPath[list.size()]));
- return entry.length() > 0 ? entry : "bin"; //$NON-NLS-1$
- }
-
- private static String writeEntry(IPath[] paths) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < paths.length; i++) {
- buffer.append(paths[i].toString());
- if (i < paths.length - 1)
- buffer.append(","); //$NON-NLS-1$
- }
- return buffer.toString();
- }
-
- public static Dictionary getDevDictionary(IPluginModelBase model) {
- if (model.getUnderlyingResource() == null)
- return null;
-
- String id = model.getPluginBase().getId();
- if (id == null || id.trim().length() == 0)
- return null;
- IPath[] paths = getOutputFolders(model, false);
- String entry = writeEntry(paths);
- Hashtable map = new Hashtable(2);
- map.put("@ignoredot@", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- map.put(id, entry.length() > 0 ? entry : "bin"); //$NON-NLS-1$
- return map;
- }
-
- private static IPath[] getOutputFolders(IPluginModelBase model, boolean checkExcluded) {
- ArrayList result = new ArrayList();
- IProject project = model.getUnderlyingResource().getProject();
- HashSet set = new HashSet();
- IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
- for (int i = 0; i < libraries.length; i++) {
- set.add(libraries[i].getName());
- }
- try {
- if (project.hasNature(JavaCore.NATURE_ID)) {
- IJavaProject jProject = JavaCore.create(project);
-
- List excluded = getFoldersToExclude(project, checkExcluded);
- IPath path = jProject.getOutputLocation();
- if (path != null && !excluded.contains(path))
- addPath(result, project, path);
-
- IClasspathEntry[] entries = jProject.getRawClasspath();
- for (int i = 0; i < entries.length; i++) {
- path = null;
- if (entries[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- path = entries[i].getOutputLocation();
- } else if (entries[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IPath candidate = entries[i].getPath().removeFirstSegments(1);
- if (candidate.segmentCount() == 0) {
- if (set.isEmpty() || set.contains(".")) //$NON-NLS-1$
- path = entries[i].getPath();
- } else if (set.contains(candidate.toString())) {
- path = entries[i].getPath();
- }
- }
- if (path != null && !excluded.contains(path)) {
- addPath(result, project, path);
- }
- }
- }
- } catch (JavaModelException e) {
- } catch (CoreException e) {
- }
- return (IPath[])result.toArray(new IPath[result.size()]);
- }
-
- private static void addPath(ArrayList result, IProject project, IPath path) {
- if (path.segmentCount() > 0 && path.segment(0).equals(project.getName())) {
- path = path.removeFirstSegments(1);
- if (path.segmentCount() == 0)
- path = new Path("."); //$NON-NLS-1$
- else {
- IResource resource = project.findMember(path);
- if (resource != null) {
- if (resource.isLinked()) {
- path = resource.getLocation();
- }
- } else {
- path = null;
- }
- }
- }
-
- if (path != null && !result.contains(path))
- result.add(path);
- }
-
- private static List getFoldersToExclude(IProject project, boolean checkExcluded) {
- ArrayList list = new ArrayList();
- if (checkExcluded) {
- IEclipsePreferences pref = new ProjectScope(project).getNode(PDECore.PLUGIN_ID);
- if (pref != null) {
- String binExcludes = pref.get(ICoreConstants.SELFHOSTING_BIN_EXCLUDES, ""); //$NON-NLS-1$
- StringTokenizer tokenizer = new StringTokenizer(binExcludes, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- list.add(new Path(tokenizer.nextToken().trim()));
- }
- }
- }
- return list;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java
deleted file mode 100644
index ff96c98..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.build.WorkspaceBuildModel;
-import org.eclipse.pde.internal.core.bundle.BundlePlugin;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.plugin.Plugin;
-
-public class ClasspathUtilCore {
-
- public static void addLibraries(IPluginModelBase model, ArrayList result) throws CoreException {
- if (new File(model.getInstallLocation()).isFile()) {
- addJARdPlugin(model, result);
- } else {
- IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
- for (int i = 0; i < libraries.length; i++) {
- if (IPluginLibrary.RESOURCE.equals(libraries[i].getType()))
- continue;
- IClasspathEntry entry = createLibraryEntry(libraries[i]);
- if (entry != null && !result.contains(entry)) {
- result.add(entry);
- }
- }
- }
- }
-
- private static void addJARdPlugin(IPluginModelBase model, ArrayList result)
- throws CoreException {
-
- IPath sourcePath = getSourceAnnotation(model, "."); //$NON-NLS-1$
- if (sourcePath == null)
- sourcePath = new Path(model.getInstallLocation());
-
- IClasspathEntry entry = JavaCore.newLibraryEntry(
- new Path(model.getInstallLocation()),
- sourcePath,
- null,
- false);
- if (entry != null && !result.contains(entry)) {
- result.add(entry);
- }
- }
-
- protected static IClasspathEntry createLibraryEntry(IPluginLibrary library) {
-
- IClasspathEntry entry = null;
- try {
- String name = library.getName();
- String expandedName = expandLibraryName(name);
-
- IPluginModelBase model = library.getPluginModel();
- IPath path = getPath(model, expandedName);
- if (path == null) {
- if (model.isFragmentModel() || !containsVariables(name))
- return null;
- model = resolveLibraryInFragments(library, expandedName);
- if (model == null)
- return null;
- path = getPath(model, expandedName);
- }
-
- // classpath must not contain entries referencing external folders
- if (model.getUnderlyingResource() == null && path.toFile().isDirectory())
- return null;
-
- entry = JavaCore.newLibraryEntry(
- path,
- getSourceAnnotation(model, expandedName),
- null,
- false);
- } catch (CoreException e) {
- }
- return entry;
- }
-
- public static boolean hasExtensibleAPI(IPlugin plugin) {
- if (plugin instanceof Plugin)
- return ((Plugin) plugin).hasExtensibleAPI();
- if (plugin instanceof BundlePlugin)
- return ((BundlePlugin) plugin).hasExtensibleAPI();
- return false;
- }
-
- public static boolean isBundle(IPluginModelBase model) {
- if (model instanceof IBundlePluginModelBase)
- return true;
- if (model.getUnderlyingResource() == null) {
- File location = new File(model.getInstallLocation());
- if (location.isDirectory() && !new File(location, "META-INF/MANIFEST.MF").exists()) //$NON-NLS-1$
- return false;
- Dictionary manifest = null;
- try {
- manifest = MinimalState.loadManifest(location);
- } catch (IOException e) {
- }
- if (manifest == null)
- return false;
- Enumeration keys = manifest.keys();
- while (keys.hasMoreElements()) {
- if (keys.nextElement().toString().equals("Bundle-SymbolicName")) //$NON-NLS-1$
- return true;
- }
- return false;
- }
- return false;
- }
-
- public static boolean containsVariables(String name) {
- return name.indexOf("$os$") != -1 //$NON-NLS-1$
- || name.indexOf("$ws$") != -1 //$NON-NLS-1$
- || name.indexOf("$nl$") != -1 //$NON-NLS-1$
- || name.indexOf("$arch$") != -1; //$NON-NLS-1$
- }
-
- public static String expandLibraryName(String source) {
- if (source == null || source.length() == 0)
- return ""; //$NON-NLS-1$
- if (source.indexOf("$ws$") != -1) //$NON-NLS-1$
- source =
- source.replaceAll(
- "\\$ws\\$", //$NON-NLS-1$
- "ws" + IPath.SEPARATOR + TargetPlatform.getWS()); //$NON-NLS-1$
- if (source.indexOf("$os$") != -1) //$NON-NLS-1$
- source =
- source.replaceAll(
- "\\$os\\$", //$NON-NLS-1$
- "os" + IPath.SEPARATOR + TargetPlatform.getOS()); //$NON-NLS-1$
- if (source.indexOf("$nl$") != -1) //$NON-NLS-1$
- source =
- source.replaceAll(
- "\\$nl\\$", //$NON-NLS-1$
- "nl" + IPath.SEPARATOR + TargetPlatform.getNL()); //$NON-NLS-1$
- if (source.indexOf("$arch$") != -1) //$NON-NLS-1$
- source =
- source.replaceAll(
- "\\$arch\\$", //$NON-NLS-1$
- "arch" + IPath.SEPARATOR + TargetPlatform.getOSArch()); //$NON-NLS-1$
- return source;
- }
-
- public static IPath getSourceAnnotation(IPluginModelBase model, String libraryName)
- throws CoreException {
- String zipName = getSourceZipName(libraryName);
- IPath path = getPath(model, zipName);
- if (path == null) {
- SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
- path = manager.findSourcePath(model.getPluginBase(), new Path(zipName));
- }
- return path;
- }
-
- public static String getSourceZipName(String libraryName) {
- int dot = libraryName.lastIndexOf('.');
- return (dot != -1) ? libraryName.substring(0, dot) + "src.zip" : libraryName; //$NON-NLS-1$
- }
-
- private static IPluginModelBase resolveLibraryInFragments(
- IPluginLibrary library,
- String libraryName) {
- IFragmentModel[] fragments =
- PDEManager.findFragmentsFor(library.getPluginModel());
-
- for (int i = 0; i < fragments.length; i++) {
- IPath path = getPath(fragments[i], libraryName);
- if (path != null)
- return fragments[i];
-
- // the following case is to account for cases when a plugin like org.eclipse.swt.win32 is checked out from
- // cvs (i.e. it has no library) and org.eclipse.swt is not in the workspace.
- // we have to find the external swt.win32 fragment to locate the $ws$/swt.jar.
- if (fragments[i].getUnderlyingResource() != null) {
- ModelEntry entry = PDECore.getDefault().getModelManager().findEntry(fragments[i].getFragment().getId());
- IPluginModelBase model = entry.getExternalModel();
- if (model != null && model instanceof IFragmentModel) {
- path = getPath(model, libraryName);
- if (path != null)
- return model;
- }
- }
- }
- return null;
- }
-
- private static IPath getPath(IPluginModelBase model, String libraryName) {
- IResource resource = model.getUnderlyingResource();
- if (resource != null) {
- IResource jarFile = resource.getProject().findMember(libraryName);
- if (jarFile != null)
- return jarFile.getFullPath();
- } else {
- File file = new File(model.getInstallLocation(), libraryName);
- if (file.exists())
- return new Path(file.getAbsolutePath());
- }
- return null;
- }
-
- public static IBuild getBuild(IPluginModelBase model)
- throws CoreException {
- IBuildModel buildModel = model.getBuildModel();
- if (buildModel == null) {
- IProject project = model.getUnderlyingResource().getProject();
- IFile buildFile = project.getFile("build.properties"); //$NON-NLS-1$
- if (buildFile.exists()) {
- buildModel = new WorkspaceBuildModel(buildFile);
- buildModel.load();
- }
- }
- return (buildModel != null) ? buildModel.getBuild() : null;
- }
-
- public static String getFilename(IPluginModelBase model) {
- StringBuffer buffer = new StringBuffer();
- String id = model.getPluginBase().getId();
- if (id != null)
- buffer.append(id);
- buffer.append("_"); //$NON-NLS-1$
- String version = model.getPluginBase().getVersion();
- if (version != null)
- buffer.append(version);
- buffer.append(".jar"); //$NON-NLS-1$
- return buffer.toString();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EclipseHomeInitializer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EclipseHomeInitializer.java
deleted file mode 100644
index 40c53c3..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EclipseHomeInitializer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jdt.core.ClasspathVariableInitializer;
-import org.eclipse.jdt.core.JavaCore;
-
-public class EclipseHomeInitializer extends ClasspathVariableInitializer {
-
-
- /**
- * @see ClasspathVariableInitializer#initialize(String)
- */
- public void initialize(String variable) {
- resetEclipseHomeVariable();
- }
-
- public static void resetEclipseHomeVariable() {
- try {
- Preferences pref = PDECore.getDefault().getPluginPreferences();
- String platformHome = pref.getString(ICoreConstants.PLATFORM_PATH);
- JavaCore.setClasspathVariable(
- PDECore.ECLIPSE_HOME_VARIABLE,
- new Path(platformHome),
- null);
- } catch (CoreException e) {
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EntryFileAdapter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EntryFileAdapter.java
deleted file mode 100644
index 5c17375..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/EntryFileAdapter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-
-public class EntryFileAdapter extends FileAdapter {
- private ModelEntry entry;
-
- /**
- * Constructor for EntryFileAdapter.
- * @param parent
- * @param file
- */
- public EntryFileAdapter(ModelEntry entry, File file, IFileAdapterFactory factory) {
- super(null, file, factory);
- this.entry = entry;
- }
-
- public ModelEntry getEntry() {
- return entry;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExecutionEnvironmentAnalyzer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExecutionEnvironmentAnalyzer.java
deleted file mode 100644
index 6d13c43..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExecutionEnvironmentAnalyzer.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.IVMInstall3;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.CompatibleEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
-
-public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyzerDelegate {
-
- public static final String JavaSE_1_6 = "JavaSE-1.6"; //$NON-NLS-1$
- public static final String J2SE_1_5 = "J2SE-1.5"; //$NON-NLS-1$
- public static final String J2SE_1_4 = "J2SE-1.4"; //$NON-NLS-1$
- public static final String J2SE_1_3 = "J2SE-1.3"; //$NON-NLS-1$
- public static final String J2SE_1_2 = "J2SE-1.2"; //$NON-NLS-1$
- public static final String JRE_1_1 = "JRE-1.1"; //$NON-NLS-1$
-
- public static final String CDC_FOUNDATION_1_1 = "CDC-1.1/Foundation-1.1"; //$NON-NLS-1$
- public static final String CDC_FOUNDATION_1_0 = "CDC-1.0/Foundation-1.0"; //$NON-NLS-1$
-
- public static final String OSGI_MINIMUM_1_0 = "OSGi/Minimum-1.0"; //$NON-NLS-1$
- public static final String OSGI_MINIMUM_1_1 = "OSGi/Minimum-1.1"; //$NON-NLS-1$
-
- public static final String JAVA_SPEC_VERSION = "java.specification.version"; //$NON-NLS-1$
- public static final String JAVA_SPEC_NAME = "java.specification.name"; //$NON-NLS-1$
- public static final String J2ME_NAME = "J2ME Foundation Specification"; //$NON-NLS-1$
-
- public static final String[] VM_PROPERTIES = {JAVA_SPEC_NAME, JAVA_SPEC_VERSION};
-
-
- public static String getCompliance(String ee) {
- if (ee == null)
- return null;
- if (JavaSE_1_6.equals(ee))
- return JavaCore.VERSION_1_6;
- if (J2SE_1_5.equals(ee))
- return JavaCore.VERSION_1_5;
- if (J2SE_1_4.equals(ee) || CDC_FOUNDATION_1_1.equals(ee))
- return JavaCore.VERSION_1_4;
- return JavaCore.VERSION_1_3;
- }
-
- public static String[] getKnownExecutionEnvironments() {
- return new String[] {
- JRE_1_1,
- J2SE_1_2,
- OSGI_MINIMUM_1_0,
- OSGI_MINIMUM_1_1,
- CDC_FOUNDATION_1_0,
- J2SE_1_3,
- CDC_FOUNDATION_1_1,
- J2SE_1_4,
- J2SE_1_5,
- JavaSE_1_6};
- }
-
- public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor)
- throws CoreException {
-
- ArrayList result = new ArrayList();
-
- if (vm instanceof IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) vm;
-
- String javaVersion = vm2.getJavaVersion();
- if (javaVersion == null)
- return new CompatibleEnvironment[0];
-
- if (javaVersion.compareTo("1.6") >= 0) //$NON-NLS-1$
- addEnvironment(result, JavaSE_1_6, javaVersion.startsWith("1.6")); //$NON-NLS-1$
-
- if (javaVersion.compareTo("1.5") >= 0) //$NON-NLS-1$
- addEnvironment(result, J2SE_1_5, javaVersion.startsWith("1.5")); //$NON-NLS-1$
-
- if (javaVersion.compareTo("1.4") >= 0) { //$NON-NLS-1$
- addEnvironment(result, J2SE_1_4, javaVersion.startsWith("1.4")); //$NON-NLS-1$
- boolean perfect = false;
- if (vm instanceof IVMInstall3) {
- Map map = ((IVMInstall3)vm).evaluateSystemProperties(VM_PROPERTIES , null);
- perfect = "1.1".equals(map.get(JAVA_SPEC_VERSION)) //$NON-NLS-1$
- && J2ME_NAME.equals(map.get(JAVA_SPEC_NAME));
- }
- addEnvironment(result, CDC_FOUNDATION_1_1, perfect);
-
- }
-
- if (javaVersion.compareTo("1.3") >= 0) { //$NON-NLS-1$
- addEnvironment(result, J2SE_1_3, javaVersion.startsWith("1.3")); //$NON-NLS-1$
- boolean perfect = false;
- if (vm instanceof IVMInstall3) {
- Map map = ((IVMInstall3)vm).evaluateSystemProperties(VM_PROPERTIES , null);
- perfect = "1.0".equals(map.get(JAVA_SPEC_VERSION)) //$NON-NLS-1$
- && J2ME_NAME.equals(map.get(JAVA_SPEC_NAME));
- }
- addEnvironment(result, CDC_FOUNDATION_1_0, perfect);
- addEnvironment(result, OSGI_MINIMUM_1_1, false);
- addEnvironment(result, OSGI_MINIMUM_1_0, false);
- }
-
- if (javaVersion.compareTo("1.2") >= 0) //$NON-NLS-1$
- addEnvironment(result, J2SE_1_2, javaVersion.startsWith("1.2")); //$NON-NLS-1$
-
- if (javaVersion.compareTo("1.1") >= 0) //$NON-NLS-1$
- addEnvironment(result, JRE_1_1, javaVersion.startsWith("1.1")); //$NON-NLS-1$
- }
- return (CompatibleEnvironment[])result.toArray(new CompatibleEnvironment[result.size()]);
- }
-
- private void addEnvironment(ArrayList result, String id, boolean strict) {
- IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
- IExecutionEnvironment env = manager.getEnvironment(id);
- if (env != null)
- result.add(new CompatibleEnvironment(env, strict));
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExtensionsHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExtensionsHandler.java
deleted file mode 100644
index d5cfb31..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExtensionsHandler.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.Stack;
-
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class ExtensionsHandler extends DefaultHandler {
-
- private Stack fOpenElements;
-
- private Locator fLocator;
-
- private Element fParent;
-
- public ExtensionsHandler(Element parent) {
- fParent = parent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#processingInstruction(java.lang.String,
- * java.lang.String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
- * java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- if (fOpenElements == null) {
- if ((qName.equals("plugin") || qName.equals("fragment"))) { //$NON-NLS-1$ //$NON-NLS-2$
- fOpenElements = new Stack();
- }
- } else if (fOpenElements.size() == 0) {
- if (qName.equals("extension")) { //$NON-NLS-1$
- createExtension(attributes);
- } else if (qName.equals("extension-point")) { //$NON-NLS-1$
- createExtensionPoint(attributes);
- }
- } else {
- createElement(qName, attributes);
- }
- }
-
- /**
- * @param attributes
- */
- private void createExtension(Attributes attributes) {
- Element extension = fParent.getOwnerDocument().createElement("extension"); //$NON-NLS-1$
- String point = attributes.getValue("point"); //$NON-NLS-1$
- if (point == null)
- return;
- extension.setAttribute("point", point); //$NON-NLS-1$
-
- String id = attributes.getValue("id"); //$NON-NLS-1$
- if (id != null)
- extension.setAttribute("id", id); //$NON-NLS-1$
-
- String name = attributes.getValue("name"); //$NON-NLS-1$
- if (name != null)
- extension.setAttribute("name", name); //$NON-NLS-1$
-
- extension.setAttribute("line", Integer.toString(fLocator.getLineNumber())); //$NON-NLS-1$
-
- fParent.appendChild(extension);
-
- if (CoreUtility.isInterestingExtensionPoint(point))
- fOpenElements.push(extension);
- }
-
- /**
- * @param attributes
- */
- private void createExtensionPoint(Attributes attributes) {
- Element extPoint = fParent.getOwnerDocument().createElement("extension-point"); //$NON-NLS-1$
-
- String id = attributes.getValue("id"); //$NON-NLS-1$
- if (id == null)
- return;
- extPoint.setAttribute("id", id); //$NON-NLS-1$
-
- String name = attributes.getValue("name"); //$NON-NLS-1$
- if (name == null)
- return;
- extPoint.setAttribute("name", name); //$NON-NLS-1$
-
- String schema = attributes.getValue("schema"); //$NON-NLS-1$
- if (schema != null)
- extPoint.setAttribute("schema", schema); //$NON-NLS-1$
-
- extPoint.setAttribute("line", Integer.toString(fLocator.getLineNumber())); //$NON-NLS-1$
-
- fParent.appendChild(extPoint);
- }
-
- private void createElement(String tagName, Attributes attributes) {
- Element element = fParent.getOwnerDocument().createElement(tagName);
- for (int i = 0; i < attributes.getLength(); i++) {
- element.setAttribute(attributes.getQName(i), attributes.getValue(i));
- }
- ((Element)fOpenElements.peek()).appendChild(element);
- fOpenElements.push(element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
- * java.lang.String, java.lang.String)
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- if (fOpenElements != null && !fOpenElements.isEmpty())
- fOpenElements.pop();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- fLocator = locator;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalFeatureModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalFeatureModelManager.java
deleted file mode 100644
index 228f8d6..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalFeatureModelManager.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.pde.core.IModelProviderEvent;
-import org.eclipse.pde.core.IModelProviderListener;
-import org.eclipse.pde.internal.core.feature.ExternalFeatureModel;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-
-public class ExternalFeatureModelManager implements
- Preferences.IPropertyChangeListener {
-
- /**
- *
- * @param manifest
- * @return ExternalFeatureModel or null
- */
- private static IFeatureModel createModel(File manifest) {
- ExternalFeatureModel model = new ExternalFeatureModel();
- model.setInstallLocation(manifest.getParent());
- InputStream stream = null;
- try {
- stream = new FileInputStream(manifest);
- model.load(stream, false);
- return model;
- } catch (Exception e) {
- } finally {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- }
- }
- }
- return null;
- }
-
- /**
- * @param monitor
- * @return IFeatureModel[]
- */
- private static IFeatureModel[] createModels(String platformHome) {
- URL[] featurePaths = PluginPathFinder.getFeaturePaths(platformHome);
- Map uniqueFeatures = new HashMap();
- for (int i = 0; i < featurePaths.length; i++) {
- File manifest = new File(featurePaths[i].getFile(), "feature.xml"); //$NON-NLS-1$
- IFeatureModel model = createModel(manifest);
- if (model != null && model.isLoaded()) {
- IFeature feature = model.getFeature();
- uniqueFeatures.put(
- feature.getId() + "_" + feature.getVersion(), model); //$NON-NLS-1$
- }
- }
- Collection models = uniqueFeatures.values();
- return (IFeatureModel[]) models
- .toArray(new IFeatureModel[models.size()]);
- }
-
- private Vector fListeners = new Vector();
-
- private IFeatureModel[] fModels;
-
- private String fPlatformHome;
-
- private Preferences fPref;
-
- public ExternalFeatureModelManager() {
- fPref = PDECore.getDefault().getPluginPreferences();
- }
-
- public void addModelProviderListener(IModelProviderListener listener) {
- fListeners.add(listener);
- }
-
- private boolean equalPaths(String path1, String path2) {
- if (path1 == null) {
- if (path2 == null) {
- return true;
- }
- return false;
- }
- if (path2 == null) {
- return false;
- }
- return new File(path1).equals(new File(path2));
-
- }
-
- private void fireModelProviderEvent(IModelProviderEvent e) {
- for (Iterator iter = fListeners.iterator(); iter.hasNext();) {
- IModelProviderListener listener = (IModelProviderListener) iter
- .next();
- listener.modelsChanged(e);
- }
- }
-
- /**
- * @param propertyValue
- * @return String or null
- */
- private String getPathString(Object propertyValue) {
- if (propertyValue != null && propertyValue instanceof String) {
- String path = (String) propertyValue;
- if (path.length() > 0) {
- return path;
- }
- }
- return null;
- }
-
- public void loadModels(String platformHome) {
- IFeatureModel[] newModels;
- if (platformHome != null && platformHome.length() > 0) {
- newModels = createModels(platformHome);
- } else {
- newModels = new IFeatureModel[0];
- }
-
- fPlatformHome = platformHome;
-
- IFeatureModel[] oldModels = fModels != null ? fModels
- : new IFeatureModel[0];
- fModels = newModels;
- notifyListeners(oldModels, newModels);
- }
-
- private void notifyListeners(IFeatureModel[] oldModels,
- IFeatureModel[] newFeatureModels) {
- if (oldModels.length > 0 || newFeatureModels.length > 0) {
- int type = 0;
- if (oldModels.length > 0)
- type |= IModelProviderEvent.MODELS_REMOVED;
- if (newFeatureModels.length > 0)
- type |= IModelProviderEvent.MODELS_ADDED;
- ModelProviderEvent replacedFeatures = new ModelProviderEvent(this,
- type, newFeatureModels, oldModels, null);
- fireModelProviderEvent(replacedFeatures);
- }
-
- }
-
- private synchronized void platformPathChanged(String newHome) {
- if (!equalPaths(newHome, fPlatformHome)) {
- loadModels(newHome);
- }
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (!ICoreConstants.PLATFORM_PATH.equals(event.getProperty())) {
- return;
- }
- String newHome = getPathString(event.getNewValue());
- platformPathChanged(newHome);
- }
-
- public void removeModelProviderListener(IModelProviderListener listener) {
- fListeners.remove(listener);
- }
-
- public synchronized void shutdown() {
- fPref.removePropertyChangeListener(this);
- loadModels(null);
- }
-
- public synchronized void startup() {
- fPref.addPropertyChangeListener(this);
- loadModels(fPref.getString(ICoreConstants.PLATFORM_PATH));
- }
-
- public synchronized void reload() {
- loadModels(fPref.getString(ICoreConstants.PLATFORM_PATH));
- }
-
- public IFeatureModel[] getModels() {
- return fModels;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchClasspathContainer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchClasspathContainer.java
deleted file mode 100644
index c86ee3e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchClasspathContainer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-
-/**
- *
- */
-public class ExternalJavaSearchClasspathContainer implements IClasspathContainer {
- private SearchablePluginsManager manager;
-
- private IClasspathEntry[] fEntries;
-
- /**
- * Constructor for RequiredPluginsClasspathContainer.
- */
- public ExternalJavaSearchClasspathContainer(SearchablePluginsManager manager) {
- this.manager = manager;
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- if (manager==null) return new IClasspathEntry[0];
- if (fEntries == null) {
- try {
- fEntries = manager.computeContainerClasspathEntries();
- }
- catch (CoreException e) {
- PDECore.logException(e);
- }
- }
- return fEntries;
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- return PDECoreMessages.ExternalJavaSearchClasspathContainer_description;
- }
-
- public int getKind() {
- return K_APPLICATION;
- }
-
- public IPath getPath() {
- return new Path(PDECore.JAVA_SEARCH_CONTAINER_ID);
- }
-
- public void reset() {
- fEntries = null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchInitializer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchInitializer.java
deleted file mode 100644
index 87da608..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalJavaSearchInitializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ClasspathContainerInitializer;
-import org.eclipse.jdt.core.IJavaProject;
-
-/**
- *
- */
-public class ExternalJavaSearchInitializer extends ClasspathContainerInitializer {
-
- /**
- * Constructor for RequiredPluginsInitializer.
- */
- public ExternalJavaSearchInitializer() {
- super();
- }
-
- /**
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(IPath, IJavaProject)
- */
- public void initialize(IPath containerPath, IJavaProject javaProject)
- throws CoreException {
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- SearchablePluginsManager searchManager = manager.getSearchablePluginsManager();
- searchManager.updateClasspathContainer(javaProject);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalModelManager.java
deleted file mode 100644
index 7668ca8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ExternalModelManager.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.pde.core.IModelProviderEvent;
-import org.eclipse.pde.core.IModelProviderListener;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class ExternalModelManager {
-
- private Vector fListeners = new Vector();
- private IPluginModelBase[] fModels = new IPluginModelBase[0];
-
-
- public static String computeDefaultPlatformPath() {
- URL installURL = Platform.getInstallLocation().getURL();
- IPath ppath = new Path(installURL.getFile()).removeTrailingSeparator();
- return getCorrectPath(ppath.toOSString());
- }
-
- public static boolean isTargetEqualToHost(String platformPath) {
- return arePathsEqual(new Path(platformPath), new Path(computeDefaultPlatformPath()));
- }
-
- private static String getCorrectPath(String path) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < path.length(); i++) {
- char c = path.charAt(i);
- if (Platform.getOS().equals("win32")) { //$NON-NLS-1$
- if (i == 0 && c == '/')
- continue;
- }
- // Some VMs may return %20 instead of a space
- if (c == '%' && i + 2 < path.length()) {
- char c1 = path.charAt(i + 1);
- char c2 = path.charAt(i + 2);
- if (c1 == '2' && c2 == '0') {
- i += 2;
- buf.append(" "); //$NON-NLS-1$
- continue;
- }
- }
- buf.append(c);
- }
- return buf.toString();
- }
- public static IPath getEclipseHome() {
- Preferences preferences = PDECore.getDefault().getPluginPreferences();
- return new Path(preferences.getString(ICoreConstants.PLATFORM_PATH));
- }
-
- public static boolean arePathsEqual(IPath path1, IPath path2) {
- String device = path1.getDevice();
- if (device != null)
- path1 = path1.setDevice(device.toUpperCase());
-
- device = path2.getDevice();
- if (device != null)
- path2 = path2.setDevice(device.toUpperCase());
-
- return path1.equals(path2);
- }
-
- public void addModelProviderListener(IModelProviderListener listener) {
- fListeners.add(listener);
- }
-
- private Vector createSavedList(String saved) {
- Vector result = new Vector();
- StringTokenizer stok = new StringTokenizer(saved);
- while (stok.hasMoreTokens()) {
- result.add(stok.nextToken());
- }
- return result;
- }
-
- private void enableAll() {
- for (int i = 0; i < fModels.length; i++)
- fModels[i].setEnabled(true);
- }
-
- public void fireModelProviderEvent(IModelProviderEvent e) {
- for (Iterator iter = fListeners.iterator(); iter.hasNext();) {
- IModelProviderListener listener = (IModelProviderListener) iter.next();
- listener.modelsChanged(e);
- }
- }
-
- protected IPluginModelBase[] getAllModels() {
- return fModels;
- }
-
- protected void initializeModels(IPluginModelBase[] models) {
- fModels = models;
- Preferences pref = PDECore.getDefault().getPluginPreferences();
- String saved = pref.getString(ICoreConstants.CHECKED_PLUGINS);
- if (saved.equals(ICoreConstants.VALUE_SAVED_ALL))
- enableAll();
- else if (!saved.equals(ICoreConstants.VALUE_SAVED_NONE)) {
- Vector list = createSavedList(saved);
- for (int i = 0; i < fModels.length; i++) {
- fModels[i].setEnabled(!list.contains(fModels[i].getPluginBase().getId()));
- }
- }
- }
-
- public void setModels(IPluginModelBase[] models) {
- fModels = models;
- }
-
- public static URL[] getPluginPaths() {
- Preferences pref = PDECore.getDefault().getPluginPreferences();
- return PluginPathFinder.getPluginPaths(pref.getString(ICoreConstants.PLATFORM_PATH));
- }
-
- public void removeModelProviderListener(IModelProviderListener listener) {
- fListeners.remove(listener);
- }
-
- public void shutdown() {
- int disabled = 0;
- StringBuffer saved = new StringBuffer();
- for (int i = 0; i < fModels.length; i++) {
- IPluginModelBase model = fModels[i];
- if (!model.isEnabled()) {
- disabled += 1;
- if (saved.length() > 0) saved.append(" "); //$NON-NLS-1$
- saved.append(model.getPluginBase().getId());
- }
- }
-
- Preferences pref= PDECore.getDefault().getPluginPreferences();
- if (disabled == 0) {
- pref.setValue(ICoreConstants.CHECKED_PLUGINS, ICoreConstants.VALUE_SAVED_ALL);
- } else if (disabled == fModels.length) {
- pref.setValue(
- ICoreConstants.CHECKED_PLUGINS,
- ICoreConstants.VALUE_SAVED_NONE);
- } else {
- pref.setValue(ICoreConstants.CHECKED_PLUGINS, saved.toString());
- }
-
- PDECore.getDefault().savePluginPreferences();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelDelta.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelDelta.java
deleted file mode 100644
index 68cec80..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelDelta.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-
-public class FeatureModelDelta implements IFeatureModelDelta {
- private ArrayList fAdded;
-
- private ArrayList fRemoved;
-
- private ArrayList fChanged;
-
- private int kind = 0;
-
- public FeatureModelDelta() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.IFeatureModelDelta#getKind()
- */
- public int getKind() {
- return kind;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.IFeatureModelDelta#getAdded()
- */
- public IFeatureModel[] getAdded() {
- return get(fAdded);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.IFeatureModelDelta#getRemoved()
- */
- public IFeatureModel[] getRemoved() {
- return get(fRemoved);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.IFeatureModelDelta#getChanged()
- */
- public IFeatureModel[] getChanged() {
- return get(fChanged);
- }
-
- private IFeatureModel[] get(ArrayList list) {
- if (list == null)
- return new IFeatureModel[0];
- return (IFeatureModel[]) list.toArray(new IFeatureModel[list.size()]);
- }
-
- void add(IFeatureModel model, int type) {
- switch (type) {
- case ADDED:
- fAdded = add(fAdded, model);
- break;
- case REMOVED:
- fRemoved = add(fRemoved, model);
- break;
- case CHANGED:
- fChanged = add(fChanged, model);
- break;
- }
- kind |= type;
- }
-
- private ArrayList add(ArrayList list, IFeatureModel model) {
- if (list == null)
- list = new ArrayList();
- list.add(model);
- return list;
- }
-
- boolean contains(IFeatureModel model, int type) {
- if ((type & ADDED) != 0 && fAdded != null && fAdded.contains(model)) {
- return true;
- }
- if ((type & REMOVED) != 0 && fRemoved != null
- && fRemoved.contains(model)) {
- return true;
- }
- if ((type & CHANGED) != 0 && fChanged != null
- && fChanged.contains(model)) {
- return true;
- }
- return false;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelManager.java
deleted file mode 100644
index 36b7806..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureModelManager.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelProviderEvent;
-import org.eclipse.pde.core.IModelProviderListener;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-
-/**
- * Manages all feature models in the workspace, and maximum one external feature
- * model for a given id and version. While workspace model(s) exist with the
- * same id and version as an external model, the external model is inactive (not
- * exposed).
- */
-
-public class FeatureModelManager {
-
- /**
- * All models in workspace, and those external models that have no
- * corresponding workspace model with the same id and version
- */
- private FeatureTable fActiveModels;
-
- /**
- * External models masked by workspace models with the same id and version.
- */
- private FeatureTable fInactiveModels;
-
- private ExternalFeatureModelManager fExternalManager;
-
- private boolean fReloadExternalNeeded = false;
-
- private WorkspaceModelManager fWorkspaceManager;
-
- private IModelProviderListener fProviderListener;
-
- /**
- * List of IFeatureModelListener
- */
- private ArrayList fListeners;
-
- public FeatureModelManager(WorkspaceModelManager wm) {
- fWorkspaceManager = wm;
- fListeners = new ArrayList();
- }
-
- public synchronized void shutdown() {
- if (fWorkspaceManager != null)
- fWorkspaceManager.removeModelProviderListener(fProviderListener);
- if (fExternalManager != null){
- fExternalManager.removeModelProviderListener(fProviderListener);
- fExternalManager.shutdown();
- }
- }
-
- private synchronized void init() {
- if (fActiveModels != null) {
- if (fReloadExternalNeeded) {
- fReloadExternalNeeded = false;
- fExternalManager.reload();
- }
- return;
- }
-
- fActiveModels = new FeatureTable();
- fInactiveModels = new FeatureTable();
-
- fProviderListener = new IModelProviderListener() {
- public void modelsChanged(IModelProviderEvent e) {
- handleModelsChanged(e);
- }
- };
- fWorkspaceManager.addModelProviderListener(fProviderListener);
-
- IFeatureModel[] models = fWorkspaceManager.getFeatureModels();
- for (int i = 0; i < models.length; i++) {
- // add all workspace models, including invalid or duplicate (save
- // id, ver)
- fActiveModels.add(models[i]);
- }
-
- fExternalManager = new ExternalFeatureModelManager();
- fExternalManager.addModelProviderListener(fProviderListener);
- fReloadExternalNeeded = false;
- fExternalManager.startup();
- }
-
- /*
- * @return all active features
- */
- public IFeatureModel[] getModels() {
- init();
- IFeatureModel[] allModels = fActiveModels.getAll();
- ArrayList valid = new ArrayList(allModels.length);
- for( int i =0; i< allModels.length; i++){
- if(allModels[i].isValid()){
- valid.add(allModels[i]);
- }
- }
- return (IFeatureModel[])valid.toArray(new IFeatureModel[valid.size()]);
- }
-
- public IFeatureModel[] getWorkspaceModels() {
- return fWorkspaceManager.getFeatureModels();
- }
-
- /**
- * Finds active model with a given id and version
- *
- * @param id
- * @param version
- * @return one IFeature model or null
- */
- public IFeatureModel findFeatureModel(String id, String version) {
- init();
- IFeatureModel[] models = fActiveModels.get(id, version);
- for (int i = 0; i < models.length; i++) {
- if (models[i].isValid()) {
- return models[i];
- }
- }
- if (models.length == 0 && "0.0.0".equals(version)) { //$NON-NLS-1$
- return findFeatureModel(id);
- }
- return null;
- }
-
- /**
- * Finds active model with the given id and version. If feature is not
- * found, but a feature with qualifier set to qualifier exists it will be
- * returned.
- *
- * @param id
- * @param version
- * @return IFeatureModel or null
- */
- public IFeatureModel findFeatureModelRelaxed(String id, String version) {
- IFeatureModel model = findFeatureModel(id, version);
- if (model != null) {
- return model;
- }
- PluginVersionIdentifier pvi = new PluginVersionIdentifier(version);
- return findFeatureModel(id, pvi.getMajorComponent() + "." //$NON-NLS-1$
- + pvi.getMinorComponent() + "." //$NON-NLS-1$
- + pvi.getServiceComponent() + ".qualifier"); //$NON-NLS-1$
- }
-
- /**
- * Finds active models with a given id
- *
- * @param id
- * @param version
- * @return IFeature model[]
- */
- public IFeatureModel[] findFeatureModels(String id) {
- init();
- IFeatureModel[] models = fActiveModels.get(id);
- ArrayList valid = new ArrayList(models.length);
- for( int i =0; i< models.length; i++){
- if(models[i].isValid()){
- valid.add(models[i]);
- }
- }
- return (IFeatureModel[])valid.toArray(new IFeatureModel[valid.size()]);
- }
-
- public IFeatureModel findFeatureModel(String id) {
- IFeatureModel[] models = findFeatureModels(id);
- IFeatureModel model = null;
- for (int i = 0; i < models.length; i++) {
- if (model == null) {
- model = models[i];
- } else {
- String version = model.getFeature().getVersion();
- String version2 = models[i].getFeature().getVersion();
- PluginVersionIdentifier vid = new PluginVersionIdentifier(version);
- PluginVersionIdentifier vid2 = new PluginVersionIdentifier(version2);
- if (vid2.isGreaterOrEqualTo(vid)) {
- model = models[i];
- }
- }
- }
- return model;
- }
-
- private void handleModelsChanged(IModelProviderEvent e) {
- init();
- IFeatureModelDelta delta = processEvent(e);
-
- Object[] entries = fListeners.toArray();
- for (int i = 0; i < entries.length; i++) {
- ((IFeatureModelListener) entries[i]).modelsChanged(delta);
- }
- }
-
- /**
- * @param e
- * @return
- */
- private synchronized IFeatureModelDelta processEvent(IModelProviderEvent e) {
- FeatureModelDelta delta = new FeatureModelDelta();
- /*
- * Set of Idvers for which there might be necessary to move a model
- * between active models and inactive models
- */
- Set affectedIdVers = null;
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_REMOVED) != 0) {
- IModel[] removed = e.getRemovedModels();
- for (int i = 0; i < removed.length; i++) {
- if (!(removed[i] instanceof IFeatureModel))
- continue;
- IFeatureModel model = (IFeatureModel) removed[i];
- FeatureTable.Idver idver = fActiveModels.remove(model);
- if (idver != null) {
- // may need to activate another model
- if (affectedIdVers == null)
- affectedIdVers = new HashSet();
- affectedIdVers.add(idver);
- delta.add(model, IFeatureModelDelta.REMOVED);
- } else {
- fInactiveModels.remove(model);
- }
- }
- }
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_ADDED) != 0) {
- IModel[] added = e.getAddedModels();
- for (int i = 0; i < added.length; i++) {
- if (!(added[i] instanceof IFeatureModel))
- continue;
- IFeatureModel model = (IFeatureModel) added[i];
- if (model.getUnderlyingResource() != null) {
- FeatureTable.Idver idver = fActiveModels.add(model);
- delta.add(model, IFeatureModelDelta.ADDED);
- // may need to deactivate another model
- if (affectedIdVers == null)
- affectedIdVers = new HashSet();
- affectedIdVers.add(idver);
- } else {
- if (!model.isValid()) {
- // ignore invalid external models
- continue;
- }
- String id = model.getFeature().getId();
- String version = model.getFeature().getVersion();
- if (fInactiveModels.get(id, version).length > 0) {
- // ignore duplicate external models
- continue;
- }
- IFeatureModel[] activeModels = fActiveModels.get(id,
- version);
- for (int j = 0; j < activeModels.length; j++) {
- if (activeModels[j].getUnderlyingResource() == null) {
- // ignore duplicate external models
- continue;
- }
- }
- FeatureTable.Idver idver = fInactiveModels.add(model);
- // may need to activate this model
- if (affectedIdVers == null)
- affectedIdVers = new HashSet();
- affectedIdVers.add(idver);
- }
- }
- }
-
- /* 1. Reinsert with a new id and version, if necessary */
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_CHANGED) != 0) {
- IModel[] changed = e.getChangedModels();
- for (int i = 0; i < changed.length; i++) {
- if (!(changed[i] instanceof IFeatureModel))
- continue;
- IFeatureModel model = (IFeatureModel) changed[i];
-
- String id = model.getFeature().getId();
- String version = model.getFeature().getVersion();
-
- FeatureTable.Idver oldIdver = fActiveModels.get(model);
- if (oldIdver != null && !oldIdver.equals(id, version)) {
- // version changed
- FeatureTable.Idver idver = fActiveModels.add(model);
- if (affectedIdVers == null)
- affectedIdVers = new HashSet();
- affectedIdVers.add(oldIdver);
- affectedIdVers.add(idver);
- }
- /*
- * no need to check inactive models, because external features
- * do not chance or version
- */
-
- }
- }
- /* 2. Move features between active and inactive tables if necessary */
- adjustExternalVisibility(delta, affectedIdVers);
- /*
- * 3. Changed models that do result in FeatureModelDelta.ADDED or
- * FeatureModelDelta.Removed fire FeatureModelDelta.CHANGED
- */
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_CHANGED) != 0) {
- IModel[] changed = e.getChangedModels();
- for (int i = 0; i < changed.length; i++) {
- if (!(changed[i] instanceof IFeatureModel))
- continue;
- IFeatureModel model = (IFeatureModel) changed[i];
- if (!delta.contains(model, IFeatureModelDelta.ADDED
- | IFeatureModelDelta.REMOVED)) {
- delta.add(model, IFeatureModelDelta.CHANGED);
- }
-
- }
- }
- return delta;
- }
-
- /**
- * @param delta
- * @param affectedIdVers
- */
- private void adjustExternalVisibility(FeatureModelDelta delta,
- Set affectedIdVers) {
- if (affectedIdVers != null) {
- for (Iterator it = affectedIdVers.iterator(); it.hasNext();) {
- FeatureTable.Idver idver = (FeatureTable.Idver) it.next();
- IFeatureModel[] affectedModels = fActiveModels.get(idver);
- if (affectedModels.length > 1) {
- /*
- * there must have been at least one workspace and one
- * external model
- */
- for (int j = 0; j < affectedModels.length; j++) {
- if (affectedModels[j].getUnderlyingResource() == null) {
- // move external to inactive
- fActiveModels.remove(affectedModels[j]);
- fInactiveModels.add(affectedModels[j]);
- delta.add(affectedModels[j],
- IFeatureModelDelta.REMOVED);
- }
- }
- }
-
- if (affectedModels.length <= 0) {
- // no workspace model
- IFeatureModel[] models = fInactiveModels.get(idver);
- if (models.length > 0) {
- // external model exists, move it to active
- fInactiveModels.remove(models[0]);
- fActiveModels.add(models[0]);
- delta.add(models[0], IFeatureModelDelta.ADDED);
- }
- }
- }
- }
- }
-
- public void addFeatureModelListener(IFeatureModelListener listener) {
- init();
- if (!fListeners.contains(listener))
- fListeners.add(listener);
- }
-
- public void removeFeatureModelListener(IFeatureModelListener listener) {
- if (fListeners.contains(listener))
- fListeners.remove(listener);
- }
-
- public void targetReloaded() {
- fReloadExternalNeeded = true;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureTable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureTable.java
deleted file mode 100644
index 56d8b3c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FeatureTable.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-
-/**
- * Stores IFeatureModels. Models are indexed by id and id with version for fast
- * retrieval. Given id or version may have more than one corresponding model. A
- * model has only one id and version that can be null. When models changes, its
- * Idver stays unchanged until the models reinserted.
- */
-class FeatureTable {
- public class Idver {
- private final String fId;
-
- private final String fVer;
-
- public Idver(String id, String version) {
- fId = id;
- fVer = version;
- }
-
- public String getId() {
- return fId;
- }
-
- public String getVer() {
- return fVer;
- }
-
- public int hashCode() {
- int code = 0;
- if (fId != null)
- code += fId.hashCode();
- if (fVer != null)
- code += fVer.hashCode();
-
- return code;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof Idver))
- return false;
- return equals(((Idver) obj).getId(), ((Idver) obj).getVer());
- }
-
- public boolean equals(String id, String version) {
- boolean sameId = fId == null && id == null || fId != null
- && fId.equals(id);
- boolean sameVer = fVer == null && version == null || fVer != null
- && fVer.equals(version);
- return sameId && sameVer;
-
- }
-
- public String toString() {
- return fId + "_" + fVer; //$NON-NLS-1$
- }
- }
-
- private static final IFeatureModel[] NO_MODELS = new IFeatureModel[0];
-
- /**
- * Map of IFeatureModel to Idver
- */
- private Map fModel2idver;
-
- /**
- * Map of Idver to ArrayList of IFeatureModel
- */
- private Map fIdver2models;
-
- /**
- * Map of Id to ArrayList of Idver
- */
- private Map fId2idvers;
-
- public FeatureTable() {
-
- fModel2idver = new HashMap();
- fIdver2models = new HashMap();
- fId2idvers = new HashMap();
- }
-
- public synchronized Idver get(IFeatureModel model) {
- return (Idver) fModel2idver.get(model);
- }
-
- /**
- * @param id
- * @param version
- * @return IFeatureModel[]
- */
- public synchronized IFeatureModel[] get(String id, String version) {
- return getImpl(new Idver(id, version));
- }
-
- /**
- * @param idver
- * @return IFeatureModel[]
- */
- public synchronized IFeatureModel[] get(Idver idver) {
- return getImpl(idver);
- }
-
- /**
- * @param idver
- * @return
- */
- private IFeatureModel[] getImpl(Idver idver) {
- ArrayList models = (ArrayList) fIdver2models.get(idver);
- if (models == null) {
- return NO_MODELS;
- }
- return (IFeatureModel[]) models
- .toArray(new IFeatureModel[models.size()]);
- }
-
- public synchronized IFeatureModel[] get(String id) {
- ArrayList idvers = (ArrayList) fId2idvers.get(id);
- if (idvers == null)
- return NO_MODELS;
- ArrayList allModels = new ArrayList();
- for (int i = 0; i < idvers.size(); i++) {
- Idver idver = (Idver) idvers.get(i);
- ArrayList models = (ArrayList) fIdver2models.get(idver);
- if (models == null) {
- continue;
- }
- allModels.addAll(models);
- }
- return (IFeatureModel[]) allModels.toArray(new IFeatureModel[allModels
- .size()]);
- }
-
- public synchronized IFeatureModel[] getAll() {
- return getAllImpl();
- }
-
- /**
- * @return
- */
- private IFeatureModel[] getAllImpl() {
- return (IFeatureModel[]) fModel2idver.keySet().toArray(
- new IFeatureModel[fModel2idver.size()]);
- }
-
- /**
- * Removes the model.
- *
- * @return Idver if model existed and was removed, null otherwise
- */
- public synchronized Idver remove(IFeatureModel model) {
- return removeImpl(model);
- }
-
- /**
- * @param model
- * @return
- */
- private Idver removeImpl(IFeatureModel model) {
- Idver idver = (Idver) fModel2idver.remove(model);
- if (idver == null) {
- return null;
- }
- ArrayList models = (ArrayList) fIdver2models.get(idver);
- for (int i = 0; i < models.size(); i++) {
- if (models.get(i) == model) {
- models.remove(i);
- break;
- }
- }
- if (models.size() <= 0) {
- fIdver2models.remove(idver);
-
- ArrayList idvers = (ArrayList) fId2idvers.get(idver.getId());
- for (int i = 0; i < idvers.size(); i++) {
- if (idvers.get(i).equals(idver)) {
- idvers.remove(i);
- break;
- }
- }
- if (idvers.size() <= 0) {
- fId2idvers.remove(idver.getId());
- }
- }
- return idver;
- }
-
- /**
- * Adds the model. Updates the position of the model if already exist.
- *
- * @return Idver used during insertion
- */
- public synchronized Idver add(IFeatureModel model) {
- removeImpl(model);
-
- IFeature feature = model.getFeature();
- String id = feature.getId();
- String ver = feature.getVersion();
- Idver idver = new Idver(id, ver);
-
- fModel2idver.put(model, idver);
-
- ArrayList models = (ArrayList) fIdver2models.get(idver);
- if (models == null) {
- models = new ArrayList(1);
- fIdver2models.put(idver, models);
- }
- models.add(model);
-
- ArrayList idvers = (ArrayList) fId2idvers.get(id);
- if (idvers == null) {
- idvers = new ArrayList(1);
- fId2idvers.put(id, idvers);
- }
- idvers.add(idver);
-
- return idver;
- }
-
- public synchronized String toString() {
- IFeatureModel[] models = getAllImpl();
- StringBuffer buf = new StringBuffer(30 * models.length);
- buf.append("["); //$NON-NLS-1$
- for (int i = 0; i < models.length; i++) {
- if (i > 0) {
- buf.append(", "); //$NON-NLS-1$
- }
- buf.append(get(models[i]));
- buf.append("@"); //$NON-NLS-1$
- buf.append(models[i].getFeature().getId());
- buf.append("_"); //$NON-NLS-1$
- buf.append(models[i].getFeature().getVersion());
- }
- buf.append("]"); //$NON-NLS-1$
- return buf.toString();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FileAdapter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FileAdapter.java
deleted file mode 100644
index 8df550e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/FileAdapter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.PlatformObject;
-
-public class FileAdapter extends PlatformObject {
- private File file;
- private Object[] children;
- private FileAdapter parent;
- private String editorId;
- private IFileAdapterFactory factory;
-
- /**
- * Constructor for FileAdapter.
- */
- public FileAdapter(FileAdapter parent, File file, IFileAdapterFactory factory) {
- this.file = file;
- this.parent = parent;
- this.factory = factory;
- }
-
- public boolean isManifest() {
- String fileName = file.getName();
- return (fileName.equals("plugin.xml") || fileName.equals("fragment.xml") || fileName.equalsIgnoreCase("manifest.mf")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- public boolean isSchema() {
- String fileName = file.getName().toLowerCase(Locale.ENGLISH);
- return fileName.endsWith(".mxsd") || fileName.endsWith(".exsd"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public FileAdapter getParent() {
- return parent;
- }
-
- public void setEditorId(String editorId) {
- this.editorId = editorId;
- }
-
- public String getEditorId() {
- return editorId;
- }
-
- public File getFile() {
- return file;
- }
-
- public boolean isDirectory() {
- return file.isDirectory();
- }
-
- public boolean hasChildren() {
- if (file.isDirectory() == false)
- return false;
- if (children == null)
- createChildren();
- return children.length > 0;
- }
-
- public Object[] getChildren() {
- if (file.isDirectory() && children == null)
- createChildren();
- return children != null ? children : new Object[0];
- }
-
- private void createChildren() {
- File[] files = file.listFiles();
- children = new Object[files.length];
- for (int i = 0; i < files.length; i++) {
- if (factory==null)
- children[i] = new FileAdapter(this, files[i], null);
- else
- children[i] = factory.createAdapterChild(this, files[i]);
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ICoreConstants.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ICoreConstants.java
deleted file mode 100644
index bed4b7e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ICoreConstants.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-public interface ICoreConstants {
-
- // Target Platform
- String PLATFORM_PATH = "platform_path"; //$NON-NLS-1$
- String SAVED_PLATFORM = "saved_platform"; //$NON-NLS-1$
- String TARGET_MODE = "target_mode"; //$NON-NLS-1$
- String VALUE_USE_THIS = "useThis"; //$NON-NLS-1$
- String VALUE_USE_OTHER = "useOther"; //$NON-NLS-1$
- String CHECKED_PLUGINS = "checkedPlugins"; //$NON-NLS-1$
- String VALUE_SAVED_NONE = "[savedNone]"; //$NON-NLS-1$
- String VALUE_SAVED_ALL = "[savedAll]"; //$NON-NLS-1$
- String VALUE_SAVED_SOME = "savedSome"; //$NON-NLS-1$
- String P_SOURCE_LOCATIONS = "source_locations"; //$NON-NLS-1$
- String P_EXT_LOCATIONS = "ext_locations"; //$NON-NLS-1$
- String PROGRAM_ARGS = "program_args"; //$NON-NLS-1$
- String VM_ARGS = "vm_args"; //$NON-NLS-1$
- String IMPLICIT_DEPENDENCIES = "implicit_dependencies"; //$NON-NLS-1$
- String GROUP_PLUGINS_VIEW = "group_plugins"; //$NON-NLS-1$
-
- // Target JRE
- String TARGET_JRE = "targetJRE"; //$NON-NLS-1$
-
- public final static String TARGET21 = "2.1"; //$NON-NLS-1$
- public final static String TARGET30 = "3.0"; //$NON-NLS-1$
- public final static String TARGET31 = "3.1"; //$NON-NLS-1$
- public final static String TARGET32 = "3.2"; //$NON-NLS-1$
-
- public final static String EQUINOX = "Equinox"; //$NON-NLS-1$
-
- // project preferences
- public static final String SELFHOSTING_BIN_EXCLUDES = "selfhosting.binExcludes"; //$NON-NLS-1$
- public static final String EQUINOX_PROPERTY = "pluginProject.equinox"; //$NON-NLS-1$
- public static final String EXTENSIONS_PROPERTY = "pluginProject.extensions"; //$NON-NLS-1$
- public static final String SECONDARY_DEPENDENCIES = "secondary.dependencies"; //$NON-NLS-1$
- public static final String RESOLVE_WITH_REQUIRE_BUNDLE = "resolve.requirebundle"; //$NON-NLS-1$
- public static final String TARGET_PROFILE = "target.profile"; //$NON-NLS-1$
-
- // for backwards compatibility with Eclipse 3.0 bundle manifest files
- public final static String PROVIDE_PACKAGE = "Provide-Package"; //$NON-NLS-1$
- public final static String REPROVIDE_ATTRIBUTE = "reprovide"; //$NON-NLS-1$
- public final static String OPTIONAL_ATTRIBUTE = "optional"; //$NON-NLS-1$
- public final static String REQUIRE_PACKAGES_ATTRIBUTE = "require-packages"; //$NON-NLS-1$
- public final static String SINGLETON_ATTRIBUTE = "singleton"; //$NON-NLS-1$
- public final static String PACKAGE_SPECIFICATION_VERSION = "specification-version"; //$NON-NLS-1$
- public final static String EXTENSIBLE_API = "Eclipse-ExtensibleAPI"; //$NON-NLS-1$
- public final static String PLUGIN_CLASS = "Plugin-Class"; //$NON-NLS-1$
- public final static String ECLIPSE_AUTOSTART = "Eclipse-AutoStart"; //$NON-NLS-1$
- public final static String ECLIPSE_LAZYSTART = "Eclipse-LazyStart"; //$NON-NLS-1$
- public final static String ECLIPSE_JREBUNDLE = "Eclipse-JREBundle"; //$NON-NLS-1$
-
- public static final String INTERNAL_DIRECTIVE = "x-internal"; //$NON-NLS-1$
- public static final String FRIENDS_DIRECTIVE = "x-friends"; //$NON-NLS-1$
- public static final String PLATFORM_FILTER = "Eclipse-PlatformFilter"; //$NON-NLS-1$
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IEnvironmentVariables.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IEnvironmentVariables.java
deleted file mode 100644
index 3a17dee..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IEnvironmentVariables.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-public interface IEnvironmentVariables {
- String OS = "org.eclipse.pde.ui.os"; //$NON-NLS-1$
- String WS = "org.eclipse.pde.ui.ws"; //$NON-NLS-1$
- String NL = "org.eclipse.pde.ui.nl"; //$NON-NLS-1$
- String ARCH = "org.eclipse.pde.ui.arch"; //$NON-NLS-1$
-
- String OS_EXTRA = "org.eclipse.pde.os.extra"; //$NON-NLS-1$
- String WS_EXTRA = "org.eclipse.pde.ws.extra"; //$NON-NLS-1$
- String NL_EXTRA = "org.eclipse.pde.nl.extra"; //$NON-NLS-1$
- String ARCH_EXTRA = "org.eclipse.pde.arch.extra"; //$NON-NLS-1$
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelDelta.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelDelta.java
deleted file mode 100644
index b95c83a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelDelta.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-
-public interface IFeatureModelDelta {
-
- public static final int ADDED = 1;
-
- public static final int REMOVED = 2;
-
- public static final int CHANGED = 4;
-
- public abstract int getKind();
-
- public abstract IFeatureModel[] getAdded();
-
- public abstract IFeatureModel[] getRemoved();
-
- public abstract IFeatureModel[] getChanged();
-
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelListener.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelListener.java
deleted file mode 100644
index cce22eb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFeatureModelListener.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-public interface IFeatureModelListener {
- public void modelsChanged(IFeatureModelDelta delta);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFileAdapterFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFileAdapterFactory.java
deleted file mode 100644
index 33e471f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IFileAdapterFactory.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-
-
-public interface IFileAdapterFactory {
- public Object createAdapterChild(FileAdapter parent, File file);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangeProviderExtension.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangeProviderExtension.java
deleted file mode 100644
index 4faad8f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangeProviderExtension.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.pde.core.IModelChangeProvider;
-
-
-/**
- *
- */
-public interface IModelChangeProviderExtension extends IModelChangeProvider {
-/**
- * Passes all the listeners to the target change provider.
- * @param target the target provider
- * @param filter if not <code>null</code>, the filter will be used to
- * filter listeners that need to be transfered. Listeners that
- * do not pass the filter will be exempt from the transfer.
- */
- void transferListenersTo(IModelChangeProviderExtension target, IModelChangedListenerFilter filter);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangedListenerFilter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangedListenerFilter.java
deleted file mode 100644
index 85b2781..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IModelChangedListenerFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.pde.core.IModelChangedListener;
-
-/**
- * This filted is to be used when listeners are copied from
- * model to model. It allows some listeners to be skipped in
- * the process.
- */
-public interface IModelChangedListenerFilter {
-/**
- * Tests if the listener should be accepted.
- * @param listener the listener to test
- * @return <code>true</code> if the listener should pass
- * the filter, <code>false</code> otherwise.
- */
- public boolean accept(IModelChangedListener listener);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IPluginModelListener.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IPluginModelListener.java
deleted file mode 100644
index b594a4d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/IPluginModelListener.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-public interface IPluginModelListener {
- public void modelsChanged(PluginModelDelta delta);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavaElementChangeListener.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavaElementChangeListener.java
deleted file mode 100644
index 744c151..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavaElementChangeListener.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-
-public class JavaElementChangeListener implements IElementChangedListener {
-
- private static final String FILENAME = "clean-cache.properties"; //$NON-NLS-1$
-
- private Properties fTable = new Properties();
-
- public JavaElementChangeListener() {
- JavaCore.addElementChangedListener(this, ElementChangedEvent.POST_CHANGE);
- load();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent)
- */
- public void elementChanged(ElementChangedEvent event) {
- handleDelta(event.getDelta());
- }
-
- public void shutdown() {
- JavaCore.removeElementChangedListener(this);
- save();
- }
-
- private void handleDelta(IJavaElementDelta delta) {
- IJavaElement element = delta.getElement();
-
- if (element instanceof IJavaModel) {
- handleChildDeltas(delta);
- } else if (element instanceof IJavaProject) {
- if (isInterestingProject((IJavaProject)element)) {
- if (delta.getKind() == IJavaElementDelta.CHANGED) {
- handleChildDeltas(delta);
- } else if (delta.getKind() == IJavaElementDelta.ADDED) {
- updateTable(element);
- }
- }
- } else if (element instanceof IPackageFragmentRoot) {
- handleChildDeltas(delta);
- }
- }
-
- private void handleChildDeltas(IJavaElementDelta delta) {
- IJavaElementDelta[] deltas = delta.getAffectedChildren();
- for (int i = 0; i < deltas.length; i++) {
- if (ignoreDelta(deltas[i]))
- continue;
- if (isInterestingDelta(deltas[i])) {
- updateTable(deltas[i].getElement());
- break;
- }
- handleDelta(deltas[i]);
- }
- }
-
- private boolean isInterestingDelta(IJavaElementDelta delta) {
- int kind = delta.getKind();
- boolean interestingKind = kind == IJavaElementDelta.ADDED
- || kind == IJavaElementDelta.REMOVED;
-
- IJavaElement element = delta.getElement();
- boolean interestingElement = element instanceof IPackageFragment
- || element instanceof IPackageFragmentRoot;
-
- if (interestingElement && interestingKind)
- return true;
-
- if (kind == IJavaElementDelta.CHANGED && element instanceof IPackageFragmentRoot) {
- IPackageFragmentRoot root = (IPackageFragmentRoot)element;
- return root.isArchive();
- }
- return false;
- }
-
- private boolean ignoreDelta(IJavaElementDelta delta) {
- try {
- IJavaElement element = delta.getElement();
- if (element instanceof IPackageFragmentRoot) {
- IPackageFragmentRoot root = (IPackageFragmentRoot)element;
- IClasspathEntry entry = root.getRawClasspathEntry();
- if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER)
- return true;
- }
- } catch (JavaModelException e) {
- }
- return false;
- }
-
- private boolean isInterestingProject(IJavaProject jProject) {
- IProject project = jProject.getProject();
- return WorkspaceModelManager.isNonBinaryPluginProject(project)
- && !WorkspaceModelManager.hasBundleManifest(project);
- }
-
- private void updateTable(IJavaElement element) {
- IJavaProject jProject = (IJavaProject)element.getAncestor(IJavaElement.JAVA_PROJECT);
- if (jProject != null) {
- IProject project = jProject.getProject();
- ModelEntry entry = PDECore.getDefault().getModelManager().findEntry(project);
- if (entry != null) {
- IPluginModelBase model = entry.getActiveModel();
- String id = model.getPluginBase().getId();
- if (id == null)
- return;
- fTable.put(id, Long.toString(System.currentTimeMillis()));
- }
- }
- }
-
- private void save() {
- // start by cleaning up extraneous keys.
- PluginModelManager mgr = PDECore.getDefault().getModelManager();
- Enumeration keys = fTable.keys();
- while(keys.hasMoreElements()) {
- String id = keys.nextElement().toString();
- IPluginModelBase model = mgr.findModel(id);
- if (model == null || model.getUnderlyingResource() == null)
- fTable.remove(id);
- }
-
- FileOutputStream stream = null;
- try {
- stream = new FileOutputStream(new File(getDirectory(), FILENAME));
- fTable.store(stream, "Cached timestamps"); //$NON-NLS-1$
- stream.flush();
- } catch (IOException e) {
- PDECore.logException(e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e1) {
- }
- }
- }
-
- private File getDirectory() {
- IPath path = PDECore.getDefault().getStateLocation().append(".cache"); //$NON-NLS-1$
- File directory = new File(path.toOSString());
- if (!directory.exists() || !directory.isDirectory())
- directory.mkdirs();
- return directory;
- }
-
- private void load() {
- FileInputStream is = null;
- try {
- File file = new File(getDirectory(), FILENAME);
- if (file.exists() && file.isFile()) {
- is = new FileInputStream(file);
- fTable.load(is);
- }
- } catch (IOException e) {
- } finally {
- try {
- if (is != null) {
- is.close();
- }
- } catch (IOException e1) {
- }
- }
- }
-
- public void synchronizeManifests(File cacheDirectory) {
- Enumeration keys = fTable.keys();
- while (keys.hasMoreElements()) {
- String id = keys.nextElement().toString();
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(id);
- if (model != null) {
- File file = new File(cacheDirectory, id + "_" + model.getPluginBase().getVersion() + ".MF"); //$NON-NLS-1$ //$NON-NLS-2$
- if (file.exists() && file.isFile() && file.lastModified() < Long.parseLong(fTable.get(id).toString()))
- file.delete();
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavadocLocationManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavadocLocationManager.java
deleted file mode 100644
index 7c6fdf6..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/JavadocLocationManager.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-public class JavadocLocationManager {
-
- public static final String JAVADOC_ID = "org.eclipse.pde.core.javadoc"; //$NON-NLS-1$
-
- private HashMap fLocations;
-
- public String getJavadocLocation(IPluginModelBase model) {
- File file = new File(model.getInstallLocation());
- if (file.isDirectory()) {
- File doc = new File(file, "doc"); //$NON-NLS-1$
- if (new File(doc, "package-list").exists()) //$NON-NLS-1$
- return doc.getAbsolutePath();
- } else if (CoreUtility.jarContainsResource(file, "doc/package-list", false)) { //$NON-NLS-1$
- return file.getAbsolutePath() + "!/doc"; //$NON-NLS-1$
- }
- return getEntry(model);
- }
-
- private String getEntry(IPluginModelBase model) {
- initialize();
- String id = model.getPluginBase().getId();
- if (id == null)
- return null;
- Iterator iter = fLocations.keySet().iterator();
- while (iter.hasNext()) {
- String location = iter.next().toString();
- Set set = (Set)fLocations.get(location);
- if (set.contains(id))
- return location;
- }
- return null;
- }
-
- private synchronized void initialize() {
- if (fLocations != null) return;
- fLocations = new HashMap();
- IPluginModelBase[] models = PDECore.getDefault().getModelManager().getExternalModels();
- for (int i = 0; i < models.length; i++) {
- IPluginExtension[] extensions = models[i].getPluginBase().getExtensions();
- for (int j = 0; j < extensions.length; j++) {
- if (JAVADOC_ID.equals(extensions[j].getPoint()))
- processExtension(extensions[j]);
- }
- }
- }
-
- private void processExtension(IPluginExtension extension) {
- IPluginObject[] children = extension.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i].getName().equals("javadoc")) { //$NON-NLS-1$
- IPluginElement javadoc = (IPluginElement) children[i];
- IPluginAttribute attr = javadoc.getAttribute("path"); //$NON-NLS-1$
- String path = (attr == null) ? null : attr.getValue();
- if (path == null)
- continue;
- try {
- new URL(path);
- processPlugins(path, javadoc.getChildren());
- } catch (MalformedURLException e) {
- attr = javadoc.getAttribute("archive"); //$NON-NLS-1$
- boolean archive = attr == null ? false : "true".equals(attr.getValue()); //$NON-NLS-1$
-
- IPath modelPath = new Path(extension.getModel().getInstallLocation());
- StringBuffer buffer = new StringBuffer();
- File file = modelPath.toFile();
- if (file.exists()) {
- try {
- buffer.append(file.toURI().toURL());
- } catch (MalformedURLException e1) {
- buffer.append("file:/"); //$NON-NLS-1$
- buffer.append(modelPath.toPortableString());
- }
- if (file.isFile()) {
- buffer.append("!/"); //$NON-NLS-1$
- archive = true;
- }
- }
- buffer.append(path);
- if (archive)
- buffer.insert(0, "jar:"); //$NON-NLS-1$
- processPlugins(buffer.toString(), javadoc.getChildren()); //$NON-NLS-1$
- }
- }
- }
- }
-
- private void processPlugins(String path, IPluginObject[] plugins) {
- for (int i = 0; i < plugins.length; i++) {
- if (plugins[i].getName().equals("plugin")) { //$NON-NLS-1$
- IPluginElement plugin = (IPluginElement)plugins[i];
- IPluginAttribute attr = plugin.getAttribute("id"); //$NON-NLS-1$
- String id = attr == null ? null : attr.getValue();
- if (id == null)
- continue;
- Set set = (Set)fLocations.get(path);
- if (set == null) {
- set = new HashSet();
- fLocations.put(path, set);
- }
- set.add(id);
- }
- }
- }
-
- public void reset() {
- fLocations = null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java
deleted file mode 100644
index d155654..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.osgi.service.resolver.StateDelta;
-import org.eclipse.osgi.service.resolver.StateHelper;
-import org.eclipse.osgi.service.resolver.StateObjectFactory;
-import org.eclipse.osgi.service.resolver.VersionConstraint;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class MinimalState {
-
- protected State fState;
-
- private String fTargetMode = null;
-
- protected long fId;
-
- private PluginConverter fConverter = null;
-
- private boolean fEEListChanged = false; // indicates that the EE has changed
- // this could be due to the system bundle changing location
- // or initially when the ee list is first created.
-
- private String[] fExecutionEnvironments; // an ordered list of known/supported execution environments
-
- private boolean fNoProfile;
-
- private static final String SYSTEM_BUNDLE = "org.eclipse.osgi"; //$NON-NLS-1$
-
- protected static boolean DEBUG = false;
-
- protected static StateObjectFactory stateObjectFactory;
-
- protected static String DIR;
-
- static {
- DEBUG = PDECore.getDefault().isDebugging()
- && "true".equals(Platform.getDebugOption("org.eclipse.pde.core/cache")); //$NON-NLS-1$ //$NON-NLS-2$
- DIR = PDECore.getDefault().getStateLocation().toOSString();
- stateObjectFactory = Platform.getPlatformAdmin().getFactory();
- }
-
- protected MinimalState() {
- }
-
- public MinimalState(Dictionary properties) {
- fState = stateObjectFactory.createState();
- fState.setResolver(Platform.getPlatformAdmin().getResolver());
- fState.setPlatformProperties(properties);
- }
-
- public void addBundle(IPluginModelBase model, boolean update) {
- if (!update) {
- BundleDescription[] bundles = fState.getBundles(model.getPluginBase().getId());
- IPath path = new Path(model.getInstallLocation());
- for (int i = 0; i < bundles.length; i++) {
- if (ExternalModelManager.arePathsEqual(path, new Path(bundles[i].getLocation()))) {
- model.setBundleDescription(bundles[i]);
- return;
- }
- }
- }
-
- BundleDescription desc = model.getBundleDescription();
- long bundleId = desc == null || !update ? -1 : desc.getBundleId();
- try {
- model.setBundleDescription(
- addBundle(new File(model.getInstallLocation()), false, bundleId));
- } catch (IOException e) {
- } catch (PluginConversionException e) {
- } catch (CoreException e) {
- PDECore.log(e);
- }
- }
-
- public BundleDescription addBundle(IPluginModelBase model, long bundleId) {
- try {
- return addBundle(new File(model.getInstallLocation()), false, -1);
- } catch (IOException e) {
- } catch (PluginConversionException e) {
- } catch (CoreException e) {
- }
- return null;
- }
-
- public BundleDescription addBundle(Dictionary manifest, File bundleLocation, boolean keepLibraries, long bundleId) {
- try {
- BundleDescription descriptor = stateObjectFactory.createBundleDescription(
- fState, manifest, bundleLocation.getAbsolutePath(),
- bundleId == -1 ? getNextId() : bundleId);
- // new bundle
- if (bundleId == -1) {
- fState.addBundle(descriptor);
- } else if (!fState.updateBundle(descriptor)) {
- fState.addBundle(descriptor);
- }
- return descriptor;
- } catch (BundleException e) {
- } catch (NumberFormatException e) {
- } catch (IllegalArgumentException e) {
- }
- return null;
- }
-
- public BundleDescription addBundle(File bundleLocation, boolean keepLibraries, long bundleId) throws PluginConversionException, CoreException, IOException {
- Dictionary manifest = loadManifest(bundleLocation);
- if (manifest == null || manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null) {
- if (!bundleLocation.isFile()
- && !new File(bundleLocation, "plugin.xml").exists() //$NON-NLS-1$
- && !new File(bundleLocation, "fragment.xml").exists()) //$NON-NLS-1$
- return null;
- PluginConverter converter = acquirePluginConverter();
- manifest = converter.convertManifest(bundleLocation, false, getTargetMode(), false, null);
- if (manifest == null
- || manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null)
- throw new CoreException(new Status(
- IStatus.ERROR,
- PDECore.PLUGIN_ID,
- IStatus.ERROR,
- "Error parsing plug-in manifest file at " + bundleLocation.toString(), null)); //$NON-NLS-1$
- }
- BundleDescription desc = addBundle(manifest, bundleLocation, keepLibraries, bundleId);
- if (desc != null && SYSTEM_BUNDLE.equals(desc.getSymbolicName())) {
- // if this is the system bundle then
- // indicate that the javaProfile has changed since the new system
- // bundle may not contain profiles for all EE's in the list
- fEEListChanged = true;
- }
- return desc;
- }
-
- protected void saveState(File dir) {
- saveState(fState, dir);
- }
-
- protected void saveState(State state, File dir) {
- try {
- if (!dir.exists())
- dir.mkdirs();
- stateObjectFactory.writeState(state, dir);
- } catch (FileNotFoundException e) {
- PDECore.log(e);
- } catch (IOException e) {
- PDECore.log(e);
- } finally {
- }
- }
-
- public static Dictionary loadManifest(File bundleLocation) throws IOException {
- ZipFile jarFile = null;
- InputStream manifestStream = null;
- try {
- String extension = new Path(bundleLocation.getName()).getFileExtension();
- if (extension != null && extension.equals("jar") && bundleLocation.isFile()) { //$NON-NLS-1$
- jarFile = new ZipFile(bundleLocation, ZipFile.OPEN_READ);
- ZipEntry manifestEntry = jarFile.getEntry(JarFile.MANIFEST_NAME);
- if (manifestEntry != null) {
- manifestStream = jarFile.getInputStream(manifestEntry);
- }
- } else {
- File file = new File(bundleLocation, JarFile.MANIFEST_NAME);
- if (file.exists())
- manifestStream = new FileInputStream(file);
- }
- } catch (IOException e) {
- }
- if (manifestStream == null)
- return null;
- try {
- Manifest m = new Manifest(manifestStream);
- return manifestToProperties(m.getMainAttributes());
- } finally {
- try {
- manifestStream.close();
- } catch (IOException e1) {
- }
- try {
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e2) {
- }
- }
- }
-
- private static Properties manifestToProperties(Attributes d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name) iter.next();
- result.put(key.toString(), d.get(key));
- }
- return result;
- }
-
- public StateDelta resolveState(boolean incremental) {
- return internalResolveState(incremental);
- }
-
- private synchronized StateDelta internalResolveState(boolean incremental) {
- if (fExecutionEnvironments == null && !fNoProfile)
- setExecutionEnvironments();
-
- if (fEEListChanged) {
- incremental = !fState.setPlatformProperties(getProfilePlatformProperties());
- fEEListChanged = false;
- }
- return fState.resolve(incremental);
- }
-
- private Dictionary[] getProfilePlatformProperties() {
- if (fExecutionEnvironments == null || fExecutionEnvironments.length == 0)
- return new Dictionary[] {TargetPlatform.getTargetEnvironment()};
-
- // add java profiles for those EE's that have a .profile file in the current system bundle
- ArrayList result = new ArrayList(fExecutionEnvironments.length);
- for (int i = 0; i < fExecutionEnvironments.length; i++) {
- Properties profileProps = getJavaProfileProperties(fExecutionEnvironments[i]);
- if (profileProps != null) {
- Dictionary props = TargetPlatform.getTargetEnvironment();
- String systemPackages = profileProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
- if (systemPackages != null)
- props.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackages);
- String ee = profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
- if (ee != null)
- props.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee);
- result.add(props);
- }
- }
- if (result.size() > 0)
- return (Dictionary[])result.toArray(new Dictionary[result.size()]);
- return new Dictionary[] {TargetPlatform.getTargetEnvironment()};
- }
-
- private File getOSGiLocation() {
- // return the File location of the system bundle
- BundleDescription osgiBundle = fState.getBundle(SYSTEM_BUNDLE, null);
- return (osgiBundle == null) ? null : new File(osgiBundle.getLocation());
- }
-
- private Properties getJavaProfileProperties(String ee) {
- File location = getOSGiLocation();
- if (location == null)
- return null;
-
- String filename = ee.replace('/', '_') + ".profile"; //$NON-NLS-1$
- InputStream is = null;
- ZipFile zipFile = null;
- try {
- // find the input stream to the profile properties file
- if (location.isDirectory()) {
- File file = new File(location, filename);
- if (file.exists())
- is = new FileInputStream(file);
- } else {
- zipFile = null;
- try {
- zipFile = new ZipFile(location, ZipFile.OPEN_READ);
- ZipEntry entry = zipFile.getEntry(filename);
- if (entry != null)
- is = zipFile.getInputStream(entry);
- } catch (IOException e) {
- // nothing to do
- }
- }
- if (is != null) {
- Properties profile = new Properties();
- profile.load(is);
- return profile;
- }
- } catch (IOException e) {
- // nothing to do
- } finally {
- if (is != null)
- try {
- is.close();
- } catch (IOException e) {
- // nothing to do
- }
- if (zipFile != null)
- try {
- zipFile.close();
- } catch (IOException e) {
- // nothing to do
- }
- }
- return null;
- }
-
- public void removeBundleDescription(BundleDescription description) {
- fState.removeBundle(description);
- }
-
- public State getState() {
- return fState;
- }
-
- protected void setTargetMode(URL[] urls) {
- fTargetMode = ICoreConstants.TARGET21;
- for (int i = 0; i < urls.length; i++) {
- if (urls[i].getFile().indexOf("org.eclipse.osgi") != -1) {//$NON-NLS-1$
- fTargetMode = null;
- break;
- }
- }
- }
-
- public String getTargetMode() {
- return fTargetMode;
- }
-
- public void setTargetMode(String mode) {
- fTargetMode = mode;
- }
-
- private void setExecutionEnvironments() {
- String jreProfile = System.getProperty("pde.jreProfile"); //$NON-NLS-1$
- if (jreProfile != null && jreProfile.length() > 0) {
- if ("none".equals(jreProfile)) { //$NON-NLS-1$
- fNoProfile = true;
- } else {
- fExecutionEnvironments = new String[] {jreProfile};
- }
- } else {
- fExecutionEnvironments = ExecutionEnvironmentAnalyzer.getKnownExecutionEnvironments();
- }
- fEEListChanged = true; // alway indicate the list has changed
- }
-
- public void addBundleDescription(BundleDescription toAdd) {
- fState.addBundle(toAdd);
- }
-
- private PluginConverter acquirePluginConverter() {
- if (fConverter == null) {
- ServiceTracker tracker = new ServiceTracker(PDECore.getDefault()
- .getBundleContext(), PluginConverter.class.getName(), null);
- tracker.open();
- fConverter = (PluginConverter) tracker.getService();
- tracker.close();
- }
- return fConverter;
- }
-
- public long getNextId() {
- return ++fId;
- }
-
- private BundleDescription findActiveBundle(String symbolicName) {
- BundleDescription[] bundles = fState.getBundles(symbolicName);
- for (int i = 0; i < bundles.length; i++) {
- if (bundles[i].isResolved())
- return bundles[i];
- }
- return null;
- }
-
- protected void logResolutionErrors() {
- MultiStatus errors = new MultiStatus(PDECore.getPluginId(), 1,
- PDECoreMessages.ExternalModelManager_scanningProblems,
- null);
-
- StateHelper helper = Platform.getPlatformAdmin().getStateHelper();
- BundleDescription[] all = fState.getBundles();
- for (int i = 0; i < all.length; i++) {
- if (!all[i].isResolved()) {
- VersionConstraint[] unsatisfiedConstraints = helper
- .getUnsatisfiedConstraints(all[i]);
- if (unsatisfiedConstraints.length == 0) {
- if (DEBUG) {
- BundleDescription activeBundle = findActiveBundle(all[i]
- .getSymbolicName());
- String message = "Plug-in located at \"" + all[i].getLocation() + "\" was disabled because plug-in located at \"" + activeBundle.getLocation() + "\" was selected."; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.print(message);
- }
- } else {
- for (int j = 0; j < unsatisfiedConstraints.length; j++) {
- String message = getResolutionFailureMessage(unsatisfiedConstraints[j]);
- if (message != null)
- errors.add(new Status(IStatus.WARNING, all[i]
- .getSymbolicName(), IStatus.WARNING, message, null));
- }
- }
- }
- }
- if (errors.getChildren().length > 0)
- PDECore.log(errors);
- }
-
- private String getResolutionFailureMessage(VersionConstraint unsatisfied) {
- if (unsatisfied.isResolved())
- throw new IllegalArgumentException();
- if (unsatisfied instanceof ImportPackageSpecification)
- return "Missing imported package: " + toString(unsatisfied); //$NON-NLS-1$
- if (unsatisfied instanceof BundleSpecification && !((BundleSpecification)unsatisfied).isOptional())
- return "Missing required plug-in: " + toString(unsatisfied); //$NON-NLS-1$
- if (unsatisfied instanceof HostSpecification)
- return "Missing Fragment Host: " + toString(unsatisfied); //$NON-NLS-1$
- return null;
- }
-
- private String toString(VersionConstraint constraint) {
- VersionRange versionRange = constraint.getVersionRange();
- if (versionRange == null || versionRange.getMinimum() != null)
- return constraint.getName();
- return constraint.getName() + '_' + versionRange;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelEntry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelEntry.java
deleted file mode 100644
index 2e63e08..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelEntry.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class ModelEntry extends PlatformObject {
- private String id;
- private IPluginModelBase fWorkspaceModel;
- private IPluginModelBase fExternalModel;
- private RequiredPluginsClasspathContainer fClasspathContainer;
- private boolean fInJavaSearch;
- private PluginModelManager fManager;
-
- public ModelEntry(PluginModelManager manager, String id) {
- this.fManager = manager;
- this.id = id;
- }
-
- public IPluginModelBase getActiveModel() {
- return (fWorkspaceModel != null) ? fWorkspaceModel : fExternalModel;
- }
-
- public String getId() {
- return id;
- }
-
- public Object[] getChildren() {
- if (fWorkspaceModel == null && fExternalModel != null) {
- File file = new File(fExternalModel.getInstallLocation());
- if (!file.isFile()) {
- FileAdapter adapter =
- new EntryFileAdapter(
- this,
- file,
- fManager.getFileAdapterFactory());
- return adapter.getChildren();
- }
- }
- return new Object[0];
- }
-
- public boolean isInJavaSearch() {
- return fInJavaSearch;
- }
-
- void setInJavaSearch(boolean value) {
- this.fInJavaSearch = value;
- }
-
- public void setWorkspaceModel(IPluginModelBase model) {
- this.fWorkspaceModel = model;
- fClasspathContainer = null;
- }
-
- public void setExternalModel(IPluginModelBase model) {
- this.fExternalModel = model;
- fClasspathContainer = null;
- }
- public IPluginModelBase getWorkspaceModel() {
- return fWorkspaceModel;
- }
-
- public IPluginModelBase getExternalModel() {
- return fExternalModel;
- }
- public boolean isEmpty() {
- return fWorkspaceModel == null && fExternalModel == null;
- }
- public RequiredPluginsClasspathContainer getClasspathContainer(boolean reset) {
- if (reset)
- fClasspathContainer = null;
-
- if (fClasspathContainer == null)
- fClasspathContainer =
- new RequiredPluginsClasspathContainer(fWorkspaceModel);
- return fClasspathContainer;
- }
- public void updateClasspathContainer(boolean doCheckClasspath)
- throws CoreException {
- if (shouldUpdateClasspathContainer(doCheckClasspath)) {
- IProject project = fWorkspaceModel.getUnderlyingResource().getProject();
- IJavaProject[] javaProjects = new IJavaProject[] { JavaCore.create(project)};
- IClasspathContainer[] containers =
- new IClasspathContainer[] { getClasspathContainer(true)};
- IPath path = new Path(PDECore.CLASSPATH_CONTAINER_ID);
- try {
- JavaCore.setClasspathContainer(path, javaProjects, containers, null);
- } catch (OperationCanceledException e) {
- getClasspathContainer(false).reset();
- throw e;
- }
- }
- }
-
- public boolean shouldUpdateClasspathContainer(boolean doCheckClasspath) throws CoreException {
- if (fWorkspaceModel == null)
- return false;
-
- IProject project = fWorkspaceModel.getUnderlyingResource().getProject();
- if (!project.hasNature(JavaCore.NATURE_ID))
- return false;
-
- if (doCheckClasspath && (!fWorkspaceModel.isLoaded()))
- return false;
-
- return true;
- }
-
- public static void updateUnknownClasspathContainer(IJavaProject javaProject)
- throws CoreException {
- if (javaProject == null)
- return;
- IPath path = new Path(PDECore.CLASSPATH_CONTAINER_ID);
- JavaCore.setClasspathContainer(
- path,
- new IJavaProject[] { javaProject },
- new IClasspathContainer[] {
- new RequiredPluginsClasspathContainer(null)},
- null);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelProviderEvent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelProviderEvent.java
deleted file mode 100644
index 2b6105d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ModelProviderEvent.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelProviderEvent;
-
-public class ModelProviderEvent implements IModelProviderEvent {
- private int types;
- private Object source;
- private IModel [] added;
- private IModel [] removed;
- private IModel [] changed;
-
-public ModelProviderEvent(Object source, int types, IModel [] added, IModel [] removed, IModel [] changed) {
- this.source = source;
- this.types = types;
- this.added = added;
- this.removed = removed;
- this.changed = changed;
-}
-
-public IModel [] getAddedModels() {
- return (added == null) ? new IModel[0] : added ;
-}
-
-public IModel [] getRemovedModels() {
- return (removed == null) ? new IModel[0] : removed;
-}
-
-public IModel [] getChangedModels() {
- return (changed == null) ? new IModel[0] : changed;
-}
-
-public int getEventTypes() {
- return types;
-}
-
-public Object getEventSource() {
- return source;
-}
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/NLResourceHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/NLResourceHelper.java
deleted file mode 100644
index e954003..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/NLResourceHelper.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.MissingResourceException;
-import java.util.PropertyResourceBundle;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Platform;
-
-
-public class NLResourceHelper {
- public static final String KEY_PREFIX = "%"; //$NON-NLS-1$
- public static final String KEY_DOUBLE_PREFIX = "%%"; //$NON-NLS-1$
- private PropertyResourceBundle bundle = null;
-
- public NLResourceHelper(String name, URL[] locations) {
- try {
- InputStream stream = getResourceStream(name, locations);
- if (stream != null) {
- bundle = new PropertyResourceBundle(stream);
- stream.close();
- }
- } catch (IOException e) {
- }
- }
-
- public void dispose() {
- bundle = null;
- }
-
- private InputStream getResourceStream(String name, URL[] locations) {
- URLClassLoader resourceLoader = new URLClassLoader(locations);
-
- StringTokenizer tokenizer = new StringTokenizer(Platform.getNL(), "_"); //$NON-NLS-1$
- String language = tokenizer.nextToken();
- String country = (tokenizer.hasMoreTokens() ? tokenizer.nextToken() : ""); //$NON-NLS-1$
- String variant = (tokenizer.hasMoreTokens() ? tokenizer.nextToken() : ""); //$NON-NLS-1$
-
- String suffix1 = "_" + language + "_" + country + "_" + variant; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String suffix2 = "_" + language + "_" + country; //$NON-NLS-1$ //$NON-NLS-2$
- String suffix3 = "_" + language; //$NON-NLS-1$
- String suffix4 = ""; //$NON-NLS-1$
-
- String[] suffices = new String[] { suffix1, suffix2, suffix3, suffix4 };
-
- InputStream stream = null;
- for (int i = 0; i < suffices.length; i++) {
- stream =
- resourceLoader.getResourceAsStream(
- name + suffices[i] + ".properties"); //$NON-NLS-1$
- if (stream != null)
- break;
- }
- return stream;
- }
-
- public String getResourceString(String value) {
- String s = value.trim();
-
- if (!s.startsWith(KEY_PREFIX))
- return s;
-
- if (s.startsWith(KEY_DOUBLE_PREFIX))
- return s.substring(1);
-
- int ix = s.indexOf(" "); //$NON-NLS-1$
- String key = ix == -1 ? s : s.substring(0, ix);
- String dflt = ix == -1 ? s : s.substring(ix + 1);
-
- if (bundle == null)
- return dflt;
-
- try {
- return bundle.getString(key.substring(1));
- } catch (MissingResourceException e) {
- return dflt;
- }
- }
-
- public boolean resourceExists(String value) {
- if (bundle == null)
- return false;
- try {
- bundle.getString(value.trim().substring(1));
- return true;
- } catch (MissingResourceException e) {
- return false;
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEClasspathContainer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEClasspathContainer.java
deleted file mode 100644
index 8e9a7ff..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEClasspathContainer.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IAccessRule;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class PDEClasspathContainer {
-
- public class Rule {
- IPath path;
- boolean discouraged;
- public boolean equals(Object other) {
- if (!(other instanceof Rule))
- return false;
- return discouraged == ((Rule)other).discouraged && path.equals(((Rule)other).path);
- }
- }
-
- private static HashMap ACCESSIBLE_RULES = new HashMap();
- private static HashMap DISCOURAGED_RULES = new HashMap();
-
- private static final IAccessRule EXCLUDE_ALL_RULE =
- JavaCore.newAccessRule(new Path("**/*"), IAccessRule.K_NON_ACCESSIBLE|IAccessRule.IGNORE_IF_BETTER); //$NON-NLS-1$
-
- protected void addProjectEntry(IProject project, Rule[] rules, ArrayList entries) throws CoreException {
- if (project.hasNature(JavaCore.NATURE_ID)) {
- IClasspathEntry entry = null;
- if (rules != null) {
- IAccessRule[] accessRules = getAccessRules(rules);
- entry = JavaCore.newProjectEntry(
- project.getFullPath(),
- accessRules,
- true,
- new IClasspathAttribute[0],
- false);
- } else {
- entry = JavaCore.newProjectEntry(project.getFullPath());
- }
- if (!entries.contains(entry))
- entries.add(entry);
- }
- }
-
- public static IClasspathEntry[] getExternalEntries(IPluginModelBase model) throws CoreException {
- ArrayList entries = new ArrayList();
- addExternalPlugin(model, new Rule[0], entries);
- return (IClasspathEntry[])entries.toArray(new IClasspathEntry[entries.size()]);
- }
-
- protected static void addExternalPlugin(IPluginModelBase model, Rule[] rules, ArrayList entries) throws CoreException {
- if (new File(model.getInstallLocation()).isFile()) {
- IPath srcPath = ClasspathUtilCore.getSourceAnnotation(model, "."); //$NON-NLS-1$
- if (srcPath == null)
- srcPath = new Path(model.getInstallLocation());
- addLibraryEntry(new Path(model.getInstallLocation()), srcPath, rules, getClasspathAttributes(model), entries);
- } else {
- IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
- for (int i = 0; i < libraries.length; i++) {
- if (IPluginLibrary.RESOURCE.equals(libraries[i].getType()))
- continue;
- model = (IPluginModelBase)libraries[i].getModel();
- String name = libraries[i].getName();
- String expandedName = ClasspathUtilCore.expandLibraryName(name);
- IPath path = getPath(model, expandedName);
- if (path == null && !model.isFragmentModel() && ClasspathUtilCore.containsVariables(name)) {
- model = resolveLibraryInFragments(model, expandedName);
- if (model != null)
- path = getPath(model, expandedName);
- }
- if (path != null && !path.toFile().isDirectory())
- addLibraryEntry(path, ClasspathUtilCore.getSourceAnnotation(model, expandedName), rules, getClasspathAttributes(model), entries);
- }
- }
- }
-
- protected static void addLibraryEntry(IPath path, IPath srcPath, Rule[] rules, IClasspathAttribute[] attributes, ArrayList entries) {
- IClasspathEntry entry = null;
- if (rules != null) {
- entry = JavaCore.newLibraryEntry(
- path,
- srcPath,
- null,
- getAccessRules(rules),
- attributes,
- false);
- } else {
- entry = JavaCore.newLibraryEntry(path, srcPath, null, new IAccessRule[0], attributes, false);
- }
- if (!entries.contains(entry)) {
- entries.add(entry);
- }
- }
-
- protected static IAccessRule[] getAccessRules(Rule[] rules) {
- IAccessRule[] accessRules = new IAccessRule[rules.length + 1];
- for (int i = 0; i < rules.length; i++) {
- Rule rule = rules[i];
- accessRules[i] = rule.discouraged ? getDiscouragedRule(rule.path) : getAccessibleRule(rule.path);
- }
- accessRules[rules.length] = EXCLUDE_ALL_RULE;
- return accessRules;
- }
-
- private static synchronized IAccessRule getAccessibleRule(IPath path) {
- IAccessRule rule = (IAccessRule)ACCESSIBLE_RULES.get(path);
- if (rule == null) {
- rule = JavaCore.newAccessRule(path, IAccessRule.K_ACCESSIBLE);
- ACCESSIBLE_RULES.put(path, rule);
- }
- return rule;
- }
-
- private static IClasspathAttribute[] getClasspathAttributes(IPluginModelBase model) {
- JavadocLocationManager manager = PDECore.getDefault().getJavadocLocationManager();
- String location = manager.getJavadocLocation(model);
- if (location == null)
- return new IClasspathAttribute[0];
- return new IClasspathAttribute[] {JavaCore.newClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, location)};
- }
-
- private static synchronized IAccessRule getDiscouragedRule(IPath path) {
- IAccessRule rule = (IAccessRule)DISCOURAGED_RULES.get(path);
- if (rule == null) {
- rule = JavaCore.newAccessRule(path, IAccessRule.K_DISCOURAGED|IAccessRule.IGNORE_IF_BETTER);
- DISCOURAGED_RULES.put(path, rule);
- }
- return rule;
- }
-
- protected static IPath getPath(IPluginModelBase model, String libraryName) {
- IResource resource = model.getUnderlyingResource();
- if (resource != null) {
- IResource jarFile = resource.getProject().findMember(libraryName);
- return (jarFile != null) ? jarFile.getFullPath() : null;
- }
- File file = new File(model.getInstallLocation(), libraryName);
- return file.exists() ? new Path(file.getAbsolutePath()) : null;
- }
-
- protected static IPluginModelBase resolveLibraryInFragments(IPluginModelBase model, String libraryName) {
- BundleDescription desc = model.getBundleDescription();
- if (desc != null) {
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- if (new File(fragments[i].getLocation(), libraryName).exists())
- return PDECore.getDefault().getModelManager().findModel(fragments[i]);
- }
- }
- return null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECore.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECore.java
deleted file mode 100644
index 4c13969..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECore.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.service.resolver.PlatformAdmin;
-import org.eclipse.pde.core.plugin.IMatchRules;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.schema.SchemaRegistry;
-import org.osgi.framework.BundleContext;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class PDECore extends Plugin implements IEnvironmentVariables {
- public static final String PLUGIN_ID = "org.eclipse.pde.core"; //$NON-NLS-1$
-
- public static final String BINARY_PROJECT_VALUE = "binary"; //$NON-NLS-1$
- public static final String BINARY_REPOSITORY_PROVIDER =
- PLUGIN_ID + "." + "BinaryRepositoryProvider"; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String CLASSPATH_CONTAINER_ID =PLUGIN_ID + ".requiredPlugins"; //$NON-NLS-1$
- public static final String JAVA_SEARCH_CONTAINER_ID = PLUGIN_ID + ".externalJavaSearch"; //$NON-NLS-1$
-
- public static final String ECLIPSE_HOME_VARIABLE = "ECLIPSE_HOME"; //$NON-NLS-1$
- public static final QualifiedName EXTERNAL_PROJECT_PROPERTY =
- new QualifiedName(PLUGIN_ID, "imported"); //$NON-NLS-1$
- public static final String EXTERNAL_PROJECT_VALUE = "external"; //$NON-NLS-1$
-
- // Shared instance
- private static PDECore inst;
-
- private static boolean isDevLaunchMode = false;
-
- public static boolean compare(
- String id1,
- String version1,
- String id2,
- String version2,
- int match) {
- if (!(id1.equals(id2)))
- return false;
- if (version1 == null)
- return true;
- if (version2 == null)
- return false;
- PluginVersionIdentifier pid1 = null;
- PluginVersionIdentifier pid2 = null;
-
- try {
- pid1 = new PluginVersionIdentifier(version1);
- pid2 = new PluginVersionIdentifier(version2);
- } catch (RuntimeException e) {
- // something is wrong with either - try direct comparison
- return version2.equals(version1);
- }
-
- switch (match) {
- case IMatchRules.NONE :
- case IMatchRules.COMPATIBLE :
- if (pid2.isCompatibleWith(pid1))
- return true;
- break;
- case IMatchRules.EQUIVALENT :
- if (pid2.isEquivalentTo(pid1))
- return true;
- break;
- case IMatchRules.PERFECT :
- if (pid2.isPerfect(pid1))
- return true;
- break;
- case IMatchRules.GREATER_OR_EQUAL :
- if (pid2.isGreaterOrEqualTo(pid1))
- return true;
- break;
- }
- return false;
- }
-
- public static PDECore getDefault() {
- return inst;
- }
- public static String getPluginId() {
- return getDefault().getBundle().getSymbolicName();
- }
-
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public static void log(IStatus status) {
- ResourcesPlugin.getPlugin().getLog().log(status);
- }
-
- public static void log(Throwable e) {
- if (e instanceof InvocationTargetException)
- e = ((InvocationTargetException) e).getTargetException();
- IStatus status = null;
- if (e instanceof CoreException)
- status = ((CoreException) e).getStatus();
- else
- status =
- new Status(
- IStatus.ERROR,
- getPluginId(),
- IStatus.OK,
- e.getMessage(),
- e);
- log(status);
- }
-
- public static void logErrorMessage(String message) {
- log(
- new Status(
- IStatus.ERROR,
- getPluginId(),
- IStatus.ERROR,
- message,
- null));
- }
-
- public static void logException(Throwable e) {
- logException(e, null);
- }
-
- public static void logException(Throwable e, String message) {
- if (e instanceof InvocationTargetException) {
- e = ((InvocationTargetException) e).getTargetException();
- }
- IStatus status = null;
- if (e instanceof CoreException)
- status = ((CoreException) e).getStatus();
- else {
- if (message == null)
- message = e.getMessage();
- if (message == null)
- message = e.toString();
- status =
- new Status(
- IStatus.ERROR,
- getPluginId(),
- IStatus.OK,
- message,
- e);
- }
- ResourcesPlugin.getPlugin().getLog().log(status);
- }
-
- public static boolean isDevLaunchMode() {
- String[] args = Platform.getApplicationArgs();
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("-pdelaunch")) //$NON-NLS-1$
- isDevLaunchMode = true;
- }
- return isDevLaunchMode;
- }
-
- private PluginModelManager fModelManager;
- private ExternalModelManager fExternalModelManager;
- private WorkspaceModelManager fWorkspaceModelManager;
- private FeatureModelManager fFeatureModelManager;
- private TargetProfileManager fTargetProfileManager;
-
- // Schema registry
- private SchemaRegistry fSchemaRegistry;
-
- private SourceLocationManager fSourceLocationManager;
- private JavadocLocationManager fJavadocLocationManager;
-
- // Tracing options manager
- private TracingOptionsManager fTracingOptionsManager;
- private BundleContext fBundleContext;
- private ServiceTracker fTracker;
- private JavaElementChangeListener fJavaElementChangeListener;
-
- public PDECore() {
- inst = this;
- }
-
- public URL getInstallURL() {
- try {
- return Platform.resolve(getDefault().getBundle().getEntry("/")); //$NON-NLS-1$
- } catch (IOException e) {
- return null;
- }
- }
-
- public IPluginExtensionPoint findExtensionPoint(String fullID) {
- if (fullID == null || fullID.length() == 0)
- return null;
- // separate plugin ID first
- int lastDot = fullID.lastIndexOf('.');
- if (lastDot == -1)
- return null;
- String pluginID = fullID.substring(0, lastDot);
- IPlugin plugin = findPlugin(pluginID);
- if (plugin == null)
- return null;
- String pointID = fullID.substring(lastDot + 1);
- IPluginExtensionPoint[] points = plugin.getExtensionPoints();
- for (int i = 0; i < points.length; i++) {
- IPluginExtensionPoint point = points[i];
- if (point.getId().equals(pointID))
- return point;
- }
- return null;
- }
-
- private IFeature findFeature(
- IFeatureModel[] models,
- String id,
- String version,
- int match) {
-
- for (int i = 0; i < models.length; i++) {
- IFeatureModel model = models[i];
-
- IFeature feature = model.getFeature();
- String pid = feature.getId();
- String pversion = feature.getVersion();
- if (compare(id, version, pid, pversion, match))
- return feature;
- }
- return null;
- }
-
- /**
- * Finds a feature with the given ID, any version
- * @param id
- * @return IFeature or null
- */
- public IFeature findFeature(String id) {
- IFeatureModel[] models = getFeatureModelManager().findFeatureModels(id);
- if (models.length > 0)
- return models[0].getFeature();
- return null;
- }
-
- /**
- * Finds a feature with the given ID and satisfying constraints
- * of the version and the match.
- * @param id
- * @param version
- * @param match
- * @return IFeature or null
- */
- public IFeature findFeature(String id, String version, int match) {
- IFeatureModel[] models = getFeatureModelManager().findFeatureModels(id);
- return findFeature(models, id, version, match);
- }
-
- public IPlugin findPlugin(String id) {
- return findPlugin(id, null, 0);
- }
-
- public IPlugin findPlugin(String id, String version, int match) {
- IPluginModel model = getModelManager().findPluginModel(id);
- return (model != null && model.isEnabled()) ? model.getPlugin() : null;
- }
-
- public ExternalModelManager getExternalModelManager() {
- initializeModels();
- return fExternalModelManager;
- }
- public PluginModelManager getModelManager() {
- initializeModels();
- return fModelManager;
- }
-
- public TargetProfileManager getTargetProfileManager() {
- if (fTargetProfileManager == null)
- fTargetProfileManager = new TargetProfileManager();
- return fTargetProfileManager;
- }
-
- public FeatureModelManager getFeatureModelManager() {
- initializeModels();
- return fFeatureModelManager;
- }
-
- public JavaElementChangeListener getJavaElementChangeListener() {
- if (fJavaElementChangeListener == null)
- fJavaElementChangeListener = new JavaElementChangeListener();
- return fJavaElementChangeListener;
- }
-
- public SchemaRegistry getSchemaRegistry() {
- if (fSchemaRegistry == null)
- fSchemaRegistry = new SchemaRegistry();
- return fSchemaRegistry;
- }
-
- public SourceLocationManager getSourceLocationManager() {
- if (fSourceLocationManager == null)
- fSourceLocationManager = new SourceLocationManager();
- return fSourceLocationManager;
- }
-
- public JavadocLocationManager getJavadocLocationManager() {
- if (fJavadocLocationManager == null)
- fJavadocLocationManager = new JavadocLocationManager();
- return fJavadocLocationManager;
- }
-
- public TracingOptionsManager getTracingOptionsManager() {
- if (fTracingOptionsManager == null)
- fTracingOptionsManager = new TracingOptionsManager();
- return fTracingOptionsManager;
- }
- public WorkspaceModelManager getWorkspaceModelManager() {
- initializeModels();
- return fWorkspaceModelManager;
- }
-
- /**
- * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPluginPreferences() {
- Preferences preferences = getPluginPreferences();
- preferences.setDefault(
- ICoreConstants.TARGET_MODE,
- ICoreConstants.VALUE_USE_THIS);
- preferences.setDefault(
- ICoreConstants.CHECKED_PLUGINS,
- ICoreConstants.VALUE_SAVED_ALL);
- if (preferences
- .getString(ICoreConstants.TARGET_MODE)
- .equals(ICoreConstants.VALUE_USE_THIS))
- preferences.setValue(
- ICoreConstants.PLATFORM_PATH,
- ExternalModelManager.computeDefaultPlatformPath());
- else
- preferences.setDefault(
- ICoreConstants.PLATFORM_PATH,
- ExternalModelManager.computeDefaultPlatformPath());
-
- // set defaults for the target environment variables.
- preferences.setDefault(OS, Platform.getOS());
- preferences.setDefault(WS, Platform.getWS());
- preferences.setDefault(NL, Locale.getDefault().toString());
- preferences.setDefault(ARCH, Platform.getOSArch());
- }
-
- private synchronized void initializeModels() {
- if (fModelManager != null && fExternalModelManager != null && fWorkspaceModelManager != null)
- return;
- fExternalModelManager = new ExternalModelManager();
- fWorkspaceModelManager = new WorkspaceModelManager();
- fModelManager = new PluginModelManager(fWorkspaceModelManager, fExternalModelManager);
- fFeatureModelManager = new FeatureModelManager(fWorkspaceModelManager);
- }
-
- public void releasePlatform() {
- if (fTracker == null)
- return;
- fTracker.close();
- fTracker = null;
- }
-
- public PlatformAdmin acquirePlatform() {
- if (fTracker==null) {
- fTracker = new ServiceTracker(fBundleContext, PlatformAdmin.class.getName(), null);
- fTracker.open();
- }
- PlatformAdmin result = (PlatformAdmin)fTracker.getService();
- while (result == null) {
- try {
- fTracker.waitForService(1000);
- result = (PlatformAdmin) fTracker.getService();
- } catch (InterruptedException ie) {
- }
- }
- return result;
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.fBundleContext = context;
- fJavaElementChangeListener = new JavaElementChangeListener();
- }
-
- public BundleContext getBundleContext() {
- return this.fBundleContext;
- }
-
- public void stop(BundleContext context) throws CoreException {
- PDECore.getDefault().savePluginPreferences();
- if (fJavaElementChangeListener != null) {
- fJavaElementChangeListener.shutdown();
- fJavaElementChangeListener = null;
- }
- if (fSchemaRegistry != null) {
- fSchemaRegistry.shutdown();
- fSchemaRegistry = null;
- }
- if (fModelManager != null) {
- fModelManager.shutdown();
- fModelManager = null;
- }
- if (fFeatureModelManager!=null) {
- fFeatureModelManager.shutdown();
- fFeatureModelManager = null;
- }
- if (fExternalModelManager!=null) {
- fExternalModelManager.shutdown();
- fExternalModelManager=null;
- }
- if (fWorkspaceModelManager!=null) {
- fWorkspaceModelManager.shutdown();
- fWorkspaceModelManager = null;
- }
- if (fTargetProfileManager!=null) {
- fTargetProfileManager.shutdown();
- fTargetProfileManager = null;
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
deleted file mode 100644
index fdd80df..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.osgi.util.NLS;
-
-public class PDECoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.pde.internal.core.pderesources";//$NON-NLS-1$
-
- public static String PluginModelManager_outOfSync;
-
- // Status text #####################################
- public static String ExternalModelManager_scanningProblems;
- public static String ExternalModelManager_processingPath;
- public static String Errors_SetupError;
- public static String Errors_SetupError_NoPlatformHome;
- public static String Errors_modelError;
- public static String BinaryRepositoryProvider_veto;
- public static String RequiredPluginsClasspathContainer_description;
- public static String ExternalJavaSearchClasspathContainer_description;
- public static String TargetPlatform_exceptionThrown;
- public static String TargetPlatformRegistryLoader_parsing;
-
- public static String FeatureInfo_description;
- public static String FeatureInfo_license;
- public static String FeatureInfo_copyright;
- public static String PluginObject_readOnlyChange;
- public static String FeatureObject_readOnlyChange;
- public static String SiteObject_readOnlyChange;
-
-
- public static String SearchablePluginsManager_saving;
- public static String BuildObject_readOnlyException;
- public static String BundleObject_readOnlyException;
- public static String PluginBase_librariesNotFoundException;
- public static String PluginParent_siblingsNotFoundException;
- public static String PluginBase_importsNotFoundException;
- public static String AbstractExtensions_extensionsNotFoundException;
- public static String SchemaCompositor_all;
- public static String SchemaCompositor_choice;
- public static String SchemaCompositor_group;
- public static String SchemaCompositor_sequence;
- public static String SiteBuildObject_readOnlyException;
- public static String PDEState_invalidFormat;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, PDECoreMessages.class);
- }
-
- public static String PDEState_readingPlugins;
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEManager.java
deleted file mode 100644
index b60aded..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEManager.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.net.URL;
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.plugin.ExternalPluginModelBase;
-
-public class PDEManager {
-
- public static IFragmentModel[] findFragmentsFor(IPluginModelBase model) {
- ArrayList result = new ArrayList();
- BundleDescription desc = getBundleDescription(model);
- if (desc != null) {
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- IPluginModelBase candidate = manager.findModel(fragments[i]);
- if (candidate instanceof IFragmentModel) {
- result.add(candidate);
- }
- }
- }
- return (IFragmentModel[])result.toArray(new IFragmentModel[result.size()]);
- }
-
- public static IPluginModel findHostFor(IFragmentModel fragment) {
- BundleDescription desc = getBundleDescription(fragment);
- if (desc != null) {
- HostSpecification spec = desc.getHost();
- if (spec != null) {
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- IPluginModelBase host = manager.findModel(spec.getName());
- if (host instanceof IPluginModel)
- return (IPluginModel)host;
- }
- }
- return null;
- }
-
- private static BundleDescription getBundleDescription(IPluginModelBase model) {
- BundleDescription desc = model.getBundleDescription();
-
- if (desc == null && model.getUnderlyingResource() != null) {
- // the model may be an editor model.
- // editor models don't carry a bundle description
- // get the core model counterpart.
- IProject project = model.getUnderlyingResource().getProject();
- IPluginModelBase coreModel = PDECore.getDefault().getModelManager().findModel(project);
- if (coreModel != null)
- desc = coreModel.getBundleDescription();
- }
- return desc;
- }
-
- public static URL[] getNLLookupLocations(IPluginModelBase model) {
- ArrayList urls = new ArrayList();
- addNLLocation(model, urls);
- if (model instanceof IPluginModel) {
- IFragmentModel[] fragments = findFragmentsFor(model);
- for (int i = 0; i < fragments.length; i++) {
- addNLLocation(fragments[i], urls);
- }
- } else if (model instanceof IFragmentModel){
- IPluginModel host = findHostFor((IFragmentModel)model);
- if (host != null)
- addNLLocation(host, urls);
- }
- return (URL[])urls.toArray(new URL[urls.size()]);
- }
-
- private static void addNLLocation(IPluginModelBase model, ArrayList urls) {
- URL location = model.getNLLookupLocation();
- if (location != null)
- urls.add(location);
- }
-
- public static String getBundleLocalization(IPluginModelBase model) {
- if (model.getUnderlyingResource() != null && model instanceof IBundlePluginModelBase)
- return((IBundlePluginModelBase)model).getBundleLocalization();
-
- if (model instanceof ExternalPluginModelBase)
- return ((ExternalPluginModelBase)model).getLocalization();
-
- return "plugin"; //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPluginConverter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPluginConverter.java
deleted file mode 100644
index eb30fae..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEPluginConverter.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Dictionary;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class PDEPluginConverter {
-
- public static void convertToOSGIFormat(IProject project, String target, Dictionary dictionary, IProgressMonitor monitor) throws CoreException {
- try {
- File outputFile = new File(project.getLocation().append(
- "META-INF/MANIFEST.MF").toOSString()); //$NON-NLS-1$
- File inputFile = new File(project.getLocation().toOSString());
- ServiceTracker tracker = new ServiceTracker(PDECore.getDefault()
- .getBundleContext(), PluginConverter.class.getName(), null);
- tracker.open();
- PluginConverter converter = (PluginConverter) tracker.getService();
- converter.convertManifest(inputFile, outputFile, false, target, true, dictionary);
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- tracker.close();
- } catch (PluginConversionException e) {
- } finally {
- monitor.done();
- }
- }
-
- public static void createBundleForFramework(IProject project, Set packages, IProgressMonitor monitor) throws CoreException {
- try {
- File outputFile = new File(project.getLocation().append(
- "META-INF/MANIFEST.MF").toOSString()); //$NON-NLS-1$
- File inputFile = new File(project.getLocation().toOSString());
- ServiceTracker tracker = new ServiceTracker(PDECore.getDefault()
- .getBundleContext(), PluginConverter.class.getName(), null);
- tracker.open();
- PluginConverter converter = (PluginConverter) tracker.getService();
- double version = TargetPlatform.getTargetVersion();
- String versionString = version <= 3.1 ? ICoreConstants.TARGET31 : TargetPlatform.getTargetVersionString();
- converter.convertManifest(inputFile, outputFile, false, versionString, true, null);
-
- InputStream manifestStream = new FileInputStream(outputFile);
- Manifest manifest = new Manifest(manifestStream);
- Properties prop = manifestToProperties(manifest.getMainAttributes());
- prop.remove(ICoreConstants.ECLIPSE_AUTOSTART);
- prop.remove(ICoreConstants.ECLIPSE_LAZYSTART);
- StringBuffer buffer = new StringBuffer();
- Iterator iter = packages.iterator();
- while (iter.hasNext()) {
- if (buffer.length() > 0) {
- buffer.append(","); //$NON-NLS-1$
- buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
- buffer.append(" "); //$NON-NLS-1$
- }
- buffer.append(iter.next().toString());
- }
- if (buffer.length() > 0)
- prop.put(Constants.IMPORT_PACKAGE, buffer.toString());
- converter.writeManifest(outputFile, prop, false);
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- tracker.close();
- } catch (PluginConversionException e) {
- } catch (CoreException e) {
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- monitor.done();
- }
- }
-
- public static void modifyBundleClasspathHeader(IProject project, IPluginModelBase model) {
- IFile file = project.getFile(JarFile.MANIFEST_NAME);
- if (file.exists()) {
- InputStream manifestStream = null;
- try {
- manifestStream = new FileInputStream(file.getLocation().toFile());
- Manifest manifest = new Manifest(manifestStream);
- Properties prop = manifestToProperties(manifest.getMainAttributes());
- String classpath = prop.getProperty(Constants.BUNDLE_CLASSPATH);
- if (classpath == null) {
- prop.put(Constants.BUNDLE_CLASSPATH,
- ClasspathUtilCore.getFilename(model));
- } else {
- ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, classpath);
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < elements.length; i++) {
- if (buffer.length() > 0) {
- buffer.append(","); //$NON-NLS-1$
- buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
- buffer.append(" "); //$NON-NLS-1$
- }
- if (elements[i].getValue().equals(".")) //$NON-NLS-1$
- buffer.append(ClasspathUtilCore.getFilename(model));
- else
- buffer.append(elements[i].getValue());
- }
- prop.put(Constants.BUNDLE_CLASSPATH, buffer.toString());
- }
- ServiceTracker tracker = new ServiceTracker(PDECore.getDefault()
- .getBundleContext(), PluginConverter.class.getName(), null);
- tracker.open();
- PluginConverter converter = (PluginConverter) tracker.getService();
- converter.writeManifest(new File(file.getLocation().toOSString()), prop, false);
- file.refreshLocal(1, null);
- tracker.close();
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } catch (BundleException e) {
- } catch (PluginConversionException e) {
- } catch (CoreException e) {
- } finally {
- try {
- if (manifestStream != null)
- manifestStream.close();
- } catch (IOException e) {
- }
- }
- }
- }
-
- private static Properties manifestToProperties(Attributes d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name) iter.next();
- result.put(key.toString(), d.get(key));
- }
- return result;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEState.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEState.java
deleted file mode 100644
index 58405cf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEState.java
+++ /dev/null
@@ -1,734 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.ResolverError;
-import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.bundle.BundleFragmentModel;
-import org.eclipse.pde.internal.core.bundle.BundlePluginModel;
-import org.eclipse.pde.internal.core.bundle.BundlePluginModelBase;
-import org.eclipse.pde.internal.core.bundle.WorkspaceBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.plugin.ExternalFragmentModel;
-import org.eclipse.pde.internal.core.plugin.ExternalPluginModel;
-import org.eclipse.pde.internal.core.plugin.ExternalPluginModelBase;
-import org.eclipse.pde.internal.core.plugin.WorkspaceExtensionsModel;
-import org.eclipse.pde.internal.core.plugin.WorkspaceFragmentModel;
-import org.eclipse.pde.internal.core.plugin.WorkspacePluginModel;
-import org.eclipse.pde.internal.core.plugin.WorkspacePluginModelBase;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.osgi.framework.Constants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class PDEState extends MinimalState {
-
- class PluginInfo {
- String name;
- String providerName;
- String className;
- boolean hasExtensibleAPI;
- boolean legacy;
- String[] libraries;
- String project;
- String localization;
- }
-
- private URL[] fWorkspaceURLs;
- private URL[] fTargetURLs;
- private IProgressMonitor fMonitor;
- private Map fPluginInfos;
- private Map fExtensions;
- private TreeMap fTargetModels = new TreeMap();
- private ArrayList fWorkspaceModels = new ArrayList();
- private boolean fCombined;
- private long fTargetTimestamp;
- private boolean fResolve = true;
- private boolean fNewState;
-
- public PDEState(URL[] urls, boolean resolve, IProgressMonitor monitor) {
- this(new URL[0], urls, resolve, TargetPlatform.getTargetEnvironment(), monitor);
- }
-
- public PDEState(URL[] workspace, URL[] target, boolean resolve, Dictionary properties, IProgressMonitor monitor) {
- long start = System.currentTimeMillis();
- fResolve = resolve;
- fWorkspaceURLs = workspace;
- fTargetURLs = target;
- fMonitor = monitor;
- setTargetMode(target);
- if (fResolve) {
- readTargetState();
- } else {
- createNewTargetState();
- createExtensionDocument();
- }
- fState.setResolver(Platform.getPlatformAdmin().getResolver());
- resolveState(false);
-
- if (fResolve)
- logResolutionErrors();
-
- createTargetModels();
-
- if (fResolve && workspace.length > 0 && !fNewState && !"true".equals(System.getProperty("pde.nocache"))) { //$NON-NLS-1$ //$NON-NLS-2$
- readWorkspaceState();
- }
-
- if (DEBUG)
- System.out.println("Time to create state: " + (System.currentTimeMillis() - start) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private void readTargetState() {
- fTargetTimestamp = computeTimestamp(fTargetURLs);
- File dir = new File(DIR, Long.toString(fTargetTimestamp) + ".target"); //$NON-NLS-1$
- if ((fState = readStateCache(dir)) == null
- || (fPluginInfos = readPluginInfoCache(dir)) == null) {
- createNewTargetState();
- saveState(dir);
- savePluginInfo(dir);
- fNewState = true;
- } else {
- fId = fState.getBundles().length;
- }
- if ((fExtensions = readExtensionsCache(dir)) == null)
- saveExtensions(dir);
- }
-
- private void createNewTargetState() {
- fState = stateObjectFactory.createState();
- fPluginInfos = new HashMap();
- fMonitor.beginTask(PDECoreMessages.PDEState_readingPlugins, fTargetURLs.length);
- for (int i = 0; i < fTargetURLs.length; i++) {
- File file = new File(fTargetURLs[i].getFile());
- try {
- fMonitor.subTask(file.getName());
- addBundle(file, true, -1);
- } catch (PluginConversionException e) {
- } catch (CoreException e) {
- } catch (IOException e) {
- PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, IStatus.ERROR,
- PDECoreMessages.PDEState_invalidFormat + " " + file.getAbsolutePath(), //$NON-NLS-1$
- null));
- } finally {
- fMonitor.worked(1);
- }
- }
- }
-
- private void createTargetModels() {
- BundleDescription[] bundleDescriptions = fState.getBundles();
- for (int i = 0; i < bundleDescriptions.length; i++) {
- boolean add = true;
- if (!bundleDescriptions[i].isResolved()) {
- ResolverError[] error = fState.getResolverErrors(bundleDescriptions[i]);
- for (int j = 0; j < error.length; j++) {
- if (error[j].getType() == ResolverError.SINGLETON_SELECTION) {
- add = false;
- break;
- }
- }
- }
- if (add) {
- BundleDescription desc = bundleDescriptions[i];
- fTargetModels.put(desc.getSymbolicName(), createExternalModel(desc));
- fExtensions.remove(Long.toString(desc.getBundleId()));
- fPluginInfos.remove(Long.toString(desc.getBundleId()));
- }
- }
- }
-
- private void readWorkspaceState() {
- long workspace = computeTimestamp(fWorkspaceURLs);
- File dir = new File(DIR, Long.toString(workspace) + ".workspace"); //$NON-NLS-1$
- State localState = readStateCache(dir);
- Map localPluginInfos = readPluginInfoCache(dir);
- Map localExtensions = readExtensionsCache(dir);
-
- fCombined = localState != null && localPluginInfos != null && localExtensions != null;
- if (fCombined) {
- Iterator iter = localPluginInfos.keySet().iterator();
- while (iter.hasNext()) {
- String key = iter.next().toString();
- fPluginInfos.put(key, localPluginInfos.get(key));
- }
-
- iter = localExtensions.keySet().iterator();
- while (iter.hasNext()) {
- String key = iter.next().toString();
- fExtensions.put(key, localExtensions.get(key));
- }
-
- BundleDescription[] bundles = localState.getBundles();
- for (int i = 0; i < bundles.length; i++) {
- BundleDescription desc = bundles[i];
- String id = desc.getSymbolicName();
- BundleDescription[] conflicts = fState.getBundles(id);
-
- for (int j = 0; j < conflicts.length; j++) {
- fState.removeBundle(conflicts[j]);
- }
-
- BundleDescription newbundle = stateObjectFactory.createBundleDescription(desc);
- IPluginModelBase model = createWorkspaceModel(newbundle);
- if (model != null && fState.addBundle(newbundle)) {
- fId = Math.max(fId, newbundle.getBundleId());
- fWorkspaceModels.add(model);
- }
- fExtensions.remove(Long.toString(newbundle.getBundleId()));
- fPluginInfos.remove(Long.toString(newbundle.getBundleId()));
- }
- fId = Math.max(fId, fState.getBundles().length);
- fState.resolve(true);
- }
- }
-
- public boolean isCombined() {
- return fCombined;
- }
-
- public BundleDescription addBundle(Dictionary manifest, File bundleLocation, boolean keepLibraries, long bundleId) {
- BundleDescription desc = super.addBundle(manifest, bundleLocation, keepLibraries, bundleId);
- if (desc != null && keepLibraries)
- createPluginInfo(desc, manifest);
- return desc;
- }
-
- private void createPluginInfo(BundleDescription desc, Dictionary manifest) {
- PluginInfo info = new PluginInfo();
- info.name = (String)manifest.get(Constants.BUNDLE_NAME);
- info.providerName = (String)manifest.get(Constants.BUNDLE_VENDOR);
-
- String className = (String)manifest.get("Plugin-Class"); //$NON-NLS-1$
- info.className = className != null ? className : (String)manifest.get(Constants.BUNDLE_ACTIVATOR);
- info.libraries = PDEStateHelper.getClasspath(manifest);
- info.hasExtensibleAPI = "true".equals(manifest.get(ICoreConstants.EXTENSIBLE_API)); //$NON-NLS-1$
- info.localization = (String)manifest.get(Constants.BUNDLE_LOCALIZATION);
- fPluginInfos.put(Long.toString(desc.getBundleId()), info);
- }
-
- private void createPluginInfo(Map map, Element element) {
- PluginInfo info = new PluginInfo();
- info.name = element.getAttribute("name"); //$NON-NLS-1$
- info.providerName = element.getAttribute("provider"); //$NON-NLS-1$
- info.className = element.getAttribute("class"); //$NON-NLS-1$
- info.hasExtensibleAPI = "true".equals(element.getAttribute("hasExtensibleAPI")); //$NON-NLS-1$ //$NON-NLS-2$
- info.project = element.getAttribute("project"); //$NON-NLS-1$
- info.legacy = "true".equals(element.getAttribute("legacy")); //$NON-NLS-1$ //$NON-NLS-2$
- info.localization = element.getAttribute("localization"); //$NON-NLS-1$
-
- NodeList libs = element.getChildNodes();
- ArrayList list = new ArrayList(libs.getLength());
- for (int i = 0; i < libs.getLength(); i++) {
- if (libs.item(i).getNodeType() == Node.ELEMENT_NODE) {
- Element lib = (Element)libs.item(i);
- list.add(lib.getAttribute("name")); //$NON-NLS-1$
- }
- }
- info.libraries = (String[])list.toArray(new String[list.size()]);
- map.put(element.getAttribute("bundleID"), info); //$NON-NLS-1$
- }
-
- private Document createExtensionDocument(){
- fExtensions = new HashMap();
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- Document doc = null;
- try {
- doc = factory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException e) {
- return null;
- }
- Element root = doc.createElement("extensions"); //$NON-NLS-1$
-
- BundleDescription[] bundles = fState.getBundles();
- for (int i = 0; i < bundles.length; i++) {
- BundleDescription desc = bundles[i];
- Element element = doc.createElement("bundle"); //$NON-NLS-1$
- element.setAttribute("bundleID", Long.toString(desc.getBundleId())); //$NON-NLS-1$
- PDEStateHelper.parseExtensions(desc, element);
- if (element.hasChildNodes()) {
- root.appendChild(element);
- fExtensions.put(Long.toString(desc.getBundleId()), element);
- }
- }
- doc.appendChild(root);
- return doc;
- }
-
- private void savePluginInfo(File dir) {
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- Document doc = factory.newDocumentBuilder().newDocument();
- Element root = doc.createElement("map"); //$NON-NLS-1$
-
- Iterator iter = fPluginInfos.keySet().iterator();
- while (iter.hasNext()) {
- String key = iter.next().toString();
- Element element = doc.createElement("bundle"); //$NON-NLS-1$
- element.setAttribute("bundleID", key); //$NON-NLS-1$
- PluginInfo info = (PluginInfo)fPluginInfos.get(key);
- if (info.className != null)
- element.setAttribute("class", info.className); //$NON-NLS-1$
- if (info.providerName != null)
- element.setAttribute("provider", info.providerName); //$NON-NLS-1$
- if (info.name != null)
- element.setAttribute("name", info.name); //$NON-NLS-1$
- if (info.hasExtensibleAPI)
- element.setAttribute("hasExtensibleAPI", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- if (info.localization != null)
- element.setAttribute("localization", info.localization); //$NON-NLS-1$
- if (info.libraries != null) {
- for (int i = 0; i < info.libraries.length; i++) {
- Element lib = doc.createElement("library"); //$NON-NLS-1$
- lib.setAttribute("name", info.libraries[i]); //$NON-NLS-1$
- element.appendChild(lib);
- }
- }
- root.appendChild(element);
- }
- doc.appendChild(root);
- XMLPrintHandler.writeFile(doc, new File(dir, ".pluginInfo")); //$NON-NLS-1$
- } catch (Exception e) {
- PDECore.log(e);
- }
- }
-
- private void saveExtensions(File dir) {
- try {
- File file = new File(dir, ".extensions"); //$NON-NLS-1$
- XMLPrintHandler.writeFile(createExtensionDocument(), file);
- } catch (IOException e) {
- }
- }
-
- private Map readExtensionsCache(File dir) {
- long start = System.currentTimeMillis();
- File file = new File(dir, ".extensions"); //$NON-NLS-1$
- if (file.exists() && file.isFile()) {
- try {
- Map map = new HashMap();
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- Document doc = factory.newDocumentBuilder().parse(file);
- Element root = doc.getDocumentElement();
- if (root != null) {
- NodeList bundles = root.getChildNodes();
- for (int i = 0; i < bundles.getLength(); i++) {
- if (bundles.item(i).getNodeType() == Node.ELEMENT_NODE) {
- Element bundle = (Element)bundles.item(i);
- String id = bundle.getAttribute("bundleID"); //$NON-NLS-1$
- map.put(id, bundle.getChildNodes());
- }
- }
- }
- if (DEBUG)
- System.out.println("Time to read extensions: " + (System.currentTimeMillis() - start) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
- return map;
- } catch (org.xml.sax.SAXException e) {
- PDECore.log(e);
- } catch (IOException e) {
- PDECore.log(e);
- } catch (ParserConfigurationException e) {
- PDECore.log(e);
- }
- }
- return null;
- }
-
- private Map readPluginInfoCache(File dir) {
- File file = new File(dir, ".pluginInfo"); //$NON-NLS-1$
- if (file.exists() && file.isFile()) {
- try {
- Map map = new HashMap();
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- Document doc = factory.newDocumentBuilder().parse(file);
- Element root = doc.getDocumentElement();
- if (root != null) {
- NodeList list = root.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- if (list.item(i).getNodeType() == Node.ELEMENT_NODE)
- createPluginInfo(map, (Element)list.item(i));
- }
- }
- return map;
- } catch (org.xml.sax.SAXException e) {
- PDECore.log(e);
- } catch (IOException e) {
- PDECore.log(e);
- } catch (ParserConfigurationException e) {
- PDECore.log(e);
- }
- }
- return null;
- }
-
- private State readStateCache(File dir) {
- if (dir.exists() && dir.isDirectory()) {
- try {
- return stateObjectFactory.readState(dir);
- } catch (IllegalStateException e) {
- PDECore.log(e);
- } catch (FileNotFoundException e) {
- PDECore.log(e);
- } catch (IOException e) {
- PDECore.log(e);
- } finally {
- }
- }
- return null;
- }
-
- private long computeTimestamp(URL[] urls) {
- long timestamp = 0;
- for (int i = 0; i < urls.length; i++) {
- File file = new File(urls[i].getFile());
- if (file.exists()) {
- if (file.isFile()) {
- timestamp ^= file.lastModified();
- } else {
- File manifest = new File(file, "META-INF/MANIFEST.MF"); //$NON-NLS-1$
- if (manifest.exists())
- timestamp ^= manifest.lastModified();
- manifest = new File(file, "plugin.xml"); //$NON-NLS-1$
- if (manifest.exists())
- timestamp ^= manifest.lastModified();
- manifest = new File(file, "fragment.xml"); //$NON-NLS-1$
- if (manifest.exists())
- timestamp ^= manifest.lastModified();
- }
- timestamp ^= file.getAbsolutePath().hashCode();
- }
- }
- return timestamp;
- }
-
- private IPluginModelBase createWorkspaceModel(BundleDescription desc) {
- String projectName = getProject(desc.getBundleId());
- IProject project = PDECore.getWorkspace().getRoot().getProject(projectName);
- if (!project.exists())
- return null;
- if (WorkspaceModelManager.hasBundleManifest(project)) {
- BundlePluginModelBase model = null;
- if (desc.getHost() == null)
- model = new BundlePluginModel();
- else
- model = new BundleFragmentModel();
- model.setEnabled(true);
- WorkspaceBundleModel bundle = new WorkspaceBundleModel(project.getFile("META-INF/MANIFEST.MF")); //$NON-NLS-1$
- bundle.load(desc, this);
- model.setBundleDescription(desc);
- model.setBundleModel(bundle);
-
- String filename = (desc.getHost() == null) ? "plugin.xml" : "fragment.xml"; //$NON-NLS-1$ //$NON-NLS-2$
- IFile file = project.getFile(filename);
- if (file.exists()) {
- WorkspaceExtensionsModel extensions = new WorkspaceExtensionsModel(file);
- extensions.load(desc, this);
- extensions.setBundleModel(model);
- model.setExtensionsModel(extensions);
- }
- return model;
- }
-
- WorkspacePluginModelBase model = null;
- if (desc.getHost() == null)
- model = new WorkspacePluginModel(project.getFile("plugin.xml"), true); //$NON-NLS-1$
- else
- model = new WorkspaceFragmentModel(project.getFile("fragment.xml"), true); //$NON-NLS-1$
- model.load(desc, this, false);
- model.setBundleDescription(desc);
- return model;
- }
-
- private IPluginModelBase createExternalModel(BundleDescription desc) {
- ExternalPluginModelBase model = null;
- if (desc.getHost() == null)
- model = new ExternalPluginModel();
- else
- model = new ExternalFragmentModel();
- model.load(desc, this, !fResolve);
- model.setBundleDescription(desc);
- return model;
- }
-
- public IPluginModelBase[] getTargetModels() {
- return (IPluginModelBase[])fTargetModels.values().toArray(new IPluginModelBase[fTargetModels.size()]);
- }
-
- public IPluginModelBase[] getWorkspaceModels() {
- return (IPluginModelBase[])fWorkspaceModels.toArray(new IPluginModelBase[fWorkspaceModels.size()]);
- }
-
- public IPluginModelBase[] getModels() {
- IPluginModelBase[] workspace = getWorkspaceModels();
- IPluginModelBase[] target = getTargetModels();
- IPluginModelBase[] all = new IPluginModelBase[workspace.length + target.length];
- if (workspace.length > 0)
- System.arraycopy(workspace, 0, all, 0, workspace.length);
- if (target.length > 0)
- System.arraycopy(target, 0, all, workspace.length, target.length);
- return all;
- }
-
- public String getClassName(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? null : info.className;
- }
-
- public boolean hasExtensibleAPI(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? false : info.hasExtensibleAPI;
- }
-
- public boolean isLegacy(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? false : info.legacy;
- }
-
- public String getPluginName(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? null : info.name;
- }
-
- public String getProviderName(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? null : info.providerName;
- }
-
- public String[] getLibraryNames(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? new String[0] : info.libraries;
- }
-
- public String getBundleLocalization(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? null : info.localization;
- }
-
- public String getProject(long bundleID) {
- PluginInfo info = (PluginInfo)fPluginInfos.get(Long.toString(bundleID));
- return info == null ? null : info.project;
- }
-
- public Node[] getExtensions(long bundleID) {
- return getChildren(bundleID, "extension"); //$NON-NLS-1$
- }
-
- public Node[] getExtensionPoints(long bundleID) {
- return getChildren(bundleID, "extension-point"); //$NON-NLS-1$
- }
-
- private Node[] getChildren(long bundleID, String tagName) {
- ArrayList list = new ArrayList();
- if (fExtensions != null) {
- Element bundle = (Element)fExtensions.get(Long.toString(bundleID));
- if (bundle != null) {
- NodeList children = bundle.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- if (tagName.equals(children.item(i).getNodeName())) {
- list.add(children.item(i));
- }
- }
- }
- }
- return (Node[])list.toArray(new Node[list.size()]);
- }
-
- public Node[] getAllExtensions(long bundleID) {
- ArrayList list = new ArrayList();
- if (fExtensions != null) {
- Element bundle = (Element)fExtensions.get(Long.toString(bundleID));
- if (bundle != null) {
- NodeList children = bundle.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- String name = children.item(i).getNodeName();
- if ("extension".equals(name) || "extension-point".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
- list.add(children.item(i));
- }
- }
- }
- }
- return (Node[])list.toArray(new Node[list.size()]);
- }
-
- public void shutdown() {
- IPluginModelBase[] models = PDECore.getDefault().getModelManager().getWorkspaceModels();
- long timestamp = 0;
- if (!"true".equals(System.getProperty("pde.nocache")) && shouldSaveState(models)) { //$NON-NLS-1$ //$NON-NLS-2$
- timestamp = computeTimestamp(models);
- File dir = new File(DIR, Long.toString(timestamp) + ".workspace"); //$NON-NLS-1$
- State state = stateObjectFactory.createState();
- for (int i = 0; i < models.length; i++) {
- state.addBundle(models[i].getBundleDescription());
- }
- saveState(state, dir);
- writePluginInfo(models, dir);
- writeExtensions(models, dir);
- }
- clearStaleStates(".target", fTargetTimestamp); //$NON-NLS-1$
- clearStaleStates(".workspace", timestamp); //$NON-NLS-1$
- clearStaleStates(".cache", 0); //$NON-NLS-1$
- }
-
- public void writePluginInfo(IPluginModelBase[] models, File destination) {
- try {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document doc = builder.newDocument();
-
- Element root = doc.createElement("map"); //$NON-NLS-1$
- doc.appendChild(root);
- for (int i = 0; i < models.length; i++) {
- IPluginBase plugin = models[i].getPluginBase();
- BundleDescription desc = models[i].getBundleDescription();
- Element element = doc.createElement("bundle"); //$NON-NLS-1$
- element.setAttribute("bundleID", Long.toString(desc.getBundleId())); //$NON-NLS-1$
- element.setAttribute("project", models[i].getUnderlyingResource().getProject().getName()); //$NON-NLS-1$
- if (plugin instanceof IPlugin && ((IPlugin)plugin).getClassName() != null)
- element.setAttribute("class", ((IPlugin)plugin).getClassName()); //$NON-NLS-1$
- if (plugin.getProviderName() != null)
- element.setAttribute("provider", plugin.getProviderName()); //$NON-NLS-1$
- if (plugin.getName() != null)
- element.setAttribute("name", plugin.getName()); //$NON-NLS-1$
- if (plugin instanceof IPlugin && ClasspathUtilCore.hasExtensibleAPI((IPlugin)plugin))
- element.setAttribute("hasExtensibleAPI", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- if (plugin.getSchemaVersion() == null)
- element.setAttribute("legacy", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- if (models[i] instanceof IBundlePluginModelBase) {
- String localization = ((IBundlePluginModelBase)models[i]).getBundleLocalization();
- if (localization != null)
- element.setAttribute("localization", localization); //$NON-NLS-1$
- }
- IPluginLibrary[] libraries = plugin.getLibraries();
- for (int j = 0; j < libraries.length; j++) {
- Element lib = doc.createElement("library"); //$NON-NLS-1$
- lib.setAttribute("name", libraries[j].getName()); //$NON-NLS-1$
- if (!libraries[j].isExported())
- lib.setAttribute("exported", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- element.appendChild(lib);
- }
- root.appendChild(element);
- }
- XMLPrintHandler.writeFile(doc, new File(destination, ".pluginInfo")); //$NON-NLS-1$
- } catch (ParserConfigurationException e) {
- } catch (FactoryConfigurationError e) {
- } catch (IOException e) {
- }
- }
-
- public void writeExtensions(IPluginModelBase[] models, File destination) {
- try {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document doc = builder.newDocument();
-
- Element root = doc.createElement("extensions"); //$NON-NLS-1$
- doc.appendChild(root);
-
- for (int i = 0; i < models.length; i++) {
- IPluginBase plugin = models[i].getPluginBase();
- IPluginExtension[] extensions = plugin.getExtensions();
- IPluginExtensionPoint[] extPoints = plugin.getExtensionPoints();
- if (extensions.length == 0 && extPoints.length == 0)
- continue;
- Element element = doc.createElement("bundle"); //$NON-NLS-1$
- element.setAttribute("bundleID", Long.toString(models[i].getBundleDescription().getBundleId())); //$NON-NLS-1$
- for (int j = 0; j < extensions.length; j++) {
- element.appendChild(CoreUtility.writeExtension(doc, extensions[j]));
- }
- for (int j = 0; j < extPoints.length; j++) {
- element.appendChild(CoreUtility.writeExtensionPoint(doc, extPoints[j]));
- }
- root.appendChild(element);
- }
- XMLPrintHandler.writeFile(doc, new File(destination, ".extensions")); //$NON-NLS-1$
- } catch (ParserConfigurationException e) {
- } catch (FactoryConfigurationError e) {
- } catch (IOException e) {
- }
- }
-
- private long computeTimestamp(IPluginModelBase[] models) {
- URL[] urls = new URL[models.length];
- for (int i = 0; i < models.length; i++) {
- try {
- IProject project = models[i].getUnderlyingResource().getProject();
- urls[i] = new File(project.getLocation().toString()).toURL();
- } catch (MalformedURLException e) {
- }
- }
- return computeTimestamp(urls);
- }
-
- private boolean shouldSaveState(IPluginModelBase[] models) {
- for (int i = 0; i < models.length; i++) {
- String id = models[i].getPluginBase().getId();
- if (id == null
- || id.trim().length() == 0
- || !models[i].isLoaded()
- ||!models[i].isInSync()
- || models[i].getBundleDescription() == null)
- return false;
- }
- return models.length > 0;
- }
-
- private void clearStaleStates(String extension, long latest) {
- File dir = new File(PDECore.getDefault().getStateLocation().toOSString());
- File[] children = dir.listFiles();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- File child = children[i];
- if (child.isDirectory()) {
- String name = child.getName();
- if (name.endsWith(extension)
- && name.length() > extension.length()
- && !name.equals(Long.toString(latest) + extension)) {
- CoreUtility.deleteContent(child);
- }
- }
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEStateHelper.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEStateHelper.java
deleted file mode 100644
index 2888dc0..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEStateHelper.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.util.ManifestElement;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-
-public class PDEStateHelper {
- private static SAXParserFactory saxParserFactory;
-
- public static BundleDescription[] getDependentBundles(BundleDescription root) {
- BundleDescription[] imported = getImportedBundles(root); // Import-Package
- BundleDescription[] required = getRequiredBundles(root); // require-bundle <=> <import> from plugin.xml
- BundleDescription[] dependents = new BundleDescription[imported.length + required.length];
- System.arraycopy(imported, 0, dependents, 0, imported.length);
- System.arraycopy(required, 0, dependents, imported.length, required.length);
- return dependents;
- }
- public static BundleDescription[] getDependentBundlesWithFragments(BundleDescription root) {
- BundleDescription[] imported = getImportedBundles(root);
- BundleDescription[] importedByFragments = getImportedByFragments(root);
- BundleDescription[] required = getRequiredBundles(root);
- BundleDescription[] requiredByFragments = getRequiredByFragments(root);
- BundleDescription[] dependents = new BundleDescription[imported.length + importedByFragments.length + required.length + requiredByFragments.length];
- System.arraycopy(imported, 0, dependents, 0, imported.length);
- System.arraycopy(importedByFragments, 0, dependents, imported.length, importedByFragments.length);
- System.arraycopy(required, 0, dependents, imported.length + importedByFragments.length, required.length);
- System.arraycopy(requiredByFragments, 0, dependents, imported.length + importedByFragments.length + required.length, requiredByFragments.length);
- return dependents;
- }
- public static BundleDescription[] getImportedByFragments(BundleDescription root) {
- BundleDescription[] fragments = root.getFragments();
- List importedByFragments = new ArrayList();
- for (int i = 0; i < fragments.length; i++) {
- if (!fragments[i].isResolved())
- continue;
- merge(importedByFragments, getImportedBundles(fragments[i]));
- }
- BundleDescription[] result = new BundleDescription[importedByFragments.size()];
- return (BundleDescription[]) importedByFragments.toArray(result);
- }
- public static BundleDescription[] getRequiredByFragments(BundleDescription root) {
- BundleDescription[] fragments = root.getFragments();
- List importedByFragments = new ArrayList();
- for (int i = 0; i < fragments.length; i++) {
- if (!fragments[i].isResolved())
- continue;
- merge(importedByFragments, getRequiredBundles(fragments[i]));
- }
- BundleDescription[] result = new BundleDescription[importedByFragments.size()];
- return (BundleDescription[]) importedByFragments.toArray(result);
- }
- public static void merge(List source, BundleDescription[] toAdd) {
- for (int i = 0; i < toAdd.length; i++) {
- if (!source.contains(toAdd[i]))
- source.add(toAdd[i]);
- }
- }
- public static String[] getClasspath(Dictionary manifest) {
- String fullClasspath = (String) manifest.get(Constants.BUNDLE_CLASSPATH);
- String[] result = new String[0];
- try {
- if (fullClasspath != null) {
- ManifestElement[] classpathEntries = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, fullClasspath);
- result = new String[classpathEntries.length];
- for (int i = 0; i < classpathEntries.length; i++) {
- result[i] = classpathEntries[i].getValue();
- }
- }
- } catch (BundleException e) {
- }
- return result;
- }
- /**
- * This methods return the bundleDescriptions to which imports have been
- * bound to.
- *
- * @param bundleId
- * @param version
- * @return
- */
- public static BundleDescription[] getImportedBundles(BundleDescription root) {
- if (root == null)
- return new BundleDescription[0];
- ExportPackageDescription[] packages = root.getResolvedImports();
- ArrayList resolvedImports = new ArrayList(packages.length);
- for (int i = 0; i < packages.length; i++)
- if (!root.getLocation().equals(packages[i].getExporter().getLocation()) && !resolvedImports.contains(packages[i].getExporter()))
- resolvedImports.add(packages[i].getExporter());
- return (BundleDescription[]) resolvedImports.toArray(new BundleDescription[resolvedImports.size()]);
- }
- /**
- * This methods return the bundleDescriptions to which required bundles
- * have been bound to.
- *
- * @param bundleId
- * @param version
- * @return
- */
- public static BundleDescription[] getRequiredBundles(BundleDescription root) {
- if (root == null)
- return new BundleDescription[0];
- return root.getResolvedRequires();
- }
-
- public static void parseExtensions(BundleDescription desc, Element parent) {
- ZipFile jarFile = null;
- InputStream stream = null;
- try {
- String filename = desc.getHost() == null ? "plugin.xml" : "fragment.xml"; //$NON-NLS-1$ //$NON-NLS-2$
- String path = desc.getLocation();
-
- File file = new File(path);
- if (file.isFile()) {
- jarFile = new ZipFile(file, ZipFile.OPEN_READ);
- ZipEntry manifestEntry = jarFile.getEntry(filename);
- if (manifestEntry != null)
- stream = jarFile.getInputStream(manifestEntry);
- } else if (file.isDirectory()) {
- File manifest = new File(file, filename);
- if (manifest.exists() && manifest.isFile()) {
- stream = new FileInputStream(manifest);
- }
- }
- if (stream != null)
- getParser().parse(stream, new ExtensionsHandler(parent));
-
- } catch (IOException e) {
- } catch (ParserConfigurationException e) {
- } catch (SAXException e) {
- } catch (FactoryConfigurationError e) {
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e1) {
- }
- try {
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e2) {
- }
- }
- }
-
- private static SAXParser getParser() throws ParserConfigurationException, SAXException{
- if (saxParserFactory == null)
- saxParserFactory = SAXParserFactory.newInstance();
- return saxParserFactory.newSAXParser();
- }
-
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PlatformConfiguration.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PlatformConfiguration.java
deleted file mode 100644
index dc5c4a2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PlatformConfiguration.java
+++ /dev/null
@@ -1,1743 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.RandomAccessFile;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.internal.boot.PlatformURLConnection;
-import org.eclipse.core.internal.boot.PlatformURLHandler;
-import org.eclipse.update.configurator.IPlatformConfiguration;
-
-public class PlatformConfiguration implements IPlatformConfiguration {
-
- private static PlatformConfiguration currentPlatformConfiguration = null;
-
- private URL configLocation;
- private HashMap sites;
- private HashMap externalLinkSites; // used to restore prior link site state
- private HashMap cfgdFeatures;
- private HashMap bootPlugins;
- private String defaultFeature;
- private long changeStamp;
- private boolean changeStampIsValid = false;
- private long lastFeaturesChangeStamp;
- private long featuresChangeStamp;
- private boolean featuresChangeStampIsValid = false;
- private long pluginsChangeStamp;
- private boolean pluginsChangeStampIsValid = false;
- private boolean transientConfig = false;
- private File cfgLockFile;
- private RandomAccessFile cfgLockFileRAF;
- private BootDescriptor runtimeDescriptor;
-
- private static String cmdFeature = null;
- private static String cmdApplication = null;
- private static boolean cmdInitialize = false;
- private static boolean cmdFirstUse = false;
- private static boolean cmdUpdate = false;
- private static boolean cmdNoUpdate = false;
-
- static boolean DEBUG = false;
-
- private static final String RUNTIME_PLUGIN_ID = "org.eclipse.core.runtime"; //$NON-NLS-1$
-
- private static final String PLUGINS = "plugins"; //$NON-NLS-1$
- private static final String FEATURES = "features"; //$NON-NLS-1$
- private static final String CONFIG_FILE_TEMP_SUFFIX = ".tmp"; //$NON-NLS-1$
- private static final String CONFIG_FILE_BAK_SUFFIX = ".bak"; //$NON-NLS-1$
- private static final String PLUGIN_XML = "plugin.xml"; //$NON-NLS-1$
- private static final String FRAGMENT_XML = "fragment.xml"; //$NON-NLS-1$
- private static final String FEATURE_XML = "feature.xml"; //$NON-NLS-1$
-
- private static final String[] BOOTSTRAP_PLUGINS = { "org.eclipse.core.boot" }; //$NON-NLS-1$
- private static final String CFG_BOOT_PLUGIN = "bootstrap"; //$NON-NLS-1$
- private static final String CFG_SITE = "site"; //$NON-NLS-1$
- private static final String CFG_URL = "url"; //$NON-NLS-1$
- private static final String CFG_POLICY = "policy"; //$NON-NLS-1$
- private static final String[] CFG_POLICY_TYPE = { "USER-INCLUDE", "USER-EXCLUDE" }; //$NON-NLS-1$ //$NON-NLS-2$
- private static final String CFG_POLICY_TYPE_UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
- private static final String CFG_LIST = "list"; //$NON-NLS-1$
- private static final String CFG_STAMP = "stamp"; //$NON-NLS-1$
- private static final String CFG_FEATURE_STAMP = "stamp.features"; //$NON-NLS-1$
- private static final String CFG_PLUGIN_STAMP = "stamp.plugins"; //$NON-NLS-1$
- private static final String CFG_UPDATEABLE = "updateable"; //$NON-NLS-1$
- private static final String CFG_LINK_FILE = "linkfile"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY = "feature"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_DEFAULT = "feature.default.id"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_ID = "id"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_PRIMARY = "primary"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_VERSION = "version"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_PLUGIN_VERSION = "plugin-version"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_PLUGIN_IDENTIFIER = "plugin-identifier"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_APPLICATION = "application"; //$NON-NLS-1$
- private static final String CFG_FEATURE_ENTRY_ROOT = "root"; //$NON-NLS-1$
-
- private static final String DEFAULT_FEATURE_ID = "org.eclipse.platform"; //$NON-NLS-1$
- private static final String DEFAULT_FEATURE_APPLICATION = "org.eclipse.ui.workbench"; //$NON-NLS-1$
-
- private static final String CFG_VERSION = "version"; //$NON-NLS-1$
- private static final String CFG_TRANSIENT = "transient"; //$NON-NLS-1$
- private static final String VERSION = "2.1"; //$NON-NLS-1$
- private static final String EOF = "eof"; //$NON-NLS-1$
- private static final int CFG_LIST_LENGTH = 10;
-
- private static final int DEFAULT_POLICY_TYPE = ISitePolicy.USER_EXCLUDE;
- private static final String[] DEFAULT_POLICY_LIST = new String[0];
-
-
- protected static final String RECONCILER_APP = "org.eclipse.update.core.reconciler"; //$NON-NLS-1$
-
- private static final char[] HEX = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
- private static URL installURL;
-
- public class SiteEntry implements IPlatformConfiguration.ISiteEntry {
-
- private URL url; // this is the external URL for the site
- private URL resolvedURL; // this is the resolved URL used internally
- private ISitePolicy policy;
- private boolean updateable = true;
- private ArrayList features;
- private ArrayList plugins;
- private PlatformConfiguration parent;
- private long changeStamp;
- private boolean changeStampIsValid = false;
- private long lastFeaturesChangeStamp;
- private long featuresChangeStamp;
- private boolean featuresChangeStampIsValid = false;
- private long lastPluginsChangeStamp;
- private long pluginsChangeStamp;
- private boolean pluginsChangeStampIsValid = false;
- private String linkFileName = null;
-
- private SiteEntry() {
- }
- private SiteEntry(URL url, ISitePolicy policy, PlatformConfiguration parent) {
- if (url == null)
- throw new IllegalArgumentException();
-
- if (policy == null)
- throw new IllegalArgumentException();
-
- if (parent == null)
- throw new IllegalArgumentException();
-
- this.url = url;
- this.policy = policy;
- this.parent = parent;
- this.features = null;
- this.plugins = null;
- this.resolvedURL = this.url;
- if (url.getProtocol().equals(PlatformURLHandler.PROTOCOL)) {
- try {
- resolvedURL = resolvePlatformURL(url); // 19536
- } catch (IOException e) {
- // will use the baseline URL ...
- }
- }
- }
-
- /*
- * @see ISiteEntry#getURL()
- */
- public URL getURL() {
- return url;
- }
-
- /*
- * @see ISiteEntry#getSitePolicy()
- */
- public ISitePolicy getSitePolicy() {
- return policy;
- }
-
- /*
- * @see ISiteEntry#setSitePolicy(ISitePolicy)
- */
- public synchronized void setSitePolicy(ISitePolicy policy) {
- if (policy == null)
- throw new IllegalArgumentException();
- this.policy = policy;
- }
-
- /*
- * @see ISiteEntry#getFeatures()
- */
- public String[] getFeatures() {
- return getDetectedFeatures();
- }
-
- /*
- * @see ISiteEntry#getPlugins()
- */
- public String[] getPlugins() {
-
- ISitePolicy policy = getSitePolicy();
-
- if (policy.getType() == ISitePolicy.USER_INCLUDE)
- return policy.getList();
-
- if (policy.getType() == ISitePolicy.USER_EXCLUDE) {
- ArrayList detectedPlugins = new ArrayList(Arrays.asList(getDetectedPlugins()));
- String[] excludedPlugins = policy.getList();
- for (int i = 0; i < excludedPlugins.length; i++) {
- if (detectedPlugins.contains(excludedPlugins[i]))
- detectedPlugins.remove(excludedPlugins[i]);
- }
- return (String[]) detectedPlugins.toArray(new String[0]);
- }
-
- // bad policy type
- return new String[0];
- }
-
- /*
- * @see ISiteEntry#getChangeStamp()
- */
- public long getChangeStamp() {
- if (!changeStampIsValid)
- computeChangeStamp();
- return changeStamp;
- }
-
- /*
- * @see ISiteEntry#getFeaturesChangeStamp()
- */
- public long getFeaturesChangeStamp() {
- if (!featuresChangeStampIsValid)
- computeFeaturesChangeStamp();
- return featuresChangeStamp;
- }
-
- /*
- * @see ISiteEntry#getPluginsChangeStamp()
- */
- public long getPluginsChangeStamp() {
- if (!pluginsChangeStampIsValid)
- computePluginsChangeStamp();
- return pluginsChangeStamp;
- }
-
- /*
- * @see ISiteEntry#isUpdateable()
- */
- public boolean isUpdateable() {
- return updateable;
- }
-
- /*
- * @see ISiteEntry#isNativelyLinked()
- */
- public boolean isNativelyLinked() {
- return isExternallyLinkedSite();
- }
-
- private String[] detectFeatures() {
-
- // invalidate stamps ... we are doing discovery
- changeStampIsValid = false;
- featuresChangeStampIsValid = false;
- parent.changeStampIsValid = false;
- parent.featuresChangeStampIsValid = false;
-
- features = new ArrayList();
-
- if (!supportsDetection(resolvedURL))
- return new String[0];
-
- // locate feature entries on site
- File siteRoot = new File(resolvedURL.getFile().replace('/', File.separatorChar));
- File root = new File(siteRoot, FEATURES);
-
- String[] list = root.list();
- String path;
- File plugin;
- for (int i = 0; list != null && i < list.length; i++) {
- path = list[i] + File.separator + FEATURE_XML;
- plugin = new File(root, path);
- if (!plugin.exists()) {
- continue;
- }
- features.add(FEATURES + "/" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$
- }
- if (DEBUG) {
- debug(resolvedURL.toString() + " located " + features.size() + " feature(s)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return (String[]) features.toArray(new String[0]);
- }
-
- private String[] detectPlugins() {
-
- // invalidate stamps ... we are doing discovery
- changeStampIsValid = false;
- pluginsChangeStampIsValid = false;
- parent.changeStampIsValid = false;
- parent.pluginsChangeStampIsValid = false;
-
- plugins = new ArrayList();
-
- if (!supportsDetection(resolvedURL))
- return new String[0];
-
- // locate plugin entries on site
- File root = new File(resolvedURL.getFile().replace('/', File.separatorChar) + PLUGINS);
- String[] list = root.list();
- String path;
- File plugin;
- for (int i = 0; list != null && i < list.length; i++) {
- path = list[i] + File.separator + PLUGIN_XML;
- plugin = new File(root, path);
- if (!plugin.exists()) {
- path = list[i] + File.separator + FRAGMENT_XML;
- plugin = new File(root, path);
- if (!plugin.exists())
- continue;
- }
- plugins.add(PLUGINS + "/" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$
- }
- if (DEBUG) {
- debug(resolvedURL.toString() + " located " + plugins.size() + " plugin(s)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return (String[]) plugins.toArray(new String[0]);
- }
-
- private synchronized String[] getDetectedFeatures() {
- if (features == null)
- return detectFeatures();
- return (String[]) features.toArray(new String[0]);
- }
-
- private synchronized String[] getDetectedPlugins() {
- if (plugins == null)
- return detectPlugins();
- return (String[]) plugins.toArray(new String[0]);
- }
-
- private URL getResolvedURL() {
- return resolvedURL;
- }
-
- private void computeChangeStamp() {
- computeFeaturesChangeStamp();
- computePluginsChangeStamp();
- changeStamp = resolvedURL.hashCode() ^ featuresChangeStamp ^ pluginsChangeStamp;
- changeStampIsValid = true;
- }
-
- private synchronized void computeFeaturesChangeStamp() {
- if (featuresChangeStampIsValid)
- return;
-
- long start = 0;
- if (DEBUG)
- start = (new Date()).getTime();
- String[] features = getFeatures();
- featuresChangeStamp = computeStamp(features);
- featuresChangeStampIsValid = true;
- if (DEBUG) {
- long end = (new Date()).getTime();
- debug(resolvedURL.toString() + " feature stamp: " + featuresChangeStamp + ((featuresChangeStamp == lastFeaturesChangeStamp) ? " [no changes]" : " [was " + lastFeaturesChangeStamp + "]") + " in " + (end - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
- }
-
- private synchronized void computePluginsChangeStamp() {
- if (pluginsChangeStampIsValid)
- return;
-
- long start = 0;
- if (DEBUG)
- start = (new Date()).getTime();
- String[] plugins = getPlugins();
- pluginsChangeStamp = computeStamp(plugins);
- pluginsChangeStampIsValid = true;
- if (DEBUG) {
- long end = (new Date()).getTime();
- debug(resolvedURL.toString() + " plugin stamp: " + pluginsChangeStamp + ((pluginsChangeStamp == lastPluginsChangeStamp) ? " [no changes]" : " [was " + lastPluginsChangeStamp + "]") + " in " + (end - start) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
- }
-
- private long computeStamp(String[] targets) {
-
- long result = 0;
- if (!supportsDetection(resolvedURL)) {
- // NOTE: this path should not be executed until we support running
- // from an arbitrary URL (in particular from http server). For
- // now just compute stamp across the list of names. Eventually
- // when general URLs are supported we need to do better (factor
- // in at least the existence of the target). However, given this
- // code executes early on the startup sequence we need to be
- // extremely mindful of performance issues.
- for (int i = 0; i < targets.length; i++)
- result ^= targets[i].hashCode();
- if (DEBUG)
- debug("*WARNING* computing stamp using URL hashcodes only"); //$NON-NLS-1$
- } else {
- // compute stamp across local targets
- String rootPath = resolvedURL.getFile().replace('/', File.separatorChar);
- if (!rootPath.endsWith(File.separator))
- rootPath += File.separator;
- File rootFile = new File(rootPath);
- if (rootFile.exists()) {
- File f = null;
- for (int i = 0; i < targets.length; i++) {
- f = new File(rootFile, targets[i]);
- if (f.exists())
- result ^= f.getAbsolutePath().hashCode() ^ f.lastModified() ^ f.length();
- }
- }
- }
-
- return result;
- }
-
- private boolean isExternallyLinkedSite() {
- return (linkFileName != null && !linkFileName.trim().equals("")); //$NON-NLS-1$
- }
-
- private synchronized void refresh() {
- // reset computed values. Will be updated on next access.
- lastFeaturesChangeStamp = featuresChangeStamp;
- lastPluginsChangeStamp = pluginsChangeStamp;
- changeStampIsValid = false;
- featuresChangeStampIsValid = false;
- pluginsChangeStampIsValid = false;
- features = null;
- plugins = null;
- }
-
- }
-
- public class SitePolicy implements IPlatformConfiguration.ISitePolicy {
-
- private int type;
- private String[] list;
-
- private SitePolicy() {
- }
- private SitePolicy(int type, String[] list) {
- if (type != ISitePolicy.USER_INCLUDE && type != ISitePolicy.USER_EXCLUDE)
- throw new IllegalArgumentException();
- this.type = type;
-
- if (list == null)
- this.list = new String[0];
- else
- this.list = list;
- }
-
- /*
- * @see ISitePolicy#getType()
- */
- public int getType() {
- return type;
- }
-
- /*
- * @see ISitePolicy#getList()
- */
- public String[] getList() {
- return list;
- }
-
- /*
- * @see ISitePolicy#setList(String[])
- */
- public synchronized void setList(String[] list) {
- if (list == null)
- this.list = new String[0];
- else
- this.list = list;
- }
-
- }
-
- public class FeatureEntry implements IPlatformConfiguration.IFeatureEntry {
- private String id;
- private String version;
- private String pluginVersion;
- private String application;
- private URL[] root;
- private boolean primary;
- private String pluginIdentifier;
-
- private FeatureEntry(String id, String version, String pluginIdentifier, String pluginVersion, boolean primary, String application, URL[] root) {
- if (id == null)
- throw new IllegalArgumentException();
- this.id = id;
- this.version = version;
- this.pluginVersion = pluginVersion;
- this.pluginIdentifier = pluginIdentifier;
- this.primary = primary;
- this.application = application;
- this.root = (root == null ? new URL[0] : root);
- }
-
- private FeatureEntry(String id, String version, String pluginVersion, boolean primary, String application, URL[] root) {
- this(id, version, id, pluginVersion, primary, application, root);
- }
-
- /*
- * @see IFeatureEntry#getFeatureIdentifier()
- */
- public String getFeatureIdentifier() {
- return id;
- }
-
- /*
- * @see IFeatureEntry#getFeatureVersion()
- */
- public String getFeatureVersion() {
- return version;
- }
-
- /*
- * @see IFeatureEntry#getFeaturePluginVersion()
- */
- public String getFeaturePluginVersion() {
- return pluginVersion;
- }
-
- /*
- * @see IFeatureEntry#getFeatureApplication()
- */
- public String getFeatureApplication() {
- return application;
- }
-
- /*
- * @see IFeatureEntry#getFeatureRootURLs()
- */
- public URL[] getFeatureRootURLs() {
- return root;
- }
-
- /*
- * @see IFeatureEntry#canBePrimary()
- */
- public boolean canBePrimary() {
- return primary;
- }
- /*
- * @see IFeatureEntry#getFeaturePluginIdentifier()
- */
- public String getFeaturePluginIdentifier() {
- return pluginIdentifier;
- }
-
- }
-
-
- /*
- * Element selector for use with "tiny" parser. Parser callers supply
- * concrete selectors
- */
- public interface Selector {
-
- /*
- * Method is called to pre-select a specific xml type. Pre-selected
- * elements are then fully parsed and result in calls to full
- * select method.
- * @return <code>true</code> is the element should be considered,
- * <code>false</code> otherwise
- */
- public boolean select(String entry);
-
- /*
- * Method is called with a fully parsed element.
- * @return <code>true</code> to select this element and terminate the parse,
- * <code>false</code> otherwise
- */
- public boolean select(String element, HashMap attributes);
- }
-
- /*
- * "Tiny" xml parser. Performs a rudimentary parse of a well-formed xml file.
- * Is specifically geared to parsing plugin.xml files of "bootstrap" plug-ins
- * during the platform startup sequence before full xml plugin is available.
- */
- public static class Parser {
-
- private ArrayList elements = new ArrayList();
-
- /*
- * Construct parser for the specified file
- */
- public Parser(File file) {
- try {
- load(new FileInputStream(file));
- } catch (Exception e) {
- // continue ... actual parsing will report errors
- }
- }
-
- /*
- * Construct parser for the specified URL
- */
- public Parser(URL url) {
- try {
- load(url.openStream());
- } catch (Exception e) {
- // continue ... actual parsing will report errors
- }
- }
-
- /*
- * Return selected elements as an (attribute-name, attribute-value) map.
- * The name of the selected element is returned as the value of entry with
- * name "<element>".
- * @return attribute map for selected element, or <code>null</code>
- */
- public HashMap getElement(Selector selector) {
- if (selector == null)
- return null;
-
- String element;
- for (int i = 0; i < elements.size(); i++) {
- // make pre-parse selector call
- element = (String) elements.get(i);
- if (selector.select(element)) {
- // parse selected entry
- HashMap attributes = new HashMap();
- String elementName;
- int j;
- // parse out element name
- for (j = 0; j < element.length(); j++) {
- if (Character.isWhitespace(element.charAt(j)))
- break;
- }
- if (j >= element.length()) {
- elementName = element;
- } else {
- elementName = element.substring(0, j);
- element = element.substring(j);
- // parse out attributes
- StringTokenizer t = new StringTokenizer(element, "=\""); //$NON-NLS-1$
- boolean isKey = true;
- String key = ""; //$NON-NLS-1$
- while (t.hasMoreTokens()) {
- String token = t.nextToken().trim();
- if (!token.equals("")) { //$NON-NLS-1$
- // collect (key, value) pairs
- if (isKey) {
- key = token;
- isKey = false;
- } else {
- attributes.put(key, token);
- isKey = true;
- }
- }
- }
- }
- // make post-parse selector call
- if (selector.select(elementName, attributes)) {
- attributes.put("<element>", elementName); //$NON-NLS-1$
- return attributes;
- }
- }
- }
- return null;
- }
-
- private void load(InputStream is) {
- if (is == null)
- return;
-
- // read file
- StringBuffer xml = new StringBuffer(4096);
- char[] iobuf = new char[4096];
- InputStreamReader r = null;
- try {
- r = new InputStreamReader(is);
- int len = r.read(iobuf, 0, iobuf.length);
- while (len != -1) {
- xml.append(iobuf, 0, len);
- len = r.read(iobuf, 0, iobuf.length);
- }
- } catch (Exception e) {
- return;
- } finally {
- if (r != null)
- try {
- r.close();
- } catch (IOException e) {
- // ignore
- }
- }
-
- // parse out element tokens
- String xmlString = xml.toString();
- StringTokenizer t = new StringTokenizer(xmlString, "<>"); //$NON-NLS-1$
- while (t.hasMoreTokens()) {
- String token = t.nextToken().trim();
- if (!token.equals("")) //$NON-NLS-1$
- elements.add(token);
- }
- }
- }
-
- public static class BootDescriptor {
- private String id;
- private String version;
- private String[] libs;
- private URL dir;
-
- public BootDescriptor(String id, String version, String[] libs, URL dir) {
- this.id = id;
- this.version = version;
- this.libs = libs;
- this.dir = dir;
- }
-
- public String getId() {
- return id;
- }
-
- public String getVersion() {
- return version;
- }
-
- public String[] getLibraries() {
- return libs;
- }
-
- public URL getPluginDirectoryURL() {
- return dir;
- }
- }
-
-
- PlatformConfiguration(URL url) throws IOException {
- this.sites = new HashMap();
- this.externalLinkSites = new HashMap();
- this.cfgdFeatures = new HashMap();
- this.bootPlugins = new HashMap();
- initialize(url);
- }
-
- /*
- * @see IPlatformConfiguration#createSiteEntry(URL, ISitePolicy)
- */
- public ISiteEntry createSiteEntry(URL url, ISitePolicy policy) {
- return new PlatformConfiguration.SiteEntry(url, policy, this);
- }
-
- /*
- * @see IPlatformConfiguration#createSitePolicy(int, String[])
- */
- public ISitePolicy createSitePolicy(int type, String[] list) {
- return new PlatformConfiguration.SitePolicy(type, list);
- }
-
- /*
- * @see IPlatformConfiguration#createFeatureEntry(String, String, String, boolean, String, URL)
- */
- public IFeatureEntry createFeatureEntry(String id, String version, String pluginVersion, boolean primary, String application, URL[] root) {
- return new PlatformConfiguration.FeatureEntry(id, version, pluginVersion, primary, application, root);
- }
-
- /*
- * @see IPlatformConfiguration#createFeatureEntry(String, String, String,
- * String, boolean, String, URL)
- */
- public IFeatureEntry createFeatureEntry(String id, String version, String pluginIdentifier, String pluginVersion, boolean primary, String application, URL[] root) {
- return new PlatformConfiguration.FeatureEntry(id, version, pluginIdentifier, pluginVersion, primary, application, root);
- }
-
- /*
- * @see IPlatformConfiguration#configureSite(ISiteEntry)
- */
- public void configureSite(ISiteEntry entry) {
- configureSite(entry, false);
- }
-
- /*
- * @see IPlatformConfiguration#configureSite(ISiteEntry, boolean)
- */
- public synchronized void configureSite(ISiteEntry entry, boolean replace) {
-
- if (entry == null)
- return;
-
- URL url = entry.getURL();
- if (url == null)
- return;
- String key = url.toExternalForm();
-
- if (sites.containsKey(key) && !replace)
- return;
-
- sites.put(key, entry);
- }
-
- /*
- * @see IPlatformConfiguration#unconfigureSite(ISiteEntry)
- */
- public synchronized void unconfigureSite(ISiteEntry entry) {
- if (entry == null)
- return;
-
- URL url = entry.getURL();
- if (url == null)
- return;
- String key = url.toExternalForm();
-
- sites.remove(key);
- }
-
- /*
- * @see IPlatformConfiguration#getConfiguredSites()
- */
- public ISiteEntry[] getConfiguredSites() {
- if (sites.size() == 0)
- return new ISiteEntry[0];
-
- return (ISiteEntry[]) sites.values().toArray(new ISiteEntry[0]);
- }
-
- /*
- * @see IPlatformConfiguration#findConfiguredSite(URL)
- */
- public ISiteEntry findConfiguredSite(URL url) {
- if (url == null)
- return null;
- String key = url.toExternalForm();
-
- ISiteEntry result = (ISiteEntry) sites.get(key);
- try {
- if (result == null) // retry with decoded URL string
- result = (ISiteEntry) sites.get(URLDecoder.decode(key, null));
- } catch (UnsupportedEncodingException e) {
- }
- return result;
- }
-
- /*
- * @see IPlatformConfiguration#configureFeatureEntry(IFeatureEntry)
- */
- public synchronized void configureFeatureEntry(IFeatureEntry entry) {
- if (entry == null)
- return;
-
- String key = entry.getFeatureIdentifier();
- if (key == null)
- return;
-
- cfgdFeatures.put(key, entry);
- }
-
- /*
- * @see IPlatformConfiguration#unconfigureFeatureEntry(IFeatureEntry)
- */
- public synchronized void unconfigureFeatureEntry(IFeatureEntry entry) {
- if (entry == null)
- return;
-
- String key = entry.getFeatureIdentifier();
- if (key == null)
- return;
-
- cfgdFeatures.remove(key);
- }
-
- /*
- * @see IPlatformConfiguration#getConfiguredFeatureEntries()
- */
- public IFeatureEntry[] getConfiguredFeatureEntries() {
- if (cfgdFeatures.size() == 0)
- return new IFeatureEntry[0];
-
- return (IFeatureEntry[]) cfgdFeatures.values().toArray(new IFeatureEntry[0]);
- }
-
- /*
- * @see IPlatformConfiguration#findConfiguredFeatureEntry(String)
- */
- public IFeatureEntry findConfiguredFeatureEntry(String id) {
- if (id == null)
- return null;
-
- return (IFeatureEntry) cfgdFeatures.get(id);
- }
-
- /*
- * @see IPlatformConfiguration#getConfigurationLocation()
- */
- public URL getConfigurationLocation() {
- return configLocation;
- }
-
- /*
- * @see IPlatformConfiguration#getChangeStamp()
- */
- public long getChangeStamp() {
- if (!changeStampIsValid)
- computeChangeStamp();
- return changeStamp;
- }
-
- /*
- * @see IPlatformConfiguration#getFeaturesChangeStamp()
- */
- public long getFeaturesChangeStamp() {
- if (!featuresChangeStampIsValid)
- computeFeaturesChangeStamp();
- return featuresChangeStamp;
- }
-
- /*
- * @see IPlatformConfiguration#getPluginsChangeStamp()
- */
- public long getPluginsChangeStamp() {
- if (!pluginsChangeStampIsValid)
- computePluginsChangeStamp();
- return pluginsChangeStamp;
- }
-
- /*
- * @see IPlatformConfiguration#getApplicationIdentifier()
- */
- public String getApplicationIdentifier() {
-
- if (cmdInitialize) {
- // we are running post-install initialization. Force
- // running of the reconciler
- return RECONCILER_APP;
- }
-
- if (featuresChangeStamp != lastFeaturesChangeStamp) {
- // we have detected feature changes ... see if we need to reconcile
- boolean update = !cmdNoUpdate || cmdUpdate;
- if (update)
- return RECONCILER_APP;
- }
-
- // "normal" startup ... run specified application
- return getApplicationIdentifierInternal();
- }
-
- private String getApplicationIdentifierInternal() {
-
- if (cmdApplication != null) // application was specified
- return cmdApplication;
- // if -feature was not specified use the default feature
- String feature = cmdFeature;
- if (feature == null)
- feature = defaultFeature;
-
- // lookup application for feature (specified or defaulted)
- if (feature != null) {
- IFeatureEntry fe = findConfiguredFeatureEntry(feature);
- if (fe != null) {
- if (fe.getFeatureApplication() != null)
- return fe.getFeatureApplication();
- }
- }
-
- // return hardcoded default if we failed
- return DEFAULT_FEATURE_APPLICATION;
- }
-
- /*
- * @see IPlatformConfiguration#getPrimaryFeatureIdentifier()
- */
- public String getPrimaryFeatureIdentifier() {
-
- if (cmdFeature != null) // -feature was specified on command line
- return cmdFeature;
-
- // feature was not specified on command line
- if (defaultFeature != null)
- return defaultFeature; // return customized default if set
- return DEFAULT_FEATURE_ID; // return hardcoded default
- }
-
- /*
- * @see IPlatformConfiguration#getPluginPath()
- */
- public URL[] getPluginPath() {
- ArrayList path = new ArrayList();
- if (DEBUG)
- debug("computed plug-in path:"); //$NON-NLS-1$
-
- ISiteEntry[] sites = getConfiguredSites();
- URL pathURL;
- for (int i = 0; i < sites.length; i++) {
- String[] plugins = sites[i].getPlugins();
- for (int j = 0; j < plugins.length; j++) {
- try {
- pathURL = new URL(((SiteEntry) sites[i]).getResolvedURL(), plugins[j]);
- path.add(pathURL);
- if (DEBUG)
- debug(" " + pathURL.toString()); //$NON-NLS-1$
- } catch (MalformedURLException e) {
- // skip entry ...
- if (DEBUG)
- debug(" bad URL: " + e); //$NON-NLS-1$
- }
- }
- }
- return (URL[]) path.toArray(new URL[0]);
- }
-
- /*
- * @see IPlatformConfiguration#getBootstrapPluginIdentifiers()
- */
- public String[] getBootstrapPluginIdentifiers() {
- return BOOTSTRAP_PLUGINS;
- }
-
- /*
- * @see IPlatformConfiguration#setBootstrapPluginLocation(String, URL)
- */
- public void setBootstrapPluginLocation(String id, URL location) {
- String[] ids = getBootstrapPluginIdentifiers();
- for (int i = 0; i < ids.length; i++) {
- if (ids[i].equals(id)) {
- bootPlugins.put(id, location.toExternalForm());
- break;
- }
- }
- }
-
- /*
- * @see IPlatformConfiguration#isUpdateable()
- */
- public boolean isUpdateable() {
- return true;
- }
-
- /*
- * @see IPlatformConfiguration#isTransient()
- */
- public boolean isTransient() {
- return transientConfig;
- }
-
- /*
- * @see IPlatformConfiguration#isTransient(boolean)
- */
- public void isTransient(boolean value) {
- // if (this != BootLoader.getCurrentPlatformConfiguration())
- // transientConfig = value;
- }
-
- /*
- * @see IPlatformConfiguration#refresh()
- */
- public synchronized void refresh() {
- // Reset computed values. Will be lazily refreshed
- // on next access
- ISiteEntry[] sites = getConfiguredSites();
- for (int i = 0; i < sites.length; i++) {
- // reset site entry
- ((SiteEntry) sites[i]).refresh();
- }
- // reset configuration entry.
- lastFeaturesChangeStamp = featuresChangeStamp;
- changeStampIsValid = false;
- featuresChangeStampIsValid = false;
- pluginsChangeStampIsValid = false;
- }
-
- /*
- * @see IPlatformConfiguration#save()
- */
- public void save() throws IOException {
- if (isUpdateable())
- save(configLocation);
- }
-
- /*
- * @see IPlatformConfiguration#save(URL)
- */
- public synchronized void save(URL url) throws IOException {
- if (url == null)
- throw new IOException("Unable to save. No URL is specified"); //$NON-NLS-1$
-
- PrintWriter w = null;
- OutputStream os = null;
- if (!url.getProtocol().equals("file")) { //$NON-NLS-1$
- // not a file protocol - attempt to save to the URL
- URLConnection uc = url.openConnection();
- uc.setDoOutput(true);
- os = uc.getOutputStream();
- w = new PrintWriter(os);
- try {
- write(w);
- } finally {
- w.close();
- }
- } else {
- // file protocol - do safe i/o
- File cfigFile = new File(url.getFile().replace('/', File.separatorChar));
- File cfigDir = cfigFile.getParentFile();
- if (cfigDir != null)
- cfigDir.mkdirs();
-
- // first save the file as temp
- File cfigTmp = new File(cfigFile.getAbsolutePath() + CONFIG_FILE_TEMP_SUFFIX);
- os = new FileOutputStream(cfigTmp);
- w = new PrintWriter(os);
- try {
- write(w);
- } finally {
- w.close();
- }
-
- // make sure we actually succeeded saving the whole configuration.
- InputStream is = new FileInputStream(cfigTmp);
- Properties tmpProps = new Properties();
- try {
- tmpProps.load(is);
- if (!EOF.equals(tmpProps.getProperty(EOF))) {
- throw new IOException("Unable to save " + cfigTmp.getAbsolutePath()); //$NON-NLS-1$
- }
- } finally {
- is.close();
- }
-
- // make the saved config the "active" one
- File cfigBak = new File(cfigFile.getAbsolutePath() + CONFIG_FILE_BAK_SUFFIX);
- cfigBak.delete(); // may have old .bak due to prior failure
-
- if (cfigFile.exists())
- cfigFile.renameTo(cfigBak);
-
- // at this point we have old config (if existed) as "bak" and the
- // new config as "tmp".
- boolean ok = cfigTmp.renameTo(cfigFile);
- if (ok) {
- // at this point we have the new config "activated", and the old
- // config (if it existed) as "bak"
- cfigBak.delete(); // clean up
- } else {
- // this codepath represents a tiny failure window. The load processing
- // on startup will detect missing config and will attempt to start
- // with "tmp" (latest), then "bak" (the previous). We can also end up
- // here if we failed to rename the current config to "bak". In that
- // case we will restart with the previous state.
- throw new IOException("Unable to save " + cfigTmp.getAbsolutePath()); //$NON-NLS-1$
- }
- }
- }
-
- public BootDescriptor getPluginBootDescriptor(String id) {
- // return the plugin descriptor for the specified plugin. This method
- // is used during boot processing to obtain information about "kernel" plugins
- // whose class loaders must be created prior to the plugin registry being
- // available (ie. loaders needed to create the plugin registry).
-
- if (RUNTIME_PLUGIN_ID.equals(id))
- return runtimeDescriptor;
- return null;
- }
-
- static PlatformConfiguration getCurrent() {
- return currentPlatformConfiguration;
- }
-
- static synchronized void shutdown() throws IOException {
-
- // save platform configuration
- PlatformConfiguration config = getCurrent();
- if (config != null) {
- try {
- config.save();
- } catch (IOException e) {
- if (DEBUG)
- debug("Unable to save configuration " + e.toString()); //$NON-NLS-1$
- // will recover on next startup
- }
- config.clearConfigurationLock();
- }
- }
-
- private synchronized void initialize(URL url) throws IOException {
- if (url == null) {
- if (DEBUG)
- debug("Creating empty configuration object"); //$NON-NLS-1$
- return;
- }
-
- load(url);
- configLocation = url;
- if (DEBUG)
- debug("Using configuration " + configLocation.toString()); //$NON-NLS-1$
- }
-
- private ISiteEntry getRootSite() {
- // create default site entry for the root
- ISitePolicy defaultPolicy = createSitePolicy(DEFAULT_POLICY_TYPE, DEFAULT_POLICY_LIST);
- URL siteURL = null;
- try {
- siteURL = new URL(PlatformURLHandler.PROTOCOL + PlatformURLHandler.PROTOCOL_SEPARATOR + "/" + "base" + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ // try using platform-relative URL
- } catch (MalformedURLException e) {
- siteURL = getInstallURL(); // ensure we come up ... use absolute file URL
- }
- ISiteEntry defaultSite = createSiteEntry(siteURL, defaultPolicy);
- return defaultSite;
- }
-
-
- private void resetInitializationLocation(File dir) {
- // [20111]
- if (dir == null || !dir.exists() || !dir.isDirectory())
- return;
- File[] list = dir.listFiles();
- for (int i = 0; i < list.length; i++) {
- if (list[i].isDirectory())
- resetInitializationLocation(list[i]);
- list[i].delete();
- }
- }
-
-
- private void clearConfigurationLock() {
- try {
- if (cfgLockFileRAF != null) {
- cfgLockFileRAF.close();
- cfgLockFileRAF = null;
- }
- } catch (IOException e) {
- // ignore ...
- }
- if (cfgLockFile != null) {
- cfgLockFile.delete();
- cfgLockFile = null;
- }
- }
-
- private void computeChangeStamp() {
- computeFeaturesChangeStamp();
- computePluginsChangeStamp();
- changeStamp = featuresChangeStamp ^ pluginsChangeStamp;
- changeStampIsValid = true;
- }
-
- private void computeFeaturesChangeStamp() {
- /*if (featuresChangeStampIsValid)
- return;
-
- long result = 0;
- ISiteEntry[] sites = getConfiguredSites();
- for (int i = 0; i < sites.length; i++) {
- result ^= sites[i].getFeaturesChangeStamp();
- }
- featuresChangeStamp = result;
- featuresChangeStampIsValid = true;*/
- }
-
- private void computePluginsChangeStamp() {
- /*if (pluginsChangeStampIsValid)
- return;
-
- long result = 0;
- ISiteEntry[] sites = getConfiguredSites();
- for (int i = 0; i < sites.length; i++) {
- result ^= sites[i].getPluginsChangeStamp();
- }
- pluginsChangeStamp = result;
- pluginsChangeStampIsValid = true;*/
- }
-
- private void load(URL url) throws IOException {
-
- if (url == null)
- throw new IOException("Unable to load URL"); //$NON-NLS-1$
-
- // try to load saved configuration file (watch for failed prior save())
- Properties props = null;
- IOException originalException = null;
- try {
- props = loadProperties(url, null); // try to load config file
- } catch (IOException e1) {
- originalException = e1;
- try {
- props = loadProperties(url, CONFIG_FILE_TEMP_SUFFIX); // check for failures on save
- } catch (IOException e2) {
- try {
- props = loadProperties(url, CONFIG_FILE_BAK_SUFFIX); // check for failures on save
- } catch (IOException e3) {
- throw originalException; // we tried, but no config here ...
- }
- }
- }
-
- // check version
- String v = props.getProperty(CFG_VERSION);
- if (!VERSION.equals(v)) {
- // the state is invalid, delete any files under the directory
- // bug 33493
- resetUpdateManagerState(url);
- throw new IOException("Bad version:" + v); //$NON-NLS-1$
- }
-
- // load simple properties
- defaultFeature = loadAttribute(props, CFG_FEATURE_ENTRY_DEFAULT, null);
-
- String flag = loadAttribute(props, CFG_TRANSIENT, null);
- if (flag != null) {
- if (flag.equals("true")) //$NON-NLS-1$
- transientConfig = true;
- else
- transientConfig = false;
- }
-
- String stamp = loadAttribute(props, CFG_FEATURE_STAMP, null);
- if (stamp != null) {
- try {
- lastFeaturesChangeStamp = Long.parseLong(stamp);
- } catch (NumberFormatException e) {
- // ignore bad attribute ...
- }
- }
-
- // load bootstrap entries
- String[] ids = getBootstrapPluginIdentifiers();
- for (int i = 0; i < ids.length; i++) {
- bootPlugins.put(ids[i], loadAttribute(props, CFG_BOOT_PLUGIN + "." + ids[i], null)); //$NON-NLS-1$
- }
-
- // load feature entries
- IFeatureEntry fe = loadFeatureEntry(props, CFG_FEATURE_ENTRY + ".0", null); //$NON-NLS-1$
- for (int i = 1; fe != null; i++) {
- configureFeatureEntry(fe);
- fe = loadFeatureEntry(props, CFG_FEATURE_ENTRY + "." + i, null); //$NON-NLS-1$
- }
-
- // load site properties
- SiteEntry root = (SiteEntry) getRootSite();
- String rootUrlString = root.getURL().toExternalForm();
- SiteEntry se = (SiteEntry) loadSite(props, CFG_SITE + ".0", null); //$NON-NLS-1$
- for (int i = 1; se != null; i++) {
-
- // check if we are forcing "first use" processing with an existing
- // platform.cfg. In this case ignore site entry that represents
- // the platform install, and use a root site entry in its place.
- // This ensures we do not get messed up by an exclusion list that
- // is read from the prior state.
- if (cmdFirstUse && rootUrlString.equals(se.getURL().toExternalForm()))
- se = root;
-
- if (!se.isExternallyLinkedSite())
- configureSite(se);
- else
- // remember external link site state, but do not configure at this point
- externalLinkSites.put(se.getURL(), se);
- se = (SiteEntry) loadSite(props, CFG_SITE + "." + i, null); //$NON-NLS-1$
- }
- }
-
- private Properties loadProperties(URL url, String suffix) throws IOException {
-
- // figure out what we will be loading
- if (suffix != null && !suffix.equals("")) //$NON-NLS-1$
- url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile() + suffix);
-
- // try to load saved configuration file
- Properties props = new Properties();
- InputStream is = null;
- try {
- is = url.openStream();
- props.load(is);
- // check to see if we have complete config file
- if (!EOF.equals(props.getProperty(EOF))) {
- throw new IOException("Unable to load"); //$NON-NLS-1$
- }
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- // ignore ...
- }
- }
- }
- return props;
- }
-
- private ISiteEntry loadSite(Properties props, String name, ISiteEntry dflt) {
-
- String urlString = loadAttribute(props, name + "." + CFG_URL, null); //$NON-NLS-1$
- if (urlString == null)
- return dflt;
-
- URL url = null;
- try {
- url = new URL(urlString);
- } catch (MalformedURLException e) {
- return dflt;
- }
-
- int policyType;
- String[] policyList;
- String typeString = loadAttribute(props, name + "." + CFG_POLICY, null); //$NON-NLS-1$
- if (typeString == null) {
- policyType = DEFAULT_POLICY_TYPE;
- policyList = DEFAULT_POLICY_LIST;
- } else {
- int i;
- for (i = 0; i < CFG_POLICY_TYPE.length; i++) {
- if (typeString.equals(CFG_POLICY_TYPE[i])) {
- break;
- }
- }
- if (i >= CFG_POLICY_TYPE.length) {
- policyType = DEFAULT_POLICY_TYPE;
- policyList = DEFAULT_POLICY_LIST;
- } else {
- policyType = i;
- policyList = loadListAttribute(props, name + "." + CFG_LIST, new String[0]); //$NON-NLS-1$
- }
- }
-
- ISitePolicy sp = createSitePolicy(policyType, policyList);
- SiteEntry site = (SiteEntry) createSiteEntry(url, sp);
-
- String stamp = loadAttribute(props, name + "." + CFG_FEATURE_STAMP, null); //$NON-NLS-1$
- if (stamp != null) {
- try {
- site.lastFeaturesChangeStamp = Long.parseLong(stamp);
- } catch (NumberFormatException e) {
- // ignore bad attribute ...
- }
- }
-
- stamp = loadAttribute(props, name + "." + CFG_PLUGIN_STAMP, null); //$NON-NLS-1$
- if (stamp != null) {
- try {
- site.lastPluginsChangeStamp = Long.parseLong(stamp);
- } catch (NumberFormatException e) {
- // ignore bad attribute ...
- }
- }
-
- String flag = loadAttribute(props, name + "." + CFG_UPDATEABLE, null); //$NON-NLS-1$
- if (flag != null) {
- if (flag.equals("true")) //$NON-NLS-1$
- site.updateable = true;
- else
- site.updateable = false;
- }
-
- String linkname = loadAttribute(props, name + "." + CFG_LINK_FILE, null); //$NON-NLS-1$
- if (linkname != null && !linkname.equals("")) { //$NON-NLS-1$
- site.linkFileName = linkname.replace('/', File.separatorChar);
- }
-
- return site;
- }
-
- private IFeatureEntry loadFeatureEntry(Properties props, String name, IFeatureEntry dflt) {
- String id = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_ID, null); //$NON-NLS-1$
- if (id == null)
- return dflt;
- String version = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_VERSION, null); //$NON-NLS-1$
- String pluginVersion = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_PLUGIN_VERSION, null); //$NON-NLS-1$
- if (pluginVersion == null)
- pluginVersion = version;
- String pluginIdentifier = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_PLUGIN_IDENTIFIER, null); //$NON-NLS-1$
- if (pluginIdentifier == null)
- pluginIdentifier = id;
- String application = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_APPLICATION, null); //$NON-NLS-1$
- ArrayList rootList = new ArrayList();
-
- // get install locations
- String rootString = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_ROOT + ".0", null); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 1; rootString != null; i++) {
- try {
- URL rootEntry = new URL(rootString);
- rootList.add(rootEntry);
- } catch (MalformedURLException e) {
- // skip bad entries ...
- }
- rootString = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_ROOT + "." + i, null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- URL[] roots = (URL[]) rootList.toArray(new URL[0]);
-
- // get primary flag
- boolean primary = false;
- String flag = loadAttribute(props, name + "." + CFG_FEATURE_ENTRY_PRIMARY, null); //$NON-NLS-1$
- if (flag != null) {
- if (flag.equals("true")) //$NON-NLS-1$
- primary = true;
- }
- return createFeatureEntry(id, version, pluginIdentifier, pluginVersion, primary, application, roots);
- }
-
- private String[] loadListAttribute(Properties props, String name, String[] dflt) {
- ArrayList list = new ArrayList();
- String value = loadAttribute(props, name + ".0", null); //$NON-NLS-1$
- if (value == null)
- return dflt;
-
- for (int i = 1; value != null; i++) {
- loadListAttributeSegment(list, value);
- value = loadAttribute(props, name + "." + i, null); //$NON-NLS-1$
- }
- return (String[]) list.toArray(new String[0]);
- }
-
- private void loadListAttributeSegment(ArrayList list, String value) {
-
- if (value == null)
- return;
-
- StringTokenizer tokens = new StringTokenizer(value, ","); //$NON-NLS-1$
- String token;
- while (tokens.hasMoreTokens()) {
- token = tokens.nextToken().trim();
- if (!token.equals("")) //$NON-NLS-1$
- list.add(token);
- }
- return;
- }
-
- private String loadAttribute(Properties props, String name, String dflt) {
- String prop = props.getProperty(name);
- if (prop == null)
- return dflt;
- return prop.trim();
- }
-
-
- private void write(PrintWriter w) {
- // write header
- w.println("# " + (new Date()).toString()); //$NON-NLS-1$
- writeAttribute(w, CFG_VERSION, VERSION);
- if (transientConfig)
- writeAttribute(w, CFG_TRANSIENT, "true"); //$NON-NLS-1$
- w.println(""); //$NON-NLS-1$
-
- // write global attributes
- writeAttribute(w, CFG_STAMP, Long.toString(getChangeStamp()));
- writeAttribute(w, CFG_FEATURE_STAMP, Long.toString(getFeaturesChangeStamp()));
- writeAttribute(w, CFG_PLUGIN_STAMP, Long.toString(getPluginsChangeStamp()));
-
- // write out bootstrap entries
- String[] ids = getBootstrapPluginIdentifiers();
- for (int i = 0; i < ids.length; i++) {
- String location = (String) bootPlugins.get(ids[i]);
- if (location != null)
- writeAttribute(w, CFG_BOOT_PLUGIN + "." + ids[i], location); //$NON-NLS-1$
- }
-
- // write out feature entries
- w.println(""); //$NON-NLS-1$
- writeAttribute(w, CFG_FEATURE_ENTRY_DEFAULT, defaultFeature);
- IFeatureEntry[] feats = getConfiguredFeatureEntries();
- for (int i = 0; i < feats.length; i++) {
- writeFeatureEntry(w, CFG_FEATURE_ENTRY + "." + Integer.toString(i), feats[i]); //$NON-NLS-1$
- }
-
- // write out site entries
- SiteEntry[] list = (SiteEntry[]) sites.values().toArray(new SiteEntry[0]);
- for (int i = 0; i < list.length; i++) {
- writeSite(w, CFG_SITE + "." + Integer.toString(i), list[i]); //$NON-NLS-1$
- }
-
- // write end-of-file marker
- writeAttribute(w, EOF, EOF);
- }
-
- private void writeSite(PrintWriter w, String id, SiteEntry entry) {
-
- // write site separator
- w.println(""); //$NON-NLS-1$
-
- // write out site settings
- writeAttribute(w, id + "." + CFG_URL, entry.getURL().toString()); //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_STAMP, Long.toString(entry.getChangeStamp())); //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_FEATURE_STAMP, Long.toString(entry.getFeaturesChangeStamp())); //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_PLUGIN_STAMP, Long.toString(entry.getPluginsChangeStamp())); //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_UPDATEABLE, entry.updateable ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (entry.linkFileName != null && !entry.linkFileName.trim().equals("")) //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_LINK_FILE, entry.linkFileName.trim().replace(File.separatorChar, '/')); //$NON-NLS-1$
-
- // write out site policy
- int type = entry.getSitePolicy().getType();
- String typeString = CFG_POLICY_TYPE_UNKNOWN;
- try {
- typeString = CFG_POLICY_TYPE[type];
- } catch (IndexOutOfBoundsException e) {
- // ignore bad attribute ...
- }
- writeAttribute(w, id + "." + CFG_POLICY, typeString); //$NON-NLS-1$
- writeListAttribute(w, id + "." + CFG_LIST, entry.getSitePolicy().getList()); //$NON-NLS-1$
- }
-
- private void writeFeatureEntry(PrintWriter w, String id, IFeatureEntry entry) {
-
- // write feature entry separator
- w.println(""); //$NON-NLS-1$
-
- // write out feature entry settings
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_ID, entry.getFeatureIdentifier()); //$NON-NLS-1$
- if (entry.canBePrimary())
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_PRIMARY, "true"); //$NON-NLS-1$ //$NON-NLS-2$
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_VERSION, entry.getFeatureVersion()); //$NON-NLS-1$
- if (entry.getFeatureVersion() != null && !entry.getFeatureVersion().equals(entry.getFeaturePluginVersion()))
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_PLUGIN_VERSION, entry.getFeaturePluginVersion()); //$NON-NLS-1$
- if (entry.getFeatureIdentifier() != null && !entry.getFeatureIdentifier().equals(entry.getFeaturePluginIdentifier()))
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_PLUGIN_IDENTIFIER, entry.getFeaturePluginIdentifier()); //$NON-NLS-1$
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_APPLICATION, entry.getFeatureApplication()); //$NON-NLS-1$
- URL[] roots = entry.getFeatureRootURLs();
- for (int i = 0; i < roots.length; i++) {
- // write our as individual attributes (is easier for Main.java to read)
- writeAttribute(w, id + "." + CFG_FEATURE_ENTRY_ROOT + "." + i, roots[i].toExternalForm()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private void writeListAttribute(PrintWriter w, String id, String[] list) {
- if (list == null || list.length == 0)
- return;
-
- String value = ""; //$NON-NLS-1$
- int listLen = 0;
- int listIndex = 0;
- for (int i = 0; i < list.length; i++) {
- if (listLen != 0)
- value += ","; //$NON-NLS-1$
- else
- value = ""; //$NON-NLS-1$
- value += list[i];
-
- if (++listLen >= CFG_LIST_LENGTH) {
- writeAttribute(w, id + "." + Integer.toString(listIndex++), value); //$NON-NLS-1$
- listLen = 0;
- }
- }
- if (listLen != 0)
- writeAttribute(w, id + "." + Integer.toString(listIndex), value); //$NON-NLS-1$
- }
-
- private void writeAttribute(PrintWriter w, String id, String value) {
- if (value == null || value.trim().equals("")) //$NON-NLS-1$
- return;
- w.println(id + "=" + escapedValue(value)); //$NON-NLS-1$
- }
-
- private String escapedValue(String value) {
- // if required, escape property values as \\uXXXX
- StringBuffer buf = new StringBuffer(value.length() * 2); // assume expansion by less than factor of 2
- for (int i = 0; i < value.length(); i++) {
- char character = value.charAt(i);
- if (character == '\\' || character == '\t' || character == '\r' || character == '\n' || character == '\f') {
- // handle characters requiring leading \
- buf.append('\\');
- buf.append(character);
- } else if ((character < 0x0020) || (character > 0x007e)) {
- // handle characters outside base range (encoded)
- buf.append('\\');
- buf.append('u');
- buf.append(HEX[(character >> 12) & 0xF]); // first nibble
- buf.append(HEX[(character >> 8) & 0xF]); // second nibble
- buf.append(HEX[(character >> 4) & 0xF]); // third nibble
- buf.append(HEX[character & 0xF]); // fourth nibble
- } else {
- // handle base characters
- buf.append(character);
- }
- }
- return buf.toString();
- }
-
-
-
-
- private static boolean supportsDetection(URL url) {
- String protocol = url.getProtocol();
- if (protocol.equals("file")) //$NON-NLS-1$
- return true;
- else if (protocol.equals(PlatformURLHandler.PROTOCOL)) {
- URL resolved = null;
- try {
- resolved = resolvePlatformURL(url); // 19536
- } catch (IOException e) {
- return false; // we tried but failed to resolve the platform URL
- }
- return resolved.getProtocol().equals("file"); //$NON-NLS-1$
- } else
- return false;
- }
-
- private static URL resolvePlatformURL(URL url) throws IOException {
- // 19536
- if (url.getProtocol().equals(PlatformURLHandler.PROTOCOL)) {
- URLConnection connection = url.openConnection();
- if (connection instanceof PlatformURLConnection) {
- url = ((PlatformURLConnection) connection).getResolvedURL();
- } else {
- // connection = new PlatformURLBaseConnection(url);
- // url = ((PlatformURLConnection)connection).getResolvedURL();
- url = getInstallURL();
- }
- }
- return url;
- }
-
- private static void debug(String s) {
- System.out.println("PlatformConfig: " + s); //$NON-NLS-1$
- }
-
- private void resetUpdateManagerState(URL url) throws IOException {
- // [20111]
- if (!supportsDetection(url))
- return; // can't do ...
-
- // find directory where the platform configuration file is
- URL resolved = resolvePlatformURL(url);
- File initCfg = new File(resolved.getFile().replace('/', File.separatorChar));
- File initDir = initCfg.getParentFile();
-
- // Find the Update Manager State directory
- if (initDir == null || !initDir.exists() || !initDir.isDirectory())
- return;
- String temp = initCfg.getName() + ".metadata"; //$NON-NLS-1$
- File UMDir = new File(initDir, temp + '/');
-
- // Attempt to rename it
- if (UMDir == null || !UMDir.exists() || !UMDir.isDirectory())
- return;
- Date now = new Date();
- boolean renamed = UMDir.renameTo(new File(initDir, temp + now.getTime() + '/'));
-
- if (!renamed)
- resetInitializationLocation(UMDir);
- }
-
- private static URL getInstallURL() {
- return installURL;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelDelta.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelDelta.java
deleted file mode 100644
index 0758fd3..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelDelta.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-
-public class PluginModelDelta {
- public static final int ADDED = 1;
- public static final int REMOVED = 2;
- public static final int CHANGED = 4;
-
- private ArrayList added;
- private ArrayList removed;
- private ArrayList changed;
-
- private int kind = 0;
-
- public PluginModelDelta() {
- }
-
- public int getKind() {
- return kind;
- }
- public ModelEntry[] getAddedEntries() {
- return getEntries(added);
- }
- public ModelEntry[] getRemovedEntries() {
- return getEntries(removed);
- }
- public ModelEntry[] getChangedEntries() {
- return getEntries(changed);
- }
- private ModelEntry[] getEntries(ArrayList list) {
- if (list == null)
- return new ModelEntry[0];
- return (ModelEntry[]) list.toArray(new ModelEntry[list.size()]);
- }
-
- void addEntry(ModelEntry entry, int type) {
- switch (type) {
- case ADDED :
- added = addEntry(added, entry);
- break;
- case REMOVED :
- removed = addEntry(removed, entry);
- break;
- case CHANGED :
- changed = addEntry(changed, entry);
- break;
- }
- kind |= type;
- }
- private ArrayList addEntry(ArrayList list, ModelEntry entry) {
- if (list == null)
- list = new ArrayList();
- list.add(entry);
- return list;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java
deleted file mode 100644
index b331a2c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginModelManager.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.osgi.service.resolver.BundleDelta;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.StateDelta;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelProviderEvent;
-import org.eclipse.pde.core.IModelProviderListener;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class PluginModelManager implements IAdaptable {
- private static final String OSGI_RUNTIME ="org.eclipse.osgi"; //$NON-NLS-1$
- private IModelProviderListener fProviderListener;
- private ExternalModelManager fExternalManager;
- private WorkspaceModelManager fWorkspaceManager;
- private SearchablePluginsManager fSearchablePluginsManager;
- private ArrayList fListeners;
- private Map fEntries;
-
- private PDEState fState;
-
- public PluginModelManager(WorkspaceModelManager wm, ExternalModelManager em) {
- fProviderListener = new IModelProviderListener() {
- public void modelsChanged(IModelProviderEvent e) {
- handleModelsChanged(e);
- }
- };
- fWorkspaceManager = wm;
- fExternalManager = em;
- fExternalManager.addModelProviderListener(fProviderListener);
- fWorkspaceManager.addModelProviderListener(fProviderListener);
- fListeners = new ArrayList();
- fSearchablePluginsManager = new SearchablePluginsManager(this);
- }
-
- /*
- * Returns true if OSGi runtime is currently present either in
- * the workspace or in the target platform.
- */
- public boolean isOSGiRuntime() {
- return findEntry(OSGI_RUNTIME) != null;
- }
-
- public String getTargetVersion() {
- ModelEntry entry = findEntry(OSGI_RUNTIME);
- if (entry == null)
- return ICoreConstants.TARGET21;
-
- IPluginModelBase model = entry.getActiveModel();
- String version = model.getPluginBase().getVersion();
- if (PluginVersionIdentifier.validateVersion(version).getSeverity() == IStatus.OK) {
- PluginVersionIdentifier id = new PluginVersionIdentifier(version);
- int major = id.getMajorComponent();
- int minor = id.getMinorComponent();
- if (major == 3 && minor == 0)
- return ICoreConstants.TARGET30;
- if (major == 3 && minor == 1)
- return ICoreConstants.TARGET31;
- }
- return ICoreConstants.TARGET32;
- }
-
- public Object getAdapter(Class key) {
- return null;
- }
-
- public void addPluginModelListener(IPluginModelListener listener) {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
- }
-
- public void removePluginModelListener(IPluginModelListener listener) {
- if (fListeners.contains(listener))
- fListeners.remove(listener);
- }
-
- public boolean isEmpty() {
- return getEntryTable().isEmpty();
- }
-
- public ModelEntry[] getEntries() {
- Collection values = getEntryTable().values();
- return (ModelEntry[]) values.toArray(new ModelEntry[values.size()]);
- }
-
- /*
- * @return enabled plug-ins only
- */
- public IPluginModelBase[] getPlugins() {
- Collection values = getEntryTable().values();
- ArrayList result = new ArrayList();
- for (Iterator iter = values.iterator(); iter.hasNext();) {
- ModelEntry entry = (ModelEntry) iter.next();
- IPluginModelBase model = entry.getActiveModel();
- if (model != null && model.isEnabled())
- result.add(model);
- }
- return (IPluginModelBase[])result.toArray(new IPluginModelBase[result.size()]);
- }
-
- /*
- * @return all plug-ins (enabled and disabled)
- */
- public IPluginModelBase[] getAllPlugins() {
- Collection values = getEntryTable().values();
- ArrayList result = new ArrayList();
- for (Iterator iter = values.iterator(); iter.hasNext();) {
- ModelEntry entry = (ModelEntry) iter.next();
- result.add(entry.getActiveModel());
- }
- return (IPluginModelBase[])result.toArray(new IPluginModelBase[result.size()]);
- }
-
- public IPluginModel[] getPluginsOnly() {
- Collection values = getEntryTable().values();
- ArrayList result = new ArrayList();
- for (Iterator iter = values.iterator(); iter.hasNext();) {
- ModelEntry entry = (ModelEntry) iter.next();
- IPluginModelBase model = entry.getActiveModel();
- if (model.isEnabled() && model instanceof IPluginModel)
- result.add(model);
- }
- return (IPluginModel[])result.toArray(new IPluginModel[result.size()]);
- }
-
- public IFragmentModel[] getFragments() {
- Collection values = getEntryTable().values();
- ArrayList result = new ArrayList();
- for (Iterator iter = values.iterator(); iter.hasNext();) {
- ModelEntry entry = (ModelEntry) iter.next();
- IPluginModelBase model = entry.getActiveModel();
- if (model instanceof IFragmentModel)
- result.add(model);
- }
- return (IFragmentModel[])result.toArray(new IFragmentModel[result.size()]);
-
- }
-
- public ModelEntry findEntry(IProject project) {
- initializeTable();
- IPluginModelBase model = fWorkspaceManager.getWorkspacePluginModel(project);
- return model == null ? null : findEntry(model.getPluginBase().getId());
- }
-
- public IPluginModelBase findModel(IProject project) {
- ModelEntry entry = findEntry(project);
- return (entry != null) ? entry.getActiveModel() : null;
- }
-
- public IPluginModelBase findModel(BundleDescription desc) {
- return desc == null ? null : findModel(desc.getSymbolicName());
- }
-
- public ModelEntry findEntry(String id) {
- if (id == null)
- return null;
- else if (id.equalsIgnoreCase("system.bundle")) //$NON-NLS-1$
- return (ModelEntry) getEntryTable().get("org.eclipse.osgi"); //$NON-NLS-1$
- return (ModelEntry) getEntryTable().get(id);
- }
-
- public IPluginModelBase findModel(String id) {
- ModelEntry entry = findEntry(id);
- return (entry == null) ? null : entry.getActiveModel();
- }
-
- public IPluginModelBase findPlugin(String id, String version, int match) {
- return findModel(id);
- }
-
- public IPluginModel findPluginModel(String id) {
- IPluginModelBase model = findModel(id);
- return (model != null && model instanceof IPluginModel) ? (IPluginModel)model : null;
- }
-
- public IFragmentModel findFragmentModel(String id) {
- IPluginModelBase model = findModel(id);
- return (model != null && model instanceof IFragmentModel) ? (IFragmentModel)model : null;
- }
-
- private void handleModelsChanged(IModelProviderEvent e) {
- PluginModelDelta delta = new PluginModelDelta();
- boolean javaSearchAffected = false;
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_REMOVED) != 0) {
- IModel[] removed = e.getRemovedModels();
- for (int i = 0; i < removed.length; i++) {
- if (!(removed[i] instanceof IPluginModelBase)) continue;
- IPluginModelBase model = (IPluginModelBase) removed[i];
- IPluginBase plugin = model.getPluginBase();
- ModelEntry entry = updateTable(plugin.getId(), model, false, delta);
- if (entry != null && (model.getUnderlyingResource() != null || entry.isInJavaSearch()))
- javaSearchAffected = true;
- }
- }
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_ADDED) != 0) {
- IModel[] added = e.getAddedModels();
- for (int i = 0; i < added.length; i++) {
- if (!(added[i] instanceof IPluginModelBase)) continue;
- IPluginModelBase model = (IPluginModelBase) added[i];
- IPluginBase plugin = model.getPluginBase();
- ModelEntry entry = updateTable(plugin.getId(), model, true, delta);
- if (entry != null && (model.getUnderlyingResource() != null || entry.isInJavaSearch()))
- javaSearchAffected = true;
- }
- }
- if ((e.getEventTypes() & IModelProviderEvent.MODELS_CHANGED) != 0) {
- IModel[] changed = e.getChangedModels();
- for (int i = 0; i < changed.length; i++) {
- if (!(changed[i] instanceof IPluginModelBase)) continue;
- IPluginModelBase model = (IPluginModelBase) changed[i];
- BundleDescription desc = model.getBundleDescription();
- String oldID = desc == null ? null : desc.getSymbolicName();
- String newID = model.getPluginBase().getId();
-
- if (oldID == null && newID == null)
- continue;
-
- ModelEntry entry = null;
- if (oldID == null && newID != null) {
- entry = updateTable(newID, model, true, delta);
- } else if (oldID != null && newID == null) {
- entry = updateTable(oldID, model, false, delta);
- model.setBundleDescription(null);
- } else if (oldID.equals(newID)) {
- fState.addBundle(model, true);
- entry = (ModelEntry)getEntryTable().get(oldID);
- delta.addEntry(entry, PluginModelDelta.CHANGED);
- } else {
- entry = updateTable(oldID, model, false, delta);
- entry = updateTable(newID, model, true, delta);
- }
- if (entry != null && (model.getUnderlyingResource() != null || entry.isInJavaSearch()))
- javaSearchAffected = true;
- }
- }
-
- StateDelta stateDelta = (e.getEventTypes() & IModelProviderEvent.TARGET_CHANGED) != 0
- ? null
- : fState.resolveState(true);
- updateAffectedEntries(stateDelta);
- if (javaSearchAffected)
- fSearchablePluginsManager.updateClasspathContainer();
- fireDelta(delta);
- }
-
- private ModelEntry updateTable(
- String id,
- IPluginModelBase model,
- boolean added,
- PluginModelDelta delta) {
- if (id == null)
- return null;
- boolean workspace = model.getUnderlyingResource()!=null;
- Map entries = getEntryTable();
- ModelEntry entry = (ModelEntry) entries.get(id);
- int kind = 0;
- if (added && entry == null) {
- entry = new ModelEntry(this, id);
- entries.put(id, entry);
- kind = PluginModelDelta.ADDED;
- }
- if (added) {
- if (workspace)
- entry.setWorkspaceModel(model);
- else
- entry.setExternalModel(model);
- } else if (entry != null) {
- if (workspace) entry.setWorkspaceModel(null);
- else
- entry.setExternalModel(null);
- if (entry.isEmpty()) {
- entries.remove(id);
- kind = PluginModelDelta.REMOVED;
- }
- }
- if (workspace) {
- if (added) {
- addWorkspaceBundleToState(model);
- } else {
- removeWorkspaceBundleFromState(model, id);
- }
- }
- if (kind==0) kind = PluginModelDelta.CHANGED;
- delta.addEntry(entry, kind);
- return entry;
- }
-
- private void updateAffectedEntries(StateDelta delta) {
- Map map = new HashMap();
- if (delta == null) {
- ModelEntry[] entries = getEntries();
- for (int i = 0; i < entries.length; i++) {
- ModelEntry entry = entries[i];
- try {
- if (entry != null && entry.shouldUpdateClasspathContainer(true)) {
- IProject project = entry.getWorkspaceModel().getUnderlyingResource().getProject();
- IJavaProject jProject = JavaCore.create(project);
- if (!map.containsKey(jProject))
- map.put(jProject, entry.getClasspathContainer(true));
- }
- } catch (CoreException e) {
- }
- }
- } else {
- BundleDelta[] deltas = delta.getChanges();
- for (int i = 0; i < deltas.length; i++) {
- try {
- String id = deltas[i].getBundle().getSymbolicName();
- ModelEntry entry = findEntry(id);
- if (entry != null && entry.shouldUpdateClasspathContainer(true)) {
- IProject project = entry.getWorkspaceModel().getUnderlyingResource().getProject();
- IJavaProject jProject = JavaCore.create(project);
- if (!map.containsKey(jProject))
- map.put(jProject, entry.getClasspathContainer(true));
- }
- } catch (CoreException e) {
- }
- }
- }
-
- if (map.size() > 0) {
- try {
- IJavaProject[] jProjects = (IJavaProject[])map.keySet().toArray(new IJavaProject[map.size()]);
- IClasspathContainer[] containers = (IClasspathContainer[])map.values().toArray(new IClasspathContainer[map.size()]);
- JavaCore.setClasspathContainer(
- new Path(PDECore.CLASSPATH_CONTAINER_ID),
- jProjects,
- containers,
- null);
- } catch (JavaModelException e) {
- }
- }
- }
-
- /*
- * Allow access to the table only through this getter.
- * It always calls initialize to make sure the table is initialized.
- * If more than one thread tries to read the table at the same time,
- * and the table is not initialized yet, thread2 would wait.
- * This way there are no partial reads.
- */
- private Map getEntryTable() {
- initializeTable();
- return fEntries;
- }
-
- /*
- * This method must be synchronized so that only one thread
- * initializes the table, and the rest would block until
- * the table is initialized.
- *
- */
- private synchronized void initializeTable() {
- if (fEntries != null) return;
- fEntries = Collections.synchronizedMap(new TreeMap());
- fState = new PDEState(
- WorkspaceModelManager.getPluginPaths(),
- ExternalModelManager.getPluginPaths(),
- true,
- TargetPlatform.getTargetEnvironment(),
- new NullProgressMonitor());
-
- fExternalManager.initializeModels(fState.getTargetModels());
- addToTable(fExternalManager.getAllModels(), false);
- if (fState.isCombined()) {
- IPluginModelBase[] models = fState.getWorkspaceModels();
- fWorkspaceManager.initializeModels(models);
- addToTable(models, true);
- } else {
- addToTable(fWorkspaceManager.getAllModels(), true);
- addWorkspaceBundlesToNewState();
- }
- fSearchablePluginsManager.initialize();
- }
-
- public PDEState getState() {
- initializeTable();
- return fState;
- }
-
- public void setState(PDEState state) {
- fState = state;
- }
-
- private void addToTable(IPluginModelBase[] models, boolean workspace) {
- for (int i = 0; i < models.length; i++) {
- IPluginModelBase model = models[i];
- String id = model.getPluginBase().getId();
- if (id == null)
- continue;
- ModelEntry entry = (ModelEntry) fEntries.get(id);
- if (entry == null) {
- entry = new ModelEntry(this, id);
- fEntries.put(id, entry);
- }
- if (workspace)
- entry.setWorkspaceModel(model);
- else
- entry.setExternalModel(model);
- }
- }
-
- private void addWorkspaceBundlesToNewState() {
- IPluginModelBase[] models = fWorkspaceManager.getAllModels();
- for (int i = 0; i < models.length; i++) {
- addWorkspaceBundleToState(models[i]);
- }
- fState.resolveState(true);
- }
-
- private void addWorkspaceBundleToState(IPluginModelBase model) {
- String id = model.getPluginBase().getId();
- if (id == null)
- return;
- ModelEntry entry = findEntry(id);
- IPluginModelBase external = entry == null ? null : entry.getExternalModel();
- if (external != null) {
- fState.removeBundleDescription(external.getBundleDescription());
- }
- fState.addBundle(model, false);
- }
-
- private void removeWorkspaceBundleFromState(IPluginModelBase model, String id) {
- BundleDescription description = model.getBundleDescription();
- if (description == null)
- return;
-
- fState.removeBundleDescription(description);
-
- ModelEntry entry = findEntry(id);
- IPluginModelBase external = entry == null ? null : entry.getExternalModel();
- if (external != null) {
- fState.addBundleDescription(external.getBundleDescription());
- }
- }
-
- private void fireDelta(PluginModelDelta delta) {
- Object [] entries = fListeners.toArray();
- for (int i=0; i<entries.length; i++) {
- ((IPluginModelListener)entries[i]).modelsChanged(delta);
- }
- }
-
- public void shutdown() {
- if (fWorkspaceManager != null)
- fWorkspaceManager.removeModelProviderListener(fProviderListener);
- if (fExternalManager != null)
- fExternalManager.removeModelProviderListener(fProviderListener);
- if (fState != null)
- fState.shutdown();
- fSearchablePluginsManager.shutdown();
- }
-
- public void setInJavaSearch(ModelEntry [] entries, boolean value, IProgressMonitor monitor) throws CoreException {
- PluginModelDelta delta = new PluginModelDelta();
- for (int i=0; i<entries.length; i++) {
- ModelEntry entry = entries[i];
- if (entry.isInJavaSearch()!=value) {
- entry.setInJavaSearch(value);
- delta.addEntry(entry, PluginModelDelta.CHANGED);
- }
- }
- if (delta.getKind()!=0) {
- fSearchablePluginsManager.persistStates( monitor);
- fireDelta(delta);
- }
- }
-
- void searchablePluginsRemoved() {
- ModelEntry [] entries = getEntries();
- PluginModelDelta delta = new PluginModelDelta();
-
- for (int i=0; i<entries.length; i++) {
- ModelEntry entry = entries[i];
- if (entry.isInJavaSearch()) {
- entry.setInJavaSearch(false);
- delta.addEntry(entry, PluginModelDelta.CHANGED);
- }
- }
- if (delta.getKind()!=0)
- fireDelta(delta);
- }
-
- public IFileAdapterFactory getFileAdapterFactory() {
- return fSearchablePluginsManager;
- }
- /**
- * @return Returns the searchablePluginsManager.
- */
- public SearchablePluginsManager getSearchablePluginsManager() {
- initializeTable();
- return fSearchablePluginsManager;
- }
-
- public IPluginModelBase[] getExternalModels() {
- initializeTable();
- return fExternalManager.getAllModels();
- }
-
- public IPluginModelBase[] getWorkspaceModels() {
- initializeTable();
- return fWorkspaceManager.getAllModels();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginPathFinder.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginPathFinder.java
deleted file mode 100644
index 02622ba..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginPathFinder.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.update.configurator.ConfiguratorUtils;
-import org.eclipse.update.configurator.IPlatformConfiguration;
-
-public class PluginPathFinder {
-
- /**
- *
- * @param platformHome
- * @param linkFile
- * @param features false for plugins, true for features
- * @return path of plugins or features directory of an extension site
- */
- private static String getSitePath(String platformHome, File linkFile, boolean features) {
- String prefix = new Path(platformHome).removeLastSegments(1).toString();
- Properties properties = new Properties();
- try {
- FileInputStream fis = new FileInputStream(linkFile);
- properties.load(fis);
- fis.close();
- String path = properties.getProperty("path"); //$NON-NLS-1$
- if (path != null) {
- if (!new Path(path).isAbsolute())
- path = prefix + IPath.SEPARATOR + path;
- path += IPath.SEPARATOR + "eclipse" + IPath.SEPARATOR; //$NON-NLS-1$
- if (features)
- path += "features"; //$NON-NLS-1$
- else
- path += "plugins"; //$NON-NLS-1$
- if (new File(path).exists()) {
- return path;
- }
- }
- } catch (IOException e) {
- }
- return null;
- }
-
- /**
- *
- * @param platformHome
- * @param features false for plugin sites, true for feature sites
- * @return array of ".../plugins" or ".../features" Files
- */
- private static File[] getSites(String platformHome, boolean features) {
- ArrayList sites = new ArrayList();
- File file = new File(platformHome, features ? "features" : "plugins"); //$NON-NLS-1$ //$NON-NLS-2$
- if (!features && !file.exists())
- file = new File(platformHome);
- if (file.exists())
- sites.add(file);
-
- File[] linkFiles = new File(platformHome + IPath.SEPARATOR + "links").listFiles(); //$NON-NLS-1$
- if (linkFiles != null) {
- for (int i = 0; i < linkFiles.length; i++) {
- String path = getSitePath(platformHome, linkFiles[i], features);
- if (path != null) {
- sites.add(new File(path));
- }
- }
- }
- return (File[])sites.toArray(new File[sites.size()]);
- }
-
- public static URL[] getPluginPaths(String platformHome) {
- if (ExternalModelManager.isTargetEqualToHost(platformHome) && !PDECore.isDevLaunchMode())
- return ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath();
-
- File file = new File(platformHome, "configuration/org.eclipse.update/platform.xml"); //$NON-NLS-1$
- if (file.exists()) {
- try {
- IPlatformConfiguration config = ConfiguratorUtils.getPlatformConfiguration(file.toURL());
- return getConfiguredSitesPaths(platformHome, config, false);
- } catch (MalformedURLException e) {
- } catch (IOException e) {
- }
- }
- return scanLocations(getSites(platformHome, false));
- }
-
- public static URL[] getFeaturePaths(String platformHome) {
- File file = new File(platformHome, "configuration/org.eclipse.update/platform.xml"); //$NON-NLS-1$
- if (file.exists()) {
- try {
- IPlatformConfiguration config = ConfiguratorUtils.getPlatformConfiguration(file.toURL());
- return getConfiguredSitesPaths(platformHome, config, true);
- } catch (MalformedURLException e) {
- } catch (IOException e) {
- }
- }
- return scanLocations(getSites(platformHome, true));
- }
-
- private static URL[] getConfiguredSitesPaths(String platformHome, IPlatformConfiguration configuration, boolean features) {
- URL[] installPlugins = scanLocations(new File[] { new File(
- platformHome, features ? "features" : "plugins") }); //$NON-NLS-1$ //$NON-NLS-2$
- URL[] extensionPlugins = getExtensionPluginURLs(configuration, features);
-
- URL[] all = new URL[installPlugins.length + extensionPlugins.length];
- System.arraycopy(installPlugins, 0, all, 0, installPlugins.length);
- System.arraycopy(extensionPlugins, 0, all, installPlugins.length, extensionPlugins.length);
- return all;
- }
-
- /**
- *
- * @param config
- * @param features true for features false for plugins
- * @return URLs for features or plugins on the site
- */
- private static URL[] getExtensionPluginURLs(IPlatformConfiguration config, boolean features) {
- ArrayList extensionPlugins = new ArrayList();
- IPlatformConfiguration.ISiteEntry[] sites = config.getConfiguredSites();
- for (int i = 0; i < sites.length; i++) {
- URL url = sites[i].getURL();
- if ("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
- String[] entries;
- if(features)
- entries = sites[i].getFeatures();
- else
- entries = sites[i].getPlugins();
- for (int j = 0; j < entries.length; j++) {
- try {
- extensionPlugins.add(new File(url.getFile(), entries[j]).toURL());
- } catch (MalformedURLException e) {
- }
- }
- }
- }
- return (URL[]) extensionPlugins.toArray(new URL[extensionPlugins.size()]);
- }
-
- /**
- * Scan given plugin/feature directores or jars for existance
- * @param sites
- * @return URLs to plugins/features
- */
- public static URL[] scanLocations(File[] sites) {
- ArrayList result = new ArrayList();
- for (int i = 0; i < sites.length; i++){
- if (!sites[i].exists())
- continue;
- File[] children = sites[i].listFiles();
- if (children != null) {
- for (int j = 0; j < children.length; j++) {
- try {
- result.add(children[j].toURL());
- } catch (MalformedURLException e) {
- }
- }
- }
- }
- return (URL[]) result.toArray(new URL[result.size()]);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredDependencyManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredDependencyManager.java
deleted file mode 100644
index 7688d8e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredDependencyManager.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class RequiredDependencyManager {
-
- public static Set addRequiredPlugins(Object[] selected, String[] implicit, State state) {
- Set set = new HashSet();
- for (int i = 0; i < selected.length; i++) {
- if (!(selected[i] instanceof IPluginModelBase))
- continue;
- IPluginModelBase model = (IPluginModelBase)selected[i];
- addBundleAndDependencies(model.getBundleDescription(), set);
- IPluginExtension[] extensions = model.getPluginBase().getExtensions();
- for (int j = 0; j < extensions.length; j++) {
- String point = extensions[j].getPoint();
- if (point != null) {
- int dot = point.lastIndexOf('.');
- if (dot != -1) {
- String id = point.substring(0, dot);
- addBundleAndDependencies(state.getBundle(id, null), set);
- }
- }
- }
- }
-
- for (int i = 0; i < implicit.length; i++) {
- addBundleAndDependencies(state.getBundle(implicit[i], null), set);
- }
-
- for (int i = 0; i < selected.length; i++) {
- if (!(selected[i] instanceof IPluginModelBase))
- continue;
- IPluginModelBase model = (IPluginModelBase)selected[i];
- set.remove(model.getPluginBase().getId());
- }
- return set;
- }
-
- private static void addBundleAndDependencies(BundleDescription desc, Set set) {
- if (desc != null && set.add(desc.getSymbolicName())) {
- BundleSpecification[] required = desc.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- addBundleAndDependencies((BundleDescription)required[i].getSupplier(), set);
- }
- ExportPackageDescription[] exported = desc.getResolvedImports();
- for (int i = 0; i < exported.length; i++) {
- addBundleAndDependencies(exported[i].getExporter(), set);
- }
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- if (!fragments[i].isResolved())
- continue;
- String id = fragments[i].getSymbolicName();
- if (!"org.eclipse.ui.workbench.compatibility".equals(id)) //$NON-NLS-1$
- addBundleAndDependencies(fragments[i], set);
- }
- HostSpecification host = desc.getHost();
- if (host != null)
- addBundleAndDependencies((BundleDescription)host.getSupplier(), set);
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsClasspathContainer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsClasspathContainer.java
deleted file mode 100644
index 4f53f0e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsClasspathContainer.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.osgi.service.resolver.BaseDescription;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.StateHelper;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-
-public class RequiredPluginsClasspathContainer extends PDEClasspathContainer implements IClasspathContainer {
-
- private IPluginModelBase fModel;
-
- private static boolean DEBUG = false;
-
- private IClasspathEntry[] fEntries = null;
-
- static {
- DEBUG = PDECore.getDefault().isDebugging()
- && "true".equals(Platform.getDebugOption("org.eclipse.pde.core/classpath")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Constructor for RequiredPluginsClasspathContainer.
- */
- public RequiredPluginsClasspathContainer(IPluginModelBase model) {
- fModel = model;
- }
-
-
- public void reset() {
- fEntries = null;
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getKind()
- */
- public int getKind() {
- return K_APPLICATION;
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getPath()
- */
- public IPath getPath() {
- return new Path(PDECore.CLASSPATH_CONTAINER_ID);
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- return PDECoreMessages.RequiredPluginsClasspathContainer_description;
- }
-
- /**
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- if (fModel == null) {
- if (DEBUG) {
- System.out.println("********Returned an empty container"); //$NON-NLS-1$
- System.out.println();
- }
- return new IClasspathEntry[0];
- }
- if (fEntries == null) {
- fEntries = computePluginEntries();
- }
- if (DEBUG) {
- System.out.println("Dependencies for plugin '" + fModel.getPluginBase().getId() + "':"); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 0; i < fEntries.length; i++) {
- System.out.println(fEntries[i]);
- }
- System.out.println();
- }
- return fEntries;
- }
-
- private IClasspathEntry[] computePluginEntries() {
- ArrayList entries = new ArrayList();
- try {
- BundleDescription desc = fModel.getBundleDescription();
- if (desc == null)
- return new IClasspathEntry[0];
-
- Map map = retrieveVisiblePackagesFromState(desc);
-
- HashSet added = new HashSet();
-
- // to avoid cycles, e.g. when a bundle imports a package it exports
- added.add(desc.getSymbolicName());
-
- HostSpecification host = desc.getHost();
- if (desc.isResolved() && host != null) {
- addHostPlugin(host, added, map, entries);
- }
-
- // add dependencies
- BundleSpecification[] required = desc.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- addDependency(getSupplier(required[i]), added, map, entries);
- }
-
- IBuild build = ClasspathUtilCore.getBuild(fModel);
- if (build != null)
- addSecondaryDependencies(added, map, entries, build);
-
- // add Import-Package
- Iterator iter = map.keySet().iterator();
- while (iter.hasNext()) {
- String symbolicName = iter.next().toString();
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(symbolicName);
- if (model != null && model.isEnabled())
- addDependencyViaImportPackage(model.getBundleDescription(), added, map, entries);
- }
-
- if (build != null)
- addExtraClasspathEntries(added, entries, build);
-
- } catch (CoreException e) {
- }
- return (IClasspathEntry[])entries.toArray(new IClasspathEntry[entries.size()]);
- }
-
- private BundleDescription getSupplier(BundleSpecification spec) {
- if (spec.isResolved())
- return (BundleDescription)spec.getSupplier();
-
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(spec.getName());
- return model != null && model.isEnabled() ? model.getBundleDescription() : null;
- }
-
- private Map retrieveVisiblePackagesFromState(BundleDescription bundle) {
- Map visiblePackages = new TreeMap();
- if (bundle.isResolved()) {
- BundleDescription desc = bundle;
- StateHelper helper = Platform.getPlatformAdmin().getStateHelper();
- addVisiblePackagesFromState(helper, desc, visiblePackages);
- if (desc.getHost() != null)
- addVisiblePackagesFromState(helper, (BundleDescription)desc.getHost().getSupplier(), visiblePackages);
- }
- return visiblePackages;
- }
-
- private void addVisiblePackagesFromState(StateHelper helper, BundleDescription desc, Map visiblePackages) {
- ExportPackageDescription[] exports = helper.getVisiblePackages(desc);
- for (int i = 0; i < exports.length; i++) {
- BundleDescription exporter = exports[i].getExporter();
- if (exporter == null)
- continue;
- ArrayList list = (ArrayList)visiblePackages.get(exporter.getSymbolicName());
- if (list == null)
- list = new ArrayList();
- Rule rule = getRule(helper, desc, exports[i]);
- if (!list.contains(rule))
- list.add(rule);
- visiblePackages.put(exporter.getSymbolicName(), list);
- }
- }
-
- private Rule getRule(StateHelper helper, BundleDescription desc, ExportPackageDescription export) {
- Rule rule = new Rule();
- rule.discouraged = helper.getAccessCode(desc, export) == StateHelper.ACCESS_DISCOURAGED;
- rule.path = new Path(export.getName().replaceAll("\\.", "/") + "/*"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return rule;
- }
-
- protected void addDependencyViaImportPackage(BundleDescription desc, HashSet added, Map map, ArrayList entries) throws CoreException {
- if (desc == null || !added.add(desc.getSymbolicName()))
- return;
-
- addPlugin(desc, true, map, entries);
-
- if (hasExtensibleAPI(desc) && desc.getContainingState() != null) {
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- if (fragments[i].isResolved())
- addDependencyViaImportPackage(fragments[i], added, map, entries);
- }
- }
- }
-
- private void addDependency(BundleDescription desc, HashSet added, Map map, ArrayList entries) throws CoreException {
- addDependency(desc, added, map, entries, true);
- }
-
- private void addDependency(BundleDescription desc, HashSet added, Map map, ArrayList entries, boolean useInclusion) throws CoreException {
- if (desc == null || !added.add(desc.getSymbolicName()))
- return;
-
- addPlugin(desc, useInclusion, map, entries);
-
- if (hasExtensibleAPI(desc) && desc.getContainingState() != null) {
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- if (fragments[i].isResolved())
- addDependency(fragments[i], added, map, entries, useInclusion);
- }
- }
-
- BundleSpecification[] required = desc.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- if (required[i].isExported()) {
- addDependency(getSupplier(required[i]), added, map, entries, useInclusion);
- }
- }
- }
-
- private boolean addPlugin(BundleDescription desc, boolean useInclusions, Map map, ArrayList entries)
- throws CoreException {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(desc);
- if (model == null || !model.isEnabled())
- return false;
- IResource resource = model.getUnderlyingResource();
- Rule[] rules = useInclusions ? getInclusions(map, model) : null;
- if (resource != null) {
- addProjectEntry(resource.getProject(), rules, entries);
- } else {
- addExternalPlugin(model, rules, entries);
- }
- return true;
- }
-
- private Rule[] getInclusions(Map map, IPluginModelBase model) {
- if ("false".equals(System.getProperty("pde.restriction")) //$NON-NLS-1$ //$NON-NLS-2$
- ||!fModel.getBundleDescription().isResolved()
- || !(fModel instanceof IBundlePluginModelBase))
- return null;
-
- if (TargetPlatform.getTargetVersion() < 3.1)
- return null;
-
- BundleDescription desc = model.getBundleDescription();
- if (desc == null || !desc.isResolved())
- return null;
-
- Rule[] rules;
-
- if (desc.getHost() != null)
- rules = getInclusions(map, (BundleDescription)desc.getHost().getSupplier());
- else
- rules = getInclusions(map, desc);
-
- return (rules.length == 0 && !ClasspathUtilCore.isBundle(model)) ? null : rules;
- }
-
- private Rule[] getInclusions(Map map, BundleDescription desc) {
- ArrayList list = (ArrayList)map.get(desc.getSymbolicName());
- return list != null ? (Rule[])list.toArray(new Rule[list.size()]) : new Rule[0];
- }
-
- private void addHostPlugin(HostSpecification hostSpec, HashSet added, Map map, ArrayList entries) throws CoreException {
- BaseDescription desc = hostSpec.getSupplier();
-
- if (desc instanceof BundleDescription && added.add(desc.getName())) {
- BundleDescription host = (BundleDescription)desc;
- // add host plug-in
- if (addPlugin(host, false, map, entries)) {
- BundleSpecification[] required = host.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- desc = getSupplier(required[i]);
- if (desc != null && desc instanceof BundleDescription) {
- addDependency((BundleDescription)desc, added, map, entries);
- }
- }
-
- // add Import-Package
- ImportPackageSpecification[] imports = host.getImportPackages();
- for (int i = 0; i < imports.length; i++) {
- BaseDescription supplier = imports[i].getSupplier();
- if (supplier instanceof ExportPackageDescription) {
- addDependencyViaImportPackage(((ExportPackageDescription)supplier).getExporter(), added, map, entries);
- }
- }
- }
- }
- }
-
- private boolean hasExtensibleAPI(BundleDescription desc) {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(desc);
- return (model instanceof IPluginModel)
- ? ClasspathUtilCore.hasExtensibleAPI(((IPluginModel)model).getPlugin())
- : false;
- }
-
- protected void addExtraClasspathEntries(HashSet added, ArrayList entries, IBuild build) throws CoreException {
- IBuildEntry entry = build.getEntry(IBuildEntry.JARS_EXTRA_CLASSPATH);
- if (entry == null)
- return;
-
- String[] tokens = entry.getTokens();
- for (int i = 0; i < tokens.length; i++) {
- IPath path = Path.fromPortableString(tokens[i]);
- if (!path.isAbsolute()) {
- File file = new File(fModel.getInstallLocation(), path.toString());
- if (file.exists()) {
- IFile resource = PDECore.getWorkspace().getRoot().getFileForLocation(new Path(file.getAbsolutePath()));
- if (resource != null && resource.getProject().equals(fModel.getUnderlyingResource().getProject())) {
- addExtraLibrary(resource.getFullPath(), null, entries);
- continue;
- }
- }
- if (path.segmentCount() >= 3 && "..".equals(path.segment(0))) { //$NON-NLS-1$
- path = path.removeFirstSegments(1);
- path = Path.fromPortableString("platform:/plugin/").append(path); //$NON-NLS-1$
- } else {
- continue;
- }
- }
-
- if (!path.toPortableString().startsWith("platform:")) { //$NON-NLS-1$
- File file = new File(path.toOSString());
- if (file.exists()) {
- addExtraLibrary(path, null, entries);
- }
- } else {
- int count = path.getDevice() == null ? 4 : 3;
- if (path.segmentCount() >= count) {
- String pluginID = path.segment(count-2);
- if (added.contains(pluginID))
- continue;
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(pluginID);
- if (model != null && model.isEnabled()) {
- path = path.setDevice(null);
- path = path.removeFirstSegments(count-1);
- if (model.getUnderlyingResource() == null) {
- File file = new File(model.getInstallLocation(), path.toOSString());
- if (file.exists()) {
- addExtraLibrary(new Path(file.getAbsolutePath()), model, entries);
- }
- } else {
- IProject project = model.getUnderlyingResource().getProject();
- IFile file = project.getFile(path);
- if (file.exists()) {
- addExtraLibrary(file.getFullPath(), model, entries);
- }
- }
- }
- }
- }
- }
- }
-
- private void addSecondaryDependencies(HashSet added, Map map, ArrayList entries, IBuild build) {
- try {
- IBuildEntry entry = build.getEntry(IBuildEntry.SECONDARY_DEPENDENCIES);
- if (entry != null) {
- String[] tokens = entry.getTokens();
- for (int i = 0; i < tokens.length; i++) {
- // Get PluginModelBase first to resolve system.bundle entry if it exists
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(tokens[i]);
- if (model != null) {
- addDependency(model.getBundleDescription(), added, map, entries, false);
- }
- }
- }
- } catch (CoreException e) {
- return;
- }
- }
-
-
- private void addExtraLibrary(IPath path, IPluginModelBase model, ArrayList entries) throws CoreException {
- IPath srcPath = null;
- if (model != null) {
- IPath shortPath = path.removeFirstSegments(path.matchingFirstSegments(new Path(model.getInstallLocation())));
- srcPath = ClasspathUtilCore.getSourceAnnotation(model, shortPath.toString());
- } else {
- String filename = ClasspathUtilCore.getSourceZipName(path.lastSegment());
- IPath candidate = path.removeLastSegments(1).append(filename);
- if (PDECore.getWorkspace().getRoot().getFile(candidate).exists())
- srcPath = candidate;
- }
- IClasspathEntry clsEntry = JavaCore.newLibraryEntry(
- path,
- srcPath,
- null);
- if (!entries.contains(clsEntry))
- entries.add(clsEntry);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsInitializer.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsInitializer.java
deleted file mode 100644
index 7d27ed1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsInitializer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ClasspathContainerInitializer;
-import org.eclipse.jdt.core.IJavaProject;
-
-/**
- *
- */
-public class RequiredPluginsInitializer extends ClasspathContainerInitializer {
-
- /**
- * Constructor for RequiredPluginsInitializer.
- */
- public RequiredPluginsInitializer() {
- super();
- }
-
- /**
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(IPath, IJavaProject)
- */
- public void initialize(IPath containerPath, IJavaProject javaProject)
- throws CoreException {
- IProject project = javaProject.getProject();
- ModelEntry entry =
- PDECore.getDefault().getModelManager().findEntry(project);
- if (entry == null) {
- ModelEntry.updateUnknownClasspathContainer(javaProject);
- } else {
- entry.updateClasspathContainer(false);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public Object getComparisonID(IPath containerPath, IJavaProject project) {
- if (containerPath == null || project == null)
- return null;
-
- return containerPath.segment(0) + "/" + project.getPath().segment(0); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ResourceExtender.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ResourceExtender.java
deleted file mode 100644
index ce8eebd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ResourceExtender.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * ResourceExtender provides property testers for the XML expression language
- * evaluation. We provide a copy in PDE so that launch shortcuts can add
- * contextual launch enablement that does not require their plugins to be
- * loaded.
- */
-public class ResourceExtender extends PropertyTester {
-
- private static final String PDE_NATURE = "PluginNature"; //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object,
- * java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String method, Object[] args,
- Object expectedValue) {
- IResource resource = (IResource) ((IAdaptable) receiver)
- .getAdapter(IResource.class);
- if (resource != null) {
- if (PDE_NATURE.equals(method)) {
- try {
- IProject proj = resource.getProject();
- return proj.isAccessible()
- && proj.hasNature("org.eclipse.pde.PluginNature"); //$NON-NLS-1$
- } catch (CoreException e) {
- return true;
- }
- }
- }
- return true;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SearchablePluginsManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SearchablePluginsManager.java
deleted file mode 100644
index 8c80f17..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SearchablePluginsManager.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-/**
- * This class manages the ability of external plug-ins in the model manager to
- * take part in the Java search. It manages a proxy Java projects and for each
- * external plug-in added to Java search, it adds its Java libraries as external
- * JARs to the proxy project. This makes the libraries visible to the Java
- * model, and they can take part in various Java searches.
- */
-public class SearchablePluginsManager implements IFileAdapterFactory {
- private IJavaProject proxyProject;
- private PluginModelManager manager;
- private static final String PROXY_FILE_NAME = ".searchable"; //$NON-NLS-1$
- private static final String PROXY_PROJECT_NAME = "External Plug-in Libraries"; //$NON-NLS-1$
- private static final String KEY = "searchablePlugins"; //$NON-NLS-1$
-
- private Listener elementListener;
- private ExternalJavaSearchClasspathContainer classpathContainer;
-
- class Listener implements IElementChangedListener {
- public void elementChanged(ElementChangedEvent e) {
- if (e.getType() == ElementChangedEvent.POST_CHANGE) {
- handleDelta(e.getDelta());
- }
- }
- }
-
- private String getProxyProjectName() {
- return PROXY_PROJECT_NAME;
- }
-
- public SearchablePluginsManager(PluginModelManager manager) {
- this.manager = manager;
- elementListener = new Listener();
- }
-
- public void initialize() {
- initializeProxyProject();
- if (proxyProject == null)
- return;
- IProject project = proxyProject.getProject();
- IFile proxyFile = project.getFile(PROXY_FILE_NAME);
- initializeStates(proxyFile);
- JavaCore.addElementChangedListener(elementListener);
- }
-
- public void shutdown() {
- JavaCore.removeElementChangedListener(elementListener);
- }
-
- private void initializeProxyProject() {
- IProject project = PDECore.getWorkspace().getRoot().getProject(
- getProxyProjectName());
- if (project == null)
- return;
- proxyProject = JavaCore.create(project);
- }
-
- private void initializeStates(IFile proxyFile) {
- if (proxyFile.exists() == false)
- return;
- Properties properties = new Properties();
- try {
- InputStream stream = proxyFile.getContents(true);
- properties.load(stream);
- stream.close();
- String value = properties.getProperty(KEY);
- if (value == null)
- return;
- ArrayList ids = new ArrayList();
- StringTokenizer stok = new StringTokenizer(value, ","); //$NON-NLS-1$
- for (; stok.hasMoreTokens();) {
- ids.add(stok.nextToken());
- }
- initializeStates(ids);
- } catch (IOException e) {
- } catch (CoreException e) {
- }
- }
- private void initializeStates(ArrayList ids) {
- for (int i = 0; i < ids.size(); i++) {
- String id = (String) ids.get(i);
- ModelEntry entry = manager.findEntry(id);
- if (entry != null)
- entry.setInJavaSearch(true);
- }
- }
-
- public void persistStates(IProgressMonitor monitor) throws CoreException {
- ModelEntry[] entries = manager.getEntries();
- StringBuffer buffer = new StringBuffer();
-
- monitor.beginTask(PDECoreMessages.SearchablePluginsManager_saving, 3);
-
- int counter = 0;
-
- for (int i = 0; i < entries.length; i++) {
- ModelEntry entry = entries[i];
- if (entry.isInJavaSearch()) {
- if (counter++ > 0)
- buffer.append(","); //$NON-NLS-1$
- buffer.append(entry.getId());
- }
- }
- createProxyProject(monitor);
- if (proxyProject == null)
- return;
- monitor.worked(1);
- IFile file = proxyProject.getProject().getFile(PROXY_FILE_NAME);
- persistStates(file, buffer.toString(), new SubProgressMonitor(monitor,
- 1));
- updateClasspathContainer();
- }
-
- public void updateClasspathContainer() {
- if (proxyProject==null) return;
- try {
- updateClasspathContainer(proxyProject);
- }
- catch (CoreException e) {
- PDECore.logException(e);
- }
- }
-
- public void updateClasspathContainer(IJavaProject project)
- throws CoreException {
- IJavaProject[] javaProjects = new IJavaProject[]{project};
- IClasspathContainer[] containers = new IClasspathContainer[]{getClasspathContainer()};
- IPath path = new Path(PDECore.JAVA_SEARCH_CONTAINER_ID);
- try {
- getClasspathContainer().reset();
- JavaCore
- .setClasspathContainer(path, javaProjects, containers, null);
- } catch (OperationCanceledException e) {
- getClasspathContainer().reset();
- throw e;
- }
- }
-
- public ExternalJavaSearchClasspathContainer getClasspathContainer() {
- /*
- if (classpathContainer == null)
- */
- classpathContainer = new ExternalJavaSearchClasspathContainer(this);
- return classpathContainer;
- }
-
- public IClasspathEntry[] computeContainerClasspathEntries()
- throws CoreException {
- ArrayList result = new ArrayList();
-
- ModelEntry[] entries = manager.getEntries();
- for (int i = 0; i < entries.length; i++) {
- ModelEntry entry = entries[i];
- ArrayList entryResult = new ArrayList();
- if (entry.getWorkspaceModel() != null) {
- // We used to skip workspace models before.
- // If we add them as references,
- // scoped searches will work according
- // to bug 52667
- IProject eproject = entry.getWorkspaceModel().getUnderlyingResource().getProject();
- if (eproject.hasNature(JavaCore.NATURE_ID)) {
- IClasspathEntry pentry =
- JavaCore.newProjectEntry(eproject.getFullPath());
- entryResult.add(pentry);
- }
- }
- else {
- if (entry.isInJavaSearch() == false)
- continue;
- IPluginModelBase model = entry.getExternalModel();
- if (model == null)
- continue;
- ClasspathUtilCore.addLibraries(model, entryResult);
- }
- addUniqueEntries(result, entryResult);
- }
- return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result
- .size()]);
- }
-
- private void computeClasspath(ModelEntry[] entries, IJavaProject project,
- IProgressMonitor monitor) throws CoreException {
- ArrayList list = new ArrayList();
-
- //The project has the dynamic classpath container for
- // searchable entries + JRE
- list.add(JavaCore.newContainerEntry(new Path(
- PDECore.JAVA_SEARCH_CONTAINER_ID)));
- list.add(JavaCore.newContainerEntry(new Path("org.eclipse.jdt.launching.JRE_CONTAINER"))); //$NON-NLS-1$
- try {
- project.setRawClasspath((IClasspathEntry[]) list
- .toArray(new IClasspathEntry[list.size()]), monitor);
- } catch (JavaModelException e) {
- throwCoreException(e);
- }
- }
-
- private void addUniqueEntries(ArrayList result, ArrayList localResult) {
- ArrayList resultCopy = (ArrayList) result.clone();
- for (int i = 0; i < localResult.size(); i++) {
- IClasspathEntry localEntry = (IClasspathEntry) localResult.get(i);
- boolean duplicate = false;
- for (int j = 0; j < resultCopy.size(); j++) {
- IClasspathEntry entry = (IClasspathEntry) resultCopy.get(j);
- if (entry.getEntryKind() == localEntry.getEntryKind()
- && entry.getContentKind() == localEntry
- .getContentKind()
- && entry.getPath().equals(localEntry.getPath())) {
- duplicate = true;
- break;
- }
- }
- if (!duplicate)
- result.add(localEntry);
- }
- }
-
- private void persistStates(IFile file, String value,
- IProgressMonitor monitor) throws CoreException {
- Properties properties = new Properties();
- properties.setProperty(KEY, value);
- try {
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- properties.store(outStream, ""); //$NON-NLS-1$
- outStream.flush();
- outStream.close();
- ByteArrayInputStream inStream = new ByteArrayInputStream(outStream
- .toByteArray());
- if (file.exists())
- file.setContents(inStream, true, false, monitor);
- else
- file.create(inStream, true, monitor);
- inStream.close();
- } catch (IOException e) {
- throwCoreException(e);
- }
- }
-
- private void throwCoreException(Throwable e) throws CoreException {
- IStatus status = new Status(IStatus.ERROR, PDECore.PLUGIN_ID,
- IStatus.OK, e.getMessage(), e);
- throw new CoreException(status);
- }
-
- private void createProxyProject(IProgressMonitor monitor) {
- IProject project = PDECore.getWorkspace().getRoot().getProject(
- getProxyProjectName());
- if (project.exists())
- return;
- monitor.beginTask("", 5); //$NON-NLS-1$
-
- try {
- project.create(new SubProgressMonitor(monitor, 1));
- project.open(new SubProgressMonitor(monitor, 1));
-
- CoreUtility.addNatureToProject(project, JavaCore.NATURE_ID,
- new SubProgressMonitor(monitor, 1));
- proxyProject = JavaCore.create(project);
- proxyProject.setOutputLocation(project.getFullPath(),
- new SubProgressMonitor(monitor, 1));
- computeClasspath(manager.getEntries(), proxyProject,
- new SubProgressMonitor(monitor, 1));
- } catch (CoreException e) {
- }
- }
-
- private boolean handleDelta(IJavaElementDelta delta) {
- Object element = delta.getElement();
- if (element instanceof IJavaModel) {
- IJavaElementDelta[] projectDeltas = delta.getAffectedChildren();
- for (int i = 0; i < projectDeltas.length; i++) {
- if (handleDelta(projectDeltas[i]))
- break;
- }
- return true;
- }
- if (delta.getElement() instanceof IJavaProject) {
- IJavaProject project = (IJavaProject) delta.getElement();
-
- if (project.equals(proxyProject)
- && delta.getKind() == IJavaElementDelta.REMOVED) {
- manager.searchablePluginsRemoved();
- proxyProject = null;
- return true;
- }
- }
- return false;
- }
-
- public Object createAdapterChild(FileAdapter parent, File file) {
- if (file.isDirectory() == false) {
- String name = file.getName().toLowerCase(Locale.ENGLISH);
- if (name.endsWith(".jar")) { //$NON-NLS-1$
- IPackageFragmentRoot root = findPackageFragmentRoot(file
- .getAbsolutePath());
- if (root != null)
- return root;
- }
- }
- return new FileAdapter(parent, file, this);
- }
-
- private IPackageFragmentRoot findPackageFragmentRoot(String absolutePath) {
- IPath jarPath = new Path(absolutePath);
- // Find in proxy project jars
- if (proxyProject != null) {
- try {
- IPackageFragmentRoot[] roots = proxyProject
- .getAllPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IPackageFragmentRoot root = roots[i];
- IPath path = root.getPath();
- if (path.equals(jarPath))
- return root;
-
- }
- } catch (JavaModelException e) {
- }
- }
- // Find in other plugin (and fragments) projects dependencies
- IPluginModelBase[] pluginModels = PDECore.getDefault()
- .getModelManager().getWorkspaceModels();
- for (int i = 0; i < pluginModels.length; i++) {
- IProject project = pluginModels[i].getUnderlyingResource()
- .getProject();
- IJavaProject javaProject = JavaCore.create(project);
- try {
- IPackageFragmentRoot[] roots = javaProject
- .getAllPackageFragmentRoots();
- for (int j = 0; j < roots.length; j++) {
- IPackageFragmentRoot root = roots[j];
- IPath path = root.getPath();
- if (path.equals(jarPath))
- return root;
- }
- } catch (JavaModelException e) {
- }
- }
-
- return null;
- }
-
- public IJavaProject getProxyProject() {
- return proxyProject;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocation.java
deleted file mode 100644
index 844fbd1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import org.eclipse.core.runtime.IPath;
-
-public class SourceLocation {
- private IPath path;
- private boolean userDefined = true;
-
- public SourceLocation(IPath path) {
- this.path = path;
- }
-
- public IPath getPath() {
- return path;
- }
-
- public void setPath(IPath path) {
- this.path = path;
- }
-
- public boolean isUserDefined() {
- return userDefined;
- }
-
- public void setUserDefined(boolean userDefined) {
- this.userDefined = userDefined;
- }
-
- public String toString() {
- return path.toOSString();
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof SourceLocation) {
- SourceLocation object = (SourceLocation)obj;
- return object.getPath().equals(path);
- }
- return false;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocationManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocationManager.java
deleted file mode 100644
index 333b6e6..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocationManager.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.ISharedPluginModel;
-import org.osgi.framework.Version;
-
-public class SourceLocationManager implements ICoreConstants {
- private SourceLocation[] fExtensionLocations = null;
-
- class SearchResult {
- SearchResult(SourceLocation loc, File file) {
- this.loc = loc;
- this.file = file;
- }
- SourceLocation loc;
- File file;
- }
-
- public SourceLocation[] getUserLocations() {
- ArrayList userLocations = new ArrayList();
- String pref = PDECore.getDefault().getPluginPreferences().getString(P_SOURCE_LOCATIONS);
- if (pref.length() > 0)
- parseSavedSourceLocations(pref, userLocations);
- return (SourceLocation[]) userLocations.toArray(new SourceLocation[userLocations.size()]);
- }
-
- public SourceLocation[] getExtensionLocations() {
- if (fExtensionLocations == null) {
- ArrayList list = new ArrayList();
- ModelEntry[] entries = PDECore.getDefault().getModelManager().getEntries();
- for (int i = 0; i < entries.length; i++) {
- IPluginModelBase model = entries[i].getExternalModel();
- if (model != null)
- processExtensions(model, list);
- }
- fExtensionLocations = (SourceLocation[]) list.toArray(new SourceLocation[list.size()]);
- }
- return fExtensionLocations;
- }
-
- public void setExtensionLocations(SourceLocation[] locations) {
- fExtensionLocations = locations;
- }
-
- public File findSourceFile(IPluginBase pluginBase, IPath sourcePath) {
- IStatus status = PluginVersionIdentifier.validateVersion(pluginBase.getVersion());
- if (status.getSeverity() != IStatus.OK)
- return null;
- IPath relativePath = getRelativePath(pluginBase, sourcePath);
- SearchResult result = findSourceLocation(pluginBase, relativePath);
- return (result != null)? result.file : null;
- }
-
- public IPath findSourcePath(IPluginBase pluginBase, IPath sourcePath) {
- IStatus status = PluginVersionIdentifier.validateVersion(pluginBase.getVersion());
- if (status.getSeverity() != IStatus.OK)
- return null;
- IPath relativePath = getRelativePath(pluginBase, sourcePath);
- SearchResult result = findSourceLocation(pluginBase, relativePath);
- return result == null ? null : result.loc.getPath().append(relativePath);
- }
-
- private IPath getRelativePath(IPluginBase pluginBase, IPath sourcePath) {
- Version vid = new Version(pluginBase.getVersion());
- String pluginDir = pluginBase.getId() + "_" + vid.toString(); //$NON-NLS-1$
- return new Path(pluginDir).append(sourcePath);
- }
-
- public SearchResult findSourceLocation(IPluginBase pluginBase, IPath relativePath) {
- SearchResult result = findSearchResult(getUserLocations(), relativePath);
- return (result != null) ? result : findSearchResult(getExtensionLocations(), relativePath);
- }
-
- private SearchResult findSearchResult(SourceLocation[] locations, IPath sourcePath) {
- for (int i = 0; i < locations.length; i++) {
- IPath fullPath = locations[i].getPath().append(sourcePath);
- File file = fullPath.toFile();
- if (file.exists())
- return new SearchResult(locations[i], file);
- }
- return null;
- }
-
- private SourceLocation parseSourceLocation(String text) {
- String path;
- try {
- text = text.trim();
- int commaIndex = text.lastIndexOf(',');
- if (commaIndex == -1)
- return new SourceLocation(new Path(text));
-
- int atLoc = text.indexOf('@');
- path =
- (atLoc == -1)
- ? text.substring(0, commaIndex)
- : text.substring(atLoc + 1, commaIndex);
- } catch (RuntimeException e) {
- return null;
- }
- return new SourceLocation(new Path(path));
- }
-
- private void parseSavedSourceLocations(String text, ArrayList entries) {
- text = text.replace(File.pathSeparatorChar, ';');
- StringTokenizer stok = new StringTokenizer(text, ";"); //$NON-NLS-1$
- while (stok.hasMoreTokens()) {
- String token = stok.nextToken();
- SourceLocation location = parseSourceLocation(token);
- if (location != null)
- entries.add(location);
- }
- }
-
- public static SourceLocation[] computeSourceLocations(IPluginModelBase[] models) {
- ArrayList result = new ArrayList();
- for (int i = 0; i < models.length; i++) {
- processExtensions(models[i], result);
- }
- return (SourceLocation[])result.toArray(new SourceLocation[result.size()]);
- }
-
- private static void processExtensions(IPluginModelBase model, ArrayList result) {
- IPluginExtension[] extensions = model.getPluginBase().getExtensions();
- for (int j = 0; j < extensions.length; j++) {
- IPluginExtension extension = extensions[j];
- if ((PDECore.getPluginId() + ".source").equals(extension.getPoint())) { //$NON-NLS-1$
- processExtension(extension, result);
- }
- }
- }
-
- private static void processExtension(IPluginExtension extension, ArrayList result) {
- IPluginObject[] children = extension.getChildren();
- for (int j = 0; j < children.length; j++) {
- if (children[j].getName().equals("location")) { //$NON-NLS-1$
- IPluginElement element = (IPluginElement) children[j];
- String pathValue = element.getAttribute("path").getValue(); //$NON-NLS-1$b
- ISharedPluginModel model = extension.getModel();
- IPath path = new Path(model.getInstallLocation()).append(pathValue);
- if (path.toFile().exists()) {
- SourceLocation location = new SourceLocation(path);
- location.setUserDefined(false);
- if (!result.contains(location))
- result.add(location);
- }
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetPlatform.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetPlatform.java
deleted file mode 100644
index 4822b2b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetPlatform.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TreeSet;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.PluginVersionIdentifier;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.eclipse.update.configurator.ConfiguratorUtils;
-import org.eclipse.update.configurator.IPlatformConfiguration;
-
-public class TargetPlatform implements IEnvironmentVariables {
-
- private static final String BOOT_ID = "org.eclipse.core.boot"; //$NON-NLS-1$
-
- static class LocalSite {
- private ArrayList plugins;
- private IPath path;
-
- public LocalSite(IPath path) {
- if (path.getDevice() != null)
- this.path = path.setDevice(path.getDevice().toUpperCase(Locale.ENGLISH));
- else
- this.path = path;
- plugins = new ArrayList();
- }
-
- public IPath getPath() {
- return path;
- }
-
- public URL getURL() throws MalformedURLException {
- return new URL("file:" + path.addTrailingSeparator().toString()); //$NON-NLS-1$
- }
-
- public void add(IPluginModelBase model) {
- plugins.add(model);
- }
-
- public String[] getRelativePluginList() {
- String[] list = new String[plugins.size()];
- for (int i = 0; i < plugins.size(); i++) {
- IPluginModelBase model = (IPluginModelBase) plugins.get(i);
- IPath location = new Path(model.getInstallLocation());
- // defect 37319
- if (location.segmentCount() > 2)
- location = location.removeFirstSegments(location.segmentCount() - 2);
- if (!PDECore.getDefault().getModelManager().isOSGiRuntime()) {
- location = location.append(model.isFragmentModel()
- ? "fragment.xml" //$NON-NLS-1$
- : "plugin.xml"); //$NON-NLS-1$
- }
- //31489 - entry must be relative
- list[i] = location.setDevice(null).makeRelative().toString();
- }
- return list;
- }
- }
-
- public static Properties getConfigIniProperties(String filename) {
- File iniFile = new File(ExternalModelManager.getEclipseHome().toOSString(), filename);
- if (!iniFile.exists())
- return null;
- Properties pini = new Properties();
- try {
- FileInputStream fis = new FileInputStream(iniFile);
- pini.load(fis);
- fis.close();
- return pini;
- } catch (IOException e) {
- }
- return null;
- }
-
- public static String[] createPluginPath() throws CoreException {
- return createPluginPath(PDECore.getDefault().getModelManager().getPlugins());
- }
-
- public static String[] createPluginPath(IPluginModelBase[] models)
- throws CoreException {
- String paths[] = new String[models.length];
- for (int i = 0; i < models.length; i++) {
- paths[i] = models[i].getInstallLocation();
- }
- return paths;
- }
-
-
- public static void createPlatformConfigurationArea(
- Map pluginMap,
- File configDir,
- String brandingPluginID)
- throws CoreException {
- try {
- if (PDECore.getDefault().getModelManager().isOSGiRuntime()) {
- if (pluginMap.containsKey("org.eclipse.update.configurator")) { //$NON-NLS-1$
- savePlatformConfiguration(ConfiguratorUtils.getPlatformConfiguration(null),configDir, pluginMap, brandingPluginID);
- }
- checkPluginPropertiesConsistency(pluginMap, configDir);
- } else {
- savePlatformConfiguration(new PlatformConfiguration(null), new File(configDir, "platform.cfg"), pluginMap, brandingPluginID); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- // Rethrow
- throw e;
- } catch (Exception e) {
- // Wrap everything else in a core exception.
- String message = e.getMessage();
- if (message==null || message.length() == 0)
- message = PDECoreMessages.TargetPlatform_exceptionThrown;
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- PDECore.getPluginId(),
- IStatus.ERROR,
- message,
- e));
- }
- }
-
- private static void checkPluginPropertiesConsistency(Map map, File configDir) {
- File runtimeDir = new File(configDir, "org.eclipse.core.runtime"); //$NON-NLS-1$
- if (runtimeDir.exists() && runtimeDir.isDirectory()) {
- long timestamp = runtimeDir.lastModified();
- Iterator iter = map.values().iterator();
- while (iter.hasNext()) {
- if (hasChanged((IPluginModelBase)iter.next(), timestamp)) {
- CoreUtility.deleteContent(runtimeDir);
- break;
- }
- }
- }
- }
-
- private static boolean hasChanged(IPluginModelBase model, long timestamp) {
- if (model.getUnderlyingResource() != null) {
- File[] files = new File(model.getInstallLocation()).listFiles();
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory())
- continue;
- String name = files[i].getName();
- if (name.startsWith("plugin") && name.endsWith(".properties") //$NON-NLS-1$ //$NON-NLS-2$
- && files[i].lastModified() > timestamp) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static String getBundleURL(String id, Map pluginMap) {
- IPluginModelBase model = (IPluginModelBase)pluginMap.get(id);
- if (model == null)
- return null;
-
- return "file:" + new Path(model.getInstallLocation()).addTrailingSeparator().toString(); //$NON-NLS-1$
- }
-
- private static void savePlatformConfiguration(
- IPlatformConfiguration platformConfiguration,
- File configFile,
- Map pluginMap,
- String primaryFeatureId)
- throws IOException, CoreException, MalformedURLException {
- ArrayList sites = new ArrayList();
-
- // Compute local sites
- Iterator iter = pluginMap.values().iterator();
- while(iter.hasNext()) {
- IPluginModelBase model = (IPluginModelBase)iter.next();
- IPath sitePath = getTransientSitePath(model);
- addToSite(sitePath, model, sites);
- }
-
- IPluginModelBase bootModel = (IPluginModelBase)pluginMap.get(BOOT_ID);
- URL configURL = new URL("file:" + configFile.getPath()); //$NON-NLS-1$
- createConfigurationEntries(platformConfiguration, bootModel, sites);
- if (primaryFeatureId != null)
- createFeatureEntries(platformConfiguration, pluginMap, primaryFeatureId);
- platformConfiguration.refresh();
- platformConfiguration.save(configURL);
-
- if (bootModel!=null) {
- String version = bootModel.getPluginBase().getVersion();
- if (version!=null) {
- PluginVersionIdentifier bootVid = new PluginVersionIdentifier(version);
- PluginVersionIdentifier breakVid = new PluginVersionIdentifier("2.0.3"); //$NON-NLS-1$
- if (breakVid.isGreaterThan(bootVid))
- // Platform configuration version changed in 2.1
- // but the same fix is in 2.0.3.
- // Must switch back to configuration 1.0 for
- // older configurations.
- repairConfigurationVersion(configURL);
- }
- }
- }
-
- private static IPath getTransientSitePath(IPluginModelBase model) {
- return new Path(model.getInstallLocation()).removeLastSegments(2);
- }
-
- private static void repairConfigurationVersion(URL url) throws IOException {
- File file = new File(url.getFile());
- if (file.exists()) {
- Properties p = new Properties();
- FileInputStream fis = new FileInputStream(file);
- p.load(fis);
- p.setProperty("version", "1.0"); //$NON-NLS-1$ //$NON-NLS-2$
- fis.close();
- FileOutputStream fos = new FileOutputStream(file);
- p.store(fos, (new Date()).toString());
- fos.close();
- }
- }
-
- private static void addToSite(
- IPath path,
- IPluginModelBase model,
- ArrayList sites) {
- if (path.getDevice() != null)
- path = path.setDevice(path.getDevice().toUpperCase(Locale.ENGLISH));
- for (int i = 0; i < sites.size(); i++) {
- LocalSite localSite = (LocalSite) sites.get(i);
- if (localSite.getPath().equals(path)) {
- localSite.add(model);
- return;
- }
- }
- // First time - add site
- LocalSite localSite = new LocalSite(path);
- localSite.add(model);
- sites.add(localSite);
- }
-
- private static void createConfigurationEntries(
- IPlatformConfiguration config,
- IPluginModelBase bootModel,
- ArrayList sites)
- throws CoreException, MalformedURLException {
-
- for (int i = 0; i < sites.size(); i++) {
- LocalSite localSite = (LocalSite) sites.get(i);
- String[] plugins = localSite.getRelativePluginList();
-
- int policy = IPlatformConfiguration.ISitePolicy.USER_INCLUDE;
- IPlatformConfiguration.ISitePolicy sitePolicy =
- config.createSitePolicy(policy, plugins);
- IPlatformConfiguration.ISiteEntry siteEntry =
- config.createSiteEntry(localSite.getURL(), sitePolicy);
- config.configureSite(siteEntry);
- }
-
- if (!PDECore.getDefault().getModelManager().isOSGiRuntime()) {
- // Set boot location
- URL bootURL = new URL("file:" + bootModel.getInstallLocation()); //$NON-NLS-1$
- config.setBootstrapPluginLocation(BOOT_ID, bootURL);
- }
- config.isTransient(true);
- }
-
-
- private static void createFeatureEntries(
- IPlatformConfiguration config,
- Map pluginMap,
- String brandingPluginID)
- throws MalformedURLException {
-
- // We have primary feature Id.
- IFeatureModel featureModel = PDECore.getDefault().getFeatureModelManager().findFeatureModel(brandingPluginID);
- if (featureModel == null)
- return;
-
- IFeature feature = featureModel.getFeature();
- String featureVersion = feature.getVersion();
- IPluginModelBase primaryPlugin = (IPluginModelBase)pluginMap.get(brandingPluginID);
- if (primaryPlugin == null)
- return;
-
- URL pluginURL = new URL("file:" + primaryPlugin.getInstallLocation()); //$NON-NLS-1$
- URL[] root = new URL[] { pluginURL };
- IPlatformConfiguration.IFeatureEntry featureEntry =
- config.createFeatureEntry(
- brandingPluginID,
- featureVersion,
- brandingPluginID,
- primaryPlugin.getPluginBase().getVersion(),
- true,
- null,
- root);
- config.configureFeatureEntry(featureEntry);
- }
-
- public static String getOS() {
- String value = getProperty(OS);
- return value.equals("") ? Platform.getOS() : value; //$NON-NLS-1$
- }
-
- public static String getWS() {
- String value = getProperty(WS);
- return value.equals("") ? Platform.getWS() : value; //$NON-NLS-1$
- }
-
- public static String getNL() {
- String value = getProperty(NL);
- return value.equals("") ? Platform.getNL() : value; //$NON-NLS-1$
- }
-
- public static String getOSArch() {
- String value = getProperty(ARCH);
- return value.equals("") ? Platform.getOSArch() : value; //$NON-NLS-1$
- }
-
- private static String getProperty(String key) {
- return PDECore.getDefault().getPluginPreferences().getString(key);
- }
-
- public static String[] getApplicationNames() {
- TreeSet result = new TreeSet();
- IPluginModelBase[] plugins = PDECore.getDefault().getModelManager().getPlugins();
- for (int i = 0; i < plugins.length; i++) {
- IPluginExtension[] extensions = plugins[i].getPluginBase().getExtensions();
- for (int j = 0; j < extensions.length; j++) {
- String point = extensions[j].getPoint();
- if (point != null && point.equals("org.eclipse.core.runtime.applications")) { //$NON-NLS-1$
- String id = extensions[j].getPluginBase().getId();
- if (id == null || id.trim().length() == 0 || id.startsWith("org.eclipse.pde.junit.runtime")) //$NON-NLS-1$
- continue;
- if (extensions[j].getId() != null)
- result.add(id+ "." + extensions[j].getId()); //$NON-NLS-1$
- }
- }
- }
- return (String[])result.toArray(new String[result.size()]);
- }
-
- public static TreeSet getProductNameSet() {
- TreeSet result = new TreeSet();
- IPluginModelBase[] plugins = PDECore.getDefault().getModelManager().getPlugins();
- for (int i = 0; i < plugins.length; i++) {
- IPluginExtension[] extensions = plugins[i].getPluginBase().getExtensions();
- for (int j = 0; j < extensions.length; j++) {
- String point = extensions[j].getPoint();
- if (point != null && point.equals("org.eclipse.core.runtime.products")) {//$NON-NLS-1$
- IPluginObject[] children = extensions[j].getChildren();
- if (children.length != 1)
- continue;
- if (!"product".equals(children[0].getName())) //$NON-NLS-1$
- continue;
- String id = extensions[j].getPluginBase().getId();
- if (id == null || id.trim().length() == 0)
- continue;
- if (extensions[j].getId() != null)
- result.add(id+ "." + extensions[j].getId()); //$NON-NLS-1$
- }
- }
- }
- return result;
- }
-
- public static String[] getProductNames() {
- TreeSet result = getProductNameSet();
- return (String[])result.toArray(new String[result.size()]);
- }
-
- public static Dictionary getTargetEnvironment() {
- Dictionary result = new Hashtable();
- result.put ("osgi.os", TargetPlatform.getOS()); //$NON-NLS-1$
- result.put ("osgi.ws", TargetPlatform.getWS()); //$NON-NLS-1$
- result.put ("osgi.nl", TargetPlatform.getNL()); //$NON-NLS-1$
- result.put ("osgi.arch", TargetPlatform.getOSArch()); //$NON-NLS-1$
- result.put("osgi.resolveOptional", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- return result;
- }
-
- public static boolean isOSGi() {
- return PDECore.getDefault().getModelManager().isOSGiRuntime();
- }
-
- public static String getTargetVersionString() {
- return PDECore.getDefault().getModelManager().getTargetVersion();
- }
-
- public static double getTargetVersion() {
- return Double.parseDouble(getTargetVersionString());
- }
-
- public static PDEState getPDEState() {
- return PDECore.getDefault().getModelManager().getState();
- }
-
- public static State getState() {
- return getPDEState().getState();
- }
-
- public static HashMap getBundleClasspaths(PDEState state) {
- HashMap properties = new HashMap();
- BundleDescription[] bundles = state.getState().getBundles();
- for (int i = 0; i < bundles.length; i++) {
- properties.put(new Long(bundles[i].getBundleId()), getValue(bundles[i], state));
- }
- return properties;
- }
-
- private static String[] getValue(BundleDescription bundle, PDEState state) {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(bundle);
- String[] result = null;
- if (model != null) {
- IPluginLibrary[] libs = model.getPluginBase().getLibraries();
- result = new String[libs.length];
- for (int i = 0; i < libs.length; i++) {
- result[i] = libs[i].getName();
- }
- } else {
- String[] libs = state.getLibraryNames(bundle.getBundleId());
- result = new String[libs.length];
- for (int i = 0; i < libs.length; i++) {
- result[i] = libs[i];
- }
- }
- if (result.length == 0)
- return new String[] {"."}; //$NON-NLS-1$
- return result;
- }
-
- public static String[] getFeaturePaths() {
- IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager().getModels();
- String[] paths = new String[models.length];
- for (int i = 0; i < models.length; i++) {
- paths[i] = models[i].getInstallLocation() + IPath.SEPARATOR + "feature.xml"; //$NON-NLS-1$
- }
- return paths;
- }
-
- /**
- * Obtains product ID
- *
- * @return String or null
- */
- public static String getDefaultProduct() {
- if (getTargetVersion() < 3.0) {
- return null;
- }
- Properties config = getConfigIniProperties("configuration/config.ini"); //$NON-NLS-1$
- if (config != null) {
- String product = (String) config.get("eclipse.product"); //$NON-NLS-1$
- if (product != null && getProductNameSet().contains(product)) {
- return product;
- }
- }
- if (getProductNameSet().contains("org.eclipse.platform.ide")) { //$NON-NLS-1$
- return "org.eclipse.platform.ide"; //$NON-NLS-1$
- }
- return null;
- }
-
- public static boolean isRuntimeRefactored() {
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- return manager.findEntry("org.eclipse.equinox.common") != null; //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetProfileManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetProfileManager.java
deleted file mode 100644
index 1ef0edf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetProfileManager.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.eclipse.pde.internal.core;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionDelta;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IRegistryChangeEvent;
-import org.eclipse.core.runtime.IRegistryChangeListener;
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-public class TargetProfileManager implements IRegistryChangeListener{
-
- Map fTargets;
- private static String[] attributes;
- {
- attributes = new String[] {"id", "name" }; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void registryChanged(IRegistryChangeEvent event) {
- IExtensionDelta[] deltas = event.getExtensionDeltas();
- for (int i = 0; i < deltas.length; i++) {
- IExtension extension = deltas[i].getExtension();
- String extensionId = extension.getExtensionPointUniqueIdentifier();
- if (extensionId.equals("org.eclipse.pde.core.targetProfiles")) { //$NON-NLS-1$
- IConfigurationElement[] elems = extension.getConfigurationElements();
- if (deltas[i].getKind() == IExtensionDelta.ADDED)
- add(elems);
- else
- remove(elems);
- }
- }
- }
-
- public IConfigurationElement[] getTargets() {
- if (fTargets == null)
- loadElements();
- return (IConfigurationElement[])fTargets.values().toArray(new IConfigurationElement[fTargets.size()]);
- }
-
- public IConfigurationElement[] getSortedTargets() {
- if (fTargets == null)
- loadElements();
- IConfigurationElement[] result = (IConfigurationElement[])fTargets.values().toArray(new IConfigurationElement[fTargets.size()]);
- Arrays.sort(result, new Comparator() {
-
- public int compare(Object o1, Object o2) {
- String value1 = getString((IConfigurationElement)o1);
- String value2 = getString((IConfigurationElement)o2);
- return value1.compareTo(value2);
- }
-
- private String getString(IConfigurationElement elem){
- String name = elem.getAttribute("name"); //$NON-NLS-1$
- String id = elem.getAttribute("id"); //$NON-NLS-1$
- name = name + " [" + id + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- return name;
- }
-
- });
- return result;
- }
-
- public IConfigurationElement getTarget(String id) {
- if (fTargets == null)
- loadElements();
- return (IConfigurationElement)fTargets.get(id);
- }
-
- private void loadElements() {
- fTargets = new HashMap();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- registry.addRegistryChangeListener(this);
- IConfigurationElement[] elements = registry.getConfigurationElementsFor("org.eclipse.pde.core.targetProfiles"); //$NON-NLS-1$
- add(elements);
- }
-
- private boolean isValid (IConfigurationElement elem) {
- String value;
- for (int i = 0; i < attributes.length; i++) {
- value = elem.getAttribute(attributes[i]);
- if (value == null || value.equals("")) //$NON-NLS-1$
- return false;
- }
- value = elem.getAttribute("path"); //$NON-NLS-1$
- String symbolicName = elem.getDeclaringExtension().getNamespace();
- URL url = getResourceURL(symbolicName, value);
- try {
- if (url != null && url.openStream().available() > 0)
- return true;
- } catch (IOException e) {
- // file does not exist
- }
- return false;
- }
-
- public static URL getResourceURL(String bundleID, String resourcePath) {
- try {
- Bundle bundle = Platform.getBundle(bundleID);
- if (bundle != null) {
- URL entry = bundle.getEntry(resourcePath);
- if (entry != null)
- return Platform.asLocalURL(entry);
- }
- } catch (IOException e) {
- }
- return null;
- }
-
- private void add(IConfigurationElement[] elems) {
- for (int i = 0; i < elems.length; i++) {
- IConfigurationElement elem = elems[i];
- if (isValid(elem)) {
- String id = elem.getAttribute("id"); //$NON-NLS-1$
- fTargets.put(id, elem);
- }
- }
- }
-
- private void remove(IConfigurationElement[] elems) {
- for (int i = 0 ; i < elems.length; i++) {
- fTargets.remove(elems[i].getAttribute("id")); //$NON-NLS-1$
- }
- }
-
- public void shutdown() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- registry.removeRegistryChangeListener(this);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java
deleted file mode 100644
index edc213e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TracingOptionsManager.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-
-public class TracingOptionsManager {
- private Properties template;
-
- public TracingOptionsManager() {
- super();
- }
-
- private void createTemplate() {
- template = new Properties();
- IPluginModelBase[] models = PDECore.getDefault().getModelManager().getPlugins();
- for (int i = 0; i < models.length; i++) {
- addToTemplate(models[i]);
- }
- }
-
- private void addToTemplate(IPluginModelBase model) {
- Properties modelOptions = getOptions(model);
- if (modelOptions == null)
- return;
- for (Enumeration keys = modelOptions.keys(); keys.hasMoreElements();) {
- String key = keys.nextElement().toString();
- String value = modelOptions.getProperty(key);
- if (key != null && value != null)
- template.setProperty(key, value);
- }
- }
-
- public Hashtable getTemplateTable(String pluginId) {
- if (template == null)
- createTemplate();
- Hashtable defaults = new Hashtable();
- for (Enumeration keys = template.keys(); keys.hasMoreElements();) {
- String key = keys.nextElement().toString();
- if (belongsTo(key, pluginId)) {
- defaults.put(key, template.get(key));
- }
- }
- return defaults;
- }
-
- private boolean belongsTo(String option, String pluginId) {
- IPath path = new Path(option);
- String firstSegment = path.segment(0);
- return pluginId.equalsIgnoreCase(firstSegment);
- }
-
- public Properties getTracingOptions(Map storedOptions) {
- // Start with the fresh template from plugins
- Properties defaults = getTracingTemplateCopy();
- if (storedOptions != null) {
- // Load stored values, but only for existing keys
- Iterator iter = storedOptions.keySet().iterator();
- while (iter.hasNext()) {
- String key = iter.next().toString();
- if (defaults.containsKey(key)) {
- defaults.setProperty(key, (String) storedOptions.get(key));
- }
- }
- }
- return defaults;
- }
-
- public Properties getTracingTemplateCopy() {
- if (template == null)
- createTemplate();
- return (Properties) template.clone();
- }
-
- public static boolean isTraceable(IPluginModelBase model) {
- String location = model.getInstallLocation();
- if (location == null)
- return false;
-
- File pluginLocation = new File(location);
- InputStream stream = null;
- ZipFile jarFile = null;
- try {
- if (pluginLocation.isDirectory())
- return new File(pluginLocation, ".options").exists(); //$NON-NLS-1$
-
- jarFile = new ZipFile(pluginLocation, ZipFile.OPEN_READ);
- ZipEntry manifestEntry = jarFile.getEntry(".options"); //$NON-NLS-1$
- if (manifestEntry != null) {
- stream = jarFile.getInputStream(manifestEntry);
- }
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- try {
- if (stream != null)
- stream.close();
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e) {
- }
- }
- return stream != null;
- }
-
- public void reset() {
- template = null;
- }
-
- private void save(String fileName, Properties properties) {
- try {
- FileOutputStream stream = new FileOutputStream(fileName);
- properties.store(stream, "Master Tracing Options"); //$NON-NLS-1$
- stream.flush();
- stream.close();
- } catch (IOException e) {
- PDECore.logException(e);
- }
- }
-
- public void save(String filename, Map map, HashSet selected) {
- Properties properties = getTracingOptions(map);
- for (Enumeration keys = properties.keys(); keys.hasMoreElements();) {
- String key = keys.nextElement().toString();
- Path path = new Path(key);
- if (path.segmentCount() < 1 || !selected.contains(path.segment(0).toString())) {
- properties.remove(key);
- }
- }
- save(filename, properties);
- }
-
- public void save(String filename, Map map) {
- save(filename, getTracingOptions(map));
- }
-
- private Properties getOptions(IPluginModelBase model) {
- String location = model.getInstallLocation();
- if (location == null)
- return null;
-
- File pluginLocation = new File(location);
- InputStream stream = null;
- ZipFile jarFile = null;
- try {
- if (pluginLocation.isDirectory()) {
- File file = new File(pluginLocation, ".options"); //$NON-NLS-1$
- if (file.exists())
- stream = new FileInputStream(file);
- } else {
- jarFile = new ZipFile(pluginLocation, ZipFile.OPEN_READ);
- ZipEntry manifestEntry = jarFile.getEntry(".options"); //$NON-NLS-1$
- if (manifestEntry != null) {
- stream = jarFile.getInputStream(manifestEntry);
- }
- }
- if (stream != null) {
- Properties modelOptions = new Properties();
- modelOptions.load(stream);
- return modelOptions;
- }
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- try {
- if (stream != null)
- stream.close();
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e) {
- }
- }
- return null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/WorkspaceModelManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/WorkspaceModelManager.java
deleted file mode 100644
index 3c1badb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/WorkspaceModelManager.java
+++ /dev/null
@@ -1,757 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelProviderEvent;
-import org.eclipse.pde.core.IModelProviderListener;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
-import org.eclipse.pde.internal.core.bundle.BundleFragmentModel;
-import org.eclipse.pde.internal.core.bundle.BundlePluginModel;
-import org.eclipse.pde.internal.core.bundle.WorkspaceBundleModel;
-import org.eclipse.pde.internal.core.feature.WorkspaceFeatureModel;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.plugin.WorkspaceExtensionsModel;
-import org.eclipse.pde.internal.core.plugin.WorkspaceFragmentModel;
-import org.eclipse.pde.internal.core.plugin.WorkspacePluginModel;
-import org.eclipse.pde.internal.core.plugin.WorkspacePluginModelBase;
-import org.eclipse.team.core.RepositoryProvider;
-
-public class WorkspaceModelManager
- implements
- IResourceChangeListener,
- IResourceDeltaVisitor {
-
- class ModelChange {
- IModel model;
- int type;
- public ModelChange(IModel model, boolean added) {
- this.model = model;
- this.type = added
- ? IModelProviderEvent.MODELS_ADDED
- : IModelProviderEvent.MODELS_REMOVED;
- }
- public ModelChange(IModel model) {
- this.model = model;
- this.type = IModelProviderEvent.MODELS_CHANGED;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof ModelChange) {
- IProject project = ((ModelChange)obj).model.getUnderlyingResource().getProject();
- return model.getUnderlyingResource().getProject().equals(project);
- }
- return false;
- }
- }
-
- private Map fModels;
- private Map fFragmentModels;
- private Map fFeatureModels;
- private ArrayList fChangedModels;
- private ArrayList fListeners = new ArrayList();
- private boolean fInitialized = false;
- private boolean fModelsLocked;
-
- public static boolean isPluginProject(IProject project) {
- if (project.isOpen())
- return hasBundleManifest(project) || hasPluginManifest(project)
- || hasFragmentManifest(project);
- return false;
- }
-
- public static boolean hasBundleManifest(IProject project) {
- return project.exists(new Path("META-INF/MANIFEST.MF")); //$NON-NLS-1$
- }
-
- public static boolean hasPluginManifest(IProject project) {
- return project.exists(new Path("plugin.xml")); //$NON-NLS-1$
- }
-
- public static boolean hasFragmentManifest(IProject project) {
- return project.exists(new Path("fragment.xml")); //$NON-NLS-1$
- }
-
- public static boolean hasFeatureManifest(IProject project) {
- return project.exists(new Path("feature.xml")); //$NON-NLS-1$
- }
-
- public static boolean isFeatureProject(IProject project) {
- if (project.isOpen())
- return project.exists(new Path("feature.xml")); //$NON-NLS-1$
- return false;
- }
-
- public static boolean isBinaryFeatureProject(IProject project) {
- return isFeatureProject(project) && isBinaryProject(project);
- }
-
- public static boolean isBinaryPluginProject(IProject project) {
- return isPluginProject(project) && isBinaryProject(project);
- }
-
- public static boolean isBinaryProject(IProject project) {
- try {
- String binary = project.getPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY);
- if (binary != null) {
- RepositoryProvider provider = RepositoryProvider.getProvider(project);
- return provider==null || provider instanceof BinaryRepositoryProvider;
- }
- } catch (CoreException e) {
- PDECore.logException(e);
- }
- return false;
- }
-
- public static boolean isNonBinaryPluginProject(IProject project) {
- return isPluginProject(project) && !isBinaryProject(project);
- }
-
- public static boolean isJavaPluginProject(IProject project) {
- if (isPluginProject(project)) {
- try {
- if (project.hasNature(JavaCore.NATURE_ID))
- return true;
- } catch (CoreException e) {
- }
- }
- return false;
- }
-
- public static boolean isUnsharedPluginProject(IProject project) {
- return RepositoryProvider.getProvider(project) == null
- || isBinaryPluginProject(project);
- }
-
- public static URL[] getPluginPaths() {
- ArrayList list = new ArrayList();
- IProject[] projects = PDECore.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- if (isPluginProject(projects[i])) {
- try {
- IPath path = projects[i].getLocation();
- if (path != null) {
- list.add(path.toFile().toURL());
- }
- } catch (MalformedURLException e) {
- }
- }
- }
- return (URL[])list.toArray(new URL[list.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IWorkspaceModelManager#getWorkspaceModel(org.eclipse.core.resources.IProject)
- */
- private IModel getWorkspaceModel(IProject project) {
- initializeWorkspaceModels();
-
- if (hasFeatureManifest(project)){
- return (IModel)fFeatureModels.get(project);
- }
-
- if (hasBundleManifest(project)) {
- IModel model = (IModel)fModels.get(project);
- return (model != null) ? model : (IModel)fFragmentModels.get(project);
- }
-
- if (hasPluginManifest(project))
- return (IModel)fModels.get(project);
-
- if (hasFragmentManifest(project))
- return (IModel)fFragmentModels.get(project);
-
- return null;
- }
-
- protected IPluginModelBase getWorkspacePluginModel(IProject project) {
- IModel model = getWorkspaceModel(project);
- return (model instanceof IPluginModelBase) ? (IPluginModelBase)model : null;
- }
-
- public IFeatureModel getFeatureModel(IProject project) {
- IModel model = getWorkspaceModel(project);
- return (model instanceof IFeatureModel) ? (IFeatureModel)model : null;
- }
-
- private void handleFileDelta(IResourceDelta delta) {
- IFile file = (IFile)delta.getResource();
- if (file.getName().equals(".options")) { //$NON-NLS-1$
- PDECore.getDefault().getTracingOptionsManager().reset();
- return;
- }
- if (file.getName().equals("build.properties") && isPluginProject(file.getProject())) { //$NON-NLS-1$
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- IModel model = getWorkspaceModel(file.getProject());
- if (model != null) {
- ModelChange change = new ModelChange(model);
- if (!fChangedModels.contains(change))
- fChangedModels.add(change);
- }
- return;
- }
-
- if (file.getName().equals("plugin.properties")) { //$NON-NLS-1$
- IProject project = file.getProject();
- if (isPluginProject(project) && !isBinaryPluginProject(project)) {
- IPluginModelBase model = getWorkspacePluginModel(project);
- if (model != null && model instanceof AbstractModel) {
- ((AbstractModel)model).resetNLResourceHelper();
- }
- }
- }
-
- if (file.getName().equals("feature.properties")) { //$NON-NLS-1$
- IProject project = file.getProject();
- if (isFeatureProject(project)) {
- IFeatureModel model = getFeatureModel(project);
- if (model != null && model instanceof AbstractModel) {
- ((AbstractModel)model).resetNLResourceHelper();
- }
- }
- }
-
- if (!isSupportedFile(file))
- return;
-
- int kind = delta.getKind();
- switch (kind) {
- case IResourceDelta.REMOVED:
- handleFileRemoved(file);
- break;
- case IResourceDelta.CHANGED:
- handleFileChanged(file, delta);
- break;
- case IResourceDelta.ADDED:
- handleFileChanged(file, delta);
- }
- }
-
- private void handleFileRemoved(IFile file) {
- IModel model = getWorkspaceModel(file);
- String fileName = file.getName().toLowerCase(Locale.ENGLISH);
- if (model != null) {
- if (model instanceof IBundlePluginModelBase) {
- IBundlePluginModelBase bModel = (IBundlePluginModelBase)model;
- if (fileName.equals("plugin.xml") || fileName.equals("fragment.xml")) { //$NON-NLS-1$ //$NON-NLS-2$
- bModel.setExtensionsModel(null);
- } else {
- removeWorkspaceModel(file.getProject());
- if (bModel.getExtensionsModel() != null)
- switchToPluginMode(bModel);
- }
- } else {
- removeWorkspaceModel(file.getProject());
- }
- }
- }
-
- private void switchToPluginMode(IBundlePluginModelBase bModel) {
- IPluginModelBase model = null;
- IProject project = bModel.getUnderlyingResource().getProject();
- if (bModel instanceof IBundlePluginModel) {
- model = createWorkspacePluginModel(project.getFile("plugin.xml")); //$NON-NLS-1$
- } else {
- model = createWorkspaceFragmentModel(project.getFile("fragment.xml")); //$NON-NLS-1$
- }
-
- if (model != null && model.getPluginBase().getId() != null) {
- if (model instanceof IPluginModel) {
- fModels.put(project, model);
- } else {
- fFragmentModels.put(project, model);
- }
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- fChangedModels.add(new ModelChange(model, true));
- }
- }
-
- private void handleFileChanged(IFile file, IResourceDelta delta) {
- IModel model = getWorkspaceModel(file);
- String filename = file.getName();
- if (model == null) {
- addWorkspaceModel(file.getProject(), true);
- } else if (delta.getKind() == IResourceDelta.ADDED) {
- if (model instanceof WorkspacePluginModelBase && filename.equals("MANIFEST.MF")) { //$NON-NLS-1$
- addWorkspaceModel(file.getProject(), true);
- } else if (model instanceof IBundlePluginModelBase && (filename.equals("plugin.xml") || filename.equals("fragment.xml"))) { //$NON-NLS-1$ //$NON-NLS-2$
- WorkspaceExtensionsModel extensions = new WorkspaceExtensionsModel(file);
- ((IBundlePluginModelBase)model).setExtensionsModel(extensions);
- extensions.setBundleModel((IBundlePluginModelBase)model);
- loadModel(extensions, false);
- // no need to fire any notifications if the plugin.xml/fragment.xml
- // of a bundle is modified.
- return;
- }
- } else if ((IResourceDelta.CONTENT & delta.getFlags()) != 0) {
- if (model instanceof IBundlePluginModelBase) {
- if (isBundleManifestFile(file)) {
- loadModel(((IBundlePluginModelBase)model).getBundleModel(), true);
- } else {
- ISharedExtensionsModel extensions = ((IBundlePluginModelBase)model).getExtensionsModel();
- boolean reload = extensions != null;
- if (extensions == null) {
- extensions = new WorkspaceExtensionsModel(file);
- ((IBundlePluginModelBase)model).setExtensionsModel(extensions);
- ((WorkspaceExtensionsModel)extensions).setBundleModel((IBundlePluginModelBase)model);
- }
- loadModel(extensions, reload);
- // no need to fire any notifications if the plugin.xml/fragment.xml
- // of a bundle is modified.
- return;
- }
- } else {
- loadModel(model, true);
- }
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- ModelChange change = new ModelChange(model);
- if (!fChangedModels.contains(change))
- fChangedModels.add(change);
- }
- }
-
- private boolean isSupportedFile(IFile file) {
- if (isBundleManifestFile(file))
- return true;
- String name = file.getName().toLowerCase(Locale.ENGLISH);
- if (!name.equals("plugin.xml") && !name.equals("fragment.xml") //$NON-NLS-1$ //$NON-NLS-2$
- && !name.equals("feature.xml")) //$NON-NLS-1$
- return false;
- IPath expectedPath = file.getProject().getFullPath().append(name);
- return expectedPath.equals(file.getFullPath());
- }
-
-
- private boolean isBundleManifestFile(IFile file) {
- IPath path = file.getProjectRelativePath();
- return (
- path.segmentCount() == 2
- && path.segment(0).equals("META-INF") //$NON-NLS-1$
- && path.segment(1).equals("MANIFEST.MF")); //$NON-NLS-1$
- }
-
- private IModel getWorkspaceModel(IFile file) {
- IProject project = file.getProject();
- if (isBundleManifestFile(file)) {
- IModel model = (IModel)fModels.get(project);
- return (model != null) ? model : (IModel)fFragmentModels.get(project);
- }
- IPath path = file.getProjectRelativePath();
- if (path.equals(new Path("plugin.xml"))) //$NON-NLS-1$
- return (IModel)fModels.get(project);
- if (path.equals(new Path("fragment.xml"))) //$NON-NLS-1$
- return (IModel)fFragmentModels.get(project);
- if (path.equals(new Path("feature.xml"))) //$NON-NLS-1$
- return (IModel)fFeatureModels.get(project);
- return null;
- }
-
- protected void initializeModels(IPluginModelBase[] models) {
- fModels = Collections.synchronizedMap(new HashMap());
- fFragmentModels = Collections.synchronizedMap(new HashMap());
- fFeatureModels = Collections.synchronizedMap(new HashMap());
-
- for (int i = 0; i < models.length; i++) {
- IProject project = models[i].getUnderlyingResource().getProject();
- if (models[i] instanceof IPluginModel) {
- fModels.put(project, models[i]);
- } else {
- fFragmentModels.put(project, models[i]);
- }
- }
- fFeatureModels = Collections.synchronizedMap(new HashMap());
-
- IWorkspace workspace = PDECore.getWorkspace();
- IProject[] projects = workspace.getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- if (!isFeatureProject(project))
- continue;
- addWorkspaceModel(project, false);
- }
-
- PDECore.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_CLOSE);
- JavaCore.addPreProcessingResourceChangedListener(this, IResourceChangeEvent.POST_CHANGE);
- fInitialized = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelManager#getAllModels()
- */
- protected IPluginModelBase[] getAllModels() {
- initializeWorkspaceModels();
-
- ArrayList result = new ArrayList();
- Iterator iter = fModels.values().iterator();
- while (iter.hasNext()) {
- result.add(iter.next());
- }
-
- iter = fFragmentModels.values().iterator();
- while (iter.hasNext()) {
- result.add(iter.next());
- }
- return (IPluginModelBase[]) result.toArray(
- new IPluginModelBase[result.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelProvider#removeModelProviderListener(org.eclipse.pde.core.IModelProviderListener)
- */
- public void removeModelProviderListener(IModelProviderListener listener) {
- fListeners.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelProvider#addModelProviderListener(org.eclipse.pde.core.IModelProviderListener)
- */
- public void addModelProviderListener(IModelProviderListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE :
- handleResourceDelta(event.getDelta());
- processModelChanges();
- break;
- case IResourceChangeEvent.PRE_CLOSE :
- IProject project = (IProject)event.getResource();
- removeWorkspaceModel(project);
- processModelChanges();
- break;
- }
- }
- /**
- * @param project
- */
- private void removeWorkspaceModel(IProject project) {
- IModel model = null;
- if (fModels.containsKey(project)) {
- model = (IModel)fModels.remove(project);
- } else if (fFragmentModels.containsKey(project)) {
- model = (IModel)fFragmentModels.remove(project);
- } else {
- model = (IModel)fFeatureModels.remove(project);
- }
- if (model != null) {
- if (model instanceof IPluginModelBase) {
- PDECore.getDefault().getTracingOptionsManager().reset();
- }
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- fChangedModels.add(new ModelChange(model, false));
- }
- }
-
- /**
- * @param delta
- */
- private void handleResourceDelta(IResourceDelta delta) {
- try {
- delta.accept(this);
- } catch (CoreException e) {
- PDECore.logException(e);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) throws CoreException {
- if (delta != null) {
- IResource resource = delta.getResource();
- if (resource instanceof IProject) {
- IProject project = (IProject) resource;
- if (delta.getKind() == IResourceDelta.ADDED || (project.isOpen() && (delta.getFlags()&IResourceDelta.OPEN) != 0)) {
- addWorkspaceModel(project, true);
- return false;
- } else if (delta.getKind() == IResourceDelta.REMOVED) {
- removeWorkspaceModel(project);
- return false;
- }
- return true;
- } else if (resource instanceof IFile) {
- handleFileDelta(delta);
- } else if (resource instanceof IFolder) {
- return resource.getName().equals("META-INF"); //$NON-NLS-1$
- }
- }
- return true;
- }
-
- private synchronized void initializeWorkspaceModels() {
- if (fInitialized || fModelsLocked)
- return;
- fModelsLocked = true;
- fModels = Collections.synchronizedMap(new HashMap());
- fFragmentModels = Collections.synchronizedMap(new HashMap());
- fFeatureModels = Collections.synchronizedMap(new HashMap());
-
- IWorkspace workspace = PDECore.getWorkspace();
- IProject[] projects = workspace.getRoot().getProjects();
-
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- if (isPluginProject(project) || isFeatureProject(project))
- addWorkspaceModel(project, false);
- }
-
- workspace.addResourceChangeListener(this, IResourceChangeEvent.PRE_CLOSE);
- JavaCore.addPreProcessingResourceChangedListener(this, IResourceChangeEvent.POST_CHANGE);
-
- fModelsLocked = false;
- fInitialized = true;
- }
-
- /**
- * @param project
- * @return
- */
- private IFeatureModel createFeatureModel(IFile file) {
- if (!file.exists())
- return null;
-
- WorkspaceFeatureModel model = new WorkspaceFeatureModel(file);
- loadModel(model, false);
- return model;
- }
-
- private IPluginModelBase createPluginModel(IProject project) {
- if (hasBundleManifest(project))
- return createWorkspaceBundleModel(project.getFile("META-INF/MANIFEST.MF")); //$NON-NLS-1$
-
- if (hasPluginManifest(project))
- return createWorkspacePluginModel(project.getFile("plugin.xml")); //$NON-NLS-1$
-
- return createWorkspaceFragmentModel(project.getFile("fragment.xml")); //$NON-NLS-1$
- }
-
- /**
- * @param file
- * @return
- */
- private IPluginModelBase createWorkspacePluginModel(IFile file) {
- if (!file.exists())
- return null;
-
- WorkspacePluginModel model = new WorkspacePluginModel(file, true);
- loadModel(model, false);
- return model;
- }
-
- /**
- * @param file
- * @return
- */
- private IPluginModelBase createWorkspaceFragmentModel(IFile file) {
- if (!file.exists())
- return null;
-
- WorkspaceFragmentModel model = new WorkspaceFragmentModel(file, true);
- loadModel(model, false);
- return model;
- }
-
- /**
- * @param file
- * @return
- */
- private IPluginModelBase createWorkspaceBundleModel(IFile file) {
- if (!file.exists())
- return null;
-
- WorkspaceBundleModel model = new WorkspaceBundleModel(file);
- loadModel(model, false);
-
- IBundlePluginModelBase bmodel = null;
- boolean fragment = model.isFragmentModel();
- if (fragment)
- bmodel = new BundleFragmentModel();
- else
- bmodel = new BundlePluginModel();
- bmodel.setEnabled(true);
- bmodel.setBundleModel(model);
-
- IFile efile = file.getProject().getFile(fragment ? "fragment.xml" : "plugin.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- if (efile.exists()) {
- WorkspaceExtensionsModel extModel = new WorkspaceExtensionsModel(efile);
- loadModel(extModel, false);
- bmodel.setExtensionsModel(extModel);
- extModel.setBundleModel(bmodel);
- }
- return bmodel;
- }
-
- private void loadModel(IModel model, boolean reload) {
- IFile file = (IFile) model.getUnderlyingResource();
- try {
- InputStream stream = file.getContents(true);
- if (reload)
- model.reload(stream, false);
- else
- model.load(stream, false);
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- return;
- } catch (IOException e) {
- }
- }
-
- /**
- * @param project
- */
- private void addWorkspaceModel(IProject project, boolean notify) {
- IModel model = null;
- if (isPluginProject(project)) {
- model = createPluginModel(project);
- if (model != null) {
- if (model instanceof IFragmentModel)
- fFragmentModels.put(project, model);
- else
- fModels.put(project, model);
- if (notify) {
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- fChangedModels.add(new ModelChange(model, true));
- }
- if (project.getFile(".options").exists()) //$NON-NLS-1$
- PDECore.getDefault().getTracingOptionsManager().reset();
- }
- } else if (isFeatureProject(project) && !fFeatureModels.containsKey(project)) {
- model = createFeatureModel(project.getFile("feature.xml")); //$NON-NLS-1$
- if (model != null) {
- fFeatureModels.put(project, model);
- if (notify) {
- if (fChangedModels == null)
- fChangedModels = new ArrayList();
- fChangedModels.add(new ModelChange(model, true));
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelManager#getFeatureModels()
- */
- public IFeatureModel[] getFeatureModels() {
- initializeWorkspaceModels();
- return (IFeatureModel[]) fFeatureModels.values().toArray(new IFeatureModel[fFeatureModels.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelManager#shutdown()
- */
- public void shutdown() {
- PDECore.getWorkspace().removeResourceChangeListener(this);
- JavaCore.removePreProcessingResourceChangedListener(this);
- }
-
- private void processModelChanges() {
- if (fChangedModels == null)
- return;
-
- if (fChangedModels.size() == 0) {
- fChangedModels = null;
- return;
- }
-
- Vector added = new Vector();
- Vector removed = new Vector();
- Vector changed = new Vector();
- for (int i = 0; i < fChangedModels.size(); i++) {
- ModelChange change = (ModelChange) fChangedModels.get(i);
- switch (change.type) {
- case IModelProviderEvent.MODELS_ADDED:
- added.add(change.model);
- break;
- case IModelProviderEvent.MODELS_REMOVED:
- removed.add(change.model);
- break;
- case IModelProviderEvent.MODELS_CHANGED:
- changed.add(change.model);
- }
- }
- IModel[] addedArray =
- added.size() > 0
- ? (IModel[]) added.toArray(new IModel[added.size()])
- : (IModel[]) null;
- IModel[] removedArray =
- removed.size() > 0
- ? (IModel[]) removed.toArray(new IModel[removed.size()])
- : (IModel[]) null;
- IModel[] changedArray =
- changed.size() > 0
- ? (IModel[]) changed.toArray(new IModel[changed.size()])
- : (IModel[]) null;
- int type = 0;
- if (addedArray != null)
- type |= IModelProviderEvent.MODELS_ADDED;
- if (removedArray != null)
- type |= IModelProviderEvent.MODELS_REMOVED;
- if (changedArray != null)
- type |= IModelProviderEvent.MODELS_CHANGED;
-
- fChangedModels = null;
- if (type != 0) {
- final ModelProviderEvent event =
- new ModelProviderEvent(
- this,
- type,
- addedArray,
- removedArray,
- changedArray);
- fireModelProviderEvent(event);
- }
- }
-
- private void fireModelProviderEvent(ModelProviderEvent event) {
- for (Iterator iter = fListeners.iterator(); iter.hasNext();) {
- ((IModelProviderListener) iter.next()).modelsChanged(event);
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLDefaultHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLDefaultHandler.java
deleted file mode 100644
index 0371abe..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLDefaultHandler.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core;
-
-import java.util.Stack;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class XMLDefaultHandler extends DefaultHandler {
-
- private org.w3c.dom.Document fDocument;
- private Element fRootElement;
-
- private Stack fElementStack = new Stack();
-
- public XMLDefaultHandler() {
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException {
- Element element = fDocument.createElement(qName);
- for (int i = 0; i < attributes.getLength(); i++) {
- element.setAttribute(attributes.getQName(i), attributes.getValue(i));
- }
-
- if (fRootElement == null)
- fRootElement = element;
- else
- ((Element)fElementStack.peek()).appendChild(element);
- fElementStack.push(element);
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException {
- fElementStack.pop();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- fDocument = factory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- fDocument.appendChild(fRootElement);
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#processingInstruction(java.lang.String, java.lang.String)
- */
- public void processingInstruction(String target, String data) throws SAXException {
- fDocument.appendChild(fDocument.createProcessingInstruction(target, data));
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
- */
- public void characters(char[] characters, int start, int length) throws SAXException {
- StringBuffer buff = new StringBuffer();
- for (int i = 0; i < length; i++) {
- buff.append(characters[start + i]);
- }
- Text text = fDocument.createTextNode(buff.toString());
- if (fRootElement == null)
- fDocument.appendChild(text);
- else
- ((Element)fElementStack.peek()).appendChild(text);
- }
-
- public Node getDocumentElement() {
- fDocument.getDocumentElement().normalize();
- return fDocument.getDocumentElement();
- }
-
- public org.w3c.dom.Document getDocument() {
- fDocument.getDocumentElement().normalize();
- return fDocument;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLPrintHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLPrintHandler.java
deleted file mode 100644
index c268baf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/XMLPrintHandler.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.core;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class XMLPrintHandler {
- // used to print XML file
- public static final String XML_COMMENT_END_TAG = "-->"; //$NON-NLS-1$
- public static final String XML_COMMENT_BEGIN_TAG = "<!--"; //$NON-NLS-1$
- public static final String XML_HEAD = "<?xml version=\"1.0\" encoding=\""; //$NON-NLS-1$
- public static final String XML_HEAD_END_TAG = "?>"; //$NON-NLS-1$
- public static final String XML_DBL_QUOTES = "\""; //$NON-NLS-1$
- public static final String XML_SPACE = " "; //$NON-NLS-1$
- public static final String XML_BEGIN_TAG = "<"; //$NON-NLS-1$
- public static final String XML_END_TAG = ">"; //$NON-NLS-1$
- public static final String XML_EQUAL = "="; //$NON-NLS-1$
- public static final String XML_SLASH = "/"; //$NON-NLS-1$
-
- public static void printBeginElement(Writer xmlWriter, String elementString, String indent, boolean terminate) throws IOException{
- StringBuffer temp = new StringBuffer(indent);
- temp.append(XML_BEGIN_TAG);
- temp.append(elementString);
- if (terminate)
- temp.append(XML_SLASH);
- temp.append(XML_END_TAG);
- temp.append("\n"); //$NON-NLS-1$
- xmlWriter.write(temp.toString());
-
- }
-
- public static void printEndElement(Writer xmlWriter, String elementString, String indent) throws IOException{
- StringBuffer temp = new StringBuffer(indent);
- temp.append(XML_BEGIN_TAG);
- temp.append(XML_SLASH).append(elementString).append(XML_END_TAG).append("\n"); //$NON-NLS-1$
- xmlWriter.write(temp.toString());
-
- }
-
- public static void printText(Writer xmlWriter, String text) throws IOException{
- xmlWriter.write(encode(text).toString());
- }
-
- public static void printComment(Writer xmlWriter, String comment)throws IOException {
- StringBuffer temp = new StringBuffer(XML_COMMENT_BEGIN_TAG);
- temp.append(encode(comment).toString()).append(XML_COMMENT_END_TAG).append("\n"); //$NON-NLS-1$
- xmlWriter.write(temp.toString());
- }
-
- public static void printHead(Writer xmlWriter, String encoding) throws IOException {
- StringBuffer temp = new StringBuffer(XML_HEAD);
- temp.append(encoding).append(XML_DBL_QUOTES).append(XML_HEAD_END_TAG).append("\n"); //$NON-NLS-1$
- xmlWriter.write(temp.toString());
- }
-
- public static String wrapAttributeForPrint(String attribute, String value) throws IOException {
- StringBuffer temp = new StringBuffer(XML_SPACE);
- temp.append(attribute).append(XML_EQUAL).append(XML_DBL_QUOTES)
- .append(encode(value).toString()).append(XML_DBL_QUOTES);
- return temp.toString();
-
- }
-
- public static void printNode(Writer xmlWriter, Node node,String encoding, String indent) throws IOException {
- if (node == null) {
- return;
- }
-
- switch (node.getNodeType()) {
- case Node.DOCUMENT_NODE: {
- printHead(xmlWriter,encoding);
- printNode(xmlWriter, ((Document) node).getDocumentElement(),encoding, indent);
- break;
- }
- case Node.ELEMENT_NODE: {
- //get the attribute list for this node.
- StringBuffer tempElementString = new StringBuffer(node.getNodeName());
- NamedNodeMap attributeList = node.getAttributes();
- if ( attributeList != null ) {
- for(int i= 0; i <attributeList.getLength();i++){
- Node attribute = attributeList.item(i);
- tempElementString.append(wrapAttributeForPrint(attribute.getNodeName(),attribute.getNodeValue()));
- }
- }
-
- // do this recursively for the child nodes.
- NodeList childNodes = node.getChildNodes();
- int length = childNodes.getLength();
- printBeginElement(xmlWriter,tempElementString.toString(), indent, length == 0);
-
- for (int i = 0; i < length; i++)
- printNode(xmlWriter, childNodes.item(i),encoding, indent + "\t"); //$NON-NLS-1$
-
- if (length > 0)
- printEndElement(xmlWriter,node.getNodeName(), indent);
- break;
- }
-
- case Node.TEXT_NODE: {
- xmlWriter.write(encode(node.getNodeValue()).toString());
- break;
- }
- default: {
- throw new UnsupportedOperationException("Unsupported XML Node Type."); //$NON-NLS-1$
- }
- }
-
- }
-
- public static StringBuffer encode(String value) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < value.length(); i++) {
- char c = value.charAt(i);
- switch (c) {
- case '&' :
- buf.append("&"); //$NON-NLS-1$
- break;
- case '<' :
- buf.append("<"); //$NON-NLS-1$
- break;
- case '>' :
- buf.append(">"); //$NON-NLS-1$
- break;
- case '\'' :
- buf.append("'"); //$NON-NLS-1$
- break;
- case '\"' :
- buf.append("""); //$NON-NLS-1$
- break;
- default :
- buf.append(c);
- break;
- }
- }
- return buf;
- }
-
- public static void writeFile(Document doc, File file) throws IOException {
- Writer writer = null;
- OutputStream out = null;
- try {
- out = new FileOutputStream(file);
- writer = new OutputStreamWriter(out, "UTF-8"); //$NON-NLS-1$
- XMLPrintHandler.printNode(writer, doc, "UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- try {
- if (writer != null)
- writer.close();
- } catch (IOException e1) {
- }
- try {
- if (out != null)
- out.close();
- } catch (IOException e1) {
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/Build.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/Build.java
deleted file mode 100644
index 99bb7c6..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/Build.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildEntry;
-
-public class Build extends BuildObject implements IBuild {
- protected ArrayList fEntries = new ArrayList();
-
- public void add(IBuildEntry entry) throws CoreException {
- ensureModelEditable();
- fEntries.add(entry);
- ((BuildEntry) entry).setInTheModel(true);
- getModel().fireModelChanged(
- new ModelChangedEvent(getModel(), IModelChangedEvent.INSERT,
- new Object[] { entry }, null));
- }
-
- public IBuildEntry[] getBuildEntries() {
- return (IBuildEntry[])fEntries.toArray(new IBuildEntry[fEntries.size()]);
- }
-
- public IBuildEntry getEntry(String name) {
- for (int i = 0; i < fEntries.size(); i++) {
- IBuildEntry entry = (IBuildEntry) fEntries.get(i);
- if (entry.getName().equals(name))
- return entry;
- }
- return null;
- }
-
- public void processEntry(String name, String value) {
- BuildEntry entry = (BuildEntry) getModel().getFactory().createEntry(
- name);
- fEntries.add(entry);
- entry.processEntry(value);
- }
-
- public void remove(IBuildEntry entry) throws CoreException {
- ensureModelEditable();
- fEntries.remove(entry);
- getModel().fireModelChanged(
- new ModelChangedEvent(getModel(), IModelChangedEvent.REMOVE,
- new Object[] { entry }, null));
- }
-
- public void reset() {
- fEntries.clear();
- }
-
- public void write(String indent, PrintWriter writer) {
- for (int i = 0; i < fEntries.size(); i++) {
- IBuildEntry entry = (IBuildEntry) fEntries.get(i);
- entry.write("", writer); //$NON-NLS-1$
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildEntry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildEntry.java
deleted file mode 100644
index e717aef..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildEntry.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-import java.io.PrintWriter;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.internal.core.util.PropertiesUtil;
-public class BuildEntry extends BuildObject implements IBuildEntry {
- private Vector tokens = new Vector();
- private String name;
- public BuildEntry(String name) {
- this.name = name;
- }
- public void addToken(String token) throws CoreException {
- ensureModelEditable();
- tokens.add(token);
- getModel().fireModelChanged(
- new ModelChangedEvent(getModel(), IModelChangedEvent.INSERT,
- new Object[]{token}, null));
- }
- public String getName() {
- return name;
- }
- public String[] getTokens() {
- String[] result = new String[tokens.size()];
- tokens.copyInto(result);
- return result;
- }
- public boolean contains(String token) {
- return tokens.contains(token);
- }
- void processEntry(String value) {
- StringTokenizer stok = new StringTokenizer(value, ","); //$NON-NLS-1$
- while (stok.hasMoreTokens()) {
- String token = stok.nextToken();
- token = token.trim();
- tokens.add(token);
- }
- }
- public void removeToken(String token) throws CoreException {
- ensureModelEditable();
- tokens.remove(token);
- getModel().fireModelChanged(
- new ModelChangedEvent(getModel(), IModelChangedEvent.REMOVE,
- new Object[]{token}, null));
- }
- public void renameToken(String oldName, String newName)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < tokens.size(); i++) {
- if (tokens.elementAt(i).toString().equals(oldName)) {
- tokens.setElementAt(newName, i);
- break;
- }
- }
- getModel().fireModelChanged(
- new ModelChangedEvent(getModel(), IModelChangedEvent.CHANGE,
- new Object[]{oldName}, null));
- }
- public void setName(String name) throws CoreException {
- ensureModelEditable();
- String oldValue = this.name;
- this.name = name;
- getModel().fireModelObjectChanged(this, P_NAME, oldValue, name);
- }
- public String toString() {
- return name;
- }
- public void write(String indent, PrintWriter writer) {
- PropertiesUtil.writeKeyValuePair(indent, name, tokens.elements(),
- writer);
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_NAME)) {
- setName(newValue != null ? newValue.toString() : null);
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModel.java
deleted file mode 100644
index 5ade221..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModel.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.build.IBuildModelFactory;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDECore;
-
-public abstract class BuildModel extends AbstractModel implements IBuildModel {
- protected Build fBuild;
-
- private BuildModelFactory fFactory;
-
- public IBuild getBuild() {
- if (isLoaded() == false)
- load();
- return fBuild;
- }
-
- public IBuild getBuild(boolean createIfMissing) {
- if (fBuild == null && createIfMissing) {
- fBuild = new Build();
- fBuild.setModel(this);
- setLoaded(true);
- }
- return getBuild();
- }
-
- public IBuildModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new BuildModelFactory(this);
- return fFactory;
- }
-
- public abstract void load();
-
- public void load(InputStream source, boolean outOfSync) {
- Properties properties = new Properties();
- try {
- properties.load(source);
- if (!outOfSync)
- updateTimeStamp();
- } catch (IOException e) {
- PDECore.logException(e);
- return;
- }
- fBuild = new Build();
- fBuild.setModel(this);
- for (Enumeration names = properties.propertyNames(); names.hasMoreElements();) {
- String name = names.nextElement().toString();
- fBuild.processEntry(name, (String) properties.get(name));
- }
- setLoaded(true);
- }
-
- public void reload(InputStream source, boolean outOfSync) {
- if (fBuild != null)
- fBuild.reset();
- else {
- fBuild = new Build();
- fBuild.setModel(this);
- }
- load(source, outOfSync);
- fireModelChanged(new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED, new Object[0], null));
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModelFactory.java
deleted file mode 100644
index 7758d9f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildModelFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.build.IBuildModelFactory;
-
-public class BuildModelFactory implements IBuildModelFactory {
- private IBuildModel model;
-
-public BuildModelFactory(IBuildModel model) {
- this.model = model;
-}
-public IBuildEntry createEntry(String name) {
- BuildEntry entry = new BuildEntry(name);
- entry.setModel(model);
- return entry;
-}
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildObject.java
deleted file mode 100644
index 4a4d9e4..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/BuildObject.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-
-public class BuildObject implements IBuildObject {
- private IBuildModel fModel;
-
- private boolean fInTheModel;
-
- public boolean isInTheModel() {
- return fInTheModel;
- }
-
- public void setInTheModel(boolean inTheModel) {
- fInTheModel = inTheModel;
- }
-
- protected void ensureModelEditable() throws CoreException {
- if (!fModel.isEditable()) {
- throwCoreException(PDECoreMessages.BuildObject_readOnlyException);
- }
- }
-
- public IBuildModel getModel() {
- return fModel;
- }
-
- void setModel(IBuildModel model) {
- fModel = model;
- }
-
- protected void throwCoreException(String message) throws CoreException {
- Status status = new Status(IStatus.ERROR, PDECore.getPluginId(),
- IStatus.OK, message, null);
- throw new CoreException(status);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/ExternalBuildModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/ExternalBuildModel.java
deleted file mode 100644
index 51e43b2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/ExternalBuildModel.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-
-public class ExternalBuildModel extends BuildModel {
-
- private static final long serialVersionUID = 1L;
- private String fInstallLocation;
-
- public ExternalBuildModel(String installLocation) {
- fInstallLocation = installLocation;
- }
-
- public String getInstallLocation() {
- return fInstallLocation;
- }
-
- public boolean isEditable() {
- return false;
- }
-
- public void load() {
- try {
- URL url = null;
- File file = new File(getInstallLocation());
- if (file.isFile() && file.getName().endsWith(".jar")) { //$NON-NLS-1$
- url = new URL("jar:file:" + file.getAbsolutePath() + "!/build.properties"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- url = new URL("file:" + file.getAbsolutePath() + Path.SEPARATOR + "build.properties"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- InputStream stream = url.openStream();
- load(stream, false);
- stream.close();
- } catch (IOException e) {
- fBuild = new Build();
- fBuild.setModel(this);
- setLoaded(true);
- }
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(getLocalFile());
- }
-
- private File getLocalFile() {
- File file = new File(getInstallLocation());
- return (file.isFile()) ? file : new File(file, "build.properties"); //$NON-NLS-1$
- }
-
- public boolean isInSync() {
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/IBuildObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/IBuildObject.java
deleted file mode 100644
index 259559e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/IBuildObject.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-/**
- *
- */
-public interface IBuildObject {
- boolean isInTheModel();
- void setInTheModel(boolean inTheModel);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/WorkspaceBuildModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/WorkspaceBuildModel.java
deleted file mode 100644
index 12b4e78..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/build/WorkspaceBuildModel.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.build;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-
-public class WorkspaceBuildModel extends BuildModel implements IEditableModel {
- private static final long serialVersionUID = 1L;
- private IFile fUnderlyingResource;
- private boolean fDirty;
- private boolean fEditable = true;
-
- public WorkspaceBuildModel(IFile file) {
- fUnderlyingResource = file;
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(event.getChangeType() != IModelChangedEvent.WORLD_CHANGED);
- super.fireModelChanged(event);
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- writer.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
- public IResource getUnderlyingResource() {
- return fUnderlyingResource;
- }
-
- public boolean isDirty() {
- return fDirty;
- }
-
- public boolean isEditable() {
- return fEditable;
- }
-
- public void load() {
- if (fUnderlyingResource.exists()) {
- try {
- InputStream stream = fUnderlyingResource.getContents(true);
- load(stream, false);
- stream.close();
- } catch (Exception e) {
- PDECore.logException(e);
- }
- } else {
- fBuild = new Build();
- fBuild.setModel(this);
- setLoaded(true);
- }
- }
-
- public boolean isInSync() {
- return true;
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(fUnderlyingResource.getLocation().toFile());
- }
-
- public void save() {
- if (fUnderlyingResource == null)
- return;
- try {
- String contents = getContents();
- ByteArrayInputStream stream = new ByteArrayInputStream(contents
- .getBytes("8859_1")); //$NON-NLS-1$
- if (fUnderlyingResource.exists()) {
- fUnderlyingResource.setContents(stream, false, false, null);
- } else {
- fUnderlyingResource.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
-
- public void save(PrintWriter writer) {
- getBuild().write("", writer); //$NON-NLS-1$
- fDirty = false;
- }
-
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- public void setEditable(boolean editable) {
- fEditable = editable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildModel#getInstallLocation()
- */
- public String getInstallLocation() {
- return fUnderlyingResource.getLocation().toOSString();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/Bundle.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/Bundle.java
deleted file mode 100644
index b930b1d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/Bundle.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import java.util.Properties;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.eclipse.pde.internal.core.text.bundle.ManifestHeader;
-import org.osgi.framework.Constants;
-
-public class Bundle extends BundleObject implements IBundle {
- private static final long serialVersionUID = 1L;
- private Properties fProperties;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundle#setHeader(java.lang.String, java.lang.String)
- */
- public void setHeader(String key, String value) {
- if (fProperties == null)
- fProperties = new Properties();
- Object oldValue = fProperties.get(key);
- if (value == null || value.trim().length() == 0)
- fProperties.remove(key);
- else
- fProperties.put(key, value);
- getModel().fireModelObjectChanged(this, key, oldValue, value);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundle#getHeader(java.lang.String)
- */
- public String getHeader(String key) {
- if (fProperties == null) {
- return null;
- }
- return (String)fProperties.get(key);
- }
-
- public void load(Properties properties) {
- fProperties = properties;
- }
-
- public String getLocalization() {
- return getHeader(Constants.BUNDLE_LOCALIZATION);
- }
-
- public void setLocalization(String localization) {
- setHeader(Constants.BUNDLE_LOCALIZATION, localization);
- }
-
- public void renameHeader(String key, String newKey) {
- if (fProperties == null)
- fProperties = new Properties();
- if (fProperties.containsKey(key)) {
- fProperties.put(newKey, fProperties.remove(key));
- }
- }
-
- public IManifestHeader getManifestHeader(String key) {
- return new ManifestHeader(key, getHeader(key), this, System.getProperty("line.separator")); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java
deleted file mode 100644
index 7817750..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleFragment;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.eclipse.pde.internal.core.plugin.PluginBase;
-import org.eclipse.pde.internal.core.text.bundle.FragmentHostHeader;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-public class BundleFragment extends BundlePluginBase implements IBundleFragment {
-
- private static final long serialVersionUID = 1L;
-
- public String getPluginId() {
- return getValue(Constants.FRAGMENT_HOST);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#getPluginVersion()
- */
- public String getPluginVersion() {
- String version = getAttribute(Constants.FRAGMENT_HOST, Constants.BUNDLE_VERSION_ATTRIBUTE);
- try {
- VersionRange versionRange = new VersionRange(version);
- if (versionRange != null) {
- return versionRange.getMinimum() != null ? versionRange.getMinimum().toString() : version;
- }
- } catch (NumberFormatException e) {
- }
- return version;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#getRule()
- */
- public int getRule() {
- String version = getAttribute(Constants.FRAGMENT_HOST, Constants.BUNDLE_VERSION_ATTRIBUTE);
- VersionRange versionRange = new VersionRange(version);
- return PluginBase.getMatchRule(versionRange);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setPluginId(java.lang.String)
- */
- public void setPluginId(String id) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String oldValue = getPluginId();
- IManifestHeader header = getManifestHeader(Constants.FRAGMENT_HOST);
- if (header instanceof FragmentHostHeader) {
- ((FragmentHostHeader)header).setHostId(id);
- } else {
- bundle.setHeader(Constants.FRAGMENT_HOST, writeFragmentHost(id, getPluginVersion()));
- }
- model.fireModelObjectChanged(this, P_PLUGIN_ID, oldValue, id);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setPluginVersion(java.lang.String)
- */
- public void setPluginVersion(String version) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String oldValue = getPluginVersion();
- IManifestHeader header = getManifestHeader(Constants.FRAGMENT_HOST);
- if (header instanceof FragmentHostHeader) {
- ((FragmentHostHeader)header).setHostRange(version);
- } else {
- bundle.setHeader(Constants.FRAGMENT_HOST, writeFragmentHost(getPluginId(), version));
- }
- model.fireModelObjectChanged(this, P_PLUGIN_VERSION, oldValue, version);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setRule(int)
- */
- public void setRule(int rule) throws CoreException {
- }
-
- private String writeFragmentHost(String id, String version) {
- StringBuffer buffer = new StringBuffer();
- if (id != null)
- buffer.append(id);
-
- if (version != null && version.trim().length() > 0) {
- buffer.append(";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version.trim() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return buffer.toString();
- }
-
- private String getAttribute(String key, String attribute) {
- IBundle bundle = getBundle();
- if (bundle == null)
- return null;
- String value = bundle.getHeader(key);
- if (value == null)
- return null;
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(key, value);
- if (elements.length > 0)
- return elements[0].getAttribute(attribute);
- } catch (BundleException e) {
- }
- return null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragmentModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragmentModel.java
deleted file mode 100644
index 61e951f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragmentModel.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundleFragmentModel;
-
-public class BundleFragmentModel
- extends BundlePluginModelBase
- implements IBundleFragmentModel {
-
- private static final long serialVersionUID = 1L;
-
- public IPluginBase createPluginBase() {
- BundleFragment bfragment = new BundleFragment();
- bfragment.setModel(this);
- return bfragment;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragmentModel#getFragment()
- */
- public IFragment getFragment() {
- return (IFragment)getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#isFragmentModel()
- */
- public boolean isFragmentModel() {
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleModel.java
deleted file mode 100644
index dbfad3b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleModel.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.PDEState;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.osgi.framework.Constants;
-
-public abstract class BundleModel
- extends AbstractModel
- implements IBundleModel {
-
- private Bundle fBundle;
-
- public BundleModel() {
- fBundle = new Bundle();
- fBundle.setModel(this);
- }
-
- public IBundle getBundle() {
- if (!isLoaded())
- load();
- return fBundle;
- }
-
- public String getInstallLocation() {
- return null;
- }
-
- public abstract void load();
-
- public boolean isFragmentModel() {
- return fBundle.getHeader(Constants.FRAGMENT_HOST) != null;
- }
-
- public void load(InputStream source, boolean outOfSync) {
- try {
- Manifest m = new Manifest(source);
- fBundle.load(manifestToProperties(m.getMainAttributes()));
- if (!outOfSync)
- updateTimeStamp();
- setLoaded(true);
- } catch (IOException e) {
- } finally {
- }
- }
-
- public void load(BundleDescription desc, PDEState state) {
- long id = desc.getBundleId();
- Properties properties = new Properties();
- properties.put(Constants.BUNDLE_SYMBOLICNAME, desc.getSymbolicName());
- String value = state.getPluginName(id);
- if (value != null)
- properties.put(Constants.BUNDLE_NAME, value);
- value = state.getProviderName(id);
- if (value != null)
- properties.put(Constants.BUNDLE_VENDOR, value);
- value = state.getClassName(id);
- if (value != null)
- properties.put(Constants.BUNDLE_ACTIVATOR, value);
- value = state.getBundleLocalization(id);
- if (value != null)
- properties.put(Constants.BUNDLE_LOCALIZATION, value);
- if (state.hasExtensibleAPI(id))
- properties.put(ICoreConstants.EXTENSIBLE_API, "true"); //$NON-NLS-1$
- String[] libraries = state.getLibraryNames(id);
- if (libraries.length > 0) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < libraries.length; i++) {
- if (buffer.length() > 0) {
- buffer.append(","); //$NON-NLS-1$
- buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
- buffer.append(" "); //$NON-NLS-1$
- }
- buffer.append(libraries[i]);
- }
- properties.put(Constants.BUNDLE_CLASSPATH, buffer.toString());
- }
- if (desc.getHost() != null) {
- properties.put(Constants.FRAGMENT_HOST, writeFragmentHost(desc.getHost()));
- }
- fBundle.load(properties);
- updateTimeStamp();
- setLoaded(true);
- }
-
- private String writeFragmentHost(HostSpecification host) {
- String id = host.getName();
- String version = host.getVersionRange().toString();
- StringBuffer buffer = new StringBuffer();
- if (id != null)
- buffer.append(id);
-
- if (version != null && version.trim().length() > 0) {
- buffer.append(";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return buffer.toString();
- }
-
-
- private Properties manifestToProperties(Attributes d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name) iter.next();
- result.put(key.toString(), d.get(key));
- }
- return result;
- }
-
-
- public void reload(InputStream source, boolean outOfSync) {
- load(source, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[0],
- null));
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleObject.java
deleted file mode 100644
index 7f9ccc9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleObject.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-
-public class BundleObject implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private transient IBundleModel model;
-
- public BundleObject() {
- }
-
- public IBundleModel getModel() {
- return model;
- }
- public void setModel(IBundleModel newModel) {
- model = newModel;
- }
- protected void throwCoreException(String message) throws CoreException {
- Status status =
- new Status(
- IStatus.ERROR,
- PDECore.getPluginId(),
- IStatus.OK,
- message,
- null);
- throw new CoreException(status);
- }
-
- protected void fireStructureChanged(BundleObject child, int changeType) {
- IModelChangedEvent e = new ModelChangedEvent(
- model,
- changeType,
- new Object[]{child},
- null);
- fireModelChanged(e);
- }
-
- protected void fireModelChanged(IModelChangedEvent e) {
- IModelChangeProvider provider = model;
- provider.fireModelChanged(e);
- }
-
- protected void firePropertyChanged(BundleObject object, String property,
- Object oldValue, Object newValue) {
- IModelChangeProvider provider = model;
- provider.fireModelObjectChanged(object, property, oldValue, newValue);
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java
deleted file mode 100644
index fe07639..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.core.bundle;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundlePlugin;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.eclipse.pde.internal.core.text.bundle.BundleActivatorHeader;
-import org.osgi.framework.Constants;
-
-public class BundlePlugin extends BundlePluginBase implements IBundlePlugin {
-
- private static final long serialVersionUID = 1L;
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPlugin#getClassName()
- */
- public String getClassName() {
- return getValue(getClassHeader());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPlugin#setClassName(java.lang.String)
- */
- public void setClassName(String className) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String old = getClassName();
- String classHeader = getClassHeader();
- IManifestHeader header = bundle.getManifestHeader(classHeader);
- if (header instanceof BundleActivatorHeader)
- ((BundleActivatorHeader)header).setClassName(className);
- else
- bundle.setHeader(getClassHeader(), className);
- model.fireModelObjectChanged(this, P_CLASS_NAME, old, className);
- }
- }
-
- private String getClassHeader() {
- IPluginImport[] imports = getImports();
- for (int i = 0; i < imports.length; i++) {
- if ("org.eclipse.core.runtime.compatibility".equals(imports[i].getId()))//$NON-NLS-1$
- return ICoreConstants.PLUGIN_CLASS;
- }
- return Constants.BUNDLE_ACTIVATOR;
- }
-
- public boolean hasExtensibleAPI() {
- return "true".equals(getValue(ICoreConstants.EXTENSIBLE_API)); //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java
deleted file mode 100644
index e83d68f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
-import org.eclipse.pde.core.plugin.ISharedPluginModel;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.PDEStateHelper;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.eclipse.pde.internal.core.plugin.PluginImport;
-import org.eclipse.pde.internal.core.plugin.PluginLibrary;
-import org.eclipse.pde.internal.core.text.bundle.BundleClasspathHeader;
-import org.eclipse.pde.internal.core.text.bundle.BundleNameHeader;
-import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader;
-import org.eclipse.pde.internal.core.text.bundle.BundleVendorHeader;
-import org.eclipse.pde.internal.core.text.bundle.BundleVersionHeader;
-import org.eclipse.pde.internal.core.text.bundle.RequireBundleHeader;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-public class BundlePluginBase extends PlatformObject implements IBundlePluginBase, Serializable {
-
- private static final long serialVersionUID = 1L;
- protected IBundlePluginModelBase model;
- private ArrayList libraries;
- private ArrayList imports;
-
- public void reset() {
- libraries = null;
- imports = null;
- }
-
- public String getSchemaVersion() {
- return "3.0"; //$NON-NLS-1$
- }
-
- public void setSchemaVersion(String value) throws CoreException {
- }
-
- public void modelChanged(IModelChangedEvent event) {
- if (event.getChangeType() == ModelChangedEvent.WORLD_CHANGED) {
- if (event.getChangeProvider().equals(model.getBundleModel())) {
- reset();
- }
- getModel().fireModelChanged(event);
- } else if (!event.getChangeProvider().equals(model.getBundleModel())) {
- getModel().fireModelChanged(event);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginBase#getBundle()
- */
- public IBundle getBundle() {
- if (model != null) {
- IBundleModel bmodel = model.getBundleModel();
- return bmodel != null ? bmodel.getBundle() : null;
- }
- return null;
- }
-
- protected IManifestHeader getManifestHeader(String key) {
- IBundle bundle = getBundle();
- return (bundle != null) ? bundle.getManifestHeader(key) : null;
- }
-
- public ISharedPluginModel getModel() {
- return model;
- }
-
- void setModel(IBundlePluginModelBase model) {
- this.model = model;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginBase#getExtensionsRoot()
- */
- public IExtensions getExtensionsRoot() {
- if (model != null) {
- ISharedExtensionsModel emodel = model.getExtensionsModel();
- return emodel != null ? emodel.getExtensions() : null;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#add(org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void add(IPluginLibrary library) throws CoreException {
- if (libraries != null) {
- libraries.add(library);
- Object header = getManifestHeader(Constants.BUNDLE_CLASSPATH);
- if (header instanceof BundleClasspathHeader) {
- ((BundleClasspathHeader)header).addLibrary(library.getName());
- } else {
- getBundle().setHeader(Constants.BUNDLE_CLASSPATH, library.getName());
- }
- fireStructureChanged(library, true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#remove(org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void remove(IPluginLibrary library) throws CoreException {
- if (libraries != null) {
- libraries.remove(library);
- Object header = getManifestHeader(Constants.BUNDLE_CLASSPATH);
- if (header instanceof BundleClasspathHeader) {
- ((BundleClasspathHeader)header).removeLibrary(library.getName());
- }
- fireStructureChanged(library, false);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#add(org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void add(IPluginImport iimport) throws CoreException {
- if (imports != null) {
- imports.add(iimport);
- Object header = getManifestHeader(Constants.REQUIRE_BUNDLE);
- if (header instanceof RequireBundleHeader) {
- ((RequireBundleHeader)header).addBundle(iimport);
- } else {
- StringBuffer buffer = new StringBuffer(iimport.getId());
- int bundleManifestVersion = getBundleManifestVersion(getBundle());
- if (iimport.isOptional())
- if (bundleManifestVersion > 1)
- buffer.append(";" + Constants.RESOLUTION_DIRECTIVE + ":=" + Constants.RESOLUTION_OPTIONAL); //$NON-NLS-1$ //$NON-NLS-2$
- else
- buffer.append(";" + ICoreConstants.OPTIONAL_ATTRIBUTE + "=true"); //$NON-NLS-1$ //$NON-NLS-2$
- if (iimport.isReexported())
- if (bundleManifestVersion > 1)
- buffer.append(";" + Constants.VISIBILITY_DIRECTIVE + ":=" + Constants.VISIBILITY_REEXPORT); //$NON-NLS-1$ //$NON-NLS-2$
- else
- buffer.append(";" + ICoreConstants.REPROVIDE_ATTRIBUTE + "=true"); //$NON-NLS-1$ //$NON-NLS-2$
- String version = iimport.getVersion();
- if (version != null && version.trim().length() > 0)
- buffer.append(";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version.trim() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- getBundle().setHeader(Constants.REQUIRE_BUNDLE, buffer.toString());
- }
- fireStructureChanged(iimport, true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#remove(org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void remove(IPluginImport pluginImport) throws CoreException {
- if (imports != null) {
- imports.remove(pluginImport);
- Object header = getManifestHeader(Constants.REQUIRE_BUNDLE);
- if (header instanceof RequireBundleHeader) {
- ((RequireBundleHeader)header).removeBundle(pluginImport.getId());
- }
- fireStructureChanged(pluginImport, false);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#getLibraries()
- */
- public IPluginLibrary[] getLibraries() {
- IBundle bundle = getBundle();
- if (bundle == null)
- return new IPluginLibrary[0];
- if (libraries == null) {
- libraries = new ArrayList();
- String value = bundle.getHeader(Constants.BUNDLE_CLASSPATH);
- if (value != null) {
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, value);
- for (int i = 0; i < elements.length; i++) {
- PluginLibrary library = new PluginLibrary();
- library.setModel(getModel());
- library.setInTheModel(true);
- library.setParent(this);
- library.load(elements[i].getValue());
- libraries.add(library);
- }
- } catch (BundleException e) {
- }
- }
- }
- return (IPluginLibrary[]) libraries.toArray(new IPluginLibrary[libraries.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#getImports()
- */
- public IPluginImport[] getImports() {
- if (imports == null) {
- imports = new ArrayList();
- BundleDescription description = model.getBundleDescription();
- if (description != null) {
- BundleSpecification[] required = description.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- imports.add(importElement);
- importElement.load(required[i]);
- }
- BundleDescription[] imported = PDEStateHelper.getImportedBundles(description);
- for (int i = 0; i < imported.length; i++) {
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- imports.add(importElement);
- importElement.load(imported[i]);
- }
- } else {
- IBundle bundle = getBundle();
- if (bundle != null) {
- try {
- String value = bundle.getHeader(Constants.REQUIRE_BUNDLE);
- int bundleManifestVersion = getBundleManifestVersion(bundle);
- if (value != null) {
- ManifestElement[] elements = ManifestElement.parseHeader(Constants.REQUIRE_BUNDLE, value);
- for (int i = 0; i < elements.length; i++) {
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- imports.add(importElement);
- importElement.load(elements[i], bundleManifestVersion);
- }
- }
- } catch (BundleException e) {
- }
- }
- }
- }
- return (IPluginImport[])imports.toArray(new IPluginImport[imports.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#getProviderName()
- */
- public String getProviderName() {
- IBundle bundle = getBundle();
- return bundle == null ? null : bundle.getHeader(Constants.BUNDLE_VENDOR);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#setProviderName(java.lang.String)
- */
- public void setProviderName(String providerName) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String old = getProviderName();
- IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_VENDOR);
- if (header instanceof BundleVendorHeader)
- ((BundleVendorHeader)header).setVendor(providerName);
- else
- bundle.setHeader(Constants.BUNDLE_VENDOR, providerName);
- model.fireModelObjectChanged(this, IPluginBase.P_PROVIDER, old, providerName);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#getVersion()
- */
- public String getVersion() {
- BundleDescription desc = model.getBundleDescription();
- if (desc != null) {
- Version version = desc.getVersion();
- return (version != null) ? version.toString() : null;
- }
- return getValue(Constants.BUNDLE_VERSION);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#setVersion(java.lang.String)
- */
- public void setVersion(String version) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String old = getVersion();
- IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_VERSION);
- if (header instanceof BundleVersionHeader)
- ((BundleVersionHeader)header).setVersionRange(version);
- else
- bundle.setHeader(Constants.BUNDLE_VERSION, version);
- model.fireModelObjectChanged(this, IPluginBase.P_VERSION, old, version);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginBase#swap(org.eclipse.pde.core.plugin.IPluginLibrary,
- * org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void swap(IPluginLibrary l1, IPluginLibrary l2) throws CoreException {
- if (libraries != null) {
- int index1 = libraries.indexOf(l1);
- int index2 = libraries.indexOf(l2);
- libraries.set(index1, l2);
- libraries.set(index2, l1);
- Object header = getManifestHeader(Constants.BUNDLE_CLASSPATH);
- if (header instanceof BundleClasspathHeader) {
- ((BundleClasspathHeader)header).swap(index1, index2);
- }
- model.fireModelObjectChanged(this, P_IMPORT_ORDER, l1, l2);
- }
- }
-
- protected void fireStructureChanged(Object object, boolean added) {
- int type = (added)?IModelChangedEvent.INSERT:IModelChangedEvent.REMOVE;
- model.fireModelChanged(new ModelChangedEvent(model, type, new Object[]{object}, null ));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#add(org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void add(IPluginExtension extension) throws CoreException {
- IExtensions extensions = getExtensionsRoot();
- if (extensions == null)
- return;
- extensions.add(extension);
-
- // reset singleton
- if (getExtensions().length == 1 && getExtensionPoints().length == 0)
- updateSingleton(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#add(org.eclipse.pde.core.plugin.IPluginExtensionPoint)
- */
- public void add(IPluginExtensionPoint point) throws CoreException {
- IExtensions extensions = getExtensionsRoot();
- if (extensions == null)
- return;
- extensions.add(point);
-
- //reset singleton
- if (getExtensions().length == 0 && getExtensionPoints().length == 1)
- updateSingleton(true);
- }
-
- public String getResourceString(String key) {
- return model.getResourceString(key);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#getExtensionPoints()
- */
- public IPluginExtensionPoint[] getExtensionPoints() {
- IExtensions extensions = getExtensionsRoot();
- if (extensions == null)
- return new IPluginExtensionPoint[0];
- return extensions.getExtensionPoints();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#getExtensions()
- */
- public IPluginExtension[] getExtensions() {
- IExtensions extensions = getExtensionsRoot();
- if (extensions == null)
- return new IPluginExtension[0];
- return extensions.getExtensions();
- }
-
- public int getIndexOf(IPluginExtension e) {
- IExtensions extensions = getExtensionsRoot();
- if (extensions == null)
- return -1;
- return extensions.getIndexOf(e);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#remove(org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void remove(IPluginExtension extension) throws CoreException {
- IExtensions extensions = getExtensionsRoot();
- if (extensions != null) {
- extensions.remove(extension);
- // reset singleton directive
- if (getExtensions().length == 0 && getExtensionPoints().length == 0)
- updateSingleton(false);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#remove(org.eclipse.pde.core.plugin.IPluginExtensionPoint)
- */
- public void remove(IPluginExtensionPoint extensionPoint)
- throws CoreException {
- IExtensions extensions = getExtensionsRoot();
- if (extensions != null) {
- extensions.remove(extensionPoint);
- // reset singleton directive
- if (getExtensions().length == 0 && getExtensionPoints().length == 0)
- updateSingleton(false);
- }
- }
-
- private void updateSingleton(boolean singleton) {
- IManifestHeader header = getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
- if (header instanceof BundleSymbolicNameHeader)
- ((BundleSymbolicNameHeader)header).setSingleton(singleton);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IExtensions#swap(org.eclipse.pde.core.plugin.IPluginExtension,
- * org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void swap(IPluginExtension e1, IPluginExtension e2)
- throws CoreException {
- IExtensions extensions = getExtensionsRoot();
- if (extensions != null) {
- extensions.swap(e1, e2);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#swap(org.eclipse.pde.core.plugin.IPluginImport, org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void swap(IPluginImport import1, IPluginImport import2)
- throws CoreException {
- if (imports != null) {
- int index1 = imports.indexOf(import1);
- int index2 = imports.indexOf(import2);
- imports.set(index1, import2);
- imports.set(index2, import1);
- Object header = getManifestHeader(Constants.REQUIRE_BUNDLE);
- if (header instanceof RequireBundleHeader) {
- ((RequireBundleHeader)header).swap(index1, index2);
- }
- model.fireModelObjectChanged(this, P_IMPORT_ORDER, import1, import2);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IIdentifiable#getId()
- */
- public String getId() {
- return getValue(Constants.BUNDLE_SYMBOLICNAME);
- }
-
- protected String getValue(String key) {
- IBundle bundle = getBundle();
- if (bundle == null)
- return null;
- String value = bundle.getHeader(key);
- if (value == null)
- return null;
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(key, value);
- if (elements.length > 0)
- return elements[0].getValue();
- } catch (BundleException e) {
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
- */
- public void setId(String id) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String old = getId();
- IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
- if (header instanceof BundleSymbolicNameHeader)
- ((BundleSymbolicNameHeader)header).setId(id);
- else
- bundle.setHeader(Constants.BUNDLE_SYMBOLICNAME, id);
- model.fireModelObjectChanged(this, IPluginBase.P_ID, old, id);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getPluginModel()
- */
- public IPluginModelBase getPluginModel() {
- return model;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getValue(Constants.BUNDLE_NAME);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- IBundle bundle = getBundle();
- if (bundle != null) {
- String old = getName();
- IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_NAME);
- if (header instanceof BundleNameHeader)
- ((BundleNameHeader)header).setBundleName(name);
- else
- bundle.setHeader(Constants.BUNDLE_NAME, name);
- model.fireModelObjectChanged(this, IPluginBase.P_NAME, old, name);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#isInTheModel()
- */
- public boolean isInTheModel() {
- return model != null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getTranslatedName()
- */
- public String getTranslatedName() {
- return getResourceString(getName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getParent()
- */
- public IPluginObject getParent() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getPluginBase()
- */
- public IPluginBase getPluginBase() {
- return this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#isValid()
- */
- public boolean isValid() {
- IExtensions extensions = getExtensionsRoot();
- return getBundle() != null
- && getBundle().getHeader(Constants.BUNDLE_SYMBOLICNAME) != null
- && (extensions == null || extensions.isValid());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String,
- * java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setInTheModel(boolean)
- */
- public void setInTheModel(boolean inModel) {
- }
-
- static public int getBundleManifestVersion(IBundle bundle) {
- String version = bundle.getHeader(Constants.BUNDLE_MANIFESTVERSION);
- if (version == null)
- return 1; // default to 1
- try {
- return Integer.parseInt(version);
- } catch (NumberFormatException e) {
- return 1; // default to 1
- }
- }
-
- public void updateImport(IPluginImport iimport) {
- Object header = getManifestHeader(Constants.REQUIRE_BUNDLE);
- if (header instanceof RequireBundleHeader && imports != null)
- ((RequireBundleHeader)header).updateBundle(imports.indexOf(iimport), iimport);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModel.java
deleted file mode 100644
index a82a01a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModel.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel;
-
-public class BundlePluginModel
- extends BundlePluginModelBase
- implements IBundlePluginModel {
-
- private static final long serialVersionUID = 1L;
-
- public IPluginBase createPluginBase() {
- BundlePlugin bplugin = new BundlePlugin();
- bplugin.setModel(this);
- return bplugin;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModel#getPlugin()
- */
- public IPlugin getPlugin() {
- return (IPlugin)getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#isFragmentModel()
- */
- public boolean isFragmentModel() {
- return false;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModelBase.java
deleted file mode 100644
index f8d69dd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginModelBase.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.IEditable;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IExtensionsModelFactory;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelFactory;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDEManager;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.plugin.PluginImport;
-import org.eclipse.pde.internal.core.plugin.PluginLibrary;
-
-public abstract class BundlePluginModelBase extends AbstractModel
- implements IBundlePluginModelBase, IPluginModelFactory {
-
- private IBundleModel fBundleModel;
- private ISharedExtensionsModel fExtensionsModel;
- private BundlePluginBase fBundlePluginBase;
- private IBuildModel fBuildModel;
- private BundleDescription fBundleDescription;
-
- public BundlePluginModelBase() {
- getPluginBase();
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase#getBundleModel()
- */
- public IBundleModel getBundleModel() {
- return fBundleModel;
- }
- public IResource getUnderlyingResource() {
- return fBundleModel.getUnderlyingResource();
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase#getExtensionsModel()
- */
- public ISharedExtensionsModel getExtensionsModel() {
- return fExtensionsModel;
- }
- public void dispose() {
- if (fBundleModel != null) {
- if (fBundlePluginBase != null)
- fBundleModel.removeModelChangedListener(fBundlePluginBase);
- fBundleModel.dispose();
- fBundleModel = null;
- }
- if (fExtensionsModel != null) {
- if (fBundlePluginBase != null)
- fExtensionsModel.removeModelChangedListener(fBundlePluginBase);
- fExtensionsModel.dispose();
- fExtensionsModel = null;
- }
- super.dispose();
- }
- public void save() {
- if (fBundleModel != null && fBundleModel instanceof IEditableModel) {
- IEditableModel emodel = (IEditableModel) fBundleModel;
- if (emodel.isDirty())
- emodel.save();
- }
- if (fExtensionsModel != null
- && fExtensionsModel instanceof IEditableModel) {
- IEditableModel emodel = (IEditableModel) fExtensionsModel;
- if (emodel.isDirty())
- emodel.save();
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase#setBundleModel(org.eclipse.pde.internal.core.ibundle.IBundleModel)
- */
- public void setBundleModel(IBundleModel bundleModel) {
- if (fBundleModel != null && fBundlePluginBase != null) {
- fBundleModel.removeModelChangedListener(fBundlePluginBase);
- }
- fBundleModel = bundleModel;
- if (fBundleModel != null && fBundlePluginBase != null)
- bundleModel.addModelChangedListener(fBundlePluginBase);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase#setExtensionsModel(org.eclipse.pde.core.plugin.IExtensionsModel)
- */
- public void setExtensionsModel(ISharedExtensionsModel extensionsModel) {
- if (fExtensionsModel != null && fBundlePluginBase != null) {
- fExtensionsModel.removeModelChangedListener(fBundlePluginBase);
- }
- fExtensionsModel = extensionsModel;
- if (extensionsModel != null && fBundlePluginBase != null)
- extensionsModel.addModelChangedListener(fBundlePluginBase);
- }
-
- public IBuildModel getBuildModel() {
- return fBuildModel;
- }
-
- public void setBuildModel(IBuildModel buildModel) {
- fBuildModel = buildModel;
- }
-
- public IPluginBase getPluginBase() {
- return getPluginBase(true);
- }
-
- public IExtensions getExtensions() {
- return getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelChangeProvider#fireModelChanged(org.eclipse.pde.core.IModelChangedEvent)
- */
- public void fireModelChanged(IModelChangedEvent event) {
- super.fireModelChanged(event);
- Object[] objects = event.getChangedObjects();
- if (objects!= null && objects.length > 0) {
- if (objects[0] instanceof IPluginImport) {
- fBundlePluginBase.updateImport((IPluginImport)objects[0]);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getPluginBase(boolean)
- */
- public IPluginBase getPluginBase(boolean createIfMissing) {
- if (fBundlePluginBase == null && createIfMissing) {
- fBundlePluginBase = (BundlePluginBase) createPluginBase();
- if (fBundleModel != null)
- fBundleModel.addModelChangedListener(fBundlePluginBase);
- setLoaded(true);
- }
- return fBundlePluginBase;
- }
- public IExtensions getExtensions(boolean createIfMissing) {
- return getPluginBase(createIfMissing);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getPluginFactory()
- */
- public IPluginModelFactory getPluginFactory() {
- return this;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.ISharedPluginModel#getFactory()
- */
- public IExtensionsModelFactory getFactory() {
- if (fExtensionsModel != null)
- return fExtensionsModel.getFactory();
- return null;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.ISharedPluginModel#getInstallLocation()
- */
- public String getInstallLocation() {
- if (fBundleModel != null)
- return fBundleModel.getInstallLocation();
- return null;
- }
-
- public String getBundleLocalization() {
- IBundle bundle = fBundleModel != null ? fBundleModel.getBundle() : null;
- return bundle != null ? bundle.getLocalization() : null;
-
- }
-
- protected NLResourceHelper createNLResourceHelper() {
- String localization = getBundleLocalization();
- return localization == null
- ? null
- : new NLResourceHelper(localization, PDEManager.getNLLookupLocations(this));
- }
-
- public URL getNLLookupLocation() {
- try {
- return new URL("file:" + getInstallLocation()); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (MalformedURLException e) {
- return null;
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#isEditable()
- */
- public boolean isEditable() {
- if (fBundleModel != null && fBundleModel.isEditable() == false)
- return false;
- if (fExtensionsModel != null && fExtensionsModel.isEditable() == false)
- return false;
- return true;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#isInSync()
- */
- public boolean isInSync() {
- return ((fBundleModel == null || fBundleModel.isInSync()) && (fExtensionsModel == null || fExtensionsModel
- .isInSync()));
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#isValid()
- */
- public boolean isValid() {
- return ((fBundleModel == null || fBundleModel.isValid()) && (fExtensionsModel == null || fExtensionsModel
- .isValid()));
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#load()
- */
- public void load() throws CoreException {
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
- */
- public void load(InputStream source, boolean outOfSync)
- throws CoreException {
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IModel#reload(java.io.InputStream, boolean)
- */
- public void reload(InputStream source, boolean outOfSync)
- throws CoreException {
- }
- /**
- * @return Returns the enabled.
- */
- public boolean isEnabled() {
- return true;
- }
-
- public void setEnabled(boolean enabled) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.AbstractModel#updateTimeStamp()
- */
- protected void updateTimeStamp() {
- }
-
- public IPluginImport createImport() {
- PluginImport iimport = new PluginImport();
- iimport.setModel(this);
- iimport.setParent(getPluginBase());
- return iimport;
- }
-
- public IPluginLibrary createLibrary() {
- PluginLibrary library = new PluginLibrary();
- library.setModel(this);
- library.setParent(getPluginBase());
- return library;
- }
- public IPluginAttribute createAttribute(IPluginElement element) {
- if (fExtensionsModel != null)
- return fExtensionsModel.getFactory().createAttribute(element);
- return null;
- }
- public IPluginElement createElement(IPluginObject parent) {
- if (fExtensionsModel != null)
- return fExtensionsModel.getFactory().createElement(parent);
- return null;
- }
- public IPluginExtension createExtension() {
- if (fExtensionsModel != null)
- return fExtensionsModel.getFactory().createExtension();
- return null;
- }
- public IPluginExtensionPoint createExtensionPoint() {
- if (fExtensionsModel != null)
- return fExtensionsModel.getFactory().createExtensionPoint();
- return null;
- }
-
- public boolean isBundleModel() {
- return true;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getBundleDescription()
- */
- public BundleDescription getBundleDescription() {
- return fBundleDescription;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#setBundleDescription(org.eclipse.osgi.service.resolver.BundleDescription)
- */
- public void setBundleDescription(BundleDescription description) {
- fBundleDescription = description;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IEditable#isDirty()
- */
- public boolean isDirty() {
- if (fBundleModel != null && (fBundleModel instanceof IEditable)
- && ((IEditable) fBundleModel).isDirty())
- return true;
- if (fExtensionsModel != null && (fExtensionsModel instanceof IEditable)
- && ((IEditable) fExtensionsModel).isDirty())
- return true;
- return false;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IEditable#save(java.io.PrintWriter)
- */
- public void save(PrintWriter writer) {
- // Does nothing - individual models are saved instead
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IEditable#setDirty(boolean)
- */
- public void setDirty(boolean dirty) {
- //does nothing
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/WorkspaceBundleModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/WorkspaceBundleModel.java
deleted file mode 100644
index edeb97a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/WorkspaceBundleModel.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.bundle;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory;
-import org.eclipse.pde.internal.core.text.bundle.BundleModelFactory;
-
-public class WorkspaceBundleModel extends BundleModel implements IEditableModel {
- private static final long serialVersionUID = 1L;
-
- private IFile fUnderlyingResource;
-
- private boolean fDirty;
-
- private boolean fEditable = true;
-
- private IBundleModelFactory fFactory;
-
- public WorkspaceBundleModel(IFile file) {
- fUnderlyingResource = file;
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(event.getChangeType() != IModelChangedEvent.WORLD_CHANGED);
- super.fireModelChanged(event);
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
- public IResource getUnderlyingResource() {
- return fUnderlyingResource;
- }
-
- public String getInstallLocation() {
- return fUnderlyingResource.getLocation().removeLastSegments(2).addTrailingSeparator().toOSString();
- }
-
- public boolean isDirty() {
- return fDirty;
- }
-
- public boolean isEditable() {
- return fEditable;
- }
-
- public void load() {
- if (fUnderlyingResource == null)
- return;
- if (fUnderlyingResource.exists()) {
- try {
- InputStream stream = fUnderlyingResource.getContents(true);
- load(stream, false);
- stream.close();
- } catch (Exception e) {
- PDECore.logException(e);
- }
- }
- }
-
- public boolean isInSync() {
- return isInSync(fUnderlyingResource.getLocation().toFile());
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(fUnderlyingResource.getLocation().toFile());
- }
-
- public void save() {
- if (fUnderlyingResource == null)
- return;
- try {
- String contents = getContents();
- ByteArrayInputStream stream = new ByteArrayInputStream(contents
- .getBytes("UTF-8")); //$NON-NLS-1$
- if (fUnderlyingResource.exists()) {
- fUnderlyingResource.setContents(stream, false, false, null);
- } else {
- fUnderlyingResource.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
-
- public void save(PrintWriter writer) {
- fDirty = false;
- }
-
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- public void setEditable(boolean editable) {
- fEditable = editable;
- }
-
- public IBundleModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new BundleModelFactory(this);
- return fFactory;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/AbstractFeatureModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/AbstractFeatureModel.java
deleted file mode 100644
index 93765c2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/AbstractFeatureModel.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.XMLDefaultHandler;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModelFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-public abstract class AbstractFeatureModel
- extends AbstractModel
- implements IFeatureModel {
- protected transient Feature feature;
- private transient IFeatureModelFactory factory;
- private boolean enabled = true;
-
- public AbstractFeatureModel() {
- super();
- }
- public IFeature getFeature() {
- if (feature == null) {
- Feature f = new Feature();
- f.model = this;
- this.feature = f;
- }
- return feature;
- }
- public IFeatureModelFactory getFactory() {
- if (factory == null)
- factory = new FeatureFactory(this);
- return factory;
- }
- public String getInstallLocation() {
- return null;
- }
- public boolean isEditable() {
- return true;
- }
- public boolean isEnabled() {
- return enabled;
- }
- public void load(InputStream stream, boolean outOfSync) throws CoreException {
- try {
- SAXParser parser = getSaxParser();
- XMLDefaultHandler handler = new XMLDefaultHandler();
- parser.parse(stream, handler);
- processDocument(handler.getDocument());
- setLoaded(true);
- if (!outOfSync)
- updateTimeStamp();
- } catch (SAXException e) {
- } catch (Exception e) {
- PDECore.logException(e);
- }
- }
-
- public boolean isValid() {
- if (!isLoaded()) return false;
- IFeature feature = getFeature();
- return feature!=null && feature.isValid();
- }
-
- private void processDocument(Document doc) {
- Node rootNode = doc.getDocumentElement();
- if (feature == null) {
- feature = new Feature();
- feature.model = this;
- } else {
- feature.reset();
- }
- feature.parse(rootNode);
- }
- public void reload(InputStream stream, boolean outOfSync)
- throws CoreException {
- if (feature != null)
- feature.reset();
- load(stream, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { feature },
- null));
- }
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/ExternalFeatureModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/ExternalFeatureModel.java
deleted file mode 100644
index a28130e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/ExternalFeatureModel.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import org.eclipse.core.runtime.CoreException;
-
-public class ExternalFeatureModel extends AbstractFeatureModel {
- private static final long serialVersionUID = 1L;
- private String location;
- /**
- * @see AbstractModel#updateTimeStamp()
- */
- protected void updateTimeStamp() {
- }
-
- /**
- * @see IModel#isInSync()
- */
- public boolean isInSync() {
- return true;
- }
-
- public boolean isEditable() {
- return false;
- }
-
- /**
- * @see IModel#load()
- */
- public void load() throws CoreException {
- }
-
- public void setInstallLocation(String location) {
- this.location = location;
- }
- public String getInstallLocation() {
- return location;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/Feature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/Feature.java
deleted file mode 100644
index 33fe935..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/Feature.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PluginModelManager;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureChild;
-import org.eclipse.pde.internal.core.ifeature.IFeatureData;
-import org.eclipse.pde.internal.core.ifeature.IFeatureImport;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInfo;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInstallHandler;
-import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURL;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Feature extends VersionableObject implements IFeature {
- private static final long serialVersionUID = 1L;
- final static String INDENT = " "; //$NON-NLS-1$
- private String fProviderName;
- private IFeatureURL fUrl;
- private IFeatureInfo[] fInfos = new IFeatureInfo[3];
- private Vector fData = new Vector();
- private Vector fChildren = new Vector();
- private Vector fPlugins = new Vector();
- private Vector fImports = new Vector();
- private String fOs;
- private String fWs;
- private String fNl;
- private String fArch;
- private String fImageName;
- private IFeatureInstallHandler fHandler;
- private boolean fPrimary;
- private boolean fExclusive;
- private String fColocationAffinity;
- private String fApplication;
- private String fPlugin;
- private boolean fValid;
-
- public void addPlugins(IFeaturePlugin[] newPlugins) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newPlugins.length; i++) {
- fPlugins.add(newPlugins[i]);
- ((FeaturePlugin) newPlugins[i]).setInTheModel(true);
- }
- fireStructureChanged(newPlugins, IModelChangedEvent.INSERT);
- }
-
- public void addData(IFeatureData[] newData) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newData.length; i++) {
- fData.add(newData[i]);
- ((FeatureData) newData[i]).setInTheModel(true);
- }
- fireStructureChanged(newData, IModelChangedEvent.INSERT);
- }
-
- public void addIncludedFeatures(IFeatureChild[] features)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < features.length; i++) {
- fChildren.add(features[i]);
- ((FeatureChild) features[i]).setInTheModel(true);
- }
- fireStructureChanged(features, IModelChangedEvent.INSERT);
- }
-
- public void addImports(IFeatureImport[] iimports) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < iimports.length; i++) {
- fImports.add(iimports[i]);
- ((FeatureImport) iimports[i]).setInTheModel(true);
- }
- fireStructureChanged(iimports, IModelChangedEvent.INSERT);
- }
-
- public IFeaturePlugin[] getPlugins() {
- IFeaturePlugin[] result = new IFeaturePlugin[fPlugins.size()];
- fPlugins.copyInto(result);
- return result;
- }
-
- public IFeatureData[] getData() {
- IFeatureData[] result = new IFeatureData[fData.size()];
- fData.copyInto(result);
- return result;
- }
-
- public IFeatureChild[] getIncludedFeatures() {
- IFeatureChild[] result = new IFeatureChild[fChildren.size()];
- fChildren.copyInto(result);
- return result;
- }
- public IFeatureImport[] getImports() {
- IFeatureImport[] result = new IFeatureImport[fImports.size()];
- fImports.copyInto(result);
- return result;
- }
- public String getProviderName() {
- return fProviderName;
- }
-
- public String getPlugin() {
- return fPlugin;
- }
-
- public IPluginModelBase getReferencedModel(IFeaturePlugin reference) {
- PluginModelManager mng = PDECore.getDefault().getModelManager();
- IPluginModelBase model = mng.findModel(reference.getId());
-
- return (model != null && model.isEnabled()) ? model : null;
- }
- public IFeatureURL getURL() {
- return fUrl;
- }
- public IFeatureInstallHandler getInstallHandler() {
- return fHandler;
- }
-
- public IFeatureInfo getFeatureInfo(int index) {
- return fInfos[index];
- }
-
- public boolean isPrimary() {
- return fPrimary;
- }
-
- public boolean isExclusive() {
- return fExclusive;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- fProviderName = getNodeAttribute(node, "provider-name"); //$NON-NLS-1$
- fPlugin = getNodeAttribute(node, "plugin"); //$NON-NLS-1$
- fOs = getNodeAttribute(node, "os"); //$NON-NLS-1$
- fWs = getNodeAttribute(node, "ws"); //$NON-NLS-1$
- fNl = getNodeAttribute(node, "nl"); //$NON-NLS-1$
- fArch = getNodeAttribute(node, "arch"); //$NON-NLS-1$
- fImageName = getNodeAttribute(node, "image"); //$NON-NLS-1$
- fColocationAffinity = getNodeAttribute(node, "colocation-affinity"); //$NON-NLS-1$
- fApplication = getNodeAttribute(node, "application"); //$NON-NLS-1$
- fPrimary = getBooleanAttribute(node, "primary"); //$NON-NLS-1$
- fExclusive = getBooleanAttribute(node, "exclusive"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- fValid = true;
-
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String tag = child.getNodeName().toLowerCase(Locale.ENGLISH);
- if (tag.equals("description")) { //$NON-NLS-1$
- IFeatureInfo info = getModel().getFactory().createInfo(
- IFeature.INFO_DESCRIPTION);
- ((FeatureInfo) info).setInTheModel(true);
- ((FeatureInfo) info).parse(child);
- fInfos[IFeature.INFO_DESCRIPTION] = info;
- } else if (tag.equals("license")) { //$NON-NLS-1$
- IFeatureInfo info = getModel().getFactory().createInfo(
- IFeature.INFO_LICENSE);
- ((FeatureInfo) info).setInTheModel(true);
- ((FeatureInfo) info).parse(child);
- fInfos[IFeature.INFO_LICENSE] = info;
- } else if (tag.equals("copyright")) { //$NON-NLS-1$
- IFeatureInfo info = getModel().getFactory().createInfo(
- IFeature.INFO_COPYRIGHT);
- ((FeatureInfo) info).setInTheModel(true);
- ((FeatureInfo) info).parse(child);
- fInfos[IFeature.INFO_COPYRIGHT] = info;
- } else if (tag.equals("url")) { //$NON-NLS-1$
- if (fUrl == null) {
- fUrl = getModel().getFactory().createURL();
- ((FeatureURL) fUrl).setInTheModel(true);
- ((FeatureURL) fUrl).parse(child);
- }
- } else if (tag.equals("requires")) { //$NON-NLS-1$
- parseRequires(child);
- } else if (tag.equals("install-handler")) { //$NON-NLS-1$
- IFeatureInstallHandler handler = getModel().getFactory()
- .createInstallHandler();
- ((FeatureInstallHandler) handler).parse(child);
- ((FeatureInstallHandler) handler).setInTheModel(true);
- this.fHandler = handler;
- } else if (tag.equals("plugin")) { //$NON-NLS-1$
- IFeaturePlugin plugin = getModel().getFactory()
- .createPlugin();
- ((FeaturePlugin) plugin).parse(child);
- ((FeaturePlugin) plugin).setInTheModel(true);
- fPlugins.add(plugin);
- } else if (tag.equals("data")) { //$NON-NLS-1$
- IFeatureData newData = getModel().getFactory().createData();
- ((FeatureData) newData).parse(child);
- ((FeatureData) newData).setInTheModel(true);
- fData.add(newData);
- } else if (tag.equals("includes")) { //$NON-NLS-1$
- IFeatureChild newChild = getModel().getFactory()
- .createChild();
- ((FeatureChild) newChild).parse(child);
- ((FeatureChild) newChild).setInTheModel(true);
- this.fChildren.add(newChild);
- }
- }
- }
- fValid = hasRequiredAttributes();
- }
- private void parseRequires(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equalsIgnoreCase("import")) { //$NON-NLS-1$
- IFeatureImport iimport = getModel().getFactory()
- .createImport();
- ((FeatureImport) iimport).parse(child);
- ((FeatureImport) iimport).setInTheModel(true);
- fImports.add(iimport);
- }
- }
- }
- }
-
- public void computeImports() throws CoreException {
- // some existing imports may valid and can be preserved
- Vector preservedImports = new Vector(fImports.size());
- // new imports
- ArrayList newImports = new ArrayList();
- for (int i = 0; i < fPlugins.size(); i++) {
- IFeaturePlugin fp = (IFeaturePlugin) fPlugins.get(i);
- IPluginBase plugin = PDECore.getDefault().findPlugin(fp.getId(),
- fp.getVersion(), 0);
- if (plugin != null) {
- addPluginImports(preservedImports, newImports, plugin);
- }
- }
- // preserve imports of features
- for (int i = 0; i < fImports.size(); i++) {
- IFeatureImport iimport = (IFeatureImport) fImports.get(i);
- if (iimport.getType() == IFeatureImport.FEATURE)
- preservedImports.add(iimport);
- }
- // removed = old - preserved
- Vector removedImports = ((Vector) fImports.clone());
- removedImports.removeAll(preservedImports);
- // perform remove
- fImports = preservedImports;
- if (removedImports.size() > 0) {
- fireStructureChanged((IFeatureImport[]) removedImports
- .toArray(new IFeatureImport[removedImports.size()]),
- IModelChangedEvent.REMOVE);
- }
- // perform add
- if (newImports.size() > 0) {
- fImports.addAll(newImports);
- fireStructureChanged((IFeatureImport[]) newImports
- .toArray(new IFeatureImport[newImports.size()]),
- IModelChangedEvent.INSERT);
- }
- }
-
- /**
- * Creates IFeatureImports based on IPluginImports. Ensures no duplicates in
- * preservedImports + newImports
- *
- * @param preservedImports
- * out for valid existing imports
- * @param newImports
- * out for new imports
- * @param plugin
- * @throws CoreException
- */
- private void addPluginImports(List preservedImports, List newImports,
- IPluginBase plugin) throws CoreException {
- IPluginImport[] pluginImports = plugin.getImports();
- for (int i = 0; i < pluginImports.length; i++) {
- IPluginImport pluginImport = pluginImports[i];
- if (pluginImport.isOptional()) {
- continue;
- }
- String id = pluginImport.getId();
- String version = pluginImport.getVersion();
- int match = pluginImport.getMatch();
- if (findFeaturePlugin(id, version, match) != null) {
- // don't add imports to local plug-ins
- continue;
- }
- if (findImport(preservedImports, id, version, match) != null) {
- // already seen
- continue;
- }
- if (findImport(newImports, id, version, match) != null) {
- // already seen
- continue;
- }
- IFeatureImport iimport = findImport(fImports, id, version, match);
- if (iimport != null) {
- // import still valid
- preservedImports.add(iimport);
- continue;
- }
- // a new one is needed
- iimport = getModel().getFactory().createImport();
- iimport.setId(id);
- iimport.setVersion(version);
- iimport.setMatch(match);
- ((FeatureImport) iimport).setInTheModel(true);
- newImports.add(iimport);
- }
- }
-
- /**
- * Finds a given import in the list
- * @param imports list of imports
- * @param id
- * @param version
- * @param match
- * @return IFeatureImport or null
- */
- private IFeatureImport findImport(List imports, String id, String version, int match) {
- for (int i = 0; i < imports.size(); i++) {
- IFeatureImport iimport = (IFeatureImport) imports.get(i);
- if (iimport.getId().equals(id)) {
- if (version == null)
- return iimport;
- if (version.equals(iimport.getVersion())
- && match == iimport.getMatch())
- return iimport;
- }
- }
- return null;
- }
-
- private IFeaturePlugin findFeaturePlugin(String id, String version,
- int match) {
-
- for (int i = 0; i < fPlugins.size(); i++) {
- IFeaturePlugin fp = (IFeaturePlugin) fPlugins.get(i);
- String pid = fp.getId();
- String pversion = fp.getVersion();
- if (PDECore.compare(id, version, pid, pversion, match))
- return fp;
- }
- return null;
- }
-
- public void removePlugins(IFeaturePlugin[] removed) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < removed.length; i++) {
- fPlugins.remove(removed[i]);
- ((FeaturePlugin) removed[i]).setInTheModel(false);
- }
- fireStructureChanged(removed, IModelChangedEvent.REMOVE);
- }
-
- public void removeData(IFeatureData[] removed) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < removed.length; i++) {
- fData.remove(removed[i]);
- ((FeatureData) removed[i]).setInTheModel(false);
- }
- fireStructureChanged(removed, IModelChangedEvent.REMOVE);
- }
-
- public void removeIncludedFeatures(IFeatureChild[] features)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < features.length; i++) {
- fChildren.remove(features[i]);
- ((FeatureChild) features[i]).setInTheModel(false);
- }
- fireStructureChanged(features, IModelChangedEvent.REMOVE);
- }
- public void removeImports(IFeatureImport[] iimports) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < iimports.length; i++) {
- fImports.remove(iimports[i]);
- ((FeatureImport) iimports[i]).setInTheModel(false);
- }
- fireStructureChanged(iimports, IModelChangedEvent.REMOVE);
- }
-
- public String getOS() {
- return fOs;
- }
-
- public String getWS() {
- return fWs;
- }
-
- public String getNL() {
- return fNl;
- }
-
- public String getArch() {
- return fArch;
- }
-
- public String getColocationAffinity() {
- return fColocationAffinity;
- }
-
- public String getApplication() {
- return fApplication;
- }
-
- public void setOS(String os) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fOs;
- this.fOs = os;
- firePropertyChanged(P_OS, oldValue, os);
- }
- public void setWS(String ws) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fWs;
- this.fWs = ws;
- firePropertyChanged(P_WS, oldValue, ws);
- }
- public void setNL(String nl) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fNl;
- this.fNl = nl;
- firePropertyChanged(P_NL, oldValue, nl);
- }
- public void setArch(String arch) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fArch;
- this.fArch = arch;
- firePropertyChanged(P_ARCH, oldValue, arch);
- }
-
- public void setPrimary(boolean newValue) throws CoreException {
- if (this.fPrimary == newValue)
- return;
- ensureModelEditable();
- Boolean oldValue = this.fPrimary ? Boolean.TRUE : Boolean.FALSE;
- this.fPrimary = newValue;
- firePropertyChanged(P_PRIMARY, oldValue, newValue
- ? Boolean.TRUE
- : Boolean.FALSE);
- }
-
- public void setExclusive(boolean newValue) throws CoreException {
- if (this.fExclusive == newValue)
- return;
- ensureModelEditable();
- Boolean oldValue = this.fExclusive ? Boolean.TRUE : Boolean.FALSE;
- this.fExclusive = newValue;
- firePropertyChanged(P_EXCLUSIVE, oldValue, newValue
- ? Boolean.TRUE
- : Boolean.FALSE);
- }
-
- public void setColocationAffinity(String newValue) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fColocationAffinity;
- this.fColocationAffinity = newValue;
- firePropertyChanged(P_COLLOCATION_AFFINITY, oldValue, newValue);
- }
-
- public void setApplication(String newValue) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fApplication;
- this.fApplication = newValue;
- firePropertyChanged(P_APPLICATION, oldValue, newValue);
- }
-
- public void setProviderName(String providerName) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fProviderName;
- this.fProviderName = providerName;
- firePropertyChanged(P_PROVIDER, oldValue, providerName);
- }
-
- public void setPlugin(String plugin) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fPlugin;
- this.fPlugin = plugin;
- firePropertyChanged(P_PLUGIN, oldValue, plugin);
- }
- public void setURL(IFeatureURL url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fUrl;
- if (this.fUrl != null) {
- ((FeatureURL) this.fUrl).setInTheModel(false);
- }
- this.fUrl = url;
- firePropertyChanged(P_URL, oldValue, url);
- }
- public void setInstallHandler(IFeatureInstallHandler handler)
- throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fHandler;
- if (this.fHandler != null) {
- ((FeatureInstallHandler) this.fHandler).setInTheModel(false);
- }
- this.fHandler = handler;
- firePropertyChanged(P_INSTALL_HANDLER, oldValue, handler);
- }
-
- public void setFeatureInfo(IFeatureInfo info, int index)
- throws CoreException {
- ensureModelEditable();
- Object oldValue = fInfos[index];
- if (oldValue != null) {
- ((FeatureInfo) oldValue).setInTheModel(true);
- }
- fInfos[index] = info;
- String property;
- switch (index) {
- case INFO_DESCRIPTION :
- property = P_DESCRIPTION;
- break;
- case INFO_LICENSE :
- property = P_LICENSE;
- break;
- case INFO_COPYRIGHT :
- property = P_COPYRIGHT;
- break;
- default :
- return;
- }
- firePropertyChanged(property, oldValue, info);
- }
-
- /**
- * Sets the imageName.
- *
- * @param imageName
- * The imageName to set
- */
- public void setImageName(String imageName) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fImageName;
- this.fImageName = imageName;
- firePropertyChanged(P_IMAGE, oldValue, imageName);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_OS)) {
- setOS((String) newValue);
- } else if (name.equals(P_WS)) {
- setWS((String) newValue);
- } else if (name.equals(P_NL)) {
- setNL((String) newValue);
- } else if (name.equals(P_ARCH)) {
- setArch((String) newValue);
- } else if (name.equals(P_COLLOCATION_AFFINITY)) {
- setColocationAffinity((String) newValue);
- } else if (name.equals(P_APPLICATION)) {
- setApplication((String) newValue);
- } else if (name.equals(P_PRIMARY)) {
- setPrimary(newValue != null
- ? ((Boolean) newValue).booleanValue()
- : false);
- } else if (name.equals(P_EXCLUSIVE)) {
- setExclusive(newValue != null
- ? ((Boolean) newValue).booleanValue()
- : false);
- } else if (name.equals(P_PROVIDER)) {
- setProviderName((String) newValue);
- } else if (name.equals(P_PLUGIN)) {
- setPlugin((String) newValue);
- } else if (name.equals(P_URL)) {
- setURL((IFeatureURL) newValue);
- } else if (name.equals(P_INSTALL_HANDLER)) {
- setInstallHandler((IFeatureInstallHandler) newValue);
- } else if (name.equals(P_DESCRIPTION)) {
- setFeatureInfo((IFeatureInfo) newValue, INFO_DESCRIPTION);
- } else if (name.equals(P_LICENSE)) {
- setFeatureInfo((IFeatureInfo) newValue, INFO_LICENSE);
- } else if (name.equals(P_COPYRIGHT)) {
- setFeatureInfo((IFeatureInfo) newValue, INFO_COPYRIGHT);
- } else if (name.equals(P_IMAGE)) {
- setImageName((String) newValue);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void reset() {
- super.reset();
- fData.clear();
- fPlugins.clear();
- fImports.clear();
- fChildren.clear();
- fUrl = null;
- fProviderName = null;
- fPlugin = null;
- fOs = null;
- fWs = null;
- fNl = null;
- fArch = null;
- fInfos[0] = null;
- fInfos[1] = null;
- fInfos[2] = null;
- fPrimary = false;
- fExclusive = false;
- fColocationAffinity = null;
- fApplication = null;
- fValid = false;
- }
-
- public boolean isValid() {
- return fValid;
- }
-
- private boolean hasRequiredAttributes() {
- // Verify that all the required attributes are
- // defined.
- if (id == null)
- return false;
- if (version == null)
- return false;
-
- for (int i = 0; i < fChildren.size(); i++) {
- IFeatureChild child = (IFeatureChild) fChildren.elementAt(i);
- if (child.getId() == null || child.getVersion() == null)
- return false;
- }
- for (int i = 0; i < fPlugins.size(); i++) {
- IFeaturePlugin plugin = (IFeaturePlugin) fPlugins.elementAt(i);
- if (plugin.getId() == null || plugin.getVersion() == null)
- return false;
-
- }
- for (int i = 0; i < fData.size(); i++) {
- IFeatureData entry = (IFeatureData) fData.elementAt(i);
- if (entry.getId() == null)
- return false;
- }
- for (int i = 0; i < fImports.size(); i++) {
- IFeatureImport iimport = (IFeatureImport) fImports.elementAt(i);
- if (iimport.getId() == null)
- return false;
- }
- return true;
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<feature"); //$NON-NLS-1$
- String indent2 = indent + INDENT;
- String indenta = indent + INDENT + INDENT;
- writeIfDefined(indenta, writer, "id", getId()); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "label", getWritableString(getLabel())); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "version", getVersion()); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "provider-name", //$NON-NLS-1$
- getWritableString(fProviderName));
- writeIfDefined(indenta, writer, "plugin", //$NON-NLS-1$
- getPlugin());
- writeIfDefined(indenta, writer, "os", fOs); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "ws", fWs); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "nl", fNl); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "arch", fArch); //$NON-NLS-1$
- if (fImageName != null)
- writeIfDefined(indenta, writer,
- "image", getWritableString(fImageName)); //$NON-NLS-1$
- if (isPrimary()) {
- writer.println();
- writer.print(indenta + "primary=\"true\""); //$NON-NLS-1$
- }
- if (isExclusive()) {
- writer.println();
- writer.print(indenta + "exclusive=\"true\""); //$NON-NLS-1$
- }
- writeIfDefined(indenta, writer,
- "colocation-affinity", fColocationAffinity); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "application", fApplication); //$NON-NLS-1$
-
- writer.println(">"); //$NON-NLS-1$
- if (fHandler != null) {
- fHandler.write(indent2, writer);
- }
-
- for (int i = 0; i < 3; i++) {
- IFeatureInfo info = fInfos[i];
- if (info != null && !info.isEmpty())
- info.write(indent2, writer);
- }
-
- if (fUrl != null) {
- fUrl.write(indent2, writer);
- }
- for (int i = 0; i < fChildren.size(); i++) {
- IFeatureChild child = (IFeatureChild) fChildren.elementAt(i);
- writer.println();
- child.write(indent2, writer);
- }
- if (fImports.size() > 0) {
- writer.println();
- writer.println(indent2 + "<requires>"); //$NON-NLS-1$
- for (int i = 0; i < fImports.size(); i++) {
- IFeatureImport iimport = (IFeatureImport) fImports.get(i);
- iimport.write(indenta, writer);
- }
- writer.println(indent2 + "</requires>"); //$NON-NLS-1$
- }
- for (int i = 0; i < fPlugins.size(); i++) {
- IFeaturePlugin plugin = (IFeaturePlugin) fPlugins.elementAt(i);
- writer.println();
- plugin.write(indent2, writer);
- }
- for (int i = 0; i < fData.size(); i++) {
- IFeatureData entry = (IFeatureData) fData.elementAt(i);
- writer.println();
- entry.write(indent2, writer);
- }
- writer.println();
- writer.println(indent + "</feature>"); //$NON-NLS-1$
- }
- private void writeIfDefined(String indent, PrintWriter writer,
- String attName, String attValue) {
- if (attValue == null || attValue.trim().length() == 0)
- return;
- writer.println();
- writer.print(indent + attName + "=\"" + attValue + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /**
- * Gets the imageName.
- *
- * @return Returns a String
- */
- public String getImageName() {
- return fImageName;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureChild.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureChild.java
deleted file mode 100644
index d8af8e0..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureChild.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureChild;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.w3c.dom.Node;
-
-public class FeatureChild extends IdentifiableObject implements IFeatureChild {
- private static final long serialVersionUID = 1L;
- private String fVersion;
- private String fName;
- private boolean fOptional;
- private int fSearchLocation = ROOT;
- private int fMatch = NONE;
- private String fOs;
- private String fWs;
- private String fArch;
- private String fNl;
-
- protected void reset() {
- super.reset();
- fVersion = null;
- fOptional = false;
- fName = null;
- fSearchLocation = ROOT;
- fMatch = NONE;
- fOs = null;
- fWs = null;
- fArch = null;
- fNl = null;
- }
- protected void parse(Node node) {
- super.parse(node);
- fVersion = getNodeAttribute(node, "version"); //$NON-NLS-1$
- fName = getNodeAttribute(node, "name"); //$NON-NLS-1$
- fOptional = getBooleanAttribute(node, "optional"); //$NON-NLS-1$
- fOs = getNodeAttribute(node, "os"); //$NON-NLS-1$
- fWs = getNodeAttribute(node, "ws"); //$NON-NLS-1$
- fArch = getNodeAttribute(node, "arch"); //$NON-NLS-1$
- fNl = getNodeAttribute(node, "nl"); //$NON-NLS-1$
- String matchName = getNodeAttribute(node, "match"); //$NON-NLS-1$
- if (matchName != null) {
- for (int i = 0; i < RULE_NAME_TABLE.length; i++) {
- if (matchName.equals(RULE_NAME_TABLE[i])) {
- fMatch = i;
- break;
- }
- }
- }
- String searchLocationName = getNodeAttribute(node, "search_location"); //$NON-NLS-1$
- if (searchLocationName == null)
- searchLocationName = getNodeAttribute(node, "search-location"); //$NON-NLS-1$
- if (searchLocationName != null) {
- if (searchLocationName.equals("root")) //$NON-NLS-1$
- fSearchLocation = ROOT;
- else if (searchLocationName.equals("self")) //$NON-NLS-1$
- fSearchLocation = SELF;
- else if (searchLocationName.equals("both")) //$NON-NLS-1$
- fSearchLocation = BOTH;
- }
- //hookWithWorkspace();
- }
-
- public void loadFrom(IFeature feature) {
- id = feature.getId();
- fVersion = feature.getVersion();
- fOptional = false;
- fName = null;
- }
- /**
- * @see IFeatureChild#getVersion()
- */
- public String getVersion() {
- return fVersion;
- }
-
- public boolean isOptional() {
- return fOptional;
- }
-
- public String getName() {
- return fName;
- }
-
- public int getSearchLocation() {
- return fSearchLocation;
- }
-
- public int getMatch() {
- return fMatch;
- }
-
- public String getOS() {
- return fOs;
- }
-
- public String getWS() {
- return fWs;
- }
-
- public String getArch() {
- return fArch;
- }
-
- public String getNL() {
- return fNl;
- }
-
- public IFeature getReferencedFeature() {
- IFeatureModel workspaceModel = PDECore.getDefault()
- .getFeatureModelManager().findFeatureModel(getId(), fVersion);
- if (workspaceModel != null) {
- return workspaceModel.getFeature();
- }
- return null;
- }
-
- /**
- * @see IFeatureChild#setVersion(String)
- */
- public void setVersion(String version) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fVersion;
- this.fVersion = version;
- firePropertyChanged(P_VERSION, oldValue, version);
- }
-
- public void setName(String name) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fName;
- this.fName = name;
- firePropertyChanged(P_NAME, oldValue, name);
- }
-
- public void setMatch(int match) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fMatch);
- this.fMatch = match;
- firePropertyChanged(P_MATCH, oldValue, new Integer(match));
- }
-
- public void setSearchLocation(int searchLocation) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fSearchLocation);
- this.fSearchLocation = searchLocation;
- firePropertyChanged(
- P_SEARCH_LOCATION,
- oldValue,
- new Integer(searchLocation));
- }
-
- public void setOptional(boolean optional) throws CoreException {
- ensureModelEditable();
- Object oldValue = new Boolean(this.fOptional);
- this.fOptional = optional;
- firePropertyChanged(P_NAME, oldValue, new Boolean(optional));
- }
-
- public void setOS(String os) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fOs;
- this.fOs = os;
- firePropertyChanged(P_OS, oldValue, os);
- }
-
- public void setWS(String ws) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fWs;
- this.fWs = ws;
- firePropertyChanged(P_WS, oldValue, ws);
- }
-
- public void setArch(String arch) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fArch;
- this.fArch = arch;
- firePropertyChanged(P_ARCH, oldValue, arch);
- }
-
- public void setNL(String nl) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fNl;
- this.fNl = nl;
- firePropertyChanged(P_NL, oldValue, nl);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_VERSION)) {
- setVersion((String) newValue);
- } else if (name.equals(P_OPTIONAL)) {
- setOptional(((Boolean) newValue).booleanValue());
- } else if (name.equals(P_NAME)) {
- setName((String) newValue);
- } else if (name.equals(P_MATCH)) {
- setMatch(newValue != null ? ((Integer) newValue).intValue() : NONE);
- } else if (name.equals(P_OS)) {
- setOS((String)newValue);
- } else if (name.equals(P_WS)) {
- setWS((String)newValue);
- } else if (name.equals(P_ARCH)) {
- setArch((String)newValue);
- } else if (name.equals(P_NL)) {
- setNL((String)newValue);
- } else if (name.equals(P_SEARCH_LOCATION)) {
- setSearchLocation(
- newValue != null ? ((Integer) newValue).intValue() : ROOT);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void setId(String id) throws CoreException {
- super.setId(id);
- }
-
- /**
- * @see IWritable#write(String, PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<includes"); //$NON-NLS-1$
- String indent2 = indent + Feature.INDENT + Feature.INDENT;
- if (getId() != null) {
- writer.println();
- writer.print(indent2 + "id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getVersion() != null) {
- writer.println();
- writer.print(indent2 + "version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getName() != null) {
- writer.println();
- writer.print(indent2 + "name=\"" + getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (isOptional()) {
- writer.println();
- writer.print(indent2 + "optional=\"true\""); //$NON-NLS-1$
- }
- if (fMatch!=NONE) {
- writer.println();
- writer.print(indent2 + "match=\""+RULE_NAME_TABLE[fMatch]+"\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getOS() != null) {
- writer.println();
- writer.print(indent2 + "os=\""+getOS() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getWS() != null) {
- writer.println();
- writer.print(indent2 + "ws=\""+getWS() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getArch() != null) {
- writer.println();
- writer.print(indent2 + "arch=\""+getArch() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getNL() != null) {
- writer.println();
- writer.print(indent2 + "nl=\""+getNL() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fSearchLocation!=ROOT) {
- writer.println();
- String value=fSearchLocation==SELF?"self":"both"; //$NON-NLS-1$ //$NON-NLS-2$
- writer.print(indent2 + "search-location=\""+value+"\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureData.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureData.java
deleted file mode 100644
index 181cb04..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureData.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.File;
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IFeatureData;
-import org.w3c.dom.Node;
-
-public class FeatureData
- extends IdentifiableObject
- implements IFeatureData {
- private static final long serialVersionUID = 1L;
- private String os;
- private String ws;
- private String nl;
- private String arch;
- private long downloadSize;
- private long installSize;
-
- public FeatureData() {
- }
-
- protected void reset() {
- super.reset();
- os = null;
- ws = null;
- nl = null;
- arch = null;
- downloadSize = 0;
- installSize = 0;
- }
-
- public boolean exists() {
- String location = getModel().getInstallLocation();
- if (location.startsWith("file:")) //$NON-NLS-1$
- location = location.substring(5);
- File file = new File(location + File.separator+getId());
- return file.exists();
- }
-
- protected void parse(Node node) {
- super.parse(node);
- os = getNodeAttribute(node, "os"); //$NON-NLS-1$
- ws = getNodeAttribute(node, "ws"); //$NON-NLS-1$
- nl = getNodeAttribute(node, "nl"); //$NON-NLS-1$
- arch = getNodeAttribute(node, "arch"); //$NON-NLS-1$
- downloadSize = getIntegerAttribute(node, "download-size"); //$NON-NLS-1$
- installSize = getIntegerAttribute(node, "install-size"); //$NON-NLS-1$
- }
- protected void writeAttributes(String indent2, PrintWriter writer) {
- if (getId() != null) {
- writer.println();
- writer.print(indent2 + "id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getOS() != null) {
- writer.println();
- writer.print(indent2 + "os=\"" + getOS() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getWS() != null) {
- writer.println();
- writer.print(indent2 + "ws=\"" + getWS() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getNL() != null) {
- writer.println();
- writer.print(indent2 + "nl=\"" + getNL() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getArch() != null) {
- writer.println();
- writer.print(indent2 + "arch=\"" + getArch() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println();
- writer.print(indent2 + "download-size=\"" + getDownloadSize() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println();
- writer.print(indent2 + "install-size=\"" + getInstallSize() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<data"); //$NON-NLS-1$
- String indent2 = indent + Feature.INDENT + Feature.INDENT;
- writeAttributes(indent2, writer);
- writer.println("/>"); //$NON-NLS-1$
- //writer.println(indent + "</data>");
- }
-
- /**
- * Gets the os.
- * @return Returns a String
- */
- public String getOS() {
- return os;
- }
-
- /**
- * Sets the os.
- * @param os The os to set
- */
- public void setOS(String os) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.os;
- this.os = os;
- firePropertyChanged(P_OS, oldValue, os);
- }
-
- /**
- * Gets the ws.
- * @return Returns a String
- */
- public String getWS() {
- return ws;
- }
-
- /**
- * Sets the ws.
- * @param ws The ws to set
- */
- public void setWS(String ws) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.ws;
- this.ws = ws;
- firePropertyChanged(P_WS, oldValue, ws);
- }
-
- /**
- * Gets the nl.
- * @return Returns a String
- */
- public String getNL() {
- return nl;
- }
-
- /**
- * Sets the nl.
- * @param nl The nl to set
- */
- public void setNL(String nl) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.nl;
- this.nl = nl;
- firePropertyChanged(P_NL, oldValue, nl);
- }
-
- /**
- * Gets the arch.
- * @return Returns a String
- */
- public String getArch() {
- return arch;
- }
-
- /**
- * Sets the arch.
- * @param arch The arch to set
- */
- public void setArch(String arch) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.arch;
- this.arch = arch;
- firePropertyChanged(P_ARCH, oldValue, arch);
- }
-
- /**
- * Gets the downloadSize.
- * @return Returns a int
- */
- public long getDownloadSize() {
- return downloadSize;
- }
-
- /**
- * Sets the downloadSize.
- * @param downloadSize The downloadSize to set
- */
- public void setDownloadSize(long downloadSize) throws CoreException {
- ensureModelEditable();
- Object oldValue = new Long(this.downloadSize);
- this.downloadSize = downloadSize;
- firePropertyChanged(P_DOWNLOAD_SIZE, oldValue, new Long(downloadSize));
- }
-
- /**
- * Gets the installSize.
- * @return Returns a int
- */
- public long getInstallSize() {
- return installSize;
- }
-
- /**
- * Sets the installSize.
- * @param installSize The installSize to set
- */
- public void setInstallSize(long installSize) throws CoreException {
- ensureModelEditable();
- Object oldValue = new Long(this.installSize);
- this.installSize = installSize;
- firePropertyChanged(P_INSTALL_SIZE, oldValue, new Long(installSize));
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException {
- if (name.equals(P_OS)) {
- setOS((String)newValue);
- }
- else if (name.equals(P_WS)) {
- setWS((String)newValue);
- }
- else if (name.equals(P_NL)) {
- setNL((String)newValue);
- }
- else if (name.equals(P_ARCH)) {
- setArch((String)newValue);
- }
- else if (name.equals(P_DOWNLOAD_SIZE)) {
- setDownloadSize(newValue!=null?((Integer)newValue).intValue():0);
- }
- else if (name.equals(P_INSTALL_SIZE)) {
- setInstallSize(newValue!=null?((Integer)newValue).intValue():0);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- public String getLabel() {
- return getId();
- }
-
- public String toString() {
- return getLabel();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureFactory.java
deleted file mode 100644
index a258f5f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import org.eclipse.pde.internal.core.ifeature.IFeatureChild;
-import org.eclipse.pde.internal.core.ifeature.IFeatureData;
-import org.eclipse.pde.internal.core.ifeature.IFeatureImport;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInfo;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInstallHandler;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModelFactory;
-import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURL;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURLElement;
-
-public class FeatureFactory implements IFeatureModelFactory {
- private IFeatureModel model;
-
-public FeatureFactory(IFeatureModel model) {
- this.model = model;
-}
-
-public IFeaturePlugin createPlugin() {
- FeaturePlugin plugin = new FeaturePlugin();
- plugin.model = model;
- plugin.parent = model.getFeature();
- return plugin;
-}
-
-public IFeatureData createData() {
- FeatureData data = new FeatureData();
- data.model = model;
- data.parent = model.getFeature();
- return data;
-}
-
-public IFeatureChild createChild() {
- FeatureChild child = new FeatureChild();
- child.model = model;
- child.parent = model.getFeature();
- return child;
-}
-
-public IFeatureImport createImport() {
- FeatureImport iimport = new FeatureImport();
- iimport.model = model;
- iimport.parent = model.getFeature();
- return iimport;
-}
-public IFeatureURL createURL() {
- FeatureURL url = new FeatureURL();
- url.model = model;
- url.parent = model.getFeature();
- return url;
-}
-
-public IFeatureInstallHandler createInstallHandler() {
- FeatureInstallHandler handler = new FeatureInstallHandler();
- handler.model = model;
- handler.parent = model.getFeature();
- return handler;
-}
-
-public IFeatureInfo createInfo(int index) {
- FeatureInfo info = new FeatureInfo(index);
- info.model = model;
- info.parent = model.getFeature();
- return info;
-}
-
-public IFeatureURLElement createURLElement(IFeatureURL parent, int elementType) {
- FeatureURLElement element = new FeatureURLElement(elementType);
- element.model = model;
- element.parent = parent;
- return element;
-}
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureImport.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureImport.java
deleted file mode 100644
index bfa62fa..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureImport.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureImport;
-import org.w3c.dom.Node;
-
-public class FeatureImport
- extends VersionableObject
- implements IFeatureImport {
- private static final long serialVersionUID = 1L;
- private int fMatch = NONE;
- private int fIdMatch = PERFECT;
- private int fType = PLUGIN;
- private boolean fPatch = false;
-
- public FeatureImport() {
- }
-
- public IPlugin getPlugin() {
- if (id != null && fType == PLUGIN) {
- return PDECore.getDefault().findPlugin(id, getVersion(), fMatch);
- }
- return null;
- }
-
- public IFeature getFeature() {
- if (id != null && fType == FEATURE) {
- return PDECore.getDefault().findFeature(id, getVersion(), fMatch);
- }
- return null;
- }
-
- public int getIdMatch() {
- return fIdMatch;
- }
-
- protected void reset() {
- super.reset();
- fPatch = false;
- fType = PLUGIN;
- fMatch = NONE;
- fIdMatch = PERFECT;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- this.id = getNodeAttribute(node, "plugin"); //$NON-NLS-1$
- if (id != null)
- fType = PLUGIN;
- else {
- this.id = getNodeAttribute(node, "feature"); //$NON-NLS-1$
- if (id != null)
- fType = FEATURE;
- }
- String mvalue = getNodeAttribute(node, "match"); //$NON-NLS-1$
- if (mvalue != null && mvalue.length() > 0) {
- String[] choices = RULE_NAME_TABLE;
- for (int i = 0; i < choices.length; i++) {
- if (mvalue.equalsIgnoreCase(choices[i])) {
- fMatch = i;
- break;
- }
- }
- }
- mvalue = getNodeAttribute(node, "id-match"); //$NON-NLS-1$
-
- if (mvalue != null && mvalue.length() > 0) {
- if (mvalue.equalsIgnoreCase(RULE_PREFIX))
- fIdMatch = PREFIX;
- }
- fPatch = getBooleanAttribute(node, "patch"); //$NON-NLS-1$
- }
-
- public void loadFrom(IFeature feature) {
- reset();
- fType = FEATURE;
- id = feature.getId();
- version = feature.getVersion();
- }
-
- public int getMatch() {
- return fMatch;
- }
-
- public void setMatch(int match) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fMatch);
- this.fMatch = match;
- firePropertyChanged(P_MATCH, oldValue, new Integer(match));
- }
-
- public void setIdMatch(int idMatch) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fIdMatch);
- this.fIdMatch = idMatch;
- firePropertyChanged(P_ID_MATCH, oldValue, new Integer(idMatch));
- }
-
- public int getType() {
- return fType;
- }
-
- public void setType(int type) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fType);
- this.fType = type;
- firePropertyChanged(P_TYPE, oldValue, new Integer(type));
- }
-
- public boolean isPatch() {
- return fPatch;
- }
-
- public void setPatch(boolean patch) throws CoreException {
- ensureModelEditable();
- Boolean oldValue = new Boolean(this.fPatch);
- this.fPatch = patch;
- firePropertyChanged(P_PATCH, oldValue, new Boolean(patch));
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_MATCH)) {
- setMatch(newValue != null ? ((Integer) newValue).intValue() : 0);
- } else if (name.equals(P_ID_MATCH)) {
- setIdMatch(newValue != null ? ((Integer) newValue).intValue() : 0);
- } else if (name.equals(P_TYPE)) {
- setType(
- newValue != null ? ((Integer) newValue).intValue() : PLUGIN);
- } else if (name.equals(P_PATCH)) {
- setPatch(
- newValue != null ? ((Boolean) newValue).booleanValue() : false);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- String typeAtt = fType == FEATURE ? "feature" : "plugin"; //$NON-NLS-1$ //$NON-NLS-2$
- writer.print(indent + "<import " + typeAtt + "=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (getVersion() != null) {
- writer.print(" version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (!fPatch && fMatch != NONE) {
- writer.print(" match=\"" + RULE_NAME_TABLE[fMatch] + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fIdMatch == PREFIX) {
- writer.print(" id-match=\"prefix\""); //$NON-NLS-1$
- }
- if (fPatch) {
- writer.print(" patch=\"true\""); //$NON-NLS-1$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-
- public String toString() {
- IPlugin plugin = getPlugin();
- if (plugin != null)
- return plugin.getTranslatedName();
- IFeature feature = getFeature();
- if (feature != null)
- return feature.getLabel();
- return getId();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInfo.java
deleted file mode 100644
index f948eae..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInfo.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInfo;
-import org.w3c.dom.Node;
-
-public class FeatureInfo extends FeatureObject implements IFeatureInfo {
- private static final long serialVersionUID = 1L;
- private String url;
- private String description;
- private int index;
-
- public FeatureInfo(int index) {
- this.index = index;
- }
-
- public int getIndex() {
- return index;
- }
-
- private String getTag() {
- return IFeature.INFO_TAGS[index];
- }
-
- /*
- * @see IFeatureInfo#getURL()
- */
- public String getURL() {
- return url;
- }
-
- /*
- * @see IFeatureInfo#getDescription()
- */
- public String getDescription() {
- return description;
- }
-
- /*
- * @see IFeatureInfo#setURL(URL)
- */
- public void setURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.url;
- this.url = url;
- firePropertyChanged(P_URL, oldValue, url);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_DESC)) {
- setDescription(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_URL)) {
- setURL(newValue != null ? newValue.toString() : null);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- /*
- * @see IFeatureInfo#setDescription(String)
- */
- public void setDescription(String description) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.description;
- this.description = description;
- firePropertyChanged(P_DESC, oldValue, description);
- }
- protected void parse(Node node) {
- url = getNodeAttribute(node, "url"); //$NON-NLS-1$
- Node firstChild = node.getFirstChild();
- if (firstChild!=null)
- description = getNormalizedText(firstChild.getNodeValue());
- }
-
- public void write(String indent, PrintWriter writer) {
- String indent2 = indent + Feature.INDENT;
- String desc = description!=null?getWritableString(description.trim()):null;
- writer.println();
- writer.print(indent + "<" + getTag()); //$NON-NLS-1$
- if (url != null) {
- writer.print(" url=\"" + getWritableString(url) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println(">"); //$NON-NLS-1$
- if (desc!=null) writer.println(indent2 + desc);
- writer.println(indent + "</" + getTag() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean isEmpty() {
- if (url != null)
- return false;
- String desc = description != null ? description.trim() : null;
- if (desc != null && desc.length() > 0)
- return false;
- return true;
- }
-
- public String toString() {
- switch (index) {
- case IFeature.INFO_DESCRIPTION :
- return PDECoreMessages.FeatureInfo_description;
- case IFeature.INFO_LICENSE :
- return PDECoreMessages.FeatureInfo_license;
- case IFeature.INFO_COPYRIGHT :
- return PDECoreMessages.FeatureInfo_copyright;
- }
- return super.toString();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInstallHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInstallHandler.java
deleted file mode 100644
index 7cf69d9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureInstallHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IFeatureInstallHandler;
-import org.w3c.dom.Node;
-
-public class FeatureInstallHandler
- extends FeatureObject
- implements IFeatureInstallHandler {
- private static final long serialVersionUID = 1L;
- private String fLibrary;
- private String fHandlerName;
-
- /*
- * @see IFeatureInstallHandler#getLibrary()
- */
- public String getLibrary() {
- return fLibrary;
- }
-
- /*
- * @see IFeatureInstallHandler#getClassName()
- */
- public String getHandlerName() {
- return fHandlerName;
- }
-
- /*
- * @see IFeatureInstallHandler#setLibrary(String)
- */
- public void setLibrary(String library) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fLibrary;
- this.fLibrary = library;
- firePropertyChanged(P_LIBRARY, oldValue, library);
- }
-
- /*
- * @see IFeatureInstallHandler#setClassName(String)
- */
- public void setHandlerName(String handlerName) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fHandlerName;
- this.fHandlerName = handlerName;
- firePropertyChanged(P_HANDLER_NAME, oldValue, handlerName);
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_LIBRARY)) {
- setLibrary((String) newValue);
- } else if (name.equals(P_HANDLER_NAME)) {
- setHandlerName((String) newValue);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
- protected void parse(Node node) {
- fLibrary = getNodeAttribute(node, "library"); //$NON-NLS-1$
- fHandlerName = getNodeAttribute(node, "handler"); //$NON-NLS-1$
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<install-handler"); //$NON-NLS-1$
- if (fLibrary != null) {
- writer.print(" library=\"" + fLibrary + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fHandlerName != null) {
- writer.print(" handler=\"" + fHandlerName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println("/>"); //$NON-NLS-1$
- //writer.println(indent + "</install-handler>");
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureObject.java
deleted file mode 100644
index db9b878..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureObject.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.ifeature.IFeatureObject;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.w3c.dom.Node;
-
-public abstract class FeatureObject
- extends PlatformObject
- implements IFeatureObject {
- transient IFeatureModel model;
- transient IFeatureObject parent;
- protected String label;
- boolean inTheModel;
-
- void setInTheModel(boolean value) {
- inTheModel = value;
- }
-
- public boolean isInTheModel() {
- return inTheModel;
- }
-
- protected void ensureModelEditable() throws CoreException {
- if (!model.isEditable()) {
- throwCoreException(PDECoreMessages.FeatureObject_readOnlyChange);
- }
- }
- protected void firePropertyChanged(
- String property,
- Object oldValue,
- Object newValue) {
- firePropertyChanged(this, property, oldValue, newValue);
- }
- protected void firePropertyChanged(
- IFeatureObject object,
- String property,
- Object oldValue,
- Object newValue) {
- if (model.isEditable()) {
- IModelChangeProvider provider = model;
- provider.fireModelObjectChanged(object, property, oldValue, newValue);
- }
- }
- protected void fireStructureChanged(IFeatureObject child, int changeType) {
- fireStructureChanged(new IFeatureObject[] { child }, changeType);
- }
- protected void fireStructureChanged(
- IFeatureObject[] children,
- int changeType) {
- IFeatureModel model = getModel();
- if (model.isEditable()) {
- IModelChangeProvider provider = model;
- provider.fireModelChanged(new ModelChangedEvent(provider, changeType, children, null));
- }
- }
- public IFeature getFeature() {
- return model.getFeature();
- }
- public String getLabel() {
- return label;
- }
-
- public String getTranslatableLabel() {
- if (label == null)
- return ""; //$NON-NLS-1$
- return model.getResourceString(label);
- }
- public IFeatureModel getModel() {
- return model;
- }
- String getNodeAttribute(Node node, String name) {
- Node attribute = node.getAttributes().getNamedItem(name);
- if (attribute != null)
- return attribute.getNodeValue();
- return null;
- }
-
- int getIntegerAttribute(Node node, String name) {
- String value = getNodeAttribute(node, name);
- if (value != null) {
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException e) {
- }
- }
- return 0;
- }
-
- boolean getBooleanAttribute(Node node, String name) {
- String value = getNodeAttribute(node, name);
- if (value != null) {
- return value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- return false;
- }
-
- protected String getNormalizedText(String source) {
- String result = source.replace('\t', ' ');
- result = result.trim();
-
- return result;
- }
-
- public IFeatureObject getParent() {
- return parent;
- }
-
- protected void parse(Node node) {
- label = getNodeAttribute(node, "label"); //$NON-NLS-1$
- }
-
- protected void reset() {
- label = null;
- }
-
- public void setLabel(String newLabel) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.label;
- label = newLabel;
- firePropertyChanged(P_LABEL, oldValue, newLabel);
- }
- protected void throwCoreException(String message) throws CoreException {
- Status status =
- new Status(IStatus.ERROR, PDECore.getPluginId(), IStatus.OK, message, null);
- CoreException ce = new CoreException(status);
- ce.fillInStackTrace();
- throw ce;
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_LABEL)) {
- setLabel(newValue != null ? newValue.toString() : null);
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- }
- public void setModel(IFeatureModel model) {
- this.model = model;
- }
-
- public void setParent(IFeatureObject parent) {
- this.parent = parent;
- }
-
- protected String getWritableString(String source) {
- return CoreUtility.getWritableString(source);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java
deleted file mode 100644
index d2c1216..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ModelEntry;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PluginModelManager;
-import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
-import org.w3c.dom.Node;
-
-public class FeaturePlugin extends FeatureData implements IFeaturePlugin {
- private static final long serialVersionUID = 1L;
- private boolean fFragment;
- private String fVersion;
- private boolean fUnpack = true;
-
- public FeaturePlugin() {
- }
-
- protected void reset() {
- super.reset();
- fVersion = null;
- fFragment = false;
- }
-
- public boolean isFragment() {
- return fFragment;
- }
-
- public IPluginBase getPluginBase() {
- if (id == null) {
- return null;
- }
- PluginModelManager manager = PDECore.getDefault().getModelManager();
- ModelEntry entry = manager.findEntry(id);
- if (entry != null) {
- IPluginModelBase model = entry.getActiveModel();
- if (fFragment && model instanceof IFragmentModel)
- return model.getPluginBase();
- else if (!fFragment && model instanceof IPluginModel)
- return model.getPluginBase();
- }
- return null;
- }
-
- public String getVersion() {
- return fVersion;
- }
- public boolean isUnpack() {
- return fUnpack;
- }
- public void setVersion(String version) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fVersion;
- this.fVersion = version;
- firePropertyChanged(this, P_VERSION, oldValue, version);
- }
-
- public void setUnpack(boolean unpack) throws CoreException {
- ensureModelEditable();
- boolean oldValue = fUnpack;
- this.fUnpack = unpack;
- firePropertyChanged(this, P_UNPACK, new Boolean(oldValue), new Boolean(unpack));
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_VERSION)) {
- setVersion(newValue != null ? newValue.toString() : null);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void setFragment(boolean fragment) throws CoreException {
- ensureModelEditable();
- this.fFragment = fragment;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- fVersion = getNodeAttribute(node, "version"); //$NON-NLS-1$
- String f = getNodeAttribute(node, "fragment"); //$NON-NLS-1$
- if (f != null && f.equalsIgnoreCase("true")) //$NON-NLS-1$
- fFragment = true;
- String unpack = getNodeAttribute(node, "unpack"); //$NON-NLS-1$
- if (unpack != null && unpack.equalsIgnoreCase("false")) //$NON-NLS-1$
- fUnpack = false;
- }
-
- public void loadFrom(IPluginBase plugin) {
- id = plugin.getId();
- label = plugin.getTranslatedName();
- fVersion = plugin.getVersion();
- fFragment = plugin instanceof IFragment;
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<plugin"); //$NON-NLS-1$
- String indent2 = indent + Feature.INDENT + Feature.INDENT;
- writeAttributes(indent2, writer);
- if (getVersion() != null) {
- writer.println();
- writer.print(indent2 + "version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (isFragment()) {
- writer.println();
- writer.print(indent2 + "fragment=\"true\""); //$NON-NLS-1$
- }
- if (!isUnpack()) {
- writer.println();
- writer.print(indent2 + "unpack=\"false\""); //$NON-NLS-1$
- }
- writer.println("/>"); //$NON-NLS-1$
- //writer.println(indent + "</plugin>");
- }
-
- public String getLabel() {
- IPluginBase pluginBase = getPluginBase();
- if (pluginBase != null) {
- return pluginBase.getTranslatedName();
- }
- String name = super.getLabel();
- if (name == null)
- name = getId();
- return name;
- }
-
- public String toString() {
- return getLabel();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURL.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURL.java
deleted file mode 100644
index 2d66ed7..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURL.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-import java.util.Locale;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURL;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURLElement;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class FeatureURL extends FeatureObject implements IFeatureURL {
- private static final long serialVersionUID = 1L;
- private IFeatureURLElement fUpdate;
- private Vector fDiscoveries = new Vector();
-
- public void addDiscovery(IFeatureURLElement discovery) throws CoreException {
- ensureModelEditable();
- fDiscoveries.add(discovery);
- ((FeatureURLElement)discovery).setInTheModel(true);
- fireStructureChanged(discovery, IModelChangedEvent.INSERT);
- }
- public void setUpdate(IFeatureURLElement update) throws CoreException {
- ensureModelEditable();
- if(fUpdate == update){
- return;
- }
- if(fUpdate!=null){
- ((FeatureURLElement)fUpdate).setInTheModel(false);
- }
- IFeatureURLElement oldValue = fUpdate;
- fUpdate = update;
- if(oldValue!=null){
- fireStructureChanged(oldValue, IModelChangedEvent.REMOVE);
- }
- if(update!=null){
- ((FeatureURLElement)update).setInTheModel(true);
- fireStructureChanged(update, IModelChangedEvent.INSERT);
- }
- }
- public IFeatureURLElement[] getDiscoveries() {
- return (IFeatureURLElement[]) fDiscoveries
- .toArray(new IFeatureURLElement[fDiscoveries.size()]);
- }
- public IFeatureURLElement getUpdate() {
- return fUpdate;
- }
- protected void parse(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String tag = child.getNodeName().toLowerCase(Locale.ENGLISH);
- int urlType = -1;
- if (tag.equals("update")) { //$NON-NLS-1$
- urlType = IFeatureURLElement.UPDATE;
- } else if (tag.equals("discovery")) { //$NON-NLS-1$
- urlType = IFeatureURLElement.DISCOVERY;
- }
- if (urlType != -1) {
- IFeatureURLElement element =
- getModel().getFactory().createURLElement(this, urlType);
- ((FeatureURLElement) element).parse(child);
- if (urlType == IFeatureURLElement.UPDATE) {
- ((FeatureURLElement)element).setInTheModel(true);
- fUpdate = element;
- }
- else if (urlType == IFeatureURLElement.DISCOVERY) {
- ((FeatureURLElement)element).setInTheModel(true);
- fDiscoveries.add(element);
- }
- }
- }
- }
- }
- public void removeDiscovery(IFeatureURLElement discovery)
- throws CoreException {
- ensureModelEditable();
- fDiscoveries.remove(discovery);
- ((FeatureURLElement)discovery).setInTheModel(false);
- fireStructureChanged(discovery, IModelChangedEvent.REMOVE);
- }
- public void write(String indent, PrintWriter writer) {
- if(fUpdate == null && fDiscoveries.size() <=0){
- return;
- }
- writer.println();
- writer.println(indent + "<url>"); //$NON-NLS-1$
- String indent2 = indent + Feature.INDENT;
- if(fUpdate!=null) {
- fUpdate.write(indent2, writer);
- }
- for (int i = 0; i < fDiscoveries.size(); i++) {
- IFeatureURLElement element = (IFeatureURLElement) fDiscoveries.elementAt(i);
- element.write(indent2, writer);
- }
- writer.println(indent + "</url>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURLElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURLElement.java
deleted file mode 100644
index 2f9d5dc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureURLElement.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IFeatureURLElement;
-import org.w3c.dom.Node;
-
-public class FeatureURLElement
- extends FeatureObject
- implements IFeatureURLElement {
- private static final long serialVersionUID = 1L;
- private int fElementType;
- private int fSiteType = UPDATE_SITE;
- private URL fUrl;
-
- public FeatureURLElement(int elementType) {
- this.fElementType = elementType;
- }
- public FeatureURLElement(int elementType, URL url) {
- this.fElementType = elementType;
- this.fUrl = url;
- }
- public int getElementType() {
- return fElementType;
- }
- public URL getURL() {
- return fUrl;
- }
- public int getSiteType() {
- return fSiteType;
- }
- protected void parse(Node node) {
- super.parse(node);
- String urlName = getNodeAttribute(node, "url"); //$NON-NLS-1$
- try {
- if(urlName!=null)
- fUrl = new URL(urlName);
- } catch (MalformedURLException e) {
- }
- String typeName = getNodeAttribute(node, "type"); //$NON-NLS-1$
- if (typeName != null && typeName.equals("web")) //$NON-NLS-1$
- fSiteType = WEB_SITE;
- }
-
- public void setURL(URL url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fUrl;
- this.fUrl = url;
- firePropertyChanged(this, P_URL, oldValue, url);
- }
-
- public void setSiteType(int type) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fSiteType);
- this.fSiteType = type;
- firePropertyChanged(this, P_URL, oldValue, new Integer(type));
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_URL)) {
- setURL((URL) newValue);
- } else if (name.equals(P_SITE_TYPE)) {
- setSiteType(((Integer) newValue).intValue());
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public String toString() {
- if (label != null)
- return label;
- if (fUrl != null)
- return fUrl.toString();
- return super.toString();
- }
- public void write(String indent, PrintWriter writer) {
- String tag = null;
- switch (fElementType) {
- case UPDATE :
- tag = "update"; //$NON-NLS-1$
- break;
- case DISCOVERY :
- tag = "discovery"; //$NON-NLS-1$
- break;
- }
- if (tag == null)
- return;
- writer.print(indent + "<" + tag); //$NON-NLS-1$
- if (label != null && label.length()>0) {
- writer.print(" label=\"" + getWritableString(label) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fUrl != null) {
- writer.print(" url=\"" + getWritableString(fUrl.toString()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (fSiteType == WEB_SITE) {
- writer.print(" type=\"web\""); //$NON-NLS-1$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/IdentifiableObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/IdentifiableObject.java
deleted file mode 100644
index bf635c1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/IdentifiableObject.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-import org.w3c.dom.Node;
-
-public class IdentifiableObject extends FeatureObject implements IIdentifiable {
- private static final long serialVersionUID = 1L;
- protected String id;
-
- public String getId() {
- return id;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- id = getNodeAttribute(node, "id"); //$NON-NLS-1$
- }
-
- public void setId(String id) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.id;
- this.id = id;
- firePropertyChanged(this, P_ID, oldValue, id);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException {
- if (name.equals(P_ID)) {
- setId(newValue!=null ? newValue.toString() : null);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- protected void reset() {
- super.reset();
- id = null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/VersionableObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/VersionableObject.java
deleted file mode 100644
index ef8a046..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/VersionableObject.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IVersionable;
-import org.w3c.dom.Node;
-
-public class VersionableObject
- extends IdentifiableObject
- implements IVersionable {
- private static final long serialVersionUID = 1L;
- protected String version;
-
- public String getVersion() {
- return version;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- version = getNodeAttribute(node, "version"); //$NON-NLS-1$
- }
-
- public void setVersion(String version) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.version;
- this.version = version;
- firePropertyChanged(this, P_VERSION, oldValue, version);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_VERSION)) {
- setVersion(newValue != null ? newValue.toString() : null);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- protected void reset() {
- super.reset();
- version = null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel.java
deleted file mode 100644
index 84f8ddb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/WorkspaceFeatureModel.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.feature;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDECore;
-
-public class WorkspaceFeatureModel extends AbstractFeatureModel
- implements
- IEditableModel {
- private static final long serialVersionUID = 1L;
- private boolean dirty;
- private IFile file;
- private boolean editable = true;
-
- public WorkspaceFeatureModel() {
- super();
- }
- public WorkspaceFeatureModel(IFile file) {
- setFile(file);
- }
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(event.getChangeType() != IModelChangedEvent.WORLD_CHANGED);
- super.fireModelChanged(event);
- }
-
- protected NLResourceHelper createNLResourceHelper() {
- try {
- IPath path = file.getLocation().removeLastSegments(1);
- String installLocation = path.toOSString();
- if (installLocation.startsWith("file:") == false) //$NON-NLS-1$
- installLocation = "file:" + installLocation; //$NON-NLS-1$
- URL url = new URL(installLocation + "/"); //$NON-NLS-1$
- String name = "feature"; //$NON-NLS-1$
- NLResourceHelper helper = new NLResourceHelper(name, new URL[]{url});
- //helper.setFile(file);
- return helper;
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- setLoaded(true);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
- public IFile getFile() {
- return file;
- }
- public String getInstallLocation() {
- return file.getParent().getLocation().toOSString();
- }
- public IResource getUnderlyingResource() {
- return file;
- }
- public boolean isDirty() {
- return dirty;
- }
- public boolean isEditable() {
- return editable;
- }
-
- public boolean isInSync() {
- return isInSync(file.getLocation().toFile());
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(file.getLocation().toFile());
- }
- public void load() {
- if (file == null)
- return;
- if (file.exists()) {
- try {
- InputStream stream = file.getContents(true);
- load(stream, false);
- stream.close();
- } catch (CoreException e) {
- } catch (IOException e) {
- PDECore.logException(e);
- }
- } else {
- this.feature = new Feature();
- feature.model = this;
- setLoaded(true);
- }
- }
- public void save() {
- if (file == null)
- return;
- try {
- String contents = getContents();
- ByteArrayInputStream stream = new ByteArrayInputStream(contents
- .getBytes("UTF8")); //$NON-NLS-1$
- if (file.exists()) {
- file.setContents(stream, false, false, null);
- } else {
- file.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- //writer.println("<!DOCTYPE feature SYSTEM \"dtd/feature.dtd\">");
- feature.write("", writer); //$NON-NLS-1$
- }
- setDirty(false);
- }
- public void setDirty(boolean dirty) {
- this.dirty = dirty;
- }
- public void setEditable(boolean newEditable) {
- editable = newEditable;
- }
- public void setFile(IFile newFile) {
- file = newFile;
- //setEditable(newFile.isReadOnly()==false);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundle.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundle.java
deleted file mode 100644
index 9e5bbc3..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundle.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-public interface IBundle {
-
- void setHeader(String key, String value);
-
- void renameHeader(String key, String newKey);
-
- String getHeader(String key);
-
- IManifestHeader getManifestHeader(String key);
-
- IBundleModel getModel();
-
- String getLocalization();
-
- void setLocalization(String localization);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragment.java
deleted file mode 100644
index 916a42b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragment.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.plugin.IFragment;
-
-/**
- * An extension of bundle plug-in base that is used
- * specifically for root model objects of fragments with
- * OSGi manifest. The goal is to continue to preserve
- * pre-3.0 compatibility for all the clients that
- * depend on IFragment interface.
- *
- * @since 3.0
- */
-public interface IBundleFragment extends IBundlePluginBase, IFragment {
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragmentModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragmentModel.java
deleted file mode 100644
index 4e1e15d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleFragmentModel.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.plugin.IFragmentModel;
-
-/**
- * An extension of the bundle plug-in model base that
- * is used specifically for fragment models with OSGi manifests.
- *
- * @since 3.0
- */
-public interface IBundleFragmentModel
- extends IBundlePluginModelBase, IFragmentModel {
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModel.java
deleted file mode 100644
index 83a5bc5..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModel.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-/**
- * This model is created from the "META-INF/MANIFEST.MF" file that represents
- * the plug-in manifest in Eclipse 3.0 OSGi format.
- * <p>
- * If this model is editable, isEditable() will return true and the model
- * instance will implement IEditable interface. The model is capable of
- * providing change notification for the registered listeners.
- *
- * @since 3.0
- */
-public interface IBundleModel extends IModel, IModelChangeProvider {
- /**
- * Returns the top-level model object of this model.
- *
- * @return an object containing the manifest headers
- */
- IBundle getBundle();
- /**
- * Returns the location of the file used to create the model.
- *
- * @return the location of the manifest file or <samp>null </samp> if the
- * file is in a workspace.
- */
- public String getInstallLocation();
- /**
- * Tests whether this is a model of a fragment bundle.
- *
- * @return <code>true</code> if this is a fragment model,
- * <code>false</code> otherwise.
- */
- public boolean isFragmentModel();
-
- public IBundleModelFactory getFactory();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModelFactory.java
deleted file mode 100644
index ba05cb4..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundleModelFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-/**
- * This factory should be used to create
- * instances of a manifest.mf header.
- */
-public interface IBundleModelFactory {
-
- /**
- * Creates a new manifest header
- * @return a new manifest header instance
- */
- IManifestHeader createHeader();
-
- /**
- * Creates a new manifest header
- *
- * @param key the manifest header key
- * @param value the manifest header value
- *
- * @return a new manifest header instance
- */
- IManifestHeader createHeader(String key, String value);
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePlugin.java
deleted file mode 100644
index 21bee6e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePlugin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.plugin.IPlugin;
-
-/**
- * An extension of bundle plug-in base that is used
- * specifically for root model objects of plug-ins with
- * OSGi manifest. The goal is to continue to preserve
- * pre-3.0 compatibility for all the clients that
- * depend on IPlugin interface.
- */
-public interface IBundlePlugin extends IBundlePluginBase, IPlugin {
-
- boolean hasExtensibleAPI();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginBase.java
deleted file mode 100644
index bbac277..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginBase.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.IModelChangedListener;
-import org.eclipse.pde.core.plugin.IPluginBase;
-
-/**
- * This interface represents an adapter that merges the notion of
- * a plug-in base (either plug-in or fragment) and OSGi bundle.
- * The goal is to maintain the expected plug-in interface
- * to the rest of the framework for both classic plug-ins
- * (with plugin.xml/fragment.xml) and new style (OSGi)
- * plug-ins with META-INF/MANIFEST.MF file.
- */
-public interface IBundlePluginBase extends IPluginBase, IModelChangedListener {
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModel.java
deleted file mode 100644
index 6f96a45..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModel.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.pde.core.plugin.IPluginModel;
-
-/**
- * An extension of the bundle plug-in model base that
- * is used specifically for plug-in models with OSGi manifests.
- *
- * @since 3.0
- */
-public interface IBundlePluginModel
- extends IBundlePluginModelBase, IPluginModel {
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelBase.java
deleted file mode 100644
index 38ea6c2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelBase.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-import org.eclipse.pde.core.IEditable;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
-/**
- * An adapter of the pre-3.0 plug-in model base interface that is capable of
- * maintaining the predictable facade when dealing with plug-in with OSGi
- * manifest files. The goal is to use the same adapter interface with the
- * manifest coming and going and transparently switch between
- * META-INF/MANIFEST.MF and plugin.xml/fragment.xml.
- *
- * @since 3.0
- */
-public interface IBundlePluginModelBase extends IPluginModelBase, IEditable {
- /**
- * Returns the underlying OSGi bundle model object if bundle manifest is
- * present.
- *
- * @return OSGi bundle model or <code>null</code> if bundle manifest is
- * not present.
- */
- IBundleModel getBundleModel();
- /**
- * Returns the model that is responsible for tracking extensions and
- * extension points. Typically this content is stored in plugin.xml file.
- *
- * @return extensions model or <code>null</code> if not present.
- */
- ISharedExtensionsModel getExtensionsModel();
- /**
- * Sets the bundle manifest model for this adapter. All calls related to
- * data that is normally stored in this model (e.g. plug-in ID, plug-in
- * name, provider name etc.) will be delegated to it if not
- * <code>null</code>.
- *
- * @param bundleModel
- * the bundle model to use in this adapter or <code>null</code>
- * if there is no bundle model.
- */
- void setBundleModel(IBundleModel bundleModel);
- /**
- * Sets the extensions model for this adapter. All the calls related to
- * extensions and extension points will be delegated to this model if not
- * <code>null</code>.
- *
- * @param extensionsModel
- * the model that stores extensions and extension points
- */
- void setExtensionsModel(ISharedExtensionsModel extensionsModel);
- /**
- * Factory method for creating a new import object. This is important for
- * maintaining the adapter because <code>IPluginBase</code> returns an
- * array of <code>IPluginImport</code> objects for dependency information.
- *
- * @return a newly created import object
- */
- IPluginImport createImport();
- /**
- * Factory method for creating a new runtime object. This is important for
- * maintaining the adapter because <code>IPluginBase</code> returns an
- * array of <code>IPluginLibrary</code> objects for runtime information.
- *
- * @return a newly created plug-in library object
- */
- IPluginLibrary createLibrary();
- /**
- * Saves the adapter by delegating the operation to the underlying models
- * that need saving.
- */
- void save();
-
- /**
- * Returns the bundle localization
- * @return the bundle localization
- */
- String getBundleLocalization();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelProvider.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelProvider.java
deleted file mode 100644
index cbaf4e8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IBundlePluginModelProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-
-/**
- * Models that implement this interface can provide a reference
- * of the bundle plug-in model that owns the model in question.
- * This interface allows objects of these models to reach up
- * to the parent adapter without making too many assumptions
- * about the nature of the parent. Models that don't have
- * bundle plug-in model parent are required to return <code>null</code>.
- *
- * @since 3.0
- */
-public interface IBundlePluginModelProvider {
-/**
- * Returns the parent bundle plug-in model if the provider
- * belongs to it.
- * @return the parent bundle plug-in model or <code>null</code>
- * if the provider does not have a bundle plug-in model parent.
- */
- IBundlePluginModelBase getBundlePluginModel();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IManifestHeader.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IManifestHeader.java
deleted file mode 100644
index 6c03247..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ibundle/IManifestHeader.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ibundle;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.text.IDocumentKey;
-
-
-public interface IManifestHeader extends IDocumentKey {
-
- /**
- * Returns the header key
- */
- String getKey();
-
- /**
- * Returns the header value
- */
- String getValue();
-
- /**
- * Sets the name of the header
- * This method will throw a CoreException if the model
- * is not editable.
- *
- * @param key the header key
- */
- void setKey(String key) throws CoreException;
-
- /**
- * Sets the value of the header
- * This method will throw a CoreException if the model
- * is not editable.
- *
- * @param value the header value
- */
- void setValue(String value);
-
- /**
- * Forces the header to update its value based on the current components,
- * attributes and directives it contains.
- *
- */
- void update();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IEnvironment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IEnvironment.java
deleted file mode 100644
index ef8d242..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IEnvironment.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface IEnvironment {
- static final String P_OS = "os"; //$NON-NLS-1$
- static final String P_WS = "ws"; //$NON-NLS-1$
- static final String P_ARCH = "arch"; //$NON-NLS-1$
- static final String P_NL = "nl"; //$NON-NLS-1$
-
- String getOS();
- String getWS();
- String getArch();
- String getNL();
-
- void setOS(String os) throws CoreException;
- void setWS(String ws) throws CoreException;
- void setArch(String arch) throws CoreException;
- void setNL(String nl) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeature.java
deleted file mode 100644
index be4ecb3..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeature.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-/**
- * The top-level model object of the Eclipse feature model.
- */
-public interface IFeature extends IFeatureObject, IVersionable, IEnvironment {
- /**
- * The name of the property that will be used to notify
- * about changes in "description" field
- */
- public static final String P_DESCRIPTION = "description"; //$NON-NLS-1$
- /**
- * The name of the property that will be used to notify
- * about changes in "copyright" field
- */
- public static final String P_COPYRIGHT = "copyright"; //$NON-NLS-1$
- /**
- * The name of the property that will be used to notify
- * about changes in "license" field
- */
- public static final String P_LICENSE = "license"; //$NON-NLS-1$
- /**
- * The name of the property that will be used to notify
- * about changes in "provider" field
- */
- public static final String P_PROVIDER = "provider"; //$NON-NLS-1$
- /**
- * The name of the property that will be used to notify
- * about changes in "image" field
- */
- public static final String P_IMAGE = "image"; //$NON-NLS-1$
- /**
- * The name of the property that will be used to notify
- * about changes in "url" field
- */
- public static final String P_URL = "url"; //$NON-NLS-1$
-
- public static final String P_INSTALL_HANDLER = "installHandler"; //$NON-NLS-1$
-
- public static final String P_PRIMARY = "primary"; //$NON-NLS-1$
- public static final String P_EXCLUSIVE = "exclusive"; //$NON-NLS-1$
- public static final String P_PLUGIN = "plugin"; //$NON-NLS-1$
-
- public static final String P_COLLOCATION_AFFINITY = "colocation-affinity"; //$NON-NLS-1$
- public static final String P_APPLICATION = "application"; //$NON-NLS-1$
-
- public static final int INFO_DESCRIPTION = 0;
- public static final int INFO_COPYRIGHT = 1;
- public static final int INFO_LICENSE = 2;
-
- public static final String[] INFO_TAGS =
- { "description", "copyright", "license" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- /**
- * Adds a plug-in reference to this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param reference a plug-in reference to add
- */
- public void addPlugins(IFeaturePlugin[] plugins) throws CoreException;
- /**
- * Adds a data reference to this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param entries a data entries to add
- */
- public void addData(IFeatureData[] entries) throws CoreException;
-
- /**
- * Adds included feature to this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param features features to include
- */
- public void addIncludedFeatures(IFeatureChild[] features)
- throws CoreException;
-
- /**
- * Remove included feature from this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param features included features to remove
- */
- public void removeIncludedFeatures(IFeatureChild[] features)
- throws CoreException;
-
- /**
- * Adds a required plug-in reference to this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param reference a required plug-in reference to add
- */
- public void addImports(IFeatureImport[] imports) throws CoreException;
- /**
- * Returns references to plug-ins in this feature
- *
- * @return an array of plug-in references in this feature
- */
- public IFeaturePlugin[] getPlugins();
- /**
- * Returns references to data in this feature
- *
- * @return an array of data references in this feature
- */
- public IFeatureData[] getData();
-
- /**
- * Returns references to required plug-ins in this feature
- *
- * @return an array of plug-in references in this feature
- */
- public IFeatureImport[] getImports();
-
- /**
- * Returns references to included features
- *
- * @return an array of feature references included in this feature
- */
- public IFeatureChild[] getIncludedFeatures();
-
- /**
- * Returns a feature provider name
- *
- * @return the feature provider name, or <samp>null</samp> if not set
- */
- public String getProviderName();
- /**
- * Returns a feature image name
- *
- * @return the feature image name, or <samp>null</samp> if not set
- */
- public String getImageName();
- /**
- *
- */
- IPluginModelBase getReferencedModel(IFeaturePlugin reference);
- /**
- * Returns a feature URL model object
- *
- * @return the feature URL model object, or <samp>null</samp> if not set
- */
- public IFeatureURL getURL();
-
- public IFeatureInstallHandler getInstallHandler();
- public void setInstallHandler(IFeatureInstallHandler handler)
- throws CoreException;
-
- public IFeatureInfo getFeatureInfo(int index);
-
- public void setFeatureInfo(IFeatureInfo info, int index)
- throws CoreException;
-
- /**
- * Removes a plug-in reference from this feature. This
- * method may throw a CoreException if the model
- * is not editable.
- *
- * @param plugin a plug-in reference to remove
- */
- public void removePlugins(IFeaturePlugin[] plugins) throws CoreException;
- /**
- * Removes a data reference from this feature. This
- * method may throw a CoreException if the model
- * is not editable.
- *
- * @param entries data entries to remove
- */
- public void removeData(IFeatureData[] entries) throws CoreException;
- /**
- * Removes a required plug-in reference from this feature.
- * This method may throw a CoreException if
- * the model is not editable.
- *
- * @param iimport a required plug-in reference to add
- */
- public void removeImports(IFeatureImport[] imports) throws CoreException;
- /**
- * Sets the provider name of this feature. This method
- * may throw a CoreException if the model is not editable.
- *
- * @param the new provider name
- */
- public void setProviderName(String providerName) throws CoreException;
- /**
- * Sets the image name of this feature. This method
- * may throw a CoreException if the model is not editable.
- *
- * @param the new image name
- */
- public void setImageName(String imageName) throws CoreException;
- /**
- /**
- * Sets the URL model object of this feature.
- *
- *@param url The URL model object.
- */
- public void setURL(IFeatureURL url) throws CoreException;
-
- public void computeImports() throws CoreException;
-
- boolean isPrimary();
- public void setPrimary(boolean value) throws CoreException;
-
- boolean isExclusive();
- public void setExclusive(boolean value) throws CoreException;
-
- String getPlugin();
- void setPlugin(String value) throws CoreException;
-
- String getColocationAffinity();
- void setColocationAffinity(String value) throws CoreException;
- String getApplication();
- void setApplication(String value) throws CoreException;
-
- boolean isValid();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureChild.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureChild.java
deleted file mode 100644
index 5dd750f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureChild.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-import org.eclipse.pde.core.plugin.IMatchRules;
-/**
- * The reference to a plug-in that is part of this feature.
- */
-public interface IFeatureChild extends IFeatureObject, IIdentifiable, IMatchRules, IEnvironment {
- String P_VERSION = "version"; //$NON-NLS-1$
- String P_OPTIONAL = "optional"; //$NON-NLS-1$
- String P_NAME = "name"; //$NON-NLS-1$
- String P_MATCH = "match"; //$NON-NLS-1$
- String P_SEARCH_LOCATION = "search-location"; //$NON-NLS-1$
-
- int ROOT = 0;
- int SELF = 1;
- int BOTH = 2;
-
- String getVersion();
- void setVersion(String version) throws CoreException;
- boolean isOptional();
- void setOptional(boolean optional) throws CoreException;
- String getName();
- void setName(String name) throws CoreException;
- int getSearchLocation();
- void setSearchLocation(int location) throws CoreException;
- int getMatch();
- void setMatch(int match) throws CoreException;
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureData.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureData.java
deleted file mode 100644
index 24e4e78..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureData.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-public interface IFeatureData extends IFeatureEntry {
- /**
- * Tests if the library that this object points to
- * exists in the project.
- */
- public boolean exists();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java
deleted file mode 100644
index 648d64b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-/**
- * The reference to a plug-in that is part of this feature.
- */
-public interface IFeatureEntry extends IFeatureObject, IIdentifiable {
- String P_OS = "p_os"; //$NON-NLS-1$
- String P_WS = "p_ws"; //$NON-NLS-1$
- String P_NL = "p_nl"; //$NON-NLS-1$
- String P_ARCH = "p_arch"; //$NON-NLS-1$
- String P_DOWNLOAD_SIZE = "p_download_size"; //$NON-NLS-1$
- String P_INSTALL_SIZE = "p_install_size"; //$NON-NLS-1$
-
- /**
- * Returns a comma-separated list of the operating systems this plug-in supports.
- */
- public String getOS();
- /**
- * Returns a comma-separated list of the window systems this plug-in supports.
- */
- public String getWS();
- /**
- * Returns a comma-separated list of the locales this plug-in supports.
- */
- public String getNL();
- /**
- * Returns a comma-separated list of the architecture this plug-in supports.
- */
- public String getArch();
- /**
- * Returns estimated download size of this plug-in.
- */
- public long getDownloadSize();
- /**
- * Returns estimated size of this plug-in when installed.
- */
- public long getInstallSize();
- /**
- * Sets a comma-separated list of the operating systems this plug-in supports.
- */
- public void setOS(String os) throws CoreException;
- /**
- * Sets a comma-separated list of the window systems this plug-in supports.
- */
- public void setWS(String ws) throws CoreException;
- /**
- * Sets a comma-separated list of the locales this plug-in supports.
- */
- public void setNL(String nl) throws CoreException;
- /**
- * Sets a comma-separated list of the archiecture this plug-in supports.
- */
- public void setArch(String arch) throws CoreException;
- /**
- * Sets the estimated download size of this plug-in.
- */
- public void setDownloadSize(long size) throws CoreException;
- /**
- * Sets the estimated size of this plug-in when installed.
- */
- public void setInstallSize(long size) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureImport.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureImport.java
deleted file mode 100644
index b53b9c4..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureImport.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginReference;
-
-public interface IFeatureImport extends IFeatureObject, IPluginReference {
- String P_TYPE = "type"; //$NON-NLS-1$
-
- String P_PATCH = "patch"; //$NON-NLS-1$
-
- String P_ID_MATCH = "id-match"; //$NON-NLS-1$
-
- int PLUGIN = 0;
-
- int FEATURE = 1;
-
- int getType();
-
- void setType(int type) throws CoreException;
-
- boolean isPatch();
-
- void setPatch(boolean patch) throws CoreException;
-
- int getIdMatch();
-
- void setIdMatch(int idMatch) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInfo.java
deleted file mode 100644
index 8f0744f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInfo.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface IFeatureInfo extends IFeatureObject {
- String P_URL = "p_url"; //$NON-NLS-1$
-
- String P_DESC = "p_desc"; //$NON-NLS-1$
-
- public String getURL();
-
- public String getDescription();
-
- public void setURL(String url) throws CoreException;
-
- public void setDescription(String desc) throws CoreException;
-
- public boolean isEmpty();
-
- public int getIndex();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInstallHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInstallHandler.java
deleted file mode 100644
index 436f31c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureInstallHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface IFeatureInstallHandler extends IFeatureObject {
- String P_LIBRARY = "library"; //$NON-NLS-1$
-
- String P_HANDLER_NAME = "handlerName"; //$NON-NLS-1$
-
- public String getLibrary();
-
- public String getHandlerName();
-
- public void setLibrary(String library) throws CoreException;
-
- public void setHandlerName(String handlerName) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModel.java
deleted file mode 100644
index 25d3ade..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModel.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-/**
- * This model type is designed to hold data loaded from
- * "feature.xml" file of an Eclipse feature.
- */
-public interface IFeatureModel extends IModel, IModelChangeProvider {
-/**
- * Returns the top-level model object.
- *
- * @return top-level model object of the feature model
- */
-public IFeature getFeature();
-/**
- * Returns the factory that should be used
- * to create new instances of model objects.
- *
- * @return feature model factory
- */
-IFeatureModelFactory getFactory();
-/**
- * Returns install location of the feature.xml file
- * in case of external files.
- *
- * @return install location for external files,
- * or <samp>null</samp> for models based on
- * workspace resources.
- */
-public String getInstallLocation();
-/**
- * Tests whether this model is enabled.
- *
- * @return <samp>true</samp> if the model is enabled
- */
-public boolean isEnabled();
-/**
- * Enables or disables this model.
- *
- * @param enabled the new enable state
- */
-public void setEnabled(boolean enabled);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModelFactory.java
deleted file mode 100644
index 9f1cd79..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureModelFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-/**
- * This model factory should be used to create
- * model objects of the feature model.
- */
-public interface IFeatureModelFactory {
-/**
- * Creates a new plug-in model object.
- *
- * @return new instance of the feature plug-in object
- */
-IFeaturePlugin createPlugin();
-/**
- * Creates a new data model object.
- *
- * @return new instance of the feature data object
- */
-IFeatureData createData();
-/**
- * Creates a new feature child object.
- *
- * @return new instance of the feature child object
- */
-IFeatureChild createChild();
-/**
- * Creates a new import model object.
- *
- * @return new instance of the feature import object
- */
-IFeatureImport createImport();
-/**
- * Creates a new feature URL instance.
- *
- * @return a new feature URL instance
- */
-IFeatureURL createURL();
-/**
- * Creates a new feature install handler.
- *
- * @return a new feature install handler.
- */
-IFeatureInstallHandler createInstallHandler();
-/**
- *
- */
-public IFeatureInfo createInfo(int info);
-/**
- * Creates a new instance of a feature URL element for
- * the provided URL parent and the type.
- *
- * @return a new URL element instance
- */
-IFeatureURLElement createURLElement(IFeatureURL parent, int elementType);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureObject.java
deleted file mode 100644
index 9e44d7e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureObject.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.pde.core.IWritable;
-/**
- * A base of all feature model objects.
- */
-public interface IFeatureObject extends IWritable, IAdaptable, Serializable {
-/**
- * A property name that will be used to notify
- * about changes in the "label" field.
- */
-String P_LABEL = "label"; //$NON-NLS-1$
-/**
- * Returns the top-level feature model object.
- * @return root feature object
- */
-public IFeature getFeature();
-/**
- * Returns the label of this feature model object'
- * @return feature object label
- */
-String getLabel();
-/**
- * Returns the feature model that owns this model object.
- *
- * @return the feature model
- */
-IFeatureModel getModel();
-
-boolean isInTheModel();
-/**
- * Returns the parent of this model object.
- *
- * @return the model object parent
- */
-public IFeatureObject getParent();
-/**
- * Sets the new label of this model object.
- * This method may throw a CoreException
- * if the model is not editable.
- *
- * @param label the new label
- */
-void setLabel(String label) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java
deleted file mode 100644
index 63cba34..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-
-
-/**
- * A base class for plug-in and data entires
- */
-public interface IFeaturePlugin extends IFeatureObject, IVersionable, IFeatureEntry {
- /**
- * A property that will be carried by the change event
- * if 'unpack' field of this object is changed.
- */
- public static final String P_UNPACK = "unpack"; //$NON-NLS-1$
- /**
- * Returns whether this is a reference to a fragment.
- * @return <samp>true</samp> if this is a fragment, <samp>false</samp> otherwise.
- */
- public boolean isFragment();
-
- public boolean isUnpack();
- public void setUnpack(boolean unpack) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURL.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURL.java
deleted file mode 100644
index e6748f1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURL.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * The container for all URL definitions of this feature.
- */
-public interface IFeatureURL extends IFeatureObject {
-/**
- * Add a URL element that should be used to
- * discover new Eclipse features. This
- * method may throw a CoreException if
- * the model is not editable.
- *
- * @param discovery a new discovery URL element
- */
-public void addDiscovery(IFeatureURLElement discovery) throws CoreException;
-/**
- * Sets a URL element that should be used to
- * update Eclipse features. This
- * method may throw a CoreException if
- * the model is not editable.
- *
- * @param update a new update URL element or null
- */
-public void setUpdate(IFeatureURLElement update) throws CoreException;
-/**
- * Return all URL elements that can be used
- * to discover new Eclipse features.
- *
- * @return an array of URL features
- */
-public IFeatureURLElement [] getDiscoveries();
-/**
- * Return URL elements that can be used
- * to update new Eclipse features.
- *
- * @return IFeatureURLElement or null if not set
- */
-public IFeatureURLElement getUpdate();
-/**
- * Remove a URL element that should be used to
- * discover new Eclipse features. This
- * method may throw a CoreException if
- * the model is not editable.
- *
- * @param discovery a discovery URL element to remove
- */
-public void removeDiscovery(IFeatureURLElement discovery) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURLElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURLElement.java
deleted file mode 100644
index efc8bc2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureURLElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * A URL element is a model object that represents
- * a single URL reference. The reference has a type
- * (UPDATE, DISCOVERY or INFO), and an optional
- * label that should be used to represent the URL
- * in the UI.
- */
-public interface IFeatureURLElement extends IFeatureObject {
- /**
- * Indicates that this is an update URL.
- */
- public static final int UPDATE = 1;
- /**
- * Indicates that this is a discovery URL.
- */
- public static final int DISCOVERY = 2;
- /**
- * Indicates that the site is a regular update site.
- */
- public static final int UPDATE_SITE = 0;
- /**
- * Indicates that the site is a Web site.
- */
- public static final int WEB_SITE = 1;
- /**
- * This property name will be used to notify
- * about changes in the "URL" field.
- */
- public static final String P_URL = "url"; //$NON-NLS-1$
- /**
- * This property name will be used to notify
- * about changes in the 'siteType' field.
- */
- public static final String P_SITE_TYPE = "siteType"; //$NON-NLS-1$
- /**
- * Returns the type of this URL element (UPDATE or DISCOVERY)
- */
- public int getElementType();
-
- /**
- * Returns the type of the site with the specified URL.
- * @return UPDATE_SITE or WEB_SITE
- */
- public int getSiteType();
- /**
- * Returns the URL of this element.
- *
- * @return the URL
- */
- public URL getURL();
- /**
- * Sets the URL of this element.
- * This method will throw a CoreException
- * if the model is not editable.
- *
- * @param url the new URL
- */
- public void setURL(URL url) throws CoreException;
- /**
- * Sets the type of the site with the specified URL.
- * @param UPDATE_SITE or WEB_SITE
- */
- public void setSiteType(int siteType) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IVersionable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IVersionable.java
deleted file mode 100644
index fcd4c7c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IVersionable.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ifeature;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-
-public interface IVersionable extends IIdentifiable {
- /**
- * A property that will be carried by the change event if 'version' field of
- * this object is changed.
- */
- public static final String P_VERSION = "version"; //$NON-NLS-1$
-
- /**
- * Returns a version of this object.
- *
- * @return the version of this object
- */
- public String getVersion();
-
- /**
- * Sets the version of this IVersonable to the provided value. This method
- * will throw CoreException if object is not editable.
- *
- * @param version
- * a new version of this object
- */
- void setVersion(String version) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IAboutInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IAboutInfo.java
deleted file mode 100644
index 01800ac..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IAboutInfo.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-
-public interface IAboutInfo extends IProductObject {
-
- public static final String P_IMAGE = "image"; //$NON-NLS-1$
- public static final String P_TEXT = "text"; //$NON-NLS-1$
-
- void setText(String text);
-
- String getText();
-
- void setImagePath(String path);
-
- String getImagePath();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IArgumentsInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IArgumentsInfo.java
deleted file mode 100644
index 89a4c12..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IArgumentsInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface IArgumentsInfo extends IProductObject {
-
- public static final String P_PROG_ARGS = "programArgs"; //$NON-NLS-1$
- public static final String P_PROG_ARGS_LIN = "programArgsLin"; //$NON-NLS-1$
- public static final String P_PROG_ARGS_MAC = "programArgsMac"; //$NON-NLS-1$
- public static final String P_PROG_ARGS_SOL = "programArgsSol"; //$NON-NLS-1$
- public static final String P_PROG_ARGS_WIN = "programArgsWin"; //$NON-NLS-1$
-
- public static final String P_VM_ARGS = "vmArgs"; //$NON-NLS-1$
- public static final String P_VM_ARGS_LIN = "vmArgsLin"; //$NON-NLS-1$
- public static final String P_VM_ARGS_MAC = "vmArgsMac"; //$NON-NLS-1$
- public static final String P_VM_ARGS_SOL = "vmArgsSol"; //$NON-NLS-1$
- public static final String P_VM_ARGS_WIN = "vmArgsWin"; //$NON-NLS-1$
-
- public static final int L_ARGS_ALL = 0;
- public static final int L_ARGS_LINUX = 1;
- public static final int L_ARGS_MACOS = 2;
- public static final int L_ARGS_SOLAR = 3;
- public static final int L_ARGS_WIN32 = 4;
-
- void setProgramArguments(String args, int platform);
-
- String getProgramArguments(int platform);
-
- String getCompleteProgramArguments(String os);
-
- void setVMArguments(String args, int platform);
-
- String getVMArguments(int platform);
-
- String getCompleteVMArguments(String os);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IConfigurationFileInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IConfigurationFileInfo.java
deleted file mode 100644
index 32926e6..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IConfigurationFileInfo.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-
-public interface IConfigurationFileInfo extends IProductObject {
-
- public static final String P_USE = "use"; //$NON-NLS-1$
- public static final String P_PATH = "path"; //$NON-NLS-1$
-
- void setUse(String use);
-
- String getUse();
-
- void setPath(String path);
-
- String getPath();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IIntroInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IIntroInfo.java
deleted file mode 100644
index 6571b64..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IIntroInfo.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface IIntroInfo extends IProductObject {
-
- void setId(String id);
-
- String getId();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ILauncherInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ILauncherInfo.java
deleted file mode 100644
index 45d5bf5..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ILauncherInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface ILauncherInfo extends IProductObject {
-
- public static final String LINUX_ICON = "linuxIcon"; //$NON-NLS-1$
-
- public static final String MACOSX_ICON = "macosxIcon"; //$NON-NLS-1$
-
- public static final String SOLARIS_LARGE = "solarisLarge"; //$NON-NLS-1$
- public static final String SOLARIS_MEDIUM = "solarisMedium"; //$NON-NLS-1$
- public static final String SOLARIS_SMALL = "solarisSmall"; //$NON-NLS-1$
- public static final String SOLARIS_TINY = "solarisTiny"; //$NON-NLS-1$
-
- public static final String WIN32_16_LOW = "winSmallLow"; //$NON-NLS-1$
- public static final String WIN32_16_HIGH = "winSmallHigh"; //$NON-NLS-1$
- public static final String WIN32_32_LOW = "winMediumLow"; //$NON-NLS-1$
- public static final String WIN32_32_HIGH = "winMediumHigh"; //$NON-NLS-1$
- public static final String WIN32_48_LOW = "winLargeLow"; //$NON-NLS-1$
- public static final String WIN32_48_HIGH = "winLargeHigh"; //$NON-NLS-1$
-
- public static final String P_USE_ICO = "useIco"; //$NON-NLS-1$
- public static final String P_ICO_PATH = "icoFile"; //$NON-NLS-1$
- public static final String P_LAUNCHER = "launcher"; //$NON-NLS-1$
-
- String getLauncherName();
-
- void setLauncherName(String name);
-
- void setIconPath(String iconId, String path);
-
- String getIconPath(String iconId);
-
- boolean usesWinIcoFile();
-
- void setUseWinIcoFile(boolean use);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProduct.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProduct.java
deleted file mode 100644
index 1ebf52c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProduct.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-
-public interface IProduct extends IProductObject {
-
- String P_ID = "id"; //$NON-NLS-1$
- String P_NAME = "name"; //$NON-NLS-1$
- String P_APPLICATION = "application"; //$NON-NLS-1$
- String P_USEFEATURES = "useFeatures"; //$NON-NLS-1$
- String P_INCLUDE_FRAGMENTS = "includeFragments"; //$NON-NLS-1$
- String P_INTRO_ID = "introId"; //$NON-NLS-1$
-
- String getId();
-
- String getName();
-
- String getApplication();
-
- String getDefiningPluginId();
-
- boolean useFeatures();
-
- IAboutInfo getAboutInfo();
-
- IConfigurationFileInfo getConfigurationFileInfo();
-
- IArgumentsInfo getLauncherArguments();
-
- IWindowImages getWindowImages();
-
- ISplashInfo getSplashInfo();
-
- IIntroInfo getIntroInfo();
-
- ILauncherInfo getLauncherInfo();
-
- void addPlugin(IProductPlugin plugin);
-
- void addFeature(IProductFeature feature);
-
- void removePlugin(IProductPlugin plugin);
-
- void removeFeature(IProductFeature feature);
-
- IProductPlugin[] getPlugins();
-
- IProductFeature[] getFeatures();
-
- void setId(String id);
-
- void setName(String name);
-
- void setAboutInfo(IAboutInfo info);
-
- void setApplication(String application);
-
- void setConfigurationFileInfo(IConfigurationFileInfo info);
-
- void setLauncherArguments(IArgumentsInfo info);
-
- void setWindowImages(IWindowImages images);
-
- void setSplashInfo(ISplashInfo info);
-
- void setIntroInfo(IIntroInfo introInfo);
-
- void setLauncherInfo(ILauncherInfo info);
-
- void setUseFeatures(boolean use);
-
- void reset();
-
- boolean containsPlugin(String id);
-
- boolean containsFeature(String id);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductFeature.java
deleted file mode 100644
index 050f55f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductFeature.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface IProductFeature extends IProductObject {
-
- String getId();
-
- void setId(String id);
-
- String getVersion();
-
- void setVersion(String version);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModel.java
deleted file mode 100644
index 48d13d7..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModel.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-
-
-public interface IProductModel extends IModel, IModelChangeProvider {
-
- IProduct getProduct();
-
- IProductModelFactory getFactory();
-
- String getInstallLocation();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModelFactory.java
deleted file mode 100644
index 8efb07e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductModelFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-
-public interface IProductModelFactory {
-
- IProduct createProduct();
-
- IAboutInfo createAboutInfo();
-
- IProductPlugin createPlugin();
-
- IProductFeature createFeature();
-
- IConfigurationFileInfo createConfigFileInfo();
-
- IWindowImages createWindowImages();
-
- ISplashInfo createSplashInfo();
-
- ILauncherInfo createLauncherInfo();
-
- IArgumentsInfo createLauncherArguments();
-
- IIntroInfo createIntroInfo();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductObject.java
deleted file mode 100644
index d87ce2a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductObject.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-import java.io.Serializable;
-
-import org.eclipse.pde.core.IWritable;
-import org.w3c.dom.Node;
-
-public interface IProductObject extends IWritable, Serializable{
-
- IProductModel getModel();
-
- void setModel(IProductModel model);
-
- IProduct getProduct();
-
- void parse(Node node);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductPlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductPlugin.java
deleted file mode 100644
index 3cb0439..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IProductPlugin.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-
-public interface IProductPlugin extends IProductObject {
-
- String getId();
-
- void setId(String id);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ISplashInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ISplashInfo.java
deleted file mode 100644
index 1c52e43..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/ISplashInfo.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface ISplashInfo extends IProductObject {
-
- public static final String P_LOCATION = "location"; //$NON-NLS-1$
-
- void setLocation(String location);
-
- String getLocation();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IWindowImages.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IWindowImages.java
deleted file mode 100644
index 3fa946a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/iproduct/IWindowImages.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.iproduct;
-
-public interface IWindowImages extends IProductObject {
-
- public static final String P_16 = "i16"; //$NON-NLS-1$
- public static final String P_32 = "i32"; //$NON-NLS-1$
- public static final String P_48 = "i48"; //$NON-NLS-1$
- public static final String P_64 = "i64"; //$NON-NLS-1$
- public static final String P_128 = "i128"; //$NON-NLS-1$
- public static final int TOTAL_IMAGES = 5;
-
- String getImagePath(int size);
- void setImagePath(String path, int size);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IDocumentSection.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IDocumentSection.java
deleted file mode 100644
index 8140576..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IDocumentSection.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Document section is portion of the extension point schema
- * definition that will be taken and built into the final reference
- * HTML document. There are several predefined document sections
- * that PDE recognizes:
- * <ul>
- * <li>MARKUP - will be used for "Markup" section</li>
- * <li>EXAMPLES - will be used for "Examples" section</li>
- * <li>API_INFO - will be used for "API information" section</li>
- * <li>IMPLEMENTATION - will be used for "Supplied Implementation" section</li>
- * </ul>
- * Text that objects of this class carry can contain HTML tags that
- * will be copied into the target document as-is.
- */
-public interface IDocumentSection extends ISchemaObject {
- /**
- * Section Id for the "Markup" section of the target reference document
- */
- String MARKUP = "markup"; //$NON-NLS-1$
- /**
- * Section Id for the "Examples" section of the target reference document
- */
- String EXAMPLES = "examples"; //$NON-NLS-1$
- /**
- * Section Id for the "Supplied Implementation" section of the target reference document
- */
- String IMPLEMENTATION = "implementation"; //$NON-NLS-1$
- /**
- * Section Id for the "API Information" section of the target reference document
- */
- String API_INFO = "apiInfo"; //$NON-NLS-1$
- /**
- * Section Id for the copyright statement section of the target reference document
- */
- String COPYRIGHT = "copyright"; //$NON-NLS-1$
-
- /**
- * Section Id for the first version in which the extension point appears.
- */
- String SINCE = "since"; //$NON-NLS-1$
-/**
- * Returns the Id of this section.
- */
-public String getSectionId();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaAttribute.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaAttribute.java
deleted file mode 100644
index 5593234..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaAttribute.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Objects that implement this interface are carrying metadata about XML schema
- * attributes. This data is stored as schema attribute annotations.
- */
-public interface IMetaAttribute {
- /**
- * Indicates that the value of the associated attribute is a regular string.
- */
- public static final int STRING = 0;
-
- /**
- * Indicates that the value of the associated attribute is a name of a fully
- * qualified Java class.
- */
- public static final int JAVA = 1;
-
- /**
- * Indicates that the value of the associated attribute is a workspace
- * resource.
- */
- public static final int RESOURCE = 2;
-
- /**
- * Property that indicates if an attribute is translatable
- */
- public static final String P_TRANSLATABLE = "translatable"; //$NON-NLS-1$
-
- /**
- * Property that indicates if an attribute is deprecated
- */
- public static final String P_DEPRECATED = "deprecated"; //$NON-NLS-1$
-
- /*
- * non-Javadoc
- */
- public static final String[] kindTable = { "string", "java", "resource" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * Returns optional name of the Java type this type must be based on (only
- * for JAVA kind).
- */
- public String getBasedOn();
-
- /**
- * Returns <samp>true</samp> if the attribute is translatable; <samp>false</samp> otherwise.
- */
- public boolean isTranslatable();
-
- /**
- * Returns <samp>true</samp> if the attribute is deprecated; <samp>false</samp> otherwise.
- */
- public boolean isDeprecated();
-
-
- /**
- * Returns the kind of this attribute's value (STRING, JAVA or RESOURCE).
- */
- public int getKind();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaElement.java
deleted file mode 100644
index 34a08b9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/IMetaElement.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Objects that implement this interface store metadata about extension point
- * schema elements. This metadata is stored as schema element annotation.
- */
-public interface IMetaElement {
- /**
- * Property that indicates if an element has translatable content
- */
- public static final String P_TRANSLATABLE = "translatable"; //$NON-NLS-1$
-
- /**
- * Property that indicates if an element is deprecated
- */
- public static final String P_DEPRECATED = "deprecated"; //$NON-NLS-1$
-
- /**
- * Returns a property (attribute) name whose value should be used to load
- * element icon in the UI. For example, if icon property is set to "icon"
- * and the element has an "icon" attribute that represents icon path
- * relative to the plug-in, an attempt will be made to load that icon.
- */
- public String getIconProperty();
-
- /**
- * Returns a property (attribute) name whose value should be used to
- * represent this element in the UI. For example, if this value is
- * <samp>null </samp> and the name of the element is "wizard", that will be
- * showing in the UI. However, if label property is set to "name" and the
- * element has a "name" attribute whose value is "Import Wizard", that value
- * will be used in the UI instead of "wizard".
- */
- public String getLabelProperty();
-
- /**
- * Returns <samp>true</samp> if the element content is translatable; <samp>false</samp> otherwise.
- */
- public boolean hasTranslatableContent();
-
- /**
- * Returns <samp>true</samp> if the element is deprecated; <samp>false</samp> otherwise.
- */
- public boolean isDeprecated();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchema.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchema.java
deleted file mode 100644
index 723f0ea..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchema.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IBaseModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-
-/**
- * Objects of this class encapsulate data loaded from the XML Schema file that
- * defines an Eclipse extension point. These files are used for three reasons:
- * <ul>
- * <li>To provide grammar that can be used by validation parsers to validate
- * extensions that plug into this extension point
- * <li>To provide additional metadata about this extension point that can be
- * used by PDE to provide user assistence in plug-in development
- * <li>To provide enough material that can be used by tools to compose a
- * reference HTML documentation about this extension point.
- * </ul>
- * Objects of this class can be changed if editable. Other classes can register
- * as change listener in order to receive notification about these changes.
- */
-public interface ISchema extends ISchemaObject, IBaseModel, IModelChangeProvider {
- String P_POINT = "pointId"; //$NON-NLS-1$
-
- String P_PLUGIN = "pluginId"; //$NON-NLS-1$
-
- int REFRESH_ADD = 1;
-
- int REFRESH_DELETE = 2;
-
- int REFRESH_RENAME = 3;
-
- /**
- * Returns a reference to a schema element defined in this schema or
- * <samp>null</samp> if not found.
- *
- * @param name
- * name of the element to find
- */
- ISchemaElement findElement(String name);
-
- /**
- * Returns an array of schema elements that can be children of the provided
- * schema element. The information is computed based on the grammar rules in
- * this schema. The computation ignores number of occurances of each
- * element. Therefore, it will always return the same result even if there
- * could be only one element of a certain type in the document and it
- * already exists.
- *
- * @param element
- * the parent element that is used for the calculation
- * @return an array of elements that can appear as children of the provided
- * element, according to the grammar of this schema
- */
- ISchemaElement[] getCandidateChildren(ISchemaElement element);
-
- /**
- * Returns an array of document sections that are defined in this schema.
- *
- * @return an array of sections in this schema
- */
- IDocumentSection[] getDocumentSections();
-
- /**
- * Returns a number of elements with global scope defined in this schema.
- *
- * @return number of global elements
- */
- public int getElementCount();
-
- /**
- * Returns a total number of elements after the included schemas have been
- * resolved and their elements added to the list.
- *
- * @return the total number of elements including external schemas
- */
- public int getResolvedElementCount();
-
- /**
- * Returns an array of elements with the global scope defined in this
- * schema.
- *
- * @return an array of global elements
- */
- public ISchemaElement[] getElements();
-
- /**
- * Returns an array of elements with the global scope defined in this schema
- * and all the included schemas.
- *
- * @return an expanded array of global elements
- */
- public ISchemaElement[] getResolvedElements();
-
- /**
- * Returns an Id of the extension point that is defined in this schema.
- *
- * @return extension point Id of this schema
- */
- public String getQualifiedPointId();
-
- public String getPointId();
-
- public void setPointId(String pointId) throws CoreException;
-
- public String getPluginId();
-
- public void setPluginId(String pluginId) throws CoreException;
-
- /**
- * Returns an object that holds a reference to this schema. Descriptors are
- * responsible for loading and disposing schema objects and could be
- * implemented in various ways, depending on whether the schema is defined
- * inside the workspace or is referenced externally.
- *
- * @return schema descriptor that holds this schema
- */
- public ISchemaDescriptor getSchemaDescriptor();
-
- /**
- * Returns a URL that defines this schema's location.
- *
- * @return a URL that points to this schema's location.
- */
- public URL getURL();
-
- /**
- * Returns a list of elements that correspond to the <samp>include</samp>
- * statements in the schema file. Included schemas are incorporated into the
- * model and references can be made to elements in the included files.
- *
- * @return an array of included schema elements or a zero-size array if
- * none.
- */
- ISchemaInclude[] getIncludes();
-
- /**
- * Returns whether the root schema element ( the <exension> element)
- * has been marked deprecated, making this schema deprecated.
- * @return true if this schema is deprecated
- */
- public boolean isDeperecated();
-
- /**
- * Returns replacement schema in case this one is deprecated.
- * @return the replacement schema
- */
- public String getDeprecatedSuggestion();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttribute.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttribute.java
deleted file mode 100644
index 50a53eb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttribute.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Objects that implement this interface hold data about attributes of schema
- * elements.
- */
-public interface ISchemaAttribute extends ISchemaObject, IMetaAttribute {
- /**
- * This attribute can be omitted by the extension element.
- */
- public static final int OPTIONAL = 0;
-
- /**
- * This attribute must be defined in the extension element.
- */
- public static final int REQUIRED = 1;
-
- /**
- * This attribute can be omitted by the extension element, and if it is, its
- * value will be set to the value defined in the "value" field.
- */
- public static final int DEFAULT = 2;
-
- /**
- * Table of the 'use' clause choices.
- */
- public static final String[] useTable = {
- "optional", "required", "default" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * Returns the type of this attribute. Attributes can only have simple
- * types.
- */
- public ISchemaSimpleType getType();
-
- /**
- * Returns the 'use' mode of this attribute (OPTIONAL, REQUIRED or DEFAULT).
- */
- public int getUse();
-
- /**
- * Returns the default value of this attribute when 'use' clause is DEFAULT.
- */
- public Object getValue();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttributeProvider.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttributeProvider.java
deleted file mode 100644
index 35e188c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaAttributeProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Objects that implement this interface can
- * have attributes.
- */
-public interface ISchemaAttributeProvider {
-/**
- * Returns an attribute definition if one with the matching name is found
- * in this provider.
- * @return attribute object or <samp>null</samp> if none with the matching name is found.
- */
-public ISchemaAttribute getAttribute(String name);
- public int getAttributeCount();
- public ISchemaAttribute[] getAttributes();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaComplexType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaComplexType.java
deleted file mode 100644
index 43ea18f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaComplexType.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import org.eclipse.pde.core.IWritable;
-/**
- * Objects of this type are holding information about complex types defined
- * inside schema elements.
- */
-public interface ISchemaComplexType extends ISchemaType, ISchemaAttributeProvider, IWritable {
-/**
- * A complex type can have one root compositor.
- @ return root complex type compositor
- */
-public ISchemaCompositor getCompositor();
-/**
- * Returns whether the content of the element that owns this type
- * can mix child elements and text.
- *@return true if element can mix text and other elements
- */
-public boolean isMixed();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaCompositor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaCompositor.java
deleted file mode 100644
index b1fd120..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaCompositor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Compositor is a container that can contain other compositors or
- * references to element defined at the global scope. Compositors
- * are used to recursively define content model for the type.
- * Compositor kind (all, choice, sequence or group) defines
- * how to interpret its children.
- */
-public interface ISchemaCompositor extends ISchemaObject, ISchemaRepeatable {
- /**
- * Indicates the root parent of the compositor.
- */
- public static final int ROOT = -1;
- /**
- * Indicates that the children can be in any order and cardinality.
- */
- public static final int ALL = 0;
- /**
- * Indicates that an only one of the compositor's children can
- * appear at this location (DTD eq: "|")
- */
- public static final int CHOICE = 1;
- /**
- * Indicates that the children must appear in sequence in the schema documents (DTD eq: "," )
- */
- public static final int SEQUENCE = 2;
- /**
- * Indicates that this compositor simply serves as a group (DTD eq: "()" )
- */
- public static final int GROUP = 3;
- /**
- * Keyword table for compositors.
- */
- public static final String[] kindTable =
- { "all", "choice", "sequence", "group" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-/**
- * Returns the number of children of this compositor.
- * @return number of compositor children
- */
-public int getChildCount();
-/**
- * Returns children of this compositor.
- * @return compositor children
- */
-public ISchemaObject[] getChildren();
-/**
- * Returns a flag that defines how the children of this compositors should be
- * treated when computing type grammar (one of ALL, CHOICE, GROUP, SEQUENCE).
- * @return compositor kind value
- */
-public int getKind();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaDescriptor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaDescriptor.java
deleted file mode 100644
index 87ef39a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaDescriptor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import java.net.URL;
-
-/**
- * Classes that implement this interface are responsible for holding the schema
- * object, loading it and disposing. Schema objects do not know where they are
- * coming from. Compositors are responsible to provide input streams for loading
- * and output streams for saving (if schema is editable).
- */
-public interface ISchemaDescriptor {
- /**
- * Returns identifier of the extension point defined in this schema.
- *
- * @return id of the schema extension point
- */
- public String getPointId();
-
- /**
- * Returns the schema object. If schema has not been loaded, or has been
- * previously disposed, this method will load it before returning. If
- * abbreviated, the light-weight schema will not contain descriptions for
- * elements or the content of documentation sections.
- *
- * @return a loaded schema object
- */
- ISchema getSchema(boolean abbreviated);
-
- /**
- * Returns the URL of the schema XML file.
- *
- * @return the URL of the schema XML file
- */
- URL getSchemaURL();
-
- /**
- * Tests if the descriptor is created outside the registry.
- *
- * @return <code>true</code> if the descriptor is outside the registry,
- * <code>false</code> otherwise.
- */
- boolean isStandalone();
-
- long getLastModified();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaElement.java
deleted file mode 100644
index 0cf3279..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaElement.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Classes that implement this interface represent definition
- * of one element in the extension point schema.
- * Elements are defined at the global scope and contain
- * type (typically complex types with compositors) and
- * attribute definitions.
- */
-public interface ISchemaElement extends ISchemaObject, ISchemaRepeatable, ISchemaAttributeProvider, IMetaElement {
-/**
- * Returns an approximate representation of this element's content
- * model in DTD form. The resulting representation may not
- * be accurate because XML schema is more powerful and
- * provides for grammar definitions that are not possible
- * with DTDs.
- *
- * param addLinks if true, the representation will contain
- * HTML tags for quick access to referenced elements.
- *
- *@return DTD approximation of this element's grammar
- */
-String getDTDRepresentation(boolean addLinks);
-/**
- * Returns type object that represents the type defined in this element.
- * The type can be simple (defining an element that can only contain text)
- * or complex (with attributes and/or compositors).
- */
-public ISchemaType getType();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaEnumeration.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaEnumeration.java
deleted file mode 100644
index 0cc088e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaEnumeration.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Objects of this type are carrying one enumeration choice
- * when defining enumeration restrictions for 'string' types.
- * For example, in restriction {"one", "two", "three"},
- * each choice is stored as one object of this type.
- * Choice name can be obtained by inherited 'getName()' method.
- */
-public interface ISchemaEnumeration extends ISchemaObject {
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaInclude.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaInclude.java
deleted file mode 100644
index 57fa80b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaInclude.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Classes that implement this interface represent a schema that is included in
- * another schema.
- */
-public interface ISchemaInclude extends ISchemaObject {
- /**
- * Model property of the schema location.
- */
- String P_LOCATION = "location"; //$NON-NLS-1$
-
- String getLocation();
-
- void setLocation(String location) throws CoreException;
-
- ISchema getIncludedSchema();
-
- void dispose();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObject.java
deleted file mode 100644
index 3ff6118..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObject.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.pde.core.IWritable;
-/**
- * Base interface for all objects that belong to the extension point
- * schema model.
- */
-public interface ISchemaObject extends IAdaptable, IWritable {
-/**
- * Property constant that will be used in the model change event
- * when description field of this object changes.
- */
-public static final String P_DESCRIPTION="description"; //$NON-NLS-1$
-/**
- * Property constant that will be used in the model change event
- * when "name" field of this object changes.
- */
-public static final String P_NAME = "name"; //$NON-NLS-1$
-/**
- * Returns text associated with this schema object. Typically, it is
- * annotation that will be used to compose the reference HTML documentation.
- * The text may contain HTML tags.
- */
-public String getDescription();
-/**
- * Returns the presentation name of this schema object.
- */
-public String getName();
-/**
- * Returns the parent of this schema object.
- */
-ISchemaObject getParent();
-
-void setParent(ISchemaObject parent);
-/**
- * Returns the schema object to which this object belongs.
- */
-public ISchema getSchema();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObjectReference.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObjectReference.java
deleted file mode 100644
index f319916..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaObjectReference.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Classes that implement this interface store a reference
- * to a schema object defined elsewhere.
- */
-public interface ISchemaObjectReference {
-/**
- * Returns a name of this reference.
- * @return reference object name
- */
-public String getName();
-/**
- * Returns a schema object that is referenced by this object.
- * @return referenced schema object
- */
-public ISchemaObject getReferencedObject();
-/**
- * Returns a real Java class of the referenced object.
- * @return Java class of the referenced object.
- */
-public Class getReferencedObjectClass();
-/**
- * Associates this reference with a schema object.
- * @param referencedObject associates this reference with the object it references
- */
-public void setReferencedObject(ISchemaObject referencedObject);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRepeatable.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRepeatable.java
deleted file mode 100644
index b5c4559..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRepeatable.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Classes that implement this interface store information
- * about objects that carry cardinality information.
- * In DTDs, cardinality is defined using special characters
- * ('?' for "0 to 1", '+' for "1 or more" and '*' for "0 or more".
- * XML Schema allows precise definition of the cardinality
- * by using minimum and maximum of occurences in the
- * instance document. This is one of the reasons why
- * it is not possible to create exact DTD representation
- * of XML Schema grammar.
- */
-public interface ISchemaRepeatable {
-/**
- * Returns maximal number of occurences of the object in the
- * instance document.
- *
- *@return maximal number of occurences in the document
- */
-public int getMaxOccurs();
-/**
- * Returns minimal number of occurences of the object in the
- * instance document.
- *
- *@return minimal number of occurences in the document
- */
-public int getMinOccurs();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRestriction.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRestriction.java
deleted file mode 100644
index 028d49f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRestriction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * Simple schema types can optionally have a restriction
- * objects that narrows the value space for the type.
- * The restrictions introduce additional requirements
- * for the value to be considered valid for the type.
- * For example, enumeration restriction defines
- * a closed set of values that are legal for the type.
- */
-public interface ISchemaRestriction extends ISchemaObject {
-/**
- * Returns the simple type to which this restriction applies.
- * @return simple type to which this restriciton applies
- */
-public ISchemaSimpleType getBaseType();
-/**
- * Returns children of this restriction. Actual types
- * of the children depend on the restriction itself.
- * @return restriction children objects
- */
-public Object[] getChildren();
-/**
- * Tests if the provided value belongs to
- * the value set defined by this restriction.
- * @return true if the provided value
- * is valid for this restriction
- */
-boolean isValueValid(Object value);
-/**
- * Associates this restriction with the simple type object.
- *
- * @param baseType type object that owns this restriction
- */
-public void setBaseType(ISchemaSimpleType baseType);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRootElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRootElement.java
deleted file mode 100644
index 9fa4f45..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaRootElement.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.eclipse.pde.internal.core.ischema;
-
-public interface ISchemaRootElement extends ISchemaElement {
-
- public void setDeprecatedSuggestion(String value) ;
-
- public String getDeprecatedSuggestion();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaSimpleType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaSimpleType.java
deleted file mode 100644
index 1d4839f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaSimpleType.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-import org.eclipse.pde.core.IWritable;
-/**
- * Classes that implement this interface define
- * simple types. Simple types do not have compositors.
- * They consist of the base type whose name is
- * available by calling 'getName()' and an optional
- * restriction that can narrow the value space for the type.
- */
-public interface ISchemaSimpleType extends ISchemaType, IWritable {
-/**
- * Returns the restriction that narrows the value space of
- * this type.
- *
- * @return restriction for this simple type, or <samp>null</samp> if there
- * is no restriction.
- */
-ISchemaRestriction getRestriction();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaType.java
deleted file mode 100644
index ebb2dd2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ischema/ISchemaType.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.ischema;
-
-/**
- * A base type interface. Schema type is associated
- * with schema elements and attributes to define
- * their grammar and/or valid value space.
- * For simple types, 'getName()' method
- * returns name of the type that defines
- * initial value space (for example, "string", "boolean" etc.).
- */
-public interface ISchemaType {
-/**
- * Returns the logical name of this type.
- * @return name of the type
- */
-public String getName();
-/**
- * Returns the schema object in which this type is defined.
- * @return the top-level schema object
- */
-public ISchema getSchema();
-
-public void setSchema(ISchema schema);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISite.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISite.java
deleted file mode 100644
index 2310d11..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISite.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * The top-level model object of the Eclipse update site model.
- */
-public interface ISite extends ISiteObject {
- String P_URL = "URL"; //$NON-NLS-1$
-
- String P_MIRRORS_URL = "mirrorsURL"; //$NON-NLS-1$
-
- String P_TYPE = "type"; //$NON-NLS-1$
-
- String P_DESCRIPTION = "description"; //$NON-NLS-1$
-
- void setType(String type) throws CoreException;
-
- String getType();
-
- void setURL(String url) throws CoreException;
-
- void setMirrorsURL(String url) throws CoreException;
-
- String getURL();
-
- String getMirrorsURL();
-
- ISiteDescription getDescription();
-
- void setDescription(ISiteDescription description) throws CoreException;
-
- void addFeatures(ISiteFeature[] features) throws CoreException;
-
- void addArchives(ISiteArchive[] archives) throws CoreException;
-
- void addCategoryDefinitions(ISiteCategoryDefinition[] defs)
- throws CoreException;
-
- void removeFeatures(ISiteFeature[] features) throws CoreException;
-
- void removeArchives(ISiteArchive[] archives) throws CoreException;
-
- void removeCategoryDefinitions(ISiteCategoryDefinition[] defs)
- throws CoreException;
-
- ISiteFeature[] getFeatures();
-
- ISiteArchive[] getArchives();
-
- ISiteCategoryDefinition[] getCategoryDefinitions();
-
- boolean isValid();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteArchive.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteArchive.java
deleted file mode 100644
index a748539..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteArchive.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface ISiteArchive extends ISiteObject {
- String P_URL = "url"; //$NON-NLS-1$
- String P_PATH = "path"; //$NON-NLS-1$
- String getURL();
- void setURL(String url) throws CoreException;
- String getPath();
- void setPath(String path) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategory.java
deleted file mode 100644
index f53dd54..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface ISiteCategory extends ISiteObject {
- String P_NAME = "name"; //$NON-NLS-1$
-
- String getName();
-
- void setName(String name) throws CoreException;
-
- ISiteCategoryDefinition getDefinition();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategoryDefinition.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategoryDefinition.java
deleted file mode 100644
index 69c3f58..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteCategoryDefinition.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface ISiteCategoryDefinition extends ISiteObject {
- String P_NAME = "name"; //$NON-NLS-1$
- String P_DESCRIPTION = "description"; //$NON-NLS-1$
- String getName();
- void setName(String name) throws CoreException;
- ISiteDescription getDescription();
- void setDescription(ISiteDescription description) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteDescription.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteDescription.java
deleted file mode 100644
index 2a107cb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteDescription.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.runtime.CoreException;
-
-public interface ISiteDescription extends ISiteObject {
- String P_URL = "url"; //$NON-NLS-1$
- String P_TEXT = "text"; //$NON-NLS-1$
-
- String getURL();
- String getText();
-
- void setURL(String url) throws CoreException;
- void setText(String text) throws CoreException;
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteFeature.java
deleted file mode 100644
index 724b048..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteFeature.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IVersionable;
-
-public interface ISiteFeature extends IVersionable, ISiteObject {
- String P_TYPE = "type"; //$NON-NLS-1$
- String P_URL = "url"; //$NON-NLS-1$
- String P_OS = "os"; //$NON-NLS-1$
- String P_WS = "ws"; //$NON-NLS-1$
- String P_NL = "nl"; //$NON-NLS-1$
- String P_ARCH = "arch"; //$NON-NLS-1$
- String P_PATCH = "patch"; //$NON-NLS-1$
- void addCategories(ISiteCategory[] categories) throws CoreException;
- void removeCategories(ISiteCategory[] categories) throws CoreException;
- ISiteCategory [] getCategories();
- String getType();
- String getURL();
- String getOS();
- String getNL();
- String getArch();
- String getWS();
- boolean isPatch();
- void setType(String type) throws CoreException;
- void setURL(String url) throws CoreException;
- void setOS(String os) throws CoreException;
- void setWS(String ws) throws CoreException;
- void setArch(String arch) throws CoreException;
- void setNL(String nl) throws CoreException;
- void setIsPatch(boolean patch) throws CoreException;
- IFile getArchiveFile();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModel.java
deleted file mode 100644
index 0a418cd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModel.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-/**
- * This model type is designed to hold data loaded from
- * "site.xml" file of an Eclipse update site.
- */
-public interface ISiteModel extends IModel, IModelChangeProvider {
-/**
- * Returns the top-level model object.
- *
- * @return top-level model object of the site model
- */
-public ISite getSite();
-/**
- * Returns the factory that should be used
- * to create new instances of model objects.
- *
- * @return feature model factory
- */
-ISiteModelFactory getFactory();
-/**
- * Returns install location of the site.xml file in case of external files.
- *
- * @return install location for external files,
- * or <samp>null</samp> for models based on
- * workspace resources.
- */
-public String getInstallLocation();
-/**
- * Tests whether this model is enabled.
- *
- * @return <samp>true</samp> if the model is enabled
- */
-public boolean isEnabled();
-/**
- * Enables or disables this model.
- *
- * @param enabled the new enable state
- */
-public void setEnabled(boolean enabled);
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModelFactory.java
deleted file mode 100644
index f64fe2f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteModelFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-/**
- * This model factory should be used to create
- * model objects of the feature model.
- */
-public interface ISiteModelFactory {
-/**
- * Creates a new plug-in model object.
- *
- * @return new instance of the feature plug-in object
- */
-ISite createSite();
-/**
- * Creates a new data model object.
- *
- * @return new instance of the feature data object
- */
-ISiteFeature createFeature();
-/**
- * Creates a new feature child object.
- *
- * @return new instance of the feature child object
- */
-ISiteCategory createCategory(ISiteFeature feature);
-/**
- * Creates a new import model object.
- *
- * @return new instance of the feature import object
- */
-ISiteCategoryDefinition createCategoryDefinition();
-/**
- * Creates a new feature URL instance.
- *
- * @return a new feature URL instance
- */
-ISiteDescription createDescription(ISiteObject parent);
-/**
- * Creates a new feature install handler.
- *
- * @return a new feature install handler.
- */
-ISiteArchive createArchive();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteObject.java
deleted file mode 100644
index 6ddcb02..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/isite/ISiteObject.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.isite;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.pde.core.IWritable;
-
-/**
- * A base of all site model objects.
- */
-public interface ISiteObject extends IWritable, IAdaptable, Serializable {
- /**
- * A property name that will be used to notify about changes in the "label"
- * field.
- */
- String P_LABEL = "label"; //$NON-NLS-1$
-
- /**
- * Returns the top-level site model object.
- *
- * @return root feature object
- */
- public ISite getSite();
-
- /**
- * Returns the label of this feature model object'
- *
- * @return feature object label
- */
- String getLabel();
-
- /**
- * Returns the site model that owns this model object.
- *
- * @return the site model
- */
- ISiteModel getModel();
-
- boolean isInTheModel();
-
- /**
- * Returns the parent of this model object.
- *
- * @return the model object parent
- */
- public ISiteObject getParent();
-
- /**
- * Sets the new label of this model object. This method may throw a
- * CoreException if the model is not editable.
- *
- * @param label
- * the new label
- */
- void setLabel(String label) throws CoreException;
-
- /**
- * Returns true if this object as all the required attributes set, false
- * otherwise.
- */
- boolean isValid();
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IAdditionalLocation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IAdditionalLocation.java
deleted file mode 100644
index 44cc2b0..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IAdditionalLocation.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface IAdditionalLocation extends ITargetObject {
-
- public static final String P_PATH = "path"; //$NON-NLS-1$
- String getPath();
- void setPath(String path);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IArgumentsInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IArgumentsInfo.java
deleted file mode 100644
index 3343d2d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IArgumentsInfo.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface IArgumentsInfo extends ITargetObject {
-
- public static final String P_PROG_ARGS = "programArgs"; //$NON-NLS-1$
- public static final String P_VM_ARGS = "vmArgs"; //$NON-NLS-1$
-
- public String getProgramArguments();
-
- public String getVMArguments();
-
- public void setProgramArguments(String args);
-
- public void setVMArguments(String args);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IEnvironmentInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IEnvironmentInfo.java
deleted file mode 100644
index d927d08..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IEnvironmentInfo.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface IEnvironmentInfo extends ITargetObject{
-
- public static final String P_OS = "os"; //$NON-NLS-1$
- public static final String P_WS = "ws"; //$NON-NLS-1$
- public static final String P_ARCH = "arch"; //$NON-NLS-1$
- public static final String P_NL = "nl"; //$NON-NLS-1$
-
- public String getOS();
-
- public String getWS();
-
- public String getArch();
-
- public String getNL();
-
- public void setOS(String os);
-
- public void setWS(String ws);
-
- public void setArch(String arch);
-
- public void setNL(String nl);
-
- public String getDisplayOS();
-
- public String getDisplayWS();
-
- public String getDisplayArch();
-
- public String getDisplayNL();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IImplicitDependenciesInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IImplicitDependenciesInfo.java
deleted file mode 100644
index 259488d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/IImplicitDependenciesInfo.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface IImplicitDependenciesInfo extends ITargetObject {
-
- public static final String P_IMPLICIT_PLUGINS = "implicit-plugins"; //$NON-NLS-1$
-
- ITargetPlugin[] getPlugins();
-
- public void addPlugin(ITargetPlugin plugin);
-
- public void addPlugins(ITargetPlugin[] plugins);
-
- public void removePlugin(ITargetPlugin plugin);
-
- public void removePlugins(ITargetPlugin[] plugins);
-
- public boolean containsPlugin(String id);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ILocationInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ILocationInfo.java
deleted file mode 100644
index caf0b3b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ILocationInfo.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ILocationInfo extends ITargetObject {
-
- final String P_LOC = "location"; //$NON-NLS-1$
-
- public boolean useDefault();
-
- public void setDefault(boolean value);
-
- public String getPath();
-
- public void setPath(String path);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITarget.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITarget.java
deleted file mode 100644
index 8f167dd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITarget.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ITarget extends ITargetObject {
-
- final String P_NAME = "name"; //$NON-NLS-1$
- final String P_ALL_PLUGINS = "useAllPlugins"; //$NON-NLS-1$
-
- void reset();
-
- String getName();
-
- void setName(String name);
-
- IArgumentsInfo getArguments();
-
- void setArguments(IArgumentsInfo info);
-
- IEnvironmentInfo getEnvironment();
-
- void setEnvironment(IEnvironmentInfo info);
-
- ITargetJRE getTargetJREInfo();
-
- void setTargetJREInfo(ITargetJRE info);
-
- ILocationInfo getLocationInfo();
-
- void setImplicitPluginsInfo(IImplicitDependenciesInfo info);
-
- IImplicitDependenciesInfo getImplicitPluginsInfo();
-
- void setLocationInfo(ILocationInfo info);
-
- void addPlugin(ITargetPlugin plugin);
-
- void addPlugins(ITargetPlugin[] plugins);
-
- void addFeature(ITargetFeature feature);
-
- void addFeatures(ITargetFeature features[]);
-
- void removePlugin(ITargetPlugin plugin);
-
- void removePlugins(ITargetPlugin[] plugins);
-
- void removeFeature(ITargetFeature feature);
-
- void removeFeatures(ITargetFeature[] features);
-
- ITargetPlugin[] getPlugins();
-
- ITargetFeature[] getFeatures();
-
- boolean containsPlugin(String id);
-
- boolean containsFeature(String id);
-
- boolean useAllPlugins();
-
- void setUseAllPlugins(boolean value);
-
- IAdditionalLocation[] getAdditionalDirectories();
-
- void removeAdditionalDirectories(IAdditionalLocation[] dirs);
-
- void addAdditionalDirectories(IAdditionalLocation[] dirs);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetFeature.java
deleted file mode 100644
index 5d4b05e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetFeature.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ITargetFeature extends ITargetObject {
-
- String getId();
-
- void setId(String id);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetJRE.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetJRE.java
deleted file mode 100644
index c8f0a03..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetJRE.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ITargetJRE extends ITargetObject {
-
- public final static int TYPE_DEFAULT = 0;
- public final static int TYPE_NAMED = 1;
- public final static int TYPE_EXECUTION_ENV = 2;
-
- public static final String P_TARGET_JRE = "targetJRE"; //$NON-NLS-1$
-
- /**
- * Returns the JRE type (TYPE_DEFAULT or TYPE_NAMED or TYPE_EXECUTION_ENV)
- *
- * @return the int representing the predefined type of the JRE defined
- */
- public int getJREType();
-
- public String getJREName();
-
- public void setNamedJRE(String name);
-
- public void setExecutionEnvJRE(String name);
-
- public void setDefaultJRE();
-
- public String getCompatibleJRE();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModel.java
deleted file mode 100644
index 672c0f8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModel.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.itarget;
-
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-
-public interface ITargetModel extends IModel, IModelChangeProvider {
-
- ITarget getTarget();
-
- ITargetModelFactory getFactory();
-
- String getInstallLocation();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModelFactory.java
deleted file mode 100644
index 232dc59..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetModelFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ITargetModelFactory {
-
- ITarget createTarget();
-
- IArgumentsInfo createArguments();
-
- IEnvironmentInfo createEnvironment();
-
- ITargetJRE createJREInfo();
-
- ILocationInfo createLocation();
-
- IImplicitDependenciesInfo createImplicitPluginInfo();
-
- ITargetPlugin createPlugin();
-
- ITargetFeature createFeature();
-
- IAdditionalLocation createAdditionalLocation();
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetObject.java
deleted file mode 100644
index 634c67f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetObject.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.itarget;
-
-import java.io.Serializable;
-
-import org.eclipse.pde.core.IWritable;
-import org.w3c.dom.Node;
-
-public interface ITargetObject extends IWritable, Serializable {
-
- ITargetModel getModel();
-
- void setModel(ITargetModel model);
-
- ITarget getTarget();
-
- void parse(Node node);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetPlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetPlugin.java
deleted file mode 100644
index 0305450..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/itarget/ITargetPlugin.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.pde.internal.core.itarget;
-
-public interface ITargetPlugin extends ITargetObject {
-
- String getId();
-
- void setId(String id);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
deleted file mode 100644
index 4f0a880..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#####################################
-PluginModelManager_outOfSync = (out of sync)
-
-###### Status text #####################################
-ExternalModelManager_scanningProblems = Problems encountered while PDE was scanning the Target Platform
-ExternalModelManager_processingPath = Processing path {0}
-Errors_SetupError = PDE Setup Error
-Errors_SetupError_NoPlatformHome = Eclipse home is not set in Preferences
-Errors_modelError = Errors in the manifest file
-BinaryRepositoryProvider_veto=Operation cannot be performed \
-because one or more resources belong to a binary plug-in \
-project that contains linked resources.\n\nTo be able to modify \
-binary project resources, re-import it by copying the content \
-into the workspace.
-RequiredPluginsClasspathContainer_description=Plug-in Dependencies
-ExternalJavaSearchClasspathContainer_description= External Plug-ins
-TargetPlatform_exceptionThrown=Exception caught while creating platform configuration.
-TargetPlatformRegistryLoader_parsing=Parsing Plugins...
-
-FeatureInfo_description = Feature Description
-FeatureInfo_license = License Agreement
-FeatureInfo_copyright = Copyright Notice
-PluginObject_readOnlyChange=Illegal attempt to change read-only plug-in manifest model
-FeatureObject_readOnlyChange=Illegal attempt to change read-only feature manifest model
-SiteObject_readOnlyChange=Illegal attempt to change read-only site manifest model
-
-
-SearchablePluginsManager_saving=Saving...
-BuildObject_readOnlyException=Illegal attempt to change read-only build.properties
-BundleObject_readOnlyException=Illegal attempt to change read-only build.properties
-PluginBase_librariesNotFoundException=Libraries not in the model
-PluginParent_siblingsNotFoundException=Siblings not in the model
-PluginBase_importsNotFoundException=Imports not in the model
-AbstractExtensions_extensionsNotFoundException=Extensions not in the model
-SchemaCompositor_all=All
-SchemaCompositor_choice=Choice
-SchemaCompositor_group=Group
-SchemaCompositor_sequence=Sequence
-SiteBuildObject_readOnlyException=Illegal attempt to change read-only site manifest model
-PDEState_invalidFormat=Invalid manifest format for plug-in located at
-PDEState_readingPlugins=Reading plug-ins...
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensions.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensions.java
deleted file mode 100644
index 2dc9a3b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensions.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.w3c.dom.Node;
-
-public abstract class AbstractExtensions
- extends PluginObject
- implements IExtensions {
-
- protected ArrayList fExtensions = new ArrayList(1);
- protected ArrayList fExtensionPoints = new ArrayList(1);
-
- public void add(IPluginExtension extension) throws CoreException {
- ensureModelEditable();
- fExtensions.add(extension);
- ((PluginExtension) extension).setInTheModel(true);
- ((PluginExtension) extension).setParent(this);
- fireStructureChanged(extension, IModelChangedEvent.INSERT);
- }
- public void add(IPluginExtensionPoint extensionPoint)
- throws CoreException {
- ensureModelEditable();
- fExtensionPoints.add(extensionPoint);
- ((PluginExtensionPoint) extensionPoint).setInTheModel(true);
- ((PluginExtensionPoint) extensionPoint).setParent(this);
- fireStructureChanged(extensionPoint, IModelChangedEvent.INSERT);
- }
-
- public IPluginExtensionPoint[] getExtensionPoints() {
- return (IPluginExtensionPoint[])fExtensionPoints.toArray(new IPluginExtensionPoint[fExtensionPoints.size()]);
- }
- public IPluginExtension[] getExtensions() {
- return (IPluginExtension[])fExtensions.toArray(new IPluginExtension[fExtensions.size()]);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_EXTENSION_ORDER)) {
- swap((IPluginExtension) oldValue, (IPluginExtension) newValue);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void load(IExtensions srcExtensions) {
- addArrayToVector(fExtensions, srcExtensions.getExtensions());
- addArrayToVector(fExtensionPoints, srcExtensions.getExtensionPoints());
- }
-
- protected void addArrayToVector(ArrayList vector, Object[] array) {
- for (int i = 0; i < array.length; i++) {
- Object obj= array[i];
- if (obj instanceof PluginObject)
- ((PluginObject) obj).setParent(this);
- vector.add(obj);
- }
- }
-
- protected void processChild(Node child) {
- String name = child.getNodeName();
- if (name.equals("extension")) { //$NON-NLS-1$
- PluginExtension extension = new PluginExtension();
- extension.setModel(getModel());
- extension.setParent(this);
- fExtensions.add(extension);
- extension.setInTheModel(true);
- extension.load(child);
- } else if (name.equals("extension-point")) { //$NON-NLS-1$
- PluginExtensionPoint point = new PluginExtensionPoint();
- point.setModel(getModel());
- point.setParent(this);
- point.setInTheModel(true);
- fExtensionPoints.add(point);
- point.load(child);
- }
- }
-
- public void remove(IPluginExtension extension) throws CoreException {
- ensureModelEditable();
- fExtensions.remove(extension);
- ((PluginExtension) extension).setInTheModel(false);
- fireStructureChanged(extension, ModelChangedEvent.REMOVE);
- }
- public void remove(IPluginExtensionPoint extensionPoint)
- throws CoreException {
- ensureModelEditable();
- fExtensionPoints.remove(extensionPoint);
- ((PluginExtensionPoint) extensionPoint).setInTheModel(false);
- fireStructureChanged(extensionPoint, ModelChangedEvent.REMOVE);
- }
-
- public void reset() {
- fExtensions = new ArrayList();
- fExtensionPoints = new ArrayList();
- }
-
- public int getExtensionCount() {
- return fExtensions.size();
- }
-
- public int getIndexOf(IPluginExtension e) {
- return fExtensions.indexOf(e);
- }
- public void swap(IPluginExtension e1, IPluginExtension e2)
- throws CoreException {
- ensureModelEditable();
- int index1 = fExtensions.indexOf(e1);
- int index2 = fExtensions.indexOf(e2);
- if (index1 == -1 || index2 == -1)
- throwCoreException(PDECoreMessages.AbstractExtensions_extensionsNotFoundException);
- fExtensions.set(index2, e1);
- fExtensions.set(index2, e2);
- firePropertyChanged(this, P_EXTENSION_ORDER, e1, e2);
- }
- protected void writeChildren(
- String indent,
- String tag,
- Object[] children,
- PrintWriter writer) {
- writer.println(indent + "<" + tag + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 0; i < children.length; i++) {
- IPluginObject obj = (IPluginObject) children[i];
- obj.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + "</" + tag + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected boolean hasRequiredAttributes(){
- // validate extensions
- for (int i = 0; i < fExtensions.size(); i++) {
- IPluginExtension extension = (IPluginExtension)fExtensions.get(i);
- if (!extension.isValid()) return false;
- }
- // validate extension points
- for (int i = 0; i < fExtensionPoints.size(); i++) {
- IPluginExtensionPoint expoint = (IPluginExtensionPoint)fExtensionPoints.get(i);
- if (!expoint.isValid()) return false;
- }
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensionsModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensionsModel.java
deleted file mode 100644
index 46c32f9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractExtensionsModel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IExtensionsModel;
-import org.eclipse.pde.core.plugin.IExtensionsModelFactory;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDEState;
-import org.xml.sax.SAXException;
-
-public abstract class AbstractExtensionsModel
- extends AbstractModel
- implements IExtensionsModel, IExtensionsModelFactory {
- protected Extensions fExtensions;
-
- public IExtensionsModelFactory getFactory() {
- return this;
- }
-
- protected Extensions createExtensions() {
- Extensions extensions = new Extensions();
- extensions.setModel(this);
- return extensions;
- }
-
- public IExtensions getExtensions() {
- return getExtensions(true);
- }
- public IExtensions getExtensions(boolean createIfMissing) {
- if (fExtensions == null && createIfMissing) {
- fExtensions = createExtensions();
- setLoaded(true);
- }
- return fExtensions;
- }
-
- public abstract URL getNLLookupLocation();
-
- protected URL[] getNLLookupLocations() {
- URL locations [] = { getNLLookupLocation() };
- return locations;
- }
-
- public synchronized void load(InputStream stream, boolean outOfSync)
- throws CoreException {
-
- if (fExtensions == null) {
- fExtensions = createExtensions();
- fExtensions.setModel(this);
- }
- fExtensions.reset();
- setLoaded(false);
- try {
- SAXParser parser = getSaxParser();
- PluginHandler handler = new PluginHandler(true);
- parser.parse(stream, handler);
- fExtensions.load(handler.getDocumentElement());
- setLoaded(true);
- if (!outOfSync)
- updateTimeStamp();
- } catch (ParserConfigurationException e) {
- } catch (SAXException e) {
- } catch (FactoryConfigurationError e) {
- } catch (IOException e) {
- }
- }
-
- public void load(BundleDescription desc, PDEState state) {
- fExtensions = createExtensions();
- fExtensions.setModel(this);
- fExtensions.load(state.getAllExtensions(desc.getBundleId()));
- updateTimeStamp();
- setLoaded(true);
- }
-
- public void reload(InputStream stream, boolean outOfSync)
- throws CoreException {
- load(stream, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { fExtensions },
- null));
- }
- protected abstract void updateTimeStamp();
-
- public IPluginAttribute createAttribute(IPluginElement element) {
- PluginAttribute attribute = new PluginAttribute();
- attribute.setModel(this);
- attribute.setParent(element);
- return attribute;
- }
- public IPluginElement createElement(IPluginObject parent) {
- PluginElement element = new PluginElement();
- element.setModel(this);
- element.setParent(parent);
- return element;
- }
- public IPluginExtension createExtension() {
- PluginExtension extension = new PluginExtension();
- extension.setParent(getExtensions());
- extension.setModel(this);
- return extension;
- }
- public IPluginExtensionPoint createExtensionPoint() {
- PluginExtensionPoint extensionPoint = new PluginExtensionPoint();
- extensionPoint.setModel(this);
- extensionPoint.setParent(getExtensions());
- return extensionPoint;
- }
-
- public boolean isValid() {
- if (!isLoaded()) return false;
- if (fExtensions==null) return false;
- return fExtensions.isValid();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractPluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractPluginModelBase.java
deleted file mode 100644
index 0f54f7f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AbstractPluginModelBase.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IExtensionsModelFactory;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginModelFactory;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDEState;
-
-public abstract class AbstractPluginModelBase
- extends AbstractModel
- implements IPluginModelBase, IPluginModelFactory {
- protected PluginBase fPluginBase;
- private boolean enabled;
- private BundleDescription fBundleDescription;
- protected boolean fAbbreviated;
-
- public AbstractPluginModelBase() {
- super();
- }
-
- public abstract String getInstallLocation();
-
- public abstract IPluginBase createPluginBase();
-
- public IExtensions createExtensions() {
- return createPluginBase();
- }
-
- public IExtensionsModelFactory getFactory() {
- return this;
- }
-
- public IPluginModelFactory getPluginFactory() {
- return this;
- }
-
- public IPluginBase getPluginBase() {
- return getPluginBase(true);
- }
- public IPluginBase getPluginBase(boolean createIfMissing) {
- if (fPluginBase == null && createIfMissing) {
- fPluginBase = (PluginBase) createPluginBase();
- setLoaded(true);
- }
- return fPluginBase;
- }
-
- public void load(InputStream stream, boolean outOfSync) throws CoreException {
- if (fPluginBase == null) {
- fPluginBase = (PluginBase) createPluginBase();
- fPluginBase.setModel(this);
- }
- fPluginBase.reset();
- setLoaded(false);
- try {
- SAXParser parser = getSaxParser();
- PluginHandler handler = new PluginHandler(fAbbreviated);
- parser.parse(stream, handler);
- fPluginBase.load(handler.getDocumentElement(), handler.getSchemaVersion());
- setLoaded(true);
- if (!outOfSync)
- updateTimeStamp();
- } catch (Exception e) {
- }
- }
-
- public void load(BundleDescription description, PDEState state, boolean ignoreExtensions) {
- setBundleDescription(description);
- IPluginBase base = getPluginBase();
- if (base instanceof Plugin)
- ((Plugin)base).load(description, state, ignoreExtensions);
- else
- ((Fragment)base).load(description, state, ignoreExtensions);
- updateTimeStamp();
- setLoaded(true);
- }
-
- public IExtensions getExtensions() {
- return getPluginBase();
- }
- public IExtensions getExtensions(boolean createIfMissing) {
- return getPluginBase(createIfMissing);
- }
- public boolean isEnabled() {
- return enabled;
- }
- public boolean isFragmentModel() {
- return false;
- }
-
- public void reload(InputStream stream, boolean outOfSync)
- throws CoreException {
- load(stream, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { fPluginBase },
- null));
- }
- public void setEnabled(boolean newEnabled) {
- enabled = newEnabled;
- }
- public String toString() {
- IPluginBase pluginBase = getPluginBase();
- if (pluginBase != null)
- return pluginBase.getTranslatedName();
- return super.toString();
- }
-
- protected abstract void updateTimeStamp();
-
- public IPluginAttribute createAttribute(IPluginElement element) {
- PluginAttribute attribute = new PluginAttribute();
- attribute.setModel(this);
- attribute.setParent(element);
- return attribute;
- }
- public IPluginElement createElement(IPluginObject parent) {
- PluginElement element = new PluginElement();
- element.setModel(this);
- element.setParent(parent);
- return element;
- }
- public IPluginExtension createExtension() {
- PluginExtension extension = new PluginExtension();
- extension.setParent(getPluginBase());
- extension.setModel(this);
- return extension;
- }
- public IPluginExtensionPoint createExtensionPoint() {
- PluginExtensionPoint extensionPoint = new PluginExtensionPoint();
- extensionPoint.setModel(this);
- extensionPoint.setParent(getPluginBase());
- return extensionPoint;
- }
- public IPluginImport createImport() {
- PluginImport iimport = new PluginImport();
- iimport.setModel(this);
- iimport.setParent(getPluginBase());
- return iimport;
- }
- public IPluginLibrary createLibrary() {
- PluginLibrary library = new PluginLibrary();
- library.setModel(this);
- library.setParent(getPluginBase());
- return library;
- }
-
- public boolean isValid() {
- if (!isLoaded()) return false;
- if (fPluginBase==null) return false;
- return fPluginBase.isValid();
- }
-
- public boolean isBundleModel() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#dispose()
- */
- public void dispose() {
- fBundleDescription = null;
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getBundleDescription()
- */
- public BundleDescription getBundleDescription() {
- return fBundleDescription;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#setBundleDescription(org.eclipse.osgi.service.resolver.BundleDescription)
- */
- public void setBundleDescription(BundleDescription description) {
- fBundleDescription = description;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AttributeChangedEvent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AttributeChangedEvent.java
deleted file mode 100644
index 6114996..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/AttributeChangedEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.ModelChangedEvent;
-
-public class AttributeChangedEvent extends ModelChangedEvent {
- public static final String P_ATTRIBUTE_VALUE = "att_value"; //$NON-NLS-1$
-
- private Object attribute;
-
- public AttributeChangedEvent(IModelChangeProvider provider, Object element,
- Object attribute, String oldValue, String newValue) {
- super(provider, element, P_ATTRIBUTE_VALUE, oldValue, newValue);
- this.attribute = attribute;
- }
-
- public Object getChangedAttribute() {
- return attribute;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Extensions.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Extensions.java
deleted file mode 100644
index c87492c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Extensions.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Extensions
- extends AbstractExtensions {
- private static final long serialVersionUID = 1L;
- private boolean valid;
- private boolean fIsFragment;
-
- public Extensions() {
- }
-
- void load(Extensions srcPluginBase) {
- super.load(srcPluginBase);
- valid = hasRequiredAttributes();
- }
-
- void load(Node node) {
- if (node == null)
- return;
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- processChild(child);
- }
- }
- valid = hasRequiredAttributes();
- }
-
- void load(Node[] nodes) {
- for (int i = 0; i < nodes.length; i++) {
- Node child = nodes[i];
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- processChild(child);
- }
- }
- valid = hasRequiredAttributes();
- }
-
- public void reset() {
- super.reset();
- valid=false;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- writer.print(fIsFragment ? "<fragment>" : "<plugin>"); //$NON-NLS-1$ //$NON-NLS-2$
-
- writer.println();
-
- String firstIndent = " "; //$NON-NLS-1$
-
- Object [] children = getExtensionPoints();
- if (children.length > 0)
- writer.println();
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtensionPoint) children[i]).write(firstIndent, writer);
- }
-
- // add extensions
- children = getExtensions();
- if (children.length > 0)
- writer.println();
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtension) children[i]).write(firstIndent, writer);
- }
- writer.println();
- writer.println(fIsFragment ? "</fragment>" : "</plugin>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void setIsFragment(boolean isFragment) {
- fIsFragment = isFragment;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalFragmentModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalFragmentModel.java
deleted file mode 100644
index 3f4a329..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalFragmentModel.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginBase;
-
-public class ExternalFragmentModel extends ExternalPluginModelBase implements
- IFragmentModel {
-
- private static final long serialVersionUID = 1L;
-
- public IPluginBase createPluginBase() {
- PluginBase base = new Fragment();
- base.setModel(this);
- return base;
- }
-
- public IFragment getFragment() {
- return (IFragment) getPluginBase();
- }
-
- public boolean isFragmentModel() {
- return true;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModel.java
deleted file mode 100644
index 604879f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModel.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModel;
-
-public class ExternalPluginModel extends ExternalPluginModelBase implements
- IPluginModel {
-
- private static final long serialVersionUID = 1L;
-
- public IPluginBase createPluginBase() {
- PluginBase base = new Plugin();
- base.setModel(this);
- return base;
- }
-
- public IPlugin getPlugin() {
- return (IPlugin) getPluginBase();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModelBase.java
deleted file mode 100644
index da05683..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ExternalPluginModelBase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDEManager;
-import org.eclipse.pde.internal.core.PDEState;
-
-public abstract class ExternalPluginModelBase extends AbstractPluginModelBase {
-
- private String fInstallLocation;
-
- private String fLocalization;
-
- public ExternalPluginModelBase() {
- super();
- }
-
- protected NLResourceHelper createNLResourceHelper() {
- return (fLocalization == null)
- ? null : new NLResourceHelper(fLocalization, PDEManager.getNLLookupLocations(this)); //$NON-NLS-1$
- }
-
- public URL getNLLookupLocation() {
- try {
- return new URL("file:" + fInstallLocation); //$NON-NLS-1$
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public IBuildModel getBuildModel() {
- return null;
- }
-
- public String getInstallLocation() {
- return fInstallLocation;
- }
-
- public boolean isEditable() {
- return false;
- }
-
- public void load() {
- }
-
- public void load(BundleDescription description, PDEState state, boolean ignoreExtensions) {
- IPath path = new Path(description.getLocation());
- String device = path.getDevice();
- if (device != null)
- path = path.setDevice(device.toUpperCase());
- setInstallLocation(path.toOSString());
- fLocalization = state.getBundleLocalization(description.getBundleId());
- super.load(description, state, ignoreExtensions);
- }
-
- public boolean isInSync() {
- return isInSync(getLocalFile());
- }
-
- private File getLocalFile() {
- File file = new File(getInstallLocation());
- if (file.isFile())
- return file;
-
- file = new File(file, "META-INF/MANIFEST.MF"); //$NON-NLS-1$
- if (!file.exists()) {
- String manifest = isFragmentModel() ? "fragment.xml" : "plugin.xml"; //$NON-NLS-1$ //$NON-NLS-2$
- file = new File(getInstallLocation(), manifest);
- }
- return file;
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(getLocalFile());
- }
-
- public void setInstallLocation(String newInstallLocation) {
- fInstallLocation = newInstallLocation;
- File file = new File(newInstallLocation);
- if (file.isDirectory())
- fInstallLocation += File.separator;
- }
-
- public String getLocalization() {
- return fLocalization;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Fragment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Fragment.java
deleted file mode 100644
index 51c42e1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Fragment.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IMatchRules;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.internal.core.PDEState;
-import org.w3c.dom.Node;
-
-public class Fragment extends PluginBase implements IFragment {
- private static final long serialVersionUID = 1L;
-
- private String fPluginId = ""; //$NON-NLS-1$
-
- private String fPluginVersion = ""; //$NON-NLS-1$
-
- private int fMatchRule = IMatchRules.NONE;
-
- public String getPluginId() {
- return fPluginId;
- }
-
- public String getPluginVersion() {
- return fPluginVersion;
- }
-
- public int getRule() {
- return fMatchRule;
- }
-
- protected boolean hasRequiredAttributes() {
- if (fPluginId == null || fPluginVersion == null)
- return false;
- return super.hasRequiredAttributes();
- }
-
- void load(BundleDescription bundleDescription, PDEState state, boolean ignoreExtensions) {
- HostSpecification host = bundleDescription.getHost();
- fPluginId = host.getName();
- VersionRange versionRange = host.getVersionRange();
- if (versionRange != null) {
- fPluginVersion = versionRange.getMinimum() != null ? versionRange
- .getMinimum().toString()
- : null;
- fMatchRule = PluginBase.getMatchRule(versionRange);
- }
- super.load(bundleDescription, state, ignoreExtensions);
- }
-
- void load(Node node, String schemaVersion) {
- fPluginId = getNodeAttribute(node, "plugin-id"); //$NON-NLS-1$
- fPluginVersion = getNodeAttribute(node, "plugin-version"); //$NON-NLS-1$
- String match = getNodeAttribute(node, "match"); //$NON-NLS-1$
- if (match != null) {
- String[] table = IMatchRules.RULE_NAME_TABLE;
- for (int i = 0; i < table.length; i++) {
- if (match.equalsIgnoreCase(table[i])) {
- fMatchRule = i;
- break;
- }
- }
- }
- super.load(node, schemaVersion);
- }
-
- public void reset() {
- fPluginId = ""; //$NON-NLS-1$
- fPluginVersion = ""; //$NON-NLS-1$
- fMatchRule = IMatchRules.NONE;
- super.reset();
- }
-
- public void setPluginId(String newPluginId) throws CoreException {
- ensureModelEditable();
- String oldValue = this.fPluginId;
- fPluginId = newPluginId;
- firePropertyChanged(P_PLUGIN_ID, oldValue, fPluginId);
- }
-
- public void setPluginVersion(String newPluginVersion) throws CoreException {
- ensureModelEditable();
- String oldValue = this.fPluginVersion;
- fPluginVersion = newPluginVersion;
- firePropertyChanged(P_PLUGIN_VERSION, oldValue, fPluginVersion);
- }
-
- public void setRule(int rule) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.fMatchRule);
- fMatchRule = rule;
- firePropertyChanged(P_RULE, oldValue, new Integer(rule));
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_PLUGIN_ID)) {
- setPluginId(newValue != null ? newValue.toString() : null);
- return;
- }
- if (name.equals(P_PLUGIN_VERSION)) {
- setPluginVersion(newValue != null ? newValue.toString() : null);
- return;
- }
- if (name.equals(P_RULE)) {
- setRule(((Integer) newValue).intValue());
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- if (getSchemaVersion() != null) {
- writer.println("<?eclipse version=\"" + getSchemaVersion() + "\"?>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.print("<fragment"); //$NON-NLS-1$
- if (getId() != null) {
- writer.println();
- writer.print(" id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getName() != null) {
- writer.println();
- writer.print(" name=\"" + getWritableString(getName()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getVersion() != null) {
- writer.println();
- writer.print(" version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getProviderName() != null) {
- writer.println();
- writer.print(" provider-name=\"" + getWritableString(getProviderName()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getPluginId() != null) {
- writer.println();
- writer.print(" plugin-id=\"" + getPluginId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getPluginVersion() != null) {
- writer.println();
- writer.print(" plugin-version=\"" + getPluginVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getRule() != IMatchRules.NONE) {
- writer.println();
- writer.print(" match=\"" + IMatchRules.RULE_NAME_TABLE[getRule()] + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println(">"); //$NON-NLS-1$
- writer.println();
-
- String firstIndent = " "; //$NON-NLS-1$
-
- // add runtime
- Object[] children = getLibraries();
- if (children.length > 0) {
- writeChildren(firstIndent, "runtime", children, writer); //$NON-NLS-1$
- writer.println();
- }
-
- // add requires
- children = getImports();
- if (children.length > 0) {
- writeChildren(firstIndent, "requires", children, writer); //$NON-NLS-1$
- writer.println();
- }
-
- children = getExtensionPoints();
- if (children.length > 0) {
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtensionPoint) children[i]).write(firstIndent, writer);
- }
- writer.println();
- }
-
- // add extensions
- children = getExtensions();
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtension) children[i]).write(firstIndent, writer);
- }
- writer.println("</fragment>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/IdentifiablePluginObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/IdentifiablePluginObject.java
deleted file mode 100644
index 894bcfc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/IdentifiablePluginObject.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-
-public abstract class IdentifiablePluginObject extends PluginObject implements IIdentifiable {
- protected String id;
-
-public IdentifiablePluginObject() {
-}
-public String getId() {
- return id;
-}
-public void setId(String id) throws CoreException {
- ensureModelEditable();
- String oldValue = this.id;
- this.id = id;
- firePropertyChanged(P_ID, oldValue, id);
-}
-
-public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException {
- if (name.equals(P_ID)) {
- setId(newValue!=null ? newValue.toString():null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
-}
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ImportObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ImportObject.java
deleted file mode 100644
index 74d607d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/ImportObject.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-
-import org.eclipse.pde.core.ISourceObject;
-import org.eclipse.pde.core.IWritable;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginImport;
-
-public class ImportObject extends PluginReference implements IWritable, Serializable {
- private static final long serialVersionUID = 1L;
- private IPluginImport iimport;
-
- public ImportObject() {
- super();
- }
- public ImportObject(IPluginImport iimport) {
- super(iimport.getId());
- this.iimport = iimport;
- }
- public ImportObject(IPluginImport iimport, IPlugin plugin) {
- super(plugin);
- this.iimport = iimport;
- }
- public IPluginImport getImport() {
- return iimport;
- }
- public boolean equals(Object object) {
- if (object instanceof ImportObject) {
- ImportObject io = (ImportObject)object;
- if (iimport.equals(io.getImport()))
- return true;
- }
- return false;
- }
- public void write(String indent, PrintWriter writer) {
- iimport.write(indent, writer);
- }
- public Object getAdapter(Class key) {
- if (key.equals(ISourceObject.class)) {
- if (iimport instanceof ISourceObject)
- return iimport;
- }
- return super.getAdapter(key);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Plugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Plugin.java
deleted file mode 100644
index e9d16ec..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/Plugin.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.internal.core.PDEState;
-import org.w3c.dom.Node;
-
-public class Plugin extends PluginBase implements IPlugin {
- private static final long serialVersionUID = 1L;
- private String fClassname;
- private boolean fHasExtensibleAPI;
-
- public String getClassName() {
- return fClassname;
- }
-
- public IPlugin getPlugin() {
- return this;
- }
-
- void load(BundleDescription bundleDescription, PDEState state, boolean ignoreExtensions) {
- fClassname = state.getClassName(bundleDescription.getBundleId());
- fHasExtensibleAPI = state.hasExtensibleAPI(bundleDescription.getBundleId());
- super.load(bundleDescription, state, ignoreExtensions);
- }
-
- void load(Node node, String schemaVersion) {
- fClassname = getNodeAttribute(node, "class"); //$NON-NLS-1$
- super.load(node, schemaVersion);
- }
-
- public void reset() {
- fClassname = null;
- super.reset();
- }
- public void setClassName(String newClassName) throws CoreException {
- ensureModelEditable();
- String oldValue = fClassname;
- fClassname = newClassName;
- firePropertyChanged(P_CLASS_NAME, oldValue, fClassname);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_CLASS_NAME)) {
- setClassName(newValue != null ? newValue.toString() : null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- if (getSchemaVersion()!=null) {
- writer.println("<?eclipse version=\"" + getSchemaVersion() + "\"?>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.print("<plugin"); //$NON-NLS-1$
- if (getId() != null) {
- writer.println();
- writer.print(" id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getName() != null) {
- writer.println();
- writer.print(" name=\"" + getWritableString(getName()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getVersion() != null) {
- writer.println();
- writer.print(" version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getProviderName() != null) {
- writer.println();
- writer.print(
- " provider-name=\"" //$NON-NLS-1$
- + getWritableString(getProviderName())
- + "\""); //$NON-NLS-1$
- }
- if (getClassName() != null) {
- writer.println();
- writer.print(" class=\"" + getClassName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println(">"); //$NON-NLS-1$
- writer.println();
-
- String firstIndent = " "; //$NON-NLS-1$
-
- // add runtime
- Object[] children = getLibraries();
- if (children.length > 0) {
- writeChildren(firstIndent, "runtime", children, writer); //$NON-NLS-1$
- writer.println();
- }
-
- // add requires
- children = getImports();
- if (children.length > 0) {
- writeChildren(firstIndent, "requires", children, writer); //$NON-NLS-1$
- writer.println();
- }
-
- children = getExtensionPoints();
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtensionPoint) children[i]).write(firstIndent, writer);
- }
- if (children.length > 0)
- writer.println();
-
- // add extensions
- children = getExtensions();
- for (int i = 0; i < children.length; i++) {
- ((IPluginExtension) children[i]).write(firstIndent, writer);
- }
- if (children.length > 0)
- writer.println();
-
- writer.println("</plugin>"); //$NON-NLS-1$
- }
-
- public boolean hasExtensibleAPI() {
- return fHasExtensibleAPI;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginAttribute.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginAttribute.java
deleted file mode 100644
index 06e3379..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginAttribute.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.w3c.dom.Node;
-
-public class PluginAttribute extends PluginObject implements IPluginAttribute {
- private static final long serialVersionUID = 1L;
-
- protected String fValue;
-
- private transient ISchemaAttribute attributeInfo;
-
- public PluginAttribute() {
- }
-
- PluginAttribute(IPluginAttribute attribute) {
- setModel(attribute.getModel());
- setParent(attribute.getParent());
- fName = attribute.getName();
- fValue = attribute.getValue();
- this.attributeInfo = ((PluginAttribute) attribute).getAttributeInfo();
- }
-
- public Object clone() {
- return new PluginAttribute(this);
- }
-
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (obj == null)
- return false;
- if (obj instanceof IPluginAttribute) {
- IPluginAttribute target = (IPluginAttribute) obj;
- if (target.getModel().equals(getModel()))
- return false;
- if (stringEqualWithNull(getName(), target.getName())
- && stringEqualWithNull(getValue(), target.getValue()))
- return true;
- }
- return false;
- }
-
- public ISchemaAttribute getAttributeInfo() {
- if (attributeInfo != null) {
- ISchema schema = attributeInfo.getSchema();
- if (schema.isDisposed()) {
- attributeInfo = null;
- }
- }
- if (attributeInfo == null) {
- PluginElement element = (PluginElement) getParent();
- ISchemaElement elementInfo = (ISchemaElement) element
- .getElementInfo();
- if (elementInfo != null) {
- attributeInfo = elementInfo.getAttribute(getName());
- }
- }
- return attributeInfo;
- }
-
- public String getValue() {
- return fValue;
- }
-
- void load(Node node) {
- fName = node.getNodeName();
- fValue = node.getNodeValue();
- }
-
- public void setAttributeInfo(ISchemaAttribute newAttributeInfo) {
- attributeInfo = newAttributeInfo;
- }
-
- public void setValue(String newValue) throws CoreException {
- ensureModelEditable();
- String oldValue = fValue;
- fValue = newValue;
- AttributeChangedEvent e = new AttributeChangedEvent(getModel(),
- getParent(), this, oldValue, newValue);
- fireModelChanged(e);
- }
-
- public void write(String indent, PrintWriter writer) {
- if (fValue == null)
- return;
- writer.print(indent);
- writer.print(getName() + "=\"" + getWritableString(fValue) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginBase.java
deleted file mode 100644
index ce63d9e..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginBase.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.util.ArrayList;
-import java.util.Locale;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IMatchRules;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.PDEState;
-import org.eclipse.pde.internal.core.PDEStateHelper;
-import org.osgi.framework.Version;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-public abstract class PluginBase
- extends AbstractExtensions
- implements IPluginBase {
- private static final Version maxVersion = new Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
-
- private ArrayList fLibraries = new ArrayList();
- private ArrayList fImports = new ArrayList();
- private String fProviderName;
- private String fId;
- private String fVersion;
- private String fSchemaVersion;
-
- private String fTargetVersion = "3.1"; //$NON-NLS-1$
-
- public String getSchemaVersion() {
- return fSchemaVersion;
- }
- public void setSchemaVersion(String schemaVersion) throws CoreException {
- ensureModelEditable();
- String oldValue = fSchemaVersion;
- fSchemaVersion = schemaVersion;
- firePropertyChanged(P_SCHEMA_VERSION, oldValue, schemaVersion);
- }
- public void add(IPluginLibrary library) throws CoreException {
- ensureModelEditable();
- fLibraries.add(library);
- ((PluginLibrary) library).setInTheModel(true);
- ((PluginLibrary) library).setParent(this);
- fireStructureChanged(library, IModelChangedEvent.INSERT);
- }
- public void add(IPluginImport iimport) throws CoreException {
- ensureModelEditable();
- ((PluginImport) iimport).setInTheModel(true);
- ((PluginImport) iimport).setParent(this);
- fImports.add(iimport);
- fireStructureChanged(iimport, IModelChangedEvent.INSERT);
- }
- public IPluginLibrary[] getLibraries() {
- return (IPluginLibrary[])fLibraries.toArray(new IPluginLibrary[fLibraries.size()]);
- }
- public IPluginImport[] getImports() {
- return (IPluginImport[])fImports.toArray(new IPluginImport[fImports.size()]);
- }
- public IPluginBase getPluginBase() {
- return this;
- }
- public String getProviderName() {
- return fProviderName;
- }
- public String getVersion() {
- return fVersion;
- }
- public String getId() {
- return fId;
- }
-
- void load(BundleDescription bundleDesc, PDEState state, boolean ignoreExtensions) {
- fId = bundleDesc.getSymbolicName();
- fVersion = bundleDesc.getVersion().toString();
- fName = state.getPluginName(bundleDesc.getBundleId());
- fProviderName = state.getProviderName(bundleDesc.getBundleId());
- if (!state.isLegacy(bundleDesc.getBundleId()))
- fSchemaVersion = "3.0"; //$NON-NLS-1$
- loadRuntime(bundleDesc, state);
- loadImports(bundleDesc);
- if (!ignoreExtensions) {
- loadExtensionPoints(state.getExtensionPoints(bundleDesc.getBundleId()));
- loadExtensions(state.getExtensions(bundleDesc.getBundleId()));
- }
- }
-
- void loadExtensions(Node[] list) {
- fExtensions = new ArrayList();
- for (int i = 0; i < list.length; i++) {
- PluginExtension extension = new PluginExtension();
- extension.setInTheModel(true);
- extension.setModel(getModel());
- extension.setParent(this);
- extension.load(list[i]);
- fExtensions.add(extension);
- }
- }
-
- void loadExtensionPoints(Node[] list) {
- fExtensionPoints = new ArrayList(list.length);
- for (int i = 0; i < list.length; i++) {
- PluginExtensionPoint extPoint = new PluginExtensionPoint();
- extPoint.setInTheModel(true);
- extPoint.setModel(getModel());
- extPoint.setParent(this);
- extPoint.load(list[i]);
- fExtensionPoints.add(extPoint);
- }
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_ID)) {
- setId(newValue != null ? newValue.toString() : null);
- return;
- }
- if (name.equals(P_VERSION)) {
- setVersion(newValue != null ? newValue.toString() : null);
- return;
- }
- if (name.equals(P_PROVIDER)) {
- setProviderName(newValue != null ? newValue.toString() : null);
- return;
- }
- if (name.equals(P_LIBRARY_ORDER)) {
- swap((IPluginLibrary) oldValue, (IPluginLibrary) newValue);
- return;
- }
- if (name.equals(P_SCHEMA_VERSION)) {
- setSchemaVersion(newValue!=null? newValue.toString():null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- void load(Node node, String schemaVersion) {
- if (node == null)
- return;
- fSchemaVersion = schemaVersion;
- fId = getNodeAttribute(node, "id"); //$NON-NLS-1$
- fName = getNodeAttribute(node, "name"); //$NON-NLS-1$
- fProviderName = getNodeAttribute(node, "provider-name"); //$NON-NLS-1$
- fVersion = getNodeAttribute(node, "version"); //$NON-NLS-1$
-
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- processChild(child);
- }
- }
- }
-
- void loadRuntime(BundleDescription description, PDEState state) {
- String[] libraryNames = state.getLibraryNames(description.getBundleId());
- for (int i = 0; i < libraryNames.length; i++) {
- PluginLibrary library = new PluginLibrary();
- library.setModel(getModel());
- library.setInTheModel(true);
- library.setParent(this);
- library.load(libraryNames[i]);
- fLibraries.add(library);
- }
- }
-
- void loadRuntime(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().toLowerCase(Locale.ENGLISH).equals("library")) { //$NON-NLS-1$
- PluginLibrary library = new PluginLibrary();
- library.setModel(getModel());
- library.setInTheModel(true);
- library.setParent(this);
- fLibraries.add(library);
- library.load(child);
- }
- }
- }
-
- void loadImports(BundleDescription description) {
- BundleSpecification[] required = description.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- fImports.add(importElement);
- importElement.load(required[i]);
- }
- BundleDescription[] imported = PDEStateHelper.getImportedBundles(description);
- for (int i = 0; i < imported.length; i++) {
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- fImports.add(importElement);
- importElement.load(imported[i]);
- }
- }
-
- void loadImports(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().toLowerCase(Locale.ENGLISH).equals("import")) { //$NON-NLS-1$
- PluginImport importElement = new PluginImport();
- importElement.setModel(getModel());
- importElement.setInTheModel(true);
- importElement.setParent(this);
- fImports.add(importElement);
- importElement.load(child);
- }
- }
- }
- protected void processChild(Node child) {
- String name = child.getNodeName().toLowerCase(Locale.ENGLISH);
- if (name.equals("runtime")) { //$NON-NLS-1$
- loadRuntime(child);
- } else if (name.equals("requires")) { //$NON-NLS-1$
- loadImports(child);
- } else {
- super.processChild(child);
- }
- }
-
- public void remove(IPluginLibrary library) throws CoreException {
- ensureModelEditable();
- fLibraries.remove(library);
- ((PluginLibrary) library).setInTheModel(false);
- fireStructureChanged(library, ModelChangedEvent.REMOVE);
- }
- public void remove(IPluginImport iimport) throws CoreException {
- ensureModelEditable();
- fImports.remove(iimport);
- ((PluginImport) iimport).setInTheModel(false);
- fireStructureChanged(iimport, ModelChangedEvent.REMOVE);
- }
- public void reset() {
- fLibraries = new ArrayList();
- fImports = new ArrayList();
- fProviderName = null;
- fSchemaVersion = null;
- fVersion = ""; //$NON-NLS-1$
- fName = ""; //$NON-NLS-1$
- fId = ""; //$NON-NLS-1$
- if (getModel() != null && getModel().getUnderlyingResource() != null) {
- fId = getModel().getUnderlyingResource().getProject().getName();
- fName = fId;
- fVersion = "0.0.0"; //$NON-NLS-1$
- }
- super.reset();
- }
-
- public void setProviderName(String providerName) throws CoreException {
- ensureModelEditable();
- String oldValue = fProviderName;
- fProviderName = providerName;
- firePropertyChanged(P_PROVIDER, oldValue, fProviderName);
- }
-
- public void setVersion(String newVersion) throws CoreException {
- ensureModelEditable();
- String oldValue = fVersion;
- fVersion = newVersion;
- firePropertyChanged(P_VERSION, oldValue, fVersion);
- }
-
- public void setId(String newId) throws CoreException {
- ensureModelEditable();
- String oldValue = fId;
- fId = newId;
- firePropertyChanged(P_ID, oldValue, fId);
- }
-
- public void internalSetVersion(String newVersion) {
- fVersion = newVersion;
- }
-
- public void swap(IPluginLibrary l1, IPluginLibrary l2)
- throws CoreException {
- ensureModelEditable();
- int index1 = fLibraries.indexOf(l1);
- int index2 = fLibraries.indexOf(l2);
- if (index1 == -1 || index2 == -1)
- throwCoreException(PDECoreMessages.PluginBase_librariesNotFoundException);
- fLibraries.set(index2, l1);
- fLibraries.set(index1, l2);
- firePropertyChanged(this, P_LIBRARY_ORDER, l1, l2);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#swap(org.eclipse.pde.core.plugin.IPluginImport, org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void swap(IPluginImport import1, IPluginImport import2)
- throws CoreException {
- ensureModelEditable();
- int index1 = fImports.indexOf(import1);
- int index2 = fImports.indexOf(import2);
- if (index1 == -1 || index2 == -1)
- throwCoreException(PDECoreMessages.PluginBase_importsNotFoundException);
- fImports.set(index2, import1);
- fImports.set(index1, import2);
- firePropertyChanged(this, P_IMPORT_ORDER, import1, import2);
- }
-
- public boolean isValid() {
- return hasRequiredAttributes();
- }
- protected boolean hasRequiredAttributes(){
- if (fName==null) return false;
- if (fId==null) return false;
- if (fVersion==null) return false;
-
- // validate libraries
- for (int i = 0; i < fLibraries.size(); i++) {
- IPluginLibrary library = (IPluginLibrary)fLibraries.get(i);
- if (!library.isValid()) return false;
- }
- // validate imports
- for (int i = 0; i < fImports.size(); i++) {
- IPluginImport iimport = (IPluginImport)fImports.get(i);
- if (!iimport.isValid()) return false;
- }
- return super.hasRequiredAttributes();
- }
-
- protected SAXParser getSaxParser() throws ParserConfigurationException, SAXException, FactoryConfigurationError {
- return SAXParserFactory.newInstance().newSAXParser();
- }
-
- public static int getMatchRule(VersionRange versionRange) {
- if (versionRange == null || versionRange.getMinimum() == null)
- return IMatchRules.NONE;
-
- Version minimum = versionRange.getMinimum();
- Version maximum = versionRange.getMaximum() == null ? maxVersion : versionRange.getMaximum();
-
- if (maximum.compareTo(maxVersion) >= 0)
- return IMatchRules.GREATER_OR_EQUAL;
- else if (minimum.equals(maximum))
- return IMatchRules.PERFECT;
- else if (!versionRange.isIncluded(minimum) || versionRange.isIncluded(maximum))
- return IMatchRules.NONE; // no real match rule for this
- else if (minimum.getMajor() == maximum.getMajor() - 1)
- return IMatchRules.COMPATIBLE;
- else if (minimum.getMajor() != maximum.getMajor())
- return IMatchRules.NONE; // no real match rule for this
- else if (minimum.getMinor() == maximum.getMinor() - 1)
- return IMatchRules.EQUIVALENT;
- else if (minimum.getMinor() != maximum.getMinor())
- return IMatchRules.NONE; // no real match rule for this
- else if (minimum.getMicro() == maximum.getMicro() - 1)
- return IMatchRules.PERFECT; // this is as close as we got
-
- return IMatchRules.NONE; // no real match rule for this
- }
-
- public void setTargetVersion(String target) {
- fTargetVersion = target;
- }
-
- public String getTargetVersion() {
- return fTargetVersion;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginElement.java
deleted file mode 100644
index e0ec99b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginElement.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class PluginElement extends PluginParent implements IPluginElement {
- private static final long serialVersionUID = 1L;
-
- static final String ATTRIBUTE_SHIFT = " "; //$NON-NLS-1$
-
- static final String ELEMENT_SHIFT = " "; //$NON-NLS-1$
-
- private transient ISchemaElement fElementInfo;
-
- private String fText;
-
- private Hashtable fAttributes = new Hashtable();
-
- public PluginElement() {
- }
-
- PluginElement(PluginElement element) {
- setModel(element.getModel());
- setParent(element.getParent());
- fName = element.getName();
- IPluginAttribute[] atts = element.getAttributes();
- for (int i = 0; i < atts.length; i++) {
- PluginAttribute att = (PluginAttribute) atts[i];
- fAttributes.put(att.getName(), att.clone());
- }
- fText = element.getText();
- fElementInfo = (ISchemaElement) element.getElementInfo();
- }
-
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (obj == null)
- return false;
- if (obj instanceof IPluginElement) {
- IPluginElement target = (IPluginElement) obj;
- if (target.getModel().equals(getModel()))
- return false;
- if (target.getAttributeCount() != getAttributeCount())
- return false;
- IPluginAttribute tatts[] = target.getAttributes();
- for (int i = 0; i < tatts.length; i++) {
- IPluginAttribute tatt = tatts[i];
- if (tatt.equals(fAttributes.get(tatt.getName())) == false)
- return false;
- }
- return super.equals(obj);
- }
- return false;
- }
-
- public IPluginElement createCopy() {
- return new PluginElement(this);
- }
-
- public IPluginAttribute getAttribute(String name) {
- return (IPluginAttribute) fAttributes.get(name);
- }
-
- public IPluginAttribute[] getAttributes() {
- Collection values = fAttributes.values();
- IPluginAttribute[] result = new IPluginAttribute[values.size()];
- return (IPluginAttribute[]) values.toArray(result);
- }
-
- public int getAttributeCount() {
- return fAttributes.size();
- }
-
- public Object getElementInfo() {
- if (fElementInfo != null) {
- ISchema schema = fElementInfo.getSchema();
- if (schema.isDisposed()) {
- fElementInfo = null;
- }
- }
- if (fElementInfo == null) {
- IPluginObject parent = getParent();
- while (parent != null && !(parent instanceof IPluginExtension)) {
- parent = parent.getParent();
- }
- if (parent != null) {
- PluginExtension extension = (PluginExtension) parent;
- ISchema schema = (ISchema) extension.getSchema();
- if (schema != null) {
- fElementInfo = schema.findElement(getName());
- }
- }
- }
- return fElementInfo;
- }
-
- public String getText() {
- return fText;
- }
-
- void load(Element element) {
- fName = element.getTagName();
- NamedNodeMap attributes = element.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- PluginAttribute att = (PluginAttribute) getModel().getFactory()
- .createAttribute(this);
- Attr attr = (Attr)attributes.item(i);
- att.fName = attr.getName();
- att.fValue = attr.getValue();
- fAttributes.put(att.getName(), att);
- }
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- PluginElement childElement = new PluginElement();
- childElement.setModel(getModel());
- childElement.setInTheModel(true);
- childElement.setParent(this);
- this.fChildren.add(childElement);
- childElement.load((Element)child);
- }
- }
- }
-
- public void reconnect() {
- super.reconnect();
- reconnectAttributes();
- }
-
- private void reconnectAttributes() {
- for (Enumeration elements = fAttributes.elements(); elements
- .hasMoreElements();) {
- PluginAttribute att = (PluginAttribute) elements.nextElement();
- att.setModel(getModel());
- att.setParent(this);
- att.setInTheModel(true);
- }
- }
-
- void load(Node node) {
- fName = node.getNodeName();
- NamedNodeMap attributes = node.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attribute = attributes.item(i);
- IPluginAttribute att = getModel().getFactory()
- .createAttribute(this);
- ((PluginAttribute) att).load(attribute);
- ((PluginAttribute) att).setInTheModel(true);
- this.fAttributes.put(attribute.getNodeName(), att);
- }
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- PluginElement childElement = new PluginElement();
- childElement.setModel(getModel());
- childElement.setInTheModel(true);
- this.fChildren.add(childElement);
- childElement.setParent(this);
- childElement.load(child);
- } else if (child.getNodeType() == Node.TEXT_NODE
- && child.getNodeValue() != null) {
- String text = child.getNodeValue();
- text = text.trim();
- if (isNotEmpty(text))
- this.fText = text;
- }
- }
- }
-
- public void removeAttribute(String name) throws CoreException {
- ensureModelEditable();
- PluginAttribute att = (PluginAttribute) fAttributes.remove(name);
- String oldValue = att.getValue();
- if (att != null) {
- att.setInTheModel(false);
- }
- firePropertyChanged(P_ATTRIBUTE, oldValue, null);
- }
-
- public void setAttribute(String name, String value) throws CoreException {
- ensureModelEditable();
- if (value == null) {
- removeAttribute(name);
- return;
- }
- IPluginAttribute attribute = getAttribute(name);
- if (attribute == null) {
- attribute = getModel().getFactory().createAttribute(this);
- attribute.setName(name);
- fAttributes.put(name, attribute);
- ((PluginAttribute) attribute).setInTheModel(true);
- }
- attribute.setValue(value);
- }
-
- public void setElementInfo(ISchemaElement newElementInfo) {
- fElementInfo = newElementInfo;
- if (fElementInfo == null) {
- for (Enumeration atts = fAttributes.elements(); atts
- .hasMoreElements();) {
- PluginAttribute att = (PluginAttribute) atts.nextElement();
- att.setAttributeInfo(null);
- }
- }
- }
-
- public void setText(String newText) throws CoreException {
- ensureModelEditable();
- String oldValue = fText;
- fText = newText;
- firePropertyChanged(P_TEXT, oldValue, fText);
-
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<" + getName()); //$NON-NLS-1$
- String newIndent = indent + ATTRIBUTE_SHIFT;
- if (fAttributes.isEmpty() == false) {
- writer.println();
- for (Iterator iter = fAttributes.values().iterator(); iter
- .hasNext();) {
- IPluginAttribute attribute = (IPluginAttribute) iter.next();
- attribute.write(newIndent, writer);
- if (iter.hasNext())
- writer.println();
- }
- }
- writer.println(">"); //$NON-NLS-1$
- newIndent = indent + ELEMENT_SHIFT;
- IPluginObject[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- IPluginElement element = (IPluginElement) children[i];
- element.write(newIndent, writer);
- }
- if (getText() != null) {
- writer.println(newIndent + getWritableString(getText()));
- }
- writer.println(indent + "</" + getName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtension.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtension.java
deleted file mode 100644
index c7c008d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtension.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.schema.SchemaRegistry;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class PluginExtension extends PluginParent implements IPluginExtension {
-
- private static final long serialVersionUID = 1L;
- protected String fPoint;
- private transient ISchema schema;
-
- public PluginExtension() {
- }
- public String getPoint() {
- return fPoint;
- }
-
- public boolean isValid() {
- return fPoint != null;
- }
-
- public Object getSchema() {
- if (schema == null) {
- SchemaRegistry registry = PDECore.getDefault().getSchemaRegistry();
- schema = registry.getSchema(fPoint);
- } else if (schema.isDisposed()) {
- schema = null;
- }
- return schema;
- }
-
- void load(Node node) {
- this.id = getNodeAttribute(node, "id"); //$NON-NLS-1$
- fName = getNodeAttribute(node, "name"); //$NON-NLS-1$
- fPoint = getNodeAttribute(node, "point"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- PluginElement childElement = new PluginElement();
- childElement.setModel(getModel());
- childElement.setInTheModel(true);
- childElement.setParent(this);
- this.fChildren.add(childElement);
- childElement.load(child);
- }
- }
- fStartLine = Integer.parseInt(getNodeAttribute(node, "line")); //$NON-NLS-1$
- }
-
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (obj == null)
- return false;
- if (obj instanceof IPluginExtension) {
- IPluginExtension target = (IPluginExtension) obj;
- // Objects from the same model must be
- // binary equal
- if (target.getModel().equals(getModel()))
- return false;
- if (!stringEqualWithNull(target.getId(), getId()))
- return false;
- if (!stringEqualWithNull(target.getName(), getName()))
- return false;
- if (!stringEqualWithNull(target.getPoint(), getPoint()))
- return false;
- // Children
- return super.equals(obj);
- }
- return false;
- }
-
- public void setPoint(String point) throws CoreException {
- ensureModelEditable();
- String oldValue = fPoint;
- fPoint = point;
- firePropertyChanged(P_POINT, oldValue, point);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_POINT)) {
- setPoint(newValue != null ? newValue.toString() : null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public String toString() {
- if (getName() != null)
- return getName();
- return getPoint();
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<extension"); //$NON-NLS-1$
- String attIndent = indent + PluginElement.ATTRIBUTE_SHIFT;
- if (getId() != null) {
- writer.println();
- writer.print(attIndent + "id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getName() != null) {
- writer.println();
- writer.print(
- attIndent + "name=\"" + getWritableString(getName()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (getPoint() != null) {
- writer.println();
- writer.print(attIndent + "point=\"" + getPoint() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println(">"); //$NON-NLS-1$
- IPluginObject[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- IPluginElement child = (IPluginElement) children[i];
- child.write(indent + PluginElement.ELEMENT_SHIFT, writer);
- }
- writer.println(indent + "</extension>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtensionPoint.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtensionPoint.java
deleted file mode 100644
index 5948f7d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginExtensionPoint.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.w3c.dom.Node;
-
-public class PluginExtensionPoint extends IdentifiablePluginObject
- implements IPluginExtensionPoint {
-
- private static final long serialVersionUID = 1L;
-
- protected String fSchema;
-
- public boolean isValid() {
- return id != null && fName != null;
- }
-
- public String getFullId() {
- IPluginBase pluginBase = getPluginModel().getPluginBase();
- String id = pluginBase.getId();
- if (pluginBase instanceof IFragment)
- id = ((IFragment) pluginBase).getPluginId();
- return id + "." + getId(); //$NON-NLS-1$
- }
-
- public String getSchema() {
- return fSchema;
- }
-
- void load(Node node) {
- this.id = getNodeAttribute(node, "id"); //$NON-NLS-1$
- fName = getNodeAttribute(node, "name"); //$NON-NLS-1$
- fSchema = getNodeAttribute(node, "schema"); //$NON-NLS-1$
- fStartLine = Integer.parseInt(getNodeAttribute(node, "line")); //$NON-NLS-1$
- }
-
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (obj instanceof IPluginExtensionPoint) {
- IPluginExtensionPoint target = (IPluginExtensionPoint) obj;
- // Objects from the same model must be
- // binary equal
- if (target.getModel().equals(getModel()))
- return false;
- if (stringEqualWithNull(target.getId(), getId())
- && stringEqualWithNull(target.getName(), getName())
- && stringEqualWithNull(target.getSchema(), getSchema()))
- return true;
- }
- return false;
- }
-
- public void setSchema(String newSchema) throws CoreException {
- ensureModelEditable();
- String oldValue = fSchema;
- fSchema = newSchema;
- firePropertyChanged(P_SCHEMA, oldValue, fSchema);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_SCHEMA)) {
- setSchema(newValue != null ? newValue.toString() : null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<extension-point"); //$NON-NLS-1$
- if (getId() != null)
- writer.print(" id=\"" + getWritableString(getId()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (getName() != null)
- writer.print(" name=\"" + getWritableString(getName()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (getSchema() != null)
- writer.print(" schema=\"" + getSchema() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println("/>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginHandler.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginHandler.java
deleted file mode 100644
index 467d385..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginHandler.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.util.Stack;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class PluginHandler extends DefaultHandler {
- private Document fDocument;
- private Element fRootElement;
- private Stack fOpenElements = new Stack();
-
- private String fSchemaVersion;
- private boolean fAbbreviated;
- private Locator fLocator;
- private boolean fPop;
-
- public PluginHandler(boolean abbreviated) {
- fAbbreviated = abbreviated;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException {
-
- fPop = true;
-
- if (fAbbreviated && fOpenElements.size() == 2) {
- Element parent = (Element)fOpenElements.peek();
- if (parent.getNodeName().equals("extension") && !isInterestingExtension((Element)fOpenElements.peek())) { //$NON-NLS-1$
- fPop = false;
- return;
- }
- }
-
- Element element = fDocument.createElement(qName);
- for (int i = 0; i < attributes.getLength(); i++) {
- element.setAttribute(attributes.getQName(i), attributes.getValue(i));
- if ("extension".equals(qName) || "extension-point".equals(qName)) { //$NON-NLS-1$ //$NON-NLS-2$
- element.setAttribute("line", Integer.toString(fLocator.getLineNumber())); //$NON-NLS-1$
- }
- }
-
- if (fRootElement == null)
- fRootElement = element;
- else
- ((Element)fOpenElements.peek()).appendChild(element);
-
- fOpenElements.push(element);
- }
-
- private boolean isInterestingExtension(Element element) {
- String point = element.getAttribute("point"); //$NON-NLS-1$
- return CoreUtility.isInterestingExtensionPoint(point);
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException {
- if (fPop || (qName.equals("extension") && fOpenElements.size() == 2)) { //$NON-NLS-1$
- fOpenElements.pop();
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- fLocator = locator;
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- fDocument = factory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- fDocument.appendChild(fRootElement);
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#processingInstruction(java.lang.String, java.lang.String)
- */
- public void processingInstruction(String target, String data) throws SAXException {
- if ("eclipse".equals(target)) { //$NON-NLS-1$
- fSchemaVersion = "3.0"; //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
- */
- public void characters(char[] characters, int start, int length) throws SAXException {
- if (fAbbreviated)
- return;
-
- StringBuffer buff = new StringBuffer();
- for (int i = 0; i < length; i++) {
- buff.append(characters[start + i]);
- }
- Text text = fDocument.createTextNode(buff.toString());
- if (fRootElement == null)
- fDocument.appendChild(text);
- else
- ((Element)fOpenElements.peek()).appendChild(text);
- }
-
- public Node getDocumentElement() {
- if (fRootElement != null) {
- fRootElement.normalize();
- }
- return fRootElement;
- }
-
- public String getSchemaVersion() {
- return fSchemaVersion;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginImport.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginImport.java
deleted file mode 100644
index f1e283d..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginImport.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.plugin.IMatchRules;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.osgi.framework.Constants;
-import org.w3c.dom.Node;
-
-public class PluginImport
- extends IdentifiablePluginObject
- implements IPluginImport, Serializable {
-
- private static final long serialVersionUID = 1L;
- private int match = NONE;
- private boolean reexported = false;
- private boolean optional = false;
- private String version;
-
- public PluginImport() {
- }
-
- public boolean isValid() {
- return getId()!=null;
- }
-
- public int getMatch() {
- return match;
- }
-
- public String getVersion() {
- return version;
- }
-
- public boolean isReexported() {
- return reexported;
- }
-
- public boolean isOptional() {
- return optional;
- }
-
- public void load(BundleDescription description) {
- this.id = description.getSymbolicName();
- }
-
- public void load(ManifestElement element, int bundleManifestVersion) {
- this.id = element.getValue();
- if (bundleManifestVersion >= 2) {
- this.optional = Constants.RESOLUTION_OPTIONAL.equals(element.getDirective(Constants.RESOLUTION_DIRECTIVE));
- this.reexported = Constants.VISIBILITY_REEXPORT.equals(element.getDirective(Constants.VISIBILITY_DIRECTIVE));
- }
- else {
- this.optional = "true".equals(element.getAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE)); //$NON-NLS-1$
- this.reexported ="true".equals(element.getAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE)); //$NON-NLS-1$
- }
- String bundleVersion = element.getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE);
- if (bundleVersion != null) {
- VersionRange versionRange = new VersionRange(bundleVersion);
- this.version = bundleVersion;
- this.match = PluginBase.getMatchRule(versionRange);
- }
- }
-
- public void load(BundleSpecification importModel) {
- this.id = importModel.getName();
- this.reexported = importModel.isExported();
- this.optional = importModel.isOptional();
- VersionRange versionRange = importModel.getVersionRange();
- if (versionRange == null || VersionRange.emptyRange.equals(versionRange)) {
- this.version = null;
- match = IMatchRules.NONE;
- } else {
- this.version = versionRange.getMinimum() != null ? versionRange.getMinimum().toString() : null;
- match = PluginBase.getMatchRule(versionRange);
- }
- }
-
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (obj == null)
- return false;
- if (obj instanceof IPluginImport) {
- IPluginImport target = (IPluginImport) obj;
- // Objects from the same model must be
- // binary equal
- if (target.getModel().equals(getModel()))
- return false;
-
- if (target.getId().equals(getId())
- && target.isReexported() == isReexported()
- && stringEqualWithNull(target.getVersion(),getVersion())
- && target.getMatch() == getMatch()
- && target.isOptional() == isOptional())
- return true;
- }
- return false;
- }
-
- void load(Node node) {
- String id = getNodeAttribute(node, "plugin"); //$NON-NLS-1$
- String export = getNodeAttribute(node, "export"); //$NON-NLS-1$
- String option = getNodeAttribute(node, "optional"); //$NON-NLS-1$
- String version = getNodeAttribute(node, "version"); //$NON-NLS-1$
- String match = getNodeAttribute(node, "match"); //$NON-NLS-1$
- boolean reexport =
- export != null && export.toLowerCase(Locale.ENGLISH).equals("true"); //$NON-NLS-1$
- boolean optional =
- option != null && option.toLowerCase(Locale.ENGLISH).equals("true"); //$NON-NLS-1$
- this.match = NONE;
- if (match != null) {
- String lmatch = match.toLowerCase(Locale.ENGLISH);
- if (lmatch.equals("exact")) //$NON-NLS-1$
- lmatch = RULE_EQUIVALENT;
- for (int i = 0; i < RULE_NAME_TABLE.length; i++) {
- if (lmatch.equals(RULE_NAME_TABLE[i])) {
- this.match = i;
- break;
- }
- }
- }
- this.version = version;
- this.id = id;
- this.reexported = reexport;
- this.optional = optional;
- }
- public void setMatch(int match) throws CoreException {
- ensureModelEditable();
- Integer oldValue = new Integer(this.match);
- this.match = match;
- firePropertyChanged(P_MATCH, oldValue, new Integer(match));
- }
- public void setReexported(boolean value) throws CoreException {
- ensureModelEditable();
- Boolean oldValue = new Boolean(reexported);
- this.reexported = value;
- firePropertyChanged(P_REEXPORTED, oldValue, new Boolean(value));
- }
- public void setOptional(boolean value) throws CoreException {
- ensureModelEditable();
- Boolean oldValue = new Boolean(this.optional);
- this.optional = value;
- firePropertyChanged(P_OPTIONAL, oldValue, new Boolean(value));
- }
- public void setVersion(String version) throws CoreException {
- ensureModelEditable();
- String oldValue = this.version;
- this.version = version;
- firePropertyChanged(P_VERSION, oldValue, version);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_MATCH)) {
- setMatch(((Integer) newValue).intValue());
- return;
- }
- if (name.equals(P_REEXPORTED)) {
- setReexported(((Boolean) newValue).booleanValue());
- return;
- }
- if (name.equals(P_OPTIONAL)) {
- setOptional(((Boolean) newValue).booleanValue());
- return;
- }
- if (name.equals(P_VERSION)) {
- setVersion(newValue != null ? newValue.toString() : null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<import plugin=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (isReexported())
- writer.print(" export=\"true\""); //$NON-NLS-1$
- if (isOptional())
- writer.print(" optional=\"true\""); //$NON-NLS-1$
- if (version != null && version.length() > 0)
- writer.print(" version=\"" + version + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (match != NONE && match != COMPATIBLE) {
- String matchValue = RULE_NAME_TABLE[match];
- writer.print(" match=\"" + matchValue + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginLibrary.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginLibrary.java
deleted file mode 100644
index 8681592..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginLibrary.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Locale;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ClasspathUtilCore;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class PluginLibrary extends PluginObject implements IPluginLibrary {
-
- private static final long serialVersionUID = 1L;
- private String[] fContentFilters;
- private boolean fExported = false;
- private String fType;
-
- public PluginLibrary() {
- }
-
- public boolean isValid() {
- return fName != null;
- }
-
- public String[] getContentFilters() {
- IPluginModelBase model = (IPluginModelBase)getModel();
- ArrayList list = new ArrayList();
- if (ClasspathUtilCore.isBundle(model)) {
- BundleDescription desc = model.getBundleDescription();
- if (desc != null) {
- ExportPackageDescription[] exports = desc.getExportPackages();
- for (int i = 0; i < exports.length; i++) {
- list.add(exports[i].getName());
- }
- }
- return (String[])list.toArray(new String[list.size()]);
- }
- if (!isExported())
- return new String[0];
- return isFullyExported() ? new String[] {"**"} : fContentFilters; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#addContentFilter(java.lang.String)
- */
- public void addContentFilter(String filter) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#removeContentFilter(java.lang.String)
- */
- public void removeContentFilter(String filter) throws CoreException {
- }
-
- public String[] getPackages() {
- return new String[0];
- }
-
- public boolean isExported() {
- return fExported;
- }
-
- public boolean isFullyExported() {
- return fExported
- && (fContentFilters == null || fContentFilters.length == 0);
- }
-
- public String getType() {
- return fType;
- }
-
-
- public void load(String name) {
- fName = name;
- fExported = true;
- }
-
- void load(Node node) {
- fName = getNodeAttribute(node, "name"); //$NON-NLS-1$
- fType = getNodeAttribute(node, "type"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- Vector exports = new Vector();
- boolean all = false;
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String tag = child.getNodeName().toLowerCase(Locale.ENGLISH);
- if (tag.equals("export")) { //$NON-NLS-1$
- String ename = getNodeAttribute(child, "name"); //$NON-NLS-1$
- if (ename != null) {
- ename = ename.trim();
- if (ename.equals("*")) { //$NON-NLS-1$
- all = true;
- } else {
- exports.add(ename);
- }
- }
- }
- }
- }
- if (exports.size() > 0) {
- fContentFilters = new String[exports.size()];
- exports.copyInto(fContentFilters);
- }
- fExported = all || exports.size() > 0;
- }
- public void setContentFilters(String[] filters) throws CoreException {
- ensureModelEditable();
- ArrayList oldValue = createArrayList(fContentFilters);
- fContentFilters = filters;
- firePropertyChanged(
- P_CONTENT_FILTERS,
- oldValue,
- createArrayList(filters));
- }
-
- public void setPackages(String[] packages) throws CoreException {
- }
-
- public void setExported(boolean value) throws CoreException {
- ensureModelEditable();
- Boolean oldValue = new Boolean(fExported);
- fExported = value;
- firePropertyChanged(P_EXPORTED, oldValue, new Boolean(value));
- }
-
- public void setType(String type) throws CoreException {
- ensureModelEditable();
- String oldValue = fType;
- fType = type;
- firePropertyChanged(P_TYPE, oldValue, type);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_CONTENT_FILTERS)) {
- ArrayList list = (ArrayList) newValue;
- if (list != null)
- setContentFilters(
- (String[]) list.toArray(new String[list.size()]));
- else
- setContentFilters(null);
- return;
- }
- if (name.equals(P_EXPORTED)) {
- setExported(((Boolean) newValue).booleanValue());
- return;
- }
- if (name.equals(P_TYPE)) {
- setType(newValue != null ? newValue.toString() : null);
- return;
- }
- super.restoreProperty(name, oldValue, newValue);
- }
-
- private ArrayList createArrayList(String[] array) {
- if (array == null)
- return null;
- ArrayList list = new ArrayList();
- for (int i = 0; i < array.length; i++) {
- list.add(array[i]);
- }
- return list;
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<library name=\"" + getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fType != null)
- writer.print(" type=\"" + fType + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (!isExported()) {
- writer.println("/>"); //$NON-NLS-1$
- } else {
- writer.println(">"); //$NON-NLS-1$
- String indent2 = indent + " "; //$NON-NLS-1$
- if (isExported()) {
- if (isFullyExported()) {
- writer.println(indent2 + "<export name=\"*\"/>"); //$NON-NLS-1$
- } else {
- for (int i = 0; i < fContentFilters.length; i++) {
- writer.println(
- indent2
- + "<export name=\"" //$NON-NLS-1$
- + fContentFilters[i]
- + "\"/>"); //$NON-NLS-1$
- }
- }
- }
- writer.println(indent + "</library>"); //$NON-NLS-1$
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginObject.java
deleted file mode 100644
index 25736d8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginObject.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ISourceObject;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.ISharedPluginModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelProvider;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Node;
-
-public abstract class PluginObject
- extends PlatformObject
- implements IPluginObject, ISourceObject, Serializable {
- protected String fName;
- private String fTranslatedName;
- private transient IPluginObject fParent;
- private transient ISharedPluginModel fModel;
- protected int fStartLine = 1;
- private boolean fInTheModel;
-
- public PluginObject() {
- }
- public boolean isValid() {
- return true;
- }
- protected void ensureModelEditable() throws CoreException {
- if (!fModel.isEditable()) {
- throwCoreException(PDECoreMessages.PluginObject_readOnlyChange);
- }
- }
-
- public void setInTheModel(boolean value) {
- fInTheModel = value;
- }
-
- public boolean isInTheModel() {
- return fInTheModel;
- }
-
- protected void firePropertyChanged(
- String property,
- Object oldValue,
- Object newValue) {
- firePropertyChanged(this, property, oldValue, newValue);
- }
- protected void firePropertyChanged(
- IPluginObject object,
- String property,
- Object oldValue,
- Object newValue) {
- if (fModel.isEditable()) {
- IModelChangeProvider provider = fModel;
- provider.fireModelObjectChanged(
- object,
- property,
- oldValue,
- newValue);
- }
- }
- protected void fireStructureChanged(IPluginObject child, int changeType) {
- IModel model = getModel();
- if (model.isEditable() && model instanceof IModelChangeProvider) {
- IModelChangedEvent e =
- new ModelChangedEvent((IModelChangeProvider)model, changeType, new Object[] { child }, null);
- fireModelChanged(e);
- }
- }
- protected void fireModelChanged(IModelChangedEvent e) {
- IModel model = getModel();
- if (model.isEditable() && model instanceof IModelChangeProvider) {
- IModelChangeProvider provider = (IModelChangeProvider) model;
- provider.fireModelChanged(e);
- }
- }
- public ISharedPluginModel getModel() {
- return fModel;
- }
-
- public IPluginModelBase getPluginModel() {
- if (fModel instanceof IBundlePluginModelProvider)
- return ((IBundlePluginModelProvider)fModel).getBundlePluginModel();
-
- return fModel instanceof IPluginModelBase? (IPluginModelBase)fModel : null;
- }
-
- public String getName() {
- return fName;
- }
-
- public String getTranslatedName() {
- if (fTranslatedName != null && !fModel.isEditable())
- return fTranslatedName;
- if (fTranslatedName == null && fName != null && fModel != null) {
- fTranslatedName = fModel.getResourceString(fName);
- }
- return fTranslatedName;
- }
-
- String getNodeAttribute(Node node, String name) {
- Node attribute = node.getAttributes().getNamedItem(name);
- if (attribute != null)
- return attribute.getNodeValue();
- return null;
- }
- public IPluginObject getParent() {
- return fParent;
- }
- public IPluginBase getPluginBase() {
- IPluginModelBase pluginModel = getPluginModel();
- return pluginModel != null ? pluginModel.getPluginBase() : null;
- }
- public String getResourceString(String key) {
- return fModel.getResourceString(key);
- }
- static boolean isNotEmpty(String text) {
- for (int i = 0; i < text.length(); i++) {
- if (Character.isWhitespace(text.charAt(i)) == false)
- return true;
- }
- return false;
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_NAME)) {
- setName(newValue != null ? newValue.toString() : null);
- }
- }
-
- public void setModel(ISharedPluginModel model) {
- this.fModel = model;
- fTranslatedName = null;
- }
- public void setName(String name) throws CoreException {
- ensureModelEditable();
- String oldValue = this.fName;
- this.fName = name;
- firePropertyChanged(P_NAME, oldValue, name);
- }
- public void setParent(IPluginObject parent) {
- this.fParent = parent;
- }
- protected void throwCoreException(String message) throws CoreException {
- Status status =
- new Status(
- IStatus.ERROR,
- PDECore.getPluginId(),
- IStatus.OK,
- message,
- null);
- CoreException ce = new CoreException(status);
- ce.fillInStackTrace();
- throw ce;
- }
- public String toString() {
- if (fName != null)
- return fName;
- return super.toString();
- }
-
- public Vector addComments(Node node, Vector result) {
- for (Node prev = node.getPreviousSibling();
- prev != null;
- prev = prev.getPreviousSibling()) {
- if (prev.getNodeType() == Node.TEXT_NODE)
- continue;
- if (prev instanceof Comment) {
- String comment = prev.getNodeValue();
- if (result == null)
- result = new Vector();
- result.add(0,comment);
- } else
- break;
- }
- return result;
- }
-
- void writeComments(PrintWriter writer, Vector source) {
- if (source == null)
- return;
- for (int i = 0; i < source.size(); i++) {
- String comment = (String) source.elementAt(i);
- writer.println("<!--" + comment + "-->"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- protected boolean stringEqualWithNull(String a, String b) {
- return a == null && b == null || a != null && b != null && a.equals(b);
- }
-
- public String getWritableString(String source) {
- return CoreUtility.getWritableString(source);
- }
-
- public int getStartLine() {
- return fStartLine;
- }
-
- public int getStopLine() {
- return fStartLine;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginParent.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginParent.java
deleted file mode 100644
index 82a8a9f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginParent.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.IPluginParent;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-
-public abstract class PluginParent extends IdentifiablePluginObject implements
- IPluginParent {
- protected ArrayList fChildren = new ArrayList(1);
-
- public PluginParent() {
- }
-
- public void add(int index, IPluginObject child) throws CoreException {
- ensureModelEditable();
- fChildren.add(index, child);
- postAdd(child);
- }
-
- public void add(IPluginObject child) throws CoreException {
- ensureModelEditable();
- fChildren.add(child);
- postAdd(child);
- }
-
- void appendChild(IPluginElement child) {
- fChildren.add(child);
- }
-
- protected void postAdd(IPluginObject child) {
- ((PluginObject) child).setInTheModel(true);
- ((PluginObject) child).setParent(this);
- fireStructureChanged(child, IModelChangedEvent.INSERT);
- }
-
- public int getChildCount() {
- return fChildren.size();
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (obj instanceof IPluginParent) {
- IPluginParent target = (IPluginParent) obj;
- if (target.getChildCount() != getChildCount())
- return false;
- IPluginObject[] tchildren = target.getChildren();
- for (int i = 0; i < tchildren.length; i++) {
- IPluginObject tchild = tchildren[i];
- if (tchild.equals(fChildren.get(i)) == false)
- return false;
- }
- return true;
- }
- return false;
- }
-
- public int getIndexOf(IPluginObject child) {
- return fChildren.indexOf(child);
- }
-
- public void swap(IPluginObject child1, IPluginObject child2)
- throws CoreException {
- ensureModelEditable();
- int index1 = fChildren.indexOf(child1);
- int index2 = fChildren.indexOf(child2);
- if (index1 == -1 || index2 == -1)
- throwCoreException(PDECoreMessages.PluginParent_siblingsNotFoundException);
- fChildren.set(index2, child1);
- fChildren.set(index1, child2);
- firePropertyChanged(this, P_SIBLING_ORDER, child1, child2);
- }
-
- public IPluginObject[] getChildren() {
- return (IPluginObject[])fChildren.toArray(new IPluginObject[fChildren.size()]);
- }
-
- public void remove(IPluginObject child) throws CoreException {
- ensureModelEditable();
- fChildren.remove(child);
- ((PluginObject) child).setInTheModel(false);
- fireStructureChanged(child, ModelChangedEvent.REMOVE);
- }
-
- public void reconnect() {
- for (int i = 0; i < fChildren.size(); i++) {
- PluginObject child = (PluginObject) fChildren.get(i);
- child.setModel(getModel());
- child.setParent(this);
- if (child instanceof PluginParent) {
- ((PluginParent) child).reconnect();
- }
- }
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginReference.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginReference.java
deleted file mode 100644
index 47f1333..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginReference.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.internal.core.PDECore;
-
-public class PluginReference extends PlatformObject {
- private String id;
- private transient IPlugin plugin;
-
- public PluginReference() {}
-
- public PluginReference(String id) {
- this.id = id;
- if (id!=null)
- plugin = PDECore.getDefault().findPlugin(id);
- }
- public PluginReference(IPlugin plugin) {
- this.id = plugin.getId();
- this.plugin = plugin;
- }
- public String getId() {
- return id;
- }
- public IPlugin getPlugin() {
- if (plugin == null && id!=null)
- plugin = PDECore.getDefault().findPlugin(id);
- return plugin;
- }
- public String toString() {
- if (plugin!=null) {
- return plugin.getTranslatedName();
- }
- return id!=null?id:"?"; //$NON-NLS-1$
- }
- public boolean isResolved() {
- return plugin!=null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceExtensionsModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceExtensionsModel.java
deleted file mode 100644
index 9ecb2cd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceExtensionsModel.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
-import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelProvider;
-
-public class WorkspaceExtensionsModel
- extends AbstractExtensionsModel
- implements IEditableModel, IBundlePluginModelProvider {
- private static final long serialVersionUID = 1L;
- private IFile fUnderlyingResource;
- private boolean fDirty;
- private boolean fEditable = true;
- private transient IBundlePluginModelBase fBundleModel;
-
-
- protected NLResourceHelper createNLResourceHelper() {
- return new NLResourceHelper("plugin", getNLLookupLocations()); //$NON-NLS-1$
- }
-
- public URL getNLLookupLocation() {
- try {
- return new URL("file:" + getInstallLocation() + "/"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public WorkspaceExtensionsModel(IFile file) {
- fUnderlyingResource = file;
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- fDirty = true;
- super.fireModelChanged(event);
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
- public String getInstallLocation() {
- return fUnderlyingResource.getLocation().removeLastSegments(1).addTrailingSeparator().toOSString();
- }
-
- public IResource getUnderlyingResource() {
- return fUnderlyingResource;
- }
-
- public boolean isInSync() {
- if (fUnderlyingResource == null)
- return true;
- IPath path = fUnderlyingResource.getLocation();
- if (path == null)
- return false;
- return super.isInSync(path.toFile());
- }
-
- public boolean isDirty() {
- return fDirty;
- }
- public boolean isEditable() {
- return fEditable;
- }
-
- public void load() {
- if (fUnderlyingResource == null)
- return;
- if (fUnderlyingResource.exists()) {
- try {
- InputStream stream = fUnderlyingResource.getContents(true);
- load(stream, false);
- stream.close();
- } catch (Exception e) {
- PDECore.logException(e);
- }
- } else {
- getExtensions(true);
- setLoaded(true);
- }
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(fUnderlyingResource.getLocation().toFile());
- }
-
- public void save() {
- if (fUnderlyingResource == null)
- return;
- try {
- String contents = getContents();
- ByteArrayInputStream stream =
- new ByteArrayInputStream(contents.getBytes("UTF8")); //$NON-NLS-1$
- if (fUnderlyingResource.exists()) {
- fUnderlyingResource.setContents(stream, false, false, null);
- } else {
- fUnderlyingResource.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- fExtensions.write("", writer); //$NON-NLS-1$
- }
- fDirty = false;
- }
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
- public void setEditable(boolean editable) {
- fEditable = editable;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.plugin.AbstractExtensionsModel#createExtensions()
- */
- protected Extensions createExtensions() {
- Extensions extensions = super.createExtensions();
- extensions.setIsFragment(fUnderlyingResource.getName().equals("fragment.xml")); //$NON-NLS-1$
- return extensions;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fUnderlyingResource.getName();
- }
-
- public void setBundleModel(IBundlePluginModelBase model) {
- fBundleModel = model;
- }
-
- public IBundlePluginModelBase getBundlePluginModel() {
- return fBundleModel;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceFragmentModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceFragmentModel.java
deleted file mode 100644
index 1cea5ec..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspaceFragmentModel.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPluginBase;
-
-public class WorkspaceFragmentModel extends WorkspacePluginModelBase implements
- IFragmentModel {
-
- private static final long serialVersionUID = 1L;
-
- public WorkspaceFragmentModel(IFile file, boolean abbreviated) {
- super(file, abbreviated);
- }
-
- public IPluginBase createPluginBase() {
- Fragment fragment = new Fragment();
- fragment.setModel(this);
- return fragment;
- }
-
- public IFragment getFragment() {
- return (IFragment) getPluginBase();
- }
-
- public boolean isFragmentModel() {
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModel.java
deleted file mode 100644
index c0ba48a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModel.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModel;
-
-public class WorkspacePluginModel extends WorkspacePluginModelBase implements
- IPluginModel {
-
- private static final long serialVersionUID = 1L;
-
- public WorkspacePluginModel(IFile file, boolean abbreviated) {
- super(file, abbreviated);
- }
-
- public IPluginBase createPluginBase() {
- Plugin plugin = new Plugin();
- plugin.setModel(this);
- return plugin;
- }
-
- public IPlugin getPlugin() {
- return (IPlugin) getPluginBase();
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModelBase.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModelBase.java
deleted file mode 100644
index 251b649..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/WorkspacePluginModelBase.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.plugin;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDEManager;
-
-public abstract class WorkspacePluginModelBase extends AbstractPluginModelBase
- implements IEditableModel {
-
- private IFile fUnderlyingResource;
-
- private boolean fDirty;
-
- private boolean fEditable = true;
-
- private IBuildModel fBuildModel;
-
- protected NLResourceHelper createNLResourceHelper() {
- return new NLResourceHelper("plugin" , PDEManager.getNLLookupLocations(this)); //$NON-NLS-1$
- }
-
- public URL getNLLookupLocation() {
- try {
- return new URL("file:" + getInstallLocation() + "/"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public WorkspacePluginModelBase(IFile file, boolean abbreviated) {
- fUnderlyingResource = file;
- fAbbreviated = abbreviated;
- setEnabled(true);
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- fDirty = true;
- super.fireModelChanged(event);
- }
-
- public IBuildModel getBuildModel() {
- return fBuildModel;
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
- public IFile getFile() {
- return fUnderlyingResource;
- }
-
- public String getInstallLocation() {
- IPath path = fUnderlyingResource.getLocation();
- return path == null ? null : path.removeLastSegments(1).addTrailingSeparator().toOSString();
- }
-
- public IResource getUnderlyingResource() {
- return fUnderlyingResource;
- }
-
- public boolean isInSync() {
- if (fUnderlyingResource == null)
- return true;
- IPath path = fUnderlyingResource.getLocation();
- if (path == null)
- return false;
- return super.isInSync(path.toFile());
- }
-
- public boolean isDirty() {
- return fDirty;
- }
-
- public boolean isEditable() {
- return fEditable;
- }
-
- public void load() {
- if (fUnderlyingResource == null)
- return;
- if (fUnderlyingResource.exists()) {
- try {
- InputStream stream = fUnderlyingResource.getContents(true);
- load(stream, false);
- stream.close();
- } catch (CoreException e) {
- } catch (IOException e) {
- PDECore.logException(e);
- }
- } else {
- fPluginBase = (PluginBase) createPluginBase();
- fPluginBase.setModel(this);
- setLoaded(true);
- }
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(fUnderlyingResource.getLocation().toFile());
- }
-
- public void save() {
- if (fUnderlyingResource == null)
- return;
- try {
- String contents = getContents();
- ByteArrayInputStream stream = new ByteArrayInputStream(contents
- .getBytes("UTF8")); //$NON-NLS-1$
- if (fUnderlyingResource.exists()) {
- fUnderlyingResource.setContents(stream, false, false, null);
- } else {
- fUnderlyingResource.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
-
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- fPluginBase.write("", writer); //$NON-NLS-1$
- }
- fDirty = false;
- }
-
- public void setBuildModel(IBuildModel buildModel) {
- fBuildModel = buildModel;
- }
-
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- public void setEditable(boolean editable) {
- fEditable = editable;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/AboutInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/AboutInfo.java
deleted file mode 100644
index 3c30819..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/AboutInfo.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IAboutInfo;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-
-public class AboutInfo extends ProductObject implements IAboutInfo {
-
- private static final long serialVersionUID = 1L;
- private String fImagePath;
- private String fAboutText;
-
- public AboutInfo(IProductModel model) {
- super(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IAboutInfo#setText(java.lang.String)
- */
- public void setText(String text) {
- String old = fAboutText;
- fAboutText = text;
- if (isEditable())
- firePropertyChanged(P_TEXT, old, fAboutText);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IAboutInfo#getText()
- */
- public String getText() {
- return fAboutText;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IAboutInfo#setImagePath(java.lang.String)
- */
- public void setImagePath(String path) {
- String old = fImagePath;
- fImagePath = path;
- if (isEditable())
- firePropertyChanged(P_IMAGE, old, fImagePath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IAboutInfo#getImagePath()
- */
- public String getImagePath() {
- return fImagePath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductObject#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- if (isAboutImageDefined() || isAboutTextDefined()) {
- writer.println(indent + "<aboutInfo>"); //$NON-NLS-1$
- if (isAboutImageDefined())
- writer.println(indent + " <image path=\"" + getWritableString(fImagePath.trim()) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- if (isAboutTextDefined()) {
- writer.println(indent + " <text>"); //$NON-NLS-1$
- writer.println(indent + " " + getWritableString(fAboutText.trim())); //$NON-NLS-1$
- writer.println(indent + " </text>"); //$NON-NLS-1$
- }
- writer.println(indent + "</aboutInfo>"); //$NON-NLS-1$
- }
- }
-
- private boolean isAboutTextDefined() {
- return fAboutText != null && fAboutText.length() > 0;
- }
-
- private boolean isAboutImageDefined() {
- return fImagePath != null && fImagePath.length() > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#parse(org.w3c.dom.Node)
- */
- public void parse(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("image")) { //$NON-NLS-1$
- fImagePath = ((Element)child).getAttribute("path"); //$NON-NLS-1$
- } else if (child.getNodeName().equals("text")) { //$NON-NLS-1$
- child.normalize();
- if (child.getChildNodes().getLength() > 0) {
- Node text = child.getFirstChild();
- if (text.getNodeType() == Node.TEXT_NODE)
- fAboutText = ((Text)text).getData().trim();
- }
- }
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java
deleted file mode 100644
index 49bc2df..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.pde.internal.core.iproduct.IArgumentsInfo;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class ArgumentsInfo extends ProductObject implements IArgumentsInfo {
-
- private static final long serialVersionUID = 1L;
- private String fProgramArgs = ""; //$NON-NLS-1$
- private String fProgramArgsLin = ""; //$NON-NLS-1$
- private String fProgramArgsMac = ""; //$NON-NLS-1$
- private String fProgramArgsSol = ""; //$NON-NLS-1$
- private String fProgramArgsWin = ""; //$NON-NLS-1$
-
- private String fVMArgs = ""; //$NON-NLS-1$
- private String fVMArgsLin = ""; //$NON-NLS-1$
- private String fVMArgsMac = ""; //$NON-NLS-1$
- private String fVMArgsSol = ""; //$NON-NLS-1$
- private String fVMArgsWin = ""; //$NON-NLS-1$
-
- public ArgumentsInfo(IProductModel model) {
- super(model);
- }
-
- public void setProgramArguments(String args, int platform) {
- String old;
- if (args == null)
- args = ""; //$NON-NLS-1$
- switch (platform) {
- case L_ARGS_ALL:
- old = fProgramArgs;
- fProgramArgs = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS, old, fProgramArgs);
- break;
- case L_ARGS_LINUX:
- old = fProgramArgsLin;
- fProgramArgsLin = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS_LIN, old, fProgramArgsLin);
- break;
- case L_ARGS_MACOS:
- old = fProgramArgsMac;
- fProgramArgsMac = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS_MAC, old, fProgramArgsMac);
- break;
- case L_ARGS_SOLAR:
- old = fProgramArgsSol;
- fProgramArgsSol = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS_SOL, old, fProgramArgsSol);
- break;
- case L_ARGS_WIN32:
- old = fProgramArgsWin;
- fProgramArgsWin = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS_WIN, old, fProgramArgsWin);
- break;
- }
- }
-
- public String getProgramArguments(int platform) {
- switch (platform) {
- case L_ARGS_ALL:
- return fProgramArgs;
- case L_ARGS_LINUX:
- return fProgramArgsLin;
- case L_ARGS_MACOS:
- return fProgramArgsMac;
- case L_ARGS_SOLAR:
- return fProgramArgsSol;
- case L_ARGS_WIN32:
- return fProgramArgsWin;
- }
- return ""; //$NON-NLS-1$
- }
-
- public String getCompleteProgramArguments(String os) {
- if (Platform.OS_WIN32.equals(os)) {
- return getCompleteArgs(getProgramArguments(L_ARGS_WIN32), fProgramArgs);
- } else if (Platform.OS_LINUX.equals(os)) {
- return getCompleteArgs(getProgramArguments(L_ARGS_LINUX), fProgramArgs);
- } else if (Platform.OS_MACOSX.equals(os)) {
- return getCompleteArgs(getProgramArguments(L_ARGS_MACOS), fProgramArgs);
- } else if (Platform.OS_SOLARIS.equals(os)) {
- return getCompleteArgs(getProgramArguments(L_ARGS_SOLAR), fProgramArgs);
- } else {
- return getProgramArguments(L_ARGS_ALL);
- }
- }
-
- public void setVMArguments(String args, int platform) {
- String old;
- if (args == null)
- args = ""; //$NON-NLS-1$
- switch (platform) {
- case L_ARGS_ALL:
- old = fVMArgs;
- fVMArgs = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS, old, fVMArgs);
- break;
- case L_ARGS_LINUX:
- old = fVMArgsLin;
- fVMArgsLin = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS_LIN, old, fVMArgsLin);
- break;
- case L_ARGS_MACOS:
- old = fVMArgsMac;
- fVMArgsMac = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS_MAC, old, fVMArgsMac);
- break;
- case L_ARGS_SOLAR:
- old = fVMArgsSol;
- fVMArgsSol = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS_SOL, old, fVMArgsSol);
- break;
- case L_ARGS_WIN32:
- old = fVMArgsWin;
- fVMArgsWin = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS_WIN, old, fVMArgsWin);
- break;
- }
- }
-
- public String getVMArguments(int platform) {
- switch (platform) {
- case L_ARGS_ALL:
- return fVMArgs;
- case L_ARGS_LINUX:
- return fVMArgsLin;
- case L_ARGS_MACOS:
- return fVMArgsMac;
- case L_ARGS_SOLAR:
- return fVMArgsSol;
- case L_ARGS_WIN32:
- return fVMArgsWin;
- }
- return ""; //$NON-NLS-1$
- }
-
- public String getCompleteVMArguments(String os) {
- if (Platform.OS_WIN32.equals(os)) {
- return getCompleteArgs(getVMArguments(L_ARGS_WIN32), fVMArgs);
- } else if (Platform.OS_LINUX.equals(os)) {
- return getCompleteArgs(getVMArguments(L_ARGS_LINUX), fVMArgs);
- } else if (Platform.OS_MACOSX.equals(os)) {
- return getCompleteArgs(getVMArguments(L_ARGS_MACOS), fVMArgs);
- } else if (Platform.OS_SOLARIS.equals(os)) {
- return getCompleteArgs(getVMArguments(L_ARGS_SOLAR), fVMArgs);
- } else {
- return getVMArguments(L_ARGS_ALL);
- }
- }
-
- private String getCompleteArgs(String platformArgs, String univArgs) {
- String args = platformArgs;
- if (univArgs.length() > 0)
- args = univArgs + " " + args; //$NON-NLS-1$
- return args.trim();
- }
-
- public void parse(Node node) {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(P_PROG_ARGS)) {
- fProgramArgs = getText(child);
- } else if (child.getNodeName().equals(P_PROG_ARGS_LIN)) {
- fProgramArgsLin = getText(child);
- } else if (child.getNodeName().equals(P_PROG_ARGS_MAC)) {
- fProgramArgsMac = getText(child);
- } else if (child.getNodeName().equals(P_PROG_ARGS_SOL)) {
- fProgramArgsSol = getText(child);
- } else if (child.getNodeName().equals(P_PROG_ARGS_WIN)) {
- fProgramArgsWin = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS)) {
- fVMArgs = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS_LIN)) {
- fVMArgsLin = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS_MAC)) {
- fVMArgsMac = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS_SOL)) {
- fVMArgsSol = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS_WIN)) {
- fVMArgsWin = getText(child);
- }
- }
- }
- }
-
- private String getText(Node node) {
- node.normalize();
- Node text = node.getFirstChild();
- if (text != null && text.getNodeType() == Node.TEXT_NODE) {
- return text.getNodeValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public void write(String indent,java.io.PrintWriter writer) {
- writer.println(indent + "<launcherArgs>"); //$NON-NLS-1$
- if (fProgramArgs.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS + ">" + getWritableString(fProgramArgs) + "</" + P_PROG_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fProgramArgsLin.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS_LIN + ">" + getWritableString(fProgramArgsLin) + "</" + P_PROG_ARGS_LIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fProgramArgsMac.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS_MAC + ">" + getWritableString(fProgramArgsMac) + "</" + P_PROG_ARGS_MAC + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fProgramArgsSol.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS_SOL + ">" + getWritableString(fProgramArgsSol) + "</" + P_PROG_ARGS_SOL + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fProgramArgsWin.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS_WIN + ">" + getWritableString(fProgramArgsWin) + "</" + P_PROG_ARGS_WIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgs.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS + ">" + getWritableString(fVMArgs) + "</" + P_VM_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgsLin.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS_LIN + ">" + getWritableString(fVMArgsLin) + "</" + P_VM_ARGS_LIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgsMac.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS_MAC + ">" + getWritableString(fVMArgsMac) + "</" + P_VM_ARGS_MAC + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgsSol.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS_SOL + ">" + getWritableString(fVMArgsSol) + "</" + P_VM_ARGS_SOL + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgsWin.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS_WIN + ">" + getWritableString(fVMArgsWin) + "</" + P_VM_ARGS_WIN + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- writer.println(indent + "</launcherArgs>"); //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ConfigurationFileInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ConfigurationFileInfo.java
deleted file mode 100644
index 41a3cbd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ConfigurationFileInfo.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ConfigurationFileInfo extends ProductObject implements
- IConfigurationFileInfo {
-
- private static final long serialVersionUID = 1L;
-
- private String fUse;
-
- private String fPath;
-
- public ConfigurationFileInfo(IProductModel model) {
- super(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo#setPath(java.lang.String)
- */
- public void setPath(String path) {
- String old = fPath;
- fPath = path;
- if (isEditable())
- firePropertyChanged(P_PATH, old, fPath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo#getPath()
- */
- public String getPath() {
- return fPath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#parse(org.w3c.dom.Node)
- */
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- fPath = element.getAttribute(P_PATH);
- fUse = element.getAttribute(P_USE);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<configIni"); //$NON-NLS-1$
- if (fUse != null)
- writer.print(" " + P_USE + "=\"" + fUse + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (fPath != null && fPath.trim().length() > 0)
- writer.print(" " + P_PATH + "=\"" + getWritableString(fPath.trim()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- writer.println("/>"); //$NON-NLS-1$
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo#setUse(java.lang.String)
- */
- public void setUse(String use) {
- String old = fUse;
- fUse = use;
- if (isEditable())
- firePropertyChanged(P_USE, old, fUse);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo#getUse()
- */
- public String getUse() {
- return fUse;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/IntroInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/IntroInfo.java
deleted file mode 100644
index 2273f67..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/IntroInfo.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IIntroInfo;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class IntroInfo extends ProductObject implements IIntroInfo {
-
- public static final String P_INTRO_ID = "introId"; //$NON-NLS-1$
- private static final long serialVersionUID = 1L;
- private String fIntroId;
-
- public IntroInfo(IProductModel model) {
- super(model);
- }
-
- public void setId(String id) {
- String old = fIntroId;
- fIntroId = id;
- if (isEditable())
- firePropertyChanged(P_INTRO_ID, old, fIntroId);
- }
-
- public String getId() {
- return fIntroId;
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- fIntroId = element.getAttribute(P_INTRO_ID);
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- if (fIntroId != null && fIntroId.length() > 0)
- writer.println(indent + "<intro " + P_INTRO_ID + "=\"" + getWritableString(fIntroId) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/LauncherInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/LauncherInfo.java
deleted file mode 100644
index 81c4e23..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/LauncherInfo.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.pde.internal.core.iproduct.ILauncherInfo;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class LauncherInfo extends ProductObject implements ILauncherInfo {
-
- private static final long serialVersionUID = 1L;
- private boolean fUseIcoFile;
- private Map fIcons = new HashMap();
- private String fLauncherName;
-
- public LauncherInfo(IProductModel model) {
- super(model);
- }
-
- public String getLauncherName() {
- return fLauncherName;
- }
-
- public void setLauncherName(String name) {
- String old = fLauncherName;
- fLauncherName = name;
- if (isEditable())
- firePropertyChanged(P_LAUNCHER, old, fLauncherName);
- }
-
- public void setIconPath(String iconId, String path) {
- if (path == null)
- path = ""; //$NON-NLS-1$
- String old = (String)fIcons.get(iconId);
- fIcons.put(iconId, path);
- if (isEditable())
- firePropertyChanged(iconId, old, path);
- }
-
- public String getIconPath(String iconId) {
- return (String)fIcons.get(iconId);
- }
-
- public boolean usesWinIcoFile() {
- return fUseIcoFile;
- }
-
- public void setUseWinIcoFile(boolean use) {
- boolean old = fUseIcoFile;
- fUseIcoFile = use;
- if (isEditable())
- firePropertyChanged(P_USE_ICO, Boolean.toString(old), Boolean.toString(fUseIcoFile));
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- fLauncherName = ((Element)node).getAttribute("name"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String name = child.getNodeName();
- if (name.equals("linux")) { //$NON-NLS-1$
- parseLinux((Element)child);
- } else if (name.equals("macosx")) { //$NON-NLS-1$
- parseMac((Element)child);
- } else if (name.equals("solaris")) { //$NON-NLS-1$
- parseSolaris((Element)child);
- } else if (name.equals("win")) { //$NON-NLS-1$
- parseWin((Element)child);
- }
- }
- }
- }
- }
-
- private void parseWin(Element element) {
- fUseIcoFile = "true".equals(element.getAttribute(P_USE_ICO)); //$NON-NLS-1$
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
- Element child = (Element)children.item(i);
- String name = child.getNodeName();
- if (name.equals("ico")) { //$NON-NLS-1$
- fIcons.put(P_ICO_PATH, child.getAttribute("path")); //$NON-NLS-1$
- } else if (name.equals("bmp")) { //$NON-NLS-1$
- fIcons.put(WIN32_16_HIGH, child.getAttribute(WIN32_16_HIGH));
- fIcons.put(WIN32_16_LOW, child.getAttribute(WIN32_16_LOW));
- fIcons.put(WIN32_32_HIGH, child.getAttribute(WIN32_32_HIGH));
- fIcons.put(WIN32_32_LOW, child.getAttribute(WIN32_32_LOW));
- fIcons.put(WIN32_48_HIGH, child.getAttribute(WIN32_48_HIGH));
- fIcons.put(WIN32_48_LOW, child.getAttribute(WIN32_48_LOW));
- }
- }
- }
- }
-
- private void parseSolaris(Element element) {
- fIcons.put(SOLARIS_LARGE, element.getAttribute(SOLARIS_LARGE));
- fIcons.put(SOLARIS_MEDIUM, element.getAttribute(SOLARIS_MEDIUM));
- fIcons.put(SOLARIS_SMALL, element.getAttribute(SOLARIS_SMALL));
- fIcons.put(SOLARIS_TINY, element.getAttribute(SOLARIS_TINY));
- }
-
- private void parseMac(Element element) {
- fIcons.put(MACOSX_ICON, element.getAttribute("icon")); //$NON-NLS-1$
- }
-
- private void parseLinux(Element element) {
- fIcons.put(LINUX_ICON, element.getAttribute("icon")); //$NON-NLS-1$
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<launcher"); //$NON-NLS-1$
- if (fLauncherName != null && fLauncherName.length() > 0)
- writer.print(" name=\"" + fLauncherName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println(">"); //$NON-NLS-1$
-
- writeLinux(indent + " ", writer); //$NON-NLS-1$
- writeMac(indent + " ", writer); //$NON-NLS-1$
- writeSolaris(indent + " ", writer); //$NON-NLS-1$
- writerWin(indent + " ", writer); //$NON-NLS-1$
- writer.println(indent + "</launcher>"); //$NON-NLS-1$
- }
-
- private void writerWin(String indent, PrintWriter writer) {
- writer.println(indent + "<win " + P_USE_ICO + "=\"" + Boolean.toString(fUseIcoFile) + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String path = (String)fIcons.get(P_ICO_PATH);
- if (path != null && path.length() > 0)
- writer.println(indent + " <ico path=\"" + getWritableString(path) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- writer.print(indent + " <bmp"); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_16_HIGH, writer); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_16_LOW, writer); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_32_HIGH, writer); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_32_LOW, writer); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_48_HIGH, writer); //$NON-NLS-1$
- writeIcon(indent + " ", WIN32_48_LOW, writer); //$NON-NLS-1$
- writer.println("/>"); //$NON-NLS-1$
- writer.println(indent + "</win>"); //$NON-NLS-1$
- }
-
- private void writeSolaris(String indent, PrintWriter writer) {
- writer.print(indent + "<solaris"); //$NON-NLS-1$
- writeIcon(indent + " ", SOLARIS_LARGE, writer); //$NON-NLS-1$
- writeIcon(indent + " ", SOLARIS_MEDIUM, writer); //$NON-NLS-1$
- writeIcon(indent + " ", SOLARIS_SMALL, writer); //$NON-NLS-1$
- writeIcon(indent + " ", SOLARIS_TINY, writer); //$NON-NLS-1$
- writer.println("/>"); //$NON-NLS-1$
- }
-
- private void writeIcon(String indent, String iconId, PrintWriter writer) {
- String icon = (String)fIcons.get(iconId);
- if (icon != null && icon.length() > 0) {
- writer.println();
- writer.print(indent + " " + iconId + "=\"" + getWritableString(icon) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- }
-
- private void writeMac(String indent, PrintWriter writer) {
- String icon = (String)fIcons.get(MACOSX_ICON);
- if (icon != null && icon.length() > 0)
- writer.println(indent + "<macosx icon=\"" + getWritableString(icon) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private void writeLinux(String indent, PrintWriter writer) {
- String icon = (String)fIcons.get(LINUX_ICON);
- if (icon != null && icon.length() > 0)
- writer.println(indent + "<linux icon=\"" + getWritableString(icon) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/Product.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/Product.java
deleted file mode 100644
index 2203834..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/Product.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.TreeMap;
-
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.iproduct.IAboutInfo;
-import org.eclipse.pde.internal.core.iproduct.IArgumentsInfo;
-import org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo;
-import org.eclipse.pde.internal.core.iproduct.IIntroInfo;
-import org.eclipse.pde.internal.core.iproduct.ILauncherInfo;
-import org.eclipse.pde.internal.core.iproduct.IProduct;
-import org.eclipse.pde.internal.core.iproduct.IProductFeature;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IProductModelFactory;
-import org.eclipse.pde.internal.core.iproduct.IProductPlugin;
-import org.eclipse.pde.internal.core.iproduct.ISplashInfo;
-import org.eclipse.pde.internal.core.iproduct.IWindowImages;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class Product extends ProductObject implements IProduct {
-
- private static final long serialVersionUID = 1L;
- private String fId;
- private String fName;
- private String fApplication;
- private IAboutInfo fAboutInfo;
-
- private TreeMap fPlugins = new TreeMap();
- private TreeMap fFeatures = new TreeMap();
- private IConfigurationFileInfo fConfigIniInfo;
- private boolean fUseFeatures;
- private IWindowImages fWindowImages;
- private ISplashInfo fSplashInfo;
- private ILauncherInfo fLauncherInfo;
- private IArgumentsInfo fLauncherArgs;
- private IIntroInfo fIntroInfo;
-
- public Product(IProductModel model) {
- super(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getId()
- */
- public String getId() {
- return fId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getName()
- */
- public String getName() {
- return fName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getApplication()
- */
- public String getApplication() {
- return fApplication;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getDefiningPluginId()
- */
- public String getDefiningPluginId() {
- if (fId == null)
- return null;
- int dot = fId.lastIndexOf('.');
- return (dot != -1) ? fId.substring(0, dot) : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#setId(java.lang.String)
- */
- public void setId(String id) {
- String old = fId;
- fId = id;
- if (isEditable())
- firePropertyChanged(P_ID, old, fId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#setName(java.lang.String)
- */
- public void setName(String name) {
- String old = fName;
- fName = name;
- if (isEditable())
- firePropertyChanged(P_NAME, old, fName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#setAboutInfo(org.eclipse.pde.internal.core.iproduct.IAboutInfo)
- */
- public void setAboutInfo(IAboutInfo info) {
- fAboutInfo = info;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#setApplication(java.lang.String)
- */
- public void setApplication(String application) {
- String old = fApplication;
- fApplication = application;
- if (isEditable())
- firePropertyChanged(P_APPLICATION, old, fApplication);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductObject#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<product"); //$NON-NLS-1$
- if (fName != null && fName.length() > 0)
- writer.print(" " + P_NAME + "=\"" + getWritableString(fName) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (fId != null && fId.length() > 0)
- writer.print(" " + P_ID + "=\"" + fId + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (fApplication != null && fApplication.length() > 0)
- writer.print(" " + P_APPLICATION + "=\"" + fApplication + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- writer.print(" " + P_USEFEATURES + "=\"" + Boolean.toString(fUseFeatures) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- writer.println(">"); //$NON-NLS-1$
-
- if (fAboutInfo != null) {
- writer.println();
- fAboutInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fConfigIniInfo != null) {
- writer.println();
- fConfigIniInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fLauncherArgs != null) {
- writer.println();
- fLauncherArgs.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fWindowImages != null) {
- writer.println();
- fWindowImages.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fSplashInfo != null) {
- writer.println();
- fSplashInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fLauncherInfo != null) {
- writer.println();
- fLauncherInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- if (fIntroInfo != null) {
- writer.println();
- fIntroInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- writer.println();
- writer.println(indent + " <plugins>"); //$NON-NLS-1$
- Iterator iter = fPlugins.values().iterator();
- while (iter.hasNext()) {
- IProductPlugin plugin = (IProductPlugin)iter.next();
- plugin.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + " </plugins>"); //$NON-NLS-1$
-
- if (fFeatures.size() > 0) {
- writer.println();
- writer.println(indent + " <features>"); //$NON-NLS-1$
- iter = fFeatures.values().iterator();
- while (iter.hasNext()) {
- IProductFeature feature = (IProductFeature)iter.next();
- feature.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + " </features>"); //$NON-NLS-1$
- }
-
- writer.println();
- writer.println("</product>"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getAboutInfo()
- */
- public IAboutInfo getAboutInfo() {
- return fAboutInfo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#reset()
- */
- public void reset() {
- fAboutInfo = null;
- fApplication = null;
- fId = null;
- fName = null;
- fIntroInfo = null;
- fPlugins.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#parse(org.w3c.dom.Node)
- */
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE
- && node.getNodeName().equals("product")) { //$NON-NLS-1$
- Element element = (Element)node;
- fApplication = element.getAttribute(P_APPLICATION);
- fId = element.getAttribute(P_ID);
- fName = element.getAttribute(P_NAME);
- fUseFeatures = "true".equals(element.getAttribute(P_USEFEATURES)); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- IProductModelFactory factory = getModel().getFactory();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String name = child.getNodeName();
- if (name.equals("aboutInfo")) { //$NON-NLS-1$
- fAboutInfo = factory.createAboutInfo();
- fAboutInfo.parse(child);
- } else if (name.equals("plugins")) { //$NON-NLS-1$
- parsePlugins(child.getChildNodes());
- } else if (name.equals("features")) { //$NON-NLS-1$
- parseFeatures(child.getChildNodes());
- } else if (name.equals("configIni")) { //$NON-NLS-1$
- fConfigIniInfo = factory.createConfigFileInfo();
- fConfigIniInfo.parse(child);
- } else if (name.equals("windowImages")) { //$NON-NLS-1$
- fWindowImages = factory.createWindowImages();
- fWindowImages.parse(child);
- } else if (name.equals("splash")) { //$NON-NLS-1$
- fSplashInfo = factory.createSplashInfo();
- fSplashInfo.parse(child);
- } else if (name.equals("launcher")) { //$NON-NLS-1$
- fLauncherInfo = factory.createLauncherInfo();
- fLauncherInfo.parse(child);
- } else if (name.equals("launcherArgs")) { //$NON-NLS-1$
- fLauncherArgs = factory.createLauncherArguments();
- fLauncherArgs.parse(child);
- } else if (name.equals("intro")) { //$NON-NLS-1$
- fIntroInfo = factory.createIntroInfo();
- fIntroInfo.parse(child);
- }
- }
- }
- }
- }
-
- private void parsePlugins(NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("plugin")) { //$NON-NLS-1$
- IProductPlugin plugin = getModel().getFactory().createPlugin();
- plugin.parse(child);
- fPlugins.put(plugin.getId(), plugin);
- }
- }
- }
- }
-
- private void parseFeatures(NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("feature")) { //$NON-NLS-1$
- IProductFeature feature = getModel().getFactory().createFeature();
- feature.parse(child);
- fFeatures.put(feature.getId(), feature);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#addPlugin(org.eclipse.pde.internal.core.iproduct.IProductPlugin)
- */
- public void addPlugin(IProductPlugin plugin) {
- String id = plugin.getId();
- if (fPlugins.containsKey(id))
- return;
-
- plugin.setModel(getModel());
- fPlugins.put(id, plugin);
- if (isEditable())
- fireStructureChanged(plugin, IModelChangedEvent.INSERT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#removePlugin(org.eclipse.pde.internal.core.iproduct.IProductPlugin)
- */
- public void removePlugin(IProductPlugin plugin) {
- fPlugins.remove(plugin.getId());
- if (isEditable())
- fireStructureChanged(plugin, IModelChangedEvent.REMOVE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getPlugins()
- */
- public IProductPlugin[] getPlugins() {
- return (IProductPlugin[])fPlugins.values().toArray(new IProductPlugin[fPlugins.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#getConfigurationFileInfo()
- */
- public IConfigurationFileInfo getConfigurationFileInfo() {
- return fConfigIniInfo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProduct#setConfigurationFileInfo(org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo)
- */
- public void setConfigurationFileInfo(IConfigurationFileInfo info) {
- fConfigIniInfo = info;
- }
-
- public boolean useFeatures() {
- return fUseFeatures;
- }
-
- public void setUseFeatures(boolean use) {
- boolean old = fUseFeatures;
- fUseFeatures = use;
- if (isEditable())
- firePropertyChanged(P_USEFEATURES, Boolean.toString(old), Boolean.toString(fUseFeatures));
- }
-
- public boolean containsPlugin(String id) {
- return fPlugins.containsKey(id);
- }
-
- public boolean containsFeature(String id) {
- return fFeatures.containsKey(id);
- }
-
- public IWindowImages getWindowImages() {
- return fWindowImages;
- }
-
- public void setWindowImages(IWindowImages images) {
- fWindowImages = images;
- }
-
- public ISplashInfo getSplashInfo() {
- return fSplashInfo;
- }
-
- public void setSplashInfo(ISplashInfo info) {
- fSplashInfo = info;
- }
-
- public ILauncherInfo getLauncherInfo() {
- return fLauncherInfo;
- }
-
- public void setLauncherInfo(ILauncherInfo info) {
- fLauncherInfo = info;
- }
-
- public void addFeature(IProductFeature feature) {
- String id = feature.getId();
- if (fFeatures.containsKey(id))
- return;
-
- feature.setModel(getModel());
- fFeatures.put(id, feature);
- if (isEditable())
- fireStructureChanged(feature, IModelChangedEvent.INSERT);
- }
-
- public void removeFeature(IProductFeature feature) {
- fFeatures.remove(feature.getId());
- if (isEditable())
- fireStructureChanged(feature, IModelChangedEvent.REMOVE);
- }
-
- public IProductFeature[] getFeatures() {
- return (IProductFeature[])fFeatures.values().toArray(new IProductFeature[fFeatures.size()]);
- }
-
- public IArgumentsInfo getLauncherArguments() {
- return fLauncherArgs;
- }
-
- public void setLauncherArguments(IArgumentsInfo info) {
- fLauncherArgs = info;
- }
-
- public IIntroInfo getIntroInfo() {
- return fIntroInfo;
- }
-
- public void setIntroInfo(IIntroInfo introInfo) {
- fIntroInfo = introInfo;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductFeature.java
deleted file mode 100644
index fb00664..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductFeature.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IProductFeature;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class ProductFeature extends ProductObject implements IProductFeature {
-
- private static final long serialVersionUID = 1L;
- private String fId;
- private String fVersion;
-
- public ProductFeature(IProductModel model) {
- super(model);
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- fId = element.getAttribute("id"); //$NON-NLS-1$
- fVersion = element.getAttribute("version"); //$NON-NLS-1$
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<feature id=\"" + fId + "\" version=\"" + fVersion + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public String getId() {
- return fId;
- }
-
- public void setId(String id) {
- fId = id;
- }
-
- public String getVersion() {
- return fVersion;
- }
-
- public void setVersion(String version) {
- fVersion = version;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModel.java
deleted file mode 100644
index c4bf671..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModel.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.XMLDefaultHandler;
-import org.eclipse.pde.internal.core.iproduct.IProduct;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IProductModelFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-
-public class ProductModel extends AbstractModel implements IProductModel {
-
- private static final long serialVersionUID = 1L;
-
- private IProductModelFactory fFactory;
- private IProduct fProduct;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#updateTimeStamp()
- */
- protected void updateTimeStamp() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModel#getProduct()
- */
- public IProduct getProduct() {
- if (fProduct == null)
- fProduct = getFactory().createProduct();
- return fProduct;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModel#getFactory()
- */
- public IProductModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new ProductModelFactory(this);
- return fFactory;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModel#getInstallLocation()
- */
- public String getInstallLocation() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isInSync()
- */
- public boolean isInSync() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load()
- */
- public void load() throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
- */
- public void load(InputStream stream, boolean outOfSync)
- throws CoreException {
- try {
- SAXParser parser = getSaxParser();
- XMLDefaultHandler handler = new XMLDefaultHandler();
- parser.parse(stream, handler);
- processDocument(handler.getDocument());
- setLoaded(true);
- } catch (Exception e) {
- PDECore.logException(e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#reload(java.io.InputStream, boolean)
- */
- public void reload(InputStream source, boolean outOfSync)
- throws CoreException {
- load(source, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { fProduct },
- null));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IBaseModel#isEditable()
- */
- public boolean isEditable() {
- return false;
- }
-
- private void processDocument(Document doc) {
- Node rootNode = doc.getDocumentElement();
- if (fProduct == null) {
- fProduct = getFactory().createProduct();
- } else {
- fProduct.reset();
- }
- fProduct.parse(rootNode);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModelFactory.java
deleted file mode 100644
index 5573483..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductModelFactory.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import org.eclipse.pde.internal.core.iproduct.IAboutInfo;
-import org.eclipse.pde.internal.core.iproduct.IArgumentsInfo;
-import org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo;
-import org.eclipse.pde.internal.core.iproduct.IIntroInfo;
-import org.eclipse.pde.internal.core.iproduct.ILauncherInfo;
-import org.eclipse.pde.internal.core.iproduct.IProduct;
-import org.eclipse.pde.internal.core.iproduct.IProductFeature;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IProductModelFactory;
-import org.eclipse.pde.internal.core.iproduct.IProductPlugin;
-import org.eclipse.pde.internal.core.iproduct.ISplashInfo;
-import org.eclipse.pde.internal.core.iproduct.IWindowImages;
-
-
-public class ProductModelFactory implements IProductModelFactory {
-
- private IProductModel fModel;
-
- public ProductModelFactory(IProductModel model) {
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModelFactory#createProduct()
- */
- public IProduct createProduct() {
- return new Product(fModel);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModelFactory#createAboutInfo()
- */
- public IAboutInfo createAboutInfo() {
- return new AboutInfo(fModel);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModelFactory#createPlugin()
- */
- public IProductPlugin createPlugin() {
- return new ProductPlugin(fModel);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductModelFactory#createConfigFileInfo()
- */
- public IConfigurationFileInfo createConfigFileInfo() {
- return new ConfigurationFileInfo(fModel);
- }
-
- public IWindowImages createWindowImages() {
- return new WindowImages(fModel);
- }
-
- public ISplashInfo createSplashInfo() {
- return new SplashInfo(fModel);
- }
-
- public ILauncherInfo createLauncherInfo() {
- return new LauncherInfo(fModel);
- }
-
- public IProductFeature createFeature() {
- return new ProductFeature(fModel);
- }
-
- public IArgumentsInfo createLauncherArguments() {
- return new ArgumentsInfo(fModel);
- }
-
- public IIntroInfo createIntroInfo() {
- return new IntroInfo(fModel);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductObject.java
deleted file mode 100644
index c2e8645..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductObject.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.iproduct.IProduct;
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IProductObject;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-
-public abstract class ProductObject extends PlatformObject implements IProductObject {
-
- private transient IProductModel fModel;
-
- public ProductObject(IProductModel model) {
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#getModel()
- */
- public IProductModel getModel() {
- return fModel;
- }
-
- public void setModel(IProductModel model) {
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#getProduct()
- */
- public IProduct getProduct() {
- return getModel().getProduct();
- }
-
- protected void firePropertyChanged(
- String property,
- Object oldValue,
- Object newValue) {
- firePropertyChanged(this, property, oldValue, newValue);
- }
-
- protected void firePropertyChanged(
- IProductObject object,
- String property,
- Object oldValue,
- Object newValue) {
- if (fModel.isEditable()) {
- IModelChangeProvider provider = fModel;
- provider.fireModelObjectChanged(object, property, oldValue, newValue);
- }
- }
-
- protected void fireStructureChanged(IProductObject child, int changeType) {
- fireStructureChanged(new IProductObject[] { child }, changeType);
- }
-
- protected void fireStructureChanged(
- IProductObject[] children,
- int changeType) {
- if (fModel.isEditable()) {
- IModelChangeProvider provider = fModel;
- provider.fireModelChanged(new ModelChangedEvent(provider, changeType, children, null));
- }
- }
-
- protected boolean isEditable() {
- return getModel().isEditable();
- }
-
- public String getWritableString(String source) {
- return CoreUtility.getWritableString(source);
- }
-
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductPlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductPlugin.java
deleted file mode 100644
index 0d7c52c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ProductPlugin.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IProductPlugin;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ProductPlugin extends ProductObject implements IProductPlugin {
-
- private static final long serialVersionUID = 1L;
- private String fId;
-
- public ProductPlugin(IProductModel model) {
- super(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductPlugin#getId()
- */
- public String getId() {
- return fId.trim();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductPlugin#setId(java.lang.String)
- */
- public void setId(String id) {
- fId = id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.iproduct.IProductObject#parse(org.w3c.dom.Node)
- */
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- fId = ((Element)node).getAttribute("id"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductObject#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<plugin id=\"" + fId + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/SplashInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/SplashInfo.java
deleted file mode 100644
index 2fac8cf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/SplashInfo.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.ISplashInfo;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class SplashInfo extends ProductObject implements ISplashInfo {
-
- private static final long serialVersionUID = 1L;
- private String fLocation;
-
- public SplashInfo(IProductModel model) {
- super(model);
- }
-
- public void setLocation(String location) {
- String old = fLocation;
- fLocation = location;
- if (isEditable())
- firePropertyChanged(P_LOCATION, old, fLocation);
- }
-
- public String getLocation() {
- return fLocation;
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- fLocation = element.getAttribute(P_LOCATION);
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- if (fLocation != null && fLocation.length() > 0)
- writer.println(indent + "<splash " + P_LOCATION + "=\"" + getWritableString(fLocation) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WindowImages.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WindowImages.java
deleted file mode 100644
index 7382a59..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WindowImages.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.iproduct.IProductModel;
-import org.eclipse.pde.internal.core.iproduct.IWindowImages;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WindowImages extends ProductObject implements IWindowImages {
-
- private static final long serialVersionUID = 1L;
- private String f16ImagePath;
- private String f32ImagePath;
- private String f48ImagePath;
- private String f64ImagePath;
- private String f128ImagePath;
-
- public WindowImages(IProductModel model) {
- super(model);
- }
-
- public String getImagePath(int size) {
- switch (size) {
- case 0:
- return f16ImagePath;
- case 1:
- return f32ImagePath;
- case 2:
- return f48ImagePath;
- case 3:
- return f64ImagePath;
- case 4:
- return f128ImagePath;
- }
- return null;
- }
-
- public void setImagePath(String path, int size) {
- String old;
- switch(size) {
- case 0:
- old = f16ImagePath;
- f16ImagePath = path;
- if (isEditable())
- firePropertyChanged(P_16, old, f16ImagePath);
- break;
- case 1:
- old = f32ImagePath;
- f32ImagePath = path;
- if (isEditable())
- firePropertyChanged(P_32, old, f32ImagePath);
- break;
- case 2:
- old = f48ImagePath;
- f48ImagePath = path;
- if (isEditable())
- firePropertyChanged(P_48, old, f48ImagePath);
- break;
- case 3:
- old = f64ImagePath;
- f64ImagePath = path;
- if (isEditable())
- firePropertyChanged(P_64, old, f64ImagePath);
- break;
- case 4:
- old = f128ImagePath;
- f128ImagePath = path;
- if (isEditable())
- firePropertyChanged(P_128, old, f128ImagePath);
- break;
- }
-
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- f16ImagePath = element.getAttribute(P_16); //$NON-NLS-1$
- // try the old 3.1 attribute name
- if (f16ImagePath == null)
- f16ImagePath = element.getAttribute("small"); //$NON-NLS-1$
-
- f32ImagePath = element.getAttribute(P_32); //$NON-NLS-1$
- // try the old 3.1 attribute name
- if (f32ImagePath == null)
- f32ImagePath = element.getAttribute("large"); //$NON-NLS-1$
-
- f48ImagePath = element.getAttribute(P_48); //$NON-NLS-1$
- f64ImagePath = element.getAttribute(P_64); //$NON-NLS-1$
- f128ImagePath = element.getAttribute(P_128); //$NON-NLS-1$
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<windowImages"); //$NON-NLS-1$
- if (f16ImagePath != null && f16ImagePath.length() > 0) {
- writer.print(" " + P_16 + "=\"" + getWritableString(f16ImagePath) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (f32ImagePath != null && f32ImagePath.length() > 0) {
- writer.print(" " + P_32 + "=\"" + getWritableString(f32ImagePath) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (f48ImagePath != null && f48ImagePath.length() > 0) {
- writer.print(" " + P_48 + "=\"" + getWritableString(f48ImagePath) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (f64ImagePath != null && f64ImagePath.length() > 0) {
- writer.print(" " + P_64 + "=\"" + getWritableString(f64ImagePath) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if (f128ImagePath != null && f128ImagePath.length() > 0) {
- writer.print(" " + P_128 + "=\"" + getWritableString(f128ImagePath) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WorkspaceProductModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WorkspaceProductModel.java
deleted file mode 100644
index 5c206ff..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/WorkspaceProductModel.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.product;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-
-
-public class WorkspaceProductModel extends ProductModel implements IEditableModel {
-
- private static final long serialVersionUID = 1L;
-
- private IFile fFile;
-
- private boolean fDirty;
-
- private boolean fEditable;
-
- public WorkspaceProductModel(IFile file, boolean editable) {
- fFile = file;
- fEditable = editable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#load()
- */
- public void load() throws CoreException {
- if (fFile.exists()) {
- InputStream stream = null;
- try {
- stream = fFile.getContents(true);
- load(stream, false);
- } catch (CoreException e) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#isInSync()
- */
- public boolean isInSync() {
- IPath path = fFile.getLocation();
- return path == null ? false : isInSync(path.toFile());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#getUnderlyingResource()
- */
- public IResource getUnderlyingResource() {
- return fFile;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#getInstallLocation()
- */
- public String getInstallLocation() {
- return fFile.getLocation().toOSString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditableModel#save()
- */
- public void save() {
- try {
- String contents = getContents();
- ByteArrayInputStream stream =
- new ByteArrayInputStream(contents.getBytes("UTF8")); //$NON-NLS-1$
- if (fFile.exists()) {
- fFile.setContents(stream, false, false, null);
- } else {
- fFile.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- setLoaded(true);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#isDirty()
- */
- public boolean isDirty() {
- return fDirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#save(java.io.PrintWriter)
- */
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- writer.println("<?pde version=\"3.1\"?>"); //$NON-NLS-1$
- writer.println();
- getProduct().write("", writer); //$NON-NLS-1$
- }
- setDirty(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#setDirty(boolean)
- */
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#fireModelChanged(org.eclipse.pde.core.IModelChangedEvent)
- */
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(true);
- super.fireModelChanged(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#isEditable()
- */
- public boolean isEditable() {
- return fEditable;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/ChoiceRestriction.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/ChoiceRestriction.java
deleted file mode 100644
index c1bd7da..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/ChoiceRestriction.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaEnumeration;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaRestriction;
-import org.eclipse.pde.internal.core.ischema.ISchemaSimpleType;
-
-public class ChoiceRestriction
- extends SchemaObject
- implements ISchemaRestriction {
-
- private static final long serialVersionUID = 1L;
- private ISchemaSimpleType baseType;
- private Vector children;
- public static final String P_CHOICES = "choices"; //$NON-NLS-1$
-
- public ChoiceRestriction(ISchema schema) {
- super(schema, "__choice__"); //$NON-NLS-1$
-
- }
- public ChoiceRestriction(ChoiceRestriction source) {
- this(source.getSchema());
- children = new Vector();
- Object[] choices = source.getChildren();
- for (int i = 0; i < choices.length; i++) {
- children.add(
- new SchemaEnumeration(
- this,
- ((ISchemaEnumeration) choices[i]).getName()));
- }
- }
- public ISchemaSimpleType getBaseType() {
- return baseType;
- }
- public Object[] getChildren() {
- return (children != null) ? children.toArray() : new Object[0];
- }
- public String[] getChoicesAsStrings() {
- if (children == null)
- return new String[0];
- Vector result = new Vector();
- for (int i = 0; i < children.size(); i++) {
- ISchemaEnumeration enumeration = (ISchemaEnumeration) children.get(i);
- result.addElement(enumeration.getName());
- }
- String[] choices = new String[result.size()];
- result.copyInto(choices);
- return choices;
- }
- public ISchemaObject getParent() {
- if (baseType != null)
- return baseType.getSchema();
- return super.getParent();
- }
- public boolean isValueValid(java.lang.Object value) {
- if (children == null)
- return false;
- String svalue = value.toString();
-
- for (int i = 0; i < children.size(); i++) {
- ISchemaEnumeration enumeration = (ISchemaEnumeration) children.get(i);
- if (enumeration.getName().equals(svalue))
- return true;
- }
- return false;
- }
- public void setBaseType(ISchemaSimpleType baseType) {
- this.baseType = baseType;
- }
- public void setChildren(Vector children) {
- Vector oldValue = this.children;
- this.children = children;
- if (getParent() != null)
- getSchema().fireModelObjectChanged(
- this,
- P_CHOICES,
- oldValue,
- children);
- }
- public String toString() {
- if (children == null)
- return ""; //$NON-NLS-1$
- StringBuffer buffer = new StringBuffer();
-
- for (int i = 0; i < children.size(); i++) {
- Object child = children.get(i);
- if (child instanceof ISchemaEnumeration) {
- ISchemaEnumeration enumeration = (ISchemaEnumeration) child;
- if (i > 0)
- buffer.append(", "); //$NON-NLS-1$
- buffer.append(enumeration.getName());
- }
- }
- return buffer.toString();
- }
- public void write(String indent, PrintWriter writer) {
- writer.println(
- indent + "<restriction base=\"" + baseType.getName() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 0; i < children.size(); i++) {
- Object child = children.get(i);
- if (child instanceof ISchemaEnumeration) {
- ISchemaEnumeration enumeration = (ISchemaEnumeration) child;
- enumeration.write(indent + Schema.INDENT, writer);
- }
- }
- writer.println(indent + "</restriction>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/DocumentSection.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/DocumentSection.java
deleted file mode 100644
index 8f522cf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/DocumentSection.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.ischema.IDocumentSection;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-
-public class DocumentSection extends SchemaObject implements IDocumentSection {
-
- private static final long serialVersionUID = 1L;
- private String sectionId;
-
- public DocumentSection(ISchemaObject parent, String sectionId, String name) {
- super(parent, name);
- this.sectionId = sectionId;
- }
-
- public String getSectionId() {
- return sectionId;
- }
-
- public void write(String indent, PrintWriter writer) {
- String indent2 = indent + Schema.INDENT;
- String indent3 = indent2 + Schema.INDENT;
- writer.println(indent + "<annotation>"); //$NON-NLS-1$
- writer.println(indent2 + "<appInfo>"); //$NON-NLS-1$
- writer.println(indent3 + "<meta.section type=\"" + sectionId + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println(indent2 + "</appInfo>"); //$NON-NLS-1$
- writer.println(indent2 + "<documentation>"); //$NON-NLS-1$
- writer.println(indent3 + getWritableDescription());
- writer.println(indent2 + "</documentation>"); //$NON-NLS-1$
- writer.println(indent + "</annotation>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/EditableSchema.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/EditableSchema.java
deleted file mode 100644
index 9af102c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/EditableSchema.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.net.URL;
-
-import org.eclipse.pde.core.IEditable;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-
-public class EditableSchema extends Schema implements IEditable {
-
- public EditableSchema(ISchemaDescriptor schemaDescriptor, URL url, boolean abbreviated) {
- super(schemaDescriptor, url, abbreviated);
- }
-
- public EditableSchema(String pluginId, String pointId, String name, boolean abbreviated) {
- super(pluginId, pointId, name, abbreviated);
- }
-
-
- private boolean dirty;
-
- public void fireModelChanged(IModelChangedEvent event) {
- if (isNotificationEnabled())
- dirty = true;
- super.fireModelChanged(event);
- }
-
- public boolean isDirty() {
- return dirty;
- }
-
- public boolean isEditable() {
- return true;
- }
-
- public void save(PrintWriter writer) {
- this.write("", writer); //$NON-NLS-1$
- dirty = false;
- }
-
- public void setDirty(boolean newDirty) {
- dirty = newDirty;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/IncludedSchemaDescriptor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/IncludedSchemaDescriptor.java
deleted file mode 100644
index 09abecc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/IncludedSchemaDescriptor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-
-public class IncludedSchemaDescriptor implements ISchemaDescriptor {
- private URL fSchemaURL;
- private String fSchemaLocation;
- private Schema fSchema;
- private long fLastModified;
-
- public IncludedSchemaDescriptor(URL schemaURL) {
- fSchemaURL = schemaURL;
- File file = new File(fSchemaURL.getFile());
- if (file.exists())
- fLastModified = file.lastModified();
- }
-
- public static URL computeURL(ISchemaDescriptor parentDesc, String schemaLocation) throws MalformedURLException {
- if (schemaLocation.startsWith("schema://")) { //$NON-NLS-1$
- // extract plug-in ID
- IPath path = new Path( schemaLocation.substring(9));
- return getPluginRelativePath(path.segment(0), path.removeFirstSegments(1), parentDesc.getSchemaURL());
- }
- // parent-relative location
- URL parentURL = parentDesc.getSchemaURL();
- IPath path = new Path(parentURL.getPath());
- path = path.removeLastSegments(1).append(schemaLocation);
- return new URL(parentURL.getProtocol(), parentURL.getHost(), path.toString());
- }
-
- private static URL getPluginRelativePath(String pluginID, IPath path, URL parentURL) {
- URL url = SchemaRegistry.getSchemaURL(pluginID, path.toString());
- if (url == null) {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(pluginID);
- if (model != null)
- url = SchemaRegistry.getSchemaFromSourceExtension(model.getPluginBase(), path);
- }
- try {
- if (url == null && parentURL != null){
- File file = new File(parentURL.getFile(), "../../../" + pluginID + "/" + path.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- if (file.exists() && file.isFile())
- url = file.toURL();
- }
- } catch (MalformedURLException e) {
- }
- return url;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.schema.AbstractSchemaDescriptor#isEnabled()
- */
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getPointId()
- */
- public String getPointId() {
- int dotLoc = fSchemaLocation.lastIndexOf('.');
- if (dotLoc!= -1) {
- return fSchemaLocation.substring(0, dotLoc);
- }
- return null;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getSchemaURL()
- */
- public URL getSchemaURL() {
- return fSchemaURL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getSchema(boolean)
- */
- public ISchema getSchema(boolean abbreviated) {
- if (fSchema == null && fSchemaURL != null) {
- fSchema = new Schema(this, fSchemaURL, abbreviated);
- fSchema.load();
- }
- return fSchema;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#isStandalone()
- */
- public boolean isStandalone() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getLastModified()
- */
- public long getLastModified() {
- return fLastModified;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/RepeatableSchemaObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/RepeatableSchemaObject.java
deleted file mode 100644
index 144ee32..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/RepeatableSchemaObject.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaRepeatable;
-
-public abstract class RepeatableSchemaObject extends SchemaObject implements ISchemaRepeatable {
- public static final String P_MIN_OCCURS="min_occurs"; //$NON-NLS-1$
- public static final String P_MAX_OCCURS="max_occurs"; //$NON-NLS-1$
- private int minOccurs = 1;
- private int maxOccurs = 1;
-
-public RepeatableSchemaObject(ISchemaObject parent, String name) {
- super(parent, name);
-}
-public int getMaxOccurs() {
- return maxOccurs;
-}
-public int getMinOccurs() {
- return minOccurs;
-}
-public boolean isRequired() {
- return minOccurs >0;
-}
-public boolean isUnbounded() {
- return maxOccurs ==Integer.MAX_VALUE;
-}
-public void setMaxOccurs(int newMaxOccurs) {
- Integer oldValue = new Integer(maxOccurs);
- maxOccurs = newMaxOccurs;
- getSchema().fireModelObjectChanged(this, P_MAX_OCCURS, oldValue, new Integer(maxOccurs));
-}
-public void setMinOccurs(int newMinOccurs) {
- Integer oldValue = new Integer(minOccurs);
- minOccurs = newMinOccurs;
- getSchema().fireModelObjectChanged(this, P_MIN_OCCURS, oldValue, new Integer(minOccurs));
-}
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/Schema.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/Schema.java
deleted file mode 100644
index af0093f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/Schema.java
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.IModelChangedListener;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.XMLDefaultHandler;
-import org.eclipse.pde.internal.core.ischema.IDocumentSection;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaComplexType;
-import org.eclipse.pde.internal.core.ischema.ISchemaCompositor;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.eclipse.pde.internal.core.ischema.ISchemaEnumeration;
-import org.eclipse.pde.internal.core.ischema.ISchemaInclude;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaObjectReference;
-import org.eclipse.pde.internal.core.ischema.ISchemaRootElement;
-import org.eclipse.pde.internal.core.ischema.ISchemaSimpleType;
-import org.eclipse.pde.internal.core.ischema.ISchemaType;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-public class Schema extends PlatformObject implements ISchema {
- private URL fURL;
-
- private Vector fListeners = new Vector();
-
- private Vector fElements = new Vector();
-
- private Vector fDocSections = new Vector();
-
- private Vector fIncludes;
-
- private String fPointID;
-
- private String fPluginID;
-
- private ISchemaDescriptor fSchemaDescriptor;
-
- private boolean fLoaded;
-
- private Vector fReferences;
-
- private String fDescription;
-
- private String fName = ""; //$NON-NLS-1$
-
- private boolean fNotificationEnabled;
-
- public final static String INDENT = " "; //$NON-NLS-1$
-
- private boolean fDisposed;
-
- private boolean fValid;
-
- private boolean fAbbreviated;
-
- public Schema(String pluginId, String pointId, String name, boolean abbreviated) {
- fPluginID = pluginId;
- fPointID = pointId;
- fName = name;
- fAbbreviated = abbreviated;
- }
-
- public Schema(ISchemaDescriptor schemaDescriptor, URL url, boolean abbreviated) {
- fSchemaDescriptor = schemaDescriptor;
- fURL = url;
- fAbbreviated = abbreviated;
- }
-
- public void addDocumentSection(IDocumentSection docSection) {
- fDocSections.addElement(docSection);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.INSERT,
- new Object[] { docSection }, null));
- }
-
- public void addElement(ISchemaElement element) {
- addElement(element, null);
- }
-
- public void addElement(ISchemaElement element, ISchemaElement afterElement) {
- int index = -1;
- if (afterElement != null) {
- index = fElements.indexOf(afterElement);
- }
- if (index != -1)
- fElements.add(index + 1, element);
- else
- fElements.add(element);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.INSERT,
- new Object[] { element }, null));
- }
-
- public void addInclude(ISchemaInclude include) {
- if (fIncludes == null)
- fIncludes = new Vector();
- fIncludes.add(include);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.INSERT,
- new Object[] { include }, null));
- }
-
- public void removeInclude(ISchemaInclude include) {
- if (fIncludes == null)
- return;
- fIncludes.remove(include);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.REMOVE,
- new Object[] { include }, null));
- }
-
- public void addModelChangedListener(IModelChangedListener listener) {
- fListeners.addElement(listener);
- }
-
- private void collectElements(ISchemaCompositor compositor, Vector result) {
- Object[] children = compositor.getChildren();
- for (int i = 0; i < children.length; i++) {
- Object child = children[i];
- if (child instanceof ISchemaCompositor)
- collectElements((ISchemaCompositor) child, result);
- else if (child instanceof ISchemaObjectReference) {
- ISchemaObjectReference ref = (ISchemaObjectReference) child;
- Object referenced = ref.getReferencedObject();
- if (referenced instanceof ISchemaElement)
- result.addElement(referenced);
- }
- }
- }
-
- public void dispose() {
- if (fIncludes != null) {
- for (int i = 0; i < fIncludes.size(); i++) {
- ISchemaInclude include = (ISchemaInclude) fIncludes.get(i);
- include.dispose();
- }
- }
- reset();
- fDisposed = true;
- }
-
- public ISchemaElement findElement(String name) {
- if (!isLoaded())
- load();
- for (int i = 0; i < fElements.size(); i++) {
- ISchemaElement element = (ISchemaElement) fElements.elementAt(i);
- if (element.getName().equals(name))
- return element;
- }
- if (fIncludes != null) {
- for (int i = 0; i < fIncludes.size(); i++) {
- ISchemaInclude include = (ISchemaInclude) fIncludes.get(i);
- ISchema ischema = include.getIncludedSchema();
- if (ischema == null)
- continue;
- ISchemaElement element = ischema.findElement(name);
- if (element != null)
- return element;
- }
- }
- return null;
- }
-
- public void fireModelChanged(IModelChangedEvent event) {
- if (!fNotificationEnabled)
- return;
- for (Iterator iter = fListeners.iterator(); iter.hasNext();) {
- IModelChangedListener listener = (IModelChangedListener) iter
- .next();
- listener.modelChanged(event);
- }
- }
-
- public void fireModelObjectChanged(Object object, String property,
- Object oldValue, Object newValue) {
- fireModelChanged(new ModelChangedEvent(this, object, property,
- oldValue, newValue));
- }
-
- private String getAttribute(Node node, String name) {
- NamedNodeMap map = node.getAttributes();
- Node attNode = map.getNamedItem(name);
- if (attNode != null) {
- String value = attNode.getNodeValue();
- if (value.length() > 0)
- return value;
- }
- return null;
- }
-
- public ISchemaElement[] getCandidateChildren(ISchemaElement element) {
- Vector candidates = new Vector();
- ISchemaType type = element.getType();
- if (type instanceof ISchemaComplexType) {
- ISchemaCompositor compositor = ((ISchemaComplexType)type).getCompositor();
- if (compositor != null)
- collectElements(compositor, candidates);
- }
- ISchemaElement[] result = new ISchemaElement[candidates.size()];
- candidates.copyInto(result);
- return result;
- }
-
- public String getDescription() {
- return fDescription;
- }
-
- public boolean isValid() {
- return fValid;
- }
-
- public IDocumentSection[] getDocumentSections() {
- IDocumentSection[] result = new IDocumentSection[fDocSections.size()];
- fDocSections.copyInto(result);
- return result;
- }
-
- public int getElementCount() {
- return fElements.size();
- }
-
- public int getResolvedElementCount() {
- int localCount = getElementCount();
- if (fIncludes == null)
- return localCount;
- int totalCount = localCount;
- for (int i = 0; i < fIncludes.size(); i++) {
- ISchemaInclude include = (ISchemaInclude) fIncludes.get(i);
- ISchema schema = include.getIncludedSchema();
- if (schema == null)
- continue;
- totalCount += schema.getResolvedElementCount();
- }
- return totalCount;
- }
-
- public ISchemaElement[] getElements() {
- if (!isLoaded())
- load();
- ISchemaElement[] result = new ISchemaElement[fElements.size()];
- fElements.copyInto(result);
- return result;
- }
-
- public ISchemaElement[] getResolvedElements() {
- if (fIncludes == null)
- return getElements();
- if (!isLoaded())
- load();
- Vector result = (Vector) fElements.clone();
- for (int i = 0; i < fIncludes.size(); i++) {
- ISchemaInclude include = (ISchemaInclude) fIncludes.get(i);
- ISchema schema = include.getIncludedSchema();
- if (schema == null)
- continue;
- ISchemaElement[] ielements = schema.getElements();
- for (int j = 0; j < ielements.length; j++)
- result.add(ielements[j]);
- }
- return (ISchemaElement[]) result.toArray(new ISchemaElement[result
- .size()]);
- }
-
- public ISchemaInclude[] getIncludes() {
- if (fIncludes == null)
- return new ISchemaInclude[0];
- return (ISchemaInclude[]) fIncludes.toArray(new ISchemaInclude[fIncludes
- .size()]);
- }
-
- public String getName() {
- return fName;
- }
-
- private String getNormalizedText(String source) {
- String result = source.replace('\t', ' ');
- result = result.trim();
- return result;
- }
-
- public ISchemaObject getParent() {
- return null;
- }
-
- public void setParent(ISchemaObject obj) {
- }
-
- public String getQualifiedPointId() {
- return fPluginID + "." + fPointID; //$NON-NLS-1$
- }
-
- public String getPluginId() {
- return fPluginID;
- }
-
- public String getPointId() {
- return fPointID;
- }
-
- public ISchema getSchema() {
- return this;
- }
-
- public ISchemaDescriptor getSchemaDescriptor() {
- return fSchemaDescriptor;
- }
-
- public URL getURL() {
- return fURL;
- }
-
- public boolean isDisposed() {
- return fDisposed;
- }
-
- public boolean isEditable() {
- return false;
- }
-
- public boolean isLoaded() {
- return fLoaded;
- }
-
- public boolean isNotificationEnabled() {
- return fNotificationEnabled;
- }
-
- public void load() {
- InputStream input = null;
- try {
- input = getURL().openStream();
- load(input);
- } catch (FileNotFoundException e) {
- fLoaded = false;
- } catch (IOException e) {
- PDECore.logException(e);
- } finally {
- try {
- if (input != null)
- input.close();
- } catch (IOException e1) {
- }
- }
- }
-
- public void load(InputStream stream) {
- try {
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- XMLDefaultHandler handler = new XMLDefaultHandler();
- parser.parse(stream, handler);
- traverseDocumentTree(handler.getDocumentElement());
- } catch (SAXException e) {
- // ignore parse errors - 'loaded' will be false anyway
- } catch (Exception e) {
- PDECore.logException(e);
- }
- }
-
- private ISchemaAttribute processAttribute(ISchemaElement element,
- Node elementNode) {
- String aname = getAttribute(elementNode, "name"); //$NON-NLS-1$
- String atype = getAttribute(elementNode, "type"); //$NON-NLS-1$
- String ause = getAttribute(elementNode, "use"); //$NON-NLS-1$
- String avalue = getAttribute(elementNode, "value"); //$NON-NLS-1$
- ISchemaSimpleType type = null;
- if (atype != null) {
- type = (ISchemaSimpleType) resolveTypeReference(atype);
- }
- SchemaAttribute attribute = new SchemaAttribute(element, aname);
- //attribute.bindSourceLocation(elementNode, lineTable);
- if (ause != null) {
- int use = ISchemaAttribute.OPTIONAL;
- if (ause.equals("required")) //$NON-NLS-1$
- use = ISchemaAttribute.REQUIRED;
- else if (ause.equals("optional")) //$NON-NLS-1$
- use = ISchemaAttribute.OPTIONAL;
- else if (ause.equals("default")) //$NON-NLS-1$
- use = ISchemaAttribute.DEFAULT;
- attribute.setUse(use);
- }
- if (avalue != null)
- attribute.setValue(avalue);
- NodeList children = elementNode.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String tag = child.getNodeName();
- if (tag.equals("annotation")) { //$NON-NLS-1$
- processAttributeAnnotation(attribute, child);
- } else if (tag.equals("simpleType")) { //$NON-NLS-1$
- processAttributeSimpleType(attribute, child);
- }
- }
- }
- if (type != null && attribute.getType() == null)
- attribute.setType(type);
- return attribute;
- }
-
- private void processAttributeAnnotation(SchemaAttribute element, Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("documentation")) { //$NON-NLS-1$
- element.setDescription(getNormalizedText(child
- .getFirstChild().getNodeValue()));
- } else if (child.getNodeName().equals("appInfo")) { //$NON-NLS-1$
- NodeList infos = child.getChildNodes();
- for (int j = 0; j < infos.getLength(); j++) {
- Node meta = infos.item(j);
- if (meta.getNodeType() == Node.ELEMENT_NODE) {
- if (meta.getNodeName().equals("meta.attribute")) { //$NON-NLS-1$
- element.setKind(processKind(getAttribute(meta,
- "kind"))); //$NON-NLS-1$
- element.setBasedOn(
- getAttribute(meta,"basedOn")); //$NON-NLS-1$
- element.setTranslatableProperty(
- processTranslatable(getAttribute(
- meta, "translatable"))); //$NON-NLS-1$
- element.setDeprecatedProperty(
- processDeprecated(getAttribute(
- meta, "deprecated"))); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
- }
-
- private boolean processTranslatable(String value) {
- return (value != null && "true".equals(value)); //$NON-NLS-1$
- }
-
- private boolean processDeprecated(String value) {
- return value != null && "true".equals(value); //$NON-NLS-1$
- }
-
- private SchemaSimpleType processAttributeRestriction(
- SchemaAttribute attribute, Node node) {
- NodeList children = node.getChildNodes();
- if (children.getLength() == 0)
- return null;
- String baseName = getAttribute(node, "base"); //$NON-NLS-1$
- if (baseName.equals("string") == false) { //$NON-NLS-1$
- return new SchemaSimpleType(attribute.getSchema(), "string"); //$NON-NLS-1$
- }
- SchemaSimpleType type = new SchemaSimpleType(attribute.getSchema(),
- baseName);
- Vector items = new Vector();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("enumeration")) { //$NON-NLS-1$
- ISchemaEnumeration enumeration = processEnumeration(
- attribute.getSchema(), child);
- if (enumeration != null)
- items.addElement(enumeration);
- }
- }
- }
- ChoiceRestriction restriction = new ChoiceRestriction(attribute
- .getSchema());
- restriction.setChildren(items);
- type.setRestriction(restriction);
- return type;
- }
-
- private void processAttributeSimpleType(SchemaAttribute attribute, Node node) {
- NodeList children = node.getChildNodes();
- if (children.getLength() == 0)
- return;
- SchemaSimpleType type = null;
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("restriction")) { //$NON-NLS-1$
- type = processAttributeRestriction(attribute, child);
- }
- }
- }
- if (type != null)
- attribute.setType(type);
- }
-
- private SchemaComplexType processComplexType(ISchemaElement owner,
- Node typeNode) {
- String aname = getAttribute(typeNode, "name"); //$NON-NLS-1$
- String amixed = getAttribute(typeNode, "mixed"); //$NON-NLS-1$
- SchemaComplexType complexType = new SchemaComplexType(this, aname);
- if (amixed != null && amixed.equals("true")) //$NON-NLS-1$
- complexType.setMixed(true);
- NodeList children = typeNode.getChildNodes();
- ISchemaCompositor compositor = null;
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("attribute")) { //$NON-NLS-1$
- complexType.addAttribute(processAttribute(owner, child));
- } else {
- ISchemaObject object = processCompositorChild(owner, child,
- ISchemaCompositor.ROOT);
- if (object instanceof ISchemaCompositor
- && compositor == null) {
- compositor = (ISchemaCompositor) object;
- }
- }
- }
- }
- complexType.setCompositor(compositor);
- return complexType;
- }
-
- private ISchemaCompositor processCompositor(ISchemaObject parent,
- Node node, int type) {
- SchemaCompositor compositor = new SchemaCompositor(parent, type);
- NodeList children = node.getChildNodes();
- int minOccurs = 1;
- int maxOccurs = 1;
- String aminOccurs = getAttribute(node, "minOccurs"); //$NON-NLS-1$
- String amaxOccurs = getAttribute(node, "maxOccurs"); //$NON-NLS-1$
- if (aminOccurs != null)
- minOccurs = Integer.valueOf(aminOccurs).intValue();
- if (amaxOccurs != null) {
- if (amaxOccurs.equals("unbounded")) //$NON-NLS-1$
- maxOccurs = Integer.MAX_VALUE;
- else {
- maxOccurs = Integer.valueOf(amaxOccurs).intValue();
- }
- }
- compositor.setMinOccurs(minOccurs);
- compositor.setMaxOccurs(maxOccurs);
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- ISchemaObject object = processCompositorChild(compositor, child,
- type);
- if (object != null)
- compositor.addChild(object);
- }
- return compositor;
- }
-
- private ISchemaObject processCompositorChild(ISchemaObject parent,
- Node child, int parentKind) {
- String tag = child.getNodeName();
- if (tag.equals("element")) { //$NON-NLS-1$
- return processElement(parent, child);
- }
- // sequence: element | group | choice | sequence
- if (tag.equals("sequence") && parentKind != ISchemaCompositor.ALL) { //$NON-NLS-1$
- return processCompositor(parent, child, ISchemaCompositor.SEQUENCE);
- }
- // choice: element | group | choice | sequence
- if (tag.equals("choice") && parentKind != ISchemaCompositor.ALL) { //$NON-NLS-1$
- return processCompositor(parent, child, ISchemaCompositor.CHOICE);
- }
- // all: element
- if (tag.equals("all") //$NON-NLS-1$
- && (parentKind == ISchemaCompositor.ROOT || parentKind == ISchemaCompositor.GROUP)) {
- return processCompositor(parent, child, ISchemaCompositor.SEQUENCE);
- }
- // group: all | choice | sequence
- if (tag.equals("group") //$NON-NLS-1$
- && (parentKind == ISchemaCompositor.CHOICE || parentKind == ISchemaCompositor.SEQUENCE)) {
- return processCompositor(parent, child, ISchemaCompositor.SEQUENCE);
- }
- return null;
- }
-
- private ISchemaElement processElement(ISchemaObject parent, Node elementNode) {
- String aname = getAttribute(elementNode, "name"); //$NON-NLS-1$
- String atype = getAttribute(elementNode, "type"); //$NON-NLS-1$
- String aref = getAttribute(elementNode, "ref"); //$NON-NLS-1$
-
- int minOccurs = 1;
- int maxOccurs = 1;
- String aminOccurs = getAttribute(elementNode, "minOccurs"); //$NON-NLS-1$
- String amaxOccurs = getAttribute(elementNode, "maxOccurs"); //$NON-NLS-1$
- if (aminOccurs != null)
- minOccurs = Integer.valueOf(aminOccurs).intValue();
- if (amaxOccurs != null) {
- if (amaxOccurs.equals("unbounded")) //$NON-NLS-1$
- maxOccurs = Integer.MAX_VALUE;
- else {
- maxOccurs = Integer.valueOf(amaxOccurs).intValue();
- }
- }
- if (aref != null) {
- // Reference!!
- SchemaElementReference reference = new SchemaElementReference(
- (ISchemaCompositor) parent, aref);
- reference.addComments(elementNode);
- reference.setMinOccurs(minOccurs);
- reference.setMaxOccurs(maxOccurs);
- fReferences.addElement(reference);
- //reference.bindSourceLocation(elementNode, lineTable);
- return reference;
- }
- ISchemaType type = null;
- if (atype != null) {
- type = resolveTypeReference(atype);
- }
- SchemaElement element;
- if (aname.equals("extension")) //$NON-NLS-1$
- element = new SchemaRootElement(parent, aname);
- else
- element = new SchemaElement(parent, aname);
- //element.bindSourceLocation(elementNode, lineTable);
- element.setMinOccurs(minOccurs);
- element.setMaxOccurs(maxOccurs);
- NodeList children = elementNode.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String tag = child.getNodeName();
- if (type == null && tag.equals("complexType")) { //$NON-NLS-1$
- type = processComplexType(element, child);
- }
- if (tag.equals("annotation")) { //$NON-NLS-1$
- processElementAnnotation(element, child);
- }
- }
- }
- element.setType(type);
- return element;
- }
-
- private void processElementAnnotation(SchemaElement element, Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("documentation") && !fAbbreviated) { //$NON-NLS-1$
- element.setDescription(getNormalizedText(child
- .getFirstChild().getNodeValue()));
- } else if (child.getNodeName().equals("appInfo")) { //$NON-NLS-1$
- NodeList infos = child.getChildNodes();
- for (int j = 0; j < infos.getLength(); j++) {
- Node meta = infos.item(j);
- if (meta.getNodeType() == Node.ELEMENT_NODE) {
- if (meta.getNodeName().equals("meta.element")) { //$NON-NLS-1$
- element.setLabelProperty(getAttribute(meta,
- "labelAttribute")); //$NON-NLS-1$
- element.setIconProperty(getAttribute(meta,
- "icon")); //$NON-NLS-1$
- if (element.getIconProperty() == null)
- element.setIconProperty(getAttribute(meta,
- "iconName")); //$NON-NLS-1$
- element.setTranslatableProperty(processTranslatable(getAttribute(
- meta, "translatable"))); //$NON-NLS-1$
- element.setDeprecatedProperty(processDeprecated(getAttribute(
- meta, "deprecated"))); //$NON-NLS-1$
- if (element instanceof ISchemaRootElement) {
- String depSug = getAttribute(meta, SchemaRootElement.P_DEP_REPLACEMENT);
- ((ISchemaRootElement)element).setDeprecatedSuggestion(depSug);
- }
- }
- }
- }
- }
- }
- }
- }
-
- private ISchemaEnumeration processEnumeration(ISchema schema, Node node) {
- String name = getAttribute(node, "value"); //$NON-NLS-1$
- return new SchemaEnumeration(schema, name);
- }
-
- private int processKind(String name) {
- if (name != null) {
- if (name.equals("java")) //$NON-NLS-1$
- return SchemaAttribute.JAVA;
- if (name.equals("resource")) //$NON-NLS-1$
- return SchemaAttribute.RESOURCE;
- }
- return SchemaAttribute.STRING;
- }
-
- private void processSchemaAnnotation(Node node) {
- NodeList children = node.getChildNodes();
- String section = "overview"; //$NON-NLS-1$
- String sectionName = "Overview"; //$NON-NLS-1$
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("documentation") && !fAbbreviated) { //$NON-NLS-1$
- String text = getNormalizedText(child.getFirstChild()
- .getNodeValue());
- if (section != null) {
- if (section.equals("overview")) { //$NON-NLS-1$
- setDescription(text);
- } else {
- DocumentSection sec = new DocumentSection(this,
- section, sectionName);
- sec.setDescription(text);
- fDocSections.addElement(sec);
- }
- }
- } else if (child.getNodeName().equals("appInfo")) { //$NON-NLS-1$
- NodeList infos = child.getChildNodes();
- for (int j = 0; j < infos.getLength(); j++) {
- Node meta = infos.item(j);
- if (meta.getNodeType() == Node.ELEMENT_NODE) {
- if (meta.getNodeName().equals("meta.schema")) { //$NON-NLS-1$
- section = "overview"; //$NON-NLS-1$
- setName(getAttribute(meta, "name")); //$NON-NLS-1$
- fPluginID = getAttribute(meta, "plugin"); //$NON-NLS-1$
- fPointID = getAttribute(meta, "id"); //$NON-NLS-1$
- fValid = true;
- } else if (meta.getNodeName()
- .equals("meta.section")) { //$NON-NLS-1$
- section = getAttribute(meta, "type"); //$NON-NLS-1$
- sectionName = getAttribute(meta, "name"); //$NON-NLS-1$
- if (sectionName == null)
- sectionName = section;
- }
- }
- }
- }
- }
- }
- }
-
- private void processInclude(Node node) {
- String location = getAttribute(node, "schemaLocation"); //$NON-NLS-1$
- SchemaInclude include = new SchemaInclude(this, location, fAbbreviated);
- if (fIncludes == null)
- fIncludes = new Vector();
- fIncludes.add(include);
- }
-
- public void reload() {
- reload(null);
- }
-
- public void reload(InputStream is) {
- setNotificationEnabled(false);
- reset();
- if (is != null)
- load(is);
- else
- load();
- setNotificationEnabled(true);
- if (isLoaded())
- fireModelChanged(new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED, new Object[0], null));
- }
-
- public void removeDocumentSection(IDocumentSection docSection) {
- fDocSections.removeElement(docSection);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.REMOVE,
- new Object[] { docSection }, null));
- }
-
- public void moveElementToSibling(ISchemaElement element, ISchemaObject sibling) {
- if (!isLoaded())
- load();
- int index = fElements.indexOf(element);
- int newIndex;
- if (sibling != null && fElements.contains(sibling))
- newIndex = fElements.indexOf(sibling);
- else
- newIndex = fElements.size() - 1;
-
- if (index > newIndex) {
- for (int i = index; i > newIndex; i--) {
- fElements.set(i, fElements.elementAt(i - 1));
- }
- } else if (index < newIndex) {
- for (int i = index; i < newIndex; i++) {
- fElements.set(i, fElements.elementAt(i + 1));
- }
- } else // don't need to move
- return;
- fElements.set(newIndex, element);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.CHANGE,
- new Object[] { this }, null));
- }
-
- public void removeElement(ISchemaElement element) {
- fElements.removeElement(element);
- fireModelChanged(new ModelChangedEvent(this, ModelChangedEvent.REMOVE,
- new Object[] { element }, null));
- }
-
- public void removeModelChangedListener(IModelChangedListener listener) {
- fListeners.removeElement(listener);
- }
-
- private void reset() {
- fElements = new Vector();
- fDocSections = new Vector();
- fIncludes = null;
- fPointID = null;
- fPluginID = null;
- fReferences = null;
- fDescription = null;
- fName = null;
- fValid = false;
- fLoaded = false;
- }
-
- private void resolveElementReference(ISchemaObjectReference reference) {
- ISchemaElement[] elementList = getResolvedElements();
- for (int i = 0; i < elementList.length; i++) {
- ISchemaElement element = elementList[i];
- if (!(element instanceof ISchemaObjectReference)
- && element.getName().equals(reference.getName())) {
- // Link
- reference.setReferencedObject(element);
- break;
- }
- }
- }
-
- private void resolveReference(ISchemaObjectReference reference) {
- Class clazz = reference.getReferencedObjectClass();
- if (clazz.equals(ISchemaElement.class)) {
- resolveElementReference(reference);
- }
- }
-
- private void resolveReferences(Vector references) {
- for (int i = 0; i < references.size(); i++) {
- ISchemaObjectReference reference = (ISchemaObjectReference) references
- .elementAt(i);
- resolveReference(reference);
- }
- }
-
- private SchemaType resolveTypeReference(String typeName) {
- // for now, create a simple type
- return new SchemaSimpleType(this, typeName);
- }
-
- public void setDescription(String newDescription) {
- String oldValue = fDescription;
- fDescription = newDescription;
- fireModelObjectChanged(this, P_DESCRIPTION, oldValue, fDescription);
- }
-
- public void setName(String newName) {
- if (newName == null)
- newName = ""; //$NON-NLS-1$
- String oldValue = fName;
- fName = newName;
- fireModelObjectChanged(this, P_NAME, oldValue, fName);
- }
-
- public void setPluginId(String newId) {
- String oldValue = fPluginID;
- fPluginID = newId;
- fireModelObjectChanged(this, P_PLUGIN, oldValue, newId);
- }
-
- public void setPointId(String newId) {
- String oldValue = fPointID;
- fPointID = newId;
- fireModelObjectChanged(this, P_POINT, oldValue, newId);
- }
-
- public void setNotificationEnabled(boolean newNotificationEnabled) {
- fNotificationEnabled = newNotificationEnabled;
- }
-
- public String toString() {
- return fName;
- }
-
- public void traverseDocumentTree(Node root) {
- NodeList children = root.getChildNodes();
- fReferences = new Vector();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName().toLowerCase(Locale.ENGLISH);
- if (nodeName.equals("element")) { //$NON-NLS-1$
- ISchemaElement element = processElement(this, child);
- fElements.addElement(element);
- } else if (nodeName.equals("annotation")) { //$NON-NLS-1$
- processSchemaAnnotation(child);
- } else if (nodeName.equals("include")) { //$NON-NLS-1$
- processInclude(child);
- }
- }
- }
- fLoaded = true;
- if (fReferences.size() > 0)
- resolveReferences(fReferences);
- fReferences = null;
- }
-
- public void updateReferencesFor(ISchemaElement element) {
- updateReferencesFor(element, ISchema.REFRESH_RENAME);
- }
-
- public void updateReferencesFor(ISchemaElement element, int kind) {
- for (int i = 0; i < fElements.size(); i++) {
- ISchemaElement el = (ISchemaElement) fElements.elementAt(i);
- if (el.equals(element))
- continue;
- ISchemaType type = el.getType();
- if (type instanceof ISchemaComplexType) {
- SchemaCompositor compositor = (SchemaCompositor) ((ISchemaComplexType) type)
- .getCompositor();
- if (compositor != null)
- compositor.updateReferencesFor(element, kind);
- }
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- String pointId = getQualifiedPointId();
- int loc = pointId.lastIndexOf('.');
- String pluginId = ""; //$NON-NLS-1$
- if (loc != -1) {
- pluginId = pointId.substring(0, loc);
- pointId = pointId.substring(loc + 1);
- }
- writer.println("<?xml version='1.0' encoding='UTF-8'?>"); //$NON-NLS-1$
- writer.println("<!-- Schema file written by PDE -->"); //$NON-NLS-1$
- writer.println("<schema targetNamespace=\"" + pluginId + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
- String indent2 = INDENT + INDENT;
- String indent3 = indent2 + INDENT;
- writer.println(indent + "<annotation>"); //$NON-NLS-1$
- writer.println(indent2 + "<appInfo>"); //$NON-NLS-1$
- writer.print(indent3 + "<meta.schema plugin=\"" + pluginId + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.print(" id=\"" + pointId + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println(" name=\"" + getName() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println(indent2 + "</appInfo>"); //$NON-NLS-1$
- writer.println(indent2 + "<documentation>"); //$NON-NLS-1$
- writer.println(indent3
- + getWritableDescription());
- writer.println(indent2 + "</documentation>"); //$NON-NLS-1$
- writer.println(INDENT + "</annotation>"); //$NON-NLS-1$
- writer.println();
- // add includes, if defined
- if (fIncludes != null) {
- for (int i = 0; i < fIncludes.size(); i++) {
- ISchemaInclude include = (ISchemaInclude) fIncludes.get(i);
- include.write(INDENT, writer);
- writer.println();
- }
- }
- // add elements
- for (int i = 0; i < fElements.size(); i++) {
- ISchemaElement element = (ISchemaElement) fElements.elementAt(i);
- element.write(INDENT, writer);
- writer.println();
- }
- // add document sections
- for (int i = 0; i < fDocSections.size(); i++) {
- IDocumentSection section = (IDocumentSection) fDocSections.elementAt(i);
- section.write(INDENT, writer);
- writer.println();
- }
- writer.println("</schema>"); //$NON-NLS-1$
- }
-
- private String getWritableDescription() {
- String lineDelimiter = System.getProperty("line.separator"); //$NON-NLS-1$
- String description = CoreUtility.getWritableString(getDescription());
- String platformDescription = description.replaceAll(
- "\\r\\n|\\r|\\n", lineDelimiter); //$NON-NLS-1$
-
- return platformDescription;
- }
-
- public boolean isDeperecated() {
- Iterator it = fElements.iterator();
- while (it.hasNext()) {
- Object next = it.next();
- if (next instanceof SchemaRootElement)
- return ((SchemaRootElement)next).isDeprecated();
- }
- return false;
- }
-
- public String getDeprecatedSuggestion() {
- Iterator it = fElements.iterator();
- while (it.hasNext()) {
- Object next = it.next();
- if (next instanceof SchemaRootElement)
- return ((SchemaRootElement)next).getDeprecatedSuggestion();
- }
- return null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaAttribute.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaAttribute.java
deleted file mode 100644
index 6bc8410..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaAttribute.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaSimpleType;
-
-public class SchemaAttribute extends SchemaObject implements ISchemaAttribute {
-
- private static final long serialVersionUID = 1L;
-
- private int kind = STRING;
-
- private int use = OPTIONAL;
-
- private String valueFilter;
-
- private ISchemaSimpleType type;
-
- private String basedOn;
-
- private Object value;
-
- public static final String P_USE = "useProperty"; //$NON-NLS-1$
-
- public static final String P_VALUE_FILTER = "valueFilterProperty"; //$NON-NLS-1$
-
- public static final String P_VALUE = "value"; //$NON-NLS-1$
-
- public static final String P_KIND = "kindProperty"; //$NON-NLS-1$
-
- public static final String P_TYPE = "typeProperty"; //$NON-NLS-1$
-
- public static final String P_BASED_ON = "basedOnProperty"; //$NON-NLS-1$
-
- private boolean fTranslatable;
-
- private boolean fDeprecated;
-
- public SchemaAttribute(ISchemaAttribute att, String newName) {
- super(att.getParent(), newName);
- kind = att.getKind();
- use = att.getUse();
- value = att.getValue();
- type = new SchemaSimpleType(att.getType());
- basedOn = att.getBasedOn();
- }
-
- public SchemaAttribute(ISchemaObject parent, String name) {
- super(parent, name);
- }
-
- public String getBasedOn() {
- return getKind() == JAVA ? basedOn : null;
- }
-
- public int getKind() {
- return kind;
- }
-
- public ISchemaSimpleType getType() {
- return type;
- }
-
- public int getUse() {
- return use;
- }
-
- public Object getValue() {
- return value;
- }
-
- public String getValueFilter() {
- return valueFilter;
- }
-
- public void setBasedOn(String newBasedOn) {
- String oldValue = basedOn;
- basedOn = newBasedOn;
- getSchema().fireModelObjectChanged(this, P_BASED_ON, oldValue, basedOn);
- }
-
- public void setKind(int newKind) {
- Integer oldValue = new Integer(kind);
- kind = newKind;
- getSchema().fireModelObjectChanged(this, P_KIND, oldValue,
- new Integer(kind));
- }
-
- public void setTranslatableProperty(boolean translatable) {
- boolean oldValue = fTranslatable;
- fTranslatable = translatable;
- getSchema().fireModelObjectChanged(this, P_TRANSLATABLE,
- Boolean.valueOf(oldValue), Boolean.valueOf(translatable));
- }
-
- public void setDeprecatedProperty(boolean deprecated) {
- boolean oldValue = fDeprecated;
- fDeprecated = deprecated;
- getSchema().fireModelObjectChanged(this, P_DEPRECATED,
- Boolean.valueOf(oldValue), Boolean.valueOf(deprecated));
- }
-
- public void setType(ISchemaSimpleType newType) {
- Object oldValue = type;
- type = newType;
- getSchema().fireModelObjectChanged(this, P_TYPE, oldValue, type);
- }
-
- public void setParent(ISchemaObject obj) {
- super.setParent(obj);
- if (type != null)
- type.setSchema(getSchema());
- }
-
- public void setUse(int newUse) {
- Integer oldValue = new Integer(use);
- use = newUse;
- getSchema().fireModelObjectChanged(this, P_USE, oldValue,
- new Integer(use));
- }
-
- public void setValue(String value) {
- String oldValue = (String) this.value;
- this.value = value;
- getSchema().fireModelObjectChanged(this, P_VALUE, oldValue, value);
- }
-
- public void setValueFilter(String valueFilter) {
- String oldValue = this.valueFilter;
- this.valueFilter = valueFilter;
- getSchema().fireModelObjectChanged(this, P_VALUE_FILTER, oldValue,
- valueFilter);
- }
-
- public void write(String indent, PrintWriter writer) {
- boolean annotation = false;
- ISchemaSimpleType type = getType();
- String typeName = type.getName();
- writer.print(indent);
- writer.print("<attribute name=\"" + getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (type.getRestriction() == null)
- writer.print(" type=\"" + typeName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- String useString = null;
- switch (getUse()) {
- case OPTIONAL:
- // don't write default setting
- // useString="optional";
- break;
- case DEFAULT:
- useString = "default"; //$NON-NLS-1$
- break;
- case REQUIRED:
- useString = "required"; //$NON-NLS-1$
- break;
- }
- if (useString != null) {
- writer.print(" use=\"" + useString + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (value != null && getUse() == DEFAULT) {
- writer.print(" value=\"" + value + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String documentation = getWritableDescription();
- if (documentation != null || this.getBasedOn() != null
- || getKind() != STRING) {
- // Add annotation
- annotation = true;
- writer.println(">"); //$NON-NLS-1$
- String annIndent = indent + Schema.INDENT;
- String indent2 = annIndent + Schema.INDENT;
- String indent3 = indent2 + Schema.INDENT;
- writer.print(annIndent);
- writer.println("<annotation>"); //$NON-NLS-1$
- if (documentation != null) {
- writer.println(indent2 + "<documentation>"); //$NON-NLS-1$
- writer.println(indent3 + documentation);
- writer.println(indent2 + "</documentation>"); //$NON-NLS-1$
- }
- if (getBasedOn() != null || getKind() != STRING || isDeprecated() || isTranslatable()) {
- writer.println(indent2 + "<appInfo>"); //$NON-NLS-1$
- writer.print(indent3 + "<meta.attribute"); //$NON-NLS-1$
- String kindValue = null;
- switch (getKind()) {
- case JAVA:
- kindValue = "java"; //$NON-NLS-1$
- break;
- case RESOURCE:
- kindValue = "resource"; //$NON-NLS-1$
- break;
- }
- if (kindValue != null)
- writer.print(" kind=\"" + kindValue + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (getBasedOn() != null)
- writer.print(" basedOn=\"" + getBasedOn() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (isTranslatable())
- writer.print(" translatable=\"true\""); //$NON-NLS-1$
- if (isDeprecated())
- writer.print(" deprecated=\"true\""); //$NON-NLS-1$
- writer.println("/>"); //$NON-NLS-1$
- writer.println(indent2 + "</appInfo>"); //$NON-NLS-1$
- }
- writer.println(annIndent + "</annotation>"); //$NON-NLS-1$
- }
- if (type.getRestriction() != null) {
- type.write(indent + Schema.INDENT, writer);
- }
- if (annotation || type.getRestriction() != null) {
- writer.println(indent + "</attribute>"); //$NON-NLS-1$
- } else {
- writer.println("/>"); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ischema.ISchemaAttribute#isTranslatable()
- */
- public boolean isTranslatable() {
- if (getKind() == STRING && fTranslatable)
- return type == null || "string".equals(type.getName()); //$NON-NLS-1$
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ischema.IMetaAttribute#isDeprecated()
- */
- public boolean isDeprecated() {
- return fDeprecated;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaComplexType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaComplexType.java
deleted file mode 100644
index ad018ca..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaComplexType.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaComplexType;
-import org.eclipse.pde.internal.core.ischema.ISchemaCompositor;
-
-public class SchemaComplexType
- extends SchemaType
- implements ISchemaComplexType {
-
- private static final long serialVersionUID = 1L;
- public static final String P_COMPOSITOR = "compositorProperty"; //$NON-NLS-1$
- private boolean mixed;
- private ISchemaCompositor compositor;
- private Vector attributes = new Vector();
-
- public SchemaComplexType(ISchema schema) {
- this(schema, null);
- }
- public SchemaComplexType(ISchema schema, String typeName) {
- super(schema, typeName != null ? typeName : "__anonymous__"); //$NON-NLS-1$
- }
- public void addAttribute(ISchemaAttribute attribute) {
- addAttribute(attribute, null);
- }
- public void addAttribute(
- ISchemaAttribute attribute,
- ISchemaAttribute afterSibling) {
- int index = -1;
- if (afterSibling != null) {
- index = attributes.indexOf(afterSibling);
- }
- if (index != -1)
- attributes.add(index + 1, attribute);
- else
- attributes.addElement(attribute);
- getSchema().fireModelChanged(
- new ModelChangedEvent(getSchema(),
- ModelChangedEvent.INSERT,
- new Object[] { attribute },
- null));
- }
- public void moveAttributeTo(ISchemaAttribute attribute, ISchemaAttribute sibling) {
- int index = attributes.indexOf(attribute);
- int newIndex;
- if (sibling != null && attributes.contains(sibling))
- newIndex = attributes.indexOf(sibling);
- else
- newIndex = attributes.size() - 1;
-
- if (index > newIndex) {
- for (int i = index; i > newIndex; i--) {
- attributes.set(i, attributes.elementAt(i - 1));
- }
- } else if (index < newIndex) {
- for (int i = index; i < newIndex; i++) {
- attributes.set(i, attributes.elementAt(i + 1));
- }
- } else // don't need to move
- return;
- attributes.set(newIndex, attribute);
- getSchema().fireModelChanged(
- new ModelChangedEvent(
- getSchema(),
- ModelChangedEvent.CHANGE,
- new Object[] { attribute.getParent() }, null));
- }
- public ISchemaAttribute getAttribute(String name) {
- for (int i = 0; i < attributes.size(); i++) {
- ISchemaAttribute attribute =
- (ISchemaAttribute) attributes.elementAt(i);
- if (attribute.getName().equals(name))
- return attribute;
- }
- return null;
- }
-
- public int getAttributeCount() {
- return attributes.size();
- }
- public ISchemaAttribute[] getAttributes() {
- ISchemaAttribute[] result = new ISchemaAttribute[attributes.size()];
- attributes.copyInto(result);
- return result;
- }
- public ISchemaCompositor getCompositor() {
- return compositor;
- }
- public boolean isMixed() {
- return mixed;
- }
- public void removeAttribute(ISchemaAttribute attribute) {
- attributes.removeElement(attribute);
- getSchema().fireModelChanged(
- new ModelChangedEvent(getSchema(),
- ModelChangedEvent.REMOVE,
- new Object[] { attribute },
- null));
- }
- public void setCompositor(ISchemaCompositor newCompositor) {
- Object oldValue = compositor;
- compositor = newCompositor;
- getSchema().fireModelObjectChanged(
- this,
- P_COMPOSITOR,
- oldValue,
- compositor);
- }
- public void setMixed(boolean newMixed) {
- mixed = newMixed;
- }
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<complexType>"); //$NON-NLS-1$
- String indent2 = indent + Schema.INDENT;
- SchemaCompositor compositor = (SchemaCompositor) getCompositor();
- if (compositor != null) {
- compositor.write(indent2, writer);
- }
- for (int i = 0; i < attributes.size(); i++) {
- ISchemaAttribute attribute =
- (ISchemaAttribute) attributes.elementAt(i);
- attribute.write(indent2, writer);
- }
- writer.println(indent + "</complexType>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaCompositor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaCompositor.java
deleted file mode 100644
index c9f211a..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaCompositor.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import org.eclipse.pde.core.IWritable;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaCompositor;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-
-public class SchemaCompositor
- extends RepeatableSchemaObject
- implements ISchemaCompositor {
-
- private static final long serialVersionUID = 1L;
-
- public static final String P_KIND = "p_kind"; //$NON-NLS-1$
-
- private int kind;
- private Vector children = new Vector();
-
- public SchemaCompositor(ISchemaObject parent, int kind) {
- super(parent, ""); //$NON-NLS-1$
- this.kind = kind;
- switch (kind) {
- case ALL :
- fName = PDECoreMessages.SchemaCompositor_all;
- break;
- case CHOICE :
- fName = PDECoreMessages.SchemaCompositor_choice;
- break;
- case GROUP :
- fName = PDECoreMessages.SchemaCompositor_group;
- break;
- case SEQUENCE :
- fName = PDECoreMessages.SchemaCompositor_sequence;
- break;
- }
- }
- public SchemaCompositor(ISchemaObject parent, String id, int kind) {
- super(parent, id);
- this.kind = kind;
- }
- public void addChild(ISchemaObject child) {
- children.addElement(child);
- child.setParent(this);
- getSchema().fireModelChanged(
- new ModelChangedEvent(getSchema(),
- ModelChangedEvent.INSERT,
- new Object[] { child },
- null));
- }
-
- public void moveChildToSibling(ISchemaObject element, ISchemaObject sibling) {
- int index = children.indexOf(element);
- int newIndex;
- if (sibling != null && children.contains(sibling))
- newIndex = children.indexOf(sibling);
- else
- newIndex = children.size() - 1;
-
- if (index > newIndex) {
- for (int i = index; i > newIndex; i--) {
- children.set(i, children.elementAt(i - 1));
- }
- } else if (index < newIndex) {
- for (int i = index; i < newIndex; i++) {
- children.set(i, children.elementAt(i + 1));
- }
- } else // don't need to move
- return;
- children.set(newIndex, element);
- getSchema().fireModelChanged(new ModelChangedEvent(
- getSchema(), ModelChangedEvent.CHANGE,
- new Object[] { this }, null));
- }
-
- public void addChild(ISchemaObject newChild, ISchemaObject afterSibling) {
- int index = -1;
- if (afterSibling != null) {
- index = children.indexOf(afterSibling);
- }
- if (index != -1)
- children.add(index + 1, newChild);
- else
- children.addElement(newChild);
- getSchema().fireModelChanged(new ModelChangedEvent(
- getSchema(), ModelChangedEvent.INSERT,
- new Object[] { newChild }, null));
- }
-
- public int getChildCount() {
- return children.size();
- }
- public ISchemaObject[] getChildren() {
- ISchemaObject[] result = new ISchemaObject[children.size()];
- children.copyInto(result);
- return result;
- }
-
- public void setParent(ISchemaObject parent) {
- super.setParent(parent);
- for (int i = 0; i < children.size(); i++) {
- ISchemaObject child = (ISchemaObject) children.get(i);
- child.setParent(this);
- }
- }
- public int getKind() {
- return kind;
- }
- public void removeChild(ISchemaObject child) {
- children.removeElement(child);
- getSchema().fireModelChanged(
- new ModelChangedEvent(getSchema(),
- ModelChangedEvent.REMOVE,
- new Object[] { child },
- null));
- }
- public void setKind(int kind) {
- if (this.kind != kind) {
- Integer oldValue = new Integer(this.kind);
- this.kind = kind;
- switch (kind) {
- case ALL :
- fName = PDECoreMessages.SchemaCompositor_all;
- break;
- case CHOICE :
- fName = PDECoreMessages.SchemaCompositor_choice;
- break;
- case GROUP :
- fName = PDECoreMessages.SchemaCompositor_group;
- break;
- case SEQUENCE :
- fName = PDECoreMessages.SchemaCompositor_sequence;
- break;
- }
- getSchema().fireModelObjectChanged(
- this,
- P_KIND,
- oldValue,
- new Integer(kind));
- }
- }
- public void updateReferencesFor(ISchemaElement element, int kind) {
- for (int i = children.size() - 1; i >= 0; i--) {
- Object child = children.elementAt(i);
- if (child instanceof SchemaElementReference) {
- SchemaElementReference ref = (SchemaElementReference) child;
- String refName = ref.getReferenceName();
- switch (kind) {
- case ISchema.REFRESH_ADD :
- if (element.getName().equals(refName)) {
- ref.setReferencedObject(element);
- getSchema().fireModelObjectChanged(ref, null, null, null);
- }
- break;
- case ISchema.REFRESH_DELETE :
- if (element.getName().equals(refName)) {
- removeChild(ref);
- getSchema().fireModelObjectChanged(this, null, ref, null);
- }
- break;
- case ISchema.REFRESH_RENAME :
- // Using the object comparison, try to
- // resolve and set the name if there is
- // a match. This is done to repair the
- // reference when the referenced object's
- // name changes.
- if (ref.getReferencedElement() == element)
- ref.setReferenceName(element.getName());
- // Also handle the case where rename
- // will satisfy a previously broken
- // reference.
- else if (element.getName().equals(refName)) {
- ref.setReferencedObject(element);
- getSchema().fireModelObjectChanged(ref, null, null, null);
- }
- break;
- }
- } else {
- SchemaCompositor compositor = (SchemaCompositor) child;
- compositor.updateReferencesFor(element, kind);
- }
- }
- }
- public void write(String indent, PrintWriter writer) {
- String tag = null;
-
- switch (kind) {
- case CHOICE :
- tag = "choice"; //$NON-NLS-1$
- break;
- case ALL :
- case GROUP :
- case SEQUENCE :
- tag = "sequence"; //$NON-NLS-1$
- break;
- }
- if (tag == null)
- return;
- writer.print(indent + "<" + tag); //$NON-NLS-1$
- if (getMinOccurs() != 1 && getMaxOccurs() != 1) {
- String min = "" + getMinOccurs(); //$NON-NLS-1$
- String max =
- getMaxOccurs() == Integer.MAX_VALUE
- ? "unbounded" //$NON-NLS-1$
- : ("" + getMaxOccurs()); //$NON-NLS-1$
- writer.print(
- " minOccurs=\"" + min + "\" maxOccurs=\"" + max + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- writer.println(">"); //$NON-NLS-1$
- String indent2 = indent + Schema.INDENT;
- for (int i = 0; i < children.size(); i++) {
- Object obj = children.elementAt(i);
- if (obj instanceof IWritable) {
- ((IWritable) obj).write(indent2, writer);
- }
- }
- writer.println(indent + "</" + tag + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaDescriptor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaDescriptor.java
deleted file mode 100644
index 436f4e8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaDescriptor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-
-
-public class SchemaDescriptor implements ISchemaDescriptor {
-
- private String fPoint;
- private URL fSchemaURL;
- private Schema fSchema;
- private long fLastModified;
- private boolean fEditable;
-
- public SchemaDescriptor(String extPointID, URL schemaURL) {
- fPoint = extPointID;
- fSchemaURL = schemaURL;
- if (fSchemaURL != null) {
- File file = new File(fSchemaURL.getFile());
- if (file.exists())
- fLastModified = file.lastModified();
- }
- }
-
- public SchemaDescriptor(IFile file, boolean editable) {
- this(new File(file.getLocation().toOSString()));
- fEditable = editable;
- }
-
- public SchemaDescriptor(File file) {
- try {
- if (file.exists()) {
- fSchemaURL = file.toURL();
- fLastModified = file.lastModified();
- }
- } catch (MalformedURLException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getPointId()
- */
- public String getPointId() {
- if (fPoint != null)
- return fPoint;
- return (fSchema == null) ? null : fSchema.getQualifiedPointId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getSchema(boolean)
- */
- public ISchema getSchema(boolean abbreviated) {
- if (fSchema == null && fSchemaURL != null) {
- if (fEditable)
- fSchema = new EditableSchema(this, fSchemaURL, abbreviated);
- else
- fSchema = new Schema(this, fSchemaURL, abbreviated);
- fSchema.load();
- }
- return fSchema;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getSchemaURL()
- */
- public URL getSchemaURL() {
- return fSchemaURL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#isStandalone()
- */
- public boolean isStandalone() {
- return true;
- }
-
- public long getLastModified() {
- return fLastModified;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElement.java
deleted file mode 100644
index a8eafcb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElement.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaComplexType;
-import org.eclipse.pde.internal.core.ischema.ISchemaCompositor;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaRepeatable;
-import org.eclipse.pde.internal.core.ischema.ISchemaType;
-
-public class SchemaElement extends RepeatableSchemaObject implements
- ISchemaElement {
-
- private static final long serialVersionUID = 1L;
-
- public static final String P_ICON_NAME = "iconName"; //$NON-NLS-1$
-
- public static final String P_LABEL_PROPERTY = "labelProperty"; //$NON-NLS-1$
-
- public static final String P_TYPE = "type"; //$NON-NLS-1$
-
- private String labelProperty;
-
- private ISchemaType type;
-
- private String iconName;
-
- private boolean fTranslatable;
-
- private boolean fDeprecated;
-
- public SchemaElement(ISchemaObject parent, String name) {
- super(parent, name);
- }
-
- private String calculateChildRepresentation(ISchemaObject object,
- boolean addLinks) {
- String child = ""; //$NON-NLS-1$
- if (object instanceof ISchemaCompositor) {
- child = calculateCompositorRepresentation(
- (ISchemaCompositor) object, addLinks);
- if (!child.equals("EMPTY") && child.length() > 0) { //$NON-NLS-1$
- child = "(" + child + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- child = object.getName();
- if (addLinks) {
- child = "<a href=\"#e." + child + "\">" + child + "</a>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- int minOccurs = 1;
- int maxOccurs = 1;
- if (object instanceof ISchemaRepeatable) {
- minOccurs = ((ISchemaRepeatable) object).getMinOccurs();
- maxOccurs = ((ISchemaRepeatable) object).getMaxOccurs();
- }
- if (minOccurs == 0) {
- if (maxOccurs == 1)
- child += "?"; //$NON-NLS-1$
- else
- child += "*"; //$NON-NLS-1$
- } else if (minOccurs == 1) {
- if (maxOccurs > 1)
- child += "+"; //$NON-NLS-1$
- }
- return child;
- }
-
- private String calculateCompositorRepresentation(
- ISchemaCompositor compositor, boolean addLinks) {
- int kind = compositor.getKind();
- ISchemaObject[] children = compositor.getChildren();
- if (children.length == 0)
- return "EMPTY"; //$NON-NLS-1$
- String text = kind == ISchemaCompositor.GROUP ? "(" : ""; //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 0; i < children.length; i++) {
- ISchemaObject object = children[i];
- String child = calculateChildRepresentation(object, addLinks);
-
- text += child;
- if (i < children.length - 1) {
- if (kind == ISchemaCompositor.SEQUENCE)
- text += " , "; //$NON-NLS-1$
- else if (kind == ISchemaCompositor.CHOICE)
- text += " | "; //$NON-NLS-1$
- }
- }
- if (kind == ISchemaCompositor.GROUP)
- text += ")"; //$NON-NLS-1$
- return text;
- }
-
- public ISchemaAttribute getAttribute(String name) {
- if (type != null && type instanceof ISchemaComplexType) {
- return ((ISchemaComplexType) type).getAttribute(name);
- }
- return null;
- }
-
- public int getAttributeCount() {
- if (type != null && type instanceof ISchemaComplexType) {
- return ((ISchemaComplexType) type).getAttributeCount();
- }
- return 0;
- }
-
- public ISchemaAttribute[] getAttributes() {
- if (type != null && type instanceof ISchemaComplexType) {
- return ((ISchemaComplexType) type).getAttributes();
- }
- return new ISchemaAttribute[0];
- }
-
- public String getDTDRepresentation(boolean addLinks) {
- String text = ""; //$NON-NLS-1$
- if (type == null)
- text += "EMPTY"; //$NON-NLS-1$
- else {
- if (type instanceof ISchemaComplexType) {
- ISchemaComplexType complexType = (ISchemaComplexType) type;
- ISchemaCompositor compositor = complexType.getCompositor();
- if (compositor != null)
- text += calculateChildRepresentation(compositor, addLinks);
- else
- text += "EMPTY"; //$NON-NLS-1$
-
- } else
- text += "(#PCDATA)"; //$NON-NLS-1$
- }
- if (text.length() > 0) {
- if (!text.equals("EMPTY") && text.charAt(0) != '(') //$NON-NLS-1$
- text = "(" + text + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return text;
- }
-
- public String getIconProperty() {
- return iconName;
- }
-
- public String getLabelProperty() {
- return labelProperty;
- }
-
- public ISchemaType getType() {
- return type;
- }
-
- public void setParent(ISchemaObject parent) {
- super.setParent(parent);
- if (type != null) {
- type.setSchema(getSchema());
- if (type instanceof ISchemaComplexType) {
- ISchemaComplexType ctype = (ISchemaComplexType) type;
- ISchemaCompositor comp = ctype.getCompositor();
- if (comp != null)
- comp.setParent(this);
- }
- }
- if (getAttributeCount() > 0) {
- ISchemaAttribute[] atts = getAttributes();
- for (int i = 0; i < atts.length; i++) {
- ISchemaAttribute att = atts[i];
- att.setParent(this);
- }
- }
- }
-
- public void setIconProperty(String newIconName) {
- String oldValue = iconName;
- iconName = newIconName;
- getSchema().fireModelObjectChanged(this, P_ICON_NAME, oldValue,
- iconName);
- }
-
- public void setTranslatableProperty(boolean translatable) {
- boolean oldValue = fTranslatable;
- fTranslatable = translatable;
- getSchema().fireModelObjectChanged(this, P_TRANSLATABLE,
- Boolean.valueOf(oldValue), Boolean.valueOf(translatable));
- }
-
- public void setDeprecatedProperty(boolean deprecated) {
- boolean oldValue = fDeprecated;
- fDeprecated = deprecated;
- getSchema().fireModelObjectChanged(this, P_DEPRECATED,
- Boolean.valueOf(oldValue), Boolean.valueOf(deprecated));
- }
-
- public void setLabelProperty(String labelProperty) {
- String oldValue = this.labelProperty;
- this.labelProperty = labelProperty;
- getSchema().fireModelObjectChanged(this, P_LABEL_PROPERTY, oldValue,
- labelProperty);
- }
-
- public void setType(ISchemaType newType) {
- Object oldValue = type;
- type = newType;
- getSchema().fireModelObjectChanged(this, P_TYPE, oldValue, type);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<element name=\"" + getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- ISchemaType type = getType();
- if (type instanceof SchemaSimpleType) {
- writer.print(" type=\"" + type.getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- writer.println(">"); //$NON-NLS-1$
- String indent2 = indent + Schema.INDENT;
- String realDescription = getWritableDescription();
- if (realDescription.length() == 0)
- realDescription = null;
- if (realDescription != null || iconName != null
- || labelProperty != null || isDeprecated() || hasTranslatableContent()) {
- String indent3 = indent2 + Schema.INDENT;
- String indent4 = indent3 + Schema.INDENT;
- writer.println(indent2 + "<annotation>"); //$NON-NLS-1$
- if (iconName != null || labelProperty != null || isDeprecated() || hasTranslatableContent()) {
- writer.println(indent3 + "<appInfo>"); //$NON-NLS-1$
- writer.print(indent4 + "<meta.element"); //$NON-NLS-1$
- if (labelProperty != null)
- writer.print(" labelAttribute=\"" + labelProperty + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (iconName != null)
- writer.print(" icon=\"" + iconName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (hasTranslatableContent())
- writer.print(" translatable=\"true\""); //$NON-NLS-1$
- if (isDeprecated())
- writer.print(" deprecated=\"true\""); //$NON-NLS-1$
- String extendedProperties = getExtendedAttributes();
- if (extendedProperties != null)
- writer.print(extendedProperties);
- writer.println("/>"); //$NON-NLS-1$
- writer.println(indent3 + "</appInfo>"); //$NON-NLS-1$
- }
- if (realDescription != null) {
- writer.println(indent3 + "<documentation>"); //$NON-NLS-1$
- if (getDescription() != null)
- writer.println(indent4 + realDescription);
- writer.println(indent3 + "</documentation>"); //$NON-NLS-1$
- }
- writer.println(indent2 + "</annotation>"); //$NON-NLS-1$
- }
-
- if (type instanceof SchemaComplexType) {
- SchemaComplexType complexType = (SchemaComplexType) type;
- complexType.write(indent2, writer);
- }
- writer.println(indent + "</element>"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ischema.IMetaElement#isTranslatable()
- */
- public boolean hasTranslatableContent() {
- return fTranslatable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.IMetaElement#isDeprecated()
- */
- public boolean isDeprecated() {
- return fDeprecated;
- }
-
- public String getExtendedAttributes() {
- return null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElementReference.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElementReference.java
deleted file mode 100644
index 7f98f72..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaElementReference.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.core.ISourceObject;
-import org.eclipse.pde.internal.core.ischema.IMetaElement;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
-import org.eclipse.pde.internal.core.ischema.ISchemaCompositor;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaObjectReference;
-import org.eclipse.pde.internal.core.ischema.ISchemaType;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Node;
-
-public class SchemaElementReference extends PlatformObject implements
- ISchemaElement, IMetaElement, ISchemaObjectReference, ISourceObject,
- Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private ISchemaElement element;
-
- private ISchemaCompositor compositor;
-
- private String referenceName;
-
- public static final String P_MAX_OCCURS = "max_occurs"; //$NON-NLS-1$
-
- public static final String P_MIN_OCCURS = "min_occurs"; //$NON-NLS-1$
-
- public static final String P_REFERENCE_NAME = "reference_name"; //$NON-NLS-1$
-
- private int minOccurs = 1;
-
- private int maxOccurs = 1;
-
- private Vector comments;
-
- private int[] range;
-
- public SchemaElementReference(ISchemaCompositor compositor, String ref) {
- referenceName = ref;
- this.compositor = compositor;
- }
-
- public ISchemaAttribute getAttribute(String name) {
- return getReferencedElement().getAttribute(name);
- }
-
- public int getAttributeCount() {
- return getReferencedElement().getAttributeCount();
- }
-
- public ISchemaAttribute[] getAttributes() {
- return getReferencedElement().getAttributes();
- }
-
- public ISchemaCompositor getCompositor() {
- return compositor;
- }
-
- public java.lang.String getDescription() {
- return getReferencedElement().getDescription();
- }
-
- public String getDTDRepresentation(boolean addLinks) {
- return getReferencedElement().getDTDRepresentation(addLinks);
- }
-
- public java.lang.String getIconProperty() {
- return getReferencedElement().getIconProperty();
- }
-
- public String getLabelProperty() {
- return getReferencedElement().getLabelProperty();
- }
-
- public int getMaxOccurs() {
- return maxOccurs;
- }
-
- public int getMinOccurs() {
- return minOccurs;
- }
-
- public String getName() {
- return referenceName;
- }
-
- public ISchemaObject getParent() {
- return compositor;
- }
-
- public void setParent(ISchemaObject parent) {
- }
-
- public ISchemaElement getReferencedElement() {
- return element;
- }
-
- public ISchemaObject getReferencedObject() {
- return element;
- }
-
- public Class getReferencedObjectClass() {
- return ISchemaElement.class;
- }
-
- public String getReferenceName() {
- return referenceName;
- }
-
- public ISchema getSchema() {
- if (element != null) {
- ISchema schema = element.getSchema();
- if (schema != null) {
- ISchemaDescriptor desc = schema.getSchemaDescriptor();
- if (!(desc instanceof IncludedSchemaDescriptor))
- return schema;
- }
- }
- return getCompositorsSchema();
- }
-
- public ISchema getCompositorsSchema() {
- if (compositor != null)
- return compositor.getSchema();
- return null;
- }
-
- public ISchemaType getType() {
- return getReferencedElement().getType();
- }
-
- public boolean isLinked() {
- return getReferencedObject() != null;
- }
-
- public void setCompositor(ISchemaCompositor newCompositor) {
- compositor = newCompositor;
- }
-
- public void setMaxOccurs(int newMaxOccurs) {
- Integer oldValue = new Integer(maxOccurs);
- maxOccurs = newMaxOccurs;
- ISchema schema = getCompositorsSchema();
- if (schema != null)
- schema.fireModelObjectChanged(this, P_MAX_OCCURS, oldValue,
- new Integer(maxOccurs));
- }
-
- public void setMinOccurs(int newMinOccurs) {
- Integer oldValue = new Integer(minOccurs);
- minOccurs = newMinOccurs;
- ISchema schema = getCompositorsSchema();
- if (schema != null)
- schema.fireModelObjectChanged(this, P_MIN_OCCURS, oldValue,
- new Integer(minOccurs));
- }
-
- public void setReferencedObject(ISchemaObject referencedObject) {
- if (referencedObject instanceof ISchemaElement)
- this.element = (ISchemaElement) referencedObject;
- else
- this.element = null;
- }
-
- public void setReferenceName(String name) {
- String oldValue = this.referenceName;
- this.referenceName = name;
- ISchema schema = getCompositorsSchema();
- if (schema != null)
- schema.fireModelObjectChanged(this, P_REFERENCE_NAME, oldValue,
- name);
- }
-
- public void write(String indent, PrintWriter writer) {
- writeComments(writer);
- writer.print(indent + "<element"); //$NON-NLS-1$
- writer.print(" ref=\"" + getReferenceName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (getMinOccurs() != 1 || getMaxOccurs() != 1) {
- String min = "" + getMinOccurs(); //$NON-NLS-1$
- String max = getMaxOccurs() == Integer.MAX_VALUE ? "unbounded" //$NON-NLS-1$
- : ("" + getMaxOccurs()); //$NON-NLS-1$
- writer
- .print(" minOccurs=\"" + min + "\" maxOccurs=\"" + max + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- writer.println("/>"); //$NON-NLS-1$
- }
-
- public void addComments(Node node) {
- comments = addComments(node, comments);
- }
-
- public Vector addComments(Node node, Vector result) {
- for (Node prev = node.getPreviousSibling(); prev != null; prev = prev
- .getPreviousSibling()) {
- if (prev.getNodeType() == Node.TEXT_NODE)
- continue;
- if (prev instanceof Comment) {
- String comment = prev.getNodeValue();
- if (result == null)
- result = new Vector();
- result.add(comment);
- } else
- break;
- }
- return result;
- }
-
- void writeComments(PrintWriter writer) {
- writeComments(writer, comments);
- }
-
- void writeComments(PrintWriter writer, Vector source) {
- if (source == null)
- return;
- for (int i = 0; i < source.size(); i++) {
- String comment = (String) source.elementAt(i);
- writer.println("<!--" + comment + "-->"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public int getStartLine() {
- return range == null ? -1 : range[0];
- }
-
- public int getStopLine() {
- return range == null ? -1 : range[1];
- }
-
- void bindSourceLocation(Node node, Hashtable lineTable) {
- if (lineTable == null)
- return;
- Integer[] data = (Integer[]) lineTable.get(node);
- if (data != null) {
- range = new int[] { data[0].intValue(), data[1].intValue() };
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.core.ischema.IMetaElement#isTranslatable()
- */
- public boolean hasTranslatableContent() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.IMetaElement#isDeprecated()
- */
- public boolean isDeprecated() {
- return false;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaEnumeration.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaEnumeration.java
deleted file mode 100644
index cef71a2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaEnumeration.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.ischema.ISchemaEnumeration;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-
-public class SchemaEnumeration extends SchemaObject implements ISchemaEnumeration {
-
- private static final long serialVersionUID = 1L;
-
- public SchemaEnumeration(ISchemaObject parent, String name) {
- super(parent, name);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<enumeration value=\"" + getName() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
- String description = getDescription();
- if (description != null)
- description.trim();
- if (description != null && description.length() > 0) {
- String indent2 = indent + Schema.INDENT;
- String indent3 = indent2 + Schema.INDENT;
- writer.println(indent2 + "<annotation>"); //$NON-NLS-1$
- writer.println(indent3 + "<documentation>"); //$NON-NLS-1$
- writer.println(indent3 + description);
- writer.println(indent3 + "</documentation>"); //$NON-NLS-1$
- writer.println(indent2 + "</annotation>"); //$NON-NLS-1$
- }
- writer.println(indent + "</enumeration>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaInclude.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaInclude.java
deleted file mode 100644
index 8205d55..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaInclude.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-import org.eclipse.pde.internal.core.ischema.ISchemaInclude;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-
-public class SchemaInclude extends SchemaObject implements ISchemaInclude {
-
- private static final long serialVersionUID = 1L;
-
- private String fLocation;
-
- private ISchema fIncludedSchema;
-
- private boolean fAbbreviated;
-
- public SchemaInclude(ISchemaObject parent, String location,
- boolean abbreviated) {
- super(parent, location);
- fLocation = location;
- fAbbreviated = abbreviated;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.ischema.ISchemaInclude#getLocation()
- */
- public String getLocation() {
- return fLocation;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.ischema.ISchemaInclude#setLocation(java.lang.String)
- */
- public void setLocation(String location) throws CoreException {
- String oldValue = this.fLocation;
- this.fLocation = location;
- fIncludedSchema = null;
- getSchema()
- .fireModelObjectChanged(this, P_LOCATION, oldValue, location);
- }
-
- /**
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String,
- * java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.println("<include schemaLocation=\"" + fLocation + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public ISchema getIncludedSchema() {
- ISchemaDescriptor descriptor = getSchema().getSchemaDescriptor();
- if (fAbbreviated) {
- SchemaRegistry registry = PDECore.getDefault().getSchemaRegistry();
- fIncludedSchema = registry.getIncludedSchema(descriptor, fLocation);
- } else if (fIncludedSchema == null){
- fIncludedSchema = createInternalSchema(descriptor, fLocation);
- }
- return fIncludedSchema;
- }
-
- private ISchema createInternalSchema(ISchemaDescriptor desc, String location) {
- try {
- URL schemaURL = IncludedSchemaDescriptor.computeURL(desc, location);
- if (schemaURL == null)
- return null;
- Schema ischema = new Schema(null, schemaURL, fAbbreviated);
- ischema.load();
- return ischema;
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public void dispose() {
- if (fIncludedSchema != null && !fIncludedSchema.isDisposed()) {
- fIncludedSchema.dispose();
- fIncludedSchema = null;
- }
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof ISchemaInclude) {
- ISchemaInclude other = (ISchemaInclude)obj;
- if (fLocation != null)
- return fLocation.equals(other.getLocation());
- return other.getLocation() == null;
- }
- return false;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaObject.java
deleted file mode 100644
index d15216f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaObject.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-public abstract class SchemaObject extends PlatformObject implements
- ISchemaObject, Serializable {
- protected String fName;
-
- private String fDescription;
-
- transient private ISchemaObject fParent;
-
- public SchemaObject(ISchemaObject parent, String name) {
- fParent = parent;
- fName = name;
- }
-
- public String getDescription() {
- return fDescription;
- }
-
- public java.lang.String getName() {
- return fName;
- }
-
- public ISchemaObject getParent() {
- return fParent;
- }
-
- public void setParent(ISchemaObject parent) {
- fParent = parent;
- }
-
- public ISchema getSchema() {
- ISchemaObject object = this;
-
- while (object.getParent() != null) {
- object = object.getParent();
- }
- return (ISchema) object;
- }
-
- public String getWritableDescription() {
- String lineDelimiter = System.getProperty("line.separator"); //$NON-NLS-1$
- String description = CoreUtility.getWritableString(getDescription());
- String platformDescription = description.replaceAll(
- "\\r\\n|\\r|\\n", lineDelimiter); //$NON-NLS-1$
-
- return platformDescription;
- }
-
- public void setDescription(String newDescription) {
- String oldValue = fDescription;
- fDescription = newDescription;
- getSchema().fireModelObjectChanged(this, P_DESCRIPTION, oldValue,
- fDescription);
- }
-
- public void setName(String newName) {
- String oldValue = fName;
- fName = newName;
- getSchema().fireModelObjectChanged(this, P_NAME, oldValue, fName);
- }
-
- public String toString() {
- if (fName != null)
- return fName;
- return super.toString();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRegistry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRegistry.java
deleted file mode 100644
index 68838cc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRegistry.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ModelEntry;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.SourceLocationManager;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-
-public class SchemaRegistry {
-
- private HashMap fRegistry = new HashMap();
-
- public ISchema getSchema(String extPointID) {
- IPluginExtensionPoint point = PDECore.getDefault().findExtensionPoint(extPointID);
- if (point == null) {
- // if there is an old schema associated with this extension point, release it.
- if (fRegistry.containsKey(extPointID))
- fRegistry.remove(extPointID);
- return null;
- }
-
- URL url = getSchemaURL(point);
- if (url == null)
- return null;
-
- ISchemaDescriptor desc = getExistingDescriptor(extPointID, url);
- if (desc == null) {
- desc = new SchemaDescriptor(extPointID, url);
- fRegistry.put(extPointID, desc);
- }
-
- return (desc == null) ? null : desc.getSchema(true);
- }
-
- public ISchema getIncludedSchema(ISchemaDescriptor parent, String schemaLocation) {
- try {
- URL url = IncludedSchemaDescriptor.computeURL(parent, schemaLocation);
- if (url == null)
- return null;
-
- ISchemaDescriptor desc = getExistingDescriptor(url.toString(), url);
- if (desc == null) {
- desc = new IncludedSchemaDescriptor(url);
- fRegistry.put(url.toString(), desc);
- }
- return desc.getSchema(true);
- } catch (MalformedURLException e) {
- }
- return null;
- }
-
- private ISchemaDescriptor getExistingDescriptor(String key, URL url) {
- ISchemaDescriptor desc = null;
- if (fRegistry.containsKey(key)) {
- desc = (ISchemaDescriptor)fRegistry.get(key);
- if (hasSchemaChanged(desc, url))
- desc = null;
- }
- return desc;
- }
-
- public static URL getSchemaURL(IPluginExtensionPoint point) {
- String schema = point.getSchema();
- if (schema == null || schema.trim().length() == 0)
- return null;
-
- IPluginModelBase model = point.getPluginModel();
- URL url = getSchemaURL(model.getPluginBase().getId(), schema);
- if (url == null)
- url = getSchemaFromSourceExtension(point.getPluginBase(), new Path(schema));
- return url;
- }
-
- public static URL getSchemaFromSourceExtension(IPluginBase plugin, IPath path) {
- SourceLocationManager mgr = PDECore.getDefault().getSourceLocationManager();
- File file = mgr.findSourceFile(plugin, path);
- try {
- if (file != null && file.exists() && file.isFile())
- return file.toURL();
- } catch (MalformedURLException e) {
- }
- return null;
- }
-
- public static URL getSchemaURL(String pluginID, String schema) {
- if (pluginID == null)
- return null;
-
- URL url = null;
- ModelEntry entry = PDECore.getDefault().getModelManager().findEntry(pluginID);
- if (entry != null) {
- url = getSchemaURL(entry.getWorkspaceModel(), schema);
- if (url == null)
- url = getSchemaURL(entry.getExternalModel(), schema);
- }
- return url;
- }
-
- private static URL getSchemaURL(IPluginModelBase model, String schema) {
- try {
- if (model == null)
- return null;
-
- String location = model.getInstallLocation();
- if (location == null)
- return null;
-
- File file = new File(location);
- if (file.isDirectory()) {
- File schemaFile = new File(file, schema);
- if (schemaFile.exists())
- return schemaFile.toURL();
- } else if (CoreUtility.jarContainsResource(file, schema, false)) { //$NON-NLS-1$
- return new URL("jar:file:" + file.getAbsolutePath() + "!/" + schema); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (MalformedURLException e) {
- }
- return null;
- }
-
- private boolean hasSchemaChanged(ISchemaDescriptor desc, URL url) {
- if (!desc.getSchemaURL().equals(url))
- return true;
- File file = new File(url.getFile());
- return (desc.getLastModified() != file.lastModified());
- }
-
- public void shutdown() {
- fRegistry.clear();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRootElement.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRootElement.java
deleted file mode 100644
index 17b939c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaRootElement.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.pde.internal.core.schema;
-
-import org.eclipse.pde.internal.core.ischema.ISchemaObject;
-import org.eclipse.pde.internal.core.ischema.ISchemaRootElement;
-
-public class SchemaRootElement extends SchemaElement implements
- ISchemaRootElement {
-
- private static final long serialVersionUID = 1L;
- public static final String P_DEP_REPLACEMENT = "replacement"; //$NON-NLS-1$
- private String fDeperecatedReplacement;
-
- public SchemaRootElement(ISchemaObject parent, String name) {
- super(parent, name);
- }
-
- public void setDeprecatedSuggestion(String value) {
- Object oldValue = fDeperecatedReplacement;
- fDeperecatedReplacement = value;
- getSchema().fireModelObjectChanged(this, P_DEP_REPLACEMENT, oldValue, fDeperecatedReplacement);
- }
-
- public String getDeprecatedSuggestion() {
- return fDeperecatedReplacement;
- }
-
- public String getExtendedAttributes() {
- if (fDeperecatedReplacement == null)
- return null;
- return " " + P_DEP_REPLACEMENT + "=\"" + fDeperecatedReplacement + "\" "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaSimpleType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaSimpleType.java
deleted file mode 100644
index 1cd9d0b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaSimpleType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.core.IWritable;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaRestriction;
-import org.eclipse.pde.internal.core.ischema.ISchemaSimpleType;
-
-public class SchemaSimpleType
- extends SchemaType
- implements ISchemaSimpleType, IWritable {
-
- private static final long serialVersionUID = 1L;
- private ISchemaRestriction restriction;
- public static final String P_RESTRICTION = "restriction"; //$NON-NLS-1$
-
- public SchemaSimpleType(ISchema schema, String typeName) {
- super(schema, typeName);
- }
- public SchemaSimpleType(ISchemaSimpleType type) {
- super(type.getSchema(), type.getName());
- ISchemaRestriction rest = type.getRestriction();
- if (rest != null) {
- if (rest instanceof ChoiceRestriction) {
- restriction = new ChoiceRestriction((ChoiceRestriction) rest);
- restriction.setBaseType(this);
- }
- }
- }
- public ISchemaRestriction getRestriction() {
- return restriction;
- }
-
- public void setSchema(ISchema schema) {
- super.setSchema(schema);
- if (restriction != null)
- restriction.setParent(schema);
- }
-
- public void setRestriction(ISchemaRestriction restriction) {
- Object oldValue = this.restriction;
- this.restriction = restriction;
- if (restriction != null)
- restriction.setBaseType(this);
- getSchema().fireModelObjectChanged(
- this,
- P_RESTRICTION,
- oldValue,
- restriction);
- }
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<simpleType>"); //$NON-NLS-1$
- if (restriction != null) {
- restriction.write(indent + Schema.INDENT, writer);
- }
- writer.println(indent + "</simpleType>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaType.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaType.java
deleted file mode 100644
index 44ce0b5..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/SchemaType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.Serializable;
-
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaType;
-
-public abstract class SchemaType implements ISchemaType, Serializable {
- private String name;
- transient private ISchema schema;
-
-public SchemaType(ISchema schema, String typeName) {
- this.schema = schema;
- name = typeName;
-}
-public String getName() {
- return name;
-}
-public ISchema getSchema() {
- return schema;
-}
-
-public void setSchema(ISchema schema) {
- this.schema = schema;
-}
-
-public String toString() {
- return name;
-}
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/StorageSchemaDescriptor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/StorageSchemaDescriptor.java
deleted file mode 100644
index e2baec2..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/schema/StorageSchemaDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.schema;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor;
-
-public class StorageSchemaDescriptor implements ISchemaDescriptor {
- private IStorage fStorage;
- private Schema fSchema;
-
- public StorageSchemaDescriptor(IStorage storage) {
- fStorage = storage;
- }
-
- public URL getSchemaURL() {
- return fSchema != null ? fSchema.getURL() : null;
- }
-
- public String getPointId() {
- return fSchema == null ? null : fSchema.getQualifiedPointId();
- }
-
- protected void loadSchema(boolean abbreviated) {
- fSchema = new Schema(this, null, false);
- try {
- InputStream stream = fStorage.getContents();
- fSchema.load(fStorage.getContents());
- stream.close();
- }
- catch (CoreException e) {
- PDECore.logException(e);
- }
- catch (IOException e) {
- PDECore.logException(e);
- }
- }
-
- public void reload() {
- if (fSchema != null) {
- fSchema.reload();
- }
- }
-
- public boolean isEnabled() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getSchema(boolean)
- */
- public ISchema getSchema(boolean abbreviated) {
- if (fSchema == null)
- loadSchema(abbreviated);
- return fSchema;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#isStandalone()
- */
- public boolean isStandalone() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ischema.ISchemaDescriptor#getLastModified()
- */
- public long getLastModified() {
- return 0;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/IPluginSearchResultCollector.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/IPluginSearchResultCollector.java
deleted file mode 100644
index 70b94d8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/IPluginSearchResultCollector.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.search;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.pde.core.plugin.IPluginObject;
-
-public interface IPluginSearchResultCollector {
-
- void accept(IPluginObject match);
-
- void done();
-
- PluginSearchOperation getOperation();
-
- void searchStarted();
-
- void setOperation(PluginSearchOperation operation);
-
- void setProgressMonitor(IProgressMonitor monitor);
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginJavaSearchUtil.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginJavaSearchUtil.java
deleted file mode 100644
index bd5c5ba..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginJavaSearchUtil.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.search;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ClasspathUtilCore;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDEManager;
-
-public class PluginJavaSearchUtil {
-
- public static IPlugin[] getPluginImports(IPluginImport dep) {
- return getPluginImports(dep.getId());
- }
-
- public static IPlugin[] getPluginImports(String pluginImportID) {
- HashSet set = new HashSet();
- collectAllPrerequisites(PDECore.getDefault().findPlugin(pluginImportID), set);
- return (IPlugin[]) set.toArray(new IPlugin[set.size()]);
- }
-
- public static void collectAllPrerequisites(IPlugin plugin, HashSet set) {
- if (plugin == null || !set.add(plugin))
- return;
- IPluginImport[] imports = plugin.getImports();
- for (int i = 0; i < imports.length; i++) {
- if (imports[i].isReexported()) {
- IPlugin child = PDECore.getDefault().findPlugin(imports[i].getId());
- if (child != null)
- collectAllPrerequisites(child, set);
- }
- }
- }
-
- public static IPackageFragment[] collectPackageFragments(
- IPluginBase[] plugins,
- IJavaProject parentProject,
- boolean filterEmptyPackages)
- throws JavaModelException {
- ArrayList result = new ArrayList();
- IPackageFragmentRoot[] roots = parentProject.getAllPackageFragmentRoots();
-
- for (int i = 0; i < plugins.length; i++) {
- IPluginModelBase model = (IPluginModelBase)plugins[i].getModel();
- IResource resource = model.getUnderlyingResource();
- if (resource == null) {
- ArrayList libraryPaths = new ArrayList();
- addLibraryPaths(model, libraryPaths);
- for (int j = 0; j < roots.length; j++) {
- if (libraryPaths.contains(roots[j].getPath())) {
- extractPackageFragments(roots[j], result, filterEmptyPackages);
- }
- }
- } else {
- IProject project = resource.getProject();
- for (int j = 0; j < roots.length; j++) {
- IJavaProject jProject = (IJavaProject) roots[j].getParent();
- if (jProject.getProject().equals(project)) {
- extractPackageFragments(roots[j], result, filterEmptyPackages);
- }
- }
- }
- }
- return (IPackageFragment[]) result.toArray(new IPackageFragment[result.size()]);
- }
-
- private static void extractPackageFragments(IPackageFragmentRoot root, ArrayList result, boolean filterEmpty) {
- try {
- IJavaElement[] children = root.getChildren();
- for (int i = 0; i < children.length; i++) {
- IPackageFragment fragment = (IPackageFragment) children[i];
- if (!filterEmpty || fragment.hasChildren())
- result.add(fragment);
- }
- } catch (JavaModelException e) {
- }
- }
-
- private static void addLibraryPaths(IPluginModelBase model, ArrayList libraryPaths) {
- IPluginBase plugin = model.getPluginBase();
-
- IFragmentModel[] fragments = new IFragmentModel[0];
- if (plugin instanceof IPlugin)
- fragments = PDEManager.findFragmentsFor(model);
-
- File file = new File(model.getInstallLocation());
- if (file.isFile()) {
- libraryPaths.add(new Path(file.getAbsolutePath()));
- } else {
- IPluginLibrary[] libraries = plugin.getLibraries();
- for (int i = 0; i < libraries.length; i++) {
- String libraryName =
- ClasspathUtilCore.expandLibraryName(libraries[i].getName());
- String path =
- plugin.getModel().getInstallLocation() + Path.SEPARATOR + libraryName;
- if (new File(path).exists()) {
- libraryPaths.add(new Path(path));
- } else {
- findLibraryInFragments(fragments, libraryName, libraryPaths);
- }
- }
- }
- if (plugin instanceof IPlugin && ClasspathUtilCore.hasExtensibleAPI((IPlugin)plugin)) {
- for (int i = 0; i < fragments.length; i++) {
- addLibraryPaths(fragments[i], libraryPaths);
- }
- }
- }
-
- private static void findLibraryInFragments(
- IFragmentModel[] fragments,
- String libraryName,
- ArrayList libraryPaths) {
- for (int i = 0; i < fragments.length; i++) {
- String path =
- fragments[i].getInstallLocation()
- + Path.SEPARATOR
- + libraryName;
- if (new File(path).exists()) {
- libraryPaths.add(new Path(path));
- break;
- }
- }
- }
-
- public static IJavaSearchScope createSeachScope(IJavaProject jProject) throws JavaModelException {
- IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots();
- ArrayList filteredRoots = new ArrayList();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getResource() != null
- && roots[i].getResource().getProject().equals(jProject.getProject())) {
- filteredRoots.add(roots[i]);
- }
- }
- return SearchEngine.createJavaSearchScope(
- (IJavaElement[]) filteredRoots.toArray(
- new IJavaElement[filteredRoots.size()]));
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchInput.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchInput.java
deleted file mode 100644
index bb896a5..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchInput.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.search;
-
-public class PluginSearchInput {
- public static final int ELEMENT_PLUGIN = 1;
- public static final int ELEMENT_FRAGMENT = 2;
- public static final int ELEMENT_EXTENSION_POINT = 3;
-
- public static final int LIMIT_DECLARATIONS = 1;
- public static final int LIMIT_REFERENCES = 2;
- public static final int LIMIT_ALL = 3;
-
- private String searchString = null;
- private boolean caseSensitive = true;
- private int searchElement = 0;
- private int searchLimit = 0;
- private PluginSearchScope searchScope;
-
- public String getSearchString() {
- return searchString;
- }
-
- public boolean isCaseSensitive() {
- return caseSensitive;
- }
-
- public void setCaseSensitive(boolean value) {
- caseSensitive = value;
- }
-
- public void setSearchString(String name) {
- searchString = name;
- }
-
- public int getSearchElement() {
- return searchElement;
- }
-
- public void setSearchElement(int element) {
- searchElement = element;
- }
-
- public int getSearchLimit() {
- return searchLimit;
- }
-
- public void setSearchLimit(int limit) {
- searchLimit = limit;
- }
-
- public PluginSearchScope getSearchScope() {
- return searchScope;
- }
-
- public void setSearchScope(PluginSearchScope scope) {
- searchScope = scope;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchOperation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchOperation.java
deleted file mode 100644
index bc6628f..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchOperation.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.search;
-
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.util.PatternConstructor;
-
-
-public class PluginSearchOperation {
- protected PluginSearchInput fInput;
- private IPluginSearchResultCollector fCollector;
- private Pattern fPattern;
-
- public PluginSearchOperation(
- PluginSearchInput input,
- IPluginSearchResultCollector collector) {
- this.fInput = input;
- this.fCollector = collector;
- collector.setOperation(this);
- this.fPattern = PatternConstructor.createPattern(
- input.getSearchString(), input.isCaseSensitive());
- }
-
- public void execute(IProgressMonitor monitor) {
- IPluginModelBase[] entries = fInput.getSearchScope().getMatchingModels();
- fCollector.searchStarted();
- fCollector.setProgressMonitor(monitor);
- monitor.beginTask("", entries.length); //$NON-NLS-1$
-
- try {
- for (int i = 0; i < entries.length; i++) {
- IPluginModelBase candidate = entries[i];
- visit(candidate);
- monitor.worked(1);
- }
- } finally {
- monitor.done();
- fCollector.done();
- }
- }
-
- private void visit(IPluginModelBase model) {
- ArrayList matches = findMatch(model);
- for (int i = 0; i < matches.size(); i++) {
- fCollector.accept((IPluginObject)matches.get(i));
- }
- }
-
- private ArrayList findMatch(IPluginModelBase model) {
- ArrayList result = new ArrayList();
- int searchLimit = fInput.getSearchLimit();
- switch (fInput.getSearchElement()) {
- case PluginSearchInput.ELEMENT_PLUGIN :
- if (searchLimit != PluginSearchInput.LIMIT_REFERENCES)
- findPluginDeclaration(model, result);
- if (searchLimit != PluginSearchInput.LIMIT_DECLARATIONS)
- findPluginReferences(model, result);
- break;
- case PluginSearchInput.ELEMENT_FRAGMENT :
- findFragmentDeclaration(model, result);
- break;
- case PluginSearchInput.ELEMENT_EXTENSION_POINT :
- if (searchLimit != PluginSearchInput.LIMIT_REFERENCES)
- findExtensionPointDeclarations(model, result);
- if (searchLimit != PluginSearchInput.LIMIT_DECLARATIONS)
- findExtensionPointReferences(model, result);
- break;
- }
- return result;
- }
-
- private void findFragmentDeclaration(
- IPluginModelBase model,
- ArrayList result) {
- IPluginBase pluginBase = model.getPluginBase();
- if (pluginBase instanceof IFragment
- && fPattern.matcher(pluginBase.getId()).matches()) {
- result.add(pluginBase); }
- }
-
- private void findPluginDeclaration(IPluginModelBase model, ArrayList result) {
- IPluginBase pluginBase = model.getPluginBase();
- if (pluginBase instanceof IPlugin
- && fPattern.matcher(pluginBase.getId()).matches())
- result.add(pluginBase);
- }
-
- private void findPluginReferences(
- IPluginModelBase model,
- ArrayList result) {
- IPluginBase pluginBase = model.getPluginBase();
- if (pluginBase instanceof IFragment) {
- if (fPattern.matcher(((IFragment) pluginBase).getPluginId())
- .matches())
- result.add(pluginBase);
- }
- IPluginImport[] imports = pluginBase.getImports();
- for (int i = 0; i < imports.length; i++) {
- if (fPattern.matcher(imports[i].getId()).matches())
- result.add(imports[i]);
- }
- }
-
- private void findExtensionPointDeclarations(
- IPluginModelBase model,
- ArrayList result) {
- IPluginExtensionPoint[] extensionPoints =
- model.getPluginBase().getExtensionPoints();
- for (int i = 0; i < extensionPoints.length; i++) {
- if (fPattern.matcher(extensionPoints[i].getFullId()).matches())
- result.add(extensionPoints[i]);
- }
- }
-
- private void findExtensionPointReferences(IPluginModelBase model, ArrayList result) {
- IPluginExtension[] extensions = model.getPluginBase().getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- if (fPattern.matcher(extensions[i].getPoint()).matches())
- result.add(extensions[i]);
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchScope.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchScope.java
deleted file mode 100644
index 804eddc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/search/PluginSearchScope.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.search;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ModelEntry;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PluginModelManager;
-
-public class PluginSearchScope {
-
- public static final int SCOPE_WORKSPACE = 0;
- public static final int SCOPE_SELECTION = 1;
- public static final int SCOPE_WORKING_SETS = 2;
-
- public static final int EXTERNAL_SCOPE_NONE = 0;
- public static final int EXTERNAL_SCOPE_ENABLED = 1;
- public static final int EXTERNAL_SCOPE_ALL = 2;
-
- private int workspaceScope;
- private int externalScope;
- private HashSet selectedResources;
-
- /**
- * Create a scope object with the provided arguments.
- * @param workspaceScope one of SCOPE_WORKSPACE, SCOPE_SELECTION,
- * SCOPE_WORKING_SETS
- * @param externalScope one of EXTERNAL_SCOPE_NONE, EXTERNAL_SCOPE_ENABLED,
- * EXTERNAL_SCOPE_ALL
- * @param workingSets goes with SCOPE_WORKING_SETS, otherwise null
- */
- public PluginSearchScope(
- int workspaceScope,
- int externalScope,
- HashSet selectedResources) {
- this.workspaceScope = workspaceScope;
- this.externalScope = externalScope;
- this.selectedResources = selectedResources;
- }
-
-
- /**
- * Creates a default scope object that will return all the entries in the
- * PluginSearchScope. It is equivalent to workspace scope being set to
- * 'Workspace' and external scope being set to 'Only Enabled'
- */
- public PluginSearchScope() {
- this(SCOPE_WORKSPACE, EXTERNAL_SCOPE_ENABLED, null);
- }
-
- private void addExternalModel(IPluginModelBase candidate, ArrayList result) {
- if (externalScope == EXTERNAL_SCOPE_ALL)
- result.add(candidate);
- else if (externalScope == EXTERNAL_SCOPE_ENABLED && candidate.isEnabled())
- result.add(candidate);
- }
-
- private void addWorkspaceModel(IPluginModelBase candidate, ArrayList result) {
- if (workspaceScope == SCOPE_WORKSPACE) {
- result.add(candidate);
- } else if (selectedResources.contains(candidate.getUnderlyingResource().getProject())) {
- result.add(candidate);
- }
- }
-
- public IPluginModelBase[] getMatchingModels() {
- ArrayList result = new ArrayList();
- PluginModelManager modelManager =
- PDECore.getDefault().getModelManager();
- ModelEntry[] entries = modelManager.getEntries();
- for (int i = 0; i < entries.length; i++) {
- IPluginModelBase candidate = entries[i].getActiveModel();
- if (candidate.getUnderlyingResource() != null) {
- addWorkspaceModel(candidate, result);
- } else {
- addExternalModel(candidate, result);
- }
- }
- return (IPluginModelBase[]) result.toArray(new IPluginModelBase[result.size()]);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/AbstractSiteModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/AbstractSiteModel.java
deleted file mode 100644
index e6eb106..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/AbstractSiteModel.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.XMLDefaultHandler;
-import org.eclipse.pde.internal.core.isite.ISite;
-import org.eclipse.pde.internal.core.isite.ISiteModel;
-import org.eclipse.pde.internal.core.isite.ISiteModelFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public abstract class AbstractSiteModel
- extends AbstractModel
- implements ISiteModel {
- protected transient Site site;
- private transient ISiteModelFactory factory;
- private boolean enabled = true;
-
- public AbstractSiteModel() {
- super();
- }
- public ISite getSite() {
- if (site == null) {
- Site s = new Site();
- s.model = this;
- this.site = s;
- }
- return site;
- }
- public ISiteModelFactory getFactory() {
- if (factory == null)
- factory = new SiteModelFactory(this);
- return factory;
- }
- public String getInstallLocation() {
- return null;
- }
- public boolean isEditable() {
- return true;
- }
- public boolean isEnabled() {
- return enabled;
- }
- public boolean isValid() {
- if (!isLoaded() || site==null) return false;
- return site.isValid();
- }
- public void load(InputStream stream, boolean outOfSync) throws CoreException {
- try {
- SAXParser parser = getSaxParser();
- XMLDefaultHandler handler = new XMLDefaultHandler();
- parser.parse(stream, handler);
- processDocument(handler.getDocument());
- setLoaded(true);
- if (!outOfSync)
- updateTimeStamp();
- } catch (Exception e) {
- PDECore.logException(e);
- }
- }
-
- private void processDocument(Document doc) {
- Node rootNode = doc.getDocumentElement();
- if (site == null) {
- site = new Site();
- site.model = this;
- } else {
- site.reset();
- }
- site.parse(rootNode);
- }
- public void reload(InputStream stream, boolean outOfSync)
- throws CoreException {
- if (site != null)
- site.reset();
- load(stream, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { site },
- null));
- }
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/ExternalSiteModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/ExternalSiteModel.java
deleted file mode 100644
index 074e8cf..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/ExternalSiteModel.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import org.eclipse.core.runtime.CoreException;
-
-
-public class ExternalSiteModel extends AbstractSiteModel {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#updateTimeStamp()
- */
- protected void updateTimeStamp() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isInSync()
- */
- public boolean isInSync() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.site.AbstractSiteModel#isEditable()
- */
- public boolean isEditable() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load()
- */
- public void load() throws CoreException {
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/IdentifiableObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/IdentifiableObject.java
deleted file mode 100644
index 3920c6c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/IdentifiableObject.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IIdentifiable;
-import org.w3c.dom.Node;
-
-public class IdentifiableObject extends SiteObject implements IIdentifiable {
-
- private static final long serialVersionUID = 1L;
- protected String id;
-
- public String getId() {
- return id;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- id = getNodeAttribute(node, "id"); //$NON-NLS-1$
- }
-
- public boolean isValid() {
- return id!=null;
- }
-
- public void setId(String id) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.id;
- this.id = id;
- firePropertyChanged(this, P_ID, oldValue, id);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException {
- if (name.equals(P_ID)) {
- setId(newValue!=null ? newValue.toString() : null);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- protected void reset() {
- super.reset();
- id = null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/Site.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/Site.java
deleted file mode 100644
index 860c2af..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/Site.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-import java.util.Locale;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.IWritable;
-import org.eclipse.pde.internal.core.isite.ISite;
-import org.eclipse.pde.internal.core.isite.ISiteArchive;
-import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
-import org.eclipse.pde.internal.core.isite.ISiteDescription;
-import org.eclipse.pde.internal.core.isite.ISiteFeature;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Site extends SiteObject implements ISite {
- private static final long serialVersionUID = 1L;
- final static String INDENT = " "; //$NON-NLS-1$
- private Vector features = new Vector();
- private Vector archives = new Vector();
- private Vector categoryDefs = new Vector();
- private String type;
- private String url;
- private String mirrorsUrl;
- private ISiteDescription description;
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#setType(java.lang.String)
- */
- public void setType(String type) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.type;
- this.type = type;
- firePropertyChanged(P_TYPE, oldValue, type);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getType()
- */
- public String getType() {
- return type;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#setURL(java.net.URL)
- */
- public void setURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.url;
- this.url = url;
- firePropertyChanged(P_URL, oldValue, url);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getURL()
- */
- public String getURL() {
- return url;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#setMirrorsURL(String)
- */
- public void setMirrorsURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.mirrorsUrl;
- this.mirrorsUrl = url;
- firePropertyChanged(P_MIRRORS_URL, oldValue, url);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getMirrorsURL()
- */
- public String getMirrorsURL() {
- return mirrorsUrl;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getDescription()
- */
- public ISiteDescription getDescription() {
- return description;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#setDescription(org.eclipse.pde.internal.core.isite.ISiteDescription)
- */
- public void setDescription(ISiteDescription description)
- throws CoreException {
- ensureModelEditable();
- Object oldValue = this.description;
- this.description = description;
- firePropertyChanged(P_DESCRIPTION, oldValue, description);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#addFeatures(org.eclipse.pde.internal.core.isite.ISiteFeature)
- */
- public void addFeatures(ISiteFeature[] newFeatures) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newFeatures.length; i++) {
- ISiteFeature feature = newFeatures[i];
- ((SiteFeature) feature).setInTheModel(true);
- features.add(newFeatures[i]);
- }
- fireStructureChanged(newFeatures, IModelChangedEvent.INSERT);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#addArchives(org.eclipse.pde.internal.core.isite.ISiteArchive)
- */
- public void addArchives(ISiteArchive[] archs) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < archs.length; i++) {
- ISiteArchive archive = archs[i];
- ((SiteArchive) archive).setInTheModel(true);
- archives.add(archs[i]);
- }
- fireStructureChanged(archs, IModelChangedEvent.INSERT);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#addCategoryDefinitions(org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition)
- */
- public void addCategoryDefinitions(ISiteCategoryDefinition[] defs)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < defs.length; i++) {
- ISiteCategoryDefinition def = defs[i];
- ((SiteCategoryDefinition) def).setInTheModel(true);
- categoryDefs.add(defs[i]);
- }
- fireStructureChanged(defs, IModelChangedEvent.INSERT);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#removeFeatures(org.eclipse.pde.internal.core.isite.ISiteFeature)
- */
- public void removeFeatures(ISiteFeature[] newFeatures)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newFeatures.length; i++) {
- ISiteFeature feature = newFeatures[i];
- ((SiteFeature) feature).setInTheModel(false);
- features.remove(newFeatures[i]);
- }
- fireStructureChanged(newFeatures, IModelChangedEvent.REMOVE);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#removeArchives(org.eclipse.pde.internal.core.isite.ISiteArchive)
- */
- public void removeArchives(ISiteArchive[] archs) throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < archs.length; i++) {
- ISiteArchive archive = archs[i];
- ((SiteArchive) archive).setInTheModel(false);
- archives.remove(archs[i]);
- }
- fireStructureChanged(archs, IModelChangedEvent.REMOVE);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#removeCategoryDefinitions(org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition)
- */
- public void removeCategoryDefinitions(ISiteCategoryDefinition[] defs)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < defs.length; i++) {
- ISiteCategoryDefinition def = defs[i];
- ((SiteCategoryDefinition) def).setInTheModel(false);
- categoryDefs.remove(defs[i]);
- }
- fireStructureChanged(defs, IModelChangedEvent.REMOVE);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getFeatures()
- */
- public ISiteFeature[] getFeatures() {
- return (ISiteFeature[]) features.toArray(
- new ISiteFeature[features.size()]);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getArchives()
- */
- public ISiteArchive[] getArchives() {
- return (ISiteArchive[]) archives.toArray(
- new ISiteArchive[archives.size()]);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISite#getCategoryDefinitions()
- */
- public ISiteCategoryDefinition[] getCategoryDefinitions() {
- return (ISiteCategoryDefinition[]) categoryDefs.toArray(
- new ISiteCategoryDefinition[categoryDefs.size()]);
- }
- protected void reset() {
- archives.clear();
- categoryDefs.clear();
- features.clear();
- description = null;
- type = null;
- url = null;
- mirrorsUrl = null;
- }
- protected void parse(Node node) {
- type = getNodeAttribute(node, "type"); //$NON-NLS-1$
- url = getNodeAttribute(node, "url"); //$NON-NLS-1$
- mirrorsUrl = getNodeAttribute(node, "mirrorsURL"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- parseChild(child);
- }
- }
- }
-
- protected void parseChild(Node child) {
- String tag = child.getNodeName().toLowerCase(Locale.ENGLISH);
- if (tag.equals("feature")) { //$NON-NLS-1$
- ISiteFeature feature = getModel().getFactory().createFeature();
- ((SiteFeature) feature).parse(child);
- ((SiteFeature) feature).setInTheModel(true);
- features.add(feature);
- } else if (tag.equals("archive")) { //$NON-NLS-1$
- ISiteArchive archive = getModel().getFactory().createArchive();
- ((SiteArchive) archive).parse(child);
- ((SiteArchive) archive).setInTheModel(true);
- archives.add(archive);
- } else if (tag.equals("category-def")) { //$NON-NLS-1$
- ISiteCategoryDefinition def =
- getModel().getFactory().createCategoryDefinition();
- ((SiteCategoryDefinition) def).parse(child);
- ((SiteCategoryDefinition) def).setInTheModel(true);
- categoryDefs.add(def);
- } else if (tag.equals("description")) { //$NON-NLS-1$
- if (description != null)
- return;
- description = getModel().getFactory().createDescription(this);
- ((SiteDescription) description).parse(child);
- ((SiteDescription) description).setInTheModel(true);
- }
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_TYPE)) {
- setType(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_URL)) {
- setURL(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_MIRRORS_URL)) {
- setMirrorsURL(newValue != null ? newValue.toString() : null);
- } else if (
- name.equals(P_DESCRIPTION)
- && newValue instanceof ISiteDescription) {
- setDescription((ISiteDescription) newValue);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<site"); //$NON-NLS-1$
- String indent2 = indent + INDENT;
- String indenta = indent + INDENT + INDENT;
- writeIfDefined(indenta, writer, "type", getType()); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "url", getURL()); //$NON-NLS-1$
- writeIfDefined(indenta, writer, "mirrorsURL", getMirrorsURL()); //$NON-NLS-1$
- writer.println(">"); //$NON-NLS-1$
-
- if (description != null) {
- description.write(indent2, writer);
- }
- writeChildren(indent2, features, writer);
- writeChildren(indent2, archives, writer);
- writeChildren(indent2, categoryDefs, writer);
- writer.println(indent + "</site>"); //$NON-NLS-1$
- }
-
- public boolean isValid() {
- for (int i=0; i<features.size(); i++) {
- ISiteFeature feature = (ISiteFeature)features.get(i);
- if (!feature.isValid()) return false;
- }
- for (int i=0; i<archives.size(); i++) {
- ISiteArchive archive = (ISiteArchive)archives.get(i);
- if (!archive.isValid()) return false;
- }
- for (int i=0; i<categoryDefs.size(); i++) {
- ISiteCategoryDefinition def = (ISiteCategoryDefinition)categoryDefs.get(i);
- if (!def.isValid()) return false;
- }
- return true;
- }
-
-
-
- private void writeChildren(
- String indent,
- Vector children,
- PrintWriter writer) {
- for (int i = 0; i < children.size(); i++) {
- IWritable writable = (IWritable) children.get(i);
- writable.write(indent, writer);
- }
- }
- private void writeIfDefined(
- String indent,
- PrintWriter writer,
- String attName,
- String attValue) {
- if (attValue == null || attValue.length() <= 0)
- return;
- writer.println();
- writer.print(indent + attName + "=\"" + SiteObject.getWritableString(attValue) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteArchive.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteArchive.java
deleted file mode 100644
index 006d486..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteArchive.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.isite.ISiteArchive;
-import org.w3c.dom.Node;
-
-public class SiteArchive extends SiteObject implements ISiteArchive {
- private static final long serialVersionUID = 1L;
- private String url;
- private String path;
-
- public boolean isValid() {
- return url!=null && path!=null;
- }
-
- public String getURL() {
- return url;
- }
- public void setURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.url;
- this.url = url;
- firePropertyChanged(P_URL, oldValue, url);
- }
- public String getPath() {
- return path;
- }
- public void setPath(String path) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.path;
- this.path = path;
- firePropertyChanged(P_PATH, oldValue, path);
- }
- public void reset() {
- super.reset();
- url = null;
- path = null;
- }
- protected void parse(Node node) {
- super.parse(node);
- path = getNodeAttribute(node, "path"); //$NON-NLS-1$
- url = getNodeAttribute(node, "url"); //$NON-NLS-1$
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<archive"); //$NON-NLS-1$
- if (path != null)
- writer.print(" path=\"" + SiteObject.getWritableString(path) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (url != null)
- writer.print(" url=\"" + SiteObject.getWritableString(url) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println("/>"); //$NON-NLS-1$
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_PATH)) {
- setPath(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_URL)) {
- setURL(newValue != null ? newValue.toString() : null);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategory.java
deleted file mode 100644
index ae55d20..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.isite.ISite;
-import org.eclipse.pde.internal.core.isite.ISiteCategory;
-import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
-import org.w3c.dom.Node;
-
-public class SiteCategory extends SiteObject implements ISiteCategory {
- private static final long serialVersionUID = 1L;
- private String name;
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategory#getName()
- */
- public String getName() {
- return name;
- }
-
- public boolean isValid() {
- return name!=null;
- }
-
- protected void parse(Node node) {
- name = getNodeAttribute(node, "name"); //$NON-NLS-1$
- }
-
- protected void reset() {
- name = null;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategory#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.name;
- this.name = name;
- firePropertyChanged(P_NAME, oldValue, name);
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<category"); //$NON-NLS-1$
- if (name!=null)
- writer.print(" name=\"" + SiteObject.getWritableString(name) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println("/>"); //$NON-NLS-1$
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_NAME)) {
- setName(newValue != null ? newValue.toString() : null);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- public ISiteCategoryDefinition getDefinition() {
- ISite site = getSite();
- ISiteCategoryDefinition [] definitions = site.getCategoryDefinitions();
- for (int i=0; i<definitions.length; i++) {
- ISiteCategoryDefinition def = definitions[i];
- if (def.getName().equals(getName()))
- return def;
- }
- return null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategoryDefinition.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategoryDefinition.java
deleted file mode 100644
index cf0e8d0..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteCategoryDefinition.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
-import org.eclipse.pde.internal.core.isite.ISiteDescription;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class SiteCategoryDefinition
- extends SiteObject
- implements ISiteCategoryDefinition {
-
- private static final long serialVersionUID = 1L;
- private String name;
- private ISiteDescription description;
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition#getName()
- */
- public String getName() {
- return name;
- }
-
- public boolean isValid() {
- return name!=null && getLabel()!=null;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.name;
- this.name = name;
- firePropertyChanged(P_NAME, oldValue, name);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition#getDescription()
- */
- public ISiteDescription getDescription() {
- return description;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition#setDescription(org.eclipse.pde.internal.core.isite.ISiteDescription)
- */
- public void setDescription(ISiteDescription description)
- throws CoreException {
- ensureModelEditable();
- Object oldValue = this.description;
- this.description = description;
- firePropertyChanged(P_DESCRIPTION, oldValue, description);
- }
-
- protected void reset() {
- super.reset();
- name = null;
- description = null;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- name = getNodeAttribute(node, "name"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().equalsIgnoreCase("description")) { //$NON-NLS-1$
- description = getModel().getFactory().createDescription(this);
- ((SiteDescription) description).parse(child);
- ((SiteDescription)description).setInTheModel(true);
- break;
- }
- }
- }
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_NAME)) {
- setName(newValue != null ? newValue.toString() : null);
- } else if (
- name.equals(P_DESCRIPTION)
- && newValue instanceof ISiteDescription) {
- setDescription((ISiteDescription) newValue);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<category-def"); //$NON-NLS-1$
- if (name != null)
- writer.print(" name=\"" + SiteObject.getWritableString(name) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (label != null)
- writer.print(" label=\"" + SiteObject.getWritableString(label) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (description != null) {
- writer.println(">"); //$NON-NLS-1$
- description.write(indent + Site.INDENT, writer);
- writer.println(indent + "</category-def>"); //$NON-NLS-1$
- } else
- writer.println("/>"); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteDescription.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteDescription.java
deleted file mode 100644
index 75de189..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteDescription.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.isite.ISiteDescription;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class SiteDescription extends SiteObject implements ISiteDescription {
- private static final long serialVersionUID = 1L;
- private String url;
- private String text;
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteDescription#getURL()
- */
- public String getURL() {
- return url;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteDescription#getText()
- */
- public String getText() {
- return text;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteDescription#setURL(java.net.URL)
- */
- public void setURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.url;
- this.url = url;
- firePropertyChanged(P_URL, oldValue, url);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteDescription#setText(java.lang.String)
- */
- public void setText(String text) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.text;
- this.text = text;
- firePropertyChanged(P_TEXT, oldValue, text);
- }
-
- protected void reset() {
- url = null;
- text = null;
- }
-
- protected void parse(Node node) {
- url = getNodeAttribute(node, "url"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i=0; i<children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType()==Node.TEXT_NODE) {
- Node firstChild = node.getFirstChild();
- if (firstChild!=null)
- text = getNormalizedText(firstChild.getNodeValue());
- break;
- }
- }
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_URL)) {
- setURL(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_TEXT)) {
- setText(newValue != null ? newValue.toString() : null);
- } else
- super.restoreProperty(name, oldValue, newValue);
- }
-
- public void write(String indent, PrintWriter writer) {
- if ((url == null || url.length() <= 0)
- && (text == null || text.trim().length() <= 0))
- return;
- writer.print(indent);
- writer.print("<description"); //$NON-NLS-1$
- if (url != null && url.length() > 0)
- writer.print(" url=\"" + //$NON-NLS-1$
- SiteObject.getWritableString(url) + "\""); //$NON-NLS-1$
- writer.println(">"); //$NON-NLS-1$
- if (text!=null) {
- writer.println(indent + Site.INDENT +
- SiteObject.getWritableString(getNormalizedText(text)));
- }
- writer.println(indent+"</description>"); //$NON-NLS-1$
- }
- public boolean isValid() {
- return true;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteFeature.java
deleted file mode 100644
index 4d30c13..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteFeature.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.isite.ISiteCategory;
-import org.eclipse.pde.internal.core.isite.ISiteFeature;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class SiteFeature extends VersionableObject implements ISiteFeature {
- private static final long serialVersionUID = 1L;
- private Vector fCategories = new Vector();
- private String fType;
- private String fUrl;
- private String fOS;
- private String fWS;
- private String fArch;
- private String fNL;
- private boolean fIsPatch;
-
- public boolean isValid() {
- if (fUrl == null)
- return false;
- for (int i = 0; i < fCategories.size(); i++) {
- ISiteCategory category = (ISiteCategory) fCategories.get(i);
- if (!category.isValid())
- return false;
- }
- return true;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#addCategories(org.eclipse.pde.internal.core.isite.ISiteCategory)
- */
- public void addCategories(ISiteCategory[] newCategories)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newCategories.length; i++) {
- ISiteCategory category = newCategories[i];
- ((SiteCategory) category).setInTheModel(true);
- fCategories.add(newCategories[i]);
- }
- fireStructureChanged(newCategories, IModelChangedEvent.INSERT);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#removeCategories(org.eclipse.pde.internal.core.isite.ISiteCategory)
- */
- public void removeCategories(ISiteCategory[] newCategories)
- throws CoreException {
- ensureModelEditable();
- for (int i = 0; i < newCategories.length; i++) {
- ISiteCategory category = newCategories[i];
- ((SiteCategory) category).setInTheModel(false);
- fCategories.remove(newCategories[i]);
- }
- fireStructureChanged(newCategories, IModelChangedEvent.REMOVE);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getCategories()
- */
- public ISiteCategory[] getCategories() {
- return (ISiteCategory[]) fCategories.toArray(
- new ISiteCategory[fCategories.size()]);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getType()
- */
- public String getType() {
- return fType;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getURL()
- */
- public String getURL() {
- return fUrl;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setType(java.lang.String)
- */
- public void setType(String type) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fType;
- this.fType = type;
- firePropertyChanged(P_TYPE, oldValue, fType);
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setURL(java.net.URL)
- */
- public void setURL(String url) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.fUrl;
- this.fUrl = url;
- firePropertyChanged(P_TYPE, oldValue, url);
- }
-
- protected void parse(Node node) {
- super.parse(node);
- fType = getNodeAttribute(node, "type"); //$NON-NLS-1$
- fUrl = getNodeAttribute(node, "url"); //$NON-NLS-1$
- fOS = getNodeAttribute(node, "os"); //$NON-NLS-1$
- fNL = getNodeAttribute(node, "nl"); //$NON-NLS-1$
- fWS = getNodeAttribute(node, "ws"); //$NON-NLS-1$
- fArch = getNodeAttribute(node, "arch"); //$NON-NLS-1$
- String value = getNodeAttribute(node, "patch"); //$NON-NLS-1$
- fIsPatch = value != null && value.equals("true"); //$NON-NLS-1$
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().equalsIgnoreCase("category")) { //$NON-NLS-1$
- SiteCategory category =
- (SiteCategory) getModel().getFactory().createCategory(this);
- category.parse(child);
- category.setInTheModel(true);
- fCategories.add(category);
- }
- }
- }
-
- protected void reset() {
- super.reset();
- fType = null;
- fUrl = null;
- fOS = null;
- fWS = null;
- fArch = null;
- fNL = null;
- fIsPatch = false;
- fCategories.clear();
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_TYPE)) {
- setType(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_URL)) {
- setURL(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_ARCH)) {
- setArch(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_NL)) {
- setNL(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_OS)) {
- setOS(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_WS)) {
- setWS(newValue != null ? newValue.toString() : null);
- } else if (name.equals(P_PATCH)) {
- setIsPatch(((Boolean)newValue).booleanValue());
- } else {
- super.restoreProperty(name, oldValue, newValue);
- }
- }
-
- /**
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<feature"); //$NON-NLS-1$
- if (fType != null)
- writer.print(" type=\"" + fType + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fUrl != null)
- writer.print(" url=\"" + fUrl + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (id != null)
- writer.print(" id=\"" + getId() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (version != null)
- writer.print(" version=\"" + getVersion() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (label != null)
- writer.print(" label=\"" + getLabel() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fOS != null)
- writer.print(" os=\"" + fOS + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fWS != null)
- writer.print(" ws=\"" + fWS + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fNL != null)
- writer.print(" nl=\"" + fNL + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fArch != null)
- writer.print(" arch=\"" + fArch + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (fIsPatch)
- writer.print(" patch=\"true\""); //$NON-NLS-1$
- if (fCategories.size() > 0) {
- writer.println(">"); //$NON-NLS-1$
- String indent2 = indent + " "; //$NON-NLS-1$
- for (int i = 0; i < fCategories.size(); i++) {
- ISiteCategory category = (ISiteCategory) fCategories.get(i);
- category.write(indent2, writer);
- }
- writer.println(indent + "</feature>"); //$NON-NLS-1$
- } else
- writer.println("/>"); //$NON-NLS-1$
- }
-
- public IFile getArchiveFile() {
- if (fUrl==null) return null;
- IResource resource = getModel().getUnderlyingResource();
- if (resource==null) return null;
- IProject project = resource.getProject();
- IFile file = project.getFile(new Path(fUrl));
- if (file.exists()) return file;
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getOS()
- */
- public String getOS() {
- return fOS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getNL()
- */
- public String getNL() {
- return fNL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getArch()
- */
- public String getArch() {
- return fArch;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#getWS()
- */
- public String getWS() {
- return fWS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setOS(java.lang.String)
- */
- public void setOS(String os) throws CoreException{
- ensureModelEditable();
- Object oldValue = fOS;
- fOS = os;
- firePropertyChanged(P_OS, oldValue, fOS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setWS(java.lang.String)
- */
- public void setWS(String ws) throws CoreException {
- ensureModelEditable();
- Object oldValue = fWS;
- fWS = ws;
- firePropertyChanged(P_WS, oldValue, fWS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setArch(java.lang.String)
- */
- public void setArch(String arch) throws CoreException {
- ensureModelEditable();
- Object oldValue = fArch;
- fArch = arch;
- firePropertyChanged(P_ARCH, oldValue, fArch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setNL(java.lang.String)
- */
- public void setNL(String nl) throws CoreException {
- ensureModelEditable();
- Object oldValue = fNL;
- fNL = nl;
- firePropertyChanged(P_NL, oldValue, fNL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#isPatch()
- */
- public boolean isPatch() {
- return fIsPatch;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.isite.ISiteFeature#setIsPatch(boolean)
- */
- public void setIsPatch(boolean patch) throws CoreException {
- ensureModelEditable();
- Object oldValue = new Boolean(fIsPatch);
- fIsPatch = patch;
- firePropertyChanged(P_PATCH, oldValue, new Boolean(fIsPatch));
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteModelFactory.java
deleted file mode 100644
index 5d83af1..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteModelFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import org.eclipse.pde.internal.core.isite.ISite;
-import org.eclipse.pde.internal.core.isite.ISiteArchive;
-import org.eclipse.pde.internal.core.isite.ISiteCategory;
-import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
-import org.eclipse.pde.internal.core.isite.ISiteDescription;
-import org.eclipse.pde.internal.core.isite.ISiteFeature;
-import org.eclipse.pde.internal.core.isite.ISiteModel;
-import org.eclipse.pde.internal.core.isite.ISiteModelFactory;
-import org.eclipse.pde.internal.core.isite.ISiteObject;
-
-public class SiteModelFactory implements ISiteModelFactory {
- private ISiteModel model;
- public SiteModelFactory(ISiteModel model) {
- this.model = model;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createSite()
- */
- public ISite createSite() {
- Site site = new Site();
- site.model = model;
- site.parent = null;
- return site;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createFeature()
- */
- public ISiteFeature createFeature() {
- SiteFeature feature = new SiteFeature();
- feature.model = model;
- feature.parent = model.getSite();
- return feature;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createCategory()
- */
- public ISiteCategory createCategory(ISiteFeature feature) {
- SiteCategory category = new SiteCategory();
- category.model = model;
- category.parent = feature;
- return category;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createCategoryDefinition()
- */
- public ISiteCategoryDefinition createCategoryDefinition() {
- SiteCategoryDefinition def = new SiteCategoryDefinition();
- def.model = model;
- def.parent = model.getSite();
- return def;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createDescription()
- */
- public ISiteDescription createDescription(ISiteObject parent) {
- SiteDescription desc = new SiteDescription();
- desc.model = model;
- desc.parent = parent;
- return desc;
- }
-
- /**
- * @see org.eclipse.pde.internal.core.isite.ISiteModelFactory#createArchive()
- */
- public ISiteArchive createArchive() {
- SiteArchive archive = new SiteArchive();
- archive.model = model;
- archive.parent = model.getSite();
- return archive;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteObject.java
deleted file mode 100644
index 83e8d9b..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/SiteObject.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDECoreMessages;
-import org.eclipse.pde.internal.core.isite.ISite;
-import org.eclipse.pde.internal.core.isite.ISiteModel;
-import org.eclipse.pde.internal.core.isite.ISiteObject;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public abstract class SiteObject
- extends PlatformObject
- implements ISiteObject {
- transient ISiteModel model;
- transient ISiteObject parent;
- protected String label;
- boolean inTheModel;
-
- void setInTheModel(boolean value) {
- inTheModel = value;
- }
-
- public boolean isInTheModel() {
- return inTheModel;
- }
-
- protected void ensureModelEditable() throws CoreException {
- if (!model.isEditable()) {
- throwCoreException(PDECoreMessages.SiteObject_readOnlyChange);
- }
- }
- protected void firePropertyChanged(
- String property,
- Object oldValue,
- Object newValue) {
- firePropertyChanged(this, property, oldValue, newValue);
- }
- protected void firePropertyChanged(
- ISiteObject object,
- String property,
- Object oldValue,
- Object newValue) {
- if (model.isEditable()) {
- model.fireModelObjectChanged(object, property, oldValue, newValue);
- }
- }
- protected void fireStructureChanged(ISiteObject child, int changeType) {
- fireStructureChanged(new ISiteObject[] { child }, changeType);
- }
- protected void fireStructureChanged(
- ISiteObject[] children,
- int changeType) {
- ISiteModel model = getModel();
- if (model.isEditable()) {
- model.fireModelChanged(new ModelChangedEvent(model, changeType, children, null));
- }
- }
- public ISite getSite() {
- return model.getSite();
- }
- public String getLabel() {
- return label;
- }
-
- public String getTranslatableLabel() {
- if (label == null)
- return ""; //$NON-NLS-1$
- return model.getResourceString(label);
- }
- public ISiteModel getModel() {
- return model;
- }
- String getNodeAttribute(Node node, String name) {
- NamedNodeMap atts = node.getAttributes();
- Node attribute = null;
- if (atts != null)
- attribute = atts.getNamedItem(name);
- if (attribute != null)
- return attribute.getNodeValue();
- return null;
- }
-
- int getIntegerAttribute(Node node, String name) {
- String value = getNodeAttribute(node, name);
- if (value != null) {
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException e) {
- }
- }
- return 0;
- }
-
- boolean getBooleanAttribute(Node node, String name) {
- String value = getNodeAttribute(node, name);
- if (value != null) {
- return value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
- return false;
- }
-
- protected String getNormalizedText(String source) {
- String result = source.replace('\t', ' ');
- result = result.trim();
-
- return result;
- }
-
- public ISiteObject getParent() {
- return parent;
- }
-
- protected void parse(Node node) {
- label = getNodeAttribute(node, "label"); //$NON-NLS-1$
- }
-
- protected void reset() {
- label = null;
- }
-
- public void setLabel(String newLabel) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.label;
- label = newLabel;
- firePropertyChanged(P_LABEL, oldValue, newLabel);
- }
- protected void throwCoreException(String message) throws CoreException {
- Status status =
- new Status(IStatus.ERROR, PDECore.getPluginId(), IStatus.OK, message, null);
- CoreException ce= new CoreException(status);
- ce.fillInStackTrace();
- throw ce;
- }
-
- public static String getWritableString(String source) {
- if (source == null)
- return ""; //$NON-NLS-1$
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- switch (c) {
- case '&' :
- buf.append("&"); //$NON-NLS-1$
- break;
- case '<' :
- buf.append("<"); //$NON-NLS-1$
- break;
- case '>' :
- buf.append(">"); //$NON-NLS-1$
- break;
- case '\'' :
- buf.append("'"); //$NON-NLS-1$
- break;
- case '\"' :
- buf.append("""); //$NON-NLS-1$
- break;
- default :
- buf.append(c);
- break;
- }
- }
- return buf.toString();
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_LABEL)) {
- setLabel(newValue != null ? newValue.toString() : null);
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- }
- public void setModel(ISiteModel model) {
- this.model = model;
- }
-
- public void setParent(ISiteObject parent) {
- this.parent = parent;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/VersionableObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/VersionableObject.java
deleted file mode 100644
index 775b87c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/VersionableObject.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.ifeature.IVersionable;
-import org.w3c.dom.Node;
-
-public class VersionableObject
- extends IdentifiableObject
- implements IVersionable {
- private static final long serialVersionUID = 1L;
- protected String version;
-
- public String getVersion() {
- return version;
- }
-
- protected void parse(Node node) {
- super.parse(node);
- version = getNodeAttribute(node, "version"); //$NON-NLS-1$
- }
-
- public void setVersion(String version) throws CoreException {
- ensureModelEditable();
- Object oldValue = this.version;
- this.version = version;
- firePropertyChanged(this, P_VERSION, oldValue, version);
- }
-
- public void restoreProperty(String name, Object oldValue, Object newValue)
- throws CoreException {
- if (name.equals(P_VERSION)) {
- setVersion(newValue != null ? newValue.toString() : null);
- }
- else super.restoreProperty(name, oldValue, newValue);
- }
-
- protected void reset() {
- super.reset();
- version = null;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/WorkspaceSiteModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/WorkspaceSiteModel.java
deleted file mode 100644
index 8eb85b8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/site/WorkspaceSiteModel.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.site;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDECore;
-
-public class WorkspaceSiteModel
- extends AbstractSiteModel
- implements IEditableModel {
- private static final long serialVersionUID = 1L;
- private boolean fDirty;
- private IFile fFile;
- private boolean fEditable = true;
-
- public WorkspaceSiteModel(IFile file) {
- fFile = file;
- }
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(event.getChangeType()!=IModelChangedEvent.WORLD_CHANGED);
- super.fireModelChanged(event);
- }
-
- protected NLResourceHelper createNLResourceHelper() {
- try {
- IPath path = fFile.getLocation().removeLastSegments(1);
- String installLocation = path.toOSString();
- if (installLocation.startsWith("file:") == false) //$NON-NLS-1$
- installLocation = "file:" + installLocation; //$NON-NLS-1$
- URL url = new URL(installLocation + "/"); //$NON-NLS-1$
- String name = "site"; //$NON-NLS-1$
- NLResourceHelper helper =
- new NLResourceHelper(name, new URL[] { url });
- return helper;
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- setLoaded(true);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
- public IFile getFile() {
- return fFile;
- }
- public String getInstallLocation() {
- return fFile.getParent().getLocation().toOSString();
- }
- public IResource getUnderlyingResource() {
- return fFile;
- }
- public boolean isDirty() {
- return fDirty;
- }
- public boolean isEditable() {
- return fEditable;
- }
-
- public boolean isInSync() {
- return isInSync(fFile.getLocation().toFile());
- }
-
- protected void updateTimeStamp() {
- updateTimeStamp(fFile.getLocation().toFile());
- }
- public void load() {
- if (fFile.exists()) {
- InputStream stream = null;
- try {
- stream = fFile.getContents(true);
- load(stream, false);
- } catch (CoreException e) {
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- } else {
- this.site = new Site();
- site.model = this;
- setLoaded(true);
- }
- }
- public void save() {
- try {
- String contents = getContents();
- ByteArrayInputStream stream =
- new ByteArrayInputStream(contents.getBytes("UTF8")); //$NON-NLS-1$
- if (fFile.exists()) {
- fFile.setContents(stream, false, false, null);
- } else {
- fFile.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- site.write("", writer); //$NON-NLS-1$
- }
- setDirty(false);
- }
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- public void setEditable(boolean newEditable) {
- fEditable = newEditable;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/AdditionalDirectory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/AdditionalDirectory.java
deleted file mode 100644
index e042bcb..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/AdditionalDirectory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.itarget.IAdditionalLocation;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AdditionalDirectory extends TargetObject implements
- IAdditionalLocation {
-
- private static final long serialVersionUID = 1L;
-
- private String fPath = ""; //$NON-NLS-1$
-
- public AdditionalDirectory(ITargetModel model) {
- super(model);
- }
-
- public String getPath() {
- return fPath;
- }
-
- public void setPath(String path) {
- String oldPath = fPath;
- fPath = path;
- firePropertyChanged(P_PATH, oldPath, fPath);
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- fPath = ((Element)node).getAttribute("path"); //$NON-NLS-1$
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<dir path=\"" + getWritableString(fPath) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ArgumentsInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ArgumentsInfo.java
deleted file mode 100644
index 1500260..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ArgumentsInfo.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import org.eclipse.pde.internal.core.itarget.IArgumentsInfo;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class ArgumentsInfo extends TargetObject implements IArgumentsInfo {
-
- private static final long serialVersionUID = 1L;
- private String fProgramArgs = ""; //$NON-NLS-1$
- private String fVMArgs = ""; //$NON-NLS-1$
-
- public ArgumentsInfo(ITargetModel model) {
- super(model);
- }
-
- public String getProgramArguments() {
- return fProgramArgs;
- }
-
- public String getVMArguments() {
- return fVMArgs;
- }
-
- public void setProgramArguments(String args) {
- String oldValue = fProgramArgs;
- fProgramArgs = args;
- if (isEditable())
- firePropertyChanged(P_PROG_ARGS, oldValue, fProgramArgs);
- }
-
- public void setVMArguments(String args) {
- String oldValue = fVMArgs;
- fVMArgs = args;
- if (isEditable())
- firePropertyChanged(P_VM_ARGS, oldValue, fVMArgs);
- }
-
- public void parse(Node node) {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(P_PROG_ARGS)) {
- fProgramArgs = getText(child);
- } else if (child.getNodeName().equals(P_VM_ARGS)) {
- fVMArgs = getText(child);
- }
- }
- }
- }
-
- private String getText(Node node) {
- node.normalize();
- Node text = node.getFirstChild();
- if (text != null && text.getNodeType() == Node.TEXT_NODE) {
- return text.getNodeValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public void write(String indent,java.io.PrintWriter writer) {
- if (( fProgramArgs == null || fProgramArgs.length()== 0) && (fVMArgs == null || fVMArgs.length() == 0))
- return;
- writer.println();
- writer.println(indent + "<launcherArgs>"); //$NON-NLS-1$
- if (fProgramArgs.length() > 0) {
- writer.println(indent + " " + "<" + P_PROG_ARGS + ">" + getWritableString(fProgramArgs) + "</" + P_PROG_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- if (fVMArgs.length() > 0) {
- writer.println(indent + " " + "<" + P_VM_ARGS + ">" + getWritableString(fVMArgs) + "</" + P_VM_ARGS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- writer.println(indent + "</launcherArgs>"); //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/EnvironmentInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/EnvironmentInfo.java
deleted file mode 100644
index d65e230..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/EnvironmentInfo.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.pde.internal.core.itarget.IEnvironmentInfo;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class EnvironmentInfo extends TargetObject implements IEnvironmentInfo {
-
- private static final long serialVersionUID = 1L;
-
- private String fOS;
- private String fWS;
- private String fArch;
- private String fNL;
-
- public EnvironmentInfo(ITargetModel model) {
- super(model);
- }
-
- public String getOS() {
- return fOS;
- }
-
- public String getWS() {
- return fWS;
- }
-
- public String getArch() {
- return fArch;
- }
-
- public String getNL() {
- return fNL;
- }
-
- public void setOS(String os) {
- String oldValue = fOS;
- fOS = os;
- firePropertyChanged(P_OS, oldValue, fOS);
- }
-
- public void setWS(String ws) {
- String oldValue = fWS;
- fWS = ws;
- firePropertyChanged(P_WS, oldValue, fWS);
- }
-
- public void setArch(String arch) {
- String oldValue = fArch;
- fArch = arch;
- firePropertyChanged(P_ARCH, oldValue, fArch);
- }
-
- public void setNL(String nl) {
- String oldValue = fNL;
- fNL = nl;
- firePropertyChanged(P_NL, oldValue, fNL);
- }
-
- public void parse(Node node) {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(P_OS)) {
- fOS = getText(child);
- } else if (child.getNodeName().equals(P_WS)) {
- fWS = getText(child);
- } else if (child.getNodeName().equals(P_ARCH)) {
- fArch = getText(child);
- } else if (child.getNodeName().equals(P_NL)) {
- fNL = getText(child);
- }
- }
- }
- }
-
- private String getText(Node node) {
- node.normalize();
- Node text = node.getFirstChild();
- if (text != null && text.getNodeType() == Node.TEXT_NODE) {
- return text.getNodeValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public void write(String indent, PrintWriter writer) {
- // if no elements set, then don't write anything
- if ((fOS == null || fOS.length() == 0) && (fWS == null || fWS.length() == 0) &&
- (fArch == null || fArch.length() == 0) && (fNL == null || fNL.length() == 0))
- return;
- writer.println();
- writer.println(indent + "<environment>"); //$NON-NLS-1$
- if (fOS != null && fOS.length() > 0)
- writer.println(indent + " <" + P_OS + ">" + getWritableString(fOS) + "</" + P_OS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if (fWS != null && fWS.length() > 0)
- writer.println(indent + " <" + P_WS + ">" + getWritableString(fWS) + "</" + P_WS + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if (fArch != null && fArch.length() > 0)
- writer.println(indent + " <" + P_ARCH + ">" + getWritableString(fArch) + "</" + P_ARCH + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if (fNL != null && fNL.length() > 0)
- writer.println(indent + " <" + P_NL + ">" + getWritableString(fNL) + "</" + P_NL + ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- writer.println(indent + "</environment>"); //$NON-NLS-1$
- }
-
- public String getDisplayOS() {
- if (fOS == null || fOS.trim().length() == 0)
- return Platform.getOS();
- return fOS.trim();
- }
-
- public String getDisplayWS() {
- if (fWS == null || fWS.trim().length() == 0)
- return Platform.getWS();
- return fWS.trim();
- }
-
- public String getDisplayArch() {
- if (fArch == null || fArch.trim().length() == 0)
- return Platform.getOSArch();
- return fArch.trim();
- }
-
- public String getDisplayNL() {
- if (fNL == null || fNL.trim().length() == 0)
- return Platform.getNL();
- return fNL.trim();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ImplicitDependenciesInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ImplicitDependenciesInfo.java
deleted file mode 100644
index e55c738..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/ImplicitDependenciesInfo.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.pde.internal.core.itarget.IImplicitDependenciesInfo;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetPlugin;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class ImplicitDependenciesInfo extends TargetObject implements
- IImplicitDependenciesInfo {
-
- private static final long serialVersionUID = 1L;
-
- Map fPlugins = new HashMap();
-
- public ImplicitDependenciesInfo(ITargetModel model) {
- super(model);
- }
-
- public ITargetPlugin[] getPlugins() {
- return (ITargetPlugin[]) fPlugins.values().toArray(new ITargetPlugin[fPlugins.size()]);
- }
-
- public void addPlugin(ITargetPlugin plugin) {
- addPlugins(new ITargetPlugin[] {plugin});
- }
-
- public void addPlugins(ITargetPlugin[] plugins) {
- ArrayList addedPlugins = new ArrayList();
- for (int i = 0; i < plugins.length; i ++ ) {
- String id = plugins[i].getId();
- if (fPlugins.containsKey(id))
- continue;
- plugins[i].setModel(getModel());
- fPlugins.put(id, plugins[i]);
- addedPlugins.add(plugins[i]);
- }
- if (isEditable() && (addedPlugins.size() > 0)) {
- firePropertyChanged(P_IMPLICIT_PLUGINS, new ITargetPlugin[0],
- (ITargetPlugin[])addedPlugins.toArray(new ITargetPlugin[addedPlugins.size()]));
- }
-
- }
-
- public void removePlugin(ITargetPlugin plugin) {
- removePlugins(new ITargetPlugin[] {plugin});
- }
-
- public void removePlugins(ITargetPlugin[] plugins) {
- ArrayList removedPlugins = new ArrayList();
- for (int i =0; i < plugins.length; i++)
- if (fPlugins.remove(plugins[i].getId()) != null)
- removedPlugins.add(plugins[i]);
- if (isEditable() && (removedPlugins.size() > 0))
- firePropertyChanged(P_IMPLICIT_PLUGINS, (ITargetPlugin[])removedPlugins.toArray(new ITargetPlugin[removedPlugins.size()]),
- new ITargetPlugin[0]);
- }
-
- public void parse(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeName().equals("plugin")) { //$NON-NLS-1$
- ITargetPlugin plugin = getModel().getFactory().createPlugin();
- plugin.parse(child);
- fPlugins.put(plugin.getId(), plugin);
- }
- }
-
- }
-
- public void write(String indent, PrintWriter writer) {
- if (fPlugins.size() == 0)
- return;
- writer.println();
- writer.println(indent + "<implicitDependencies>"); //$NON-NLS-1$
- Iterator it = fPlugins.values().iterator();
- while (it.hasNext()) {
- TargetPlugin plugin = (TargetPlugin) it.next();
- plugin.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + "</implicitDependencies>"); //$NON-NLS-1$
- }
-
- public boolean containsPlugin(String id) {
- return fPlugins.containsKey(id);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/LocationInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/LocationInfo.java
deleted file mode 100644
index bb5b3dc..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/LocationInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.itarget.ILocationInfo;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class LocationInfo extends TargetObject implements ILocationInfo{
-
- private static final long serialVersionUID = 1L;
-
- private String fPath = ""; //$NON-NLS-1$
- private boolean fUseDefault = true;
-
- public LocationInfo(ITargetModel model) {
- super(model);
- }
-
- public void parse(Node node) {
- Element element = (Element)node;
- fPath = element.getAttribute("path"); //$NON-NLS-1$
- fUseDefault = "true".equalsIgnoreCase(element.getAttribute("useDefault")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println();
- writer.print(indent + "<location"); //$NON-NLS-1$
- if (fUseDefault)
- writer.print(" useDefault=\"true\""); //$NON-NLS-1$
- if (fPath != null && fPath.trim().length() > 0)
- writer.print(" path=\"" + getWritableString(fPath.trim()) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println("/>"); //$NON-NLS-1$
- }
-
- public boolean useDefault() {
- return fUseDefault;
- }
-
- public void setDefault(boolean value) {
- fUseDefault = value;
- if (value)
- firePropertyChanged(P_LOC, fPath, ""); //$NON-NLS-1$
- else
- firePropertyChanged(P_LOC, "", fPath); //$NON-NLS-1$
- }
-
- public String getPath() {
- return fPath;
- }
-
- public void setPath(String path) {
- fUseDefault = false;
- String oldValue = fPath;
- fPath = (path != null) ? path : ""; //$NON-NLS-1$
- firePropertyChanged(P_LOC, oldValue, fPath);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/Target.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/Target.java
deleted file mode 100644
index c481d53..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/Target.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.TreeMap;
-
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.itarget.IAdditionalLocation;
-import org.eclipse.pde.internal.core.itarget.IArgumentsInfo;
-import org.eclipse.pde.internal.core.itarget.IEnvironmentInfo;
-import org.eclipse.pde.internal.core.itarget.IImplicitDependenciesInfo;
-import org.eclipse.pde.internal.core.itarget.ILocationInfo;
-import org.eclipse.pde.internal.core.itarget.ITarget;
-import org.eclipse.pde.internal.core.itarget.ITargetFeature;
-import org.eclipse.pde.internal.core.itarget.ITargetJRE;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetModelFactory;
-import org.eclipse.pde.internal.core.itarget.ITargetPlugin;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Target extends TargetObject implements ITarget {
-
- private static final long serialVersionUID = 1L;
- private String fName;
- private TreeMap fPlugins = new TreeMap();
- private TreeMap fFeatures = new TreeMap();
- private IArgumentsInfo fArgsInfo;
- private IEnvironmentInfo fEnvInfo;
- private ITargetJRE fRuntimeInfo;
- private ILocationInfo fLocationInfo;
- private IImplicitDependenciesInfo fImplicitInfo;
- private boolean fUseAllTargetPlatform = false;
- private Set fAdditionalDirectories = new HashSet();
-
- public Target(ITargetModel model) {
- super(model);
- }
-
- public void reset() {
- fArgsInfo = null;
- fEnvInfo = null;
- fRuntimeInfo = null;
- fLocationInfo = null;
- fImplicitInfo = null;
- fPlugins.clear();
- fFeatures.clear();
- fUseAllTargetPlatform = false;
- fAdditionalDirectories.clear();
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE
- && node.getNodeName().equals("target")) { //$NON-NLS-1$
- Element element = (Element)node;
- fName = element.getAttribute(P_NAME);
- NodeList children = node.getChildNodes();
- ITargetModelFactory factory = getModel().getFactory();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String name = child.getNodeName();
- if (name.equals("launcherArgs")) { //$NON-NLS-1$
- fArgsInfo = factory.createArguments();
- fArgsInfo.parse(child);
- } else if (name.equals("content")) { //$NON-NLS-1$
- parseContent((Element)child);
- } else if (name.equals("environment")) { //$NON-NLS-1$
- fEnvInfo = factory.createEnvironment();
- fEnvInfo.parse(child);
- } else if (name.equals("targetJRE")) { //$NON-NLS-1$
- fRuntimeInfo = factory.createJREInfo();
- fRuntimeInfo.parse(child);
- } else if (name.equals("location")) { //$NON-NLS-1$
- fLocationInfo = factory.createLocation();
- fLocationInfo.parse(child);
- } else if (name.equals("implicitDependencies")) { //$NON-NLS-1$
- fImplicitInfo = factory.createImplicitPluginInfo();
- fImplicitInfo.parse(child);
- }
- }
- }
- }
- }
-
- private void parseContent(Element content) {
- fUseAllTargetPlatform =
- "true".equals(content.getAttribute("useAllPlugins")); //$NON-NLS-1$ //$NON-NLS-2$
- NodeList children = content.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if ("plugins".equals(node.getNodeName())) { //$NON-NLS-1$
- parsePlugins(node.getChildNodes());
- } else if ("features".equals(node.getNodeName())) { //$NON-NLS-1$
- parseFeatures(node.getChildNodes());
- } else if ("extraLocations".equals(node.getNodeName())) { //$NON-NLS-1$
- parseLocations(node.getChildNodes());
- }
- }
- }
-
- private void parsePlugins(NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("plugin")) { //$NON-NLS-1$
- ITargetPlugin plugin = getModel().getFactory().createPlugin();
- plugin.parse(child);
- fPlugins.put(plugin.getId(), plugin);
- }
- }
- }
- }
-
- private void parseFeatures(NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("feature")) { //$NON-NLS-1$
- ITargetFeature feature = getModel().getFactory().createFeature();
- feature.parse(child);
- fFeatures.put(feature.getId(), feature);
- }
- }
- }
- }
-
- private void parseLocations(NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("dir")) { //$NON-NLS-1$
- IAdditionalLocation loc = getModel().getFactory().createAdditionalLocation();
- loc.parse(child);
- fAdditionalDirectories.add(loc);
- }
- }
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent + "<target"); //$NON-NLS-1$
- if (fName != null && fName.length() > 0)
- writer.print(" " + P_NAME + "=\"" + getWritableString(fName) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- writer.println(">"); //$NON-NLS-1$
- if (fArgsInfo != null) {
- fArgsInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
- if (fEnvInfo != null) {
- fEnvInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
- if (fRuntimeInfo != null) {
- fRuntimeInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
- if (fLocationInfo != null) {
- fLocationInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
-
- writer.println();
- if (fUseAllTargetPlatform) {
- writer.println(indent + " <content useAllPlugins=\"true\">"); //$NON-NLS-1$
- } else {
- writer.println(indent + " <content>"); //$NON-NLS-1$
- }
-
- writer.println(indent + " <plugins>"); //$NON-NLS-1$
- Iterator iter = fPlugins.values().iterator();
- while (iter.hasNext()) {
- ITargetPlugin plugin = (ITargetPlugin) iter.next();
- plugin.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + " </plugins>"); //$NON-NLS-1$
- writer.println(indent + " <features>"); //$NON-NLS-1$
- iter = fFeatures.values().iterator();
- while (iter.hasNext()) {
- ITargetFeature feature = (ITargetFeature) iter.next();
- feature.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + " </features>"); //$NON-NLS-1$
- if (!fAdditionalDirectories.isEmpty()) {
- writer.println(indent + " <extraLocations>"); //$NON-NLS-1$
- iter = fAdditionalDirectories.iterator();
- while (iter.hasNext()) {
- IAdditionalLocation location = (IAdditionalLocation) iter.next();
- location.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println(indent + " </extraLocations>"); //$NON-NLS-1$
- }
- writer.println(indent + " </content>"); //$NON-NLS-1$
- if (fImplicitInfo != null) {
- fImplicitInfo.write(indent + " ", writer); //$NON-NLS-1$
- }
- writer.println();
- writer.println(indent + "</target>"); //$NON-NLS-1$
- }
-
- public IArgumentsInfo getArguments() {
- return fArgsInfo;
- }
-
- public void setArguments(IArgumentsInfo info) {
- fArgsInfo = info;
- }
-
- public IEnvironmentInfo getEnvironment() {
- return fEnvInfo;
- }
-
- public void setEnvironment(IEnvironmentInfo info) {
- fEnvInfo = info;
- }
-
- public ITargetJRE getTargetJREInfo() {
- return fRuntimeInfo;
- }
-
- public void setTargetJREInfo(ITargetJRE info) {
- fRuntimeInfo = info;
-
- }
-
- public String getName() {
- return fName;
- }
-
- public void setName(String name) {
- String oldValue = fName;
- fName = name;
- firePropertyChanged(P_NAME, oldValue, fName);
- }
-
- public ILocationInfo getLocationInfo() {
- return fLocationInfo;
- }
-
- public void setLocationInfo(ILocationInfo info) {
- fLocationInfo = info;
- }
-
- public void addPlugin(ITargetPlugin plugin) {
- addPlugins(new ITargetPlugin[] {plugin});
- }
-
- public void addPlugins(ITargetPlugin[] plugins) {
- boolean modify = false;
- for (int i = 0; i < plugins.length; i ++ ) {
- String id = plugins[i].getId();
- if (fPlugins.containsKey(id))
- continue;
- modify = true;
- plugins[i].setModel(getModel());
- fPlugins.put(id, plugins[i]);
- }
- if (isEditable() && modify) {
- fireStructureChanged(plugins, IModelChangedEvent.INSERT);
- }
- }
-
- public void addFeature(ITargetFeature feature) {
- addFeatures(new ITargetFeature[] {feature});
- }
-
- public void addFeatures(ITargetFeature[] features) {
- boolean modify = false;
- for (int i = 0; i < features.length; i++) {
- String id = features[i].getId();
- if (fFeatures.containsKey(id))
- continue;
- modify = true;
- features[i].setModel(getModel());
- fFeatures.put(id, features[i]);
- }
- if (isEditable() && modify)
- fireStructureChanged(features, IModelChangedEvent.INSERT);
- }
-
- public void removePlugin(ITargetPlugin plugin) {
- removePlugins(new ITargetPlugin[] {plugin});
- }
-
- public void removePlugins(ITargetPlugin[] plugins) {
- boolean modify = false;
- for (int i =0; i < plugins.length; i++)
- modify = ((fPlugins.remove(plugins[i].getId()) != null) || modify);
- if (isEditable() && modify)
- fireStructureChanged(plugins, IModelChangedEvent.REMOVE);
- }
-
- public void removeFeature(ITargetFeature feature) {
- removeFeatures(new ITargetFeature[] {feature});
- }
-
- public void removeFeatures(ITargetFeature[] features) {
- boolean modify = false;
- for (int i = 0; i < features.length; i++) {
- modify = ((fFeatures.remove(features[i].getId()) != null) || modify);
- }
- if (isEditable() && modify)
- fireStructureChanged(features, IModelChangedEvent.REMOVE);
- }
-
- public ITargetPlugin[] getPlugins() {
- return (ITargetPlugin[]) fPlugins.values().toArray(new ITargetPlugin[fPlugins.size()]);
- }
-
- public ITargetFeature[] getFeatures() {
- return (ITargetFeature[]) fFeatures.values().toArray(new ITargetFeature[fFeatures.size()]);
- }
-
- public boolean containsPlugin(String id) {
- return fPlugins.containsKey(id);
- }
-
- public boolean containsFeature(String id) {
- return fFeatures.containsKey(id);
- }
-
- public boolean useAllPlugins() {
- return fUseAllTargetPlatform;
- }
-
- public void setUseAllPlugins(boolean value) {
- boolean oldValue = fUseAllTargetPlatform;
- fUseAllTargetPlatform = value;
- if (isEditable())
- firePropertyChanged(P_ALL_PLUGINS, new Boolean(oldValue), new Boolean(fUseAllTargetPlatform));
- }
-
- public void setImplicitPluginsInfo(IImplicitDependenciesInfo info) {
- fImplicitInfo = info;
- }
-
- public IImplicitDependenciesInfo getImplicitPluginsInfo() {
- return fImplicitInfo;
- }
-
- public IAdditionalLocation[] getAdditionalDirectories() {
- return (IAdditionalLocation[])
- fAdditionalDirectories.toArray(new IAdditionalLocation[fAdditionalDirectories.size()]);
- }
-
- public void addAdditionalDirectories(IAdditionalLocation[] dirs) {
- for (int i = 0; i < dirs.length; i++) {
- fAdditionalDirectories.add(dirs[i]);
- }
- fireStructureChanged(dirs, IModelChangedEvent.INSERT);
- }
-
- public void removeAdditionalDirectories(IAdditionalLocation[] dirs) {
- for (int i = 0; i < dirs.length; i++) {
- fAdditionalDirectories.remove(dirs[i]);
- }
- fireStructureChanged(dirs, IModelChangedEvent.REMOVE);
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetFeature.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetFeature.java
deleted file mode 100644
index ff922e9..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetFeature.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.itarget.ITargetFeature;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class TargetFeature extends TargetObject implements ITargetFeature {
-
- private static final long serialVersionUID = 1L;
- private String fId;
-
- public TargetFeature(ITargetModel model) {
- super(model);
- }
-
- public String getId() {
- return fId.trim();
- }
-
- public void setId(String id) {
- fId = id;
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- fId = element.getAttribute("id"); //$NON-NLS-1$
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<feature id=\"" + getWritableString(fId) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetJRE.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetJRE.java
deleted file mode 100644
index e0e9220..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetJRE.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
-import org.eclipse.pde.internal.core.itarget.ITargetJRE;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class TargetJRE extends TargetObject implements ITargetJRE {
-
- private static final long serialVersionUID = 1L;
- private int fType;
- private String fName;
-
- public TargetJRE(ITargetModel model) {
- super(model);
- }
-
- public int getJREType() {
- return fType;
- }
-
- public String getJREName() {
- return fName;
- }
-
- public void setNamedJRE(String name) {
- int oldType = fType;
- String oldName = fName;
- fName = (name == null) ? "" : name; //$NON-NLS-1$
- fType = TYPE_NAMED;
- if (oldType != fType)
- firePropertyChanged(P_TARGET_JRE, new Integer(oldType), new Integer(fType));
- else
- firePropertyChanged(P_TARGET_JRE, oldName, fName);
- }
-
- public void setExecutionEnvJRE(String name) {
- int oldType = fType;
- String oldName = fName;
- fName = (name == null) ? "" : name; //$NON-NLS-1$
- fType = TYPE_EXECUTION_ENV;
- if (oldType != fType)
- firePropertyChanged(P_TARGET_JRE, new Integer(oldType), new Integer(fType));
- else
- firePropertyChanged(P_TARGET_JRE, oldName, fName);
- }
-
- public void setDefaultJRE() {
- int oldType = fType;
- fName = ""; //$NON-NLS-1$
- fType = TYPE_DEFAULT;
- if (oldType != fType)
- firePropertyChanged(P_TARGET_JRE, new Integer(oldType), new Integer(fType));
- }
-
- public void parse(Node node) {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals("jreName")) { //$NON-NLS-1$
- fType = TYPE_NAMED;
- fName = getText(child);
- } else if (child.getNodeName().equals("execEnv")) { //$NON-NLS-1$
- fType = TYPE_EXECUTION_ENV;
- fName = getText(child);
- }
- }
- }
- if (list.getLength() == 0) {
- fType = TYPE_DEFAULT;
- fName = ""; //$NON-NLS-1$
- }
- }
-
- private String getText(Node node) {
- node.normalize();
- Node text = node.getFirstChild();
- if (text != null && text.getNodeType() == Node.TEXT_NODE) {
- return text.getNodeValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public void write(String indent, PrintWriter writer) {
- if (fType == 0)
- return;
- writer.println();
- writer.println(indent + "<targetJRE>"); //$NON-NLS-1$
- if (fType == 1)
- writer.println(indent + " <jreName>" + getWritableString(fName) + "</jreName>"); //$NON-NLS-1$ //$NON-NLS-2$
- else if (fType == 2)
- writer.println(indent + " <execEnv>" + getWritableString(fName) + "</execEnv>"); //$NON-NLS-1$ //$NON-NLS-2$
- writer.println(indent + "</targetJRE>"); //$NON-NLS-1$
- }
-
- public String getCompatibleJRE() {
- int jreType = getJREType();
-
- switch (jreType) {
- case ITargetJRE.TYPE_DEFAULT:
- return JavaRuntime.getDefaultVMInstall().getName();
- case ITargetJRE.TYPE_NAMED:
- return getJREName();
- case ITargetJRE.TYPE_EXECUTION_ENV:
- IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
- IExecutionEnvironment environment = manager.getEnvironment(getJREName());
- IVMInstall vm = null;
- if (environment != null) {
- vm = environment.getDefaultVM();
- if (vm == null) {
- IVMInstall[] installs = environment.getCompatibleVMs();
- // take the first strictly compatible vm if there is no default
- for (int i = 0; i < installs.length; i++) {
- IVMInstall install = installs[i];
- if (environment.isStrictlyCompatible(install)) {
- return install.getName();
- }
- }
- // use the first vm failing that
- if (vm == null && installs.length > 0)
- return installs[0].getName();
- }
- return vm.getName();
- }
- }
- return JavaRuntime.getDefaultVMInstall().getName();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModel.java
deleted file mode 100644
index 78369fe..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModel.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.target;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.AbstractModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.XMLDefaultHandler;
-import org.eclipse.pde.internal.core.itarget.ITarget;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetModelFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class TargetModel extends AbstractModel implements ITargetModel {
-
- private static final long serialVersionUID = 1L;
-
- private ITargetModelFactory fFactory;
- private ITarget fTarget;
-
- protected void updateTimeStamp() {
- }
-
- public ITarget getTarget() {
- if (fTarget == null)
- fTarget = getFactory().createTarget();
- return fTarget;
- }
-
- public ITargetModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new TargetModelFactory(this);
- return fFactory;
- }
-
- public String getInstallLocation() {
- return null;
- }
-
- public boolean isInSync() {
- return true;
- }
-
- public void load() throws CoreException {
- }
-
- public void load(InputStream stream, boolean outOfSync) throws CoreException {
- try {
- SAXParser parser = getSaxParser();
- XMLDefaultHandler handler = new XMLDefaultHandler();
- parser.parse(stream, handler);
- processDocument(handler.getDocument());
- setLoaded(true);
- } catch (Exception e) {
- PDECore.logException(e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- public void reload(InputStream source, boolean outOfSync) throws CoreException {
- load(source, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] { fTarget },
- null));
- }
-
- public boolean isEditable() {
- return false;
- }
-
- private void processDocument(Document doc) {
- Node rootNode = doc.getDocumentElement();
- if (fTarget == null) {
- fTarget = getFactory().createTarget();
- } else {
- fTarget.reset();
- }
- fTarget.parse(rootNode);
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModelFactory.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModelFactory.java
deleted file mode 100644
index 186b8dd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetModelFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.target;
-
-import org.eclipse.pde.internal.core.itarget.IAdditionalLocation;
-import org.eclipse.pde.internal.core.itarget.IArgumentsInfo;
-import org.eclipse.pde.internal.core.itarget.IEnvironmentInfo;
-import org.eclipse.pde.internal.core.itarget.IImplicitDependenciesInfo;
-import org.eclipse.pde.internal.core.itarget.ILocationInfo;
-import org.eclipse.pde.internal.core.itarget.ITarget;
-import org.eclipse.pde.internal.core.itarget.ITargetFeature;
-import org.eclipse.pde.internal.core.itarget.ITargetJRE;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetModelFactory;
-import org.eclipse.pde.internal.core.itarget.ITargetPlugin;
-
-public class TargetModelFactory implements ITargetModelFactory {
-
- private ITargetModel fModel;
-
- public TargetModelFactory(ITargetModel model) {
- fModel = model;
- }
-
- public ITarget createTarget() {
- return new Target(fModel);
- }
-
- public IArgumentsInfo createArguments() {
- return new ArgumentsInfo(fModel);
- }
-
- public IEnvironmentInfo createEnvironment() {
- return new EnvironmentInfo(fModel);
- }
-
- public ITargetJRE createJREInfo() {
- return new TargetJRE(fModel);
- }
-
- public ILocationInfo createLocation() {
- return new LocationInfo(fModel);
- }
-
- public IImplicitDependenciesInfo createImplicitPluginInfo() {
- return new ImplicitDependenciesInfo(fModel);
- }
-
- public ITargetPlugin createPlugin() {
- return new TargetPlugin(fModel);
- }
-
- public ITargetFeature createFeature() {
- return new TargetFeature(fModel);
- }
-
- public IAdditionalLocation createAdditionalLocation() {
- return new AdditionalDirectory(fModel);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetObject.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetObject.java
deleted file mode 100644
index 9bcc1ca..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetObject.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.target;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.itarget.ITarget;
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetObject;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-public abstract class TargetObject extends PlatformObject implements ITargetObject {
-
- private transient ITargetModel fModel;
-
- public TargetObject(ITargetModel model) {
- fModel = model;
- }
-
- public ITargetModel getModel() {
- return fModel;
- }
-
- public void setModel(ITargetModel model) {
- fModel = model;
- }
-
- public ITarget getTarget() {
- return getModel().getTarget();
- }
-
- protected void firePropertyChanged(String property, Object oldValue, Object newValue) {
- firePropertyChanged(this, property, oldValue, newValue);
- }
-
- protected void firePropertyChanged(ITargetObject object, String property,
- Object oldValue, Object newValue) {
- if (fModel.isEditable()) {
- IModelChangeProvider provider = fModel;
- provider.fireModelObjectChanged(object, property, oldValue, newValue);
- }
- }
-
- protected void fireStructureChanged(ITargetObject child, int changeType) {
- fireStructureChanged(new ITargetObject[] { child }, changeType);
- }
-
- protected void fireStructureChanged(ITargetObject[] children, int changeType) {
- if (fModel.isEditable()) {
- IModelChangeProvider provider = fModel;
- provider.fireModelChanged(new ModelChangedEvent(provider, changeType,
- children, null));
- }
- }
-
- protected boolean isEditable() {
- return getModel().isEditable();
- }
-
- public String getWritableString(String source) {
- return CoreUtility.getWritableString(source);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPlugin.java
deleted file mode 100644
index 284e85c..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetPlugin.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.pde.internal.core.target;
-
-import java.io.PrintWriter;
-
-import org.eclipse.pde.internal.core.itarget.ITargetModel;
-import org.eclipse.pde.internal.core.itarget.ITargetPlugin;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class TargetPlugin extends TargetObject implements ITargetPlugin {
-
- private static final long serialVersionUID = 1L;
- private String fId;
-
- public TargetPlugin(ITargetModel model) {
- super(model);
- }
-
- public String getId() {
- return fId.trim();
- }
-
- public void setId(String id) {
- fId = id;
- }
-
- public void parse(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- fId = ((Element)node).getAttribute("id"); //$NON-NLS-1$
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.println(indent + "<plugin id=\"" + getWritableString(fId) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/WorkspaceTargetModel.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/WorkspaceTargetModel.java
deleted file mode 100644
index 0ee82fd..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/WorkspaceTargetModel.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.target;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.pde.core.IEditableModel;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.PDECore;
-
-
-public class WorkspaceTargetModel extends TargetModel implements IEditableModel {
-
- private static final long serialVersionUID = 1L;
-
- private IFile fFile;
-
- private boolean fDirty;
-
- private boolean fEditable;
-
- public WorkspaceTargetModel(IFile file, boolean editable) {
- fFile = file;
- fEditable = editable;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#load()
- */
- public void load() throws CoreException {
- if (fFile.exists()) {
- InputStream stream = null;
- try {
- stream = fFile.getContents(true);
- load(stream, false);
- } catch (CoreException e) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#isInSync()
- */
- public boolean isInSync() {
- IPath path = fFile.getLocation();
- return path == null ? false : isInSync(path.toFile());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#getUnderlyingResource()
- */
- public IResource getUnderlyingResource() {
- return fFile;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#getInstallLocation()
- */
- public String getInstallLocation() {
- return fFile.getLocation().toOSString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditableModel#save()
- */
- public void save() {
- try {
- String contents = getContents();
- ByteArrayInputStream stream =
- new ByteArrayInputStream(contents.getBytes("UTF8")); //$NON-NLS-1$
- if (fFile.exists()) {
- fFile.setContents(stream, false, false, null);
- } else {
- fFile.create(stream, false, null);
- }
- stream.close();
- } catch (CoreException e) {
- PDECore.logException(e);
- } catch (IOException e) {
- }
- }
-
- public String getContents() {
- StringWriter swriter = new StringWriter();
- PrintWriter writer = new PrintWriter(swriter);
- setLoaded(true);
- save(writer);
- writer.flush();
- try {
- swriter.close();
- } catch (IOException e) {
- }
- return swriter.toString();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#isDirty()
- */
- public boolean isDirty() {
- return fDirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#save(java.io.PrintWriter)
- */
- public void save(PrintWriter writer) {
- if (isLoaded()) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
- writer.println("<?pde version=\"3.2\"?>"); //$NON-NLS-1$
- writer.println();
- getTarget().write("", writer); //$NON-NLS-1$
- }
- setDirty(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#setDirty(boolean)
- */
- public void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.AbstractModel#fireModelChanged(org.eclipse.pde.core.IModelChangedEvent)
- */
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(true);
- super.fireModelChanged(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.product.ProductModel#isEditable()
- */
- public boolean isEditable() {
- return fEditable;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java
deleted file mode 100644
index e962e18..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import javax.xml.parsers.FactoryConfigurationError;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.plugin.PluginExtension;
-import org.eclipse.pde.internal.core.plugin.PluginExtensionPoint;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-public class CoreUtility {
-
- /**
- * Read a file from an InputStream and write it to the file system.
- *
- * @param in InputStream from which to read.
- * @param file output file to create.
- * @exception IOException
- */
- public static void readFile(InputStream in, File file) throws IOException {
- FileOutputStream fos = null;
- try {
- fos = new FileOutputStream(file);
-
- byte buffer[] = new byte[1024];
- int count;
- while ((count = in.read(buffer, 0, buffer.length)) > 0) {
- fos.write(buffer, 0, count);
- }
-
- fos.close();
- fos = null;
-
- in.close();
- in = null;
- } catch (IOException e) {
- // close open streams
- if (fos != null) {
- try {
- fos.close();
- } catch (IOException ee) {
- }
- }
-
- if (in != null) {
- try {
- in.close();
- } catch (IOException ee) {
- }
- }
-
- throw e;
- }
- }
-
- public static void addNatureToProject(IProject proj, String natureId,
- IProgressMonitor monitor) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length] = natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, monitor);
- }
-
- public static boolean isInterestingExtensionPoint(String point) {
- return "org.eclipse.pde.core.source".equals(point) //$NON-NLS-1$
- || "org.eclipse.core.runtime.products".equals(point) //$NON-NLS-1$
- || "org.eclipse.pde.core.javadoc".equals(point) //$NON-NLS-1$
- || "org.eclipse.ui.intro".equals(point); //$NON-NLS-1$
- }
-
- public static void createFolder(IFolder folder) throws CoreException {
- if (!folder.exists()) {
- IContainer parent = folder.getParent();
- if (parent instanceof IFolder) {
- createFolder((IFolder) parent);
- }
- folder.create(true, true, null);
- }
- }
-
- public static void createProject(IProject project, IPath location,
- IProgressMonitor monitor) throws CoreException {
- if (!Platform.getLocation().equals(location)) {
- IProjectDescription desc = project.getWorkspace()
- .newProjectDescription(project.getName());
- desc.setLocation(location);
- project.create(desc, monitor);
- } else
- project.create(monitor);
- }
-
- public static String getWritableString(String source) {
- if (source == null)
- return ""; //$NON-NLS-1$
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- switch (c) {
- case '&' :
- buf.append("&"); //$NON-NLS-1$
- break;
- case '<' :
- buf.append("<"); //$NON-NLS-1$
- break;
- case '>' :
- buf.append(">"); //$NON-NLS-1$
- break;
- case '\'' :
- buf.append("'"); //$NON-NLS-1$
- break;
- case '\"' :
- buf.append("""); //$NON-NLS-1$
- break;
- default :
- buf.append(c);
- break;
- }
- }
- return buf.toString();
- }
-
- public static String normalize(String text) {
- if (text == null || text.trim().length() == 0)
- return ""; //$NON-NLS-1$
-
- text = text.replaceAll("\\r|\\n|\\f|\\t", " "); //$NON-NLS-1$ //$NON-NLS-2$
- return text.replaceAll("\\s+", " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public static void deleteContent(File curr) {
- if (curr.exists()) {
- if (curr.isDirectory()) {
- File[] children = curr.listFiles();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- deleteContent(children[i]);
- }
- }
- }
- curr.delete();
- }
- }
-
- public static Element writeExtension(Document doc, IPluginExtension extension) {
- Element child = doc.createElement("extension"); //$NON-NLS-1$
- if (extension.getPoint() != null)
- child.setAttribute("point", getWritableString(extension.getPoint())); //$NON-NLS-1$
- if (extension.getName() != null)
- child.setAttribute("name", getWritableString(extension.getName())); //$NON-NLS-1$
- if (extension.getId() != null)
- child.setAttribute("id", getWritableString(extension.getId())); //$NON-NLS-1$
- if (extension instanceof PluginExtension)
- child.setAttribute("line", Integer.toString(((PluginExtension)extension).getStartLine())); //$NON-NLS-1$
- IPluginObject[] children = extension.getChildren();
- for (int i = 0; i < children.length; i++) {
- child.appendChild(writeElement(doc, (IPluginElement)children[i]));
- }
- return child;
- }
-
- public static Element writeElement(Document doc, IPluginElement element) {
- Element child = doc.createElement(element.getName());
- IPluginAttribute[] attrs = element.getAttributes();
- for (int i = 0; i < attrs.length; i++) {
- child.setAttribute(attrs[i].getName(), getWritableString(attrs[i].getValue()));
- }
- IPluginObject[] elements = element.getChildren();
- for (int i = 0; i < elements.length; i++) {
- child.appendChild(writeElement(doc, (IPluginElement)elements[i]));
- }
- return child;
- }
-
- public static Element writeExtensionPoint(Document doc, IPluginExtensionPoint extPoint) {
- Element child = doc.createElement("extension-point"); //$NON-NLS-1$
- if (extPoint.getId() != null)
- child.setAttribute("id", getWritableString(extPoint.getId())); //$NON-NLS-1$
- if (extPoint.getName() != null)
- child.setAttribute("name", getWritableString(extPoint.getName())); //$NON-NLS-1$
- if (extPoint.getSchema() != null)
- child.setAttribute("schema", getWritableString(extPoint.getSchema())); //$NON-NLS-1$
- if (extPoint instanceof PluginExtensionPoint)
- child.setAttribute("line", Integer.toString(((PluginExtensionPoint)extPoint).getStartLine())); //$NON-NLS-1$
- return child;
- }
-
- public static boolean guessUnpack(BundleDescription bundle) {
- if (bundle == null)
- return true;
-
- if (new File(bundle.getLocation()).isFile())
- return false;
-
- IWorkspaceRoot root = PDECore.getWorkspace().getRoot();
- IContainer container = root.getContainerForLocation(new Path(bundle.getLocation()));
- if (container == null)
- return true;
-
- if (container instanceof IProject) {
- try {
- if (!((IProject)container).hasNature(JavaCore.NATURE_ID))
- return true;
- } catch (CoreException e) {
- }
- }
-
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(bundle);
- if (model == null)
- return true;
-
- IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
- if (libraries.length == 0)
- return false;
-
- for (int i = 0; i < libraries.length; i++) {
- if (libraries[i].getName().equals(".")) //$NON-NLS-1$
- return false;
- }
- return true;
- }
-
- public static boolean jarContainsResource(File file, String resource, boolean directory) {
- ZipFile jarFile = null;
- try {
- jarFile = new ZipFile(file, ZipFile.OPEN_READ);
- ZipEntry resourceEntry = jarFile.getEntry(resource);
- if (resourceEntry != null)
- return directory ? resourceEntry.isDirectory() : true;
- } catch (IOException e) {
- } catch (FactoryConfigurationError e) {
- } finally {
- try {
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e2) {
- }
- }
- return false;
- }
-
- public static void copyFile(IPath originPath, String name, File target) {
- File source = new File(originPath.toFile(), name);
- if (source.exists() == false)
- return;
- FileInputStream is = null;
- FileOutputStream os = null;
- try {
- is = new FileInputStream(source);
- os = new FileOutputStream(target);
- byte[] buf = new byte[1024];
- long currentLen = 0;
- int len = is.read(buf);
- while (len != -1) {
- currentLen += len;
- os.write(buf, 0, len);
- len = is.read(buf);
- }
- } catch (IOException e) {
- } finally {
- try {
- if (is != null)
- is.close();
- if (os != null)
- os.close();
- } catch (IOException e) {
- }
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/IdUtil.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/IdUtil.java
deleted file mode 100644
index b4500b8..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/IdUtil.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.util;
-
-public class IdUtil {
- public static boolean isValidPluginId(String name) {
- if (name.length() <= 0) {
- return false;
- }
- for (int i = 0; i < name.length(); i++) {
- char c = name.charAt(i);
- if ((c < 'A' || 'Z' < c) && (c < 'a' || 'z' < c)
- && (c < '0' || '9' < c) && c != '_') {
- if (i == 0 || i == name.length() - 1 || c != '.') {
- return false;
- }
- }
- }
- return true;
- }
-
- public static boolean isValidExtensionPointId(String name) {
- if (name.length() <= 0) {
- return false;
- }
- for (int i = 0; i < name.length(); i++) {
- char c = name.charAt(i);
- if ((c < 'A' || 'Z' < c) && (c < 'a' || 'z' < c)
- && (c < '0' || '9' < c) && c != '_') {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PatternConstructor.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PatternConstructor.java
deleted file mode 100644
index 860dd22..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PatternConstructor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.util;
-
-import java.util.regex.Pattern;
-
-public class PatternConstructor {
- private static final Pattern PATTERN_BACK_SLASH = Pattern.compile("\\\\"); //$NON-NLS-1$
-
- private static final Pattern PATTERN_QUESTION = Pattern.compile("\\?"); //$NON-NLS-1$
-
- private static final Pattern PATTERN_STAR = Pattern.compile("\\*"); //$NON-NLS-1$
-
- private static final Pattern PATTERN_LBRACKET = Pattern.compile("\\("); //$NON-NLS-1$
-
- private static final Pattern PATTERN_RBRACKET = Pattern.compile("\\)"); //$NON-NLS-1$
- /*
- * Converts user string to regular expres '*' and '?' to regEx variables.
- *
- */
- private static String asRegEx(String pattern, boolean group) {
- // Replace \ with \\, * with .* and ? with .
- // Quote remaining characters
- String result1 = PATTERN_BACK_SLASH.matcher(pattern).replaceAll(
- "\\\\E\\\\\\\\\\\\Q"); //$NON-NLS-1$
- String result2 = PATTERN_STAR.matcher(result1).replaceAll(
- "\\\\E.*\\\\Q"); //$NON-NLS-1$
- String result3 = PATTERN_QUESTION.matcher(result2).replaceAll(
- "\\\\E.\\\\Q"); //$NON-NLS-1$
- if (group) {
- result3 = PATTERN_LBRACKET.matcher(result3).replaceAll(
- "\\\\E(\\\\Q"); //$NON-NLS-1$
- result3 = PATTERN_RBRACKET.matcher(result3).replaceAll(
- "\\\\E)\\\\Q"); //$NON-NLS-1$
- }
- return "\\Q" + result3 + "\\E"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Creates a regular expression pattern from the pattern string (which is
- * our old 'StringMatcher' format).
- *
- * @param pattern
- * The search pattern
- * @param isCaseSensitive
- * Set to <code>true</code> to create a case insensitve pattern
- * @return The created pattern
- */
- public static Pattern createPattern(String pattern, boolean isCaseSensitive) {
- if (isCaseSensitive)
- return Pattern.compile(asRegEx(pattern, false));
- return Pattern.compile(asRegEx(pattern, false), Pattern.CASE_INSENSITIVE
- | Pattern.UNICODE_CASE);
- }
- public static Pattern createGroupedPattern(String pattern, boolean isCaseSensitive) {
- if (isCaseSensitive)
- return Pattern.compile(asRegEx(pattern, true));
- return Pattern.compile(asRegEx(pattern, true), Pattern.CASE_INSENSITIVE
- | Pattern.UNICODE_CASE);
- }
-
- private PatternConstructor() {
- }
-}
diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PropertiesUtil.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PropertiesUtil.java
deleted file mode 100644
index c3f44b3..0000000
--- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/PropertiesUtil.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 26, 2003
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.pde.internal.core.util;
-
-import java.io.PrintWriter;
-import java.util.Enumeration;
-
-public class PropertiesUtil {
- private static final char[] HEX =
- {
- '0',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- 'A',
- 'B',
- 'C',
- 'D',
- 'E',
- 'F' };
-
- public static String createWritableName(String source) {
- if (source.indexOf(' ') >= 0) {
- // has blanks
- StringBuffer writableName = new StringBuffer();
- for (int i = 0; i < source.length(); i++) {
- char c = source.charAt(i);
- if (c == ' ') {
- writableName.append("\\ "); //$NON-NLS-1$
- } else
- writableName.append(c);
- }
- source = writableName.toString();
- }
- return createEscapedValue(source);
- }
-
- public static String createEscapedValue(String value) {
- // if required, escape property values as \\uXXXX
- StringBuffer buf = new StringBuffer(value.length() * 2);
- // assume expansion by less than factor of 2
- for (int i = 0; i < value.length(); i++) {
- char character = value.charAt(i);
- if (character == '\\'
- || character == '\t'
- || character == '\r'
- || character == '\n'
- || character == '\f') {
- // handle characters requiring leading \
- buf.append('\\');
- buf.append(character);
- } else if ((character < 0x0020) || (character > 0x007e)) {
- // handle characters outside base range (encoded)
- buf.append('\\');
- buf.append('u');
- buf.append(HEX[(character >> 12) & 0xF]); // first nibble
- buf.append(HEX[(character >> 8) & 0xF]); // second nibble
- buf.append(HEX[(character >> 4) & 0xF]); // third nibble
- buf.append(HEX[character & 0xF]); // fourth nibble
- } else {
- // handle base characters
- buf.append(character);
- }
- }
- return buf.toString();
- }
-
- /*
- * Copied from org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizardPage.windEscapeChars(String s)
- */
- public static String windEscapeChars(String s) {
- if (s == null)
- return null;
-
- char aChar;
- int len= s.length();
- StringBuffer outBuffer= new StringBuffer(len);
-
- for (int x= 0; x < len;) {
- aChar= s.charAt(x++);
- if (aChar == '\\') {
- aChar= s.charAt(x++);
- if (aChar == 'u') {
- // Read the xxxx
- int value= 0;
- for (int i= 0; i < 4; i++) {
- aChar= s.charAt(x++);
- switch (aChar) {
- case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- value= (value << 4) + aChar - '0';
- break;
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- value= (value << 4) + 10 + aChar - 'a';
- break;
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- value= (value << 4) + 10 + aChar - 'A';
- break;
- default:
- throw new IllegalArgumentException("Malformed \\uxxxx encoding."); //$NON-NLS-1$
- }
- }
- outBuffer.append((char) value);
- } else {
- if (aChar == 't') {
- outBuffer.append('\t');
- } else {
- if (aChar == 'r') {
- outBuffer.append('\r');
- } else {
- if (aChar == 'n') {
- outBuffer.append('\n');
- } else {
- if (aChar == 'f') {
- outBuffer.append('\f');
- } else {
- outBuffer.append(aChar);
- }
- }
- }
- }
- }
- } else
- outBuffer.append(aChar);
- }
- return outBuffer.toString();
- }
- public static void writeKeyValuePair(String indent, String name, String value, PrintWriter writer) {
- String writableName = createWritableName(name);
- writer.print(writableName + " = "); //$NON-NLS-1$
-
- writer.println(PropertiesUtil.createEscapedValue(value));
- }
-
- public static void writeKeyValuePair(String indent, String name, Enumeration tokens, PrintWriter writer) {
- String writableName = createWritableName(name);
- writer.print(writableName + " = "); //$NON-NLS-1$
- if (!tokens.hasMoreElements()) {
- writer.println();
- return;
- }
- int indentLength = name.length() + 3;
- for (;tokens.hasMoreElements();) {
- String token = tokens.nextElement().toString();
- writer.print(PropertiesUtil.createEscapedValue(token));
- if (tokens.hasMoreElements()) {
- writer.println(",\\"); //$NON-NLS-1$
- for (int j = 0; j < indentLength; j++) {
- writer.print(" "); //$NON-NLS-1$
- }
- } else
- writer.println(""); //$NON-NLS-1$
- }
- }
-
- public static String writeKeyValuePair(String name, String[] tokens) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(createWritableName(name));
- buffer.append(" = "); //$NON-NLS-1$
- int indentLength = name.length() + 3;
- for (int i = 0; i < tokens.length; i++) {
- buffer.append(createEscapedValue(tokens[i]));
- if (i < tokens.length - 1) {
- buffer.append(",\\" + System.getProperty("line.separator")); //$NON-NLS-1$ //$NON-NLS-2$
- for (int j = 0; j < indentLength; j++) {
- buffer.append(" "); //$NON-NLS-1$
- }
- }
- }
- buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/ui/org.eclipse.pde.core/targets/rcp.target b/ui/org.eclipse.pde.core/targets/rcp.target
deleted file mode 100644
index 4b8872f..0000000
--- a/ui/org.eclipse.pde.core/targets/rcp.target
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.2"?>
-
-<target id="org.eclipse.pde.core.binaryRCP" name="Base RCP (Binary Only)">
-
- <location useDefault="true"/>
-
- <content>
- <plugins>
- </plugins>
- <features>
- <feature id="org.eclipse.rcp"/>
- </features>
- </content>
-
-</target>
diff --git a/ui/org.eclipse.pde.core/targets/rcpWithSource.target b/ui/org.eclipse.pde.core/targets/rcpWithSource.target
deleted file mode 100644
index 6891183..0000000
--- a/ui/org.eclipse.pde.core/targets/rcpWithSource.target
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.2"?>
-
-<target id="org.eclipse.pde.core.rcpWithSource" name="Base RCP with Source">
-
- <location useDefault="true"/>
-
- <content>
- <plugins>
- </plugins>
- <features>
- <feature id="org.eclipse.rcp"/>
- <feature id="org.eclipse.rcp.source"/>
- </features>
- </content>
-
-</target>
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/AbstractEditingModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/AbstractEditingModel.java
deleted file mode 100644
index fa753d2..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/AbstractEditingModel.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.IModelChangedListener;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.internal.core.IModelChangeProviderExtension;
-import org.eclipse.pde.internal.core.IModelChangedListenerFilter;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-
-public abstract class AbstractEditingModel extends PlatformObject implements IEditingModel, IModelChangeProviderExtension {
- private ArrayList fListeners = new ArrayList();
- protected boolean fReconciling;
- protected boolean fInSync = true;
- protected boolean fLoaded = false;
- protected boolean fDisposed;
- protected long fTimestamp;
- private transient NLResourceHelper fNLResourceHelper;
- private IDocument fDocument;
- private boolean fDirty;
- private String fCharset;
- private IResource fUnderlyingResource;
- private String fInstallLocation;
- private boolean fStale;
-
- public AbstractEditingModel(IDocument document, boolean isReconciling) {
- fDocument = document;
- fReconciling = isReconciling;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#dispose()
- */
- public void dispose() {
- if (fNLResourceHelper != null) {
- fNLResourceHelper.dispose();
- fNLResourceHelper = null;
- }
- fDisposed = true;
- fListeners.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#getResourceString(java.lang.String)
- */
- public String getResourceString(String key) {
- if (key == null || key.length() == 0)
- return ""; //$NON-NLS-1$
-
- if (fNLResourceHelper == null)
- fNLResourceHelper = createNLResourceHelper();
-
- return (fNLResourceHelper == null) ? key : fNLResourceHelper.getResourceString(key);
- }
-
- protected abstract NLResourceHelper createNLResourceHelper();
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isDisposed()
- */
- public boolean isDisposed() {
- return fDisposed;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isEditable()
- */
- public boolean isEditable() {
- return fReconciling;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isLoaded()
- */
- public boolean isLoaded() {
- return fLoaded;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isInSync()
- */
- public boolean isInSync() {
- return fInSync;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isValid()
- */
- public boolean isValid() {
- return isLoaded();
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#getTimeStamp()
- */
- public final long getTimeStamp() {
- return fTimestamp;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load()
- */
- public final void load() throws CoreException {
- try {
- load(getInputStream(getDocument()), false);
- } catch (UnsupportedEncodingException e) {
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#reload(java.io.InputStream, boolean)
- */
- public final void reload(InputStream source, boolean outOfSync)
- throws CoreException {
- load(source, outOfSync);
- fireModelChanged(
- new ModelChangedEvent(this,
- IModelChangedEvent.WORLD_CHANGED,
- new Object[] {this},
- null));
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#isReconcilingModel()
- */
- public boolean isReconcilingModel() {
- return fReconciling;
- }
-
- public IDocument getDocument() {
- return fDocument;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.text.IReconcilingParticipant#reconciled(org.eclipse.jface.text.IDocument)
- */
- public final void reconciled(IDocument document) {
- if (isReconcilingModel()) {
- try {
- if (isStale()) {
- adjustOffsets(document);
- setStale(false);
- } else {
- reload(getInputStream(document), false);
- }
- if (isDirty())
- setDirty(false);
- } catch (Exception e) {
- }
- }
- }
-
- protected abstract void adjustOffsets(IDocument document);
-
- protected InputStream getInputStream(IDocument document) throws UnsupportedEncodingException {
- return new ByteArrayInputStream(document.get().getBytes(getCharset()));
- }
-
- public String getCharset() {
- return fCharset != null ? fCharset : "UTF-8"; //$NON-NLS-1$
- }
-
- public void setCharset(String charset) {
- fCharset = charset;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelChangeProvider#addModelChangedListener(org.eclipse.pde.core.IModelChangedListener)
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
- }
- public void transferListenersTo(IModelChangeProviderExtension target, IModelChangedListenerFilter filter) {
- List oldList = (List)fListeners.clone();
- for (int i=0; i<oldList.size(); i++) {
- IModelChangedListener listener = (IModelChangedListener)oldList.get(i);
- if (filter==null || filter.accept(listener)) {
- // add the listener to the target
- target.addModelChangedListener(listener);
- // remove the listener from our list
- fListeners.remove(listener);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelChangeProvider#fireModelChanged(org.eclipse.pde.core.IModelChangedEvent)
- */
- public void fireModelChanged(IModelChangedEvent event) {
- setDirty(event.getChangeType() != IModelChangedEvent.WORLD_CHANGED);
- for (int i = 0; i < fListeners.size(); i++) {
- ((IModelChangedListener)fListeners.get(i)).modelChanged(event);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelChangeProvider#fireModelObjectChanged(java.lang.Object, java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void fireModelObjectChanged(Object object, String property, Object oldValue, Object newValue) {
- fireModelChanged(new ModelChangedEvent(this, object, property, oldValue, newValue));
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModelChangeProvider#removeModelChangedListener(org.eclipse.pde.core.IModelChangedListener)
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- fListeners.remove(listener);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#isDirty()
- */
- public boolean isDirty() {
- return fDirty;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#save(java.io.PrintWriter)
- */
- public void save(PrintWriter writer) {
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IEditable#setDirty(boolean)
- */
- public void setDirty(boolean dirty) {
- this.fDirty = dirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IEditingModel#isStale()
- */
- public boolean isStale() {
- return fStale;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IEditingModel#setStale(boolean)
- */
- public void setStale(boolean stale) {
- fStale = stale;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#getUnderlyingResource()
- */
- public IResource getUnderlyingResource() {
- return fUnderlyingResource;
- }
-
- public void setUnderlyingResource(IResource resource) {
- fUnderlyingResource = resource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.ISharedPluginModel#getInstallLocation()
- */
- public String getInstallLocation() {
- if (fInstallLocation == null && fUnderlyingResource != null) {
- IPath path = fUnderlyingResource.getProject().getLocation();
- return path != null ? path.addTrailingSeparator().toString() : null;
- }
- return fInstallLocation;
- }
-
- public void setInstallLocation(String location) {
- fInstallLocation = location;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentHandler.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentHandler.java
deleted file mode 100644
index c129b5b..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentHandler.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import java.util.ArrayList;
-import java.util.Stack;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public abstract class DocumentHandler extends DefaultHandler {
-
- protected FindReplaceDocumentAdapter fFindReplaceAdapter;
- protected Stack fDocumentNodeStack = new Stack();
- protected int fHighestOffset = 0;
- private Locator fLocator;
-
- public DocumentHandler() {
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- fDocumentNodeStack.clear();
- fHighestOffset = 0;
- fFindReplaceAdapter = new FindReplaceDocumentAdapter(getDocument());
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- IDocumentNode parent = fDocumentNodeStack.isEmpty() ? null : (IDocumentNode)fDocumentNodeStack.peek();
- IDocumentNode node = getDocumentNode(qName, parent);
- node.setXMLTagName(qName);
- try {
- int nodeOffset = getStartOffset(qName);
- node.setOffset(nodeOffset);
- IDocument doc = getDocument();
- int line = doc.getLineOfOffset(nodeOffset);
- node.setLineIndent(node.getOffset() - doc.getLineOffset(line));
- // create attributes
- for (int i = 0; i < attributes.getLength(); i++) {
- String attName = attributes.getQName(i);
- String attValue = attributes.getValue(i);
- IDocumentAttribute attribute = getDocumentAttribute(attName, attValue, node);
- if (attribute != null) {
- IRegion region = getAttributeRegion(attName, attValue, nodeOffset);
- if (region == null) {
- attValue = CoreUtility.getWritableString(attValue);
- region = getAttributeRegion(attName, attValue, nodeOffset);
- }
- if (region != null) {
- attribute.setNameOffset(region.getOffset());
- attribute.setNameLength(attName.length());
- attribute.setValueOffset(region.getOffset() + region.getLength() - 1 - attValue.length());
- attribute.setValueLength(attValue.length());
- }
- node.setXMLAttribute(attribute);
- }
- }
- } catch (BadLocationException e) {
- }
- appendChildToParent(parent, node);
- fDocumentNodeStack.push(node);
- }
-
- protected void appendChildToParent(IDocumentNode parent, IDocumentNode child) {
- if (parent != null && child != null) {
- parent.addChildNode(child);
- }
- }
-
- protected abstract IDocumentNode getDocumentNode(String name, IDocumentNode parent);
-
- protected abstract IDocumentAttribute getDocumentAttribute(String name, String value, IDocumentNode parent);
-
- private int getStartOffset(String elementName) throws BadLocationException {
- int line = fLocator.getLineNumber();
- int col = fLocator.getColumnNumber();
- IDocument doc = getDocument();
- if (col < 0)
- col = doc.getLineLength(line);
- String text = doc.get(fHighestOffset + 1, doc.getLineOffset(line) - fHighestOffset - 1);
-
- ArrayList commentPositions = new ArrayList();
- for (int idx = 0; idx < text.length();) {
- idx = text.indexOf("<!--", idx); //$NON-NLS-1$
- if (idx == -1)
- break;
- int end = text.indexOf("-->", idx); //$NON-NLS-1$
- if (end == -1)
- break;
-
- commentPositions.add(new Position(idx, end - idx));
- idx = end + 1;
- }
-
- int idx = 0;
- for (; idx < text.length(); idx += 1) {
- idx = text.indexOf("<" + elementName, idx); //$NON-NLS-1$
- if (idx == -1)
- break;
- boolean valid = true;
- for (int i = 0; i < commentPositions.size(); i++) {
- Position pos = (Position)commentPositions.get(i);
- if (pos.includes(idx)) {
- valid = false;
- break;
- }
- }
- if (valid)
- break;
- }
- if (idx > -1)
- fHighestOffset += idx + 1;
- return fHighestOffset;
- }
-
- private int getElementLength(IDocumentNode node, int line, int column) throws BadLocationException {
- int endIndex = node.getOffset();
- IDocument doc = getDocument();
- int start = Math.max(doc.getLineOffset(line), node.getOffset());
- column = doc.getLineLength(line);
- String lineText= doc.get(start, column - start + doc.getLineOffset(line));
-
- int index = lineText.indexOf("</" + node.getXMLTagName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- if (index == -1) {
- index= lineText.indexOf("/>"); //$NON-NLS-1$
- if (index == -1 ) {
- endIndex = column;
- } else {
- endIndex = index + 2;
- }
- } else{
- endIndex = index + node.getXMLTagName().length() + 3;
- }
- return start + endIndex - node.getOffset();
- }
-
- private IRegion getAttributeRegion(String name, String value, int offset) throws BadLocationException{
- IRegion nameRegion = fFindReplaceAdapter.find(offset, name+"\\s*=\\s*\"", true, true, false, true); //$NON-NLS-1$
- if (nameRegion != null) {
- if (getDocument().get(nameRegion.getOffset() + nameRegion.getLength(), value.length()).equals(value))
- return new Region(nameRegion.getOffset(), nameRegion.getLength() + value.length() + 1);
- }
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- IDocumentNode node = (IDocumentNode)fDocumentNodeStack.pop();
- try {
- node.setLength(getElementLength(node, fLocator.getLineNumber() - 1, fLocator.getColumnNumber()));
- setTextNodeOffset(node);
- } catch (BadLocationException e) {
- }
- }
-
- protected void setTextNodeOffset(IDocumentNode node) throws BadLocationException {
- IDocumentTextNode textNode = node.getTextNode();
- if (textNode != null && textNode.getText() != null) {
- if (textNode.getText().trim().length() == 0) {
- node.removeTextNode();
- return;
- }
- IDocument doc = getDocument();
- String text = doc.get(node.getOffset(), node.getLength());
- textNode.setOffset(node.getOffset() + text.indexOf(textNode.getText()));
- text = doc.get(textNode.getOffset(), node.getLength() - textNode.getOffset() + node.getOffset());
- int index = text.indexOf('<');
- for (index -= 1; index >= 0; index--) {
- if (!Character.isWhitespace(text.charAt(index))) {
- index += 1;
- break;
- }
- }
- textNode.setLength(index);
- textNode.setText(doc.get(textNode.getOffset(), index));
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException e) throws SAXException {
- generateErrorElementHierarchy();
- }
-
- /**
- *
- */
- private void generateErrorElementHierarchy() {
- while (!fDocumentNodeStack.isEmpty()) {
- ((IDocumentNode)fDocumentNodeStack.pop()).setIsErrorNode(true);
- }
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException e) throws SAXException {
- generateErrorElementHierarchy();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- fLocator = locator;
- }
-
- protected abstract IDocument getDocument();
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentTextNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentTextNode.java
deleted file mode 100644
index 5b0b63a..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/DocumentTextNode.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-public class DocumentTextNode implements IDocumentTextNode {
- private int fOffset = -1;
- private int fLength = 0;
- private IDocumentNode fEnclosingElement;
- private String fText;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setEnclosingElement(org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public void setEnclosingElement(IDocumentNode node) {
- fEnclosingElement = node;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getEnclosingElement()
- */
- public IDocumentNode getEnclosingElement() {
- return fEnclosingElement;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setText(java.lang.String)
- */
- public void setText(String text) {
- fText = text;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getText()
- */
- public String getText() {
- return fText == null ? "" : fText; //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setOffset(int)
- */
- public void setOffset(int offset) {
- fOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getOffset()
- */
- public int getOffset() {
- return fOffset;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getLength()
- */
- public int getLength() {
- return fLength;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setLength(int)
- */
- public void setLength(int length) {
- fLength = length;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentAttribute.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentAttribute.java
deleted file mode 100644
index 841d1ee..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentAttribute.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import java.io.Serializable;
-
-public interface IDocumentAttribute extends Serializable {
-
- void setEnclosingElement(IDocumentNode node);
- IDocumentNode getEnclosingElement();
-
- void setNameOffset(int offset);
- int getNameOffset();
-
- void setNameLength(int length);
- int getNameLength();
-
- void setValueOffset(int offset);
- int getValueOffset();
-
- void setValueLength(int length);
- int getValueLength();
-
- String getAttributeName();
- String getAttributeValue();
-
- String write();
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentKey.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentKey.java
deleted file mode 100644
index c48c9ce..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentKey.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import org.eclipse.pde.core.IWritable;
-
-public interface IDocumentKey extends IWritable, IDocumentRange {
- void setName(String name);
- String getName();
-
- void setOffset(int offset);
- void setLength(int length);
-
- String write();
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentNode.java
deleted file mode 100644
index 7ff7f3f..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentNode.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import java.io.Serializable;
-
-public interface IDocumentNode extends Serializable, IDocumentRange {
-
- IDocumentNode getParentNode();
- void setParentNode(IDocumentNode node);
-
- void addChildNode(IDocumentNode child);
- void addChildNode(IDocumentNode child, int position);
- IDocumentNode removeChildNode(IDocumentNode child);
- IDocumentNode[] getChildNodes();
-
- void addTextNode(IDocumentTextNode textNode);
- IDocumentTextNode getTextNode();
- void removeTextNode();
-
- int indexOf(IDocumentNode child);
- IDocumentNode getChildAt(int index);
-
- IDocumentNode getPreviousSibling();
- void setPreviousSibling(IDocumentNode sibling);
-
- void swap(IDocumentNode child1, IDocumentNode child2);
-
- void setXMLTagName(String tag);
- String getXMLTagName();
-
- void setXMLAttribute(IDocumentAttribute attribute);
- void setXMLAttribute(String name, String value);
- String getXMLAttributeValue(String name);
-
- IDocumentAttribute getDocumentAttribute(String name);
- IDocumentAttribute[] getNodeAttributes();
- void removeDocumentAttribute(IDocumentAttribute attr);
-
- boolean isErrorNode();
- void setIsErrorNode(boolean isErrorNode);
-
- void setOffset(int offset);
- void setLength(int length);
-
- void setLineIndent(int indent);
- int getLineIndent();
-
- String write(boolean indent);
- String writeShallow(boolean terminate);
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentRange.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentRange.java
deleted file mode 100644
index 48f21d8..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentRange.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-public interface IDocumentRange {
- int getOffset();
- int getLength();
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentTextNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentTextNode.java
deleted file mode 100644
index c0332cb..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IDocumentTextNode.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-public interface IDocumentTextNode {
-
- void setEnclosingElement(IDocumentNode node);
- IDocumentNode getEnclosingElement();
-
- void setText(String text);
- String getText();
-
- void setOffset(int offset);
- int getOffset();
-
- void setLength(int length);
- int getLength();
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IEditingModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IEditingModel.java
deleted file mode 100644
index 10a7bf9..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IEditingModel.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IEditable;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-
-public interface IEditingModel extends IModel, IModelChangeProvider, IReconcilingParticipant, IEditable {
-
-public IDocument getDocument();
-public void setStale(boolean stale);
-public boolean isStale();
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IReconcilingParticipant.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IReconcilingParticipant.java
deleted file mode 100644
index 674d365..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/IReconcilingParticipant.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import org.eclipse.jface.text.IDocument;
-
-public interface IReconcilingParticipant {
-
- void reconciled(IDocument document);
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/XMLEditingModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/XMLEditingModel.java
deleted file mode 100644
index 4a6c063..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/XMLEditingModel.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IModel;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public abstract class XMLEditingModel extends AbstractEditingModel {
-
- private SAXParser fParser;
-
- public XMLEditingModel(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
- */
- public void load(InputStream source, boolean outOfSync) {
- try {
- fLoaded = true;
- getParser().parse(source, createDocumentHandler(this));
- } catch (SAXException e) {
- fLoaded = false;
- } catch (IOException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#adjustOffsets(org.eclipse.jface.text.IDocument)
- */
- protected void adjustOffsets(IDocument document) {
- try {
- getParser().parse(getInputStream(document), createNodeOffsetHandler(this));
- } catch (SAXException e) {
- } catch (IOException e) {
- }
- }
-
- protected abstract DefaultHandler createNodeOffsetHandler(IModel model);
-
- protected abstract DefaultHandler createDocumentHandler(IModel model);
-
- private SAXParser getParser() {
- try {
- if (fParser == null) {
- fParser = SAXParserFactory.newInstance().newSAXParser();
- }
- } catch (Exception e) {
- }
- return fParser;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/Build.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/Build.java
deleted file mode 100644
index eb6b8c1..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/Build.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.build;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.internal.core.text.IDocumentKey;
-import org.eclipse.pde.internal.core.util.PropertiesUtil;
-
-public class Build implements IBuild {
-
- private BuildModel fModel;
- private HashMap fEntries = new HashMap();
-
- public Build(BuildModel model) {
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuild#add(org.eclipse.pde.core.build.IBuildEntry)
- */
- public void add(IBuildEntry entry) throws CoreException {
- fEntries.put(entry.getName(), entry);
- fModel.fireModelChanged(new ModelChangedEvent(fModel,
- IModelChangedEvent.INSERT, new Object[]{entry}, null));
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuild#getBuildEntries()
- */
- public IBuildEntry[] getBuildEntries() {
- return (IBuildEntry[])fEntries.values().toArray(new IBuildEntry[fEntries.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuild#getEntry(java.lang.String)
- */
- public IBuildEntry getEntry(String name) {
- return (IBuildEntry)fEntries.get(name);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuild#remove(org.eclipse.pde.core.build.IBuildEntry)
- */
- public void remove(IBuildEntry entry) throws CoreException {
- fEntries.remove(entry.getName());
- fModel.fireModelChanged(new ModelChangedEvent(fModel,
- IModelChangedEvent.REMOVE, new Object[]{entry}, null));
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String,
- * java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- }
-
- public void load(InputStream source) throws IOException {
- fEntries.clear();
- Properties properties = new Properties();
- properties.load(source);
- Enumeration keys = properties.keys();
- while (keys.hasMoreElements()) {
- String name = keys.nextElement().toString();
- BuildEntry entry = (BuildEntry)fModel.getFactory().createEntry(name);
- entry.processEntry(properties.get(name).toString());
- fEntries.put(name, entry);
- }
- adjustOffsets(fModel.getDocument());
- }
-
- public void adjustOffsets(IDocument document) {
- int lines = document.getNumberOfLines();
- try {
- IDocumentKey currentKey = null;
- for (int i = 0; i < lines; i++) {
- int offset = document.getLineOffset(i);
- int length = document.getLineLength(i);
- String line = document.get(offset, length);
- if (line.startsWith("#") | line.startsWith("!")) { //$NON-NLS-1$ //$NON-NLS-2$
- if (currentKey != null) {
- currentKey.setLength(offset - 1 - currentKey.getOffset());
- currentKey = null;
- }
- continue;
- }
-
- line = line.trim();
- if (line.length() == 0)
- continue;
-
- if (currentKey != null) {
- if (!line.endsWith("\\")) { //$NON-NLS-1$
- currentKey.setLength(offset + document.getLineLength(i) - currentKey.getOffset());
- currentKey = null;
- }
- } else {
- int index = line.indexOf('=');
- if (index == -1)
- index = line.indexOf(':');
- if (index == -1)
- index = line.indexOf(' ');
- if (index == -1)
- index = line.indexOf('\t');
- String name = (index != -1) ? line.substring(0, index).trim() : line;
- String propertyKey;
- try{
- propertyKey=PropertiesUtil.windEscapeChars(name);
- }catch(IllegalArgumentException iae){
- propertyKey = name;
- }
- currentKey = (IDocumentKey)getEntry(propertyKey);
- if (currentKey != null) {
- while (Character.isSpaceChar(document.getChar(offset))) {
- offset += 1;
- }
- currentKey.setOffset(offset);
- if (!line.endsWith("\\")) { //$NON-NLS-1$
- currentKey.setLength(document.getLineOffset(i) + document.getLineLength(i) - currentKey.getOffset());
- currentKey = null;
- }
- }
- }
- }
- } catch (BadLocationException e) {
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildEntry.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildEntry.java
deleted file mode 100644
index 4caa455..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildEntry.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.build;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.text.IDocumentKey;
-import org.eclipse.pde.internal.core.util.PropertiesUtil;
-
-public class BuildEntry implements IBuildEntry, IDocumentKey {
-
- private int fLength = -1;
- private int fOffset = -1;
- private IBuildModel fModel;
- private String fName;
- private ArrayList fTokens = new ArrayList();
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildEntry#addToken(java.lang.String)
- */
- public void addToken(String token) throws CoreException {
- fTokens.add(token);
- getModel().fireModelObjectChanged(this, getName(), null, token);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getName()
- */
- public String getName() {
- return fName;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildEntry#getTokens()
- */
- public String[] getTokens() {
- return (String[])fTokens.toArray(new String[fTokens.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildEntry#contains(java.lang.String)
- */
- public boolean contains(String token) {
- return fTokens.contains(token);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildEntry#removeToken(java.lang.String)
- */
- public void removeToken(String token) throws CoreException {
- fTokens.remove(token);
- getModel().fireModelObjectChanged(this, getName(), token, null);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildEntry#renameToken(java.lang.String, java.lang.String)
- */
- public void renameToken(String oldToken, String newToken)
- throws CoreException {
- int index = fTokens.indexOf(oldToken);
- if (index != -1) {
- fTokens.set(index, newToken);
- getModel().fireModelObjectChanged(this, getName(), oldToken, newToken);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setName(java.lang.String)
- */
- public void setName(String name) {
- String oldName = fName;
- if (getModel() != null){
- try {
- IBuild build = getModel().getBuild();
- build.remove(this);
- fName = name;
- build.add(this);
- } catch (CoreException e) {
- PDECore.logException(e);
- }
- getModel().fireModelObjectChanged(this, getName(), oldName, name);
- } else
- fName = name;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getOffset()
- */
- public int getOffset() {
- return fOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setOffset(int)
- */
- public void setOffset(int offset) {
- fOffset = offset;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getLength()
- */
- public int getLength() {
- return fLength;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setLength(int)
- */
- public void setLength(int length) {
- fLength = length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- }
-
- public void setModel(IBuildModel model) {
- fModel = model;
- }
-
- public IBuildModel getModel() {
- return fModel;
- }
-
- public void processEntry(String value) {
- StringTokenizer stok = new StringTokenizer(value, ","); //$NON-NLS-1$
- while (stok.hasMoreTokens()) {
- fTokens.add(stok.nextToken().trim());
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#write()
- */
- public String write() {
- return PropertiesUtil.writeKeyValuePair(getName(), getTokens());
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModel.java
deleted file mode 100644
index 6cf4138..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModel.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.build;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.build.IBuild;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.build.IBuildModelFactory;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.text.AbstractEditingModel;
-
-
-public class BuildModel extends AbstractEditingModel implements IBuildModel {
-
- //private Properties fProperties;
- private BuildModelFactory fFactory;
- private Build fBuild;
-
- /**
- * @param document
- * @param isReconciling
- */
- public BuildModel(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#createNLResourceHelper()
- */
- protected NLResourceHelper createNLResourceHelper() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
- */
- public void load(InputStream source, boolean outOfSync) throws CoreException {
- try {
- fLoaded = true;
- ((Build)getBuild()).load(source);
- } catch (IOException e) {
- fLoaded = false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#adjustOffsets(org.eclipse.jface.text.IDocument)
- */
- protected void adjustOffsets(IDocument document) {
- ((Build)getBuild()).adjustOffsets(document);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildModel#getBuild()
- */
- public IBuild getBuild() {
- if (fBuild == null)
- fBuild = new Build(this);
- return fBuild;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildModel#getFactory()
- */
- public IBuildModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new BuildModelFactory(this);
- return fFactory;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModelFactory.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModelFactory.java
deleted file mode 100644
index 6e78c26..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/build/BuildModelFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.build;
-
-import org.eclipse.pde.core.build.IBuildEntry;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.build.IBuildModelFactory;
-
-public class BuildModelFactory implements IBuildModelFactory {
-
- private IBuildModel fModel;
-
- public BuildModelFactory(IBuildModel model) {
- fModel = model;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.build.IBuildModelFactory#createEntry(java.lang.String)
- */
- public IBuildEntry createEntry(String name) {
- BuildEntry entry = new BuildEntry();
- entry.setName(name);
- entry.setModel(fModel);
- return entry;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BasePackageHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BasePackageHeader.java
deleted file mode 100644
index 45faeb6..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BasePackageHeader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.Constants;
-
-public abstract class BasePackageHeader extends CompositeManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BasePackageHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter, true);
- }
-
- protected String getVersionAttribute() {
- int manifestVersion = BundlePluginBase.getBundleManifestVersion(getBundle());
- return (manifestVersion < 2) ? ICoreConstants.PACKAGE_SPECIFICATION_VERSION : Constants.VERSION_ATTRIBUTE;
- }
-
- public void addPackage(PackageObject object) {
- addManifestElement(object);
- }
-
- public Object removePackage(PackageObject object) {
- return removeManifestElement(object);
- }
-
- public boolean hasPackage(String packageName) {
- return hasElement(packageName);
- }
-
- public Object removePackage(String name) {
- return removeManifestElement(name);
- }
-
- public boolean renamePackage(String oldName, String newName) {
- if (hasPackage(oldName)) {
- PackageObject object = (PackageObject)removeManifestElement(oldName);
- object.setName(newName);
- addManifestElement(object);
- return true;
- }
- return false;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/Bundle.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/Bundle.java
deleted file mode 100644
index 7aad633..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/Bundle.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.eclipse.pde.internal.core.text.IDocumentKey;
-import org.osgi.framework.Constants;
-
-public class Bundle implements IBundle {
-
- private BundleModel fModel;
- private Hashtable fDocumentHeaders = new Hashtable();
-
- public Bundle(BundleModel model) {
- fModel = model;
- }
-
- public void clearHeaders() {
- fDocumentHeaders.clear();
- }
-
- public void load(Manifest manifest) {
- Map attributes = manifest.getMainAttributes();
- Iterator iter = attributes.keySet().iterator();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name) iter.next();
- if (key.toString().equals(Constants.BUNDLE_MANIFESTVERSION)) {
- String value = (String)attributes.get(key);
- IManifestHeader header = fModel.getFactory().createHeader(key.toString(), value);
- fDocumentHeaders.put(key.toString(), header);
- break;
- }
- }
- iter = attributes.keySet().iterator();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name) iter.next();
- if (key.toString().equals(Constants.BUNDLE_MANIFESTVERSION))
- continue;
- String value = (String)attributes.get(key);
- IManifestHeader header = fModel.getFactory().createHeader(key.toString(), value);
- fDocumentHeaders.put(key.toString(), header);
- }
- adjustOffsets(fModel.getDocument());
- }
-
- public void clearOffsets() {
- Iterator iter = fDocumentHeaders.values().iterator();
- while (iter.hasNext()) {
- ManifestHeader header = (ManifestHeader)iter.next();
- header.setOffset(-1);
- header.setLength(-1);
- }
- }
-
- protected void adjustOffsets(IDocument document) {
- int lines = document.getNumberOfLines();
- try {
- IDocumentKey currentKey = null;
- for (int i = 0; i < lines; i++) {
- int offset = document.getLineOffset(i);
- int length = document.getLineLength(i);
- String line = document.get(offset, length);
-
- if (currentKey != null) {
- int lineNumber = line.startsWith(" ") ? i : i - 1; //$NON-NLS-1$
- IRegion region = document.getLineInformation(lineNumber);
- String delimiter = document.getLineDelimiter(lineNumber);
- int keyLength = region.getOffset() + region.getLength() - currentKey.getOffset();
- currentKey.setLength(delimiter != null ? keyLength + delimiter.length() : keyLength);
- if (!line.startsWith(" ")) { //$NON-NLS-1$
- currentKey = null;
- }
- }
-
- if (currentKey == null) {
- int index = line.indexOf(':');
- String name = (index != -1) ? line.substring(0, index) : line;
- currentKey = (IDocumentKey)fDocumentHeaders.get(name);
- if (currentKey != null) {
- IRegion region = document.getLineInformation(i);
- currentKey.setOffset(region.getOffset());
- String delimiter = document.getLineDelimiter(i);
- currentKey.setLength(delimiter != null ? region.getLength() + delimiter.length() : region.getLength());
- }
- }
- }
- } catch (BadLocationException e) {
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundle#setHeader(java.lang.String, java.lang.String)
- */
- public void setHeader(String key, String value) {
- IManifestHeader header = (ManifestHeader)fDocumentHeaders.get(key);
- String old = null;
- if (header == null) {
- header = getModel().getFactory().createHeader(key, value);
- } else {
- old = header.getValue();
- header.setValue(value);
- }
- fDocumentHeaders.put(key, header);
- fModel.fireModelObjectChanged(header, key, old, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundle#getHeader(java.lang.String)
- */
- public String getHeader(String key) {
- ManifestHeader header = (ManifestHeader)fDocumentHeaders.get(key);
- return (header != null) ? header.getValue() : null;
- }
-
- public IManifestHeader getManifestHeader(String key) {
- return (ManifestHeader)fDocumentHeaders.get(key);
- }
-
- public Dictionary getHeaders() {
- return fDocumentHeaders;
- }
-
- public IBundleModel getModel() {
- return fModel;
- }
-
- public String getLocalization() {
- return getHeader(Constants.BUNDLE_LOCALIZATION);
- }
-
- public void setLocalization(String localization) {
- setHeader(Constants.BUNDLE_LOCALIZATION, localization);
- }
-
- public void renameHeader(String key, String newKey) {
- ManifestHeader header = (ManifestHeader)getManifestHeader(key);
- if (header != null) {
- header.setName(newKey);
- fDocumentHeaders.put(newKey, fDocumentHeaders.remove(key));
- }
- fModel.fireModelObjectChanged(header, newKey, key, newKey);
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleActivatorHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleActivatorHeader.java
deleted file mode 100644
index 4deac6c..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleActivatorHeader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class BundleActivatorHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleActivatorHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setClassName(String className) {
- setMainComponent(className);
- }
-
- public String getClassName() {
- return getMainComponent();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleClasspathHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleClasspathHeader.java
deleted file mode 100644
index 7ccaba6..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleClasspathHeader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-
-public class BundleClasspathHeader extends CompositeManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleClasspathHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void addLibrary(String name) {
- addManifestElement(name);
- }
-
- public void removeLibrary(String name) {
- removeManifestElement(name);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleLocalizationHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleLocalizationHeader.java
deleted file mode 100644
index 084a9b5..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleLocalizationHeader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class BundleLocalizationHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleLocalizationHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setLocalization(String localization) {
- setMainComponent(localization);
- }
-
- public String getLocalization() {
- return getMainComponent();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModel.java
deleted file mode 100644
index f3e21e6..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModel.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.Manifest;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory;
-import org.eclipse.pde.internal.core.text.AbstractEditingModel;
-import org.osgi.framework.Constants;
-
-public class BundleModel extends AbstractEditingModel implements IBundleModel {
-
- private IBundle fBundle;
- private IBundleModelFactory fFactory;
- /**
- * @param document
- * @param isReconciling
- */
- public BundleModel(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- fBundle = new Bundle(this);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#createNLResourceHelper()
- */
- protected NLResourceHelper createNLResourceHelper() {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundleModel#isFragmentModel()
- */
- public boolean isFragmentModel() {
- return getBundle().getHeader(Constants.FRAGMENT_HOST) != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
- */
- public void load(InputStream source, boolean outOfSync) throws CoreException {
- try {
- fLoaded = true;
- ((Bundle)getBundle()).clearHeaders();
- ((Bundle)getBundle()).load(new Manifest(source));
- } catch (IOException e) {
- fLoaded = false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#adjustOffsets(org.eclipse.jface.text.IDocument)
- */
- protected void adjustOffsets(IDocument document) {
- ((Bundle)getBundle()).clearOffsets();
- ((Bundle)getBundle()).adjustOffsets(document);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.core.ibundle.IBundleModel#getBundle()
- */
- public IBundle getBundle() {
- return fBundle;
- }
- public IBundleModelFactory getFactory() {
- if (fFactory == null)
- fFactory = new BundleModelFactory(this);
- return fFactory;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModelFactory.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModelFactory.java
deleted file mode 100644
index 8276ee3..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleModelFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IBundleModel;
-import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-import org.osgi.framework.Constants;
-
-public class BundleModelFactory implements IBundleModelFactory {
-
- private IBundleModel fModel;
-
- public BundleModelFactory(IBundleModel model) {
- fModel = model;
- }
-
-
- public IManifestHeader createHeader() {
- return null;
- }
-
- public IManifestHeader createHeader(String key, String value) {
- ManifestHeader header = null;
- IBundle bundle = fModel.getBundle();
- String newLine;
- if (fModel instanceof BundleModel)
- newLine = TextUtilities.getDefaultLineDelimiter(((BundleModel)fModel).getDocument());
- else
- newLine = System.getProperty("line.separator"); //$NON-NLS-1$
-
- if (key.equals(Constants.BUNDLE_ACTIVATOR)) {
- header = new BundleActivatorHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_LOCALIZATION)){
- header = new BundleLocalizationHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_NAME)) {
- header = new BundleNameHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT)) {
- header = new RequiredExecutionEnvironmentHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_SYMBOLICNAME)) {
- header = new BundleSymbolicNameHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_VENDOR)) {
- header = new BundleVendorHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_VERSION)) {
- header = new BundleVersionHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.BUNDLE_CLASSPATH)) {
- header = new BundleClasspathHeader(key, value, bundle, newLine);
- } else if (key.equals(ICoreConstants.ECLIPSE_LAZYSTART) || key.equals(ICoreConstants.ECLIPSE_AUTOSTART)) {
- header = new LazyStartHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.EXPORT_PACKAGE) || key.equals(ICoreConstants.PROVIDE_PACKAGE)) {
- header = new ExportPackageHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.FRAGMENT_HOST)) {
- header = new FragmentHostHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.IMPORT_PACKAGE)){
- header = new ImportPackageHeader(key, value, bundle, newLine);
- } else if (key.equals(Constants.REQUIRE_BUNDLE)) {
- header = new RequireBundleHeader(key, value, bundle, newLine);
- } else {
- header = new ManifestHeader(key, value, bundle, newLine);
- }
- return header;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleNameHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleNameHeader.java
deleted file mode 100644
index 5f3c4ec..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleNameHeader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class BundleNameHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleNameHeader(String name, String value, IBundle bundle,
- String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public String getBundleName() {
- return getMainComponent();
- }
-
- public void setBundleName(String name) {
- setMainComponent(name);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleSymbolicNameHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleSymbolicNameHeader.java
deleted file mode 100644
index 5770580..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleSymbolicNameHeader.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.Constants;
-
-public class BundleSymbolicNameHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleSymbolicNameHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setId(String id) {
- setMainComponent(id);
- }
-
- public String getId() {
- return getMainComponent();
- }
-
- public void setSingleton(boolean singleton) {
- if (getManifestVersion() > 1) {
- setDirective(Constants.SINGLETON_DIRECTIVE,
- singleton ? Boolean.toString(true) : null);
- if (getAttribute(Constants.SINGLETON_DIRECTIVE) != null)
- setAttribute(Constants.SINGLETON_DIRECTIVE, null);
- } else {
- setAttribute(Constants.SINGLETON_DIRECTIVE,
- singleton ? Boolean.toString(true) : null);
- }
- }
-
- public boolean isSingleton() {
- String value = getManifestVersion() > 1
- ? getDirective(Constants.SINGLETON_DIRECTIVE)
- : getAttribute(Constants.SINGLETON_DIRECTIVE);
- return "true".equals(value); //$NON-NLS-1$
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleTextChangeListener.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleTextChangeListener.java
deleted file mode 100644
index af9e857..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleTextChangeListener.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.text.IDocumentKey;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-
-public class BundleTextChangeListener implements IModelTextChangeListener {
-
- private HashMap fOperationTable = new HashMap();
- private IDocument fDocument;
-
- public BundleTextChangeListener(IDocument document) {
- fDocument = document;
- }
-
- public void modelChanged(IModelChangedEvent event) {
- Object[] objects = event.getChangedObjects();
- if (objects != null) {
- for (int i = 0; i < objects.length; i++) {
- Object object = objects[i];
- if (object instanceof PDEManifestElement)
- object = ((PDEManifestElement)object).getHeader();
- else if (object instanceof PackageFriend)
- object = ((PackageFriend)object).getHeader();
-
- if (object instanceof ManifestHeader) {
- ManifestHeader header = (ManifestHeader)object;
- TextEdit op = (TextEdit)fOperationTable.get(header);
- if (op != null) {
- fOperationTable.remove(header);
- }
- if (header.getValue() == null || header.getValue().trim().length() == 0) {
- deleteKey(header);
- } else {
- modifyKey(header);
- }
- }
- }
- }
- }
-
- private void insertKey(IDocumentKey key) {
- int offset = fDocument.getLength();
- for (int i = fDocument.getNumberOfLines() - 1; i >= 0; i--) {
- try {
- if (fDocument.get(fDocument.getLineOffset(i), fDocument.getLineLength(i)).trim().length() > 0) {
- break;
- }
- offset = fDocument.getLineOffset(i);
- } catch (BadLocationException e) {
- }
- }
- InsertEdit op = new InsertEdit(offset, key.write());
- fOperationTable.put(key, op);
- }
-
- private void deleteKey(IDocumentKey key) {
- if (key.getOffset() > 0) {
- TextEdit op = new DeleteEdit(key.getOffset(), key.getLength());
- fOperationTable.put(key, op);
- }
- }
-
- private void modifyKey(IDocumentKey key) {
- if (key.getOffset() == -1) {
- insertKey(key);
- } else {
- TextEdit op = new ReplaceEdit(key.getOffset(), key.getLength(), key.write());
- fOperationTable.put(key, op);
- }
- }
-
- public TextEdit[] getTextOperations() {
- return (TextEdit[])fOperationTable.values().toArray(new TextEdit[fOperationTable.size()]);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVendorHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVendorHeader.java
deleted file mode 100644
index 82755ce..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVendorHeader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class BundleVendorHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleVendorHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setVendor(String vendor) {
- setMainComponent(vendor);
- }
-
- public String getVendor() {
- return getMainComponent();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVersionHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVersionHeader.java
deleted file mode 100644
index d27d6f9..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/BundleVersionHeader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class BundleVersionHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public BundleVersionHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setVersionRange(String range) {
- setMainComponent(range);
- }
-
- public VersionRange getVersionRange() {
- return new VersionRange(getMainComponent());
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/CompositeManifestHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/CompositeManifestHeader.java
deleted file mode 100644
index cdab6ea..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/CompositeManifestHeader.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.Vector;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.internal.core.bundle.BundleObject;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.BundleException;
-
-public class CompositeManifestHeader extends ManifestHeader {
-
- private static final PDEManifestElement[] NO_ELEMENTS = new PDEManifestElement[0];
-
- private static final long serialVersionUID = 1L;
-
- private boolean fSort;
-
- protected ArrayList fManifestElements;
-
- protected Map fElementMap;
-
- public CompositeManifestHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- this(name, value, bundle, lineDelimiter, false);
- }
-
- public CompositeManifestHeader(String name, String value, IBundle bundle, String lineDelimiter, boolean sort) {
- fName = name;
- fBundle = bundle;
- fLineDelimiter = lineDelimiter;
- setModel(fBundle.getModel());
- fSort = sort;
- fValue = value;
- processValue(value);
- }
-
- protected void processValue(String value) {
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(fName, value);
- for (int i = 0; i < elements.length; i++)
- addManifestElement(createElement(elements[i]), false);
- } catch (BundleException e) {
- }
- }
-
- protected PDEManifestElement createElement(ManifestElement element) {
- return new PDEManifestElement(this, element);
- }
-
- public void update() {
- update(false);
- }
-
- public void update(boolean notify) {
- StringBuffer sb = new StringBuffer();
- PDEManifestElement[] elements = getElements();
- for (int i = 0; i < elements.length; i++) {
- if (sb.length() > 0) {
- sb.append(","); //$NON-NLS-1$
- sb.append(fLineDelimiter);
- sb.append(" "); //$NON-NLS-1$
- }
- sb.append(elements[i].write());
- }
- String old = fValue;
- fValue = sb.toString();
- if (notify)
- firePropertyChanged(this, fName, old, fValue);
- }
-
- protected void addManifestElement(String value) {
- addManifestElement(new PDEManifestElement(this, value));
- }
-
- protected void addManifestElement(PDEManifestElement element) {
- addManifestElement(element, true);
- }
-
- protected void addManifestElement(PDEManifestElement element, boolean update) {
- if (fSort) {
- if (fElementMap == null)
- fElementMap = new TreeMap();
- fElementMap.put(element.getValue(), element);
- } else {
- if (fManifestElements == null)
- fManifestElements = new ArrayList(1);
- fManifestElements.add(element);
- }
- if (update) {
- update(false);
- fireStructureChanged(element, IModelChangedEvent.INSERT);
- }
- }
-
- protected Object removeManifestElement(PDEManifestElement element) {
- return removeManifestElement(element.getValue());
- }
-
- protected Object removeManifestElement(String name) {
- Object object = null;
- if (fSort) {
- if (fElementMap != null) {
- object = fElementMap.remove(name);
- }
- } else if (fManifestElements != null){
- for (int i = 0; i < fManifestElements.size(); i++) {
- PDEManifestElement element = (PDEManifestElement)fManifestElements.get(i);
- if (name.equals(element.getValue()))
- object = fManifestElements.remove(i);
- }
- }
- update(false);
- if (object instanceof BundleObject)
- fireStructureChanged((BundleObject)object, IModelChangedEvent.REMOVE);
- return object;
- }
-
- protected PDEManifestElement[] getElements() {
- if (fSort && fElementMap != null)
- return (PDEManifestElement[])fElementMap.values().toArray(new PDEManifestElement[fElementMap.size()]);
-
- if (fManifestElements != null)
- return (PDEManifestElement[])fManifestElements.toArray(new PDEManifestElement[fManifestElements.size()]);
-
- return NO_ELEMENTS;
- }
-
- public boolean isEmpty() {
- if (fSort)
- return fElementMap == null || fElementMap.size() == 0;
- return fManifestElements == null || fManifestElements.size() == 0;
- }
-
- public boolean hasElement(String name) {
- if (fSort && fElementMap != null)
- return fElementMap.containsKey(name);
-
- if (fManifestElements != null) {
- for (int i = 0; i < fManifestElements.size(); i++) {
- PDEManifestElement element = (PDEManifestElement)fManifestElements.get(i);
- if (name.equals(element.getValue()))
- return true;
- }
- }
- return false;
- }
-
- public Vector getElementNames() {
- PDEManifestElement[] elements = getElements();
- Vector vector = new Vector(elements.length);
- for (int i = 0; i < elements.length; i++) {
- vector.add(elements[i].getValue());
- }
- return vector;
- }
-
- public void swap(int index1, int index2) {
- if (fSort || fManifestElements == null)
- return;
- int size = fManifestElements.size();
- if (index1 >= 0 && index2 >= 0 && size > Math.max(index1, index2)) {
- Object object1 = fManifestElements.get(index1);
- Object object2 = fManifestElements.get(index2);
- fManifestElements.set(index1, object2);
- fManifestElements.set(index2, object1);
- update(true);
- }
- }
-
- protected PDEManifestElement getElementAt(int index) {
- if (fManifestElements != null && fManifestElements.size() > index)
- return (PDEManifestElement)fManifestElements.get(index);
- return null;
- }
-
-
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExecutionEnvironment.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExecutionEnvironment.java
deleted file mode 100644
index e2342f9..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExecutionEnvironment.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-public class ExecutionEnvironment extends PDEManifestElement {
-
- private static final long serialVersionUID = 1L;
-
- public ExecutionEnvironment(ManifestHeader header, String value) {
- super(header, value);
- }
-
- public String getName() {
- return getValue();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageHeader.java
deleted file mode 100644
index 0e420d3..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageHeader.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.Vector;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class ExportPackageHeader extends BasePackageHeader {
-
- private static final long serialVersionUID = 1L;
-
- public ExportPackageHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- protected PDEManifestElement createElement(ManifestElement element) {
- return new ExportPackageObject(this, element, getVersionAttribute());
- }
-
- public Vector getPackageNames() {
- return getElementNames();
- }
-
- public ExportPackageObject getPackage(String packageName) {
- return (fElementMap == null) ? null : (ExportPackageObject) fElementMap.get(packageName);
- }
-
- public ExportPackageObject[] getPackages() {
- PDEManifestElement[] elements = getElements();
- ExportPackageObject[] result = new ExportPackageObject[elements.length];
- System.arraycopy(elements, 0, result, 0, elements.length);
- return result;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageObject.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageObject.java
deleted file mode 100644
index ecab0ca..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ExportPackageObject.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.Iterator;
-import java.util.TreeMap;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.IModelChangedEvent;
-
-public class ExportPackageObject extends PackageObject {
-
- private static final String INTERNAL = "x-internal"; //$NON-NLS-1$
- private static final String FRIENDS = "x-friends"; //$NON-NLS-1$
-
- private static final long serialVersionUID = 1L;
-
- private TreeMap fFriends = new TreeMap();
-
- public ExportPackageObject(ManifestHeader header, ManifestElement element, String versionAttribute) {
- super(header, element, versionAttribute);
- processFriends();
- }
-
- public ExportPackageObject(ManifestHeader header, IPackageFragment fragment, String versionAttribute) {
- super(header, fragment.getElementName(), null, versionAttribute);
- }
-
- protected void processFriends() {
- String[] friends = getDirectives(FRIENDS);
- if (friends != null) {
- for (int i = 0; i < friends.length; i++) {
- fFriends.put(friends[i], new PackageFriend(this, friends[i]));
- }
- }
- }
-
- public boolean isInternal() {
- return "true".equals(getDirective(INTERNAL)) || getDirective(FRIENDS) != null; //$NON-NLS-1$
- }
-
- public void setInternal(boolean internal) {
- boolean old = isInternal();
- if (!internal) {
- setDirective(INTERNAL, null);
- setDirective(FRIENDS, null);
- } else {
- if (fFriends.size() == 0)
- setDirective(INTERNAL, "true"); //$NON-NLS-1$
- else {
- Iterator iter = fFriends.keySet().iterator();
- while (iter.hasNext())
- addDirective(FRIENDS, iter.next().toString());
- }
- }
- fHeader.update();
- firePropertyChanged(this, INTERNAL, Boolean.toString(old), Boolean.toString(internal));
- }
-
- public PackageFriend[] getFriends() {
- return (PackageFriend[])fFriends.values().toArray(new PackageFriend[fFriends.size()]);
- }
-
- public void addFriend(PackageFriend friend) {
- fFriends.put(friend.getName(), friend);
- addDirective(FRIENDS, friend.getName());
- setDirective(INTERNAL, null);
- fHeader.update();
- fireStructureChanged(friend, IModelChangedEvent.INSERT);
- }
-
- public void removeFriend(PackageFriend friend) {
- fFriends.remove(friend.getName());
- setDirective(FRIENDS, null);
- if (fFriends.size() == 0)
- setDirective(INTERNAL, "true"); //$NON-NLS-1$
- else {
- Iterator iter = fFriends.keySet().iterator();
- while (iter.hasNext())
- addDirective(FRIENDS, iter.next().toString());
- }
- fHeader.update();
- fireStructureChanged(friend, IModelChangedEvent.REMOVE);
- }
-
- public boolean hasFriend(String name) {
- return fFriends.containsKey(name);
- }
-
- public boolean hasSameVisibility(ExportPackageObject object) {
- if (object.isInternal() != isInternal())
- return false;
-
- if (fFriends.size() != object.fFriends.size())
- return false;
-
- Iterator iter = fFriends.keySet().iterator();
- while (iter.hasNext()) {
- if (!object.fFriends.containsKey(iter.next()))
- return false;
- }
- return true;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/FragmentHostHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/FragmentHostHeader.java
deleted file mode 100644
index 6c20d30..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/FragmentHostHeader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.Constants;
-
-public class FragmentHostHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public FragmentHostHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void setHostId(String id) {
- setMainComponent(id);
- }
-
- public String getHostId() {
- return getMainComponent();
- }
-
- public void setHostRange(String range) {
- setAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, range);
- }
-
- public VersionRange getHostRange() {
- return new VersionRange(getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE));
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/IModelTextChangeListener.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/IModelTextChangeListener.java
deleted file mode 100644
index 1fbeab6..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/IModelTextChangeListener.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.core.IModelChangedListener;
-import org.eclipse.text.edits.TextEdit;
-
-public interface IModelTextChangeListener extends IModelChangedListener {
-
- TextEdit[] getTextOperations();
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageHeader.java
deleted file mode 100644
index a5eaf33..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageHeader.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class ImportPackageHeader extends BasePackageHeader {
-
- private static final long serialVersionUID = 1L;
-
- public ImportPackageHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- protected PDEManifestElement createElement(ManifestElement element) {
- return new ImportPackageObject(this, element, getVersionAttribute());
- }
-
- public ImportPackageObject getPackage(String packageName) {
- return (fElementMap == null) ? null : (ImportPackageObject) fElementMap.get(packageName);
- }
-
- public ImportPackageObject[] getPackages() {
- PDEManifestElement[] elements = getElements();
- ImportPackageObject[] result = new ImportPackageObject[elements.length];
- System.arraycopy(elements, 0, result, 0, elements.length);
- return result;
- }
-
- public void addPackage(String id) {
- PackageObject obj = new ImportPackageObject(this, id, null, null);
- addManifestElement(obj);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java
deleted file mode 100644
index 62a4ab7..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-public class ImportPackageObject extends PackageObject {
-
- private static final long serialVersionUID = 1L;
-
- private static String getVersion(ExportPackageDescription desc) {
- String version = desc.getVersion().toString();
- if (!version.equals(Version.emptyVersion.toString()))
- return desc.getVersion().toString();
- return null;
- }
-
- public ImportPackageObject(ManifestHeader header, ManifestElement element, String versionAttribute) {
- super(header, element, versionAttribute);
- }
-
- public ImportPackageObject(ManifestHeader header, ExportPackageDescription desc, String versionAttribute) {
- super(header, desc.getName(), getVersion(desc), versionAttribute);
- }
-
- public ImportPackageObject(ManifestHeader header, String id, String version, String versionAttribute) {
- super(header, id, version, versionAttribute);
- }
-
- public boolean isOptional() {
- int manifestVersion = BundlePluginBase.getBundleManifestVersion(getHeader().getBundle());
- if (manifestVersion > 1)
- return Constants.RESOLUTION_OPTIONAL.equals(getDirective(Constants.RESOLUTION_DIRECTIVE));
- return "true".equals(getAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE)); //$NON-NLS-1$
- }
-
- public void setOptional(boolean optional) {
- boolean old = isOptional();
- int manifestVersion = BundlePluginBase.getBundleManifestVersion(getHeader().getBundle());
- if (optional) {
- if (manifestVersion > 1)
- setDirective(Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL);
- else
- setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, "true"); //$NON-NLS-1$
- } else {
- setDirective(Constants.RESOLUTION_DIRECTIVE, null);
- setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, null);
- }
- fHeader.update();
- firePropertyChanged(this, Constants.RESOLUTION_DIRECTIVE, Boolean.toString(old), Boolean.toString(optional));
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/LazyStartHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/LazyStartHeader.java
deleted file mode 100644
index 9400885..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/LazyStartHeader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class LazyStartHeader extends SingleManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public LazyStartHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public boolean isLazyStart() {
- return "true".equals(getMainComponent()); //$NON-NLS-1$
- }
-
- public void setLazyStart(boolean lazy) {
- setMainComponent(Boolean.toString(lazy));
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ManifestHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ManifestHeader.java
deleted file mode 100644
index 5ed122f..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ManifestHeader.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.core.bundle.BundleObject;
-import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
-
-public class ManifestHeader extends BundleObject implements IManifestHeader {
- private static final long serialVersionUID = 1L;
-
- private int fOffset = -1;
- private int fLength = -1;
-
- protected String fName;
- protected String fValue;
-
- protected IBundle fBundle;
- protected String fLineDelimiter;
-
- public ManifestHeader() {
- }
-
- public ManifestHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- fName = name;
- fBundle = bundle;
- fLineDelimiter = lineDelimiter;
- processValue(value);
- setModel(fBundle.getModel());
- }
-
- protected void processValue(String value) {
- fValue = value;
- }
-
- public String getLineLimiter() {
- return fLineDelimiter;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setName(java.lang.String)
- */
- public void setName(String name) {
- fName = name;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getName()
- */
- public String getName() {
- return fName;
- }
-
- public String getValue() {
- return fValue;
- }
-
- public void setValue(String value) {
- String old = fValue;
- fValue = value;
- fBundle.getModel().fireModelObjectChanged(this, getName(), old, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setOffset(int)
- */
- public void setOffset(int offset) {
- fOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getOffset()
- */
- public int getOffset() {
- return fOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setLength(int)
- */
- public void setLength(int length) {
- fLength = length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getLength()
- */
- public int getLength() {
- return fLength;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentKey#write()
- */
- public String write() {
- StringBuffer sb = new StringBuffer(fName);
- sb.append(": "); //$NON-NLS-1$
- sb.append(getValue());
- sb.append(fLineDelimiter);
- return sb.toString();
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- }
-
- public void setBundle(IBundle bundle) {
- fBundle = bundle;
- }
-
- public IBundle getBundle() {
- return fBundle;
- }
-
- public String getKey() {
- return getName();
- }
-
- public void setKey(String key) throws CoreException {
- setName(key);
- }
-
- protected int getManifestVersion() {
- return BundlePluginBase.getBundleManifestVersion(fBundle);
- }
-
- public void update() {
- }
-
-}
-
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PDEManifestElement.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PDEManifestElement.java
deleted file mode 100644
index ae24b92..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PDEManifestElement.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.core.text.bundle;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.TreeMap;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.bundle.BundleObject;
-import org.osgi.framework.BundleException;
-
-public class PDEManifestElement extends BundleObject {
-
- private static final long serialVersionUID = 1L;
-
- protected String[] fValueComponents;
- protected TreeMap fAttributes;
- protected TreeMap fDirectives;
- protected ManifestHeader fHeader;
-
- public PDEManifestElement(ManifestHeader header, String value) {
- fHeader = header;
- setValue(value);
- }
- protected PDEManifestElement(ManifestHeader header, ManifestElement manifestElement) {
- fHeader = header;
- init(manifestElement);
- }
-
- public String[] getValueComponents() {
- return fValueComponents;
- }
-
- protected void setValueComponents(String[] valueComponents) {
- fValueComponents = valueComponents;
- }
-
- public String[] getAttributes(String key) {
- return getTableValues(fAttributes, key);
- }
-
- public String getAttribute(String key) {
- return getTableValue(fAttributes, key);
- }
-
- public Set getKeys() {
- return getTableKeys(fAttributes);
- }
-
- protected void addAttribute(String key, String value) {
- fAttributes = addTableValue(fAttributes, key, value);
- }
-
- protected void setAttribute(String key, String value) {
- fAttributes = setTableValue(fAttributes, key, value);
- }
-
- public String getDirective(String key) {
- return getTableValue(fDirectives, key);
- }
-
- public String[] getDirectives(String key) {
- return getTableValues(fDirectives, key);
- }
-
- public Set getDirectiveKeys() {
- return getTableKeys(fDirectives);
- }
-
- protected void addDirective(String key, String value) {
- fDirectives = addTableValue(fDirectives, key, value);
- }
-
- protected void setDirective(String key, String value) {
- fDirectives = setTableValue(fDirectives, key, value);
- }
-
- private String getTableValue(TreeMap table, String key) {
- if (table == null)
- return null;
- Object result = table.get(key);
- if (result == null)
- return null;
- if (result instanceof String)
- return (String) result;
-
- ArrayList valueList = (ArrayList) result;
- //return the last value
- return (String) valueList.get(valueList.size() - 1);
- }
-
- private String[] getTableValues(TreeMap table, String key) {
- if (table == null)
- return null;
- Object result = table.get(key);
- if (result == null)
- return null;
- if (result instanceof String)
- return new String[] {(String) result};
- ArrayList valueList = (ArrayList) result;
- return (String[]) valueList.toArray(new String[valueList.size()]);
- }
-
- private Set getTableKeys(TreeMap table) {
- if (table == null)
- return null;
- return table.keySet();
- }
-
- private TreeMap addTableValue(TreeMap table, String key, String value) {
- if (table == null) {
- table = new TreeMap();
- }
- Object curValue = table.get(key);
- if (curValue != null) {
- ArrayList newList;
- // create a list to contain multiple values
- if (curValue instanceof ArrayList) {
- newList = (ArrayList) curValue;
- } else {
- newList = new ArrayList(5);
- newList.add(curValue);
- }
- newList.add(value);
- table.put(key, newList);
- } else {
- table.put(key, value);
- }
- return table;
- }
-
- private TreeMap setTableValue(TreeMap table, String key, String value) {
- if (table == null) {
- table = new TreeMap();
- }
- if (value == null || value.trim().length() == 0)
- table.remove(key);
- else {
- table.put(key, value);
- }
- return table;
- }
-
- public void setValue(String value) {
- if (value == null) {
- setValueComponents(new String[0]);
- return;
- }
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(fHeader.fName, value);
- if (elements != null && elements.length > 0)
- init(elements[0]);
- } catch (BundleException e) {
- }
- }
-
- private void init(ManifestElement manifestElement) {
- setValueComponents(manifestElement.getValueComponents());
- Enumeration attKeys = manifestElement.getKeys();
- if (attKeys != null) {
- while (attKeys.hasMoreElements()) {
- String attKey = (String)attKeys.nextElement();
- String[] values = ManifestElement.getArrayFromList(manifestElement.getAttribute(attKey));
- for (int i = 0; i < values.length; i++)
- addAttribute(attKey, values[i]);
- }
- }
- Enumeration dirKeys = manifestElement.getDirectiveKeys();
- if (dirKeys != null) {
- while (dirKeys.hasMoreElements()) {
- String dirKey = (String)dirKeys.nextElement();
- String[] values = ManifestElement.getArrayFromList(manifestElement.getDirective(dirKey));
- for (int i = 0; i < values.length; i++)
- addDirective(dirKey, values[i]);
- }
- }
- }
-
- public String write() {
- StringBuffer sb = new StringBuffer(getValue());
- appendValuesToBuffer(sb, fAttributes);
- appendValuesToBuffer(sb, fDirectives);
- return sb.toString();
- }
-
- public String getValue() {
- StringBuffer sb = new StringBuffer();
- if (fValueComponents == null)
- return ""; //$NON-NLS-1$
- for (int i = 0; i < fValueComponents.length; i++) {
- if (i != 0) sb.append("; "); //$NON-NLS-1$
- sb.append(fValueComponents[i]);
- }
- return sb.toString();
- }
-
- private void appendValuesToBuffer(StringBuffer sb, TreeMap table) {
- if (table == null)
- return;
- Iterator dkeys = table.keySet().iterator();
- while (dkeys.hasNext()) {
- String dkey = (String)dkeys.next();
- Object value = table.get(dkey);
- if (value == null)
- continue;
- sb.append(";"); //$NON-NLS-1$
- sb.append(dkey);
- sb.append(table.equals(fDirectives) ? ":=" : "="); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (value instanceof String) {
- boolean wrap = shouldWrap(value.toString());
- if (wrap) sb.append("\""); //$NON-NLS-1$
- sb.append(value);
- if (wrap) sb.append("\""); //$NON-NLS-1$
- } else if (value instanceof ArrayList) {
- ArrayList values = (ArrayList)value;
- boolean wrap = (values.size() > 1
- || (values.size() == 1 && shouldWrap(values.get(0).toString())));
- if (wrap) sb.append("\""); //$NON-NLS-1$
- for (int i = 0; i < values.size(); i++) {
- if (i != 0) sb.append(","); //$NON-NLS-1$
- sb.append(values.get(i));
- }
- if (wrap) sb.append("\""); //$NON-NLS-1$
- }
- }
- }
-
- private boolean shouldWrap(String value) {
- return value.indexOf(' ') != -1
- || value.indexOf(',') != -1
- || value.indexOf('.') != -1
- || value.indexOf('[') != -1
- || value.indexOf('(') != -1;
- }
-
- public ManifestHeader getHeader() {
- return fHeader;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageFriend.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageFriend.java
deleted file mode 100644
index 7bafb21..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageFriend.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.pde.internal.core.bundle.BundleObject;
-
-public class PackageFriend extends BundleObject {
-
- private static final long serialVersionUID = 1L;
-
- private String fName;
-
- private PackageObject fPackageObject;
-
- public PackageFriend(PackageObject object, String name) {
- fName = name;
- fPackageObject = object;
- }
-
- public String getName() {
- return fName;
- }
-
- public String toString() {
- return fName;
- }
-
- public ManifestHeader getHeader() {
- return fPackageObject.getHeader();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java
deleted file mode 100644
index ff900ec..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.util.ManifestElement;
-
-public class PackageObject extends PDEManifestElement {
-
- private static final long serialVersionUID = 1L;
-
- private String fVersionAttribute;
-
- public PackageObject(ManifestHeader header, ManifestElement element, String versionAttribute) {
- super(header, element);
- fVersionAttribute = versionAttribute;
- setModel(fHeader.getBundle().getModel());
- }
-
- public PackageObject(ManifestHeader header, String name, String version, String versionAttribute) {
- super(header, name.length() > 0 ? name : "."); //$NON-NLS-1$
- fVersionAttribute = versionAttribute;
- setModel(fHeader.getBundle().getModel());
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer(getValue());
- String version = getVersion();
- if (version != null && version.length() > 0) {
- buffer.append(" "); //$NON-NLS-1$
- boolean wrap = Character.isDigit(version.charAt(0));
- if (wrap)
- buffer.append("("); //$NON-NLS-1$
- buffer.append(version);
- if (wrap)
- buffer.append(")"); //$NON-NLS-1$
- }
- return buffer.toString();
- }
-
- public String getVersion() {
- return getAttribute(fVersionAttribute);
- }
-
- public String getName() {
- return getValue();
- }
-
- public void setName(String name) {
- setValueComponents(new String[] {name});
- }
-
- public void setVersion(String version) {
- String old = getVersion();
- setAttribute(fVersionAttribute, version);
- fHeader.update();
- firePropertyChanged(this, fVersionAttribute, old, version);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleHeader.java
deleted file mode 100644
index 26a76f1..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleHeader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.Constants;
-
-public class RequireBundleHeader extends CompositeManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public RequireBundleHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- public void addBundle(IPluginImport iimport) {
- addBundle(iimport.getId(), iimport.getVersion(), iimport.isReexported(), iimport.isOptional());
- }
-
- public void addBundle(String id) {
- addBundle(id, null, false, false);
- }
-
- public void addBundle(String id, String version, boolean exported, boolean optional) {
- RequireBundleObject element = new RequireBundleObject(this, id);
-
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(getBundle());
- if (optional)
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL);
- else
- element.setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, "true"); //$NON-NLS-1$
-
- if (exported)
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.VISIBILITY_DIRECTIVE, Constants.VISIBILITY_REEXPORT);
- else
- element.setAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE, "true"); //$NON-NLS-1$
-
- if (version != null && version.trim().length() > 0)
- element.setAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version.trim());
-
- addManifestElement(element);
- }
-
- public void removeBundle(String id) {
- removeManifestElement(id);
- }
-
- public void removeBundle(RequireBundleObject bundle) {
- removeManifestElement(bundle);
- }
-
- protected PDEManifestElement createElement(ManifestElement element) {
- return new RequireBundleObject(this, element);
- }
-
- public void updateBundle(int index, IPluginImport iimport) {
- if (index == -1)
- return;
-
- PDEManifestElement element = getElementAt(index);
- if (element != null) {
- element.setValue(iimport.getId());
-
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(getBundle());
- if (iimport.isOptional()) {
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL);
- else
- element.setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, "true"); //$NON-NLS-1$
- } else {
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.RESOLUTION_DIRECTIVE, null);
- else
- element.setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, null);
- }
-
- if (iimport.isReexported()) {
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.VISIBILITY_DIRECTIVE, Constants.VISIBILITY_REEXPORT);
- else
- element.setAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE, "true"); //$NON-NLS-1$
- } else {
- if (bundleManifestVersion > 1)
- element.setDirective(Constants.VISIBILITY_DIRECTIVE, null);
- else
- element.setAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE, null);
- }
- element.setAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, iimport.getVersion());
- }
- update(true);
- }
-
- public RequireBundleObject[] getRequiredBundles() {
- PDEManifestElement[] elements = getElements();
- RequireBundleObject[] result = new RequireBundleObject[elements.length];
- System.arraycopy(elements, 0, result, 0, elements.length);
- return result;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleObject.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleObject.java
deleted file mode 100644
index 1f6c9dd..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequireBundleObject.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ICoreConstants;
-import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
-import org.osgi.framework.Constants;
-
-public class RequireBundleObject extends PDEManifestElement {
-
- private static final long serialVersionUID = 1L;
-
- public RequireBundleObject(ManifestHeader header, String value) {
- super(header, value);
- setModel(fHeader.getBundle().getModel());
- }
-
- public RequireBundleObject(ManifestHeader header, ManifestElement manifestElement) {
- super(header, manifestElement);
- setModel(fHeader.getBundle().getModel());
- }
-
- public void setId(String id) {
- String old = getId();
- setValue(id);
- fHeader.update();
- firePropertyChanged(this, fHeader.getName(), old, id);
- }
-
- public String getId() {
- return getValue();
- }
-
- public void setVersion(String version) {
- String old = getVersion();
- setAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
- fHeader.update();
- firePropertyChanged(this, Constants.BUNDLE_VERSION_ATTRIBUTE, old, version);
- }
-
- public String getVersion() {
- return getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE);
- }
-
- public void setOptional(boolean optional) {
- boolean old = isOptional();
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(fHeader.getBundle());
- if (optional) {
- if (bundleManifestVersion > 1)
- setDirective(Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL);
- else
- setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, "true"); //$NON-NLS-1$
- } else {
- if (bundleManifestVersion > 1)
- setDirective(Constants.RESOLUTION_DIRECTIVE, null);
- else
- setAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE, null);
- }
- fHeader.update();
- firePropertyChanged(this, Constants.RESOLUTION_DIRECTIVE, Boolean.toString(old), Boolean.toString(optional));
- }
-
- public boolean isOptional() {
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(fHeader.getBundle());
- if (bundleManifestVersion > 1)
- return Constants.RESOLUTION_OPTIONAL.equals(getDirective(Constants.RESOLUTION_DIRECTIVE));
-
- return "true".equals(getAttribute(ICoreConstants.OPTIONAL_ATTRIBUTE)); //$NON-NLS-1$
- }
-
- public void setReexported(boolean export) {
- boolean old = isReexported();
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(fHeader.getBundle());
- if (export) {
- if (bundleManifestVersion > 1)
- setDirective(Constants.VISIBILITY_DIRECTIVE, Constants.VISIBILITY_REEXPORT);
- else
- setAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE, "true"); //$NON-NLS-1$
- } else {
- if (bundleManifestVersion > 1)
- setDirective(Constants.VISIBILITY_DIRECTIVE, null);
- else
- setAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE, null);
- }
- fHeader.update();
- firePropertyChanged(this, Constants.VISIBILITY_DIRECTIVE, Boolean.toString(old), Boolean.toString(export));
- }
-
- public boolean isReexported() {
- int bundleManifestVersion = BundlePluginBase.getBundleManifestVersion(fHeader.getBundle());
- if (bundleManifestVersion > 1)
- return Constants.VISIBILITY_REEXPORT.equals(getDirective(Constants.VISIBILITY_DIRECTIVE));
-
- return "true".equals(getAttribute(ICoreConstants.REPROVIDE_ATTRIBUTE)); //$NON-NLS-1$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequiredExecutionEnvironmentHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequiredExecutionEnvironmentHeader.java
deleted file mode 100644
index d875a58..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/RequiredExecutionEnvironmentHeader.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-
-public class RequiredExecutionEnvironmentHeader extends CompositeManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- public RequiredExecutionEnvironmentHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- protected PDEManifestElement createElement(ManifestElement element) {
- return new ExecutionEnvironment(this, element.getValue());
- }
-
- public boolean hasExecutionEnvironment(IExecutionEnvironment env) {
- return hasElement(env.getId());
- }
-
- public void addExecutionEnvironment(IExecutionEnvironment env) {
- addManifestElement(new ExecutionEnvironment(this, env.getId()));
- }
-
- public ExecutionEnvironment removeExecutionEnvironment(ExecutionEnvironment env) {
- return (ExecutionEnvironment)removeManifestElement(env);
- }
-
- public ExecutionEnvironment[] getEnvironments() {
- PDEManifestElement[] elements = getElements();
- ExecutionEnvironment[] result = new ExecutionEnvironment[elements.length];
- System.arraycopy(elements, 0, result, 0, elements.length);
- return result;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/SingleManifestHeader.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/SingleManifestHeader.java
deleted file mode 100644
index a8cea5b..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/SingleManifestHeader.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.bundle;
-
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.core.ibundle.IBundle;
-import org.osgi.framework.BundleException;
-
-public class SingleManifestHeader extends ManifestHeader {
-
- private static final long serialVersionUID = 1L;
-
- private PDEManifestElement fElement;
-
- public SingleManifestHeader(String name, String value, IBundle bundle, String lineDelimiter) {
- super(name, value, bundle, lineDelimiter);
- }
-
- protected void processValue(String value) {
- try {
- ManifestElement[] elements = ManifestElement.parseHeader(getName(), value);
- if (elements.length > 0) {
- fElement = new PDEManifestElement(this, elements[0]);
- } else {
- fElement = new PDEManifestElement(this, ""); //$NON-NLS-1$
- }
- } catch (BundleException e) {
- }
- fValue = value;
- }
-
- public void setAttribute(String key, String value) {
- fElement.setAttribute(key, value);
- update();
- }
-
- public void setDirective(String key, String value) {
- fElement.setDirective(key, value);
- update();
- }
-
- public void setMainComponent(String value) {
- if (value == null)
- fElement.setValueComponents((String[])null);
- else
- fElement.setValueComponents(new String[] {value});
- update();
- }
-
- public String getAttribute(String key) {
- return fElement.getAttribute(key);
- }
-
- public String getDirective(String key) {
- return fElement.getDirective(key);
- }
-
- public String getMainComponent() {
- return fElement.getValue();
- }
-
- public void update() {
- String old = fValue;
- fValue = fElement.write();
- fBundle.getModel().fireModelObjectChanged(this, fName, old, fValue);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/AbstractPluginDocumentHandler.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/AbstractPluginDocumentHandler.java
deleted file mode 100644
index d721960..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/AbstractPluginDocumentHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.internal.core.text.DocumentHandler;
-import org.xml.sax.SAXException;
-
-public abstract class AbstractPluginDocumentHandler extends DocumentHandler {
-
- private PluginModelBase fModel;
- private String fSchemaVersion;
-
- /**
- * @param model
- */
- public AbstractPluginDocumentHandler(PluginModelBase model) {
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.DocumentHandler#getDocument()
- */
- protected IDocument getDocument() {
- return fModel.getDocument();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- IPluginBase pluginBase = fModel.getPluginBase();
- try {
- if (pluginBase != null)
- pluginBase.setSchemaVersion(fSchemaVersion);
- } catch (CoreException e) {
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#processingInstruction(java.lang.String, java.lang.String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException {
- if ("eclipse".equals(target)) { //$NON-NLS-1$
- fSchemaVersion = "3.0"; //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.DocumentHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- super.startDocument();
- fSchemaVersion = null;
- }
- protected PluginModelBase getModel() {
- return fModel;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentModel.java
deleted file mode 100644
index 5f0380c..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentModel.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IFragmentModel;
-
-public class FragmentModel extends PluginModelBase implements IFragmentModel{
-
- public FragmentModel(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragmentModel#getFragment()
- */
- public IFragment getFragment() {
- return (IFragment)getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#isFragmentModel()
- */
- public boolean isFragmentModel() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getBundleDescription()
- */
- public BundleDescription getBundleDescription() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#setBundleDescription(org.eclipse.osgi.service.resolver.BundleDescription)
- */
- public void setBundleDescription(BundleDescription description) {
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentNode.java
deleted file mode 100644
index 864877e..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/FragmentNode.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IFragment;
-import org.eclipse.pde.core.plugin.IMatchRules;
-
-public class FragmentNode extends PluginBaseNode implements IFragment {
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#getPluginId()
- */
- public String getPluginId() {
- return getXMLAttributeValue(P_PLUGIN_ID);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#getPluginVersion()
- */
- public String getPluginVersion() {
- return getXMLAttributeValue(P_PLUGIN_VERSION);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#getRule()
- */
- public int getRule() {
- String match = getXMLAttributeValue("match"); //$NON-NLS-1$
- if (match == null || match.trim().length() == 0)
- return IMatchRules.NONE;
- if (match.equals("compatible")) //$NON-NLS-1$
- return IMatchRules.COMPATIBLE;
- if (match.equals("perfect")) //$NON-NLS-1$
- return IMatchRules.PERFECT;
- if (match.equals("equivalent")) //$NON-NLS-1$
- return IMatchRules.EQUIVALENT;
- return IMatchRules.GREATER_OR_EQUAL;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setPluginId(java.lang.String)
- */
- public void setPluginId(String id) throws CoreException {
- setXMLAttribute(P_PLUGIN_ID, id);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setPluginVersion(java.lang.String)
- */
- public void setPluginVersion(String version) throws CoreException {
- setXMLAttribute(P_PLUGIN_VERSION, version);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IFragment#setRule(int)
- */
- public void setRule(int rule) throws CoreException {
- String match = ""; //$NON-NLS-1$
- switch (rule) {
- case IMatchRules.COMPATIBLE:
- match = "compatible"; //$NON-NLS-1$
- break;
- case IMatchRules.EQUIVALENT:
- match = "equivalent"; //$NON-NLS-1$
- break;
- case IMatchRules.PERFECT:
- match = "perfect"; //$NON-NLS-1$
- break;
- case IMatchRules.GREATER_OR_EQUAL:
- match = "greaterOrEqual"; //$NON-NLS-1$
- }
- setXMLAttribute(P_RULE, match);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginBaseNode#getSpecificAttributes()
- */
- protected String[] getSpecificAttributes() {
- ArrayList result = new ArrayList();
-
- String pluginID = getPluginId();
- if (pluginID != null && pluginID.trim().length() > 0)
- result.add(" " + P_PLUGIN_ID + "=\"" + pluginID + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- String pluginVersion = getPluginVersion();
- if (pluginVersion != null && pluginVersion.trim().length() > 0)
- result.add(" " + P_PLUGIN_VERSION + "=\"" + pluginVersion + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- String match = getXMLAttributeValue(P_RULE);
- if (match != null && match.trim().length() > 0)
- result.add(" " + P_RULE + "=\"" + match + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- return (String[]) result.toArray(new String[result.size()]);
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/NodeOffsetHandler.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/NodeOffsetHandler.java
deleted file mode 100644
index 0dee844..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/NodeOffsetHandler.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class NodeOffsetHandler extends AbstractPluginDocumentHandler {
-
- /**
- * @param model
- */
- public NodeOffsetHandler(PluginModelBase model) {
- super(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.DocumentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- super.startElement(uri, localName, qName, attributes);
- IDocumentNode node = (IDocumentNode)fDocumentNodeStack.peek();
- IDocumentAttribute[] attrs = node.getNodeAttributes();
- for (int i = 0; i < attrs.length; i++) {
- //if (attrs[i].getNameOffset() == -1)
- //node.removeDocumentAttribute(attrs[i]);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.DocumentHandler#getDocumentNode(java.lang.String, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- protected IDocumentNode getDocumentNode(String name, IDocumentNode parent) {
- IDocumentNode node = null;
- if (parent == null) {
- node = (IDocumentNode)getModel().getPluginBase();
- node.setOffset(-1);
- node.setLength(-1);
- } else {
- IDocumentNode[] children = parent.getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i].getOffset() < 0) {
- node = children[i];
- break;
- }
- }
- }
-
- IDocumentAttribute[] attrs = node.getNodeAttributes();
- for (int i = 0; i < attrs.length; i++) {
- attrs[i].setNameOffset(-1);
- attrs[i].setNameLength(-1);
- attrs[i].setValueOffset(-1);
- attrs[i].setValueLength(-1);
- }
-
- for (int i = 0; i < node.getChildNodes().length; i++) {
- IDocumentNode child = node.getChildAt(i);
- child.setOffset(-1);
- child.setLength(-1);
- }
-
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.DocumentHandler#appendChildToParent(org.eclipse.pde.internal.ui.model.IDocumentNode, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- protected void appendChildToParent(IDocumentNode parent, IDocumentNode child) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.DocumentHandler#getDocumentAttribute(java.lang.String, java.lang.String, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- protected IDocumentAttribute getDocumentAttribute(String name,
- String value, IDocumentNode parent) {
- return parent.getDocumentAttribute(name);
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginAttribute.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginAttribute.java
deleted file mode 100644
index 4d9d344..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginAttribute.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public class PluginAttribute extends PluginObjectNode
- implements
- IPluginAttribute , IDocumentAttribute{
-
- private static final long serialVersionUID = 1L;
-
- private IDocumentNode fEnclosingElement;
- private String fValue;
- private int fNameOffset = -1;
- private int fNameLength = -1;
- private int fValueOffset = -1;
- private int fValueLength = -1;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginAttribute#getValue()
- */
- public String getValue() {
- return fValue;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginAttribute#setValue(java.lang.String)
- */
- public void setValue(String value) throws CoreException {
- fValue = value;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#setEnclosingElement(org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public void setEnclosingElement(IDocumentNode node) {
- fEnclosingElement = node;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getEnclosingElement()
- */
- public IDocumentNode getEnclosingElement() {
- return fEnclosingElement;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#setNameOffset(int)
- */
- public void setNameOffset(int offset) {
- fNameOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getNameOffset()
- */
- public int getNameOffset() {
- return fNameOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#setNameLength(int)
- */
- public void setNameLength(int length) {
- fNameLength = length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getNameLength()
- */
- public int getNameLength() {
- return fNameLength;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#setValueOffset(int)
- */
- public void setValueOffset(int offset) {
- fValueOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getValueOffset()
- */
- public int getValueOffset() {
- return fValueOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#setValueLength(int)
- */
- public void setValueLength(int length) {
- fValueLength = length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getValueLength()
- */
- public int getValueLength() {
- return fValueLength;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getAttributeName()
- */
- public String getAttributeName() {
- return getName();
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#getAttributeValue()
- */
- public String getAttributeValue() {
- return getValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentAttribute#write()
- */
- public String write() {
- return getName() + "=\"" + getWritableString(getValue()) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String getWritableString(String source) {
- return super
- .getWritableString(source)
- .replaceAll("\\r", "
") //$NON-NLS-1$ //$NON-NLS-2$
- .replaceAll("\\n", "
"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginBaseNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginBaseNode.java
deleted file mode 100644
index fd1d2f2..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginBaseNode.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public abstract class PluginBaseNode extends PluginObjectNode implements IPluginBase {
-
-
- private String fSchemaVersion;
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#add(org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void add(IPluginLibrary library) throws CoreException {
- IDocumentNode parent = getEnclosingElement("runtime", true); //$NON-NLS-1$
- if (library instanceof PluginLibraryNode) {
- PluginLibraryNode node = (PluginLibraryNode)library;
- node.setModel(getModel());
- library.setInTheModel(true);
- parent.addChildNode(node);
- fireStructureChanged(library, IModelChangedEvent.INSERT);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#add(org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void add(IPluginImport pluginImport) throws CoreException {
- IDocumentNode parent = getEnclosingElement("requires", true); //$NON-NLS-1$
- if (pluginImport instanceof PluginImportNode) {
- PluginImportNode node = (PluginImportNode)pluginImport;
- node.setModel(getModel());
- pluginImport.setInTheModel(true);
- parent.addChildNode(node);
- fireStructureChanged(pluginImport, IModelChangedEvent.INSERT);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#remove(org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void remove(IPluginImport pluginImport) throws CoreException {
- IDocumentNode parent = getEnclosingElement("requires", false); //$NON-NLS-1$
- if (parent != null) {
- parent.removeChildNode((IDocumentNode)pluginImport);
- pluginImport.setInTheModel(false);
- fireStructureChanged(pluginImport, IModelChangedEvent.REMOVE);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#getLibraries()
- */
- public IPluginLibrary[] getLibraries() {
- ArrayList result = new ArrayList();
- IDocumentNode requiresNode = getEnclosingElement("runtime", false); //$NON-NLS-1$
- if (requiresNode != null) {
- IDocumentNode[] children = requiresNode.getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof IPluginLibrary)
- result.add(children[i]);
- }
- }
-
- return (IPluginLibrary[]) result.toArray(new IPluginLibrary[result.size()]);
- }
-
- private IDocumentNode getEnclosingElement(String elementName, boolean create) {
- PluginElementNode element = null;
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof IPluginElement) {
- if (((PluginElementNode)children[i]).getXMLTagName().equals(elementName)) {
- element = (PluginElementNode)children[i];
- break;
- }
- }
- }
- if (element == null && create) {
- element = new PluginElementNode();
- element.setXMLTagName(elementName);
- element.setParentNode(this);
- element.setModel(getModel());
- element.setInTheModel(true);
- if (elementName.equals("runtime")) { //$NON-NLS-1$
- addChildNode(element, 0);
- } else if (elementName.equals("requires")) { //$NON-NLS-1$
- if (children.length > 0 && children[0].getXMLTagName().equals("runtime")) { //$NON-NLS-1$
- addChildNode(element, 1);
- } else {
- addChildNode(element, 0);
- }
- }
- }
- return element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#getImports()
- */
- public IPluginImport[] getImports() {
- ArrayList result = new ArrayList();
- IDocumentNode requiresNode = getEnclosingElement("requires", false); //$NON-NLS-1$
- if (requiresNode != null) {
- IDocumentNode[] children = requiresNode.getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof IPluginImport)
- result.add(children[i]);
- }
- }
-
- return (IPluginImport[]) result.toArray(new IPluginImport[result.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#getProviderName()
- */
- public String getProviderName() {
- return getXMLAttributeValue(P_PROVIDER);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#getVersion()
- */
- public String getVersion() {
- return getXMLAttributeValue(P_VERSION);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#remove(org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void remove(IPluginLibrary library) throws CoreException {
- IDocumentNode parent = getEnclosingElement("runtime", false); //$NON-NLS-1$
- if (parent != null) {
- parent.removeChildNode((IDocumentNode)library);
- library.setInTheModel(false);
- fireStructureChanged(library, IModelChangedEvent.REMOVE);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#setProviderName(java.lang.String)
- */
- public void setProviderName(String providerName) throws CoreException {
- setXMLAttribute(P_PROVIDER, providerName);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#setVersion(java.lang.String)
- */
- public void setVersion(String version) throws CoreException {
- setXMLAttribute(P_VERSION, version);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#swap(org.eclipse.pde.core.plugin.IPluginLibrary, org.eclipse.pde.core.plugin.IPluginLibrary)
- */
- public void swap(IPluginLibrary l1, IPluginLibrary l2) throws CoreException {
- IDocumentNode node = getEnclosingElement("runtime", false); //$NON-NLS-1$
- if (node != null) {
- node.swap((IDocumentNode)l1, (IDocumentNode)l2);
- firePropertyChanged(node, P_LIBRARY_ORDER, l1, l2);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#getSchemaVersion()
- */
- public String getSchemaVersion() {
- return fSchemaVersion;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#setSchemaVersion(java.lang.String)
- */
- public void setSchemaVersion(String schemaVersion) throws CoreException {
- fSchemaVersion = schemaVersion;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#add(org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void add(IPluginExtension extension) throws CoreException {
- if (extension instanceof PluginExtensionNode) {
- PluginExtensionNode node = (PluginExtensionNode)extension;
- node.setModel(getModel());
- extension.setInTheModel(true);
- addChildNode(node);
- fireStructureChanged(extension, IModelChangedEvent.INSERT);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#add(org.eclipse.pde.core.plugin.IPluginExtensionPoint)
- */
- public void add(IPluginExtensionPoint extensionPoint) throws CoreException {
- if (extensionPoint instanceof PluginExtensionPointNode) {
- PluginExtensionPointNode node = (PluginExtensionPointNode)extensionPoint;
- node.setModel(getModel());
- extensionPoint.setInTheModel(true);
- node.setParentNode(this);
- IPluginExtensionPoint[] extPoints = getExtensionPoints();
- if (extPoints.length > 0)
- addChildNode(node, indexOf((IDocumentNode)extPoints[extPoints.length - 1]) + 1);
- else {
- IDocumentNode requires = getEnclosingElement("requires", false); //$NON-NLS-1$
- if (requires != null) {
- addChildNode(node, indexOf(requires) + 1);
- } else {
- IDocumentNode runtime = getEnclosingElement("runtime", false); //$NON-NLS-1$
- if (runtime != null)
- addChildNode(node, indexOf(runtime) + 1);
- else
- addChildNode(node, 0);
- }
- }
- fireStructureChanged(extensionPoint, IModelChangedEvent.INSERT);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#getExtensionPoints()
- */
- public IPluginExtensionPoint[] getExtensionPoints() {
- ArrayList result = new ArrayList();
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof IPluginExtensionPoint)
- result.add(children[i]);
- }
- return (IPluginExtensionPoint[]) result.toArray(new IPluginExtensionPoint[result.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#getExtensions()
- */
- public IPluginExtension[] getExtensions() {
- ArrayList result = new ArrayList();
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof IPluginExtension)
- result.add(children[i]);
- }
- return (IPluginExtension[]) result.toArray(new IPluginExtension[result.size()]);
- }
- public int getIndexOf(IPluginExtension e) {
- IPluginExtension [] children = getExtensions();
- for (int i=0; i<children.length; i++) {
- if (children[i].equals(e))
- return i;
- }
- return -1;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#remove(org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void remove(IPluginExtension extension) throws CoreException {
- if (extension instanceof IDocumentNode) {
- removeChildNode((IDocumentNode)extension);
- extension.setInTheModel(false);
- fireStructureChanged(extension, IModelChangedEvent.REMOVE);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#remove(org.eclipse.pde.core.plugin.IPluginExtensionPoint)
- */
- public void remove(IPluginExtensionPoint extensionPoint)
- throws CoreException {
- if (extensionPoint instanceof IDocumentNode) {
- removeChildNode((IDocumentNode)extensionPoint);
- extensionPoint.setInTheModel(false);
- fireStructureChanged(extensionPoint, IModelChangedEvent.REMOVE);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensions#swap(org.eclipse.pde.core.plugin.IPluginExtension, org.eclipse.pde.core.plugin.IPluginExtension)
- */
- public void swap(IPluginExtension e1, IPluginExtension e2)
- throws CoreException {
- swap((IDocumentNode)e1, (IDocumentNode)e2);
- firePropertyChanged(this, P_EXTENSION_ORDER, e1, e2);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginBase#swap(org.eclipse.pde.core.plugin.IPluginImport, org.eclipse.pde.core.plugin.IPluginImport)
- */
- public void swap(IPluginImport import1, IPluginImport import2)
- throws CoreException {
- IDocumentNode node = getEnclosingElement("requires", false); //$NON-NLS-1$
- if (node != null) {
- node.swap((IDocumentNode)import1, (IDocumentNode)import2);
- firePropertyChanged(node, P_IMPORT_ORDER, import1, import2);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#getId()
- */
- public String getId() {
- return getXMLAttributeValue(P_ID);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
- */
- public void setId(String id) throws CoreException {
- setXMLAttribute(P_ID, id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getXMLAttributeValue(P_NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- setXMLAttribute(P_NAME, name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- String newLine = getLineDelimiter();
-
- StringBuffer buffer = new StringBuffer();
- buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + newLine); //$NON-NLS-1$
- buffer.append("<?eclipse version=\"3.0\"?>" + newLine); //$NON-NLS-1$
-
- buffer.append(writeShallow(false) + newLine);
-
- IDocumentNode runtime = getEnclosingElement("runtime", false); //$NON-NLS-1$
- if (runtime != null) {
- runtime.setLineIndent(getLineIndent() + 3);
- buffer.append(runtime.write(true) + newLine);
- }
-
- IDocumentNode requires = getEnclosingElement("requires", false); //$NON-NLS-1$
- if (requires != null) {
- requires.setLineIndent(getLineIndent() + 3);
- buffer.append(requires.write(true) + newLine);
- }
-
- IPluginExtensionPoint[] extPoints = getExtensionPoints();
- for (int i = 0; i < extPoints.length; i++) {
- IDocumentNode extPoint = (IDocumentNode)extPoints[i];
- extPoint.setLineIndent(getLineIndent() + 3);
- buffer.append(extPoint.write(true) + newLine);
- }
-
- IPluginExtension[] extensions = getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IDocumentNode extension = (IDocumentNode)extensions[i];
- extension.setLineIndent(getLineIndent() + 3);
- buffer.append(extension.write(true) + newLine);
- }
-
- buffer.append("</" + getXMLTagName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow()
- */
- public String writeShallow(boolean terminate) {
- String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
- StringBuffer buffer = new StringBuffer();
- buffer.append("<" + getXMLTagName()); //$NON-NLS-1$
- buffer.append(newLine);
-
- String id = getId();
- if (id != null && id.trim().length() > 0)
- buffer.append(" " + P_ID + "=\"" + getWritableString(id) + "\"" + newLine); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- String name = getName();
- if (name != null && name.trim().length() > 0)
- buffer.append(" " + P_NAME + "=\"" + getWritableString(name) + "\"" + newLine); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- String version = getVersion();
- if (version != null && version.trim().length() > 0)
- buffer.append(" " + P_VERSION + "=\"" + getWritableString(version) + "\"" + newLine); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- String provider = getProviderName();
- if (provider != null && provider.trim().length() > 0) {
- buffer.append(" " + P_PROVIDER + "=\"" + getWritableString(provider) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- String[] specific = getSpecificAttributes();
- for (int i = 0; i < specific.length; i++)
- buffer.append(newLine + specific[i]);
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
-
- return buffer.toString();
- }
-
- protected abstract String[] getSpecificAttributes();
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentHandler.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentHandler.java
deleted file mode 100644
index 8d92ff0..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.pde.internal.core.text.DocumentTextNode;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-import org.eclipse.pde.internal.core.text.IDocumentTextNode;
-import org.xml.sax.SAXException;
-
-public class PluginDocumentHandler extends AbstractPluginDocumentHandler {
-
- private PluginDocumentNodeFactory fFactory;
-
- public PluginDocumentHandler(PluginModelBase model) {
- super(model);
- fFactory = (PluginDocumentNodeFactory)getModel().getPluginFactory();
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
- */
- public void characters(char[] ch, int start, int length) throws SAXException {
- IDocumentNode parent = (IDocumentNode)fDocumentNodeStack.peek();
- if (parent == null)
- return;
-
- StringBuffer buffer = new StringBuffer();
- buffer.append(ch, start, length);
- IDocumentTextNode textNode = parent.getTextNode();
- if (textNode == null) {
- if (buffer.toString().trim().length() > 0) {
- textNode = new DocumentTextNode();
- textNode.setEnclosingElement(parent);
- parent.addTextNode(textNode);
- textNode.setText(buffer.toString().trim());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.DocumentHandler#getDocumentNode(java.lang.String, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- protected IDocumentNode getDocumentNode(String name, IDocumentNode parent) {
- return fFactory.createDocumentNode(name, parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.DocumentHandler#getDocumentAttribute(java.lang.String, java.lang.String, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- protected IDocumentAttribute getDocumentAttribute(String name,
- String value, IDocumentNode parent) {
- return fFactory.createAttribute(name, value, parent);
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNode.java
deleted file mode 100644
index df36ebd..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNode.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-import org.eclipse.pde.internal.core.text.IDocumentTextNode;
-
-public abstract class PluginDocumentNode implements IDocumentNode {
-
- private IDocumentNode fParent;
- private ArrayList fChildren = new ArrayList();
- private boolean fIsErrorNode;
- private int fLength = -1;
- private int fOffset = -1;
- protected Map fAttributes = new TreeMap();
- private String fTag;
- private int fIndent = 0;
- private IDocumentNode fPreviousSibling;
- protected IDocumentTextNode fTextNode;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#getChildNodes()
- */
- public IDocumentNode[] getChildNodes() {
- return (IDocumentNode[]) fChildren.toArray(new IDocumentNode[fChildren.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#indexOf(org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public int indexOf(IDocumentNode child) {
- return fChildren.indexOf(child);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getChildAt(int)
- */
- public IDocumentNode getChildAt(int index) {
- if (index < fChildren.size())
- return (IDocumentNode)fChildren.get(index);
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#getParentNode()
- */
- public IDocumentNode getParentNode() {
- return fParent;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#setParentNode(org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode)
- */
- public void setParentNode(IDocumentNode node) {
- fParent = node;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#addChildNode(org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode)
- */
- public void addChildNode(IDocumentNode child) {
- addChildNode(child, fChildren.size());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#addChildNode(org.eclipse.pde.internal.ui.model.IDocumentNode, int)
- */
- public void addChildNode(IDocumentNode child, int position) {
- fChildren.add(position, child);
- if (position > 0 && fChildren.size() > 1)
- child.setPreviousSibling((IDocumentNode)fChildren.get(position - 1));
- if (fChildren.size() > 1 && position < fChildren.size() - 1)
- ((IDocumentNode)fChildren.get(position + 1)).setPreviousSibling(child);
- child.setParentNode(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#removeChildNode(org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public IDocumentNode removeChildNode(IDocumentNode child) {
- int index = fChildren.indexOf(child);
- if (index != -1) {
- fChildren.remove(child);
- if (index < fChildren.size()) {
- IDocumentNode prevSibling = index == 0 ? null : (IDocumentNode)fChildren.get(index - 1);
- ((IDocumentNode)fChildren.get(index)).setPreviousSibling(prevSibling);
- return child;
- }
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#isErrorNode()
- */
- public boolean isErrorNode() {
- return fIsErrorNode;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.neweditor.model.IDocumentNode#setIsErrorNode(boolean)
- */
- public void setIsErrorNode(boolean isErrorNode) {
- fIsErrorNode = isErrorNode;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setOffset(int)
- */
- public void setOffset(int offset) {
- fOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setLength(int)
- */
- public void setLength(int length) {
- fLength = length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getOffset()
- */
- public int getOffset() {
- return fOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getLength()
- */
- public int getLength() {
- return fLength;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setAttribute(org.eclipse.pde.internal.ui.model.IDocumentAttribute)
- */
- public void setXMLAttribute(IDocumentAttribute attribute) {
- fAttributes.put(attribute.getAttributeName(), attribute);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getXMLAttributeValue(java.lang.String)
- */
- public String getXMLAttributeValue(String name) {
- PluginAttribute attr = (PluginAttribute)fAttributes.get(name);
- return attr == null ? null : attr.getValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setXMLTagName(java.lang.String)
- */
- public void setXMLTagName(String tag) {
- fTag = tag;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getXMLTagName()
- */
- public String getXMLTagName() {
- return fTag;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getDocumentAttribute(java.lang.String)
- */
- public IDocumentAttribute getDocumentAttribute(String name) {
- return (IDocumentAttribute)fAttributes.get(name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getLineIndent()
- */
- public int getLineIndent() {
- return fIndent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setLineIndent(int)
- */
- public void setLineIndent(int indent) {
- fIndent = indent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getAttributes()
- */
- public IDocumentAttribute[] getNodeAttributes() {
- ArrayList list = new ArrayList();
- Iterator iter = fAttributes.values().iterator();
- while (iter.hasNext())
- list.add(iter.next());
- return (IDocumentAttribute[])list.toArray(new IDocumentAttribute[list.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getPreviousSibling()
- */
- public IDocumentNode getPreviousSibling() {
- return fPreviousSibling;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setPreviousSibling(org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public void setPreviousSibling(IDocumentNode sibling) {
- fPreviousSibling = sibling;
- }
-
- protected String getIndent() {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < fIndent; i++) {
- buffer.append(" "); //$NON-NLS-1$
- }
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#swap(org.eclipse.pde.internal.ui.model.IDocumentNode, org.eclipse.pde.internal.ui.model.IDocumentNode)
- */
- public void swap(IDocumentNode child1, IDocumentNode child2) {
- int index1 = fChildren.indexOf(child1);
- int index2 = fChildren.indexOf(child2);
-
- fChildren.set(index1, child2);
- fChildren.set(index2, child1);
-
- child1.setPreviousSibling(index2 == 0 ? null : (IDocumentNode)fChildren.get(index2 - 1));
- child2.setPreviousSibling(index1 == 0 ? null : (IDocumentNode)fChildren.get(index1 - 1));
-
- if (index1 < fChildren.size() - 1)
- ((IDocumentNode)fChildren.get(index1 + 1)).setPreviousSibling(child2);
-
- if (index2 < fChildren.size() - 1)
- ((IDocumentNode)fChildren.get(index2 + 1)).setPreviousSibling(child1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#addTextNode(org.eclipse.pde.internal.ui.model.IDocumentTextNode)
- */
- public void addTextNode(IDocumentTextNode textNode) {
- fTextNode = textNode;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#getTextNode()
- */
- public IDocumentTextNode getTextNode() {
- return fTextNode;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#removeTextNode()
- */
- public void removeTextNode() {
- fTextNode = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#removeDocumentAttribute(org.eclipse.pde.internal.ui.model.IDocumentAttribute)
- */
- public void removeDocumentAttribute(IDocumentAttribute attr) {
- fAttributes.remove(attr.getAttributeName());
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNodeFactory.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNodeFactory.java
deleted file mode 100644
index bfc72cd..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginDocumentNodeFactory.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginImport;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.core.plugin.IPluginModelFactory;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public class PluginDocumentNodeFactory implements IPluginModelFactory {
-
- private PluginModelBase fModel;
-
- public PluginDocumentNodeFactory(PluginModelBase model) {
- fModel = model;
- }
-
- public IDocumentNode createDocumentNode(String name, IDocumentNode parent) {
- if (parent == null)
- return createPluginBase(name);
-
- if (parent instanceof PluginBaseNode) {
- if ("extension".equals(name)) //$NON-NLS-1$
- return createExtension(parent);
- if ("extension-point".equals(name)) //$NON-NLS-1$
- return createExtensionPoint(parent);
- } else {
- if (name.equals("import") && parent instanceof PluginElementNode) { //$NON-NLS-1$
- if (((PluginElementNode)parent).getName().equals("requires")) { //$NON-NLS-1$
- IDocumentNode ancestor = parent.getParentNode();
- if (ancestor != null && ancestor instanceof PluginBaseNode) {
- return createImport(parent);
- }
- }
- } else if (name.equals("library") && parent instanceof PluginElementNode) { //$NON-NLS-1$
- if (((PluginElementNode)parent).getName().equals("runtime")) { //$NON-NLS-1$
- IDocumentNode ancestor = parent.getParentNode();
- if (ancestor != null && ancestor instanceof PluginBaseNode) {
- return createLibrary(parent);
- }
- }
- }
-
-
- }
- return createElement(name, parent);
- }
-
- /**
- * @param parent
- * @return
- */
- private IDocumentNode createLibrary(IDocumentNode parent) {
- PluginLibraryNode node = new PluginLibraryNode();
- node.setParentNode(parent);
- node.setModel(fModel);
- node.setInTheModel(true);
- return node;
- }
-
- /**
- * @param parent
- */
- private IDocumentNode createImport(IDocumentNode parent) {
- PluginImportNode node = new PluginImportNode();
- node.setParentNode(parent);
- node.setModel(fModel);
- node.setInTheModel(true);
- return node;
- }
-
- /**
- * @param name
- * @param parent
- * @return
- */
- private IDocumentNode createElement(String name, IDocumentNode parent) {
- PluginElementNode node = new PluginElementNode();
- try {
- node.setName(name);
- node.setParentNode(parent);
- node.setModel(fModel);
- node.setInTheModel(true);
- } catch (CoreException e) {
- }
- return node;
- }
-
- /**
- * @param name
- * @param parent
- * @return
- */
- private PluginExtensionPointNode createExtensionPoint(IDocumentNode parent) {
- PluginExtensionPointNode node = new PluginExtensionPointNode();
- node.setParentNode(parent);
- node.setModel(fModel);
- node.setInTheModel(true);
- return node;
- }
-
- /**
- * @param name
- * @return
- */
- private PluginExtensionNode createExtension(IDocumentNode parent) {
- PluginExtensionNode node = new PluginExtensionNode();
- node.setParentNode(parent);
- node.setModel(fModel);
- node.setInTheModel(true);
- return node;
- }
-
- public IDocumentAttribute createAttribute(String name, String value, IDocumentNode enclosingElement) {
- PluginAttribute attribute = new PluginAttribute();
- try {
- attribute.setName(name);
- attribute.setValue(value);
- } catch (CoreException e) {
- }
- attribute.setEnclosingElement(enclosingElement);
- attribute.setModel(fModel);
- attribute.setInTheModel(true);
- return attribute;
- }
-
- private PluginBaseNode createPluginBase(String name) {
- return (PluginBaseNode)fModel.createPluginBase(name.equals("fragment")); //$NON-NLS-1$
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelFactory#createImport()
- */
- public IPluginImport createImport() {
- PluginImportNode node = new PluginImportNode();
- node.setModel(fModel);
- node.setXMLTagName("import"); //$NON-NLS-1$
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelFactory#createLibrary()
- */
- public IPluginLibrary createLibrary() {
- PluginLibraryNode node = new PluginLibraryNode();
- node.setModel(fModel);
- node.setXMLTagName("library"); //$NON-NLS-1$
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensionsModelFactory#createAttribute(org.eclipse.pde.core.plugin.IPluginElement)
- */
- public IPluginAttribute createAttribute(IPluginElement element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensionsModelFactory#createElement(org.eclipse.pde.core.plugin.IPluginObject)
- */
- public IPluginElement createElement(IPluginObject parent) {
- PluginElementNode node = new PluginElementNode();
- node.setModel(fModel);
- node.setParentNode((IDocumentNode)parent);
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensionsModelFactory#createExtension()
- */
- public IPluginExtension createExtension() {
- PluginExtensionNode node = new PluginExtensionNode();
- node.setModel(fModel);
- node.setXMLTagName("extension"); //$NON-NLS-1$
- return node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IExtensionsModelFactory#createExtensionPoint()
- */
- public IPluginExtensionPoint createExtensionPoint() {
- PluginExtensionPointNode node = new PluginExtensionPointNode();
- node.setModel(fModel);
- node.setXMLTagName("extension-point"); //$NON-NLS-1$
- return node;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginElementNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginElementNode.java
deleted file mode 100644
index be3510c..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginElementNode.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginAttribute;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.ischema.ISchemaElement;
-import org.eclipse.pde.internal.core.text.DocumentTextNode;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-import org.eclipse.pde.internal.core.text.IDocumentTextNode;
-
-public class PluginElementNode extends PluginParentNode
- implements
- IPluginElement {
-
- private static final long serialVersionUID = 1L;
-
- private transient ISchemaElement elementInfo;
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#createCopy()
- */
- public IPluginElement createCopy() {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#getAttribute(java.lang.String)
- */
- public IPluginAttribute getAttribute(String name) {
- return (IPluginAttribute)fAttributes.get(name);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#getAttributes()
- */
- public IPluginAttribute[] getAttributes() {
- return (IPluginAttribute[])fAttributes.values().toArray(new IPluginAttribute[fAttributes.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#getAttributeCount()
- */
- public int getAttributeCount() {
- return fAttributes.size();
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#getText()
- */
- public String getText() {
- IDocumentTextNode node = getTextNode();
- return node == null ? "" : node.getText(); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#setAttribute(java.lang.String, java.lang.String)
- */
- public void setAttribute(String name, String value) throws CoreException {
- setXMLAttribute(name, value);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#setText(java.lang.String)
- */
- public void setText(String text) throws CoreException {
- IDocumentTextNode node = getTextNode();
- if (node == null) {
- node = new DocumentTextNode();
- node.setEnclosingElement(this);
- addTextNode(node);
- }
- node.setText(text);
- firePropertyChanged(this, P_TEXT, node, node);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- String sep = getLineDelimiter();
- StringBuffer buffer = new StringBuffer();
- if (indent)
- buffer.append(getIndent());
-
- IDocumentNode[] children = getChildNodes();
- String text = getText();
- if (children.length > 0 || text.length() > 0) {
- buffer.append(writeShallow(false) + sep);
- if (text.length() > 0)
- buffer.append(getIndent() + " " + text + sep); //$NON-NLS-1$
- for (int i = 0; i < children.length; i++) {
- children[i].setLineIndent(getLineIndent() + 3);
- buffer.append(children[i].write(true) + sep);
- }
- buffer.append(getIndent() + "</" + getXMLTagName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- buffer.append(writeShallow(true));
- }
-
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
- */
- public String writeShallow(boolean terminate) {
- String sep = getLineDelimiter();
- StringBuffer buffer = new StringBuffer("<" + getXMLTagName()); //$NON-NLS-1$
-
- IDocumentAttribute[] attrs = getNodeAttributes();
- if (attrs.length == 1) {
- if (attrs[0].getAttributeValue().length() > 0)
- buffer.append(" " + attrs[0].write()); //$NON-NLS-1$
- } else {
- for (int i = 0; i < attrs.length; i++) {
- if (attrs[i].getAttributeValue().length() > 0)
- buffer.append(sep + getIndent() + " " + attrs[i].write()); //$NON-NLS-1$
- }
- }
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getXMLTagName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- setXMLTagName(name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginElement#getElementInfo()
- */
- public Object getElementInfo() {
- if (elementInfo == null) {
- IDocumentNode node = getParentNode();
- for (;;) {
- if (node == null || node instanceof IPluginExtension)
- break;
- node = node.getParentNode();
- }
- if (node != null) {
- IPluginExtension extension = (IPluginExtension) node;
- ISchema schema = (ISchema)extension.getSchema();
- if (schema != null) {
- elementInfo = schema.findElement(getName());
- }
- }
- }
- return elementInfo;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionNode.java
deleted file mode 100644
index da23473..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionNode.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ischema.ISchema;
-import org.eclipse.pde.internal.core.schema.SchemaRegistry;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public class PluginExtensionNode extends PluginParentNode
- implements
- IPluginExtension {
- private static final long serialVersionUID = 1L;
- private transient ISchema fSchema;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtension#getPoint()
- */
- public String getPoint() {
- return getXMLAttributeValue(P_POINT);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtension#setPoint(java.lang.String)
- */
- public void setPoint(String point) throws CoreException {
- setXMLAttribute(P_POINT, point);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- setXMLAttribute(P_NAME, name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getXMLAttributeValue(P_NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getTranslatedName()
- */
- public String getTranslatedName() {
- String name = getName();
- if (name != null && name.trim().length() > 0)
- return getResourceString(name);
- String point = getPoint();
- ISchema schema = PDECore.getDefault().getSchemaRegistry().getSchema(point);
- return schema == null ? "" : schema.getName(); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#getId()
- */
- public String getId() {
- return getXMLAttributeValue(P_ID);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
- */
- public void setId(String id) throws CoreException {
- setXMLAttribute(P_ID, id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- String sep = getLineDelimiter();
- StringBuffer buffer = new StringBuffer();
- if (indent)
- buffer.append(getIndent());
- buffer.append(writeShallow(false));
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- children[i].setLineIndent(getLineIndent() + 3);
- buffer.append(sep + children[i].write(true));
- }
- buffer.append(sep + getIndent() + "</extension>"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
- */
- public String writeShallow(boolean terminate) {
- String sep = getLineDelimiter();
- String attrIndent = " "; //$NON-NLS-1$
- StringBuffer buffer = new StringBuffer("<extension"); //$NON-NLS-1$
- IDocumentAttribute attr = getDocumentAttribute(P_ID);
- if (attr != null && attr.getAttributeValue().trim().length() > 0)
- buffer.append(sep + getIndent() + attrIndent + attr.write());
- attr = getDocumentAttribute(P_NAME);
- if (attr != null && attr.getAttributeValue().trim().length() > 0)
- buffer.append(sep + getIndent() + attrIndent + attr.write());
- attr = getDocumentAttribute(P_POINT);
- if (attr != null && attr.getAttributeValue().trim().length() > 0)
- buffer.append(sep + getIndent() + attrIndent + attr.write());
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtension#getSchema()
- */
- public Object getSchema() {
- if (fSchema == null) {
- SchemaRegistry registry = PDECore.getDefault().getSchemaRegistry();
- fSchema = registry.getSchema(getPoint());
- } else if (fSchema.isDisposed()) {
- fSchema = null;
- }
- return fSchema;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionPointNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionPointNode.java
deleted file mode 100644
index ba41190..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginExtensionPointNode.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-
-public class PluginExtensionPointNode extends PluginObjectNode
- implements
- IPluginExtensionPoint {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#getFullId()
- */
- public String getFullId() {
- String pluginID = getPluginBase().getId();
- return (pluginID != null) ? pluginID + "." + getId() : getId(); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#getSchema()
- */
- public String getSchema() {
- return getXMLAttributeValue("schema"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#setSchema(java.lang.String)
- */
- public void setSchema(String schema) throws CoreException {
- setXMLAttribute(P_SCHEMA, schema);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#getId()
- */
- public String getId() {
- return getXMLAttributeValue(P_ID);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
- */
- public void setId(String id) throws CoreException {
- setXMLAttribute(P_ID, id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- setXMLAttribute(P_NAME, name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getXMLAttributeValue(P_NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- return indent ? getIndent() + writeShallow(true) : writeShallow(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
- */
- public String writeShallow(boolean terminate) {
- StringBuffer buffer = new StringBuffer("<extension-point"); //$NON-NLS-1$
- appendAttribute(buffer, P_ID);
- appendAttribute(buffer, P_NAME);
- appendAttribute(buffer, P_SCHEMA);
-
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
- return buffer.toString();
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginImportNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginImportNode.java
deleted file mode 100644
index 425648e..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginImportNode.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IMatchRules;
-import org.eclipse.pde.core.plugin.IPluginImport;
-
-public class PluginImportNode extends PluginObjectNode implements IPluginImport {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginImport#isReexported()
- */
- public boolean isReexported() {
- String value = getXMLAttributeValue(P_REEXPORTED);
- return value != null && value.equals("true"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginImport#isOptional()
- */
- public boolean isOptional() {
- String value = getXMLAttributeValue(P_OPTIONAL);
- return value != null && value.equals("true"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginImport#setReexported(boolean)
- */
- public void setReexported(boolean value) throws CoreException {
- setXMLAttribute(P_REEXPORTED, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginImport#setOptional(boolean)
- */
- public void setOptional(boolean value) throws CoreException {
- setXMLAttribute(P_OPTIONAL, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginReference#getMatch()
- */
- public int getMatch() {
- String match = getXMLAttributeValue(P_MATCH);
- if (match == null || match.trim().length() == 0)
- return IMatchRules.NONE;
- if (match.equals("compatible")) //$NON-NLS-1$
- return IMatchRules.COMPATIBLE;
- if (match.equals("perfect")) //$NON-NLS-1$
- return IMatchRules.PERFECT;
- if (match.equals("equivalent")) //$NON-NLS-1$
- return IMatchRules.EQUIVALENT;
- return IMatchRules.GREATER_OR_EQUAL;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginReference#getVersion()
- */
- public String getVersion() {
- return getXMLAttributeValue(P_VERSION);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginReference#setMatch(int)
- */
- public void setMatch(int match) throws CoreException {
- switch(match) {
- case IMatchRules.GREATER_OR_EQUAL:
- setXMLAttribute(P_MATCH, "greaterOrEqual"); //$NON-NLS-1$
- break;
- case IMatchRules.EQUIVALENT:
- setXMLAttribute(P_MATCH, "equivalent"); //$NON-NLS-1$
- break;
- case IMatchRules.COMPATIBLE:
- setXMLAttribute(P_MATCH, "compatible"); //$NON-NLS-1$
- break;
- case IMatchRules.PERFECT:
- setXMLAttribute(P_MATCH, "perfect"); //$NON-NLS-1$
- break;
- default:
- setXMLAttribute(P_MATCH, null);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginReference#setVersion(java.lang.String)
- */
- public void setVersion(String version) throws CoreException {
- setXMLAttribute(P_VERSION, version);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#getId()
- */
- public String getId() {
- return getXMLAttributeValue("plugin"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
- */
- public void setId(String id) throws CoreException {
- setXMLAttribute("plugin", id); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- return indent ? getIndent() + writeShallow(true) : writeShallow(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
- */
- public String writeShallow(boolean terminate) {
- StringBuffer buffer = new StringBuffer("<import"); //$NON-NLS-1$
- appendAttribute(buffer, "plugin"); //$NON-NLS-1$
- appendAttribute(buffer, P_VERSION);
- appendAttribute(buffer, P_MATCH);
- appendAttribute(buffer, P_REEXPORTED, "false"); //$NON-NLS-1$
- appendAttribute(buffer, P_OPTIONAL, "false"); //$NON-NLS-1$
-
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginLibraryNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginLibraryNode.java
deleted file mode 100644
index c51a642..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginLibraryNode.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginLibrary;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public class PluginLibraryNode extends PluginObjectNode implements IPluginLibrary {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#getContentFilters()
- */
- public String[] getContentFilters() {
- IDocumentNode[] children = getChildNodes();
- ArrayList result = new ArrayList();
- for (int i = 0; i < children.length; i++) {
- PluginObjectNode node = (PluginObjectNode)children[i];
- if (node.getName().equals(P_EXPORTED)) {
- String name = children[i].getXMLAttributeValue(P_NAME);
- if (name != null && !name.equals("*")) { //$NON-NLS-1$
- int index = name.indexOf(".*"); //$NON-NLS-1$
- if (index != -1)
- name = name.substring(0, index);
- result.add(name);
- }
- }
- }
- return (String[])result.toArray(new String[result.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#getPackages()
- */
- public String[] getPackages() {
- return new String[0];
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#isExported()
- */
- public boolean isExported() {
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- PluginObjectNode node = (PluginObjectNode)children[i];
- if (node.getName().equals(P_EXPORTED))
- return true;
- }
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#isFullyExported()
- */
- public boolean isFullyExported() {
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- PluginObjectNode node = (PluginObjectNode)children[i];
- if (node.getName().equals(P_EXPORTED)) {
- String name = children[i].getXMLAttributeValue(P_NAME);
- if (name != null && name.equals("*")) //$NON-NLS-1$
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#getType()
- */
- public String getType() {
- String type = getXMLAttributeValue(P_TYPE);
- return (type != null && type.equals("resource")) ? IPluginLibrary.RESOURCE : IPluginLibrary.CODE; //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#setContentFilters(java.lang.String[])
- */
- public void setContentFilters(String[] filters) throws CoreException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#addContentFilter(java.lang.String)
- */
- public void addContentFilter(String filter) throws CoreException {
- PluginElementNode node = new PluginElementNode();
- node.setXMLTagName(P_EXPORTED);
- node.setParentNode(this);
- node.setModel(getModel());
- node.setXMLAttribute(P_NAME, "*".equals(filter) || filter.endsWith(".*") ? filter : filter + ".*"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addContentFilter(node);
- }
-
- public void addContentFilter(PluginElementNode node) throws CoreException {
- addChildNode(node);
- if (isInTheModel()) {
- node.setInTheModel(true);
- fireStructureChanged(node, IModelChangedEvent.INSERT);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#removeContentFilter(java.lang.String)
- */
- public void removeContentFilter(String filter) throws CoreException {
- if (!filter.endsWith(".*")) //$NON-NLS-1$
- filter += ".*"; //$NON-NLS-1$
- IDocumentNode[] children = getChildNodes();
- for (int i = 0; i < children.length; i++) {
- if (children[i].getXMLTagName().equals(P_EXPORTED)
- && filter.equals(children[i].getXMLAttributeValue(P_NAME))) {
- removeContentFilter((PluginElementNode)children[i]);
- }
- }
- }
-
- public void removeContentFilter(PluginElementNode node) {
- removeChildNode(node);
- if (isInTheModel()) {
- node.setInTheModel(false);
- fireStructureChanged(node, IModelChangedEvent.REMOVE);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#setPackages(java.lang.String[])
- */
- public void setPackages(String[] packages) throws CoreException {
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#setExported(boolean)
- */
- public void setExported(boolean exported) throws CoreException {
- IDocumentNode[] children = getChildNodes();
- boolean alreadyExported = false;
- for (int i = 0; i < children.length; i++) {
- if (children[i].getXMLTagName().equals(P_EXPORTED)) {
- if (!"*".equals(children[i].getXMLAttributeValue(P_NAME))) { //$NON-NLS-1$
- removeContentFilter((PluginElementNode)children[i]);
- } else {
- alreadyExported = true;
- if (!exported) {
- removeContentFilter((PluginElementNode)children[i]);
- }
- }
- }
- }
- if (exported && !alreadyExported) {
- addContentFilter("*"); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginLibrary#setType(java.lang.String)
- */
- public void setType(String type) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return getXMLAttributeValue(P_NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- setXMLAttribute(P_NAME, name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
- */
- public String write(boolean indent) {
- String sep = getLineDelimiter();
- StringBuffer buffer = new StringBuffer();
- if (indent)
- buffer.append(getIndent());
-
- IDocumentNode[] children = getChildNodes();
- if (children.length > 0) {
- buffer.append(writeShallow(false) + sep);
- for (int i = 0; i < children.length; i++) {
- children[i].setLineIndent(getLineIndent() + 3);
- buffer.append(children[i].write(true) + sep);
- }
- buffer.append(getIndent() + "</" + getXMLTagName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- buffer.append(writeShallow(true));
- }
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
- */
- public String writeShallow(boolean terminate) {
- StringBuffer buffer = new StringBuffer("<" + getXMLTagName()); //$NON-NLS-1$
-
- IDocumentAttribute[] attrs = getNodeAttributes();
- for (int i = 0; i < attrs.length; i++) {
- appendAttribute(buffer, attrs[i].getAttributeName());
- }
- if (terminate)
- buffer.append("/"); //$NON-NLS-1$
- buffer.append(">"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- public String toString() {
- return getName();
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModel.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModel.java
deleted file mode 100644
index 37b5a2b..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModel.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.pde.core.plugin.IPlugin;
-import org.eclipse.pde.core.plugin.IPluginModel;
-
-public class PluginModel extends PluginModelBase implements IPluginModel {
-
- public PluginModel(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModel#getPlugin()
- */
- public IPlugin getPlugin() {
- return (IPlugin)getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#isFragmentModel()
- */
- public boolean isFragmentModel() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getBundleDescription()
- */
- public BundleDescription getBundleDescription() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#setBundleDescription(org.eclipse.osgi.service.resolver.BundleDescription)
- */
- public void setBundleDescription(BundleDescription description) {
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModelBase.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModelBase.java
deleted file mode 100644
index e554b11..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginModelBase.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.build.IBuildModel;
-import org.eclipse.pde.core.plugin.IExtensions;
-import org.eclipse.pde.core.plugin.IExtensionsModelFactory;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginModelFactory;
-import org.eclipse.pde.internal.core.NLResourceHelper;
-import org.eclipse.pde.internal.core.PDEManager;
-import org.eclipse.pde.internal.core.text.XMLEditingModel;
-import org.xml.sax.helpers.DefaultHandler;
-
-public abstract class PluginModelBase extends XMLEditingModel implements IPluginModelBase {
-
- private PluginBaseNode fPluginBase;
- private boolean fIsEnabled;
- private PluginDocumentHandler fHandler;
- private NodeOffsetHandler fNodeOffsetHandler;
- private IPluginModelFactory fFactory;
-
- public PluginModelBase(IDocument document, boolean isReconciling) {
- super(document, isReconciling);
- fFactory = new PluginDocumentNodeFactory(this);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#createPluginBase()
- */
- public IPluginBase createPluginBase(boolean isFragment) {
- if (isFragment) {
- fPluginBase = new FragmentNode();
- fPluginBase.setXMLTagName("fragment"); //$NON-NLS-1$
- } else {
- fPluginBase = new PluginNode();
- fPluginBase.setXMLTagName("plugin"); //$NON-NLS-1$
- }
- fPluginBase.setInTheModel(true);
- fPluginBase.setModel(this);
- return fPluginBase;
- }
-
- public IPluginBase createPluginBase() {
- return createPluginBase(isFragmentModel());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getBuildModel()
- */
- public IBuildModel getBuildModel() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getPluginBase()
- */
- public IPluginBase getPluginBase() {
- return getPluginBase(true);
- }
-
- public IExtensions getExtensions() {
- return getPluginBase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getPluginBase(boolean)
- */
- public IPluginBase getPluginBase(boolean createIfMissing) {
- if (!fLoaded && createIfMissing) {
- createPluginBase();
- try {
- load();
- } catch (CoreException e) {
- }
- }
- return fPluginBase;
- }
-
- public IExtensions getExtensions(boolean createIfMissing) {
- return getPluginBase(createIfMissing);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#isEnabled()
- */
- public boolean isEnabled() {
- return fIsEnabled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- fIsEnabled = enabled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getPluginFactory()
- */
- public IPluginModelFactory getPluginFactory() {
- return fFactory;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginModelBase#getNLLookupLocation()
- */
- public URL getNLLookupLocation() {
- try {
- String installLocation = getInstallLocation();
- return installLocation == null ? null : new URL("file:" + installLocation); //$NON-NLS-1$
- } catch (MalformedURLException e) {
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.ISharedPluginModel#getFactory()
- */
- public IExtensionsModelFactory getFactory() {
- return fFactory;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#createNLResourceHelper()
- */
- protected NLResourceHelper createNLResourceHelper() {
- URL[] locations = PDEManager.getNLLookupLocations(this);
- return (locations.length == 0)
- ? null
- : new NLResourceHelper("plugin", locations); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.XMLEditingModel#createDocumentHandler(org.eclipse.pde.core.IModel)
- */
- protected DefaultHandler createDocumentHandler(IModel model) {
- if (fHandler == null)
- fHandler = new PluginDocumentHandler(this);
- return fHandler;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.XMLEditingModel#createNodeOffsetHandler(org.eclipse.pde.core.IModel)
- */
- protected DefaultHandler createNodeOffsetHandler(IModel model) {
- if (fNodeOffsetHandler == null)
- fNodeOffsetHandler = new NodeOffsetHandler(this);
- return fNodeOffsetHandler;
- }
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginNode.java
deleted file mode 100644
index 8d0f77a..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.plugin.IPlugin;
-
-public class PluginNode extends PluginBaseNode implements IPlugin {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPlugin#getClassName()
- */
- public String getClassName() {
- return getXMLAttributeValue(P_CLASS_NAME);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPlugin#setClassName(java.lang.String)
- */
- public void setClassName(String className) throws CoreException {
- setXMLAttribute(P_CLASS_NAME, className);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.internal.ui.model.plugin.PluginBaseNode#getSpecificAttributes()
- */
- protected String[] getSpecificAttributes() {
- String classname = getClassName();
- if (classname != null && classname.trim().length() > 0)
- return new String[] {" " + P_CLASS_NAME + "=\"" + classname + "\""}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return new String[0];
- }
- public boolean hasExtensibleAPI() {
- return false;
- }
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginObjectNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginObjectNode.java
deleted file mode 100644
index b10b9f9..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginObjectNode.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.pde.core.IModel;
-import org.eclipse.pde.core.IModelChangeProvider;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.ModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.ISharedPluginModel;
-import org.eclipse.pde.internal.core.text.IDocumentAttribute;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-import org.eclipse.pde.internal.core.text.IEditingModel;
-import org.eclipse.pde.internal.core.util.CoreUtility;
-
-public class PluginObjectNode extends PluginDocumentNode
- implements
- IPluginObject {
-
- private static final long serialVersionUID = 1L;
- private String fName;
- private boolean fInTheModel;
- private transient ISharedPluginModel fModel;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getModel()
- */
- public ISharedPluginModel getModel() {
- return fModel;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getPluginModel()
- */
- public IPluginModelBase getPluginModel() {
- return (IPluginModelBase) fModel;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
- */
- public String getName() {
- return fName;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#isInTheModel()
- */
- public boolean isInTheModel() {
- return fInTheModel;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getTranslatedName()
- */
- public String getTranslatedName() {
- return getResourceString(getName());
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getParent()
- */
- public IPluginObject getParent() {
- return (IPluginObject) getParentNode();
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getPluginBase()
- */
- public IPluginBase getPluginBase() {
- return fModel != null
- ? ((IPluginModelBase) fModel).getPluginBase()
- : null;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#getResourceString(java.lang.String)
- */
- public String getResourceString(String key) {
- return fModel != null ? fModel.getResourceString(key) : key;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
- */
- public void setName(String name) throws CoreException {
- fName = name;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#isValid()
- */
- public boolean isValid() {
- return false;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.IWritable#write(java.lang.String,
- * java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.core.plugin.IPluginObject#setInTheModel(boolean)
- */
- public void setInTheModel(boolean inModel) {
- fInTheModel = inModel;
- }
-
- public void setModel(ISharedPluginModel model) {
- fModel = model;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#setXMLAttribute(java.lang.String,
- * java.lang.String)
- */
- public void setXMLAttribute(String name, String value) {
- String oldValue = getXMLAttributeValue(name);
- PluginAttribute attr = (PluginAttribute) fAttributes.get(name);
- try {
- if (value == null)
- value = ""; //$NON-NLS-1$
- if (attr == null) {
- attr = new PluginAttribute();
- attr.setName(name);
- attr.setEnclosingElement(this);
- fAttributes.put(name, attr);
- }
- attr.setValue(value == null ? "" : value); //$NON-NLS-1$
- } catch (CoreException e) {
- }
- if (fInTheModel)
- firePropertyChanged(attr.getEnclosingElement(), attr
- .getAttributeName(), oldValue, value);
- }
-
- protected void firePropertyChanged(IDocumentNode node, String property,
- Object oldValue, Object newValue) {
- if (fModel.isEditable()) {
- fModel.fireModelObjectChanged(node, property, oldValue, newValue);
- }
- }
-
- protected void fireStructureChanged(IPluginObject child, int changeType) {
- IModel model = getModel();
- if (model.isEditable() && model instanceof IModelChangeProvider) {
- IModelChangedEvent e = new ModelChangedEvent(fModel, changeType,
- new Object[]{child}, null);
- fireModelChanged(e);
- }
- }
-
- protected void fireModelChanged(IModelChangedEvent e) {
- IModel model = getModel();
- if (model.isEditable() && model instanceof IModelChangeProvider) {
- IModelChangeProvider provider = (IModelChangeProvider) model;
- provider.fireModelChanged(e);
- }
- }
-
- public String getWritableString(String source) {
- return CoreUtility.getWritableString(source);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#writeShallow()
- */
- public String writeShallow(boolean terminate) {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.pde.internal.ui.model.IDocumentNode#write()
- */
- public String write(boolean indent) {
- return ""; //$NON-NLS-1$
- }
-
- protected void appendAttribute(StringBuffer buffer, String attrName) {
- appendAttribute(buffer, attrName, ""); //$NON-NLS-1$
- }
-
- protected void appendAttribute(StringBuffer buffer, String attrName, String defaultValue) {
- IDocumentAttribute attr = getDocumentAttribute(attrName);
- if (attr != null) {
- String value = attr.getAttributeValue();
- if (value != null && value.trim().length() > 0 && !value.equals(defaultValue))
- buffer.append(" " + attr.write()); //$NON-NLS-1$
- }
- }
-
- public String getLineDelimiter() {
- return TextUtilities.getDefaultLineDelimiter(((IEditingModel)getModel()).getDocument());
- }
-
-
-
-}
diff --git a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginParentNode.java b/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginParentNode.java
deleted file mode 100644
index c59e7ca..0000000
--- a/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/plugin/PluginParentNode.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.core.text.plugin;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.core.IModelChangedEvent;
-import org.eclipse.pde.core.plugin.IPluginObject;
-import org.eclipse.pde.core.plugin.IPluginParent;
-import org.eclipse.pde.internal.core.text.IDocumentNode;
-
-public class PluginParentNode extends PluginObjectNode implements IPluginParent {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#add(int, org.eclipse.pde.core.plugin.IPluginObject)
- */
- public void add(int index, IPluginObject child) throws CoreException {
- addChildNode((IDocumentNode)child, index);
- fireStructureChanged(child, IModelChangedEvent.INSERT);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#add(org.eclipse.pde.core.plugin.IPluginObject)
- */
- public void add(IPluginObject child) throws CoreException {
- add(getChildCount(), child);
- child.setInTheModel(true);
- ((PluginObjectNode)child).setModel(getModel());
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#getChildCount()
- */
- public int getChildCount() {
- return getChildNodes().length;
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#getIndexOf(org.eclipse.pde.core.plugin.IPluginObject)
- */
- public int getIndexOf(IPluginObject child) {
- return indexOf((IDocumentNode)child);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#swap(org.eclipse.pde.core.plugin.IPluginObject, org.eclipse.pde.core.plugin.IPluginObject)
- */
- public void swap(IPluginObject child1, IPluginObject child2)
- throws CoreException {
- swap((IDocumentNode)child1, (IDocumentNode)child2);
- firePropertyChanged(this, P_SIBLING_ORDER, child1, child2);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#getChildren()
- */
- public IPluginObject[] getChildren() {
- ArrayList result = new ArrayList();
- IDocumentNode[] nodes = getChildNodes();
- for (int i = 0; i < nodes.length; i++)
- result.add(nodes[i]);
-
- return (IPluginObject[])result.toArray(new IPluginObject[result.size()]);
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.core.plugin.IPluginParent#remove(org.eclipse.pde.core.plugin.IPluginObject)
- */
- public void remove(IPluginObject child) throws CoreException {
- removeChildNode((IDocumentNode)child);
- child.setInTheModel(false);
- fireStructureChanged(child, IModelChangedEvent.REMOVE);
- }
-}
diff --git a/ui/org.eclipse.pde.junit.runtime/.classpath b/ui/org.eclipse.pde.junit.runtime/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/ui/org.eclipse.pde.junit.runtime/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ui/org.eclipse.pde.junit.runtime/.cvsignore b/ui/org.eclipse.pde.junit.runtime/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/ui/org.eclipse.pde.junit.runtime/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.junit.runtime/.project b/ui/org.eclipse.pde.junit.runtime/.project
deleted file mode 100644
index e3c3e46..0000000
--- a/ui/org.eclipse.pde.junit.runtime/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.pde.junit.runtime</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.jdt.core.prefs b/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 46f5502..0000000
--- a/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,49 +0,0 @@
-#Wed Nov 23 18:50:03 EST 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.pde.prefs b/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 2b13c47..0000000
--- a/ui/org.eclipse.pde.junit.runtime/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,13 +0,0 @@
-#Thu Jan 26 15:19:32 EST 2006
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=1
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index 3ec2812..0000000
--- a/ui/org.eclipse.pde.junit.runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.pde.junit.runtime; singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-ClassPath: pdejunit.jar
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jdt.junit.runtime;bundle-version="[3.2.0,4.0.0)",
- org.junit,
- org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)";resolution:=optional
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.pde.internal.junit.runtime;x-internal:=true
diff --git a/ui/org.eclipse.pde.junit.runtime/about.html b/ui/org.eclipse.pde.junit.runtime/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/ui/org.eclipse.pde.junit.runtime/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.junit.runtime/build.properties b/ui/org.eclipse.pde.junit.runtime/build.properties
deleted file mode 100644
index e5047fb..0000000
--- a/ui/org.eclipse.pde.junit.runtime/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-source.pdejunit.jar = src/
-bin.includes = *.jar,\
- plugin.xml,\
- plugin.properties,\
- about.html,\
- META-INF/
-src.includes = about.html
diff --git a/ui/org.eclipse.pde.junit.runtime/plugin.properties b/ui/org.eclipse.pde.junit.runtime/plugin.properties
deleted file mode 100644
index 680b946..0000000
--- a/ui/org.eclipse.pde.junit.runtime/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = PDE JUnit Plug-in Test
-providerName = Eclipse.org
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.junit.runtime/plugin.xml b/ui/org.eclipse.pde.junit.runtime/plugin.xml
deleted file mode 100644
index 6d114e8..0000000
--- a/ui/org.eclipse.pde.junit.runtime/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- id="uitestapplication"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.pde.internal.junit.runtime.UITestApplication">
- </run>
- </application>
- </extension>
- <extension
- id="coretestapplication"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.pde.internal.junit.runtime.CoreTestApplication">
- </run>
- </application>
- </extension>
-
-</plugin>
diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/CoreTestApplication.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/CoreTestApplication.java
deleted file mode 100644
index ccba116..0000000
--- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/CoreTestApplication.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.junit.runtime;
-
-import org.eclipse.core.runtime.IPlatformRunnable;
-
-
-public class CoreTestApplication implements IPlatformRunnable {
-
- /**
- * Runs a set of tests as defined by the given command line args.
- * This is the platform application entry point.
- * @see IPlatformRunnable
- */
- public Object run(Object arguments) throws Exception {
- RemotePluginTestRunner.main((String[])arguments);
- return null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java
deleted file mode 100644
index 50a6ef5..0000000
--- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.junit.runtime;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.internal.junit.runner.RemoteTestRunner;
-import org.osgi.framework.Bundle;
-
-/**
- * Runs JUnit tests contained inside a plugin.
- */
-public class RemotePluginTestRunner extends RemoteTestRunner {
-
- private String fTestPluginName;
-
- class BundleClassLoader extends ClassLoader {
- private Bundle bundle;
- public BundleClassLoader(Bundle target) {
- this.bundle = target;
- }
- protected Class findClass(String name) throws ClassNotFoundException {
- return bundle.loadClass(name);
- }
- protected URL findResource(String name) {
- return bundle.getResource(name);
- }
- protected Enumeration findResources(String name) throws IOException {
- return bundle.getResources(name);
- }
- }
-
- /**
- * The main entry point. Supported arguments in addition
- * to the ones supported by RemoteTestRunner:
- * <pre>
- * -testpluginname: the name of the plugin containing the tests.
- * </pre>
- * @see RemoteTestRunner
- */
-
- public static void main(String[] args) {
- RemotePluginTestRunner testRunner= new RemotePluginTestRunner();
- testRunner.init(args);
- testRunner.run();
- }
-
- /**
- * Returns the Plugin class loader of the plugin containing the test.
- * @see RemotePluginTestRunner#getClassLoader()
- */
- protected ClassLoader getClassLoader() {
- Bundle bundle = Platform.getBundle(fTestPluginName);
- if (bundle == null)
- throw new IllegalArgumentException("No Classloader found for plug-in " + fTestPluginName); //$NON-NLS-1$
- return new BundleClassLoader(bundle);
- }
-
- protected void init(String[] args) {
- defaultInit(args);
- setTestPluginName(args);
- }
-
- protected void setTestPluginName(String[] args) {
- for (int i = 0; i < args.length; i++) {
- if (args[i].toLowerCase(Locale.ENGLISH).equals("-testpluginname")) { //$NON-NLS-1$
- if (i < args.length - 1)
- fTestPluginName = args[i + 1];
- return;
- }
- }
- throw new IllegalArgumentException("Parameter -testpluginnname not specified."); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java b/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java
deleted file mode 100644
index f80348d..0000000
--- a/ui/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.junit.runtime;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPlatformRunnable;
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.testing.ITestHarness;
-import org.eclipse.ui.testing.TestableObject;
-
-/**
- * A Workbench that runs a test suite specified in the
- * command line arguments.
- */
-public class UITestApplication implements IPlatformRunnable, ITestHarness {
-
- private static final String DEFAULT_APP_3_0 = "org.eclipse.ui.ide.workbench"; //$NON-NLS-1$
-
- private TestableObject fTestableObject;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
- */
- public Object run(final Object args) throws Exception {
- IPlatformRunnable application = getApplication((String[]) args);
-
- Assert.assertNotNull(application);
-
- fTestableObject = PlatformUI.getTestableObject();
- fTestableObject.setTestHarness(this);
- return application.run(args);
- }
-
-
- /*
- * return the application to run, or null if not even the default application
- * is found.
- */
- private IPlatformRunnable getApplication(String[] args) throws CoreException {
- // Find the name of the application as specified by the PDE JUnit launcher.
- // If no application is specified, the 3.0 default workbench application
- // is returned.
- IExtension extension =
- Platform.getExtensionRegistry().getExtension(
- Platform.PI_RUNTIME,
- Platform.PT_APPLICATIONS,
- getApplicationToRun(args));
-
-
- Assert.assertNotNull(extension);
-
- // If the extension does not have the correct grammar, return null.
- // Otherwise, return the application object.
- IConfigurationElement[] elements = extension.getConfigurationElements();
- if (elements.length > 0) {
- IConfigurationElement[] runs = elements[0].getChildren("run"); //$NON-NLS-1$
- if (runs.length > 0) {
- Object runnable = runs[0].createExecutableExtension("class"); //$NON-NLS-1$
- if (runnable instanceof IPlatformRunnable)
- return (IPlatformRunnable) runnable;
- }
- }
- return null;
- }
-
- /*
- * The -testApplication argument specifies the application to be run.
- * If the PDE JUnit launcher did not set this argument, then return
- * the name of the default application.
- * In 3.0, the default is the "org.eclipse.ui.ide.worbench" application.
- *
- */
- private String getApplicationToRun(String[] args) {
- IProduct product = Platform.getProduct();
- if (product != null)
- return product.getApplication();
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("-testApplication") && i < args.length -1) //$NON-NLS-1$
- return args[i+1];
- }
- return DEFAULT_APP_3_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.testing.ITestHarness#runTests()
- */
- public void runTests() {
- fTestableObject.testingStarting();
- fTestableObject.runTest(new Runnable() {
- public void run() {
- RemotePluginTestRunner.main(Platform.getCommandLineArgs());
- }
- });
- fTestableObject.testingFinished();
- }
-
-}
diff --git a/ui/org.eclipse.pde.runtime/.classpath b/ui/org.eclipse.pde.runtime/.classpath
deleted file mode 100644
index 4848249..0000000
--- a/ui/org.eclipse.pde.runtime/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ui/org.eclipse.pde.runtime/.cvsignore b/ui/org.eclipse.pde.runtime/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/ui/org.eclipse.pde.runtime/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.runtime/.project b/ui/org.eclipse.pde.runtime/.project
deleted file mode 100644
index 5e843b1..0000000
--- a/ui/org.eclipse.pde.runtime/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.pde.runtime</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/ui/org.eclipse.pde.runtime/.settings/org.eclipse.jdt.core.prefs b/ui/org.eclipse.pde.runtime/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 50da0db..0000000
--- a/ui/org.eclipse.pde.runtime/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,49 +0,0 @@
-#Wed Nov 23 18:49:52 EST 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/ui/org.eclipse.pde.runtime/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index 03abd76..0000000
--- a/ui/org.eclipse.pde.runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %name
-Bundle-SymbolicName: org.eclipse.pde.runtime; singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Activator: org.eclipse.pde.internal.runtime.PDERuntimePlugin
-Bundle-Vendor: %provider-name
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)"
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.pde.internal.runtime;x-internal:=true,
- org.eclipse.pde.internal.runtime.logview;x-friends:="org.eclipse.pde.ui",
- org.eclipse.pde.internal.runtime.registry;x-internal:=true
diff --git a/ui/org.eclipse.pde.runtime/about.html b/ui/org.eclipse.pde.runtime/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/ui/org.eclipse.pde.runtime/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.runtime/build.properties b/ui/org.eclipse.pde.runtime/build.properties
deleted file mode 100644
index 3c18de4..0000000
--- a/ui/org.eclipse.pde.runtime/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-source.. = src/
-src.includes=about.html
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- .,\
- about.html,\
- META-INF/
-
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/clear.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/clear.gif
deleted file mode 100644
index 6775edf..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/collapseall.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/collapseall.gif
deleted file mode 100644
index 7dc0de5..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/export_log.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/export_log.gif
deleted file mode 100644
index a5a431e..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/export_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/filter_ps.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/filter_ps.gif
deleted file mode 100644
index f6f6219..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/filter_ps.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/find_obj.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/find_obj.gif
deleted file mode 100644
index f246a63..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/find_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/import_log.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/import_log.gif
deleted file mode 100644
index f935e22..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/import_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/open_log.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/open_log.gif
deleted file mode 100644
index 96d5334..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/open_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/properties.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/properties.gif
deleted file mode 100644
index ec394d6..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/properties.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/refresh.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/refresh.gif
deleted file mode 100644
index 6eafa48..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/remove.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/remove.gif
deleted file mode 100644
index 9e14298..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/remove.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/restore_log.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/restore_log.gif
deleted file mode 100644
index ab62179..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/restore_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/th_horizontal.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/th_horizontal.gif
deleted file mode 100644
index ce1a29c..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/th_horizontal.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/dlcl16/th_vertical.gif b/ui/org.eclipse.pde.runtime/icons/dlcl16/th_vertical.gif
deleted file mode 100644
index a404f8d..0000000
--- a/ui/org.eclipse.pde.runtime/icons/dlcl16/th_vertical.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/clear.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/clear.gif
deleted file mode 100644
index af30a42..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/collapseall.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/collapseall.gif
deleted file mode 100644
index a2d80a9..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/export_log.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/export_log.gif
deleted file mode 100644
index 3465699..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/export_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/filter_ps.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/filter_ps.gif
deleted file mode 100644
index 3d061d7..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/filter_ps.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/find_obj.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/find_obj.gif
deleted file mode 100644
index d540a01..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/find_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/import_log.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/import_log.gif
deleted file mode 100644
index cab213e..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/import_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/open_log.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/open_log.gif
deleted file mode 100644
index 7e4c583..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/open_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/properties.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/properties.gif
deleted file mode 100644
index 1dc19a3..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/properties.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/refresh.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/refresh.gif
deleted file mode 100644
index e383147..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/remove.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/remove.gif
deleted file mode 100644
index b6922ac..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/remove.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/restore_log.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/restore_log.gif
deleted file mode 100644
index 8c4d765..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/restore_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/th_horizontal.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/th_horizontal.gif
deleted file mode 100644
index d590470..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/th_horizontal.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/elcl16/th_vertical.gif b/ui/org.eclipse.pde.runtime/icons/elcl16/th_vertical.gif
deleted file mode 100644
index 50a54e0..0000000
--- a/ui/org.eclipse.pde.runtime/icons/elcl16/th_vertical.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/error_log.gif b/ui/org.eclipse.pde.runtime/icons/eview16/error_log.gif
deleted file mode 100644
index 58873a1..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/error_log.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/event_next.gif b/ui/org.eclipse.pde.runtime/icons/eview16/event_next.gif
deleted file mode 100644
index 072b184..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/event_next.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/event_prev.gif b/ui/org.eclipse.pde.runtime/icons/eview16/event_prev.gif
deleted file mode 100644
index 0716475..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/event_prev.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/hide_pane.gif b/ui/org.eclipse.pde.runtime/icons/eview16/hide_pane.gif
deleted file mode 100644
index 94004ff..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/hide_pane.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/horizontal_view.gif b/ui/org.eclipse.pde.runtime/icons/eview16/horizontal_view.gif
deleted file mode 100644
index 86bfc48..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/horizontal_view.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/registry.gif b/ui/org.eclipse.pde.runtime/icons/eview16/registry.gif
deleted file mode 100644
index c2d6375..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/registry.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/eview16/vertical_view.gif b/ui/org.eclipse.pde.runtime/icons/eview16/vertical_view.gif
deleted file mode 100644
index 493c2fb..0000000
--- a/ui/org.eclipse.pde.runtime/icons/eview16/vertical_view.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/error_st_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/error_st_obj.gif
deleted file mode 100644
index 0bc6068..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/error_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/error_stack.gif b/ui/org.eclipse.pde.runtime/icons/obj16/error_stack.gif
deleted file mode 100644
index e61fc24..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/error_stack.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/ext_point_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/ext_point_obj.gif
deleted file mode 100644
index 17f771a..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/ext_point_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/ext_points_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/ext_points_obj.gif
deleted file mode 100644
index 52f4e5e..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/ext_points_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/extension_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/extension_obj.gif
deleted file mode 100644
index 7f3f595..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/extension_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/extensions_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/extensions_obj.gif
deleted file mode 100644
index e8abf43..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/extensions_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/generic_xml_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/generic_xml_obj.gif
deleted file mode 100644
index 4083e21..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/generic_xml_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/info_st_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/info_st_obj.gif
deleted file mode 100644
index 2da001e..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/info_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/java_lib_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/java_lib_obj.gif
deleted file mode 100644
index cb55e33..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/java_lib_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/ok_st_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/ok_st_obj.gif
deleted file mode 100644
index 9cacb96..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/ok_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/plugin_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/plugin_obj.gif
deleted file mode 100644
index 8493df4..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/plugin_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/req_plugin_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/req_plugin_obj.gif
deleted file mode 100644
index c54f2b3..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/req_plugin_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/req_plugins_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/req_plugins_obj.gif
deleted file mode 100644
index 7f135be..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/req_plugins_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/runtime_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/runtime_obj.gif
deleted file mode 100644
index f159bcd..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/runtime_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/warning_st_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/warning_st_obj.gif
deleted file mode 100644
index 2b2e50f..0000000
--- a/ui/org.eclipse.pde.runtime/icons/obj16/warning_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/icons/ovr16/run_co.gif b/ui/org.eclipse.pde.runtime/icons/ovr16/run_co.gif
deleted file mode 100644
index 13077f9..0000000
--- a/ui/org.eclipse.pde.runtime/icons/ovr16/run_co.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.runtime/plugin.properties b/ui/org.eclipse.pde.runtime/plugin.properties
deleted file mode 100644
index 130205d..0000000
--- a/ui/org.eclipse.pde.runtime/plugin.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#
-# plugin.xml properties
-#
-
-name = Plug-in Development Environment Runtime
-provider-name = Eclipse.org
-
-views.category.name = &PDE Runtime
-views.registry.name= Plug-in Registry
-views.errorLog.name= Error Log
-ViewCommand.registryBrowser.name= Plug-in Registry
-ViewCommand.registryBrowser.description= Show the Plug-in Registry
-ViewCommand.logView.name= Error Log
-ViewCommand.logView.description= Show the Error Log
-
-propertyPages.details.name = Event Details
-propertyPages.session.name = Session Data
diff --git a/ui/org.eclipse.pde.runtime/plugin.xml b/ui/org.eclipse.pde.runtime/plugin.xml
deleted file mode 100644
index 7363fe5..0000000
--- a/ui/org.eclipse.pde.runtime/plugin.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
-<!-- Extensions -->
- <extension
- point="org.eclipse.ui.views">
- <category
- name="%views.category.name"
- id="org.eclipse.pde.runtime">
- </category>
- <view
- name="%views.registry.name"
- icon="$nl$/icons/eview16/registry.gif"
- category="org.eclipse.pde.runtime"
- class="org.eclipse.pde.internal.runtime.registry.RegistryBrowser"
- id="org.eclipse.pde.runtime.RegistryBrowser">
- </view>
- <view
- name="%views.errorLog.name"
- icon="$nl$/icons/eview16/error_log.gif"
- category="org.eclipse.pde.runtime"
- class="org.eclipse.pde.internal.runtime.logview.LogView"
- id="org.eclipse.pde.runtime.LogView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- name="%ViewCommand.registryBrowser.name"
- description="%ViewCommand.registryBrowser.description"
- categoryId="org.eclipse.ui.category.views"
- id="org.eclipse.pde.runtime.RegistryBrowser">
- </command>
- <command
- name="%ViewCommand.logView.name"
- description="%ViewCommand.logView.description"
- categoryId="org.eclipse.ui.category.views"
- id="org.eclipse.pde.runtime.LogView">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.ui.resourcePerspective">
- <viewShortcut
- id="org.eclipse.pde.runtime.LogView">
- </viewShortcut>
- </perspectiveExtension>
- <perspectiveExtension
- targetID="org.eclipse.jdt.ui.JavaPerspective">
- <viewShortcut
- id="org.eclipse.pde.runtime.LogView">
- </viewShortcut>
- </perspectiveExtension>
- <perspectiveExtension
- targetID="org.eclipse.debug.ui.DebugPerspective">
- <viewShortcut
- id="org.eclipse.pde.runtime.LogView">
- </viewShortcut>
- </perspectiveExtension>
- <perspectiveExtension
- targetID="org.eclipse.jdt.ui.JavaBrowsingPerspective">
- <viewShortcut
- id="org.eclipse.pde.runtime.LogView">
- </viewShortcut>
- </perspectiveExtension>
- </extension>
-
-</plugin>
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/IHelpContextIds.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/IHelpContextIds.java
deleted file mode 100644
index 4ef97f7..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/IHelpContextIds.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime;
-
-public interface IHelpContextIds {
- public static final String PREFIX = "org.eclipse.pde.doc.user" + "."; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String LOG_VIEW = PREFIX + "log_view"; //$NON-NLS-1$
- public static final String REGISTRY_VIEW = PREFIX + "registry_view"; //$NON-NLS-1$
-
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/OverlayIcon.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/OverlayIcon.java
deleted file mode 100644
index 4b768e9..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/OverlayIcon.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime;
-
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-
-
-public class OverlayIcon extends CompositeImageDescriptor {
-
- static final int DEFAULT_WIDTH= 16;
- static final int DEFAULT_HEIGHT= 16;
-
- private Point fSize= null;
-
- private ImageDescriptor fBase;
- private ImageDescriptor fOverlays[][];
-
- public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays) {
- fBase= base;
- if (fBase == null)
- fBase= ImageDescriptor.getMissingImageDescriptor();
- fOverlays= overlays;
- fSize= new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
- }
- public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays, Point size) {
- fBase= base;
- if (fBase == null)
- fBase= ImageDescriptor.getMissingImageDescriptor();
- fOverlays= overlays;
- fSize= size;
- }
- protected void drawBottomLeft(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length= overlays.length;
- int x= 0;
- for (int i= 0; i < 3; i++) {
- if (i < length && overlays[i] != null) {
- ImageData id= overlays[i].getImageData();
- drawImage(id, x, getSize().y-id.height);
- x+= id.width;
- }
- }
- }
- protected void drawBottomRight(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length= overlays.length;
- int x= getSize().x;
- for (int i= 2; i >= 0; i--) {
- if (i < length && overlays[i] != null) {
- ImageData id= overlays[i].getImageData();
- x-= id.width;
- drawImage(id, x, getSize().y-id.height);
- }
- }
- }
- protected void drawCompositeImage(int width, int height) {
- ImageData bg= fBase.getImageData();
- drawImage(bg, 0, 0);
-
- if (fOverlays != null) {
- if (fOverlays.length > 0)
- drawTopRight( fOverlays[0]);
-
- if (fOverlays.length > 1)
- drawBottomRight(fOverlays[1]);
-
- if (fOverlays.length > 2)
- drawBottomLeft(fOverlays[2]);
-
- if (fOverlays.length > 3)
- drawTopLeft(fOverlays[3]);
- }
- }
- protected void drawTopLeft(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length= overlays.length;
- int x= 0;
- for (int i= 0; i < 3; i++) {
- if (i < length && overlays[i] != null) {
- ImageData id= overlays[i].getImageData();
- drawImage(id, x, 0);
- x+= id.width;
- }
- }
- }
- protected void drawTopRight(ImageDescriptor[] overlays) {
- if (overlays == null)
- return;
- int length= overlays.length;
- int x= getSize().x;
- for (int i= 2; i >= 0; i--) {
- if (i < length && overlays[i] != null) {
- ImageData id= overlays[i].getImageData();
- x-= id.width;
- drawImage(id, x, 0);
- }
- }
- }
- protected Point getSize() {
- return fSize;
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java
deleted file mode 100644
index 3313d17..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.pde.internal.runtime;
-
-import org.eclipse.osgi.util.NLS;
-
-public class PDERuntimeMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.pde.internal.runtime.pderuntimeresources";//$NON-NLS-1$
-
- public static String LogView_column_severity;
- public static String LogView_column_message;
- public static String LogView_column_plugin;
- public static String LogView_column_date;
- public static String LogView_clear;
- public static String LogView_clear_tooltip;
- public static String LogView_copy;
- public static String LogView_delete;
- public static String LogView_delete_tooltip;
- public static String LogView_export;
- public static String LogView_exportLog;
- public static String LogView_export_tooltip;
- public static String LogView_import;
- public static String LogView_import_tooltip;
- public static String LogView_filter;
- public static String LogView_readLog_reload;
- public static String LogView_readLog_restore;
- public static String LogView_readLog_restore_tooltip;
- public static String LogView_severity_error;
- public static String LogView_severity_warning;
- public static String LogView_severity_info;
- public static String LogView_severity_ok;
- public static String LogView_confirmDelete_title;
- public static String LogView_confirmDelete_message;
- public static String LogView_confirmOverwrite_message;
- public static String LogView_operation_importing;
- public static String LogView_operation_reloading;
- public static String LogView_activate;
- public static String LogView_view_currentLog;
- public static String LogView_view_currentLog_tooltip;
- public static String LogView_properties_tooltip;
-
- public static String LogView_FilterDialog_title;
- public static String LogView_FilterDialog_eventTypes;
- public static String LogView_FilterDialog_information;
- public static String LogView_FilterDialog_warning;
- public static String LogView_FilterDialog_error;
- public static String LogView_FilterDialog_limitTo;
- public static String LogView_FilterDialog_eventsLogged;
- public static String LogView_FilterDialog_allSessions;
- public static String LogView_FilterDialog_recentSession;
-
- public static String RegistryView_extensionPointPR_id;
- public static String RegistryView_extensionPointPR_name;
-
- public static String RegistryView_extensionPR_id;
- public static String RegistryView_extensionPR_name;
- public static String RegistryView_extensionPR_point;
-
- public static String RegistryView_libraryPR_path;
- public static String RegistryView_libraryPR_exported;
- public static String RegistryView_libraryPR_fullyExported;
-
- public static String RegistryView_pluginPR_installURL;
- public static String RegistryView_pluginPR_name;
- public static String RegistryView_pluginPR_id;
- public static String RegistryView_pluginPR_providerName;
- public static String RegistryView_pluginPR_version;
- public static String RegistryView_pluginPR_activated;
-
- public static String RegistryView_prerequisitePR_exported;
- public static String RegistryView_prerequisitePR_id;
- public static String RegistryView_prerequisitePR_version;
- public static String RegistryView_prerequisitePR_optional;
- public static String RegistryView_prerequisitePR_match;
- public static String RegistryView_prerequisitePR_matchedCompatible;
- public static String RegistryView_prerequisitePR_matchedExact;
- public static String RegistryView_prerequisitePR_matchedEquivalent;
- public static String RegistryView_prerequisitePR_matchedGreaterOrEqual;
- public static String RegistryView_prerequisitePR_matchedPerfect;
-
- public static String RegistryView_refresh_label;
- public static String RegistryView_refresh_tooltip;
- public static String RegistryView_collapseAll_label;
- public static String RegistryView_collapseAll_tooltip;
-
- public static String RegistryView_folders_imports;
- public static String RegistryView_folders_libraries;
- public static String RegistryView_folders_extensionPoints;
- public static String RegistryView_folders_extensions;
- public static String EventDetailsDialog_title;
- public static String EventDetailsDialog_date;
- public static String EventDetailsDialog_severity;
- public static String EventDetailsDialog_message;
- public static String EventDetailsDialog_exception;
- public static String EventDetailsDialog_session;
- public static String EventDetailsDialog_noStack;
- public static String EventDetailsDialog_previous;
- public static String EventDetailsDialog_next;
- public static String EventDetailsDialog_copy;
-
- public static String RegistryView_showRunning_label;
-
- public static String RegistryView_showPropertiesSheet_label;
- public static String RegistryView_showPropertiesSheet_tooltip;
- public static String RegistryView_showPropertiesSheet_desc;
-
- public static String RegistryView_verticalOrientation_label;
- public static String RegistryView_verticalOrientation_tooltip;
- public static String RegistryView_verticalOrientation_desc;
-
- public static String RegistryView_horizontalOrientation_label;
- public static String RegistryView_horizontalOrientation_tooltip;
- public static String RegistryView_horizontalOrientation_desc;
-
- public static String RegistryView_titleSummary;
- public static String OpenLogDialog_title;
- public static String OpenLogDialog_message;
- public static String OpenLogDialog_cannotDisplay;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, PDERuntimeMessages.class);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java
deleted file mode 100644
index fb83f0a..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime;
-
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.pde.internal.runtime.registry.PluginObjectAdapter;
-import org.eclipse.pde.internal.runtime.registry.RegistryPropertySourceFactory;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-
-public class PDERuntimePlugin extends AbstractUIPlugin {
-
- private static PDERuntimePlugin inst;
-
- private BundleContext fContext;
-
- public static IWorkbenchPage getActivePage() {
- return getDefault().internalGetActivePage();
- }
-
- public static Shell getActiveWorkbenchShell() {
- return getActiveWorkbenchWindow().getShell();
- }
-
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- public static PDERuntimePlugin getDefault() {
- return inst;
- }
-
- public static String getPluginId() {
- return getDefault().getBundle().getSymbolicName();
- }
-
- public PDERuntimePlugin() {
- inst = this;
- }
-
- private IWorkbenchPage internalGetActivePage() {
- return getWorkbench().getActiveWorkbenchWindow().getActivePage();
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.fContext = context;
- IAdapterManager manager = Platform.getAdapterManager();
- RegistryPropertySourceFactory factory =
- new RegistryPropertySourceFactory();
- manager.registerAdapters(factory, PluginObjectAdapter.class);
- }
-
- public BundleContext getBundleContext() {
- return this.fContext;
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- inst = null;
- }
-
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java
deleted file mode 100644
index 2ff4a03..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-
-public class PDERuntimePluginImages {
-
- private final static ImageRegistry PLUGIN_REGISTRY =
- PDERuntimePlugin.getDefault().getImageRegistry();
-
- public final static String ICONS_PATH = "icons/"; //$NON-NLS-1$
-
- private static final String PATH_OBJ = ICONS_PATH + "obj16/"; //$NON-NLS-1$
- private static final String PATH_LCL = ICONS_PATH + "elcl16/"; //$NON-NLS-1$
- private static final String PATH_LCL_DISABLED = ICONS_PATH + "dlcl16/"; //$NON-NLS-1$
- private static final String PATH_OVR = ICONS_PATH + "ovr16/"; //$NON-NLS-1$
- private static final String PATH_EVENTS = ICONS_PATH + "eview16/"; //$NON-NLS-1$
-
-
- public static final ImageDescriptor DESC_ERROR_ST_OBJ =
- create(PATH_OBJ, "error_st_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_ERROR_STACK_OBJ =
- create(PATH_OBJ, "error_stack.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_EXT_POINT_OBJ =
- create(PATH_OBJ, "ext_point_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_EXT_POINTS_OBJ =
- create(PATH_OBJ, "ext_points_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_EXTENSION_OBJ =
- create(PATH_OBJ, "extension_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_EXTENSIONS_OBJ =
- create(PATH_OBJ, "extensions_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_GENERIC_XML_OBJ =
- create(PATH_OBJ, "generic_xml_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_INFO_ST_OBJ =
- create(PATH_OBJ, "info_st_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_JAVA_LIB_OBJ =
- create(PATH_OBJ, "java_lib_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_NATIVE_LIB_OBJ =
- create(PATH_OBJ, "native_lib_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_OK_ST_OBJ =
- create(PATH_OBJ, "ok_st_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_PLUGIN_OBJ =
- create(PATH_OBJ, "plugin_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_REQ_PLUGIN_OBJ =
- create(PATH_OBJ, "req_plugin_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_REQ_PLUGINS_OBJ =
- create(PATH_OBJ, "req_plugins_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_RUNTIME_OBJ =
- create(PATH_OBJ, "runtime_obj.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_WARNING_ST_OBJ =
- create(PATH_OBJ, "warning_st_obj.gif"); //$NON-NLS-1$
-
- /*
- * Local tool bar image descriptors
- */
-
- public static final ImageDescriptor DESC_PROPERTIES =
- create(PATH_LCL, "properties.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_OPEN_LOG =
- create(PATH_LCL, "open_log.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_OPEN_LOG_DISABLED =
- create(PATH_LCL_DISABLED, "open_log.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_PROPERTIES_DISABLED =
- create(PATH_LCL_DISABLED, "properties.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_REFRESH =
- create(PATH_LCL, "refresh.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_REFRESH_DISABLED =
- create(PATH_LCL_DISABLED, "refresh.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_CLEAR = create(PATH_LCL, "clear.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_CLEAR_DISABLED =
- create(PATH_LCL_DISABLED, "clear.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_READ_LOG =
- create(PATH_LCL, "restore_log.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_READ_LOG_DISABLED =
- create(PATH_LCL_DISABLED, "restore_log.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_REMOVE_LOG =
- create(PATH_LCL, "remove.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_REMOVE_LOG_DISABLED =
- create(PATH_LCL_DISABLED, "remove.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_FILTER =
- create(PATH_LCL, "filter_ps.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_FILTER_DISABLED =
- create(PATH_LCL_DISABLED, "filter_ps.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_EXPORT =
- create(PATH_LCL, "export_log.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_EXPORT_DISABLED =
- create(PATH_LCL_DISABLED, "export_log.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_IMPORT =
- create(PATH_LCL, "import_log.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_IMPORT_DISABLED =
- create(PATH_LCL_DISABLED, "import_log.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_COLLAPSE_ALL =
- create(PATH_LCL, "collapseall.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_HORIZONTAL_VIEW =
- create(PATH_LCL, "th_horizontal.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_HORIZONTAL_VIEW_DISABLED =
- create(PATH_LCL_DISABLED, "th_horizontal.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_VERTICAL_VIEW =
- create(PATH_LCL, "th_vertical.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_VERTICAL_VIEW_DISABLED =
- create(PATH_LCL_DISABLED, "th_vertical.gif"); //$NON-NLS-1$
-
- public static final ImageDescriptor DESC_HIDE_PANE =
- create(PATH_EVENTS, "hide_pane.gif"); //$NON-NLS-1$
-
- /*
- * Event Details
- */
- public static final ImageDescriptor DESC_PREV_EVENT =
- create(PATH_EVENTS, "event_prev.gif"); //$NON-NLS-1$
- public static final ImageDescriptor DESC_NEXT_EVENT =
- create(PATH_EVENTS, "event_next.gif"); //$NON-NLS-1$
- /*
- * Overlays
- */
- public static final ImageDescriptor DESC_RUN_CO =
- create(PATH_OVR, "run_co.gif"); //$NON-NLS-1$
-
- private static ImageDescriptor create(String prefix, String name) {
- return ImageDescriptor.createFromURL(makeIconURL(prefix, name));
- }
-
- public static Image get(String key) {
- return PLUGIN_REGISTRY.get(key);
- }
- private static URL makeIconURL(String prefix, String name) {
- String path = "$nl$/" + prefix + name; //$NON-NLS-1$
- return Platform.find(PDERuntimePlugin.getDefault().getBundle(), new Path(path));
- }
- public static Image manage(String key, ImageDescriptor desc) {
- Image image = desc.createImage();
- PLUGIN_REGISTRY.put(key, image);
- return image;
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java
deleted file mode 100644
index 00b34c9..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.Collator;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-public class EventDetailsDialog extends TrayDialog {
- private LogEntry entry, parentEntry;
- private LogViewLabelProvider labelProvider;
- private static int COPY_ID = 22;
- private TreeViewer provider;
- private int elementNum, totalElementCount;
- private LogEntry[] entryChildren;
- private int childIndex = 0;
- private boolean isOpen;
- private boolean isLastChild;
- private boolean isAtEndOfLog;
-
- private Label dateLabel;
- private Label severityImageLabel;
- private Label severityLabel;
- private Text msgText;
- private Text stackTraceText;
- private Text sessionDataText;
- private Clipboard clipboard;
- private Button copyButton;
- private Button backButton;
- private Button nextButton;
- private Image imgNextEnabled;
- private Image imgPrevEnabled;
- private Image imgCopyEnabled;
- private SashForm sashForm;
-
- // sorting
- private Comparator comparator = null;
- private Collator collator;
-
- // location configuration
- private Point dialogLocation;
- private Point dialogSize;
- private int[] sashWeights;
-
- /**
- *
- * @param parentShell shell in which dialog is displayed
- * @param selection entry initially selected and to be displayed
- * @param provider viewer
- * @param comparator comparator used to order all entries
- */
- protected EventDetailsDialog(Shell parentShell, IAdaptable selection, ISelectionProvider provider, Comparator comparator) {
- super(parentShell);
- labelProvider = new LogViewLabelProvider();
- this.provider = (TreeViewer) provider;
- this.entry = (LogEntry)selection;
- this.comparator = comparator;
- setShellStyle(SWT.MODELESS | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.CLOSE | SWT.BORDER | SWT.TITLE);
- clipboard = new Clipboard(parentShell.getDisplay());
- initialize();
- createImages();
- collator = Collator.getInstance();
- readConfiguration();
- isLastChild = false;
- isAtEndOfLog = false;
- }
-
- private void initialize() {
- elementNum = getParentElementNum();
- resetTotalElementCount();
- parentEntry = (LogEntry) entry.getParent(entry);
- if (isChild(entry)){
- setEntryChildren(parentEntry);
- resetChildIndex();
- }
- isLastChild = false;
- isAtEndOfLog = false;
- }
-
- private void resetChildIndex() {
- for (int i = 0; i < entryChildren.length; i++) {
- if (equal(entryChildren[i].getMessage(), entry.getMessage())
- && equal(entryChildren[i].getDate(), entry.getDate())
- && equal(entryChildren[i].getPluginId(), entry
- .getPluginId())
- && entryChildren[i].getSeverity() == entry.getSeverity()
- && equal(entryChildren[i].getSeverityText(), entry
- .getSeverityText())) {
- childIndex = i;
- break;
- }
- }
- }
-
- private boolean equal(String str1, String str2) {
- if (str1 == null) {
- return str1 == str2;
- }
- return str1.equals(str2);
- }
-
- private void createImages(){
- imgCopyEnabled =
- PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY).createImage(
- true);
- //imgNextDisabled. = PDERuntimePluginImages.DESC_NEXT_EVENT_DISABLED.createImage(true);
- //imgPrevDisabled = PDERuntimePluginImages.DESC_PREV_EVENT_DISABLED.createImage(true);
- imgPrevEnabled = PDERuntimePluginImages.DESC_PREV_EVENT.createImage(true);
- imgNextEnabled = PDERuntimePluginImages.DESC_NEXT_EVENT.createImage(true);
- }
-
- private boolean isChild(LogEntry entry) {
- return entry.getParent(entry) != null;
- }
-
- public boolean isOpen(){
- return isOpen;
- }
-
- public int open(){
- isOpen = true;
- if (sashWeights == null){
- int width = getSashForm().getClientArea().width;
- if (width - 100 > 0)
- width -= 100;
- else
- width = width/2;
- sashWeights = new int[]{width, getSashForm().getClientArea().width-width};
- }
- getSashForm().setWeights(sashWeights);
- return super.open();
- }
-
- public boolean close() {
- storeSettings();
- isOpen = false;
- imgCopyEnabled.dispose();
- imgNextEnabled.dispose();
- imgPrevEnabled.dispose();
- return super.close();
- }
-
- public void create() {
- super.create();
-
- // dialog location
- if (dialogLocation != null)
- getShell().setLocation(dialogLocation);
-
- // dialog size
- if (dialogSize != null)
- getShell().setSize(dialogSize);
- else
- getShell().setSize(500,550);
-
- applyDialogFont(buttonBar);
- getButton(IDialogConstants.OK_ID).setFocus();
- }
-
- protected void buttonPressed(int buttonId) {
- if (IDialogConstants.OK_ID == buttonId)
- okPressed();
- else if (IDialogConstants.CANCEL_ID == buttonId)
- cancelPressed();
- else if (IDialogConstants.BACK_ID == buttonId)
- backPressed();
- else if (IDialogConstants.NEXT_ID == buttonId)
- nextPressed();
- else if (COPY_ID == buttonId)
- copyPressed();
- }
-
- protected void backPressed() {
- if (isChild(entry)) {
- if (childIndex > 0) {
- if (isLastChild){
- setEntryChildren(parentEntry);
- isLastChild = false;
- }
- childIndex--;
- entry = entryChildren[childIndex];
- } else
- entry = parentEntry;
- } else {
- if (elementNum - 1 >= 0)
- elementNum -= 1;
- entry = entryChildren[elementNum];
- }
- setEntrySelectionInTable();
- }
-
- protected void nextPressed() {
- if (isChild(entry) && childIndex < entryChildren.length-1) {
- childIndex++;
- entry = entryChildren[childIndex];
- isLastChild = childIndex == entryChildren.length - 1;
- } else if (isChild(entry) && isLastChild && !isAtEndOfLog){
- findNextSelectedChild(entry);
- } else if (elementNum + 1 < totalElementCount){
- if (isLastChild){
- setEntryChildren();
- isLastChild = false;
- }
- elementNum += 1;
- entry = entryChildren[elementNum];
- } else { // at end of list but can branch into child elements - bug 58083
- setEntryChildren(entry);
- entry = entryChildren[0];
- isAtEndOfLog = entryChildren.length == 0;
- isLastChild = entryChildren.length == 0;
- }
- setEntrySelectionInTable();
- }
-
- protected void copyPressed() {
- StringWriter writer = new StringWriter();
- PrintWriter pwriter = new PrintWriter(writer);
-
- entry.write(pwriter);
- pwriter.flush();
- String textVersion = writer.toString();
- try {
- pwriter.close();
- writer.close();
- } catch (IOException e) {
- }
- // set the clipboard contents
- clipboard.setContents(new Object[] { textVersion }, new Transfer[] { TextTransfer.getInstance()});
- }
-
- public void setComparator(Comparator comparator){
- this.comparator = comparator;
- updateProperties();
- }
- private void setComparator(byte sortType, final int sortOrder){
- if (sortType == LogView.DATE){
- comparator = new Comparator(){
- public int compare(Object e1, Object e2) {
- try {
- SimpleDateFormat formatter = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
- Date date1 = formatter.parse(((LogEntry) e1).getDate());
- Date date2 = formatter.parse(((LogEntry) e2).getDate());
- if (sortOrder == LogView.ASCENDING)
- return date1.before(date2) ? -1 : 1;
- return date1.after(date2) ? -1 : 1;
- } catch (ParseException e) {
- }
- return 0;
- }
- };
- } else if (sortType == LogView.PLUGIN){
- comparator = new Comparator(){
- public int compare(Object e1, Object e2) {
- LogEntry entry1 = (LogEntry)e1;
- LogEntry entry2 = (LogEntry)e2;
- return collator.compare(entry1.getPluginId(), entry2.getPluginId()) * sortOrder;
- }
- };
- } else {
- comparator = new Comparator(){
- public int compare(Object e1, Object e2) {
- LogEntry entry1 = (LogEntry)e1;
- LogEntry entry2 = (LogEntry)e2;
- return collator.compare(entry1.getMessage(), entry2.getMessage()) * sortOrder;
- }
- };
- }
- }
-
- public void resetSelection(IAdaptable selectedEntry, byte sortType, int sortOrder){
- setComparator(sortType, sortOrder);
- resetSelection(selectedEntry);
- }
-
- public void resetSelection(IAdaptable selectedEntry){
- if (entry.equals(selectedEntry) &&
- elementNum == getParentElementNum()){
- updateProperties();
- return;
- }
- entry = (LogEntry)selectedEntry;
- initialize();
- updateProperties();
- }
-
- public void resetButtons(){
- backButton.setEnabled(false);
- nextButton.setEnabled(false);
- }
-
- private void setEntrySelectionInTable(){
- ISelection selection = new StructuredSelection(entry);
- provider.setSelection(selection);
- }
-
- public void updateProperties() {
- if (isChild(entry)){
- parentEntry = (LogEntry) entry.getParent(entry);
- setEntryChildren(parentEntry);
- resetChildIndex();
- if (childIndex == entryChildren.length - 1)
- isLastChild = true;
- }
-
- resetTotalElementCount();
-
- dateLabel.setText(entry.getDate() != null ? entry.getDate() : ""); //$NON-NLS-1$
- severityImageLabel.setImage(labelProvider.getColumnImage(entry, 0));
- severityLabel.setText(entry.getSeverityText());
- msgText.setText(entry.getMessage() != null ? entry.getMessage() : ""); //$NON-NLS-1$
- String stack = entry.getStack();
- if (stack != null) {
- stackTraceText.setText(stack);
- } else {
- stackTraceText.setText(PDERuntimeMessages.EventDetailsDialog_noStack);
- }
- LogSession session = entry.getSession();
- if (session != null && session.getSessionData() != null)
- sessionDataText.setText(session.getSessionData());
-
- updateButtons();
- }
-
- private void updateButtons(){
- boolean isAtEnd = elementNum == totalElementCount - 1;
- if (isChild(entry)){
- backButton.setEnabled(true);
- nextButton.setEnabled(nextChildExists(entry, parentEntry, entryChildren) || !isLastChild || !isAtEnd || entry.hasChildren());
- } else {
- backButton.setEnabled(elementNum != 0);
- nextButton.setEnabled(!isAtEnd || entry.hasChildren());
- }
- }
-
- private void findNextSelectedChild(LogEntry originalEntry){
- if (isChild (parentEntry)){
- // we're at the end of the child list; find next parent
- // to select. If the parent is a child at the end of the child
- // list, find its next parent entry to select, etc.
-
- entry = parentEntry;
- setEntryChildren((LogEntry)parentEntry.getParent(parentEntry));
- parentEntry = (LogEntry)parentEntry.getParent(parentEntry);
- resetChildIndex();
- isLastChild = childIndex == entryChildren.length-1;
- if (isLastChild){
- findNextSelectedChild(originalEntry);
- } else {
- nextPressed();
- }
- } else {
- entry = originalEntry;
- isAtEndOfLog = true;
- nextPressed();
- }
- }
-
- private boolean nextChildExists(LogEntry originalEntry, LogEntry originalParent, LogEntry[] originalEntries){
- if (isChild (parentEntry)){
- // we're at the end of the child list; find next parent
- // to select. If the parent is a child at the end of the child
- // list, find its next parent entry to select, etc.
-
- entry = parentEntry;
- setEntryChildren((LogEntry)parentEntry.getParent(parentEntry));
- parentEntry = (LogEntry)parentEntry.getParent(parentEntry);
- resetChildIndex();
- if (childIndex == entryChildren.length-1){
- nextChildExists(originalEntry, originalParent, originalEntries);
- } else {
- entry = originalEntry;
- parentEntry = originalParent;
- entryChildren = originalEntries;
- resetChildIndex();
- return true;
- }
- }
- entry = originalEntry;
- parentEntry = originalParent;
- entryChildren = originalEntries;
- resetChildIndex();
- return false;
-
- }
- private void setEntryChildren(){
- Object[] children = ((LogViewContentProvider)provider.getContentProvider()).getElements(null);
-
- if (comparator != null)
- Arrays.sort(children, comparator);
- entryChildren = new LogEntry[children.length];
-
- System.arraycopy(children,0,entryChildren,0,children.length);
- }
-
- private void resetTotalElementCount(){
- totalElementCount = provider.getTree().getItemCount();
- }
-
- private void setEntryChildren(LogEntry parent){
- if (parent == null){
- setEntryChildren();
- return;
- }
- Object[] children = parent.getChildren(parent);
- if (comparator != null)
- Arrays.sort(children, comparator);
- entryChildren = new LogEntry[children.length];
-
- System.arraycopy(children,0,entryChildren,0,children.length);
- }
-
- private int getParentElementNum(){
- LogEntry itemEntry = (LogEntry)((IStructuredSelection)provider.getSelection()).getFirstElement();
- itemEntry = getRootEntry(itemEntry);
-
- setEntryChildren();
- for (int i = 0; i<provider.getTree().getItemCount(); i++){
- try {
- LogEntry littleEntry = entryChildren[i];
- if (itemEntry.equals(littleEntry)){
- return i;
- }
- } catch (Exception e){
-
- }
- }
- return 0;
- }
-
- private LogEntry getRootEntry(LogEntry entry){
- if (!isChild(entry))
- return entry;
- return getRootEntry((LogEntry)entry.getParent(entry));
- }
-
- public SashForm getSashForm(){
- return sashForm;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- container.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- container.setLayoutData(gd);
-
- createDetailsSection(container);
- createSashForm(container);
- createStackSection(getSashForm());
- createSessionSection(getSashForm());
-
- updateProperties();
- Dialog.applyDialogFont(container);
- return container;
- }
-
- private void createSashForm(Composite parent){
- sashForm = new SashForm(parent, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.marginHeight = layout.marginWidth = 0;
- sashForm.setLayout(layout);
- sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- private void createToolbarButtonBar(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = layout.marginHeight = 0;
- layout.numColumns = 1;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
- Composite container = new Composite(comp, SWT.NONE);
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 10;
- layout.numColumns = 1;
- container.setLayout(layout);
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- backButton = createButton(container, IDialogConstants.BACK_ID, "", false); //$NON-NLS-1$
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- gd.verticalSpan = 1;
- backButton.setLayoutData(gd);
- backButton.setToolTipText(PDERuntimeMessages.EventDetailsDialog_previous);
- backButton.setImage(imgPrevEnabled);
-
- nextButton = createButton(container, IDialogConstants.NEXT_ID, "", false); //$NON-NLS-1$
- gd = new GridData();
- gd.horizontalSpan = 3;
- gd.verticalSpan = 1;
- nextButton.setLayoutData(gd);
- nextButton.setToolTipText(PDERuntimeMessages.EventDetailsDialog_next);
- nextButton.setImage(imgNextEnabled);
-
- copyButton = createButton(container, COPY_ID, "", false); //$NON-NLS-1$
- gd = new GridData();
- gd.horizontalSpan = 3;
- gd.verticalSpan = 1;
- copyButton.setLayoutData(gd);
- copyButton.setImage(imgCopyEnabled);
- copyButton.setToolTipText(PDERuntimeMessages.EventDetailsDialog_copy);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- // create OK button only by default
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
- private void createDetailsSection(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- container.setLayout(layout);
- container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- createTextSection(container);
- createToolbarButtonBar(container);
- }
-
- private void createTextSection(Composite parent) {
- Composite textContainer = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = layout.marginWidth = 0;
- textContainer.setLayout(layout);
- textContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(textContainer, SWT.NONE);
- label.setText(PDERuntimeMessages.EventDetailsDialog_date);
- dateLabel = new Label(textContainer, SWT.NULL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- dateLabel.setLayoutData(gd);
-
- label = new Label(textContainer, SWT.NONE);
- label.setText(PDERuntimeMessages.EventDetailsDialog_severity);
- severityImageLabel = new Label(textContainer, SWT.NULL);
- severityLabel = new Label(textContainer, SWT.NULL);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- severityLabel.setLayoutData(gd);
-
- label = new Label(textContainer, SWT.NONE);
- label.setText(PDERuntimeMessages.EventDetailsDialog_message);
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- label.setLayoutData(gd);
- msgText = new Text(textContainer, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER);
- msgText.setEditable(false);
- gd = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING | GridData.GRAB_VERTICAL);
- gd.horizontalSpan = 2;
- gd.heightHint = 44;
- gd.grabExcessVerticalSpace = true;
- msgText.setLayoutData(gd);
- }
-
- private void createStackSection(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 6;
- container.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 100;
- container.setLayoutData(gd);
-
- Label label = new Label(container, SWT.NULL);
- label.setText(PDERuntimeMessages.EventDetailsDialog_exception);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- label.setLayoutData(gd);
-
- stackTraceText = new Text(container, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- stackTraceText.setLayoutData(gd);
- stackTraceText.setEditable(false);
- }
-
- private void createSessionSection(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 6;
- container.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 100;
- container.setLayoutData(gd);
-
- Label line = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.widthHint = 1;
- line.setLayoutData(gd);
-
- Label label = new Label(container, SWT.NONE);
- label.setText(PDERuntimeMessages.EventDetailsDialog_session);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- label.setLayoutData(gd);
- sessionDataText = new Text(container, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL );
- gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- sessionDataText.setLayoutData(gd);
- sessionDataText.setEditable(false);
- }
-
- //--------------- configuration handling --------------
-
- /**
- * Stores the current state in the dialog settings.
- * @since 2.0
- */
- private void storeSettings() {
- writeConfiguration();
- }
- /**
- * Returns the dialog settings object used to share state
- * between several event detail dialogs.
- *
- * @return the dialog settings to be used
- */
- private IDialogSettings getDialogSettings() {
- IDialogSettings settings= PDERuntimePlugin.getDefault().getDialogSettings();
- IDialogSettings dialogSettings = settings.getSection(getClass().getName());
- if (dialogSettings == null)
- dialogSettings = settings.addNewSection(getClass().getName());
- return dialogSettings;
- }
-
- /**
- * Initializes itself from the dialog settings with the same state
- * as at the previous invocation.
- */
- private void readConfiguration() {
- IDialogSettings s= getDialogSettings();
- try {
- int x= s.getInt("x"); //$NON-NLS-1$
- int y= s.getInt("y"); //$NON-NLS-1$
- dialogLocation= new Point(x, y);
-
- x = s.getInt("width"); //$NON-NLS-1$
- y = s.getInt("height"); //$NON-NLS-1$
- dialogSize = new Point(x,y);
-
- sashWeights = new int[2];
- sashWeights[0] = s.getInt("sashWidth1"); //$NON-NLS-1$
- sashWeights[1] = s.getInt("sashWidth2"); //$NON-NLS-1$
-
- } catch (NumberFormatException e) {
- dialogLocation= null;
- dialogSize = null;
- sashWeights = null;
- }
- }
-
- private void writeConfiguration(){
- IDialogSettings s = getDialogSettings();
- Point location = getShell().getLocation();
- s.put("x", location.x); //$NON-NLS-1$
- s.put("y", location.y); //$NON-NLS-1$
-
- Point size = getShell().getSize();
- s.put("width", size.x); //$NON-NLS-1$
- s.put("height", size.y); //$NON-NLS-1$
-
- sashWeights = getSashForm().getWeights();
- s.put("sashWidth1", sashWeights[0]); //$NON-NLS-1$
- s.put("sashWidth2", sashWeights[1]); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialogAction.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialogAction.java
deleted file mode 100644
index 469bd9d..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialogAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionProviderAction;
-
-
-public class EventDetailsDialogAction extends SelectionProviderAction{
-
- /**
- * The shell in which to open the property dialog
- */
- private Shell shell;
- private ISelectionProvider provider;
- private EventDetailsDialog propertyDialog;
- private Comparator comparator;
- /**
- * Creates a new action for opening a property dialog
- * on the elements from the given selection provider
- * @param shell - the shell in which the dialog will open
- * @param provider - the selection provider whose elements
- * the property dialog will describe
- */
- public EventDetailsDialogAction(Shell shell, ISelectionProvider provider){
- super(provider, PDERuntimeMessages.EventDetailsDialog_title);
- Assert.isNotNull(shell);
- this.shell = shell;
- this.provider = provider;
- // setToolTipText
- //WorkbenchHelp.setHelp
- }
-
- public boolean resetSelection(byte sortType, int sortOrder){
- IAdaptable element = (IAdaptable) getStructuredSelection().getFirstElement();
- if (element == null)
- return false;
- if (propertyDialog != null && propertyDialog.isOpen()){
- propertyDialog.resetSelection(element, sortType, sortOrder);
- return true;
- }
- return false;
- }
- public void resetSelection(){
- IAdaptable element = (IAdaptable) getStructuredSelection().getFirstElement();
- if (element == null)
- return;
- if (propertyDialog != null && propertyDialog.isOpen())
- propertyDialog.resetSelection(element);
- }
-
- public void resetDialogButtons(){
- if (propertyDialog != null && propertyDialog.isOpen())
- propertyDialog.resetButtons();
- }
-
- public void setComparator(Comparator comparator){
- this.comparator = comparator;
- if (propertyDialog != null && propertyDialog.isOpen())
- propertyDialog.setComparator(comparator);
- }
-
- public void run(){
- if (propertyDialog != null && propertyDialog.isOpen()){
- resetSelection();
- return;
- }
-
- //get initial selection
- IAdaptable element = (IAdaptable) getStructuredSelection().getFirstElement();
- if (element == null)
- return;
-
- propertyDialog = new EventDetailsDialog(shell, element, provider, comparator);
- propertyDialog.create();
- propertyDialog.getShell().setText(PDERuntimeMessages.EventDetailsDialog_title);
- propertyDialog.open();
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/FilterDialog.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/FilterDialog.java
deleted file mode 100644
index 6668155..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/FilterDialog.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IMemento;
-
-
-public class FilterDialog extends TrayDialog {
- private Button limit;
- private Text limitText;
-
- private Button okButton;
- private Button errorButton;
- private Button warningButton;
- private Button infoButton;
- private Button showAllButton;
- private IMemento memento;
-
- public FilterDialog(Shell parentShell, IMemento memento) {
- super(parentShell);
- this.memento = memento;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite container = (Composite)super.createDialogArea(parent);
- createEventTypesGroup(container);
- createLimitSection(container);
- createSessionSection(container);
-
- Dialog.applyDialogFont(container);
- return container;
- }
-
- private void createEventTypesGroup(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 275;
- group.setLayoutData(gd);
- group.setText(PDERuntimeMessages.LogView_FilterDialog_eventTypes);
-
- infoButton = new Button(group, SWT.CHECK);
- infoButton.setText(PDERuntimeMessages.LogView_FilterDialog_information);
- infoButton.setSelection(memento.getString(LogView.P_LOG_INFO).equals("true")); //$NON-NLS-1$
-
- warningButton = new Button(group, SWT.CHECK);
- warningButton.setText(PDERuntimeMessages.LogView_FilterDialog_warning);
- warningButton.setSelection(memento.getString(LogView.P_LOG_WARNING).equals("true")); //$NON-NLS-1$
-
- errorButton = new Button(group, SWT.CHECK);
- errorButton.setText(PDERuntimeMessages.LogView_FilterDialog_error);
- errorButton.setSelection(memento.getString(LogView.P_LOG_ERROR).equals("true")); //$NON-NLS-1$
- }
-
- private void createLimitSection(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- limit = new Button(comp, SWT.CHECK);
- limit.setText(PDERuntimeMessages.LogView_FilterDialog_limitTo);
- limit.setSelection(memento.getString(LogView.P_USE_LIMIT).equals("true")); //$NON-NLS-1$
- limit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- limitText.setEnabled(((Button)e.getSource()).getSelection());
- }});
-
- limitText = new Text(comp, SWT.BORDER);
- limitText.addModifyListener(new ModifyListener(){
- public void modifyText(ModifyEvent e) {
- try {
- if (okButton == null)
- return;
- Integer.parseInt(limitText.getText());
- okButton.setEnabled(true);
- } catch (NumberFormatException e1) {
- okButton.setEnabled(false);
- }
- }});
- limitText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- limitText.setText(memento.getString(LogView.P_LOG_LIMIT));
- limitText.setEnabled(limit.getSelection());
-
- }
-
- private void createSessionSection(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- container.setLayout(new GridLayout());
- container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(container, SWT.NONE);
- label.setText(PDERuntimeMessages.LogView_FilterDialog_eventsLogged);
-
- showAllButton = new Button(container, SWT.RADIO);
- showAllButton.setText(PDERuntimeMessages.LogView_FilterDialog_allSessions);
- GridData gd = new GridData();
- gd.horizontalIndent = 20;
- showAllButton.setLayoutData(gd);
-
- Button button = new Button(container, SWT.RADIO);
- button.setText(PDERuntimeMessages.LogView_FilterDialog_recentSession);
- gd = new GridData();
- gd.horizontalIndent = 20;
- button.setLayoutData(gd);
-
- if (memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")) { //$NON-NLS-1$
- showAllButton.setSelection(true);
- } else {
- button.setSelection(true);
- }
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- okButton = createButton(
- parent,
- IDialogConstants.OK_ID,
- IDialogConstants.OK_LABEL,
- true);
- createButton(
- parent,
- IDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL,
- false);
- }
-
- protected void okPressed() {
- memento.putString(LogView.P_LOG_INFO, infoButton.getSelection() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- memento.putString(LogView.P_LOG_WARNING, warningButton.getSelection() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- memento.putString(LogView.P_LOG_ERROR, errorButton.getSelection() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- memento.putString(LogView.P_LOG_LIMIT, limitText.getText());
- memento.putString(LogView.P_USE_LIMIT, limit.getSelection() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- memento.putString(LogView.P_SHOW_ALL_SESSIONS, showAllButton.getSelection() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- super.okPressed();
- }
-
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogEntry.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogEntry.java
deleted file mode 100644
index e0842ba..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogEntry.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class LogEntry extends PlatformObject implements IWorkbenchAdapter {
- private ArrayList children;
- private LogEntry parent;
- private String pluginId;
- private int severity;
- private int code;
- private String date;
- private String message;
- private String stack;
- private LogSession session;
-
- public LogEntry() {
- }
-
- public LogSession getSession() {
- return session;
- }
-
- void setSession(LogSession session) {
- this.session = session;
- }
-
- public LogEntry(IStatus status) {
- processStatus(status);
- }
- public int getSeverity() {
- return severity;
- }
-
- public boolean isOK() {
- return severity == IStatus.OK;
- }
- public int getCode() {
- return code;
- }
- public String getPluginId() {
- return pluginId;
- }
- public String getMessage() {
- return message;
- }
- public String getStack() {
- return stack;
- }
- public String getDate() {
- return date;
- }
- public String getSeverityText() {
- return getSeverityText(severity);
- }
- public boolean hasChildren() {
- return children != null && children.size() > 0;
- }
- public String toString() {
- return getSeverityText();
- }
- /**
- * @see IWorkbenchAdapter#getChildren(Object)
- */
- public Object[] getChildren(Object parent) {
- if (children == null)
- return new Object[0];
- return children.toArray();
- }
-
- /**
- * @see IWorkbenchAdapter#getImageDescriptor(Object)
- */
- public ImageDescriptor getImageDescriptor(Object arg0) {
- return null;
- }
-
- /**
- * @see IWorkbenchAdapter#getLabel(Object)
- */
- public String getLabel(Object obj) {
- return getSeverityText();
- }
-
- /**
- * @see IWorkbenchAdapter#getParent(Object)
- */
- public Object getParent(Object obj) {
- return parent;
- }
-
- void setParent(LogEntry parent) {
- this.parent = parent;
- }
-
- private String getSeverityText(int severity) {
- switch (severity) {
- case IStatus.ERROR :
- return PDERuntimeMessages.LogView_severity_error;
- case IStatus.WARNING :
- return PDERuntimeMessages.LogView_severity_warning;
- case IStatus.INFO :
- return PDERuntimeMessages.LogView_severity_info;
- case IStatus.OK :
- return PDERuntimeMessages.LogView_severity_ok;
- }
- return "?"; //$NON-NLS-1$
- }
-
-
- void processEntry(String line) {
- //!ENTRY <pluginID> <severity> <code> <date>
- //!ENTRY <pluginID> <date> if logged by the framework!!!
- StringTokenizer stok = new StringTokenizer(line, " "); //$NON-NLS-1$
- int tokenCount = stok.countTokens();
- boolean byFrameWork = stok.countTokens() < 5;
-
- if (byFrameWork) {
- severity = 4;
- code = 0;
- }
- StringBuffer dateBuffer = new StringBuffer();
- for (int i = 0; i < tokenCount; i++) {
- String token = stok.nextToken();
- switch (i) {
- case 0:
- break;
- case 1:
- pluginId = token;
- break;
- case 2:
- if (byFrameWork) {
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- } else {
- severity = parseInteger(token);
- }
- break;
- case 3:
- if (byFrameWork) {
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- } else
- code = parseInteger(token);
- break;
- default:
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- }
- }
- date = dateBuffer.toString();
- }
-
- int processSubEntry(String line) {
- //!SUBENTRY <depth> <pluginID> <severity> <code> <date>
- //!SUBENTRY <depth> <pluginID> <date>if logged by the framework!!!
- StringTokenizer stok = new StringTokenizer(line, " "); //$NON-NLS-1$
- int tokenCount = stok.countTokens();
- boolean byFrameWork = stok.countTokens() < 5;
-
- StringBuffer dateBuffer = new StringBuffer();
- int depth = 0;
- for (int i = 0; i < tokenCount; i++) {
- String token = stok.nextToken();
- switch (i) {
- case 0:
- break;
- case 1:
- depth = parseInteger(token);
- break;
- case 2:
- pluginId = token;
- break;
- case 3:
- if (byFrameWork) {
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- } else {
- severity = parseInteger(token);
- }
- break;
- case 4:
- if (byFrameWork) {
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- } else
- code = parseInteger(token);
- break;
- default:
- if (dateBuffer.length() > 0)
- dateBuffer.append(" "); //$NON-NLS-1$
- dateBuffer.append(token);
- }
- }
- date = dateBuffer.toString();
- return depth;
- }
-
- private int parseInteger(String token) {
- try {
- return Integer.parseInt(token);
- } catch (NumberFormatException e) {
- return 0;
- }
- }
-
- void setStack(String stack) {
- this.stack = stack;
- }
- void setMessage(String message) {
- this.message = message;
- }
-
- private void processStatus(IStatus status) {
- pluginId = status.getPlugin();
- severity = status.getSeverity();
- code = status.getCode();
- DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS"); //$NON-NLS-1$
- date = formatter.format(new Date());
- message = status.getMessage();
- Throwable throwable = status.getException();
- if (throwable != null) {
- StringWriter swriter = new StringWriter();
- PrintWriter pwriter = new PrintWriter(swriter);
- throwable.printStackTrace(pwriter);
- pwriter.flush();
- pwriter.close();
- stack = swriter.toString();
- }
- IStatus[] schildren = status.getChildren();
- if (schildren.length > 0) {
- children = new ArrayList();
- for (int i = 0; i < schildren.length; i++) {
- LogEntry child = new LogEntry(schildren[i]);
- addChild(child);
- }
- }
- }
- void addChild(LogEntry child) {
- if (children == null)
- children = new ArrayList();
- children.add(child);
- child.setParent(this);
- }
- public void write(PrintWriter writer) {
- if (session != null)
- writer.println(session.getSessionData());
- writer.println(getSeverityText());
- if (date != null)
- writer.println(getDate());
-
- if (message != null)
- writer.println(getMessage());
-
- if (stack != null) {
- writer.println();
- writer.println(stack);
- }
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java
deleted file mode 100644
index 57fe42c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.ui.IMemento;
-
-class LogReader {
- private static final int SESSION_STATE = 10;
- public static final long MAX_FILE_LENGTH = 1024*1024;
- private static final int ENTRY_STATE = 20;
- private static final int SUBENTRY_STATE = 30;
- private static final int MESSAGE_STATE = 40;
- private static final int STACK_STATE = 50;
- private static final int TEXT_STATE = 60;
- private static final int UNKNOWN_STATE = 70;
-
- private static LogSession currentSession;
-
- public static void parseLogFile(File file, ArrayList entries, IMemento memento) {
- ArrayList parents = new ArrayList();
- LogEntry current = null;
- LogSession session = null;
- int writerState = UNKNOWN_STATE;
- StringWriter swriter = null;
- PrintWriter writer = null;
- int state = UNKNOWN_STATE;
- currentSession = null;
- BufferedReader reader = null;
- try {
-
- reader = new BufferedReader(new InputStreamReader(
- new TailInputStream(file, MAX_FILE_LENGTH), "UTF-8")); //$NON-NLS-1$
- for (;;) {
- String line = reader.readLine();
- if (line == null)
- break;
- line = line.trim();
- if (line.length() == 0)
- continue;
-
- if (line.startsWith("!SESSION")) { //$NON-NLS-1$
- state = SESSION_STATE;
- } else if (line.startsWith("!ENTRY")) { //$NON-NLS-1$
- state = ENTRY_STATE;
- } else if (line.startsWith("!SUBENTRY")) { //$NON-NLS-1$
- state = SUBENTRY_STATE;
- } else if (line.startsWith("!MESSAGE")) { //$NON-NLS-1$
- state = MESSAGE_STATE;
- } else if (line.startsWith("!STACK")) { //$NON-NLS-1$
- state = STACK_STATE;
- } else
- state = TEXT_STATE;
-
- if (state == TEXT_STATE) {
- if (writer != null)
- writer.println(line);
- continue;
- }
-
- if (writer != null) {
- if (writerState == STACK_STATE && current != null) {
- current.setStack(swriter.toString());
- } else if (writerState == SESSION_STATE && session != null) {
- session.setSessionData(swriter.toString());
- } else if (writerState == MESSAGE_STATE && current != null){
- String message = current.getMessage() + swriter.toString();
- message = message.trim();
- current.setMessage(message);
- }
- writerState = UNKNOWN_STATE;
- swriter = null;
- writer.close();
- writer = null;
- }
-
- if (state == STACK_STATE) {
- swriter = new StringWriter();
- writer = new PrintWriter(swriter, true);
- writerState = STACK_STATE;
- } else if (state == SESSION_STATE) {
- session = new LogSession();
- session.processLogLine(line);
- swriter = new StringWriter();
- writer = new PrintWriter(swriter, true);
- writerState = SESSION_STATE;
- updateCurrentSession(session);
- if (!currentSession.equals(session) && !memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")) //$NON-NLS-1$
- entries.clear();
- } else if (state == ENTRY_STATE) {
- LogEntry entry = new LogEntry();
- entry.setSession(session);
- entry.processEntry(line);
- setNewParent(parents, entry, 0);
- current = entry;
- addEntry(current, entries, memento, false);
- } else if (state == SUBENTRY_STATE) {
- if (parents.size() > 0) {
- LogEntry entry = new LogEntry();
- entry.setSession(session);
- int depth = entry.processSubEntry(line);
- setNewParent(parents, entry, depth);
- current = entry;
- LogEntry parent = (LogEntry) parents.get(depth - 1);
- parent.addChild(entry);
- }
- } else if (state == MESSAGE_STATE) {
- swriter = new StringWriter();
- writer = new PrintWriter(swriter, true);
- String message = ""; //$NON-NLS-1$
- if (line.length() > 8)
- message = line.substring(9).trim();
- message = message.trim();
- if (current != null)
- current.setMessage(message);
- writerState = MESSAGE_STATE;
- }
- }
-
- if (swriter != null && current != null && writerState == STACK_STATE)
- current.setStack(swriter.toString());
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- try {
- if (reader != null)
- reader.close();
- } catch (IOException e1) {
- }
- if (writer != null)
- writer.close();
- }
- }
-
- private static void updateCurrentSession(LogSession session) {
- if (currentSession == null) {
- currentSession = session;
- return;
- }
- Date currentDate = currentSession.getDate();
- Date sessionDate = session.getDate();
- if (currentDate == null && sessionDate != null)
- currentSession = session;
- else if (currentDate != null && sessionDate == null)
- currentSession = session;
- else if (currentDate != null && sessionDate != null && sessionDate.after(currentDate))
- currentSession = session;
- }
-
- public static void addEntry(LogEntry current, ArrayList entries, IMemento memento, boolean useCurrentSession) {
- int severity = current.getSeverity();
- boolean doAdd = true;
- switch(severity) {
- case IStatus.INFO:
- doAdd = memento.getString(LogView.P_LOG_INFO).equals("true"); //$NON-NLS-1$
- break;
- case IStatus.WARNING:
- doAdd = memento.getString(LogView.P_LOG_WARNING).equals("true"); //$NON-NLS-1$
- break;
- case IStatus.ERROR:
- doAdd = memento.getString(LogView.P_LOG_ERROR).equals("true"); //$NON-NLS-1$
- break;
- }
- if (doAdd) {
- if (useCurrentSession)
- current.setSession(currentSession);
- entries.add(0, current);
-
- if (memento.getString(LogView.P_USE_LIMIT).equals("true") //$NON-NLS-1$
- && entries.size() > memento.getInteger(LogView.P_LOG_LIMIT).intValue())
- entries.remove(entries.size() - 1);
- }
- }
-
- private static void setNewParent(
- ArrayList parents,
- LogEntry entry,
- int depth) {
- if (depth + 1 > parents.size())
- parents.add(entry);
- else
- parents.set(depth, entry);
- }
-
- public static void reset() {
- currentSession = null;
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogSession.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogSession.java
deleted file mode 100644
index 3253a72..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogSession.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.StringTokenizer;
-
-public class LogSession {
- private String sessionData;
- private Date date;
-
- /**
- * Constructor for LogSession.
- */
- public LogSession() {
- }
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(String dateString) {
- SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss.SS"); //$NON-NLS-1$
- try {
- date = formatter.parse(dateString);
- } catch (ParseException e) {
- }
- }
-
- public String getSessionData() {
- return sessionData;
- }
-
- void setSessionData(String data) {
- this.sessionData = data;
- }
-
- public void processLogLine(String line) {
- StringTokenizer tokenizer = new StringTokenizer(line);
- if (tokenizer.countTokens() == 6) {
- tokenizer.nextToken();
- StringBuffer dateBuffer = new StringBuffer();
- for (int i = 0; i < 4; i++) {
- dateBuffer.append(tokenizer.nextToken());
- dateBuffer.append(" "); //$NON-NLS-1$
- }
- setDate(dateBuffer.toString().trim());
- }
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java
deleted file mode 100644
index 4c6e84a..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.text.Collator;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.pde.internal.runtime.IHelpContextIds;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.program.Program;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.ViewPart;
-
-public class LogView extends ViewPart implements ILogListener {
- public static final String P_LOG_WARNING = "warning"; //$NON-NLS-1$
- public static final String P_LOG_ERROR = "error"; //$NON-NLS-1$
- public static final String P_LOG_INFO = "info"; //$NON-NLS-1$
- public static final String P_LOG_LIMIT = "limit"; //$NON-NLS-1$
- public static final String P_USE_LIMIT = "useLimit"; //$NON-NLS-1$
- public static final String P_SHOW_ALL_SESSIONS = "allSessions"; //$NON-NLS-1$
- private static final String P_COLUMN_1 = "column2"; //$NON-NLS-1$
- private static final String P_COLUMN_2 = "column3"; //$NON-NLS-1$
- private static final String P_COLUMN_3 = "column4"; //$NON-NLS-1$
- public static final String P_ACTIVATE = "activate"; //$NON-NLS-1$
- public static final String P_ORDER_TYPE = "orderType"; //$NON-NLS-1$
- public static final String P_ORDER_VALUE = "orderValue"; //$NON-NLS-1$
-
- private int MESSAGE_ORDER;
- private int PLUGIN_ORDER;
- private int DATE_ORDER;
-
- public final static byte MESSAGE = 0x0;
- public final static byte PLUGIN = 0x1;
- public final static byte DATE = 0x2;
- public static int ASCENDING = 1;
- public static int DESCENDING = -1;
-
- private ArrayList fLogs;
-
- private Clipboard fClipboard;
-
- private IMemento fMemento;
- private File fInputFile;
- private String fDirectory;
-
- private Comparator comparator;
- private Collator collator;
-
- // hover text
- private boolean canOpenTextShell;
- private Text textLabel;
- private Shell textShell;
-
- private boolean fFirstEvent = true;
-
- private TreeColumn fColumn1;
- private TreeColumn fColumn2;
- private TreeColumn fColumn3;
-
- private Tree fTree;
- private TreeViewer fTreeViewer;
-
- private Action fPropertiesAction;
- private Action fDeleteLogAction;
- private Action fReadLogAction;
- private Action fCopyAction;
- private Action fActivateViewAction;
- private Action fOpenLogAction;
- private Action fExportAction;
-
- public LogView() {
- fLogs = new ArrayList();
- fInputFile = Platform.getLogFileLocation().toFile();
- }
-
- public void createPartControl(Composite parent) {
- readLogFile();
- createViewer(parent);
- createActions();
- fClipboard = new Clipboard(fTree.getDisplay());
- fTree.setToolTipText(""); //$NON-NLS-1$
- getSite().setSelectionProvider(fTreeViewer);
- initializeViewerSorter();
-
- Platform.addLogListener(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fTree, IHelpContextIds.LOG_VIEW);
- }
-
- private void createActions() {
- IActionBars bars = getViewSite().getActionBars();
-
- fCopyAction = createCopyAction();
- bars.setGlobalActionHandler(ActionFactory.COPY.getId(), fCopyAction);
-
- IToolBarManager toolBarManager = bars.getToolBarManager();
-
- fExportAction = createExportAction();
- toolBarManager.add(fExportAction);
-
- final Action importLogAction = createImportLogAction();
- toolBarManager.add(importLogAction);
-
- toolBarManager.add(new Separator());
-
- final Action clearAction = createClearAction();
- toolBarManager.add(clearAction);
-
- fDeleteLogAction = createDeleteLogAction();
- toolBarManager.add(fDeleteLogAction);
-
- fOpenLogAction = createOpenLogAction();
- toolBarManager.add(fOpenLogAction);
-
- fReadLogAction = createReadLogAction();
- toolBarManager.add(fReadLogAction);
-
- toolBarManager.add(new Separator());
-
- IMenuManager mgr = bars.getMenuManager();
- mgr.add(createFilterAction());
- mgr.add(new Separator());
-
- fActivateViewAction = createActivateViewAction();
- mgr.add(fActivateViewAction);
-
- createPropertiesAction();
-
- MenuManager popupMenuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- IMenuListener listener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(fCopyAction);
- manager.add(new Separator());
- manager.add(clearAction);
- manager.add(fDeleteLogAction);
- manager.add(fOpenLogAction);
- manager.add(fReadLogAction);
- manager.add(new Separator());
- manager.add(fExportAction);
- manager.add(importLogAction);
- manager.add(new Separator());
- ((EventDetailsDialogAction) fPropertiesAction).setComparator(comparator);
- manager.add(fPropertiesAction);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- };
- popupMenuManager.addMenuListener(listener);
- popupMenuManager.setRemoveAllWhenShown(true);
- getSite().registerContextMenu(popupMenuManager, getSite().getSelectionProvider());
- Menu menu = popupMenuManager.createContextMenu(fTree);
- fTree.setMenu(menu);
- }
-
- private Action createActivateViewAction() {
- Action action = new Action(PDERuntimeMessages.LogView_activate) { //
- public void run() {
- fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- };
- action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$
- return action;
- }
-
- private Action createClearAction() {
- Action action = new Action(PDERuntimeMessages.LogView_clear) {
- public void run() {
- handleClear();
- }
- };
- action.setImageDescriptor(PDERuntimePluginImages.DESC_CLEAR);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_CLEAR_DISABLED);
- action.setToolTipText(PDERuntimeMessages.LogView_clear_tooltip);
- action.setText(PDERuntimeMessages.LogView_clear);
- return action;
- }
-
- private Action createCopyAction() {
- Action action = new Action(PDERuntimeMessages.LogView_copy) {
- public void run() {
- copyToClipboard(fTreeViewer.getSelection());
- }
- };
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
- .getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- return action;
- }
-
- private Action createDeleteLogAction() {
- Action action = new Action(PDERuntimeMessages.LogView_delete) {
- public void run() {
- doDeleteLog();
- }
- };
- action.setToolTipText(PDERuntimeMessages.LogView_delete_tooltip);
- action.setImageDescriptor(PDERuntimePluginImages.DESC_REMOVE_LOG);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_REMOVE_LOG_DISABLED);
- action.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile()));
- return action;
- }
-
- private Action createExportAction() {
- Action action = new Action(PDERuntimeMessages.LogView_export) {
- public void run() {
- handleExport();
- }
- };
- action.setToolTipText(PDERuntimeMessages.LogView_export_tooltip);
- action.setImageDescriptor(PDERuntimePluginImages.DESC_EXPORT);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_EXPORT_DISABLED);
- action.setEnabled(fInputFile.exists());
- return action;
- }
-
- private Action createFilterAction() {
- Action action = new Action(PDERuntimeMessages.LogView_filter) {
- public void run() {
- handleFilter();
- }
- };
- action.setToolTipText(PDERuntimeMessages.LogView_filter);
- action.setImageDescriptor(PDERuntimePluginImages.DESC_FILTER);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_FILTER_DISABLED);
- return action;
- }
-
- private Action createImportLogAction() {
- Action action = new Action(PDERuntimeMessages.LogView_import) {
- public void run() {
- handleImport();
- }
- };
- action.setToolTipText(PDERuntimeMessages.LogView_import_tooltip);
- action.setImageDescriptor(PDERuntimePluginImages.DESC_IMPORT);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_IMPORT_DISABLED);
- return action;
- }
-
- private Action createOpenLogAction() {
- Action action = new Action(PDERuntimeMessages.LogView_view_currentLog) {
- public void run() {
- if (fInputFile.exists()) {
- if (fInputFile.length() > LogReader.MAX_FILE_LENGTH) {
- OpenLogDialog openDialog = new OpenLogDialog(getViewSite()
- .getShell(), fInputFile);
- openDialog.create();
- openDialog.open();
- return;
- }
- if (!Program.launch(fInputFile.getAbsolutePath())) {
- Program p = Program.findProgram(".txt"); //$NON-NLS-1$
- if (p != null)
- p.execute(fInputFile.getAbsolutePath());
- else {
- OpenLogDialog openDialog = new OpenLogDialog(
- getViewSite().getShell(), fInputFile);
- openDialog.create();
- openDialog.open();
- }
- }
- }
- }
- };
- action.setImageDescriptor(PDERuntimePluginImages.DESC_OPEN_LOG);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_OPEN_LOG_DISABLED);
- action.setEnabled(fInputFile.exists());
- action.setToolTipText(PDERuntimeMessages.LogView_view_currentLog_tooltip);
- return action;
- }
-
- private void createPropertiesAction() {
- fPropertiesAction = new EventDetailsDialogAction(fTree.getShell(), fTreeViewer);
- fPropertiesAction.setImageDescriptor(PDERuntimePluginImages.DESC_PROPERTIES);
- fPropertiesAction
- .setDisabledImageDescriptor(PDERuntimePluginImages.DESC_PROPERTIES_DISABLED);
- fPropertiesAction.setToolTipText(PDERuntimeMessages.LogView_properties_tooltip);
- fPropertiesAction.setEnabled(false);
- }
-
- private Action createReadLogAction() {
- Action action = new Action(PDERuntimeMessages.LogView_readLog_restore) {
- public void run() {
- fInputFile = Platform.getLogFileLocation().toFile();
- reloadLog();
- }
- };
- action.setToolTipText(PDERuntimeMessages.LogView_readLog_restore_tooltip);
- action.setImageDescriptor(PDERuntimePluginImages.DESC_READ_LOG);
- action.setDisabledImageDescriptor(PDERuntimePluginImages.DESC_READ_LOG_DISABLED);
- return action;
- }
-
- private void createViewer(Composite parent) {
- fTreeViewer = new TreeViewer(parent, SWT.FULL_SELECTION);
- fTree = fTreeViewer.getTree();
- fTree.setLinesVisible(true);
- createColumns(fTree);
- fTreeViewer.setContentProvider(new LogViewContentProvider(this));
- fTreeViewer.setLabelProvider(new LogViewLabelProvider());
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- handleSelectionChanged(e.getSelection());
- if (fPropertiesAction.isEnabled())
- ((EventDetailsDialogAction) fPropertiesAction).resetSelection();
- }
- });
- fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- ((EventDetailsDialogAction) fPropertiesAction).setComparator(comparator);
- fPropertiesAction.run();
- }
- });
- fTreeViewer.setInput(this);
- addMouseListeners();
- }
-
- private void createColumns(Tree tree) {
- fColumn1 = new TreeColumn(tree, SWT.LEFT);
- fColumn1.setText(PDERuntimeMessages.LogView_column_message);
- fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue());
- fColumn1.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MESSAGE_ORDER *= -1;
- ViewerSorter sorter = getViewerSorter(MESSAGE);
- fTreeViewer.setSorter(sorter);
- collator = sorter.getCollator();
- boolean isComparatorSet = ((EventDetailsDialogAction) fPropertiesAction)
- .resetSelection(MESSAGE, MESSAGE_ORDER);
- setComparator(MESSAGE);
- if (!isComparatorSet)
- ((EventDetailsDialogAction) fPropertiesAction)
- .setComparator(comparator);
- fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER);
- fMemento.putInteger(P_ORDER_TYPE, MESSAGE);
- setColumnSorting(fColumn1, MESSAGE_ORDER);
- }
- });
-
- fColumn2 = new TreeColumn(tree, SWT.LEFT);
- fColumn2.setText(PDERuntimeMessages.LogView_column_plugin);
- fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue());
- fColumn2.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- PLUGIN_ORDER *= -1;
- ViewerSorter sorter = getViewerSorter(PLUGIN);
- fTreeViewer.setSorter(sorter);
- collator = sorter.getCollator();
- boolean isComparatorSet = ((EventDetailsDialogAction) fPropertiesAction)
- .resetSelection(PLUGIN, PLUGIN_ORDER);
- setComparator(PLUGIN);
- if (!isComparatorSet)
- ((EventDetailsDialogAction) fPropertiesAction)
- .setComparator(comparator);
- fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER);
- fMemento.putInteger(P_ORDER_TYPE, PLUGIN);
- setColumnSorting(fColumn2, PLUGIN_ORDER);
- }
- });
-
- fColumn3 = new TreeColumn(tree, SWT.LEFT);
- fColumn3.setText(PDERuntimeMessages.LogView_column_date);
- fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue());
- fColumn3.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DATE_ORDER *= -1;
- ViewerSorter sorter = getViewerSorter(DATE);
- fTreeViewer.setSorter(sorter);
- collator = sorter.getCollator();
- setComparator(DATE);
- ((EventDetailsDialogAction) fPropertiesAction).setComparator(comparator);
- fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER);
- fMemento.putInteger(P_ORDER_TYPE, DATE);
- setColumnSorting(fColumn3, DATE_ORDER);
- }
- });
-
- tree.setHeaderVisible(true);
- }
-
- private void initializeViewerSorter() {
- byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue();
- ViewerSorter sorter = getViewerSorter(orderType);
- fTreeViewer.setSorter(sorter);
- if (orderType == MESSAGE )
- setColumnSorting(fColumn1, MESSAGE_ORDER);
- else if (orderType == PLUGIN)
- setColumnSorting(fColumn2, PLUGIN_ORDER);
- else if (orderType == DATE)
- setColumnSorting(fColumn3, DATE_ORDER);
- }
-
- private void setColumnSorting(TreeColumn column, int order) {
- fTree.setSortColumn(column);
- fTree.setSortDirection(order == ASCENDING ? SWT.UP : SWT.DOWN);
- }
-
- public void dispose() {
- writeSettings();
- Platform.removeLogListener(this);
- fClipboard.dispose();
- LogReader.reset();
- super.dispose();
- }
-
-
- private void handleImport() {
- FileDialog dialog = new FileDialog(getViewSite().getShell());
- dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$
- if (fDirectory != null)
- dialog.setFilterPath(fDirectory);
- handleImportPath(dialog.open());
- }
-
- public void handleImportPath(String path) {
- if (path != null && new Path(path).toFile().exists()) {
- fInputFile = new Path(path).toFile();
- fDirectory = fInputFile.getParent();
- IRunnableWithProgress op = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- monitor.beginTask(PDERuntimeMessages.LogView_operation_importing, IProgressMonitor.UNKNOWN);
- readLogFile();
- }
- };
- ProgressMonitorDialog pmd = new ProgressMonitorDialog(getViewSite().getShell());
- try {
- pmd.run(true, true, op);
- } catch (InvocationTargetException e) {
- } catch (InterruptedException e) {
- } finally {
- fReadLogAction.setText(PDERuntimeMessages.LogView_readLog_reload);
- fReadLogAction.setToolTipText(PDERuntimeMessages.LogView_readLog_reload);
- asyncRefresh(false);
- resetDialogButtons();
- }
- }
- }
-
- private void handleExport() {
- FileDialog dialog = new FileDialog(getViewSite().getShell(), SWT.SAVE);
- dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$
- if (fDirectory != null)
- dialog.setFilterPath(fDirectory);
- String path = dialog.open();
- if (path != null) {
- if (path.indexOf('.') == -1 && !path.endsWith(".log")) //$NON-NLS-1$
- path += ".log"; //$NON-NLS-1$
- File outputFile = new Path(path).toFile();
- fDirectory = outputFile.getParent();
- if (outputFile.exists()) {
- String message = NLS.bind(PDERuntimeMessages.LogView_confirmOverwrite_message, outputFile.toString());
- if (!MessageDialog.openQuestion(getViewSite().getShell(), PDERuntimeMessages.LogView_exportLog, message))
- return;
- }
- copy(fInputFile, outputFile);
- }
- }
-
- private void copy(File inputFile, File outputFile) {
- BufferedReader reader = null;
- BufferedWriter writer = null;
- try {
- reader = new BufferedReader(new InputStreamReader(new FileInputStream(
- inputFile), "UTF-8")); //$NON-NLS-1$
- writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
- outputFile), "UTF-8")); //$NON-NLS-1$
- while (reader.ready()) {
- writer.write(reader.readLine());
- writer.write(System.getProperty("line.separator")); //$NON-NLS-1$
- }
- } catch (IOException e) {
- } finally {
- try {
- if (reader != null)
- reader.close();
- if (writer != null)
- writer.close();
- } catch (IOException e1) {
- }
- }
- }
-
- private void handleFilter() {
- FilterDialog dialog = new FilterDialog(
- PDERuntimePlugin.getActiveWorkbenchShell(), fMemento);
- dialog.create();
- dialog.getShell().setText(
- PDERuntimeMessages.LogView_FilterDialog_title);
- if (dialog.open() == FilterDialog.OK)
- reloadLog();
- }
-
- private void doDeleteLog() {
- String title = PDERuntimeMessages.LogView_confirmDelete_title;
- String message = PDERuntimeMessages.LogView_confirmDelete_message;
- if (!MessageDialog.openConfirm(fTree.getShell(), title,
- message))
- return;
- if (fInputFile.delete() || fLogs.size() > 0) {
- fLogs.clear();
- asyncRefresh(false);
- resetDialogButtons();
- }
- }
-
- public void fillContextMenu(IMenuManager manager) {
- }
-
- public LogEntry[] getLogs() {
- return (LogEntry[]) fLogs.toArray(new LogEntry[fLogs.size()]);
- }
-
- protected void handleClear() {
- BusyIndicator.showWhile(fTree.getDisplay(),
- new Runnable() {
- public void run() {
- fLogs.clear();
- asyncRefresh(false);
- resetDialogButtons();
- }
- });
- }
-
- protected void reloadLog() {
- IRunnableWithProgress op = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException,
- InterruptedException {
- monitor.beginTask(PDERuntimeMessages.LogView_operation_reloading,
- IProgressMonitor.UNKNOWN);
- readLogFile();
- }
- };
- ProgressMonitorDialog pmd = new ProgressMonitorDialog(getViewSite().getShell());
- try {
- pmd.run(true, true, op);
- } catch (InvocationTargetException e) {
- } catch (InterruptedException e) {
- } finally {
- fReadLogAction.setText(PDERuntimeMessages.LogView_readLog_restore);
- fReadLogAction.setToolTipText(PDERuntimeMessages.LogView_readLog_restore);
- asyncRefresh(false);
- resetDialogButtons();
- }
- }
-
- private void readLogFile() {
- fLogs.clear();
- if (!fInputFile.exists())
- return;
- LogReader.parseLogFile(fInputFile, fLogs, fMemento);
- }
-
- public void logging(IStatus status, String plugin) {
- if (!fInputFile.equals(Platform.getLogFileLocation().toFile()))
- return;
- if (fFirstEvent) {
- readLogFile();
- asyncRefresh();
- fFirstEvent = false;
- } else {
- pushStatus(status);
- }
- }
-
- private void pushStatus(IStatus status) {
- LogEntry entry = new LogEntry(status);
- LogReader.addEntry(entry, fLogs, fMemento, true);
- asyncRefresh();
- }
-
- private void asyncRefresh() {
- asyncRefresh(true);
- }
-
- private void asyncRefresh(final boolean activate) {
- if (fTree.isDisposed())
- return;
- Display display = fTree.getDisplay();
- final ViewPart view = this;
- if (display != null) {
- display.asyncExec(new Runnable() {
- public void run() {
- if (!fTree.isDisposed()) {
- fTreeViewer.refresh();
- fDeleteLogAction.setEnabled(fInputFile.exists()
- && fInputFile.equals(Platform.getLogFileLocation()
- .toFile()));
- fOpenLogAction.setEnabled(fInputFile.exists());
- fExportAction.setEnabled(fInputFile.exists());
- if (activate && fActivateViewAction.isChecked()) {
- IWorkbenchPage page = PDERuntimePlugin.getActivePage();
- if (page != null)
- page.bringToTop(view);
- }
- }
- }
- });
- }
- }
-
- public void setFocus() {
- if (fTree != null && !fTree.isDisposed())
- fTree.setFocus();
- }
-
- private void handleSelectionChanged(ISelection selection) {
- updateStatus(selection);
- fCopyAction.setEnabled(!selection.isEmpty());
- fPropertiesAction.setEnabled(!selection.isEmpty());
- }
-
- private void updateStatus(ISelection selection) {
- IStatusLineManager status = getViewSite().getActionBars().getStatusLineManager();
- if (selection.isEmpty())
- status.setMessage(null);
- else {
- LogEntry entry = (LogEntry) ((IStructuredSelection) selection)
- .getFirstElement();
- status.setMessage(((LogViewLabelProvider) fTreeViewer.getLabelProvider())
- .getColumnText(entry, 0));
- }
- }
-
- private void copyToClipboard(ISelection selection) {
- StringWriter writer = new StringWriter();
- PrintWriter pwriter = new PrintWriter(writer);
- if (selection.isEmpty())
- return;
- LogEntry entry = (LogEntry) ((IStructuredSelection) selection).getFirstElement();
- entry.write(pwriter);
- pwriter.flush();
- String textVersion = writer.toString();
- try {
- pwriter.close();
- writer.close();
- } catch (IOException e) {
- }
- if (textVersion.trim().length() > 0) {
- // set the clipboard contents
- fClipboard.setContents(new Object[] { textVersion }, new Transfer[] { TextTransfer
- .getInstance() });
- }
- }
-
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- if (memento == null)
- this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$
- else
- this.fMemento = memento;
- readSettings();
-
- // initialize column ordering
- final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue();
- switch (type){
- case DATE:
- DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue();
- MESSAGE_ORDER = DESCENDING;
- PLUGIN_ORDER = DESCENDING;
- break;
- case MESSAGE:
- MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue();
- DATE_ORDER = DESCENDING;
- PLUGIN_ORDER = DESCENDING;
- break;
- case PLUGIN:
- PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue();
- MESSAGE_ORDER = DESCENDING;
- DATE_ORDER = DESCENDING;
- break;
- default:
- DATE_ORDER = DESCENDING;
- MESSAGE_ORDER = DESCENDING;
- PLUGIN_ORDER = DESCENDING;
- }
- if (collator == null)
- collator = Collator.getInstance();
- setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue());
- }
-
- private void initializeMemento() {
- if (fMemento.getString(P_USE_LIMIT) == null)
- fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$
- if (fMemento.getInteger(P_LOG_LIMIT) == null)
- fMemento.putInteger(P_LOG_LIMIT, 50);
- if (fMemento.getString(P_LOG_INFO) == null)
- fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$
- if (fMemento.getString(P_LOG_WARNING) == null)
- fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$
- if (fMemento.getString(P_LOG_ERROR) == null)
- fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$
- if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null)
- fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$
- Integer width = fMemento.getInteger(P_COLUMN_1);
- if (width == null || width.intValue() == 0)
- fMemento.putInteger(P_COLUMN_1, 300);
- width = fMemento.getInteger(P_COLUMN_2);
- if (width == null || width.intValue() == 0)
- fMemento.putInteger(P_COLUMN_2, 150);
- width = fMemento.getInteger(P_COLUMN_3);
- if (width == null || width.intValue() == 0)
- fMemento.putInteger(P_COLUMN_3, 150);
- if (fMemento.getString(P_ACTIVATE) == null)
- fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$
-
- fMemento.putInteger(P_ORDER_VALUE, DESCENDING);
- fMemento.putInteger(P_ORDER_TYPE, DATE);
- }
-
- public void saveState(IMemento memento) {
- if (this.fMemento == null || memento == null)
- return;
- this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth());
- this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth());
- this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth());
- this.fMemento.putString(P_ACTIVATE,
- fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- memento.putMemento(this.fMemento);
- writeSettings();
- }
-
- private void addMouseListeners() {
- Listener tableListener = new Listener() {
- public void handleEvent(Event e) {
- switch (e.type) {
- case SWT.MouseMove:
- onMouseMove(e);
- break;
- case SWT.MouseHover:
- onMouseHover(e);
- break;
- case SWT.MouseDown:
- onMouseDown(e);
- break;
- }
- }
- };
- int[] tableEvents = new int[] { SWT.MouseDown, SWT.MouseMove, SWT.MouseHover };
- for (int i = 0; i < tableEvents.length; i++) {
- fTree.addListener(tableEvents[i], tableListener);
- }
- }
-
- private void makeHoverShell() {
- textShell = new Shell(fTree.getShell(), SWT.NO_FOCUS | SWT.ON_TOP);
- Display display = textShell.getDisplay();
- textShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- GridLayout layout = new GridLayout(1, false);
- int border = ((fTree.getShell().getStyle() & SWT.NO_TRIM) == 0) ? 0 : 1;
- layout.marginHeight = border;
- layout.marginWidth = border;
- textShell.setLayout(layout);
- textShell.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Composite shellComposite = new Composite(textShell, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- shellComposite.setLayout(layout);
- shellComposite.setLayoutData(new GridData(GridData.FILL_BOTH
- | GridData.VERTICAL_ALIGN_BEGINNING));
- textLabel = new Text(shellComposite, SWT.WRAP | SWT.MULTI);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 100;
- gd.grabExcessHorizontalSpace = true;
- textLabel.setLayoutData(gd);
- Color c = fTree.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
- textLabel.setBackground(c);
- c = fTree.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND);
- textLabel.setForeground(c);
- textLabel.setEditable(false);
- textShell.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- onTextShellDispose(e);
- }
- });
- }
-
- void onTextShellDispose(DisposeEvent e) {
- canOpenTextShell = true;
- setFocus();
- }
-
- void onMouseDown(Event e) {
- if (textShell != null && !textShell.isDisposed() && !textShell.isFocusControl()) {
- textShell.close();
- canOpenTextShell = true;
- }
- }
-
- void onMouseHover(Event e) {
- if (!canOpenTextShell)
- return;
- canOpenTextShell = false;
- Point point = new Point(e.x, e.y);
- TreeItem item = fTree.getItem(point);
- if (item == null)
- return;
- String message = ((LogEntry) item.getData()).getStack();
- if (message == null)
- return;
- makeHoverShell();
- textLabel.setText(message);
- int x = point.x + 5;
- int y = point.y - (fTree.getItemHeight() * 2) - 20;
- textShell.setLocation(fTree.toDisplay(x, y));
- textShell.setSize(fTree.getColumn(0).getWidth(), 125);
- textShell.open();
- setFocus();
- }
-
- void onMouseMove(Event e) {
- if (textShell != null && !textShell.isDisposed())
- textShell.close();
-
- Point point = new Point(e.x, e.y);
- TreeItem item = fTree.getItem(point);
- if (item == null)
- return;
- Image image= item.getImage();
- LogEntry entry = (LogEntry)item.getData();
- int parentCount = getNumberOfParents(entry);
- int startRange = 20 + Math.max(image.getBounds().width + 2, 7 + 2)*parentCount;
- int endRange = startRange + 16;
- canOpenTextShell = e.x >= startRange && e.x <= endRange;
- }
-
- private int getNumberOfParents(LogEntry entry){
- LogEntry parent = (LogEntry)entry.getParent(entry);
- if (parent ==null)
- return 0;
- return 1 + getNumberOfParents(parent);
- }
-
- public Comparator getComparator() {
- return comparator;
- }
-
- private void setComparator(byte sortType) {
- if (sortType == DATE) {
- comparator = new Comparator() {
- public int compare(Object e1, Object e2) {
- try {
- SimpleDateFormat formatter = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
- Date date1 = formatter.parse(((LogEntry) e1).getDate());
- Date date2 = formatter.parse(((LogEntry) e2).getDate());
- if (DATE_ORDER == ASCENDING)
- return date1.before(date2) ? DESCENDING : ASCENDING;
- return date1.after(date2) ? DESCENDING : ASCENDING;
- } catch (ParseException e) {
- }
- return 0;
- }
- };
- } else if (sortType == PLUGIN) {
- comparator = new Comparator() {
- public int compare(Object e1, Object e2) {
- LogEntry entry1 = (LogEntry) e1;
- LogEntry entry2 = (LogEntry) e2;
- return collator.compare(entry1.getPluginId(), entry2.getPluginId())
- * PLUGIN_ORDER;
- }
- };
- } else {
- comparator = new Comparator() {
- public int compare(Object e1, Object e2) {
- LogEntry entry1 = (LogEntry) e1;
- LogEntry entry2 = (LogEntry) e2;
- return collator.compare(entry1.getMessage(), entry2.getMessage())
- * MESSAGE_ORDER;
- }
- };
- }
- }
-
- private ViewerSorter getViewerSorter(byte sortType) {
- if (sortType == PLUGIN) {
- return new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- LogEntry entry1 = (LogEntry) e1;
- LogEntry entry2 = (LogEntry) e2;
- return super.compare(viewer, entry1.getPluginId(), entry2
- .getPluginId())
- * PLUGIN_ORDER;
- }
- };
- } else if (sortType == MESSAGE) {
- return new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- LogEntry entry1 = (LogEntry) e1;
- LogEntry entry2 = (LogEntry) e2;
- return super
- .compare(viewer, entry1.getMessage(), entry2.getMessage())
- * MESSAGE_ORDER;
- }
- };
- } else {
- return new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- try {
- SimpleDateFormat formatter = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
- Date date1 = formatter.parse(((LogEntry) e1).getDate());
- Date date2 = formatter.parse(((LogEntry) e2).getDate());
- if (DATE_ORDER == ASCENDING)
- return date1.before(date2) ? DESCENDING : ASCENDING;
- return date1.after(date2) ? DESCENDING : ASCENDING;
- } catch (ParseException e) {
- }
- return 0;
- }
- };
- }
- }
-
- private void resetDialogButtons() {
- ((EventDetailsDialogAction) fPropertiesAction).resetDialogButtons();
- }
-
- /**
- * Returns the filter dialog settings object used to maintain
- * state between filter dialogs
- * @return the dialog settings to be used
- */
- private IDialogSettings getLogSettings() {
- IDialogSettings settings= PDERuntimePlugin.getDefault().getDialogSettings();
- return settings.getSection(getClass().getName());
- }
-
- /**
- * Returns the plugin preferences used to maintain
- * state of log view
- * @return the plugin preferences
- */
- private Preferences getLogPreferences(){
- return PDERuntimePlugin.getDefault().getPluginPreferences();
- }
-
- private void readSettings(){
- IDialogSettings s = getLogSettings();
- Preferences p = getLogPreferences();
- if (s == null || p == null){
- initializeMemento();
- return;
- }
- try {
- fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$
- fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT));
- fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p
- .getInt(P_COLUMN_1) : 300);
- fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p
- .getInt(P_COLUMN_2) : 150);
- fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p
- .getInt(P_COLUMN_3) : 150);
- fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- int order = p.getInt(P_ORDER_VALUE);
- fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order);
- fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE));
- } catch (NumberFormatException e) {
- fMemento.putInteger(P_LOG_LIMIT, 50);
- fMemento.putInteger(P_COLUMN_1, 300);
- fMemento.putInteger(P_COLUMN_2, 150);
- fMemento.putInteger(P_COLUMN_3, 150);
- fMemento.putInteger(P_ORDER_TYPE, DATE);
- fMemento.putInteger(P_ORDER_VALUE, DESCENDING);
- }
- }
-
- private void writeSettings(){
- writeViewSettings();
- writeFilterSettings();
- }
-
- private void writeFilterSettings(){
- IDialogSettings settings = getLogSettings();
- if (settings == null)
- settings = PDERuntimePlugin.getDefault().getDialogSettings().addNewSection(getClass().getName());
- settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$
- settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue());
- settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$
- settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$
- settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$
- settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$
- }
-
- private void writeViewSettings(){
- Preferences preferences = getLogPreferences();
- preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue());
- preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue());
- preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue());
- preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$
- int order = fMemento.getInteger(P_ORDER_VALUE).intValue();
- preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order);
- preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue());
- }
-
- public void sortByDateDescending() {
- setColumnSorting(fColumn3, DESCENDING);
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewContentProvider.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewContentProvider.java
deleted file mode 100644
index b699800..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewContentProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class LogViewContentProvider implements ITreeContentProvider {
- private LogView logView;
-
- public LogViewContentProvider(LogView logView) {
- this.logView = logView;
- }
- public void dispose() {
- }
- public Object[] getChildren(Object element) {
- return ((LogEntry) element).getChildren(element);
- }
- public Object[] getElements(Object element) {
- return logView.getLogs();
- }
- public Object getParent(Object element) {
- return ((LogEntry) element).getParent(element);
- }
- public boolean hasChildren(Object element) {
- return ((LogEntry) element).hasChildren();
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- public boolean isDeleted(Object element) {
- return false;
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java
deleted file mode 100644
index e774d3c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-import org.eclipse.swt.graphics.Image;
-
-public class LogViewLabelProvider
- extends LabelProvider
- implements ITableLabelProvider {
- private Image infoImage;
- private Image okImage;
- private Image errorImage;
- private Image warningImage;
- private Image errorWithStackImage;
-
- public LogViewLabelProvider() {
- errorImage = PDERuntimePluginImages.DESC_ERROR_ST_OBJ.createImage();
- warningImage = PDERuntimePluginImages.DESC_WARNING_ST_OBJ.createImage();
- infoImage = PDERuntimePluginImages.DESC_INFO_ST_OBJ.createImage();
- okImage = PDERuntimePluginImages.DESC_OK_ST_OBJ.createImage();
- errorWithStackImage = PDERuntimePluginImages.DESC_ERROR_STACK_OBJ.createImage();
- }
- public void dispose() {
- errorImage.dispose();
- infoImage.dispose();
- okImage.dispose();
- warningImage.dispose();
- errorWithStackImage.dispose();
- super.dispose();
- }
- public Image getColumnImage(Object element, int columnIndex) {
- LogEntry entry = (LogEntry) element;
- if (columnIndex == 0) {
- switch (entry.getSeverity()) {
- case IStatus.INFO :
- return infoImage;
- case IStatus.OK :
- return okImage;
- case IStatus.WARNING :
- return warningImage;
- default :
- return (entry.getStack() == null ? errorImage : errorWithStackImage);
- }
- }
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- LogEntry entry = (LogEntry) element;
- switch (columnIndex) {
- case 0:
- return entry.getMessage() != null ? entry.getMessage() : ""; //$NON-NLS-1$
- case 1:
- return entry.getPluginId() != null ? entry.getPluginId() : ""; //$NON-NLS-1$
- case 2:
- return entry.getDate() != null ? entry.getDate() : ""; //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/OpenLogDialog.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/OpenLogDialog.java
deleted file mode 100644
index d352f4c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/OpenLogDialog.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.RandomAccessFile;
-import java.io.StringWriter;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Displays the error log in non-Win32 platforms - see bug 55314.
- */
-public final class OpenLogDialog extends TrayDialog {
- // input log file
- private File logFile;
- // location/size configuration
- private IDialogSettings dialogSettings;
- private Point dialogLocation;
- private Point dialogSize;
- private int DEFAULT_WIDTH = 750;
- private int DEFAULT_HEIGHT = 800;
-
- public OpenLogDialog(Shell parentShell, File logFile) {
- super(parentShell);
- this.logFile = logFile;
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN | SWT.MODELESS);
-
- }
-
- /*
- * (non-Javadoc) Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(PDERuntimeMessages.OpenLogDialog_title);
- readConfiguration();
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL,
- true);
- }
-
- public void create() {
- super.create();
- // dialog location
- if (dialogLocation != null)
- getShell().setLocation(dialogLocation);
- // dialog size
- if (dialogSize != null)
- getShell().setSize(dialogSize);
- else
- getShell().setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
- getButton(IDialogConstants.CLOSE_ID).setFocus();
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- Composite outer = (Composite) super.createDialogArea(parent);
- Text text = new Text(outer, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL
- | SWT.NO_FOCUS | SWT.H_SCROLL);
- text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- gridData.grabExcessVerticalSpace = true;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- text.setText(getLogSummary());
- return outer;
- }
-
- private String getLogSummary() {
- StringWriter out = new StringWriter();
- PrintWriter writer = new PrintWriter(out);
- if (logFile.length() > LogReader.MAX_FILE_LENGTH) {
- readLargeFileWithMonitor(writer);
- } else {
- readFileWithMonitor(writer);
- }
- writer.close();
- return out.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.CLOSE_ID) {
- storeSettings();
- close();
- }
- super.buttonPressed(buttonId);
- }
-
- //--------------- configuration handling --------------
- /**
- * Stores the current state in the dialog settings.
- *
- * @since 2.0
- */
- private void storeSettings() {
- writeConfiguration();
- }
-
- /**
- * Returns the dialog settings object used to share state between several
- * event detail dialogs.
- *
- * @return the dialog settings to be used
- */
- private IDialogSettings getDialogSettings() {
- IDialogSettings settings = PDERuntimePlugin.getDefault().getDialogSettings();
- dialogSettings = settings.getSection(getClass().getName());
- if (dialogSettings == null)
- dialogSettings = settings.addNewSection(getClass().getName());
- return dialogSettings;
- }
-
- /**
- * Initializes itself from the dialog settings with the same state as at the
- * previous invocation.
- */
- private void readConfiguration() {
- IDialogSettings s = getDialogSettings();
- try {
- int x = s.getInt("x"); //$NON-NLS-1$
- int y = s.getInt("y"); //$NON-NLS-1$
- dialogLocation = new Point(x, y);
- x = s.getInt("width"); //$NON-NLS-1$
- y = s.getInt("height"); //$NON-NLS-1$
- dialogSize = new Point(x, y);
- } catch (NumberFormatException e) {
- dialogLocation = null;
- dialogSize = null;
- }
- }
-
- private void writeConfiguration() {
- IDialogSettings s = getDialogSettings();
- Point location = getShell().getLocation();
- s.put("x", location.x); //$NON-NLS-1$
- s.put("y", location.y); //$NON-NLS-1$
- Point size = getShell().getSize();
- s.put("width", size.x); //$NON-NLS-1$
- s.put("height", size.y); //$NON-NLS-1$
- }
-
- // reading file within MAX_FILE_LENGTH size
- private void readFile(PrintWriter writer) throws FileNotFoundException, IOException {
- BufferedReader bReader = new BufferedReader(new FileReader(logFile));
- while (bReader.ready())
- writer.println(bReader.readLine());
- }
-
- // reading large files
- private void readLargeFile(PrintWriter writer) throws FileNotFoundException,
- IOException {
- RandomAccessFile random = null;
- boolean hasStarted = false;
- try {
- random = new RandomAccessFile(logFile, "r"); //$NON-NLS-1$
- random.seek(logFile.length() - LogReader.MAX_FILE_LENGTH);
- for (;;) {
- String line = random.readLine();
- if (line == null)
- break;
- line = line.trim();
- if (line.length() == 0)
- continue;
- if (!hasStarted
- && (line.startsWith("!ENTRY") || line.startsWith("!SESSION"))) //$NON-NLS-1$ //$NON-NLS-2$
- hasStarted = true;
- if (hasStarted)
- writer.println(line);
- continue;
- }
- } finally {
- try {
- if (random != null)
- random.close();
- } catch (IOException e1) {
- }
- }
- }
-
- private void readLargeFileWithMonitor(final PrintWriter writer) {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException,
- InterruptedException {
- monitor
- .beginTask(
- PDERuntimeMessages.OpenLogDialog_message, IProgressMonitor.UNKNOWN);
- try {
- readLargeFile(writer);
- } catch (IOException e) {
- writer.println(PDERuntimeMessages.OpenLogDialog_cannotDisplay);
- }
- }
- };
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(getParentShell());
- try {
- dialog.run(true, true, runnable);
- } catch (InvocationTargetException e) {
- } catch (InterruptedException e) {
- }
- }
-
- private void readFileWithMonitor(final PrintWriter writer) {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException,
- InterruptedException {
- monitor
- .beginTask(
- PDERuntimeMessages.OpenLogDialog_message, IProgressMonitor.UNKNOWN);
- try {
- readFile(writer);
- } catch (IOException e) {
- writer.println(PDERuntimeMessages.OpenLogDialog_cannotDisplay);
- }
- }
- };
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(getParentShell());
- try {
- dialog.run(true, true, runnable);
- } catch (InvocationTargetException e) {
- } catch (InterruptedException e) {
- }
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/TailInputStream.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/TailInputStream.java
deleted file mode 100644
index 1ab0c33..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/TailInputStream.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.logview;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-
-public class TailInputStream extends InputStream {
-
- private RandomAccessFile fRaf;
-
- private long fTail;
-
- public TailInputStream(File file, long maxLength) throws IOException {
- super();
- fTail = maxLength;
- fRaf = new RandomAccessFile(file, "r"); //$NON-NLS-1$
- skipHead(file);
- }
-
- private void skipHead(File file) throws IOException {
- if (file.length() > fTail) {
- fRaf.seek(file.length() - fTail);
- // skip bytes until a new line to be sure we start from a beginnng of valid UTF-8 character
- int c= read();
- while(c!='\n' && c!='r' && c!=-1){
- c=read();
- }
-
- }
- }
-
- public int read() throws IOException {
- byte[] b = new byte[1];
- int len = fRaf.read(b, 0, 1);
- if (len < 0) {
- return len;
- }
- return b[0];
- }
-
- public int read(byte[] b) throws IOException {
- return fRaf.read(b, 0, b.length);
- }
-
- public int read(byte[] b, int off, int len) throws IOException {
- return fRaf.read(b, off, len);
- }
-
- public void close() throws IOException {
- fRaf.close();
- }
-
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties
deleted file mode 100644
index cce980c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties
+++ /dev/null
@@ -1,123 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#
-# PDE Runtime resources
-#
-
-LogView_column_severity = !
-LogView_column_message = Message
-LogView_column_plugin = Plug-in
-LogView_column_date = Date
-LogView_clear = C&lear Log Viewer
-LogView_clear_tooltip = Clear Log Viewer
-LogView_copy = &Copy
-LogView_delete = &Delete Log
-LogView_delete_tooltip = Delete Log
-LogView_export = &Export Log...
-LogView_exportLog=Export Log
-LogView_export_tooltip = Export Log
-LogView_import = &Import Log...
-LogView_import_tooltip = Import Log
-LogView_filter = &Filters...
-LogView_readLog_reload = Re&load This Workspace's Log
-LogView_readLog_restore = &Restore Log
-LogView_readLog_restore_tooltip = Restore Log
-LogView_severity_error = Error
-LogView_severity_warning = Warning
-LogView_severity_info = Info
-LogView_severity_ok = OK
-LogView_confirmDelete_title = Confirm Delete
-LogView_confirmDelete_message = Are you sure you want to permanently delete all logged events?
-LogView_confirmOverwrite_message = File " {0}" exists. Would you like to overwrite it?
-LogView_operation_importing = Importing log...
-LogView_operation_reloading = Reloading...
-LogView_activate = &Activate on new events
-LogView_view_currentLog = &Open Log
-LogView_view_currentLog_tooltip = Open Log
-LogView_properties_tooltip = Event Details
-
-LogView_FilterDialog_title = Log Filters
-LogView_FilterDialog_eventTypes = Event Types
-LogView_FilterDialog_information = &Information
-LogView_FilterDialog_warning = &Warning
-LogView_FilterDialog_error = &Error
-LogView_FilterDialog_limitTo = &Limit visible events to:
-LogView_FilterDialog_eventsLogged = Show events logged during:
-LogView_FilterDialog_allSessions = &All sessions
-LogView_FilterDialog_recentSession = &Most recent session
-
-RegistryView_extensionPointPR_id = Id
-RegistryView_extensionPointPR_name = Name
-
-RegistryView_extensionPR_id = Id
-RegistryView_extensionPR_name = Name
-RegistryView_extensionPR_point = Point
-
-RegistryView_libraryPR_path = Path
-RegistryView_libraryPR_exported = Exported
-RegistryView_libraryPR_fullyExported = Fully Exported
-
-RegistryView_pluginPR_installURL = Install URL
-RegistryView_pluginPR_name = Name
-RegistryView_pluginPR_id = Unique ID
-RegistryView_pluginPR_providerName = Provider Name
-RegistryView_pluginPR_version = Version
-RegistryView_pluginPR_activated = Activated
-
-RegistryView_prerequisitePR_exported = Exported
-RegistryView_prerequisitePR_id = Unique Id
-RegistryView_prerequisitePR_version = Required Version
-RegistryView_prerequisitePR_optional = Optional
-RegistryView_prerequisitePR_match = Match Rule
-RegistryView_prerequisitePR_matchedCompatible = Compatible
-RegistryView_prerequisitePR_matchedExact = Exact
-RegistryView_prerequisitePR_matchedEquivalent = Equivalent
-RegistryView_prerequisitePR_matchedGreaterOrEqual = Greater or Equal
-RegistryView_prerequisitePR_matchedPerfect = Perfect
-
-RegistryView_refresh_label=&Refresh
-RegistryView_refresh_tooltip=Refresh
-RegistryView_collapseAll_label = &Collapse All
-RegistryView_collapseAll_tooltip = Collapse All
-
-RegistryView_folders_imports = Prerequisites
-RegistryView_folders_libraries = Run-time Libraries
-RegistryView_folders_extensionPoints = Extension Points
-RegistryView_folders_extensions = Extensions
-EventDetailsDialog_title= Event Details
-EventDetailsDialog_date=Date:
-EventDetailsDialog_severity=Severity:
-EventDetailsDialog_message=Message:
-EventDetailsDialog_exception=Exception Stack Trace:
-EventDetailsDialog_session=Session Data:
-EventDetailsDialog_noStack = An exception stack trace is not available.
-EventDetailsDialog_previous=View Details Of Previous Event
-EventDetailsDialog_next=View Details Of Next Event
-EventDetailsDialog_copy=Copy Event Details To Clipboard
-
-RegistryView_showRunning_label = &Show Active Plug-ins Only
-
-RegistryView_showPropertiesSheet_label = S&how Registry Only
-RegistryView_showPropertiesSheet_tooltip = Show Plug-in Registry Only
-RegistryView_showPropertiesSheet_desc = Hide registry properties
-
-RegistryView_verticalOrientation_label = &Vertical View Orientation
-RegistryView_verticalOrientation_tooltip = Vertical View Orientation
-RegistryView_verticalOrientation_desc = Tile vertically
-
-RegistryView_horizontalOrientation_label = &Horizontal View Orientation
-RegistryView_horizontalOrientation_tooltip = Horizontal View Orientation
-RegistryView_horizontalOrientation_desc = Tile horizontally
-
-RegistryView_titleSummary = Filter matched {0} of {1} plug-ins.
-OpenLogDialog_title=Error Log
-OpenLogDialog_message=Opening log...
-OpenLogDialog_cannotDisplay=Log file cannot be displayed.
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementAdapter.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementAdapter.java
deleted file mode 100644
index 2c4e22d..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementAdapter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-public class ConfigurationElementAdapter extends ParentAdapter {
-
-
-public ConfigurationElementAdapter(Object object) {
- super(object);
-}
-protected Object[] createChildren() {
- IConfigurationElement config = (IConfigurationElement)getObject();
- IConfigurationElement [] children = config.getChildren();
- if (children.length==0) return null;
- Object[] result = new Object[children.length];
- for (int i=0; i<children.length; i++) {
- IConfigurationElement child = children[i];
- result[i] = new ConfigurationElementAdapter(child);
- }
- return result;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementPropertySource.java
deleted file mode 100644
index 3cf7a99..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ConfigurationElementPropertySource.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class ConfigurationElementPropertySource extends RegistryPropertySource {
- private IConfigurationElement config;
-
-public ConfigurationElementPropertySource(IConfigurationElement config) {
- this.config = config;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- String [] atts = config.getAttributeNames();
- for (int i=0; i<atts.length; i++) {
- result.addElement(new PropertyDescriptor(atts[i], atts[i]));
- }
- return toDescriptorArray(result);
-}
-public Object getPropertyValue(Object name) {
- return config.getAttribute(name.toString());
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionAdapter.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionAdapter.java
deleted file mode 100644
index 05c9533..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-
-public class ExtensionAdapter extends ParentAdapter {
-
-
-public ExtensionAdapter(Object object) {
- super(object);
-}
-protected Object[] createChildren() {
- IExtension extension = (IExtension)getObject();
-
- IConfigurationElement [] elements = extension.getConfigurationElements();
- Object [] result = new ConfigurationElementAdapter[elements.length];
- for (int i=0; i<elements.length; i++) {
- IConfigurationElement config = elements[i];
- result[i]=new ConfigurationElementAdapter(config);
- }
- return result;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointAdapter.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointAdapter.java
deleted file mode 100644
index 3014f81..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-
-public class ExtensionPointAdapter extends ParentAdapter {
-
-
-public ExtensionPointAdapter(Object object) {
- super(object);
-}
-protected Object [] createChildren() {
- IExtensionPoint extensionPoint = (IExtensionPoint)getObject();
-
- IExtension [] extensions = extensionPoint.getExtensions();
- Object [] result = new Object[extensions.length];
- for (int i=0; i<extensions.length; i++) {
- IExtension extension = extensions[i];
- result[i] = new ExtensionAdapter(extension);
- }
- return result;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointPropertySource.java
deleted file mode 100644
index d836f2c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPointPropertySource.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class ExtensionPointPropertySource extends RegistryPropertySource {
- private IExtensionPoint extensionPoint;
- public static final String P_NAME = "name"; //$NON-NLS-1$
- public static final String P_ID = "id"; //$NON-NLS-1$
-
-public ExtensionPointPropertySource(IExtensionPoint extensionPoint) {
- this.extensionPoint = extensionPoint;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- result.addElement(new PropertyDescriptor(P_NAME, PDERuntimeMessages.RegistryView_extensionPointPR_name));
- result.addElement(new PropertyDescriptor(P_ID, PDERuntimeMessages.RegistryView_extensionPointPR_id));
- return toDescriptorArray(result);
-}
-public Object getPropertyValue(Object name) {
- if (name.equals(P_NAME))
- return extensionPoint.getLabel();
- if (name.equals(P_ID))
- return extensionPoint.getUniqueIdentifier();
- return null;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPropertySource.java
deleted file mode 100644
index fbf3005..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ExtensionPropertySource.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class ExtensionPropertySource extends RegistryPropertySource {
- private IExtension extension;
- public static final String P_NAME = "name"; //$NON-NLS-1$
- public static final String P_ID = "id"; //$NON-NLS-1$
- public static final String P_POINT = "point"; //$NON-NLS-1$
- public ExtensionPropertySource(IExtension extension) {
- this.extension = extension;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- result.addElement(new PropertyDescriptor(P_NAME, PDERuntimeMessages.RegistryView_extensionPR_name));
- result.addElement(new PropertyDescriptor(P_ID, PDERuntimeMessages.RegistryView_extensionPR_id));
- result.addElement(new PropertyDescriptor(P_POINT, PDERuntimeMessages.RegistryView_extensionPR_point));
- return toDescriptorArray(result);
-}
-public Object getPropertyValue(Object name) {
- if (name.equals(P_NAME))
- return extension.getLabel();
- if (name.equals(P_ID))
- return extension.getUniqueIdentifier();
- if (name.equals(P_POINT))
- return extension.getExtensionPointUniqueIdentifier();
- return null;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/IPluginFolder.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/IPluginFolder.java
deleted file mode 100644
index 562aadd..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/IPluginFolder.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-
-public interface IPluginFolder extends IAdaptable {
- public static final int F_EXTENSIONS = 1;
- public static final int F_EXTENSION_POINTS = 2;
- public static final int F_IMPORTS = 3;
- public static final int F_LIBRARIES = 4;
- public static final int F_FRAGMENTS = 5;
- public Object[] getChildren();
- int getFolderId();
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/LibraryPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/LibraryPropertySource.java
deleted file mode 100644
index 8b44b4f..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/LibraryPropertySource.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.ILibrary;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class LibraryPropertySource extends RegistryPropertySource {
- private ILibrary library;
- public static final String P_PATH = "path"; //$NON-NLS-1$
- public static final String P_EXPORTED = "exported"; //$NON-NLS-1$
- public static final String P_FULLY_EXPORTED = "fully_exported"; //$NON-NLS-1$
-
-public LibraryPropertySource(ILibrary library) {
- this.library = library;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- result.addElement(new PropertyDescriptor(P_PATH, PDERuntimeMessages.RegistryView_libraryPR_path));
- result.addElement(new PropertyDescriptor(P_EXPORTED, PDERuntimeMessages.RegistryView_libraryPR_exported));
- result.addElement(new PropertyDescriptor(P_FULLY_EXPORTED, PDERuntimeMessages.RegistryView_libraryPR_fullyExported));
- return toDescriptorArray(result);
-}
-public Object getPropertyValue(Object name) {
- if (name.equals(P_PATH))
- return library.getPath().toString();
- if (name.equals(P_EXPORTED))
- return library.isExported()?"true":"false"; //$NON-NLS-1$ //$NON-NLS-2$
- if (name.equals(P_FULLY_EXPORTED))
- return library.isFullyExported()?"true":"false"; //$NON-NLS-1$ //$NON-NLS-2$
- return null;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ParentAdapter.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ParentAdapter.java
deleted file mode 100644
index 5f18690..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/ParentAdapter.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-public abstract class ParentAdapter extends PluginObjectAdapter {
- Object [] children;
-
-public ParentAdapter(Object object) {
- super(object);
-}
-protected abstract Object[] createChildren();
-public Object[] getChildren() {
- if (children==null) children = createChildren();
- return children;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginObjectAdapter.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginObjectAdapter.java
deleted file mode 100644
index 85108bc..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginObjectAdapter.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.PlatformObject;
-
-public class PluginObjectAdapter extends PlatformObject {
- private Object object;
-
-public PluginObjectAdapter(Object object) {
- this.object = object;
-}
-public Object getObject() {
- return object;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginPropertySource.java
deleted file mode 100644
index 3c7ab33..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PluginPropertySource.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class PluginPropertySource extends RegistryPropertySource {
- private IPluginDescriptor pd;
- public static final String P_INSTALL_URL="installURL"; //$NON-NLS-1$
- public static final String P_NAME = "name"; //$NON-NLS-1$
- public static final String P_ID = "id"; //$NON-NLS-1$
- public static final String P_PROVIDER = "provider"; //$NON-NLS-1$
- public static final String P_VERSION = "version"; //$NON-NLS-1$
- public static final String P_ACTIVATED = "activated"; //$NON-NLS-1$
- public PluginPropertySource(IPluginDescriptor pd) {
- this.pd = pd;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- result.addElement(new PropertyDescriptor(P_INSTALL_URL, PDERuntimeMessages.RegistryView_pluginPR_installURL));
- result.addElement(new PropertyDescriptor(P_NAME, PDERuntimeMessages.RegistryView_pluginPR_name));
- result.addElement(new PropertyDescriptor(P_ID, PDERuntimeMessages.RegistryView_pluginPR_id));
- result.addElement(new PropertyDescriptor(P_PROVIDER, PDERuntimeMessages.RegistryView_pluginPR_providerName));
- result.addElement(new PropertyDescriptor(P_VERSION, PDERuntimeMessages.RegistryView_pluginPR_version));
- result.addElement(new PropertyDescriptor(P_ACTIVATED, PDERuntimeMessages.RegistryView_pluginPR_activated));
- return toDescriptorArray(result);
-}
-public Object getPropertyValue(Object name) {
- if (name.equals(P_INSTALL_URL))
- return pd.getInstallURL();
- if (name.equals(P_NAME))
- return pd.getLabel();
- if (name.equals(P_ID))
- return pd.getUniqueIdentifier();
- if (name.equals(P_PROVIDER))
- return pd.getProviderName();
- if (name.equals(P_VERSION))
- return pd.getVersionIdentifier();
- if (name.equals(P_ACTIVATED))
- return pd.isPluginActivated() ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
- return null;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PrerequisitePropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PrerequisitePropertySource.java
deleted file mode 100644
index 10f603c..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/PrerequisitePropertySource.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPluginPrerequisite;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class PrerequisitePropertySource extends RegistryPropertySource {
- private IPluginPrerequisite prereq;
- public static final String P_ID = "id"; //$NON-NLS-1$
- public static final String P_VERSION = "version"; //$NON-NLS-1$
- public static final String P_EXPORTED = "exported"; //$NON-NLS-1$
- public static final String P_MATCH = "match"; //$NON-NLS-1$
- public static final String P_OPTIONAL = "optional"; //$NON-NLS-1$
- public PrerequisitePropertySource(IPluginPrerequisite prereq) {
- this.prereq = prereq;
- }
- public IPropertyDescriptor[] getPropertyDescriptors() {
- Vector result = new Vector();
-
- result.addElement(
- new PropertyDescriptor(
- P_EXPORTED,
- PDERuntimeMessages.RegistryView_prerequisitePR_exported));
- result.addElement(
- new PropertyDescriptor(
- P_ID,
- PDERuntimeMessages.RegistryView_prerequisitePR_id));
- result.addElement(
- new PropertyDescriptor(
- P_VERSION,
- PDERuntimeMessages.RegistryView_prerequisitePR_version));
- result.addElement(
- new PropertyDescriptor(
- P_MATCH,
- PDERuntimeMessages.RegistryView_prerequisitePR_match));
- result.addElement(
- new PropertyDescriptor(
- P_OPTIONAL,
- PDERuntimeMessages.RegistryView_prerequisitePR_optional));
- return toDescriptorArray(result);
-
- }
-
- public Object getPropertyValue(Object name) {
- if (name.equals(P_ID))
- return prereq.getUniqueIdentifier();
-
- if (name.equals(P_EXPORTED))
- return prereq.isExported() ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
-
- if (name.equals(P_VERSION)) {
- Object version = prereq.getVersionIdentifier();
- return version != null ? version.toString() : ""; //$NON-NLS-1$
- }
-
- if (name.equals(P_OPTIONAL))
- return prereq.isOptional() ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
-
- if (name.equals(P_MATCH)) {
- if (prereq.isMatchedAsCompatible())
- return PDERuntimeMessages.RegistryView_prerequisitePR_matchedCompatible;
- if (prereq.isMatchedAsEquivalent())
- return PDERuntimeMessages.RegistryView_prerequisitePR_matchedEquivalent;
- if (prereq.isMatchedAsExact())
- return PDERuntimeMessages.RegistryView_prerequisitePR_matchedExact;
- if (prereq.isMatchedAsGreaterOrEqual())
- return PDERuntimeMessages.RegistryView_prerequisitePR_matchedGreaterOrEqual;
- if (prereq.isMatchedAsPerfect())
- return PDERuntimeMessages.RegistryView_prerequisitePR_matchedPerfect;
- }
- return ""; //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
deleted file mode 100644
index 691b7d5..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionDelta;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IRegistryChangeEvent;
-import org.eclipse.core.runtime.IRegistryChangeListener;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.pde.internal.runtime.IHelpContextIds;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.part.DrillDownAdapter;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-public class RegistryBrowser extends ViewPart
- implements BundleListener, IRegistryChangeListener {
-
- public static final String SHOW_RUNNING_PLUGINS = "RegistryView.showRunning.label"; //$NON-NLS-1$
- public static final String REGISTRY_ORIENTATION = "RegistryView.orientation"; //$NON-NLS-1$
- public static final int VERTICAL_ORIENTATION = 1;
- public static final int HORIZONTAL_ORIENTATION = 2;
- public static final int SINGLE_PANE_ORIENTATION = 3;
-
- private TreeViewer treeViewer;
- private IMemento memento;
- private static int orientation;
- private int[] horizontalSashWeight;
- private int[] verticalSashWeight;
- private static final int[] DEFAULT_SASH_WEIGHTS = {13, 6};
-
- // menus and action items
- private Action refreshAction;
- private Action showPluginsAction;
- private Action collapseAllAction;
- private Action[] toggleViewAction;
- private DrillDownAdapter drillDownAdapter;
-
- //attributes view
- private SashForm fSashForm;
- private PropertySheetPage fPropertySheet;
-
- // single-pane control
- private Composite mainView;
-
- /*
- * customized DrillDownAdapter which modifies enabled state of showing active/inactive
- * plug-ins action - see Bug 58467
- */
- class RegistryDrillDownAdapter extends DrillDownAdapter{
- public RegistryDrillDownAdapter(TreeViewer tree){
- super(tree);
- }
-
- public void goInto() {
- super.goInto();
- showPluginsAction.setEnabled(!canGoHome());
- }
-
- public void goBack() {
- super.goBack();
- showPluginsAction.setEnabled(!canGoHome());
- }
-
- public void goHome() {
- super.goHome();
- showPluginsAction.setEnabled(!canGoHome());
- }
-
- public void goInto(Object newInput) {
- super.goInto(newInput);
- showPluginsAction.setEnabled(!canGoHome());
- }
- }
- public RegistryBrowser() {
- super();
- }
-
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- if (memento == null)
- this.memento = XMLMemento.createWriteRoot("REGISTRYVIEW"); //$NON-NLS-1$
- else
- this.memento = memento;
- initializeMemento();
- orientation = this.memento.getInteger(REGISTRY_ORIENTATION).intValue();
- }
-
- private void initializeMemento() {
- // show all plug-ins by default (i.e. not just activated ones)
- if (memento.getString(SHOW_RUNNING_PLUGINS) == null)
- memento.putString(SHOW_RUNNING_PLUGINS, "false"); //$NON-NLS-1$
- if (memento.getInteger(REGISTRY_ORIENTATION) == null)
- memento.putInteger(REGISTRY_ORIENTATION, HORIZONTAL_ORIENTATION);
- }
-
- public void dispose() {
- Platform.getExtensionRegistry().removeRegistryChangeListener(this);
- PDERuntimePlugin.getDefault().getBundleContext().removeBundleListener(
- this);
- super.dispose();
- }
-
- public void createPartControl(Composite parent) {
- // create the sash form that will contain the tree viewer & text viewer
- fSashForm = new SashForm(parent, SWT.HORIZONTAL);
- fSashForm.setLayout(new GridLayout());
- fSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
- setSashForm(fSashForm);
- makeActions();
- createTreeViewer();
- createAttributesViewer();
- fillToolBar();
- treeViewer.refresh();
- setViewOrientation(orientation);
- setContentDescription(((RegistryBrowserContentProvider)treeViewer.getContentProvider()).getTitleSummary());
-
- Platform.getExtensionRegistry().addRegistryChangeListener(this);
- PDERuntimePlugin.getDefault().getBundleContext().addBundleListener(this);
- }
- private void createTreeViewer() {
- mainView = new Composite(getSashForm(), SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = layout.marginWidth = 0;
- mainView.setLayout(layout);
- mainView.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Tree tree = new Tree(mainView, SWT.FLAT);
- GridData gd = new GridData(GridData.FILL_BOTH);
- tree.setLayoutData(gd);
- treeViewer = new TreeViewer(tree);
- boolean showRunning = memento.getString(SHOW_RUNNING_PLUGINS).equals("true") ? true : false; //$NON-NLS-1$
- treeViewer.setContentProvider(new RegistryBrowserContentProvider(treeViewer, showRunning));
- treeViewer
- .setLabelProvider(new RegistryBrowserLabelProvider(treeViewer));
- treeViewer.setUseHashlookup(true);
- treeViewer.setSorter(new ViewerSorter() {
- });
- treeViewer.setInput(new PluginObjectAdapter(Platform.getPluginRegistry()));
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object selection = ((IStructuredSelection) event.getSelection())
- .getFirstElement();
- updateAttributesView(selection);
- }
- });
- treeViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- Object selection = ((IStructuredSelection) event.getSelection())
- .getFirstElement();
- updateAttributesView(selection);
- if (selection != null && treeViewer.isExpandable(selection))
- treeViewer.setExpandedState(selection, !treeViewer
- .getExpandedState(selection));
- }
- });
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(treeViewer.getControl(),
- IHelpContextIds.REGISTRY_VIEW);
-
- getViewSite().setSelectionProvider(treeViewer);
-
- MenuManager popupMenuManager = new MenuManager();
- IMenuListener listener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager mng) {
- fillContextMenu(mng);
- }
- };
- popupMenuManager.setRemoveAllWhenShown(true);
- popupMenuManager.addMenuListener(listener);
- Menu menu = popupMenuManager.createContextMenu(tree);
- tree.setMenu(menu);
- }
- /*
- * add attributes viewer
- */
- protected void createAttributesViewer() {
- Composite composite = new Composite(getSashForm(), SWT.FLAT);
- GridLayout layout = new GridLayout();
- layout.marginWidth = layout.marginHeight = 0;
- layout.numColumns = 2;
- layout.makeColumnsEqualWidth = false;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createPropertySheet(composite);
- }
- /*
- * add property sheet
- */
- protected void createPropertySheet(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = layout.marginHeight = 0;
- composite.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- composite.setLayoutData(gd);
- fPropertySheet = new PropertySheetPage();
- fPropertySheet.createControl(composite);
- gd = new GridData(GridData.FILL_BOTH);
- fPropertySheet.getControl().setLayoutData(gd);
- fPropertySheet.makeContributions(new MenuManager(),
- new ToolBarManager(), null);
- }
- private void fillToolBar(){
- drillDownAdapter = new RegistryDrillDownAdapter(treeViewer);
- IActionBars bars = getViewSite().getActionBars();
- IToolBarManager mng = bars.getToolBarManager();
- drillDownAdapter.addNavigationActions(mng);
- mng.add(refreshAction);
- mng.add(new Separator());
- mng.add(collapseAllAction);
- IMenuManager mgr = bars.getMenuManager();
- mgr.add(toggleViewAction[0]);
- mgr.add(toggleViewAction[1]);
- mgr.add(toggleViewAction[2]);
- mgr.add(new Separator());
- mgr.add(showPluginsAction);
- }
- public void fillContextMenu(IMenuManager manager) {
- manager.add(refreshAction);
- manager.add(new Separator());
- drillDownAdapter.addNavigationActions(manager);
- manager.add(new Separator());
- manager.add(showPluginsAction);
- }
- public TreeViewer getTreeViewer() {
- return treeViewer;
- }
- protected SashForm getSashForm() {
- return fSashForm;
- }
- public void saveState(IMemento memento) {
- if (memento == null || this.memento == null || treeViewer == null)
- return;
- boolean showRunning = ((RegistryBrowserContentProvider) treeViewer
- .getContentProvider()).isShowRunning();
- if (showRunning)
- this.memento.putString(SHOW_RUNNING_PLUGINS, "true"); //$NON-NLS-1$
- else
- this.memento.putString(SHOW_RUNNING_PLUGINS, "false"); //$NON-NLS-1$
- this.memento.putInteger(REGISTRY_ORIENTATION, orientation);
- memento.putMemento(this.memento);
- }
-
- public void updateAttributesView(Object selection) {
- if (selection != null)
- fPropertySheet.selectionChanged(null, new StructuredSelection(
- selection));
- else
- fPropertySheet.selectionChanged(null, new StructuredSelection(
- new Object()));
- }
-
- private void setSashForm(SashForm sashForm) {
- fSashForm = sashForm;
- }
- public void setFocus() {
- treeViewer.getTree().setFocus();
- }
-
- /*
- * @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent)
- */
- public void bundleChanged(BundleEvent event) {
- if (treeViewer == null)
- return;
- Tree tree = treeViewer.getTree();
- if (tree.isDisposed())
- return;
-
- final RegistryBrowserContentProvider provider = ((RegistryBrowserContentProvider) treeViewer.getContentProvider());
- final IPluginDescriptor descriptor = Platform.getPluginRegistry().getPluginDescriptor(event.getBundle().getSymbolicName());
- if (descriptor == null)
- return;
- final PluginObjectAdapter adapter = new PluginObjectAdapter(descriptor);
- tree.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (treeViewer == null || treeViewer.getTree() == null || treeViewer.getTree().isDisposed())
- return;
- TreeItem[] items = treeViewer.getTree().getItems();
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- PluginObjectAdapter plugin = (PluginObjectAdapter) items[i].getData();
- if (plugin != null) {
- Object object = plugin.getObject();
- if (object instanceof IPluginDescriptor) {
- IPluginDescriptor desc = (IPluginDescriptor) object;
- if (desc.equals(descriptor)) {
- treeViewer.remove(plugin);
- break;
- }
- }
- }
- }
- }
- if (provider.isShowRunning() && !descriptor.isPluginActivated())
- return;
- treeViewer.add(treeViewer.getInput(), adapter);
- updateTitle();
- }
- });
- }
- /*
- * @see org.eclipse.core.runtime.IRegistryChangeListener#registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent)
- */
- public void registryChanged(IRegistryChangeEvent event) {
- final IExtensionDelta[] deltas = event.getExtensionDeltas();
- treeViewer.getTree().getDisplay().syncExec(new Runnable() {
- public void run() {
- for (int i = 0; i < deltas.length; i++) {
- IExtension ext = deltas[i].getExtension();
- IExtensionPoint extPoint = deltas[i].getExtensionPoint();
- IPluginDescriptor descriptor = extPoint.getDeclaringPluginDescriptor();
- PluginObjectAdapter adapter = new PluginObjectAdapter(
- descriptor);
- if (deltas[i].getKind() == IExtensionDelta.ADDED) {
- if (ext != null)
- treeViewer.add(adapter, ext);
- if (extPoint != null)
- treeViewer.add(adapter, extPoint);
- } else {
- if (ext != null)
- treeViewer.remove(ext);
- if (extPoint != null)
- treeViewer.remove(extPoint);
- treeViewer.refresh();
- }
- }
- updateTitle();
- }
- });
- }
- /*
- * toolbar and context menu actions
- */
- public void makeActions() {
- refreshAction = new Action("refresh") { //$NON-NLS-1$
- public void run() {
- BusyIndicator.showWhile(treeViewer.getTree().getDisplay(),
- new Runnable() {
- public void run() {
- treeViewer.refresh();
- }
- });
- }
- };
- refreshAction.setText(PDERuntimeMessages.RegistryView_refresh_label);
- refreshAction.setToolTipText(PDERuntimeMessages.RegistryView_refresh_tooltip);
- refreshAction.setImageDescriptor(PDERuntimePluginImages.DESC_REFRESH);
- refreshAction
- .setDisabledImageDescriptor(PDERuntimePluginImages.DESC_REFRESH_DISABLED);
-
- showPluginsAction = new Action(PDERuntimeMessages.RegistryView_showRunning_label){
- public void run(){
- ((RegistryBrowserContentProvider) treeViewer.getContentProvider())
- .setShowRunning(showPluginsAction.isChecked());
- treeViewer.refresh();
- updateTitle();
- }
- };
- showPluginsAction.setChecked(memento.getString(SHOW_RUNNING_PLUGINS).equals("true")); //$NON-NLS-1$
-
- collapseAllAction = new Action("collapseAll"){ //$NON-NLS-1$
- public void run(){
- treeViewer.collapseAll();
- }
- };
- collapseAllAction.setText(PDERuntimeMessages.RegistryView_collapseAll_label);
- collapseAllAction.setImageDescriptor(PDERuntimePluginImages.DESC_COLLAPSE_ALL);
- collapseAllAction.setToolTipText(PDERuntimeMessages.RegistryView_collapseAll_tooltip);
-
- toggleViewAction = new TogglePropertiesAction[3];
- toggleViewAction[0] = new TogglePropertiesAction(this, VERTICAL_ORIENTATION);
- toggleViewAction[1] = new TogglePropertiesAction(this, HORIZONTAL_ORIENTATION);
- toggleViewAction[2] = new TogglePropertiesAction(this, SINGLE_PANE_ORIENTATION);
- if (orientation == VERTICAL_ORIENTATION)
- toggleViewAction[0].setChecked(true);
- else if (orientation == HORIZONTAL_ORIENTATION)
- toggleViewAction[1].setChecked(true);
- else
- toggleViewAction[2].setChecked(true);
- }
-
- /*
- * orientation and properties display handler
- */
- protected void setLastSashWeights(int[] weights) {
- if (orientation == HORIZONTAL_ORIENTATION)
- horizontalSashWeight = weights;
- else if (orientation == VERTICAL_ORIENTATION)
- verticalSashWeight = weights;
- }
-
- public void setViewOrientation(int viewOrientation){
- setLastSashWeights(getSashForm().getWeights());
- if (viewOrientation == SINGLE_PANE_ORIENTATION){
- getSashForm().setMaximizedControl(mainView);
- } else {
- if (viewOrientation == VERTICAL_ORIENTATION)
- getSashForm().setOrientation(SWT.VERTICAL);
- else
- getSashForm().setOrientation(SWT.HORIZONTAL);
- getSashForm().setMaximizedControl(null);
- getSashForm().setWeights(getLastSashWeights(viewOrientation));
- }
- orientation = viewOrientation;
- }
- protected int[] getLastSashWeights(int viewOrientation) {
- if (viewOrientation == HORIZONTAL_ORIENTATION){
- if (horizontalSashWeight == null)
- horizontalSashWeight = DEFAULT_SASH_WEIGHTS;
- return horizontalSashWeight;
- }
- if (verticalSashWeight == null)
- verticalSashWeight = DEFAULT_SASH_WEIGHTS;
- return verticalSashWeight;
- }
-
- public void updateTitle(){
- if (treeViewer == null || treeViewer.getContentProvider() == null)
- return;
- setContentDescription(((RegistryBrowserContentProvider)treeViewer.getContentProvider()).getTitleSummary());
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
deleted file mode 100644
index 3e5ee58..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserContentProvider.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-public class RegistryBrowserContentProvider
- implements
- org.eclipse.jface.viewers.ITreeContentProvider {
- private Hashtable pluginMap = new Hashtable();
- private boolean showRunning;
- public boolean isInExtensionSet;
- private TreeViewer viewer;
- private int numPluginsTotal;
-
-
- class PluginFolder implements IPluginFolder {
- private int id;
- IPluginDescriptor pd;
- private Object[] children;
- public PluginFolder(IPluginDescriptor pd, int id) {
- this.pd = pd;
- this.id = id;
- }
- public IPluginDescriptor getPluginDescriptor() {
- return pd;
- }
- public Object[] getChildren() {
- if (children == null)
- children = getFolderChildren(pd, id);
- return children;
- }
- public int getFolderId() {
- return id;
- }
- public Object getAdapter(Class key) {
- return null;
- }
- }
-
- public RegistryBrowserContentProvider(TreeViewer viewer, boolean showRunning){
- super();
- this.viewer = viewer;
- this.showRunning = showRunning;
- this.numPluginsTotal = 0;
- }
- protected PluginObjectAdapter createAdapter(Object object, int id) {
- if (id == IPluginFolder.F_EXTENSIONS)
- return new ExtensionAdapter(object);
- if (id == IPluginFolder.F_EXTENSION_POINTS)
- return new ExtensionPointAdapter(object);
- return new PluginObjectAdapter(object);
- }
- protected Object[] createPluginFolders(IPluginDescriptor pd) {
- Object[] array = new Object[4];
- array[0] = new PluginFolder(pd, IPluginFolder.F_IMPORTS);
- array[1] = new PluginFolder(pd, IPluginFolder.F_LIBRARIES);
- array[2] = new PluginFolder(pd, IPluginFolder.F_EXTENSION_POINTS);
- array[3] = new PluginFolder(pd, IPluginFolder.F_EXTENSIONS);
- return array;
- }
- public void dispose() {
- }
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
- public Object[] getChildren(Object element) {
- if (element == null)
- return null;
-
- if (element instanceof ExtensionAdapter) {
- return ((ExtensionAdapter) element).getChildren();
- }
- isInExtensionSet = false;
- if (element instanceof ExtensionPointAdapter) {
- return ((ExtensionPointAdapter) element).getChildren();
-// return getNonDuplicateLabelChildren(element);
- }
- if (element instanceof ConfigurationElementAdapter) {
- return ((ConfigurationElementAdapter) element).getChildren();
- }
- if (element instanceof PluginObjectAdapter)
- element = ((PluginObjectAdapter) element).getObject();
- if (element.equals(Platform.getPluginRegistry())) {
- Object[] plugins = getPlugins(Platform.getPluginRegistry());
-
- if (plugins == null){
- numPluginsTotal = 0;
- return new Object[0];
- }
- numPluginsTotal = plugins.length;
-
- if (showRunning){
- ArrayList resultList = new ArrayList();
- for (int i = 0; i < plugins.length; i++) {
- if (plugins[i] instanceof PluginObjectAdapter) {
- Object object = ((PluginObjectAdapter) plugins[i])
- .getObject();
- if (object instanceof IPluginDescriptor && ((IPluginDescriptor) object).isPluginActivated())
- resultList.add(plugins[i]);
- }
- }
- return resultList.toArray(new Object[resultList.size()]);
- }
- return plugins;
- }
- if (element instanceof IPluginDescriptor) {
- IPluginDescriptor desc = (IPluginDescriptor) element;
- Object[] folders = (Object[]) pluginMap.get(desc
- .getUniqueIdentifier());
- if (folders == null) {
- folders = createPluginFolders(desc);
- pluginMap.put(desc.getUniqueIdentifier(), folders);
- } else {
- ArrayList folderList = new ArrayList();
- for (int i = 0; i<folders.length; i++){
- if (folders[i] != null && ((IPluginFolder)folders[i]).getChildren() != null)
- folderList.add(folders[i]);
- }
- folders = folderList.toArray(new Object[folderList.size()]);
- }
- return folders;
- }
- if (element instanceof IPluginFolder) {
- IPluginFolder folder = (IPluginFolder) element;
- isInExtensionSet = folder.getFolderId() == 1;
- return ((IPluginFolder) element).getChildren();
-// return getNonDuplicateLabelChildren(folder);
- }
- if (element instanceof IConfigurationElement) {
- return ((IConfigurationElement) element).getChildren();
- }
- return null;
- }
- public Object[] getNonDuplicateLabelChildren(Object element) {
- ArrayList extList = new ArrayList();
- ArrayList labelList = new ArrayList();
- if (element instanceof IPluginFolder){
- Object[] children = ((IPluginFolder)element).getChildren();
- if (children != null && isInExtensionSet){
- for (int i = 0; i<children.length; i++){
- IExtension ext = (IExtension)((ExtensionAdapter)children[i]).getObject();
- String label = ((RegistryBrowserLabelProvider)viewer.getLabelProvider()).getText(ext);
- if (label == null || label.length() ==0)
- continue;
- if (!labelList.contains(label)){
- labelList.add(label);
- extList.add(children[i]);
- }
- }
- return extList.toArray(new Object[extList.size()]);
- }
- return children;
- } else if (element instanceof ExtensionPointAdapter){
- Object[] children = ((ExtensionPointAdapter) element).getChildren();
- if (children!=null){
- for (int i =0; i<children.length; i++){
- String label = ((RegistryBrowserLabelProvider)viewer.getLabelProvider()).getText(children[i]);
- if (label == null || label.length() ==0)
- continue;
- if (!labelList.contains(label)){
- labelList.add(label);
- extList.add(children[i]);
- }
- }
- return extList.toArray(new Object[extList.size()]);
- }
- return children;
- }
- return new Object[0];
- }
- public Object[] getPlugins(IPluginRegistry registry) {
- IPluginDescriptor[] descriptors = registry.getPluginDescriptors();
- Object[] result = new Object[descriptors.length];
- for (int i = 0; i < descriptors.length; i++) {
- result[i] = new PluginObjectAdapter(descriptors[i]);
- }
- return result;
- }
- private Object[] getFolderChildren(IPluginDescriptor pd, int id) {
- Object[] array = null;
- switch (id) {
- case IPluginFolder.F_EXTENSIONS :
- array = pd.getExtensions();
- break;
- case IPluginFolder.F_EXTENSION_POINTS :
- array = pd.getExtensionPoints();
- break;
- case IPluginFolder.F_IMPORTS :
- array = pd.getPluginPrerequisites();
- break;
- case IPluginFolder.F_LIBRARIES :
- array = pd.getRuntimeLibraries();
- try {
- if (array == null || array.length == 0){
- Object classpath = Platform.getBundle(pd.getUniqueIdentifier()).getHeaders().get(Constants.BUNDLE_CLASSPATH);
- return classpath == null ? null : ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, classpath.toString());
- }
- } catch (BundleException e) {
- }
- break;
- }
- Object[] result = null;
- if (array != null && array.length > 0) {
- result = new Object[array.length];
- for (int i = 0; i < array.length; i++) {
- result[i] = createAdapter(array[i], id);
- }
- }
- return result;
- }
- public Object getParent(Object element) {
- return null;
- }
- public boolean hasChildren(Object element) {
- Object[] children = getChildren(element);
- return children != null && children.length > 0;
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- public void setShowRunning(boolean showRunning){
- this.showRunning = showRunning;
- }
- public boolean isShowRunning(){
- return showRunning;
- }
-
- public String getTitleSummary(){
- if (viewer == null || viewer.getTree() == null)
- return NLS.bind(PDERuntimeMessages.RegistryView_titleSummary, (new String[] {"0", "0"})); //$NON-NLS-1$ //$NON-NLS-2$
-
- return NLS.bind(PDERuntimeMessages.RegistryView_titleSummary, (new String[] {new Integer(viewer.getTree().getItemCount()).toString(), new Integer(numPluginsTotal).toString()}));
- }
-
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
deleted file mode 100644
index 0db0cc9..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILibrary;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginPrerequisite;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.pde.internal.runtime.OverlayIcon;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-import org.eclipse.swt.graphics.Image;
-
-public class RegistryBrowserLabelProvider extends LabelProvider {
- private Image pluginImage;
- private Image activePluginImage;
- private Image libraryImage;
- private Image runtimeImage;
- private Image genericTagImage;
- private Image extensionImage;
- private Image extensionsImage;
- private Image extensionPointImage;
- private Image extensionPointsImage;
- private Image requiresImage;
- private Image reqPluginImage;
- private TreeViewer viewer;
-
- public RegistryBrowserLabelProvider(TreeViewer viewer) {
- this.viewer = viewer;
- pluginImage = PDERuntimePluginImages.DESC_PLUGIN_OBJ.createImage();
- reqPluginImage = PDERuntimePluginImages.DESC_REQ_PLUGIN_OBJ.createImage();
- extensionPointImage = PDERuntimePluginImages.DESC_EXT_POINT_OBJ.createImage();
- extensionPointsImage = PDERuntimePluginImages.DESC_EXT_POINTS_OBJ.createImage();
- extensionImage = PDERuntimePluginImages.DESC_EXTENSION_OBJ.createImage();
- extensionsImage = PDERuntimePluginImages.DESC_EXTENSIONS_OBJ.createImage();
- requiresImage = PDERuntimePluginImages.DESC_REQ_PLUGINS_OBJ.createImage();
- libraryImage = PDERuntimePluginImages.DESC_JAVA_LIB_OBJ.createImage();
- genericTagImage = PDERuntimePluginImages.DESC_GENERIC_XML_OBJ.createImage();
- runtimeImage = PDERuntimePluginImages.DESC_RUNTIME_OBJ.createImage();
-
- ImageDescriptor activePluginDesc =
- new OverlayIcon(
- PDERuntimePluginImages.DESC_PLUGIN_OBJ,
- new ImageDescriptor[][] { { PDERuntimePluginImages.DESC_RUN_CO }
- });
- activePluginImage = activePluginDesc.createImage();
- }
- public void dispose() {
- pluginImage.dispose();
- activePluginImage.dispose();
- reqPluginImage.dispose();
- extensionPointImage.dispose();
- extensionPointsImage.dispose();
- extensionImage.dispose();
- extensionsImage.dispose();
- requiresImage.dispose();
- libraryImage.dispose();
- genericTagImage.dispose();
- runtimeImage.dispose();
- }
- public Image getImage(Object element) {
- if (element instanceof PluginObjectAdapter)
- element = ((PluginObjectAdapter) element).getObject();
- if (element instanceof IPluginDescriptor) {
- IPluginDescriptor pd = (IPluginDescriptor) element;
- boolean active = pd.isPluginActivated();
- return active ? activePluginImage : pluginImage;
- }
- if (element instanceof IPluginFolder) {
- int id = ((IPluginFolder) element).getFolderId();
- switch (id) {
- case IPluginFolder.F_EXTENSIONS :
- return extensionsImage;
- case IPluginFolder.F_EXTENSION_POINTS :
- return extensionPointsImage;
- case IPluginFolder.F_IMPORTS :
- return requiresImage;
- case IPluginFolder.F_LIBRARIES :
- return runtimeImage;
- }
- return null;
- }
- if (element instanceof IExtension) {
- return extensionImage;
- }
- if (element instanceof IExtensionPoint) {
- return extensionPointImage;
- }
- if (element instanceof IPluginPrerequisite) {
- return reqPluginImage;
- }
- if (element instanceof ILibrary || element instanceof ManifestElement) {
- return libraryImage;
- }
- if (element instanceof IConfigurationElement) {
- return genericTagImage;
- }
- return null;
- }
- public String getText(Object element) {
- if (element instanceof PluginObjectAdapter)
- element = ((PluginObjectAdapter) element).getObject();
- if (element instanceof IPluginDescriptor) {
- return ((IPluginDescriptor)element).getUniqueIdentifier();
- }
- if (element instanceof IPluginFolder) {
- switch (((IPluginFolder) element).getFolderId()) {
- case IPluginFolder.F_IMPORTS :
- return PDERuntimeMessages.RegistryView_folders_imports;
- case IPluginFolder.F_LIBRARIES :
- return PDERuntimeMessages.RegistryView_folders_libraries;
- case IPluginFolder.F_EXTENSION_POINTS :
- return PDERuntimeMessages.RegistryView_folders_extensionPoints;
- case IPluginFolder.F_EXTENSIONS :
- return PDERuntimeMessages.RegistryView_folders_extensions;
- }
- }
- if (element instanceof IExtension) {
- if (((RegistryBrowserContentProvider)viewer.getContentProvider()).isInExtensionSet)
- return ((IExtension) element).getExtensionPointUniqueIdentifier();
-
- IPluginDescriptor desc = ((IExtension) element).getDeclaringPluginDescriptor();
- return "contributed by: "+ desc.getUniqueIdentifier(); //$NON-NLS-1$
-
- }
- if (element instanceof IExtensionPoint) {
- String pluginId = ((IExtensionPoint)element).getDeclaringPluginDescriptor().getUniqueIdentifier();//getParentIdentifier();
- String extPointId = ((IExtensionPoint) element).getUniqueIdentifier();
- return extPointId.substring(pluginId.length()+1);
- }
- if (element instanceof IPluginPrerequisite) {
- return ((IPluginPrerequisite) element).getUniqueIdentifier();
- }
- if (element instanceof ILibrary) {
- return ((ILibrary) element).getPath().toString();
- }
- if (element instanceof ManifestElement) {
- return ((ManifestElement)element).getValue();
- }
- if (element instanceof IConfigurationElement) {
- String label = ((IConfigurationElement) element).getAttribute("label"); //$NON-NLS-1$
- if (label == null){
- label = ((IConfigurationElement) element).getAttribute("name"); //$NON-NLS-1$
- }
- if (label == null && ((IConfigurationElement) element).getAttribute("id") != null){ //$NON-NLS-1$
- String[] labelSplit = ((IConfigurationElement) element).getAttribute("id").split("\\."); //$NON-NLS-1$ //$NON-NLS-2$
- label = labelSplit.length == 0 ? null: labelSplit[labelSplit.length-1];
- }
- if (label == null){
- label = ((IConfigurationElement) element).getName();
- }
-
- return label;
- }
- return super.getText(element);
- }
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySource.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySource.java
deleted file mode 100644
index ffc5bda..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySource.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import java.util.Vector;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-public abstract class RegistryPropertySource implements IPropertySource {
-
-public Object getEditableValue() {
- return null;
-}
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return null;
-}
-public boolean isPropertySet(Object id) {
- return false;
-}
-public void resetPropertyValue(Object id) {}
-public void setPropertyValue(Object id, Object value) {}
-protected IPropertyDescriptor[] toDescriptorArray(Vector result) {
- IPropertyDescriptor [] array = new IPropertyDescriptor[result.size()];
- result.copyInto(array);
- return array;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySourceFactory.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySourceFactory.java
deleted file mode 100644
index a432894..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryPropertySourceFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILibrary;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginPrerequisite;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-public class RegistryPropertySourceFactory implements IAdapterFactory {
-
-public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.equals(IPropertySource.class)) return getPropertySource(adaptableObject);
- return null;
-}
-public java.lang.Class[] getAdapterList() {
- return new Class[] { IPropertySource.class };
-}
-protected IPropertySource getPropertySource(Object sourceObject) {
- if (sourceObject instanceof PluginObjectAdapter)
- sourceObject = ((PluginObjectAdapter) sourceObject).getObject();
- if (sourceObject instanceof IPluginDescriptor) {
- return new PluginPropertySource((IPluginDescriptor) sourceObject);
- }
- if (sourceObject instanceof IExtension) {
- return new ExtensionPropertySource((IExtension) sourceObject);
- }
- if (sourceObject instanceof IExtensionPoint) {
- return new ExtensionPointPropertySource((IExtensionPoint) sourceObject);
- }
- if (sourceObject instanceof ILibrary) {
- return new LibraryPropertySource((ILibrary) sourceObject);
- }
- if (sourceObject instanceof IConfigurationElement) {
- return new ConfigurationElementPropertySource((IConfigurationElement) sourceObject);
- }
- if (sourceObject instanceof IPluginPrerequisite) {
- return new PrerequisitePropertySource((IPluginPrerequisite) sourceObject);
- }
- return null;
-}
-}
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/TogglePropertiesAction.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/TogglePropertiesAction.java
deleted file mode 100644
index 06d0898..0000000
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/TogglePropertiesAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.runtime.registry;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePluginImages;
-
-
-/**
- * Action that controls the appearance of the details pane in debug views such
- * as the VariablesView and the ExpressionsView. Instances of this class can be
- * created to show the detail pane underneath the main tree, to the right of the
- * main tree, or not shown at all.
- *
- * @since 3.0
- */
-public class TogglePropertiesAction extends Action {
- private RegistryBrowser fViewer;
- private int fOrientation;
-
- public TogglePropertiesAction(RegistryBrowser view, int orientation) {
- super("", AS_RADIO_BUTTON); //$NON-NLS-1$
- setRegistryBrowser(view);
- setOrientation(orientation);
-
- if (orientation == RegistryBrowser.VERTICAL_ORIENTATION) {
- setText(PDERuntimeMessages.RegistryView_verticalOrientation_label);
- setToolTipText(PDERuntimeMessages.RegistryView_verticalOrientation_tooltip);
- setDescription(PDERuntimeMessages.RegistryView_verticalOrientation_desc);
- setImageDescriptor(PDERuntimePluginImages.DESC_VERTICAL_VIEW);
- setDisabledImageDescriptor(PDERuntimePluginImages.DESC_VERTICAL_VIEW_DISABLED);
- } else if (orientation == RegistryBrowser.HORIZONTAL_ORIENTATION) {
- setText(PDERuntimeMessages.RegistryView_horizontalOrientation_label);
- setToolTipText(PDERuntimeMessages.RegistryView_horizontalOrientation_tooltip);
- setDescription(PDERuntimeMessages.RegistryView_horizontalOrientation_desc);
- setImageDescriptor(PDERuntimePluginImages.DESC_HORIZONTAL_VIEW);
- setDisabledImageDescriptor(PDERuntimePluginImages.DESC_HORIZONTAL_VIEW_DISABLED);
- } else {
- setText(PDERuntimeMessages.RegistryView_showPropertiesSheet_label);
- setToolTipText(PDERuntimeMessages.RegistryView_showPropertiesSheet_tooltip);
- setDescription(PDERuntimeMessages.RegistryView_showPropertiesSheet_desc);
- setImageDescriptor(PDERuntimePluginImages.DESC_HIDE_PANE);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() { // called when menu pressed
- getRegistryBrowser().setViewOrientation(getOrientation());
- }
-
- private RegistryBrowser getRegistryBrowser() {
- return fViewer;
- }
-
- private void setRegistryBrowser(RegistryBrowser view) {
- fViewer = view;
- }
-
- private void setOrientation(int orientation) {
- fOrientation = orientation;
- }
-
- public int getOrientation() {
- return fOrientation;
- }
-}
-
diff --git a/ui/org.eclipse.pde.ui.tests/.classpath b/ui/org.eclipse.pde.ui.tests/.classpath
deleted file mode 100644
index d6f0551..0000000
--- a/ui/org.eclipse.pde.ui.tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="Macro Manager"/>
- <classpathentry kind="src" path="Macro UI"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ui/org.eclipse.pde.ui.tests/.cvsignore b/ui/org.eclipse.pde.ui.tests/.cvsignore
deleted file mode 100644
index 64a560c..0000000
--- a/ui/org.eclipse.pde.ui.tests/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-build.xml
-tests.jar
-tests.jar.bin.log
-org.eclipse.pde.ui.tests_*
-temp.folder
diff --git a/ui/org.eclipse.pde.ui.tests/.project b/ui/org.eclipse.pde.ui.tests/.project
deleted file mode 100644
index 2d576be..0000000
--- a/ui/org.eclipse.pde.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.pde.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.jdt.core.prefs b/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3f7af20..0000000
--- a/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,39 +0,0 @@
-#Tue Sep 20 17:53:35 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.pde.prefs b/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 763a42a..0000000
--- a/ui/org.eclipse.pde.ui.tests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Nov 13 13:02:55 EST 2005
-compilers.p.deprecated=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 1bc4b78..0000000
--- a/ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: PDE JUnit Tests
-Bundle-SymbolicName: org.eclipse.pde.ui.tests; singleton:=true
-Bundle-Version: 3.1.0
-Bundle-ClassPath: tests.jar
-Bundle-Activator: org.eclipse.pde.internal.ui.tests.macro.MacroPlugin
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Require-Bundle: org.junit,
- org.eclipse.pde.ui,
- org.eclipse.ui,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jdt.core,
- org.eclipse.test.performance,
- org.eclipse.ui.ide,
- org.eclipse.pde,
- org.eclipse.team.core,
- org.eclipse.jdt.ui,
- org.eclipse.jdt.launching
-Eclipse-LazyStart: true
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/AbstractStructuredCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/AbstractStructuredCommand.java
deleted file mode 100644
index 333fa4f..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/AbstractStructuredCommand.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.widgets.*;
-import org.w3c.dom.*;
-
-public abstract class AbstractStructuredCommand extends MacroCommand {
- protected ArrayList items;
-
- public AbstractStructuredCommand(WidgetIdentifier wid) {
- super(wid);
- items = new ArrayList();
- }
-
- public boolean mergeEvent(Event e) {
- items.clear();
- processEvent(e);
- return true;
- }
-
- protected Widget [] getItemsForEvent(Event e) {
- Widget item = null;
- if (e.item!=null)
- item = (Widget)e.item;
- else if (e.widget instanceof Item)
- item = e.widget;
- if (item!=null)
- return new Widget[] {item};
- return null;
- }
-
- public void processEvent(Event event) {
- Widget [] eventItems=getItemsForEvent(event);
-
- if (eventItems!=null) {
- for (int i=0; i<eventItems.length; i++) {
- String id = getItemId(eventItems[i]);
- if (id!=null)
- items.add(id);
- }
- }
- }
-
- protected String getItemId(Widget item) {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- String id = recorder.resolveWidget(item);
- if (id!=null)
- return id;
- Object data = item.getData();
- if (data!=null)
- return data.getClass().getName();
- return null;
- }
-
- protected void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
- NodeList children = node.getChildNodes();
- for (int i=0; i<children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE &&
- child.getNodeName().equals("item")) {
- String path = MacroUtil.getAttribute(child, "path");
- if (path!=null)
- items.add(path);
- }
- }
- }
-
- protected void writeAdditionalAttributes(PrintWriter writer) {
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.print("\"");
- writeAdditionalAttributes(writer);
- writer.println(">");
- String cindent = indent + " ";
- for (int i=0; i<items.size(); i++) {
- writer.print(cindent);
- writer.print("<item path=\"");
- writer.print((String)items.get(i));
- writer.println("\"/>");
- }
- writer.println(indent+"</command>");
- }
-
- protected abstract void playTreeCommand(Tree tree, TreeItem[] matches);
- protected abstract void playTableCommand(Table table, TableItem[] matches);
- protected abstract void playTableTreeCommand(TableTree tableTree, TableTreeItem[] matches);
-
- public final boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- CommandTarget target = MacroUtil.locateCommandTarget(parent, getWidgetId(), getStartLine());
-
- if (target==null) return false;
- target.setFocus();
- MacroUtil.processDisplayEvents(display);
-
- Widget widget = target.getWidget();
-
- if (widget==null || widget.isDisposed())
- return false;
-
- if (widget instanceof Tree) {
- TreeItem[] matches = findMatches((Tree)widget);
- playTreeCommand((Tree)widget, matches);
- }
- else if (widget instanceof Table) {
- TableItem [] matches = findMatches((Table)widget);
- playTableCommand((Table)widget, matches);
- }
- else if (widget instanceof TableTree) {
- TableTreeItem [] matches = findMatches((TableTree)widget);
- playTableTreeCommand((TableTree)widget, matches);
- }
- return true;
- }
-
- private TreeItem[] findMatches(Tree tree) {
- TreeItem [] children = tree.getItems();
- ArrayList matches = new ArrayList();
- for (int i=0; i<items.size(); i++) {
- String itemId = (String)items.get(i);
- TreeItem item = findTreeItem(children, itemId);
- if (item!=null)
- matches.add(item);
- }
- return (TreeItem[])matches.toArray(new TreeItem[matches.size()]);
- }
- private TableItem[] findMatches(Table table) {
- TableItem [] elements = table.getItems();
- ArrayList matches = new ArrayList();
-
- for (int i=0; i<items.size(); i++) {
- String itemId = (String)items.get(i);
- TableItem item = findTableItem(elements, itemId);
- if (item!=null)
- matches.add(item);
- }
- return (TableItem[])matches.toArray(new TableItem[matches.size()]);
- }
-
- private TableTreeItem [] findMatches(TableTree tableTree) {
- TableTreeItem [] children = tableTree.getItems();
- ArrayList matches = new ArrayList();
-
- for (int i=0; i<items.size(); i++) {
- String itemId = (String)items.get(i);
- TableTreeItem item = findTableTreeItem(children, itemId);
- if (item!=null)
- matches.add(item);
- }
- return (TableTreeItem[])matches.toArray(new TableTreeItem[matches.size()]);
- }
-
- private TreeItem findTreeItem(TreeItem [] children, String itemId) {
- for (int i=0; i<children.length; i++) {
- TreeItem item = children[i];
- String id = getItemId(item);
- //Test the item itself
- if (id!=null && id.equals(itemId))
- return item;
- int ccount = item.getItemCount();
- if (ccount>0) {
- //Test the item's children
- TreeItem citem = findTreeItem(item.getItems(), itemId);
- if (citem!=null)
- return citem;
- }
- }
- return null;
- }
-
- private TableItem findTableItem(TableItem [] children, String itemId) {
- for (int i=0; i<children.length; i++) {
- TableItem item = children[i];
- String id = getItemId(item);
-
- if (id!=null && id.equals(itemId))
- return item;
- }
- return null;
- }
-
- private TableTreeItem findTableTreeItem(TableTreeItem [] children, String itemId) {
- for (int i=0; i<children.length; i++) {
- TableTreeItem item = children[i];
- String id = getItemId(item);
- //Test the item itself
- if (id!=null && id.equals(itemId))
- return item;
- int ccount = item.getItemCount();
- if (ccount>0) {
- //Test the item's children
- TableTreeItem citem = findTableTreeItem(item.getItems(), itemId);
- if (citem!=null)
- return citem;
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/BooleanSelectionCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/BooleanSelectionCommand.java
deleted file mode 100644
index 57ff4dd..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/BooleanSelectionCommand.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.w3c.dom.*;
-
-public class BooleanSelectionCommand extends MacroCommand {
- public static final String TYPE="select";
- private Boolean selection;
- private ArrayList path;
-
- public BooleanSelectionCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public String getType() {
- return TYPE;
- }
-
- public void processEvent(Event e) {
- selection = getSelection(e.widget);
- if (e.widget instanceof MenuItem) {
- //System.out.println("Item="+e.widget+" data = "+e.widget.getData());
- path = getPath((MenuItem)e.widget);
- }
- }
-
- private Boolean getSelection(Widget widget) {
- if ((widget.getStyle() & (SWT.CHECK | SWT.RADIO)) == 0)
- return null;
- if (widget instanceof Button)
- return new Boolean(((Button)widget).getSelection());
- if (widget instanceof ToolItem)
- return new Boolean(((ToolItem)widget).getSelection());
- if (widget instanceof MenuItem)
- return new Boolean(((MenuItem)widget).getSelection());
- return null;
- }
-
- private ArrayList getPath(MenuItem item) {
- ArrayList segments = new ArrayList();
- Object data = item.getData();
-
- if (data instanceof ContributionItem) {
- ContributionItem aitem = (ContributionItem)data;
- MenuManager manager = (MenuManager)aitem.getParent();
- while (manager!=null) {
- String id = manager.getId();
- if (id==null)
- break;
- segments.add(0, id);
- manager = (MenuManager)manager.getParent();
- }
- }
- return segments.size()>0?segments:null;
- }
-
- protected void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
- String sel = MacroUtil.getAttribute(node, "selection");
- if (sel!=null) {
- selection = sel.equals("true")?Boolean.TRUE:Boolean.FALSE;
- }
- NodeList children = node.getChildNodes();
- for (int i=0; i<children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE &&
- child.getNodeName().equals("parent")) {
- if (path==null)
- path = new ArrayList();
- path.add(MacroUtil.getAttribute(child, "widgetId"));
- }
- }
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.print("\"");
- if (selection!=null) {
- writer.print(" selection=\"");
- writer.print(selection.equals(Boolean.TRUE)?"true":"false");
- writer.print("\"");
- }
- if (path!=null) {
- writer.println(">");
- String pindent = indent + " ";
- for (int i=0; i<path.size(); i++) {
- writer.print(pindent);
- writer.print("<parent widgetId=\"");
- writer.print((String)path.get(i));
- writer.println("\"/>");
- }
- writer.print(indent);
- writer.println("</command>");
- }
- else
- writer.println("/>");
- }
-
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- CommandTarget target = MacroUtil.locateCommandTarget(parent, getWidgetId(), path, getStartLine());
- if (target==null) return false;
- target.setFocus();
- Widget widget = target.getWidget();
-
- if ((widget.getStyle() & (SWT.CHECK | SWT.RADIO)) == 0) {
- doClick(widget);
- }
- else if (selection!=null)
- doSelect(widget);
- return true;
- }
- private void doClick(Widget widget) throws CoreException {
- Event e = new Event();
- e.type = SWT.Selection;
- e.widget = widget;
- widget.notifyListeners(e.type, e);
- }
-
- protected Event createMouseEvent(Widget widget, int type) {
- Event e = new Event();
- e.type = type;
- e.button = 1;
- e.widget = widget;
- return e;
- }
-
- private void doSelect(Widget widget) throws CoreException {
- if (widget instanceof Button)
- ((Button)widget).setSelection(selection.booleanValue());
- else if (widget instanceof ToolItem)
- ((ToolItem)widget).setSelection(selection.booleanValue());
- else if (widget instanceof MenuItem)
- ((MenuItem)widget).setSelection(selection.booleanValue());
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CheckCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CheckCommand.java
deleted file mode 100644
index 0f40ff5..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CheckCommand.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.widgets.*;
-
-public class CheckCommand extends ToggleStructuredCommand {
- public static final String TYPE = "item-check";
- /**
- * @param wid
- */
- public CheckCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public String getType() {
- return TYPE;
- }
-
- public void processEvent(Event event) {
- super.processEvent(event);
- Widget item = event.item;
- if (item instanceof TreeItem)
- value = ((TreeItem)item).getChecked();
- else if (item instanceof TableItem)
- value = ((TableItem)item).getChecked();
- else if (item instanceof TableTreeItem)
- value = ((TableTreeItem)item).getChecked();
- }
-
- protected void playTreeCommand(Tree tree, TreeItem[] matches) {
- for (int i=0; i<matches.length; i++) {
- matches[i].setChecked(getValue());
- }
- }
-
- protected void playTableCommand(Table table, TableItem[] matches) {
- for (int i=0; i<matches.length; i++) {
- matches[i].setChecked(getValue());
- }
- }
-
- protected void playTableTreeCommand(TableTree tableTree, TableTreeItem [] matches) {
- for (int i=0; i<matches.length; i++) {
- matches[i].setChecked(getValue());
- }
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ChoiceSelectionCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ChoiceSelectionCommand.java
deleted file mode 100644
index 3f8035c..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ChoiceSelectionCommand.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.*;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.widgets.*;
-import org.w3c.dom.*;
-
-public class ChoiceSelectionCommand extends MacroCommand {
- public static final String TYPE = "choice-select";
-
- private String choiceId;
-
- public ChoiceSelectionCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public String getType() {
- return TYPE;
- }
-
- public void processEvent(Event e) {
- choiceId = computeChoiceId(e.widget, e.item);
- }
-
- private String computeChoiceId(Widget widget, Widget item) {
- int index = -1;
-
- if (widget instanceof Combo) {
- Combo combo = (Combo) widget;
- index = combo.getSelectionIndex();
- } else if (widget instanceof CCombo) {
- CCombo combo = (CCombo) widget;
- index = combo.getSelectionIndex();
- } else {
- String id = MacroPlugin.getDefault().getMacroManager()
- .resolveWidget(item);
- if (id != null)
- return id;
- if (widget instanceof TabFolder) {
- TabFolder tabFolder = (TabFolder) widget;
- TabItem tabItem = (TabItem) item;
- index = tabFolder.indexOf(tabItem);
- } else if (widget instanceof CTabFolder) {
- CTabFolder tabFolder = (CTabFolder) widget;
- CTabItem tabItem = (CTabItem) item;
- index = tabFolder.indexOf(tabItem);
- }
- }
- if (index != -1)
- return getPositionId(index);
- else
- return null;
- }
-
- private String getPositionId(int index) {
- return "item#" + index;
- }
-
- protected void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
- choiceId = MacroUtil.getAttribute(node, "choiceId");
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.print("\"");
- if (choiceId != null) {
- writer.print(" choiceId=\"");
- writer.print(choiceId);
- writer.print("\"");
- }
- writer.println("/>");
- }
-
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor)
- throws CoreException {
- CommandTarget target = MacroUtil.locateCommandTarget(parent,
- getWidgetId(), getStartLine());
- if (target == null)
- return false;
- target.setFocus();
- Widget widget = target.getWidget();
- if (widget instanceof TabFolder)
- doSelect((TabFolder) widget);
- else if (widget instanceof CTabFolder)
- doSelect((CTabFolder) widget);
- else if (widget instanceof Combo)
- doSelect((Combo) widget);
- else if (widget instanceof CCombo)
- doSelect((CCombo) widget);
- return true;
- }
-
- private void doSelect(TabFolder tabFolder) {
- TabItem[] items = tabFolder.getItems();
- for (int i = 0; i < items.length; i++) {
- TabItem item = items[i];
- String id = computeChoiceId(tabFolder, item);
- if (id != null && id.equals(choiceId)) {
- tabFolder.setSelection(i);
- break;
- }
- }
- }
-
- private void doSelect(CTabFolder tabFolder) {
- CTabItem[] items = tabFolder.getItems();
- for (int i = 0; i < items.length; i++) {
- CTabItem item = items[i];
- String id = computeChoiceId(tabFolder, item);
- if (id != null && id.equals(choiceId)) {
- tabFolder.setSelection(i);
- break;
- }
- }
- }
-
- private void doSelect(Combo combo) {
- int index = getIndexFromChoice();
- if (index != -1)
- combo.select(index);
- }
-
- private void doSelect(CCombo combo) {
- int index = getIndexFromChoice();
- if (index != -1)
- combo.select(index);
- }
-
- private int getIndexFromChoice() {
- int loc = choiceId.indexOf('#');
- if (loc == -1)
- return -1;
- try {
- return new Integer(choiceId.substring(loc + 1)).intValue();
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CommandTarget.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CommandTarget.java
deleted file mode 100644
index ded5b78..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/CommandTarget.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Widget;
-
-public class CommandTarget {
- private Widget widget;
- private Object context;
-
- public CommandTarget(Widget widget, Object context) {
- this.widget = widget;
- this.context = context;
- }
-
- public void ensureVisible() {
- }
-
- public Widget getWidget() {
- return widget;
- }
- public Object getContext() {
- return context;
- }
- public void setFocus() {
- ensureVisible();
- Display display = widget.getDisplay();
- if (widget instanceof Control) {
- Control c = (Control)widget;
- if (!c.equals(display.getFocusControl()))
- c.setFocus();
- }
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/EditorCommandTarget.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/EditorCommandTarget.java
deleted file mode 100644
index 4197a13..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/EditorCommandTarget.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.*;
-import org.eclipse.ui.IEditorPart;
-
-public class EditorCommandTarget extends CommandTarget {
- /**
- * @param widget
- * @param context
- */
- public EditorCommandTarget(Widget widget, IEditorPart editor) {
- super(widget, editor);
- }
-
- public IEditorPart getEditor() {
- return (IEditorPart)getContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.CommandTarget#ensureVisible()
- */
- public void ensureVisible() {
- IEditorPart editor = getEditor();
- IWorkbenchPage page = editor.getEditorSite().getPage();
- page.activate(editor);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ExpansionCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ExpansionCommand.java
deleted file mode 100644
index e3e7f7e..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ExpansionCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.widgets.*;
-
-public class ExpansionCommand extends ToggleStructuredCommand {
- public static final String TYPE = "item-expand";
- /**
- * @param wid
- */
- public ExpansionCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public void processEvent(Event event) {
- super.processEvent(event);
- Widget item = event.item;
-
- if (item instanceof TreeItem)
- value = !((TreeItem)item).getExpanded();
- else if (item instanceof TableTreeItem)
- value = !((TableTreeItem)item).getExpanded();
- }
-
- protected void playTreeCommand(Tree tree, TreeItem[] matches) {
- for (int i=0; i<matches.length; i++) {
- matches[i].setExpanded(getValue());
- fireEvent(tree, matches[i]);
- }
- }
-
- private void fireEvent(Widget widget, Widget item) {
- Event event = new Event();
- event.type = getValue()?SWT.Expand:SWT.Collapse;
- event.widget = widget;
- event.item= item;
- widget.notifyListeners(event.type, event);
- }
-
- protected void playTableCommand(Table table, TableItem[] matches) {
- }
-
- protected void playTableTreeCommand(TableTree tableTree, TableTreeItem [] matches) {
- for (int i=0; i<matches.length; i++) {
- matches[i].setExpanded(getValue());
- fireEvent(tableTree, matches[i]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.SelectionCommand#getKind()
- */
- public String getType() {
- return TYPE;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/FocusCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/FocusCommand.java
deleted file mode 100644
index 6b17c5f..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/FocusCommand.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.widgets.*;
-
-public class FocusCommand extends MacroCommand {
- public static final String TYPE = "focus";
-
- public FocusCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public boolean mergeEvent(Event e) {
- // we can directly merge repeated focus requests
- // on the same widget
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.MacroCommand#getType()
- */
- public String getType() {
- return TYPE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.MacroCommand#processEvent(org.eclipse.swt.widgets.Event)
- */
- public void processEvent(Event e) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.print("\"");
- writer.println("/>");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.IPlayable#playback(org.eclipse.swt.widgets.Composite)
- */
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- if (parent.isDisposed()) return false;
- CommandTarget target = MacroUtil.locateCommandTarget(parent, getWidgetId(), getStartLine());
- if (target!=null)
- target.setFocus();
- return true;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IIndexHandler.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IIndexHandler.java
deleted file mode 100644
index 560b092..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IIndexHandler.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Classes that implement this interface are registered with
- * the macro manager to handle cases where the user interrupted
- * the recording process to insert a named index. Upon playback,
- * index handler will be called to handle the named index
- * when reached in the script.
- *
- * @since 3.1
- */
-
-public interface IIndexHandler {
-/**
- * Evaluates the state of the platform at the provided script
- * index. Error status returned from the method will cause
- * the script manager to stop the script execution and
- * throw a <code>CoreException</code>.
- *
- * @param shell the active shell when the index was reached
- * @param indexId the unique identifier of the index
- * inserted in the script
- * @return <code>Status.OK_STATUS</code> if the script can proceed, or
- * an error status otherwise.
- */
- IStatus processIndex(Shell shell, String indexId);
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IPlayable.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IPlayable.java
deleted file mode 100644
index a69dbae..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IPlayable.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-
-public interface IPlayable {
- boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException;
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IRecorderListener.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IRecorderListener.java
deleted file mode 100644
index c6e8ea5..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IRecorderListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-public interface IRecorderListener {
- int STOP = 1;
- int INDEX = 2;
- void recordingStarted();
- void recordingStopped();
-/**
- * Called when the user pressed Ctrl+Shift+F10 (index)
- * or Ctrl+Shift+F11 (stop) to interrupt
- * the recording process. Clients may use this event
- * to insert named indexes, stop the recording etc.
- * @param type <code>STOP</code> or <code>INDEX</code>
- */
- void recordingInterrupted(int type);
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWidgetResolver.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWidgetResolver.java
deleted file mode 100644
index 7296d9b..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWidgetResolver.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * This interface is registered using extension point
- * <code>org.eclipse.ui.macro</code> return unique identifier
- * from a provided widget. The identifier must be reproducable
- * between sessions so that it can be used to locate the
- * widget on playback.
- *
- * @since 3.1
- */
-public interface IWidgetResolver {
-/**
- * Returns a unique identifier for the provided widget.
- * @param widget the widget to identify
- * @return unique identifier that can be used to locate the
- * widget or <code>null</code> if none can be found.
- */
- String getUniqueId(Widget widget);
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWritable.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWritable.java
deleted file mode 100644
index 6615269..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/IWritable.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-
-public interface IWritable {
- void write(String indent, PrintWriter writer);
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/KeyCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/KeyCommand.java
deleted file mode 100644
index b09a493..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/KeyCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.*;
-import org.eclipse.ui.commands.IWorkbenchCommandSupport;
-
-public class KeyCommand extends MacroCommand {
- public static final String TYPE="key-binding";
- private String commandId;
-
- /**
- * @param widgetId
- */
- public KeyCommand(WidgetIdentifier widgetId, String commandId) {
- super(widgetId);
- this.commandId = commandId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.internal.macro.MacroCommand#getType()
- */
- public String getType() {
- return TYPE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.internal.macro.MacroCommand#processEvent(org.eclipse.swt.widgets.Event)
- */
- public void processEvent(Event e) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.internal.macro.IWritable#write(java.lang.String, java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.print("\" commandId=\"");
- writer.print(commandId);
- writer.println("\"/>");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.internal.macro.IPlayable#playback(org.eclipse.swt.widgets.Display, org.eclipse.swt.widgets.Composite, org.eclipse.core.runtime.IProgressMonitor)
- */
- public boolean playback(Display display, Composite parent,
- IProgressMonitor monitor) throws CoreException {
- CommandTarget target = MacroUtil.locateCommandTarget(parent, getWidgetId(), getStartLine());
- if (target==null) return false;
- IWorkbenchCommandSupport csupport = PlatformUI.getWorkbench().getCommandSupport();
- ICommand command = csupport.getCommandManager().getCommand(commandId);
- if (command!=null) {
- try {
- command.execute(null);
- return true;
- }
- catch (ExecutionException e) {
- MacroPlugin.logException(e);
- }
- catch (NotHandledException e) {
- MacroPlugin.logException(e);
- }
- }
- return false;
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/Macro.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/Macro.java
deleted file mode 100644
index 8479183..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/Macro.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Stack;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.w3c.dom.Node;
-
-public class Macro implements IWritable, IPlayable {
- private static final String SYNTAX_VERSION="0.1";
- private transient IIndexHandler indexHandler;
- ArrayList shells;
- private String name;
- private Stack shellStack;
-
- public Macro() {
- shells = new ArrayList();
- }
-
- public Macro(String name) {
- this();
- this.name = name;
- }
-
- void addShell(Node node, Hashtable lineTable) {
- String sid = MacroUtil.getAttribute(node, "id");
- MacroCommandShell shell = new MacroCommandShell(null, sid);
- shell.load(node, lineTable);
- shells.add(shell);
- }
-
- public void initializeForRecording(Display display) {
- shellStack = new Stack();
- shells.clear();
- Shell currentShell = display.getActiveShell();
- MacroCommandShell commandShell = createCommandShell(currentShell);
- shellStack.push(commandShell);
- shells.add(commandShell);
- }
-
- private MacroCommandShell createCommandShell(Shell shell) {
- WidgetIdentifier wi = MacroUtil.getWidgetIdentifier(shell);
- if (wi==null) return null;
- return new MacroCommandShell(shell, wi.getWidgetId());
- }
-
- private boolean isCurrent(Shell shell) {
- if (shellStack.isEmpty()) return false;
- MacroCommandShell cshell = (MacroCommandShell)shellStack.peek();
- return cshell.tracks(shell);
- }
-
- public void stopRecording() {
- reset();
- }
-
- public boolean addEvent(Event event) throws Exception {
- if (isIgnorableEvent(event))
- return false;
- try {
- if (event.widget instanceof Shell) {
- switch (event.type) {
- case SWT.Activate:
- activateShell((Shell)event.widget);
- break;
- case SWT.Close:
- boolean stop = closeShell((Shell)event.widget);
- if (stop)
- return true;
- break;
- }
- }
- else if (getTopShell()!=null) {
- getTopShell().addEvent(event);
- }
- }
- catch (Exception e) {
- throw e;
- }
- return false;
- }
-
- private boolean isIgnorableEvent(Event e) {
- Shell shell = e.display.getActiveShell();
- if (shell!=null) {
- Boolean ivalue = (Boolean)shell.getData(MacroManager.IGNORE);
- if (ivalue!=null && ivalue.equals(Boolean.TRUE))
- return true;
- }
- return false;
- }
-
- public void addPause() {
- getTopShell().addPause();
- }
-
- public void addIndex(String id) {
- getTopShell().addIndex(id);
- }
- public MacroCommandShell getTopShell() {
- if (shellStack.isEmpty())
- return null;
- return (MacroCommandShell)shellStack.peek();
- }
- private void activateShell(Shell shell) {
- Object data = shell.getData();
- if (data instanceof Dialog) {
- if (!isCurrent(shell)) {
- MacroCommandShell commandShell = createCommandShell(shell);
- getTopShell().addCommandShell(commandShell);
- shellStack.push(commandShell);
- }
- }
- else if (data instanceof Window) {
- updateStack();
- if (!isCurrent(shell)) {
- // pop the current
- popStack();
- MacroCommandShell commandShell = createCommandShell(shell);
- shellStack.push(commandShell);
- shells.add(commandShell);
- }
- }
- }
-
- private void popStack() {
- if (shellStack.isEmpty()) return;
- MacroCommandShell top = (MacroCommandShell)shellStack.pop();
- top.extractExpectedReturnCode();
- }
-
- private boolean closeShell(Shell shell) {
- if (shellStack.isEmpty()) return false;
- MacroCommandShell top = (MacroCommandShell)shellStack.peek();
- if (top.tracks(shell))
- popStack();
- return shellStack.isEmpty();
- }
-
- private void updateStack() {
- while (shellStack.size()>0) {
- MacroCommandShell top = getTopShell();
- if (top.isDisposed())
- popStack();
- else
- break;
- }
- }
-
- private void closeSecondaryShells() {
- }
-
- public String [] getExistingIndices() {
- ArrayList list = new ArrayList();
- for (int i=0; i<shells.size(); i++) {
- MacroCommandShell shell = (MacroCommandShell)shells.get(i);
- shell.addExistingIndices(list);
- }
- return (String[])list.toArray(new String[list.size()]);
- }
-
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- reset();
- String mname = name!=null?name:"macro";
- monitor.beginTask("Executing "+mname+" ...", shells.size());
- for (int i=0; i<shells.size(); i++) {
- MacroCommandShell shell = (MacroCommandShell)shells.get(i);
- shell.setIndexHandler(getIndexHandler());
- final Shell [] sh = new Shell[1];
- display.syncExec(new Runnable() {
- public void run() {
- sh[0] = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- }
- });
- try {
- boolean result = shell.playback(display, sh[0], new SubProgressMonitor(monitor, 1));
- if (!result)
- return false;
- }
- catch (CoreException e) {
- closeSecondaryShells();
- throw e;
- }
- }
- return true;
- }
- private void reset() {
- shellStack = null;
- }
- public void write(String indent, PrintWriter writer) {
- writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- writer.print("<macro version=\"");
- writer.print(SYNTAX_VERSION);
- writer.println("\">");
- String cindent = " ";
- for (int i=0; i<shells.size(); i++) {
- MacroCommandShell cshell = (MacroCommandShell)shells.get(i);
- cshell.write(cindent, writer);
- }
- writer.println("</macro>");
- }
-
- public IIndexHandler getIndexHandler() {
- return indexHandler;
- }
-
-
- public void setIndexHandler(IIndexHandler indexHandler) {
- this.indexHandler = indexHandler;
- }
-
- public String getName() {
- return name;
- }
-
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommand.java
deleted file mode 100644
index 1b54951..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.widgets.Event;
-import org.w3c.dom.Node;
-
-public abstract class MacroCommand implements IWritable, IPlayable {
- private WidgetIdentifier widgetId;
- private int [] range;
-
- public MacroCommand (WidgetIdentifier widgetId) {
- this.widgetId = widgetId;
- }
-
- public abstract String getType();
- public abstract void processEvent(Event e);
-
- protected void load(Node node, Hashtable lineTable) {
- String cid = MacroUtil.getAttribute(node, "contextId");
- String wid = MacroUtil.getAttribute(node, "widgetId");
- if (wid!=null && cid!=null)
- widgetId = new WidgetIdentifier(new Path(cid), new Path(wid));
- bindSourceLocation(node, lineTable);
- }
-
-
- void bindSourceLocation(Node node, Map lineTable) {
- Integer[] lines = (Integer[]) lineTable.get(node);
- if (lines != null) {
- range = new int[2];
- range[0] = lines[0].intValue();
- range[1] = lines[1].intValue();
- }
- }
-
- public int getStartLine() {
- if (range == null)
- return -1;
- return range[0];
- }
- public int getStopLine() {
- if (range == null)
- return -1;
- return range[1];
- }
-
- public boolean mergeEvent(Event e) {
- return false;
- }
- public WidgetIdentifier getWidgetId() {
- return widgetId;
- }
- public String toString() {
- return "MacroCommand ["+getType()+", line "+getStartLine()+"]";
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommandShell.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommandShell.java
deleted file mode 100644
index 0228b56..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroCommandShell.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.TableTree;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.IWorkbenchCommandSupport;
-import org.eclipse.ui.keys.KeySequence;
-import org.eclipse.ui.keys.KeyStroke;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class MacroCommandShell extends MacroInstruction {
- private ArrayList commands;
-
- private int expectedReturnCode;
-
- private transient Event lastEvent;
-
- private transient Display display;
-
- private transient Shell shell;
-
- private transient IIndexHandler indexHandler;
-
- private transient Window window;
-
- private static class NestedShell implements Listener, Runnable {
- private MacroCommandShell cshell;
-
- private Display display;
-
- private Shell nshell;
-
- private boolean released;
-
- private CoreException exception;
-
- private IProgressMonitor monitor;
-
- public NestedShell(Display display, MacroCommandShell cshell,
- IProgressMonitor monitor) {
- this.display = display;
- this.cshell = cshell;
- this.monitor = monitor;
- }
-
- public void handleEvent(Event e) {
- if (e.widget instanceof Shell) {
- // shell activated
- Shell shell = (Shell) e.widget;
- IPath path = MacroUtil.getShellId(shell);
- String sid = path.toString();
- if (sid.equals(cshell.getId())) {
- shell.getDisplay().removeFilter(SWT.Activate, this);
- released = true;
- this.nshell = shell;
- shell.getDisplay().asyncExec(this);
- }
- }
- }
-
- public boolean getResult() {
- return cshell.matchesReturnCode();
- }
-
- public boolean isReleased() {
- return released;
- }
-
- public void run() {
- try {
- cshell.playback(display, nshell, monitor);
- } catch (CoreException e) {
- this.exception = e;
- if (nshell != null && !nshell.isDisposed())
- nshell.close();
- }
- }
-
- public CoreException getException() {
- return exception;
- }
- }
-
- public MacroCommandShell() {
- this(null, null);
- }
-
- public MacroCommandShell(Shell shell, String path) {
- super(path);
- commands = new ArrayList();
- this.shell = shell;
- hookWindow(false);
- }
-
- private void hookWindow(boolean playback) {
- if (shell != null) {
- if (!playback)
- doHookWindow();
- else
- display.syncExec(new Runnable() {
- public void run() {
- doHookWindow();
- }
- });
- }
- }
-
- private void doHookWindow() {
- Object data = shell.getData();
- if (data != null && data instanceof Window)
- this.window = (Window) data;
- }
-
- public void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
-
- String codeId = MacroUtil.getAttribute(node, "return-code");
- if (codeId != null) {
- try {
- expectedReturnCode = new Integer(codeId).intValue();
- } catch (NumberFormatException e) {
- }
- }
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String name = child.getNodeName();
- if (name.equals("command"))
- processCommand(child, lineTable);
- else if (name.equals("shell"))
- processShell(child, lineTable);
- else if (name.equals("index"))
- processIndex(child, lineTable);
- }
- }
- }
-
- private void processCommand(Node node, Hashtable lineTable) {
- String wid = MacroUtil.getAttribute(node, "widgetId");
- String cid = MacroUtil.getAttribute(node, "contextId");
- String type = MacroUtil.getAttribute(node, "type");
- if (type == null)
- return;
- MacroCommand command = null;
- WidgetIdentifier wi = (wid != null && cid != null) ? new WidgetIdentifier(
- new Path(wid), new Path(cid))
- : null;
- if (type.equals(ModifyCommand.TYPE))
- command = new ModifyCommand(wi);
- else if (type.equals(BooleanSelectionCommand.TYPE))
- command = new BooleanSelectionCommand(wi);
- else if (type.equals(StructuredSelectionCommand.ITEM_SELECT)
- || type.equals(StructuredSelectionCommand.DEFAULT_SELECT))
- command = new StructuredSelectionCommand(wi, type);
- else if (type.equals(ExpansionCommand.TYPE))
- command = new ExpansionCommand(wi);
- else if (type.equals(CheckCommand.TYPE))
- command = new CheckCommand(wi);
- else if (type.equals(FocusCommand.TYPE))
- command = new FocusCommand(wi);
- else if (type.equals(ChoiceSelectionCommand.TYPE))
- command = new ChoiceSelectionCommand(wi);
- else if (type.equals(WaitCommand.TYPE))
- command = new WaitCommand();
- if (command != null) {
- command.load(node, lineTable);
- commands.add(command);
- }
- }
-
- private void processShell(Node node, Hashtable lineTable) {
- MacroCommandShell shell = new MacroCommandShell();
- shell.load(node, lineTable);
- commands.add(shell);
- }
-
- private void processIndex(Node node, Hashtable lineTable) {
- MacroIndex index = new MacroIndex();
- index.load(node, lineTable);
- commands.add(index);
- }
-
- public void addCommandShell(MacroCommandShell cshell) {
- commands.add(cshell);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<shell id=\"");
- writer.print(getId());
- writer.print("\" return-code=\"");
- writer.print(expectedReturnCode + "");
- writer.println("\">");
- String cindent = indent + " ";
- for (int i = 0; i < commands.size(); i++) {
- IWritable writable = (IWritable) commands.get(i);
- if (i < commands.size() - 1 || !(writable instanceof WaitCommand))
- writable.write(cindent, writer);
- }
- writer.print(indent);
- writer.println("</shell>");
- }
-
- public void addEvent(Event event) {
- if (event.widget instanceof Control) {
- if (((Control) event.widget).isVisible() == false)
- return;
- }
- MacroCommand command = createCommand(event);
- if (command != null) {
- command.processEvent(event);
- MacroCommand lastCommand = getLastCommand();
- if (lastCommand != null
- && lastCommand.getWidgetId().equals(command.getWidgetId())
- && lastCommand.getType().equals(FocusCommand.TYPE)
- && isFocusCommand(command.getType())) {
- // focus followed by select or modify - focus implied
- commands.remove(lastCommand);
- }
- commands.add(command);
- lastEvent = event;
- }
- }
-
- public void addPause() {
- WaitCommand command = new WaitCommand();
- MacroCommand lastCommand = getLastCommand();
- if (lastCommand != null && lastCommand.getType() != WaitCommand.TYPE)
- commands.add(command);
- }
-
- public void addIndex(String id) {
- commands.add(new MacroIndex(id));
- }
-
- public void extractExpectedReturnCode() {
- if (window != null)
- expectedReturnCode = window.getReturnCode();
- }
-
- public boolean matchesReturnCode() {
- if (window != null) {
- return window.getReturnCode() == expectedReturnCode;
- }
- return true;
- }
-
- private boolean isFocusCommand(String type) {
- return type.equals(BooleanSelectionCommand.TYPE)
- || type.equals(StructuredSelectionCommand.ITEM_SELECT)
- || type.equals(StructuredSelectionCommand.DEFAULT_SELECT)
- || type.equals(ExpansionCommand.TYPE)
- || type.equals(CheckCommand.TYPE)
- || type.equals(ModifyCommand.TYPE);
- }
-
- protected MacroCommand createCommand(Event event) {
- MacroCommand lastCommand = getLastCommand();
- if (lastEvent != null && lastEvent.widget.equals(event.widget)) {
- if (lastEvent.type == event.type
- || (lastEvent.type == SWT.Selection && event.type == SWT.DefaultSelection)) {
- if (lastCommand != null && lastCommand.mergeEvent(event))
- return null;
- }
- }
- MacroCommand command = null;
- WidgetIdentifier wi = MacroUtil.getWidgetIdentifier(event.widget);
- if (wi == null)
- return null;
-
- switch (event.type) {
- case SWT.Modify:
- if (!isEditable(event.widget))
- return null;
- command = new ModifyCommand(wi);
- break;
- case SWT.Selection:
- case SWT.DefaultSelection:
- command = createSelectionCommand(wi, event);
- break;
- case SWT.FocusIn:
- command = new FocusCommand(wi);
- break;
- case SWT.Expand:
- case SWT.Collapse:
- command = new ExpansionCommand(wi);
- break;
- /*
- * case SWT.KeyUp: command = findKeyBinding(wi, event); break;
- */
- }
- return command;
- }
-
- private boolean isEditable(Widget widget) {
- if (widget instanceof Control) {
- Control control = (Control) widget;
- if (!control.isEnabled())
- return false;
- if (control instanceof Text)
- return ((Text) control).getEditable();
- if (control instanceof Combo || control instanceof CCombo)
- return ((control.getStyle() & SWT.READ_ONLY) == 0);
- if (control instanceof StyledText)
- return ((StyledText) control).getEditable();
- }
- return true;
- }
-
- private MacroCommand createSelectionCommand(WidgetIdentifier wid,
- Event event) {
- if (event.widget instanceof MenuItem
- || event.widget instanceof ToolItem
- || event.widget instanceof Button) {
- String wId = wid.getWidgetId();
- if (wId.endsWith("org.eclipse.pde.ui.tests.StopAction"))
- return null;
- if (wId.endsWith("org.eclipse.pde.ui.tests.IndexAction"))
- return null;
- return new BooleanSelectionCommand(wid);
- }
- if (event.widget instanceof Tree || event.widget instanceof Table
- || event.widget instanceof TableTree) {
- if (event.detail == SWT.CHECK)
- return new CheckCommand(wid);
- String type = event.type == SWT.DefaultSelection ? StructuredSelectionCommand.DEFAULT_SELECT
- : StructuredSelectionCommand.ITEM_SELECT;
- return new StructuredSelectionCommand(wid, type);
- }
- if (event.widget instanceof TabFolder
- || event.widget instanceof CTabFolder)
- return new ChoiceSelectionCommand(wid);
- if (event.widget instanceof Combo || event.widget instanceof CCombo)
- return new ChoiceSelectionCommand(wid);
- return null;
- }
-
- protected MacroCommand findKeyBinding(WidgetIdentifier wid, Event e) {
- System.out.println("mask=" + e.stateMask + ", char=" + e.character);
- java.util.List keyStrokes = MacroUtil.generatePossibleKeyStrokes(e);
- if (keyStrokes.size() == 0)
- return null;
- for (int i = 0; i < keyStrokes.size(); i++) {
- if (!((KeyStroke) keyStrokes.get(i)).isComplete())
- return null;
- }
- System.out.println("keyStrokes=" + keyStrokes);
- IWorkbenchCommandSupport csupport = PlatformUI.getWorkbench()
- .getCommandSupport();
- KeySequence keySequence = KeySequence.getInstance(keyStrokes);
- System.out.println("keySequence=" + keySequence);
- String commandId = csupport.getCommandManager().getPerfectMatch(
- keySequence);
- System.out.println("Command id=" + commandId);
- if (commandId == null)
- return null;
- return new KeyCommand(wid, commandId);
- }
-
- private MacroCommand getLastCommand() {
- if (commands.size() > 0) {
- Object item = commands.get(commands.size() - 1);
- if (item instanceof MacroCommand)
- return (MacroCommand) item;
- }
- return null;
- }
-
- public boolean isDisposed() {
- return this.shell != null && this.shell.isDisposed();
- }
-
- public void close() {
- if (this.shell!=null && !this.shell.isDisposed())
- this.shell.close();
- }
-
- public boolean tracks(Shell shell) {
- if (this.shell != null && this.shell.equals(shell))
- return true;
- return false;
- }
-
- public boolean playback(final Display display, Composite parent,
- IProgressMonitor monitor) throws CoreException {
- if (parent instanceof Shell) {
- this.shell = (Shell) parent;
- this.display = display;
- hookWindow(true);
- }
-
- NestedShell nestedShell = null;
-
- monitor.beginTask("", commands.size());
-
- for (int i = 0; i < commands.size(); i++) {
- Object c = commands.get(i);
- if (c instanceof MacroIndex) {
- String id = ((MacroIndex) c).getId();
- if (id != null && indexHandler != null) {
- IStatus status = indexHandler.processIndex(shell, id);
- if (status.getSeverity() == IStatus.OK)
- continue;
- throw new CoreException(status);
- }
- // ignore the index
- continue;
- }
- IPlayable playable = (IPlayable) c;
- if (i < commands.size() - 1) {
- // check the next command
- IPlayable next = (IPlayable) commands.get(i + 1);
- if (next instanceof MacroCommandShell) {
- // this command will open a new shell
- // add a listener before it is too late
- MacroCommandShell nestedCommand = (MacroCommandShell) next;
- nestedShell = new NestedShell(display, nestedCommand,
- new SubProgressMonitor(monitor, 1));
- final NestedShell fnestedShell = nestedShell;
- display.syncExec(new Runnable() {
- public void run() {
- display.addFilter(SWT.Activate, fnestedShell);
- }
- });
- }
- }
- if (playable instanceof MacroCommand) {
- boolean last = i == commands.size() - 1;
- playInGUIThread(display, playable, last, monitor);
- monitor.worked(1);
- } else if (nestedShell != null) {
- CoreException e = null;
- if (nestedShell.isReleased() == false) {
- final NestedShell fnestedShell = nestedShell;
- display.syncExec(new Runnable() {
- public void run() {
- display.removeFilter(SWT.Activate, fnestedShell);
- }
- });
- }
- e = nestedShell.getException();
- boolean result = nestedShell.getResult();
- nestedShell = null;
- if (e != null)
- throw e;
- if (!result)
- return false;
- }
- }
- shell = null;
- return true;
- }
-
- void addExistingIndices(ArrayList list) {
- for (int i = 0; i < commands.size(); i++) {
- Object c = commands.get(i);
- if (c instanceof MacroIndex) {
- list.add(((MacroIndex) c).getId());
- } else if (c instanceof MacroCommandShell) {
- ((MacroCommandShell) c).addExistingIndices(list);
- }
- }
- }
-
- private void playInGUIThread(final Display display,
- final IPlayable playable, boolean last,
- final IProgressMonitor monitor) throws CoreException {
- final CoreException[] ex = new CoreException[1];
-
- Runnable runnable = new Runnable() {
- public void run() {
- try {
- //System.out.println("Executing: "+playable.toString());
- playable.playback(display, MacroCommandShell.this.shell,
- monitor);
- MacroUtil.processDisplayEvents(display);
- } catch (ClassCastException e) {
- ex[0] = createPlaybackException(playable, e);
- } catch (CoreException e) {
- ex[0] = e;
- } catch (SWTException e) {
- ex[0] = createPlaybackException(playable, e);
- } catch (SWTError error) {
- ex[0] = createPlaybackException(playable, error);
- }
- }
- };
- // if (last)
- // shell.getDisplay().asyncExec(runnable);
- // else
- // display.syncExec(runnable);
- if (playable instanceof WaitCommand) {
- playable.playback(display, this.shell, monitor);
- } else
- display.syncExec(runnable);
-
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
-
- // for (;;) {
- // if (display.isDisposed() || !display.readAndDispatch())
- // break;
- // }
-
- if (ex[0] != null)
- throw ex[0];
- }
-
- public IIndexHandler getIndexHandler() {
- return indexHandler;
- }
-
- public void setIndexHandler(IIndexHandler indexHandler) {
- this.indexHandler = indexHandler;
- for (int i = 0; i < commands.size(); i++) {
- Object c = commands.get(i);
- if (c instanceof MacroCommandShell) {
- MacroCommandShell child = (MacroCommandShell) c;
- child.setIndexHandler(indexHandler);
- }
- }
- }
-
- private CoreException createPlaybackException(IPlayable playable, Throwable th) {
- IStatus status = new Status(IStatus.ERROR, "org.eclipse.pde.ui.tests", IStatus.OK,
- "Error while executing a macro command: "+playable.toString(), th);
- return new CoreException(status);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroIndex.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroIndex.java
deleted file mode 100644
index 052a167..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroIndex.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-
-public class MacroIndex extends MacroInstruction {
-
- public MacroIndex() {
- super(null);
- }
-
- public MacroIndex(String id) {
- super(id);
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<index id=\"");
- writer.print(getId());
- writer.println("\"/>");
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroInstruction.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroInstruction.java
deleted file mode 100644
index 582cbf0..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroInstruction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.Node;
-
-public abstract class MacroInstruction implements IWritable, IPlayable {
- private int [] range;
- private String id;
-
- public MacroInstruction (String id) {
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- protected void load(Node node, Hashtable lineTable) {
- this.id = MacroUtil.getAttribute(node, "id");
- bindSourceLocation(node, lineTable);
- }
-
- void bindSourceLocation(Node node, Map lineTable) {
- Integer[] lines = (Integer[]) lineTable.get(node);
- if (lines != null) {
- range = new int[2];
- range[0] = lines[0].intValue();
- range[1] = lines[1].intValue();
- }
- }
-
- public int getStartLine() {
- if (range == null)
- return -1;
- return range[0];
- }
- public int getStopLine() {
- if (range == null)
- return -1;
- return range[1];
- }
-
-
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- return false;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroManager.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroManager.java
deleted file mode 100644
index d5c15ad..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroManager.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Vector;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-public class MacroManager {
- public static final String IGNORE = "__macro_ignore__";
- public static final int IDLE = 0;
-
- public static final int RUNNING = 1;
-
- public static final int DONE = 2;
-
- private Macro currentMacro;
-
- private IIndexHandler indexHandler;
-
- class DisplayListener implements Listener {
- public void handleEvent(Event event) {
- onEvent(event);
- }
- }
-
- class JobListener extends JobChangeAdapter {
- private int state = IDLE;
-
- public void running(IJobChangeEvent event) {
- if (!event.getJob().isSystem() && state == IDLE)
- state = RUNNING;
- }
-
- public void done(IJobChangeEvent event) {
- if (!event.getJob().isSystem() && state == RUNNING)
- state = DONE;
- }
-
- public void reset() {
- state = IDLE;
- }
-
- public int getState() {
- return state;
- }
- }
-
- private DisplayListener listener;
-
- private JobListener jobListener;
-
- private Vector listeners;
-
- private ArrayList widgetResolvers;
- private SAXParser parser;
-
- public MacroManager() {
- listener = new DisplayListener();
- jobListener = new JobListener();
- listeners = new Vector();
- }
-
- public void addRecorderListener(IRecorderListener listener) {
- if (!listeners.contains(listener))
- listeners.add(listener);
- }
-
- public void addIndex(String indexId) {
- if (currentMacro!=null) {
- currentMacro.addIndex(indexId);
- }
- }
-
- public void removeRecorderListener(IRecorderListener listener) {
- if (listeners.contains(listener))
- listeners.remove(listener);
- }
-
- public boolean isRecording() {
- return currentMacro != null;
- }
-
- public void startRecording() {
- Display display = PlatformUI.getWorkbench().getDisplay();
- hookListeners(display);
- currentMacro = new Macro();
- currentMacro.initializeForRecording(display);
- IRecorderListener[] array = (IRecorderListener[]) listeners
- .toArray(new IRecorderListener[listeners.size()]);
- for (int i = 0; i < array.length; i++) {
- array[i].recordingStarted();
- }
- }
-
- public String [] getExistingIndices() {
- if (currentMacro!=null) {
- return currentMacro.getExistingIndices();
- }
- return new String [0];
- }
-
- public Macro stopRecording() {
- Display display = PlatformUI.getWorkbench().getDisplay();
- unhookListeners(display);
- currentMacro.stopRecording();
- Macro newMacro = currentMacro;
- currentMacro = null;
- IRecorderListener[] array = (IRecorderListener[]) listeners
- .toArray(new IRecorderListener[listeners.size()]);
- for (int i = 0; i < array.length; i++) {
- array[i].recordingStopped();
- }
- return newMacro;
- }
-
- public void hookListeners(Display display) {
- display.addFilter(SWT.KeyDown, listener);
- display.addFilter(SWT.Selection, listener);
- display.addFilter(SWT.DefaultSelection, listener);
- display.addFilter(SWT.Expand, listener);
- display.addFilter(SWT.Collapse, listener);
- display.addFilter(SWT.Modify, listener);
- display.addFilter(SWT.Activate, listener);
- display.addFilter(SWT.Close, listener);
- display.addFilter(SWT.FocusIn, listener);
- IJobManager jobManager = Platform.getJobManager();
- jobManager.addJobChangeListener(jobListener);
- }
-
- public void unhookListeners(Display display) {
- display.removeFilter(SWT.KeyDown, listener);
- display.removeFilter(SWT.Selection, listener);
- display.removeFilter(SWT.DefaultSelection, listener);
- display.removeFilter(SWT.Expand, listener);
- display.removeFilter(SWT.Collapse, listener);
- display.removeFilter(SWT.Modify, listener);
- display.removeFilter(SWT.Activate, listener);
- display.removeFilter(SWT.Close, listener);
- display.removeFilter(SWT.FocusIn, listener);
- IJobManager jobManager = Platform.getJobManager();
- jobManager.removeJobChangeListener(jobListener);
- }
-
- public void shutdown() {
- if (currentMacro != null) {
- Display display = PlatformUI.getWorkbench().getDisplay();
- unhookListeners(display);
- currentMacro.stopRecording();
- currentMacro = null;
- }
- }
-
- /**
- * Plays a provided macro stream. The method will close the input stream
- * upon parsing.
- *
- * @param is
- * @throws CoreException
- */
- public boolean play(final Display display, IRunnableContext context,
- String scriptName, InputStream is) throws CoreException {
- XMLDefaultHandler handler = createMacroDocument(is);
- Node root = handler.getDocumentElement();
- NodeList children = root.getChildNodes();
-
- final Macro macro = new Macro(scriptName);
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeName().equals("shell")) {
- macro.addShell(child, handler.getLineTable());
- }
- }
- // discard the DOM
- handler = null;
-
- macro.setIndexHandler(getIndexHandler());
-
- final boolean[] result = new boolean[1];
-
- IRunnableWithProgress op = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException {
- try {
- //System.out.println("Start macro: "+macro.getName());
- result[0] = macro.playback(display, null, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } catch (ClassCastException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- //System.out.println("Stop macro: "+macro.getName());
- }
- }
- };
- try {
- context.run(true, true, op);
- } catch (InterruptedException e) {
- } catch (InvocationTargetException e) {
- MacroPlugin.logException(e);
- return false;
- }
- return result[0];
- }
-
- private XMLDefaultHandler createMacroDocument(InputStream is) throws CoreException {
- XMLDefaultHandler handler=null;
- try {
- SAXParser parser = getParser();
- handler = new XMLDefaultHandler();
- parser.parse(is, handler);
- } catch (SAXException e) {
- MacroUtil.throwCoreException("Error parsing the macro file", 0, e);
- } catch (IOException e) {
- MacroUtil.throwCoreException("Error parsing the macro file", 0, e);
- } finally {
- try {
- is.close();
- } catch (IOException e) {
- }
- }
- return handler;
- }
-
- private SAXParser getParser() throws CoreException {
- if (parser==null) {
- try {
- return SAXParserFactory.newInstance().newSAXParser();
- } catch (ParserConfigurationException e) {
- MacroUtil.throwCoreException("Error parsing the macro file", 0, e);
- } catch (SAXException e) {
- MacroUtil.throwCoreException("Error parsing the macro file", 0, e);
- }
- }
- return parser;
- }
-
- private void onEvent(Event event) {
- try {
- if (event.type==SWT.KeyDown) {
- if ((event.stateMask & SWT.SHIFT)!=0 &&
- (event.stateMask & SWT.CTRL)!=0) {
- int key = event.keyCode & SWT.KEY_MASK;
- if (key==SWT.F11)
- notifyInterrupt(IRecorderListener.STOP);
- else if (key==SWT.F10)
- notifyInterrupt(IRecorderListener.INDEX);
- }
- return;
- }
- if ((event.type == SWT.Close || event.type == SWT.Activate)
- && !(event.widget instanceof Shell))
- return;
- if (jobListener.getState() == RUNNING
- || jobListener.getState() == DONE)
- currentMacro.addPause();
- jobListener.reset();
- boolean stop = currentMacro.addEvent(event);
- if (stop) {
- notifyInterrupt(IRecorderListener.STOP);
- }
- } catch (Exception e) {
- MacroPlugin.logException(e);
- stopRecording();
- }
- }
-
- private void notifyInterrupt(int type) {
- IRecorderListener[] array = (IRecorderListener[]) listeners
- .toArray(new IRecorderListener[listeners.size()]);
- for (int i = 0; i < array.length; i++) {
- array[i].recordingInterrupted(type);
- }
- }
-
- public String resolveWidget(Widget widget) {
- if (widgetResolvers == null)
- loadWidgetResolvers();
- for (int i = 0; i < widgetResolvers.size(); i++) {
- IWidgetResolver resolver = (IWidgetResolver) widgetResolvers.get(i);
- String id = resolver.getUniqueId(widget);
- if (id != null)
- return id;
- }
- return null;
- }
-
- private void loadWidgetResolvers() {
- widgetResolvers = new ArrayList();
- IConfigurationElement[] elements = Platform.getExtensionRegistry()
- .getConfigurationElementsFor(
- "org.eclipse.pde.ui.tests.macroSupport");
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].getName().equals("widgetResolver")) {
- try {
- Object obj = elements[i].createExecutableExtension("class");
- if (obj instanceof IWidgetResolver)
- widgetResolvers.add(obj);
- } catch (CoreException e) {
- System.out.println(e);
- }
- }
- }
- }
-
- public IIndexHandler getIndexHandler() {
- return indexHandler;
- }
-
-
- public void setIndexHandler(IIndexHandler indexHandler) {
- this.indexHandler = indexHandler;
- }
-
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroPlugin.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroPlugin.java
deleted file mode 100644
index b930f8a..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroPlugin.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.lang.reflect.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.plugin.*;
-import org.osgi.framework.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MacroPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static MacroPlugin plugin;
-
- private MacroManager recorder;
- /**
- * The constructor.
- */
- public MacroPlugin() {
- super();
- plugin = this;
- recorder = new MacroManager();
- }
- public MacroManager getMacroManager() {
- return recorder;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- recorder.shutdown();
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static MacroPlugin getDefault() {
- return plugin;
- }
-
- public static void logException(Throwable e) {
- logException(e, null, null);
- }
- public static void logException(
- Throwable e,
- final String title,
- String message) {
- if (e instanceof InvocationTargetException) {
- e = ((InvocationTargetException) e).getTargetException();
- }
- IStatus status = null;
- if (e instanceof CoreException)
- status = ((CoreException) e).getStatus();
- else {
- if (message == null)
- message = e.getMessage();
- if (message == null)
- message = e.toString();
- status = new Status(IStatus.ERROR, "org.eclipse.pde.ui.tests", IStatus.OK, message, e);
- }
- ResourcesPlugin.getPlugin().getLog().log(status);
- Display display = Display.getCurrent();
- if (display==null)
- display = Display.getDefault();
- final IStatus fstatus = status;
- display.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(null, title, null, fstatus);
- }
- });
- }
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroUtil.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroUtil.java
deleted file mode 100644
index 7cf9baa..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/MacroUtil.java
+++ /dev/null
@@ -1,955 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.CoolBarManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.ToolBarContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.CoolBar;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPluginContribution;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.EditorSite;
-import org.eclipse.ui.internal.PartPane;
-import org.eclipse.ui.internal.PartSite;
-import org.eclipse.ui.keys.SWTKeySupport;
-import org.w3c.dom.Node;
-
-public class MacroUtil {
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- /**
- * Returns the path where counters of the given event are stored, or null if
- * we are not keeping records of the given event.
- *
- * @param event
- * @return
- */
- public static WidgetIdentifier getWidgetIdentifier(Widget widget) {
- if (widget instanceof MenuItem) {
-
- MenuItem menuItem = (MenuItem) widget;
-
- if (onMenubar(menuItem)) {
- return new WidgetIdentifier(new Path("menus"), new Path(getActionId(menuItem))); //$NON-NLS-1$
- }
- Control c = widget.getDisplay().getFocusControl();
- WidgetIdentifier ci = getControlIdentifier(c);
- if (ci==null)
- return null;
- return new WidgetIdentifier(new Path("popup").append(ci.getFullyQualifiedPath()), new Path(getActionId(menuItem))); //$NON-NLS-1$
- } else if (widget instanceof ToolItem) {
- ToolItem toolItem = (ToolItem) widget;
-
- if (onToolbar(toolItem))
- return new WidgetIdentifier(new Path("toolbar"), new Path(getActionId(toolItem))); //$NON-NLS-1$
- // local toolbar somewhere - locate the parent
- // first
- ToolBar toolBar = toolItem.getParent();
- WidgetIdentifier controlId = getControlIdentifier(toolBar);
- IPath localPath = controlId.getFullyQualifiedPath();
- return new WidgetIdentifier(new Path("local-toolbar").append(localPath),
- new Path(getActionId(toolItem)));
- } else if (widget instanceof Shell) {
- return new WidgetIdentifier(new Path("shell"), getShellId((Shell)widget));
- } else if (widget instanceof Control) {
- return getControlIdentifier((Control)widget);
- } else if (widget instanceof Menu) {
- return new WidgetIdentifier(new Path("menu"), new Path(getActionId((Menu)widget)));
- }
- return null;
- }
-
- public static IPath getShellId(Shell shell) {
- Object data = shell.getData();
- String id = "";
- if (data instanceof WizardDialog) {
- id = data.getClass().getName().toString();
- }
- else if (data instanceof Window) {
- id = data.getClass().getName().toString();
- }
- return new Path(id);
- }
-
- public static WidgetIdentifier getControlIdentifier(Control control) {
- Shell shell = control.getShell();
- Object data = shell.getData();
- if (data instanceof WizardDialog) {
- // in wizard
- WizardDialog wd = (WizardDialog)data;
- IWizardPage page = wd.getCurrentPage();
- if (page==null) return null;
- Control pageControl = page.getControl();
- String relativePath = computeRelativePath((Composite)pageControl, null, control);
- if (relativePath!=null) {
- IPath path = new Path("wizard-page").append(page.getName());
- return new WidgetIdentifier(path, new Path(relativePath));
- }
- // check for wizard buttons
- if (control instanceof Button) {
- relativePath = computeRelativePath(shell, (Composite)pageControl, control);
- return new WidgetIdentifier(new Path("wizard"), new Path(relativePath));
- }
- return null;
- }
- else if (data instanceof IWorkbenchWindow) {
- IWorkbenchWindow window = (IWorkbenchWindow)data;
- IWorkbenchPage page = window.getActivePage();
- IWorkbenchPart part = page.getActivePart();
- IWorkbenchPartSite site = part.getSite();
- IPath path;
- if (part instanceof IViewPart)
- path = new Path("view").append(site.getId());
- else if (part instanceof IEditorPart) {
- String inputName = ((IEditorPart)part).getEditorInput().getName();
- path = new Path("editor").append(site.getId()).append(inputName);
- }
- else
- return null;
- PartSite partSite = (PartSite)site;
- PartPane pane = partSite.getPane();
- Composite paneComposite = (Composite)pane.getControl();
- // If the control we are looking for is a local tool bar,
- // go up one level
- if (part instanceof IViewPart && control instanceof ToolBar)
- paneComposite = paneComposite.getParent();
- String relativePath = computeRelativePath(paneComposite, null, control);
- if (relativePath!=null) {
- return new WidgetIdentifier(path, new Path(relativePath));
- }
- }
- else {
- // unknown shell - fetch controls starting from the shell
- String relativePath = computeRelativePath(shell, null, control);
- return new WidgetIdentifier(new Path("shell"), new Path(relativePath));
- }
- return null;
- }
-
- private static String computeRelativePath(Composite parent, Composite skip, Control control) {
- int [] counter = new int[1];
- counter[0] = 0;
- boolean result = computeControlToken(parent, skip, control, counter);
- if (!result && skip==null) return null;
- int index = result?counter[0]:0;
- return getControlId(control, index);
- }
-
- private static String getControlId(Control control, int index) {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- String controlId = recorder.resolveWidget(control);
- if (controlId==null)
- controlId = index+"";
- return control.getClass().getName()+"#"+controlId;
- }
-
- private static boolean computeControlToken(Composite parent, Composite skip, Control control, int [] counter) {
- Control [] children = parent.getChildren();
- for (int i=0; i<children.length; i++) {
- Control child = children[i];
-
- if (!child.isVisible()) continue;
-
- if (child.getClass().equals(control.getClass())) {
- // same type - increment counter
- counter[0]++;
- if (control.equals(child)) {
- // bingo
- return true;
- }
- }
- else if (child instanceof Composite) {
- if (skip!=null && child.equals(skip)) continue;
- boolean status = computeControlToken((Composite)child, skip, control, counter);
- if (status)
- return true;
- }
- }
- return false;
- }
-
- public static boolean isInputControl(Control control) {
- return true;
- }
-
- /**
- * @param menuItem
- * @return
- */
- private static boolean onMenubar(MenuItem menuItem) {
- Menu parent = menuItem.getParent();
- MenuItem parentItem = parent.getParentItem();
-
- if (parentItem != null) {
- return onMenubar(parentItem);
- }
-
- Shell theShell = parent.getShell();
-
- return parent == theShell.getMenuBar();
- }
-
- private static boolean onToolbar(ToolItem toolItem) {
- ToolBar toolBar = toolItem.getParent();
- Shell shell = toolBar.getShell();
- Object data = shell.getData();
- if (data instanceof ApplicationWindow) {
- ApplicationWindow window = (ApplicationWindow)data;
- ToolBarManager mng = window.getToolBarManager();
- if (mng!=null) {
- if (mng.getControl()!=null && mng.getControl()==toolBar)
- return true;
- }
- CoolBarManager cmng = window.getCoolBarManager();
- if (cmng!=null) {
- CoolBar cbar = cmng.getControl();
- Composite parent = toolBar.getParent();
- while (parent!=null) {
- if (parent == cbar) return true;
- parent = parent.getParent();
- }
- }
- }
- return false;
- }
-
- /**
- * @param toolItem
- * @return
- */
- private static String getActionId(ToolItem toolItem) {
- Object data = toolItem.getData();
- if (data != null && (data instanceof IContributionItem)) {
- String result = getActionId((IContributionItem) data);
- if (!result.equals(EMPTY_STRING)) {
- return result;
- }
- }
-
- return "readablename/" + getDisplayName(toolItem); //$NON-NLS-1$
- }
-
- /**
- * @param toolItem
- * @return
- */
- private static String getDisplayName(ToolItem toolItem) {
- String name = toolItem.getText();
-
- if (name != null && !name.equals(EMPTY_STRING)) {
- return name;
- }
-
- name = toolItem.getToolTipText();
-
- if (name != null) {
- return name;
- }
-
- return "unknown"; //$NON-NLS-1$
- }
-
- /**
- * Returns an identifier for the given MenuItem, based on its user-readable
- * strings
- *
- * @param menuItem
- * @return
- */
- private static String getDisplayName(MenuItem menuItem) {
-
- if (menuItem.getParent() == null
- || menuItem.getParent().getParentItem() == null) {
- return removeChar(menuItem.getText(), '&');
- }
-
- return getDisplayName(menuItem.getParent()) + "/" //$NON-NLS-1$
- + removeChar(menuItem.getText(), '&');
- }
-
- /**
- * Returns an identifier for the given Menu, based on its user-readable
- * strings
- *
- * @param menu
- * @return
- */
- private static String getDisplayName(Menu menu) {
-
- MenuItem parentItem = menu.getParentItem();
-
- if (parentItem == null) {
- return EMPTY_STRING;
- }
-
- return getDisplayName(parentItem);
- }
-
- protected String getContribId(MenuItem menuItem) {
- Object data = menuItem.getData();
- if (data != null && (data instanceof IContributionItem)) {
- String result = ((IContributionItem) data).getId();
-
- if (result != null) {
- return result;
- }
- }
-
- return EMPTY_STRING;
- }
-
- /**
- * @param menuItem
- * @return
- */
- private static String getActionId(MenuItem menuItem) {
- Object data = menuItem.getData();
- if (data != null && (data instanceof IContributionItem)) {
- String result = getActionId((IContributionItem) data);
- if (!result.equals(EMPTY_STRING)) {
- return result;
- }
- }
-
- // return EMPTY_STRING;
-
- return "readablename/" + getDisplayName(menuItem); //$NON-NLS-1$
- }
-
- private static String getActionId(Menu menu) {
- Object data = menu.getData();
- if (data != null && (data instanceof IContributionItem)) {
- String result = getActionId((IContributionItem) data);
- if (!result.equals(EMPTY_STRING)) {
- return result;
- }
- }
-
- // return EMPTY_STRING;
-
- return "readablename/" + getDisplayName(menu); //$NON-NLS-1$
- }
-
- private static String getActionId(IContributionItem contrib) {
- String id = null;
-
- if (contrib instanceof IPluginContribution) {
- id = ((IPluginContribution)contrib).getLocalId();
- }
- if (id==null)
- id = contrib.getId();
-
- if (id != null) {
- return "contribid/" + id; //$NON-NLS-1$
- }
-
- if (contrib instanceof ActionContributionItem) {
- ActionContributionItem actionItem = (ActionContributionItem) contrib;
-
- id = actionItem.getId();
-
- if (id != null) {
- return "actionid/" + id; //$NON-NLS-1$
- }
-
- IAction action = actionItem.getAction();
-
- id = action.getActionDefinitionId();
-
- if (id != null) {
- return "defid/" + id; //$NON-NLS-1$
- }
-
- return "actionclass/" + action.getClass().getName(); //$NON-NLS-1$
- }
- return "contribclass/" + contrib.getClass().getName(); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.instrumentation.IDataProvider#getDefaultValue(org.eclipse.core.runtime.IPath)
- */
- public Object getDefaultValue(IPath node) throws CoreException {
- return null;
- }
-
- private MenuItem getMenuItem(Menu menu, IPath menuPath) {
- if (menuPath.isEmpty()) {
- return null;
- }
-
- String toFind = menuPath.segment(0);
- MenuItem[] items = menu.getItems();
-
- for (int idx = 0; idx < items.length; idx++) {
- MenuItem item = items[idx];
-
- String itemName = removeChar(item.getText(), '&');
-
- if (itemName.equals(toFind)) {
- return getMenuItem(item, menuPath.removeFirstSegments(1));
- }
- }
-
- return null;
- }
-
- private MenuItem getMenuItem(MenuItem menu, IPath menuPath) {
- if (menuPath.isEmpty()) {
- return menu;
- }
-
- Menu subMenu = menu.getMenu();
- if (subMenu == null) {
- return null;
- }
-
- return getMenuItem(subMenu, menuPath);
-
- }
- public static String removeChar(String input, char toRemove) {
- StringBuffer buf = new StringBuffer(input.length());
-
- int last = 0;
- for (int pos = input.indexOf(toRemove); pos != -1; pos = input.indexOf(toRemove, last)) {
- buf.append(input.substring(last, pos));
- last = pos + 1;
- }
-
- buf.append(input.substring(last, input.length()));
-
- return buf.toString();
- }
-
- public static String getAttribute(Node node, String name) {
- Node value = node.getAttributes().getNamedItem(name);
- if (value!=null)
- return value.getNodeValue();
- return null;
- }
-
- public static String getNormalizedText(String source) {
- if (source==null) return "";
- //String result = source.replace('\t', ' ');
- String result = source;
- result = result.trim();
- return result;
- }
-
- public static String getWritableText(String input) {
- String result = input.trim();
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < result.length(); i++) {
- char c = result.charAt(i);
- switch (c) {
- case '<' :
- buf.append("<"); //$NON-NLS-1$
- break;
- case '>' :
- buf.append(">"); //$NON-NLS-1$
- break;
- case '&' :
- buf.append("&"); //$NON-NLS-1$
- break;
- case '\'' :
- buf.append("'"); //$NON-NLS-1$
- break;
- case '\"' :
- buf.append("""); //$NON-NLS-1$
- break;
- default :
- buf.append(c);
- }
- }
- return buf.toString();
- }
-
- public static CommandTarget locateCommandTarget(Composite parent, WidgetIdentifier wid, int line) throws CoreException {
- return locateCommandTarget(parent, wid, null, line);
- }
-
- public static CommandTarget locateCommandTarget(Composite parent, WidgetIdentifier wid, ArrayList parents, int line) throws CoreException {
- Shell shell = (Shell)parent;
-
- String firstToken = wid.contextPath.segment(0);
- IPath wpath = wid.widgetPath;
- Iterator iter = parents!=null?parents.iterator():null;
- if (firstToken.equals("menus"))
- return locateMenuBarItem(shell, wpath, iter, line);
- if (firstToken.equals("popup"))
- return locatePopupMenuItem(shell, wid, iter, line);
- if (firstToken.equals("toolbar"))
- return locateToolItem(shell, wpath, line);
- if (firstToken.equals("local-toolbar"))
- return locateLocalToolItem(shell, wid, line);
- if (firstToken.equals("wizard"))
- return locateWizardControl(shell, wpath, line);
- if (firstToken.equals("shell"))
- return locateShellControl(shell, wpath, line);
-
- String id = wid.contextPath.segment(1);
- if (firstToken.equals("wizard-page"))
- return locateWizardPageControl(shell, id, wpath, line);
- if (firstToken.equals("view"))
- return locateViewControl(shell, id, wpath, line);
- if (firstToken.equals("editor")) {
- String inputName = wid.contextPath.segment(2);
- return locateEditorControl(shell, id, inputName, wpath, line);
- }
- return null;
- }
-
- private static CommandTarget locateMenuBarItem(Shell shell, IPath path, Iterator parents, int line) throws CoreException {
- MenuItem item = null;
- Object data = shell.getData();
- Menu menuBar = shell.getMenuBar();
-
- if (data instanceof ApplicationWindow && parents!=null) {
- ApplicationWindow window = (ApplicationWindow)data;
- MenuManager manager = window.getMenuBarManager();
- item = locateMenuItem(manager, path.toString(), parents, line);
- }
- else {
- item = locateMenuItem(menuBar, path.toString(), line);
- }
- if (item!=null) return new CommandTarget(item, menuBar);
- throwCoreException("Cannot locate menu item: "+path.toString(), line);
- return null;
- }
-
- private static MenuItem locateMenuItem(Menu menu, String id, int line) {
- MenuItem [] items = menu.getItems();
-
- for (int i=0; i<items.length; i++) {
- MenuItem item = items[i];
-
- Menu submenu = item.getMenu();
- if (submenu!=null) {
- MenuItem hit = locateMenuItem(submenu, id, line);
- if (hit!=null)
- return hit;
- }
- else {
- String itemId = getActionId(item);
- if (itemId!=null && id.equals(itemId))
- return item;
- }
- }
- return null;
- }
-
- private static MenuItem locateMenuItem(MenuManager mng, String id, Iterator parents, int line) {
- IContributionItem [] items = mng.getItems();
-
- String parentId = null;
- if (parents.hasNext())
- parentId = (String)parents.next();
-
- for (int i=0; i<items.length; i++) {
- IContributionItem citem = items[i];
-
- if (citem instanceof MenuManager) {
- MenuManager submenu = (MenuManager)citem;
- String subId = submenu.getId();
-
- if (subId.equals(parentId)) {
- // show this menu to force dynamic items
- // to show
- Menu menu = submenu.getMenu();
- forceMenuOpen(null, menu);
-
- MenuItem hit = locateMenuItem(submenu, id, parents, line);
- forceMenuClosed(menu);
- if (hit!=null)
- return hit;
- }
- }
- else {
- String itemId = getActionId(citem);
- if (itemId!=null && id.equals(itemId)) {
- MenuItem hit = locateMenuItem(mng.getMenu(), id, line);
- if (hit!=null)
- return hit;
- }
- }
- }
- return null;
- }
-
- private static void forceMenuOpen(Control c, Menu menu) {
- Event e = new Event();
- e.type = SWT.Show;
- e.widget = menu;
- /*
- if (c!=null) {
- Point midpoint = c.getSize();
- midpoint.x /= 2;
- midpoint.y /= 2;
- midpoint = c.toDisplay(midpoint);
- menu.setLocation(midpoint);
- }
- */
- //menu.setVisible(true);
- menu.notifyListeners(e.type, e);
- processDisplayEvents(menu.getDisplay());
- }
-
- private static void forceMenuClosed(Menu menu) {
- Event e = new Event();
- e.type = SWT.Hide;
- //menu.setVisible(false);
- e.widget = menu;
- menu.notifyListeners(e.type, e);
- processDisplayEvents(menu.getDisplay());
- }
-
- public static void processDisplayEvents(Display display) {
- for (;;) {
- if (!display.readAndDispatch ())
- break;
- }
- }
-
- private static CommandTarget locatePopupMenuItem(Shell shell, WidgetIdentifier wid, Iterator parents, int line) throws CoreException {
- IPath contextPath = wid.contextPath.removeFirstSegments(1);
- IPath wpath = new Path(contextPath.lastSegment());
- contextPath = contextPath.removeLastSegments(1);
- CommandTarget target = locateCommandTarget(shell, new WidgetIdentifier(contextPath, wpath), line);
- if (target!=null) {
- Control control = (Control)target.getWidget();
- Menu popupMenu = control.getMenu();
- if (popupMenu!=null) {
- forceMenuOpen(control, popupMenu);
- MenuItem menuItem = locateMenuItem(popupMenu, wid.getWidgetId(), line);
- forceMenuClosed(popupMenu);
- if (menuItem!=null) {
- return new CommandTarget(menuItem, control);
- }
- }
- }
- throwCoreException("Cannot locate pop-up menu item: "+wid.getWidgetId(), line);
- return null;
- }
-
- private static CommandTarget locateToolItem(Shell shell, IPath path, int line) throws CoreException {
- Object data = shell.getData();
- CommandTarget target = null;
- if (data instanceof ApplicationWindow) {
- ApplicationWindow window = (ApplicationWindow)data;
- CoolBarManager coolMng = window.getCoolBarManager();
- if (coolMng!=null) {
- target = locateToolItem(coolMng, path.toString(), line);
- }
- ToolBarManager toolMng = window.getToolBarManager();
- if (toolMng!=null) {
- target = locateToolItem(toolMng, path.toString(), line);
- }
- }
- if (target==null)
- throwCoreException("Cannot locate pop-up menu item: "+path.toString(), line);
- return target;
- }
-
- private static CommandTarget locateToolItem(ICoolBarManager coolMng, String id, int line) {
- IContributionItem [] items = coolMng.getItems();
- for (int i=0; i<items.length; i++) {
- if (items[i] instanceof ToolBarContributionItem) {
- ToolBarContributionItem item = (ToolBarContributionItem)items[i];
- IToolBarManager toolMng = item.getToolBarManager();
- CommandTarget target = locateToolItem((ToolBarManager)toolMng, id, line);
- if (target!=null)
- return target;
- }
- }
- return null;
- }
-
- private static CommandTarget locateToolItem(ToolBarManager toolMng, String id, int line) {
- return locateToolItem(toolMng.getControl(), id, line);
- }
-
- private static CommandTarget locateToolItem(ToolBar toolBar, String id, int line) {
- ToolItem [] items = toolBar.getItems();
- for (int i=0; i<items.length; i++) {
- ToolItem item = items[i];
- String itemId = getActionId(item);
- if (itemId!=null && itemId.equals(id))
- return new CommandTarget(item, toolBar);
- }
- return null;
- }
-
- private static CommandTarget locateLocalToolItem(Shell shell, WidgetIdentifier wid, int line) throws CoreException {
- IPath wpath = wid.contextPath.removeFirstSegments(1);
- String firstToken = wpath.segment(0);
-
- if (firstToken.equals("view")) {
- String id = wpath.segment(1);
- IViewPart view = locateView(shell, id, line);
- if (view!=null) {
- PartPane pane = getPartPane(view);
- processDisplayEvents(shell.getDisplay());
- Composite parent = pane.getControl().getParent();
- Control c = locateVisibleChild((Composite)parent, null, wpath.removeFirstSegments(2));
- if (c!=null) {
- //TODO bad cast
- ToolBarManager mng = (ToolBarManager)view.getViewSite().getActionBars().getToolBarManager();
- CommandTarget target = locateToolItem(mng, wid.getWidgetId(), line);
- if (target!=null)
- return target;
- }
- }
- }
- throwCoreException("Cannot locate local tool bar item: "+wid.getFullyQualifiedId().toString(), line);
- return null;
- }
-
- private static WizardCommandTarget locateWizardControl(Shell shell, IPath wpath, int line) throws CoreException {
- WizardDialog wdialog = (WizardDialog)shell.getData();
- IWizardPage page = wdialog.getCurrentPage();
- Composite pparent = (Composite)page.getControl();
- Control control=locateVisibleChild(shell, pparent, wpath);
- if (control==null)
- throwCoreException("Cannot locate wizard control: "+wpath.toString(), line);
- if (control.isDisposed())
- throwCoreException("Wizard control is disposed: "+wpath.toString(), line);
- return new WizardCommandTarget(control, wdialog);
- }
-
- private static WindowCommandTarget locateShellControl(Shell shell, IPath wpath, int line) throws CoreException {
- Window window = (Window)shell.getData();
- Control control=locateVisibleChild(shell, null, wpath);
- if (control==null)
- throwCoreException("Cannot locate shell control: "+wpath.toString(), line);
- if (control.isDisposed())
- throwCoreException("Shell control is disposed: "+wpath.toString(), line);
- return new WindowCommandTarget(control, window);
- }
-
- private static WizardCommandTarget locateWizardPageControl(Shell shell, String id, IPath wpath, int line) throws CoreException {
- Control control=null;
- Object data = shell.getData();
- if (data instanceof WizardDialog) {
- WizardDialog wdialog = (WizardDialog)data;
- IWizardPage page = wdialog.getCurrentPage();
- String pname = page.getName();
- // assert page
- if (pname.equals(id)==false)
- throwCoreException("Unexpected wizard page: "+pname+", expected "+id, line);
- Composite pparent = (Composite)page.getControl();
- control = locateVisibleChild(pparent, null, wpath);
- if (control!=null)
- return new WizardCommandTarget(control, wdialog);
- }
- if (control==null)
- throwCoreException("Cannot locate wizard page control: "+wpath.toString(), line);
- return null;
- }
-
- private static IViewPart locateView(Shell shell, String id, int line) throws CoreException {
- Object data = shell.getData();
-
- if (data instanceof IWorkbenchWindow) {
- IWorkbenchWindow window = (IWorkbenchWindow)data;
- IWorkbenchPage page = window.getActivePage();
- if (page!=null) {
- IViewPart view = page.showView(id);
- return view;
- }
- }
- throwCoreException("Cannot locate view: "+id, line);
- return null;
- }
-
- private static PartPane getPartPane(IViewPart part) {
- IWorkbenchPartSite site = part.getSite();
- PartPane pane = ((PartSite)site).getPane();
- return pane;
- }
-
- private static ViewCommandTarget locateViewControl(Shell shell, String id, IPath wpath, int line) throws CoreException {
- Control control=null;
-
- IViewPart view = locateView(shell, id, line);
- if (view!=null) {
- PartPane pane = getPartPane(view);
- Control c = pane.getControl();
- control = locateVisibleChild((Composite)c, null, wpath);
- if (control!=null) {
- return new ViewCommandTarget(control, view);
- }
- }
- throwCoreException("Cannot locate view control: "+wpath.toString(), line);
- return null;
- }
- private static EditorCommandTarget locateEditorControl(Shell shell, String id, String inputName, IPath wpath, int line) throws CoreException {
- Control control=null;
-
- Object data = shell.getData();
-
- if (data instanceof IWorkbenchWindow) {
- IWorkbenchWindow window = (IWorkbenchWindow)data;
- IWorkbenchPage page = window.getActivePage();
- if (page!=null) {
- IEditorReference [] erefs = page.getEditorReferences();
- IEditorPart editor=null;
- for (int i=0; i<erefs.length; i++) {
- IEditorReference eref = erefs[i];
- if (eref.getId().equals(id)) {
- // check the input
- IEditorPart part = eref.getEditor(true);
- if (part.getEditorInput().getName().equals(inputName)) {
- editor = part;
- break;
- }
- }
- }
- if (editor!=null) {
- IEditorSite site = editor.getEditorSite();
- PartPane pane = ((EditorSite)site).getPane();
- Control c = pane.getControl();
- control = locateVisibleChild((Composite)c, null, wpath);
- if (control!=null) {
- return new EditorCommandTarget(control, editor);
- }
- }
- }
- }
- if (control==null)
- throwCoreException("Cannot locate editor control: "+wpath.toString(), line);
- return null;
- }
-
- private static Control locateVisibleChild(Composite parent, Composite skip, IPath wpath) {
- int [] counter = new int[1];
- counter[0] = 0;
- String wid = wpath.toString();
- int sloc = wid.lastIndexOf('#');
- if (sloc== -1) return null;
- String wclassName = wid.substring(0, sloc);
- return locateVisibleChild(parent, skip, wid, wclassName, counter);
- }
-
- private static Control locateVisibleChild(Composite parent, Composite skip, String id, String wclassName, int [] counter) {
- Control [] children = parent.getChildren();
- for (int i=0; i<children.length; i++) {
- Control child = children[i];
-
- if (child.getClass().getName().equals(wclassName)) {
- // same type - increment counter
- if (child.isVisible()==false) continue;
- counter[0]++;
- String cid = getControlId(child, counter[0]);
- if (cid.equals(id)) {
- // bingo
- return child;
- }
- }
- else if (child instanceof Composite) {
- if (skip!=null && child.equals(skip)) continue;
- if (!child.isVisible()) continue;
- Control c = locateVisibleChild((Composite)child, skip, id, wclassName, counter);
- if (c!=null)
- return c;
- }
- }
- return null;
- }
-
- public static void throwCoreException(String message, int line) throws CoreException {
- throwCoreException(message, line, null);
- }
- public static void throwCoreException(String message, int line, Throwable t) throws CoreException {
- if (line >0)
- message = "Line "+line+": "+message;
- Status s = new Status(IStatus.ERROR, "org.eclipse.ui.macro", IStatus.OK, message, t);
- throw new CoreException(s);
- }
-
- public static java.util.List generatePossibleKeyStrokes(Event event) {
- final java.util.List keyStrokes = new ArrayList(3);
-
- /*
- * If this is not a keyboard event, then there are no key strokes. This
- * can happen if we are listening to focus traversal events.
- */
- if ((event.stateMask == 0) && (event.keyCode == 0)
- && (event.character == 0)) {
- return keyStrokes;
- }
-
- // Add each unique key stroke to the list for consideration.
- final int firstAccelerator = SWTKeySupport
- .convertEventToUnmodifiedAccelerator(event);
- keyStrokes.add(SWTKeySupport
- .convertAcceleratorToKeyStroke(firstAccelerator));
-
- // We shouldn't allow delete to undergo shift resolution.
- if (event.character == SWT.DEL) {
- return keyStrokes;
- }
-
- final int secondAccelerator = SWTKeySupport
- .convertEventToUnshiftedModifiedAccelerator(event);
- if (secondAccelerator != firstAccelerator) {
- keyStrokes.add(SWTKeySupport
- .convertAcceleratorToKeyStroke(secondAccelerator));
- }
-
- final int thirdAccelerator = SWTKeySupport
- .convertEventToModifiedAccelerator(event);
- if ((thirdAccelerator != secondAccelerator)
- && (thirdAccelerator != firstAccelerator)) {
- keyStrokes.add(SWTKeySupport
- .convertAcceleratorToKeyStroke(thirdAccelerator));
- }
-
- return keyStrokes;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ModifyCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ModifyCommand.java
deleted file mode 100644
index a45dcb5..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ModifyCommand.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.*;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
-
-public class ModifyCommand extends MacroCommand {
- public static final String TYPE = "modify";
-
- private String text;
-
- public ModifyCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public String getType() {
- return TYPE;
- }
-
- public boolean mergeEvent(Event e) {
- return doProcessEvent(e);
- }
-
- public void processEvent(Event e) {
- doProcessEvent(e);
- }
-
- protected void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
-
- NodeList children = node.getChildNodes();
- for (int i=0; i<children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType()==Node.TEXT_NODE) {
- text = MacroUtil.getNormalizedText(child.getNodeValue());
- break;
- }
- }
- }
-
- private boolean doProcessEvent(Event e) {
- String text = extractText(e.widget);
- if (text != null) {
- this.text = text;
- return true;
- }
- return false;
- }
-
- private String extractText(Widget widget) {
- if (widget instanceof Text)
- return ((Text) widget).getText();
- if (widget instanceof Combo)
- return ((Combo) widget).getText();
- if (widget instanceof CCombo)
- return ((CCombo) widget).getText();
- if (widget instanceof StyledText)
- return MacroUtil.getWritableText(((StyledText) widget).getText());
- return null;
- }
-
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\" contextId=\"");
- writer.print(getWidgetId().getContextId());
- writer.print("\" widgetId=\"");
- writer.print(getWidgetId().getWidgetId());
- writer.println("\">");
- if (text != null) {
- writer.print(indent);
- writer.print(text);
- writer.println();
- }
- writer.print(indent);
- writer.println("</command>");
- }
-
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- if (parent.isDisposed()) return false;
- CommandTarget target = MacroUtil.locateCommandTarget(parent,
- getWidgetId(), getStartLine());
- if (target != null) {
- target.setFocus();
- Widget widget = target.getWidget();
- if (widget instanceof Text)
- ((Text) widget).setText(text);
- else if (widget instanceof Combo)
- ((Combo) widget).setText(text);
- else if (widget instanceof CCombo)
- ((CCombo) widget).setText(text);
- else if (widget instanceof StyledText)
- ((StyledText)widget).setText(text);
- }
- return true;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/StructuredSelectionCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/StructuredSelectionCommand.java
deleted file mode 100644
index e9431fb..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/StructuredSelectionCommand.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.widgets.*;
-
-public class StructuredSelectionCommand extends AbstractStructuredCommand {
- private String type;
- public static final String DEFAULT_SELECT="default-select";
- public static final String ITEM_SELECT="item-select";
-
- public StructuredSelectionCommand(WidgetIdentifier wid, String type) {
- super(wid);
- items = new ArrayList();
- this.type = type;
- }
-
- public boolean mergeEvent(Event e) {
- if (e.type==SWT.DefaultSelection) {
- this.type = DEFAULT_SELECT;
- }
- return super.mergeEvent(e);
- }
-
- public String getType() {
- return type;
- }
-
- protected Widget[] getItemsForEvent(Event event) {
- if (event.widget instanceof Tree) {
- return ((Tree)event.widget).getSelection();
- }
- else if (event.widget instanceof Table) {
- return ((Table)event.widget).getSelection();
- }
- else if (event.widget instanceof TableTree) {
- return ((TableTree)event.widget).getSelection();
- }
- return super.getItemsForEvent(event);
- }
-
- protected void playTreeCommand(Tree tree, TreeItem[] matches) {
- tree.setSelection(matches);
- fireEvent(tree, matches);
- }
-
- private void fireEvent(Widget widget, Widget [] items) {
- Event e = new Event();
- e.widget = widget;
- e.type = type.equals(ITEM_SELECT)?SWT.Selection:SWT.DefaultSelection;
- e.item = items.length>0?items[0]:null;
- widget.notifyListeners(e.type, e);
- }
-
- protected void playTableCommand(Table table, TableItem[] matches) {
- table.setSelection(matches);
- fireEvent(table, matches);
- }
-
- protected void playTableTreeCommand(TableTree tableTree, TableTreeItem [] matches) {
- tableTree.setSelection(matches);
- fireEvent(tableTree, matches);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ToggleStructuredCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ToggleStructuredCommand.java
deleted file mode 100644
index 6ac1bc1..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ToggleStructuredCommand.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.PrintWriter;
-import java.util.Hashtable;
-
-import org.eclipse.swt.widgets.Event;
-import org.w3c.dom.Node;
-
-public abstract class ToggleStructuredCommand extends AbstractStructuredCommand {
- protected boolean value;
-
- /**
- * @param wid
- */
- public ToggleStructuredCommand(WidgetIdentifier wid) {
- super(wid);
- }
-
- public boolean mergeEvent(Event e) {
- return false;
- }
-
- protected void load(Node node, Hashtable lineTable) {
- super.load(node, lineTable);
- String att = MacroUtil.getAttribute(node, "value");
- this.value = att!=null && att.equals("true");
- }
-
- protected void writeAdditionalAttributes(PrintWriter writer) {
- writer.print(" value=\"");
- writer.print(value?"true":"false");
- writer.print("\"");
- }
-
- public boolean getValue() {
- return value;
- }
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ViewCommandTarget.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ViewCommandTarget.java
deleted file mode 100644
index 579fcb8..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/ViewCommandTarget.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.*;
-import org.eclipse.ui.IViewPart;
-
-public class ViewCommandTarget extends CommandTarget {
- public ViewCommandTarget(Widget widget, IViewPart view) {
- super(widget, view);
- }
-
- public IViewPart getView() {
- return (IViewPart)getContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.CommandTarget#ensureVisible()
- */
- public void ensureVisible() {
- IViewPart view = getView();
- IWorkbenchPage page = view.getViewSite().getPage();
- page.activate(view);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WaitCommand.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WaitCommand.java
deleted file mode 100644
index 1d09569..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WaitCommand.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.*;
-import org.eclipse.swt.widgets.*;
-
-public class WaitCommand extends MacroCommand {
- public static final String TYPE = "wait";
- private static final WidgetIdentifier nullIdentifier = new WidgetIdentifier(new Path(""), new Path(""));
-
- private static class JobListener extends JobChangeAdapter {
- private int counter=0;
- private IProgressMonitor monitor;
- private Thread t;
-
- public JobListener(IProgressMonitor monitor, Thread t, int number) {
- this.counter = number;
- this.monitor = monitor;
- this.t = t;
- }
- private synchronized void change(int increment) {
- this.counter += increment;
- if (counter==0) {
- monitor.subTask("");
- synchronized (t) {
- t.interrupt();
- }
- }
- }
- public void running(IJobChangeEvent event) {
- Job job = event.getJob();
- if (!job.isSystem())
- change(1);
- }
- public void done(IJobChangeEvent event) {
- Job job = event.getJob();
- if (!job.isSystem())
- change(-1);
- }
- }
-
- public WaitCommand() {
- super(nullIdentifier);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.macro.MacroCommand#getType()
- */
- public String getType() {
- return TYPE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.macro.MacroCommand#processEvent(org.eclipse.swt.widgets.Event)
- */
- public void processEvent(Event e) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.macro.IWritable#write(java.lang.String,
- * java.io.PrintWriter)
- */
- public void write(String indent, PrintWriter writer) {
- writer.print(indent);
- writer.print("<command type=\"");
- writer.print(getType());
- writer.print("\"");
- writer.println("/>");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.macro.IPlayable#playback(org.eclipse.swt.widgets.Composite)
- */
- public boolean playback(Display display, Composite parent, IProgressMonitor monitor) throws CoreException {
- if (parent.isDisposed())
- return false;
- IJobManager jobManager = Platform.getJobManager();
- int nrunning = getNumberOfRunningJobs(jobManager);
- if (nrunning==0) return true;
- String message = "Waiting for the background jobs...";
- JobListener listener = new JobListener(monitor, Thread.currentThread(), nrunning);
- jobManager.addJobChangeListener(listener);
- monitor.subTask(message);
- try {
- Thread.sleep(30000);
- }
- catch (InterruptedException e) {
- }
- jobManager.removeJobChangeListener(listener);
- return true;
- }
- private int getNumberOfRunningJobs(IJobManager manager) {
- int count = 0;
- Job[] jobs = manager.find(null);
- for (int i=0; i<jobs.length; i++) {
- if (!jobs[i].isSystem() && jobs[i].getState()==Job.RUNNING)
- count++;
- }
- return count;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WidgetIdentifier.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WidgetIdentifier.java
deleted file mode 100644
index 00a43bb..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WidgetIdentifier.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.core.runtime.IPath;
-
-public class WidgetIdentifier {
- public IPath contextPath;
- public IPath widgetPath;
-
- public WidgetIdentifier(IPath contextPath, IPath widgetPath) {
- this.contextPath = contextPath;
- this.widgetPath = widgetPath;
- }
-
- public String getContextId() {
- return contextPath.toString();
- }
- public String getWidgetId() {
- return widgetPath.toString();
- }
- public IPath getFullyQualifiedPath() {
- return contextPath.append(widgetPath);
- }
- public String getFullyQualifiedId() {
- return getFullyQualifiedPath().toString();
- }
- public boolean equals(Object obj) {
- if (obj==null) return false;
- if (obj==this) return true;
- if (obj instanceof WidgetIdentifier) {
- WidgetIdentifier wid = (WidgetIdentifier)obj;
- return wid.contextPath.equals(contextPath) && wid.widgetPath.equals(widgetPath);
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WindowCommandTarget.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WindowCommandTarget.java
deleted file mode 100644
index 901fc78..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WindowCommandTarget.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Widget;
-
-public class WindowCommandTarget extends CommandTarget {
- /**
- * @param widget
- * @param context
- */
- public WindowCommandTarget(Widget widget, Window window) {
- super(widget, window);
- }
-
- Window getWindow() {
- return (Window)getContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.macro.CommandTarget#ensureVisible()
- */
- public void ensureVisible() {
- Window window = getWindow();
- window.getShell().setActive();
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WizardCommandTarget.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WizardCommandTarget.java
deleted file mode 100644
index 3da23df..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/WizardCommandTarget.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Widget;
-
-public class WizardCommandTarget extends WindowCommandTarget {
- /**
- * @param widget
- * @param window
- */
- public WizardCommandTarget(Widget widget, Window window) {
- super(widget, window);
- }
-
- public WizardDialog getWizardDialog() {
- return (WizardDialog)getWindow();
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/XMLDefaultHandler.java b/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/XMLDefaultHandler.java
deleted file mode 100644
index 395e887..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro Manager/org/eclipse/pde/internal/ui/tests/macro/XMLDefaultHandler.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.util.*;
-
-import javax.xml.parsers.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-public class XMLDefaultHandler extends DefaultHandler {
-
- private org.w3c.dom.Document fDocument;
-
- private Locator fLocator;
-
- private Hashtable fLineTable;
-
- private Element fRootElement;
-
- private Stack fElementStack = new Stack();
-
- public XMLDefaultHandler() {
- fLineTable = new Hashtable();
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- Element element = fDocument.createElement(qName);
- for (int i = 0; i < attributes.getLength(); i++) {
- element
- .setAttribute(attributes.getQName(i), attributes
- .getValue(i));
- }
-
- Integer lineNumber = new Integer(fLocator.getLineNumber());
- Integer[] range = new Integer[] { lineNumber, new Integer(-1) };
- fLineTable.put(element, range);
- if (fRootElement == null)
- fRootElement = element;
- else
- ((Element) fElementStack.peek()).appendChild(element);
- fElementStack.push(element);
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- Integer[] range = (Integer[]) fLineTable.get(fElementStack.pop());
- range[1] = new Integer(fLocator.getLineNumber());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- fLocator = locator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- fDocument = factory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException e) {
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- fDocument.appendChild(fRootElement);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#processingInstruction(java.lang.String,
- * java.lang.String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException {
- fDocument.appendChild(fDocument.createProcessingInstruction(target,
- data));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
- */
- public void characters(char[] characters, int start, int length)
- throws SAXException {
- StringBuffer buff = new StringBuffer();
- for (int i = 0; i < length; i++) {
- buff.append(characters[start + i]);
- }
- Text text = fDocument.createTextNode(buff.toString());
- if (fRootElement == null)
- fDocument.appendChild(text);
- else
- ((Element) fElementStack.peek()).appendChild(text);
- }
-
- public Node getDocumentElement() {
- fDocument.getDocumentElement().normalize();
- return fDocument.getDocumentElement();
- }
-
- public org.w3c.dom.Document getDocument() {
- fDocument.getDocumentElement().normalize();
- return fDocument;
- }
-
- public Hashtable getLineTable() {
- return fLineTable;
- }
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultIndexHandler.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultIndexHandler.java
deleted file mode 100644
index 212a8e3..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultIndexHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-
-public class DefaultIndexHandler implements IIndexHandler {
-
- public DefaultIndexHandler() {
- }
-
- public IStatus processIndex(final Shell shell, String indexId) {
- final String message = "Index reached: "+indexId;
-
- final IStatus [] result = new IStatus[1];
-
- shell.getDisplay().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openInformation(shell, "Macro Playback", message);
- result[0] = Status.OK_STATUS;
- }
- });
- return result[0];
- }
-}
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultWidgetResolver.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultWidgetResolver.java
deleted file mode 100644
index f3190ec..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/DefaultWidgetResolver.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.pde.core.IIdentifiable;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IPluginContribution;
-
-public class DefaultWidgetResolver implements IWidgetResolver {
- public String getUniqueId(Widget widget) {
- Object data = widget.getData();
-
- // direct resolution (widget-independent)
- if (data instanceof IPluginContribution)
- return ((IPluginContribution) data).getLocalId();
-
- // widget-specific resolution
- if (widget instanceof TreeItem || widget instanceof TableItem) {
- if (data instanceof IJavaElement)
- return ((IJavaElement) data).getPath().toString();
- if (data instanceof IResource)
- return ((IResource) data).getFullPath().toString();
- if (data instanceof IClasspathContainer)
- return ((IClasspathContainer) data).getPath().toString();
- if (data instanceof IPluginModelBase)
- return ((IPluginModelBase)data).getPluginBase().getId();
- if (data instanceof IFeatureModel)
- return ((IFeatureModel)data).getFeature().getId();
- if (data instanceof IIdentifiable)
- return ((IIdentifiable)data).getId();
- }
- if (widget instanceof Button) {
- if (data instanceof Integer)
- return "ButtonId=" + ((Integer) data).intValue();
- }
- if (widget instanceof TabFolder || widget instanceof CTabFolder) {
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexAction.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexAction.java
deleted file mode 100644
index a008bda..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.pde.internal.ui.tests.macro.IRecorderListener;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-
-public class IndexAction implements IWorkbenchWindowActionDelegate, IRecorderListener {
- private IAction action;
- /**
- * The constructor.
- */
- public IndexAction() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.addRecorderListener(this);
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- this.action = action;
- if (!recorder.isRecording()) {
- action.setEnabled(false);
- return;
- }
- RecordBlock.getInstance().insertIndex();
- }
-
- /**
- * Selection in the workbench has been changed. We
- * can change the state of the 'real' action here
- * if we want, but this can only happen after
- * the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- public void recordingStarted() {
- if (action!=null)
- action.setEnabled(true);
- }
-
- public void recordingStopped() {
- if (action!=null)
- action.setEnabled(false);
- }
-
- public void recordingInterrupted(int type) {
- }
-
- /**
- * We can use this method to dispose of any system
- * resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.removeRecorderListener(this);
- RecordBlock.dispose();
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- RecordBlock.init(window);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexPage.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexPage.java
deleted file mode 100644
index 38947b9..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexPage.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class IndexPage extends WizardPage {
- private String indexId;
- private Text text;
- private TableViewer tableViewer;
- private String [] existingIndices;
-
- class ExistingProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- return existingIndices;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- public IndexPage(String [] existingIndices) {
- super("index");
- setTitle("Script index");
- setDescription("Enter a unique id for the script index. The index will be processed by index handled during execution of the script.");
- this.existingIndices = existingIndices;
- }
-
- public void createControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- container.setLayout(layout);
- Label label = new Label(container, SWT.NULL);
- label.setText("&Index identifier:");
- text = new Text(container, SWT.SINGLE|SWT.BORDER);
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateStatus();
- }
- });
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- label = new Label(container, SWT.NULL);
- label.setText("&Existing indices:");
- tableViewer = new TableViewer(container, SWT.BORDER);
- tableViewer.setContentProvider(new ExistingProvider());
- tableViewer.setInput(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- Object obj = sel.getFirstElement();
- if (obj!=null)
- text.setText(obj.toString());
- }
- });
- setPageComplete(false);
- setControl(container);
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible)
- text.setFocus();
- }
-
- private void updateStatus() {
- String id = text.getText();
- String errorMessage=null;
- if (id.length()==0) {
- errorMessage = "Index id cannot be empty.";
- }
- else {
- boolean exists=false;
- for (int i=0; i<existingIndices.length; i++) {
- if (id.equals(existingIndices[i])) {
- exists=true;
- break;
- }
- }
- if (exists)
- errorMessage="Index id already exists.";
- }
- setErrorMessage(errorMessage);
- setPageComplete(errorMessage==null);
- if (errorMessage==null)
- this.indexId = id;
- }
-
- public String getIndexId() {
- return indexId;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexWizard.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexWizard.java
deleted file mode 100644
index 3039d1c..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/IndexWizard.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-
-
-public class IndexWizard extends Wizard {
- private IndexPage page;
- private MacroManager macroManager;
-
- public IndexWizard(MacroManager manager) {
- this.macroManager = manager;
- setWindowTitle("Macro Recorder");
- }
-
- public void addPages() {
- page = new IndexPage(macroManager.getExistingIndices());
- addPage(page);
- }
-
- public boolean performFinish() {
- String indexId = page.getIndexId();
- if (indexId!=null) {
- macroManager.addIndex(indexId);
- }
- return true;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/NewMacroWizard.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/NewMacroWizard.java
deleted file mode 100644
index 7885a8b..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/NewMacroWizard.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.*;
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.*;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-public class NewMacroWizard extends Wizard {
- private String contents;
- private NewMacroPage page;
-
- class NewMacroPage extends WizardNewFileCreationPage {
- public NewMacroPage(IStructuredSelection ssel) {
- super("newFile", ssel);
- setTitle("Macro script name");
- setDescription("Select the target location and the name of the new script (extension *.emc).");
- }
- public InputStream getInitialContents() {
- InputStream is=null;
- try {
- is = new ByteArrayInputStream(contents.getBytes("UTF8"));
- }
- catch (UnsupportedEncodingException e) {
- }
- return is;
- }
- }
-
- public NewMacroWizard(String contents) {
- this.contents = contents;
- setWindowTitle("Macro Recorder");
- }
-
- public void addPages() {
- ISelectionService sservice = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
- ISelection selection = sservice.getSelection();
- IStructuredSelection ssel;
- if (!(selection instanceof IStructuredSelection))
- ssel = new StructuredSelection();
- else
- ssel = (IStructuredSelection)selection;
-
- page = new NewMacroPage(ssel);
- addPage(page);
- }
- public boolean performFinish() {
- IFile file = page.createNewFile();
- return file!=null;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/PlaybackAction.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/PlaybackAction.java
deleted file mode 100644
index d0d08b4..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/PlaybackAction.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Our sample action implements workbench action delegate.
- * The action proxy will be created by the workbench and
- * shown in the UI. When the user tries to use the action,
- * this delegate will be created and execution will be
- * delegated to it.
- * @see IWorkbenchWindowActionDelegate
- */
-public class PlaybackAction implements IWorkbenchWindowActionDelegate {
- private IWorkbenchWindow window;
- /**
- * The constructor.
- */
- public PlaybackAction() {
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ssel = (IStructuredSelection)selection;
- Object el = ssel.getFirstElement();
- if (el instanceof IFile) {
- action.setEnabled(false);
- runFile((IFile)el);
- action.setEnabled(true);
- }
- }
- }
-
- private void runFile(IFile file) {
- try {
- InputStream is = file.getContents();
- MacroManager mng = MacroPlugin.getDefault().getMacroManager();
- mng.setIndexHandler(new DefaultIndexHandler());
- mng.play(window.getShell().getDisplay(), window, file.getName(), is);
- mng.setIndexHandler(null);
- }
- catch (CoreException e) {
- MacroPlugin.logException(e);
- }
- }
-
- /**
- * Selection in the workbench has been changed. We
- * can change the state of the 'real' action here
- * if we want, but this can only happen after
- * the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * We can use this method to dispose of any system
- * resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- this.window = window;
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordAction.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordAction.java
deleted file mode 100644
index 4e37cd7..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.pde.internal.ui.tests.macro.IRecorderListener;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Our sample action implements workbench action delegate.
- * The action proxy will be created by the workbench and
- * shown in the UI. When the user tries to use the action,
- * this delegate will be created and execution will be
- * delegated to it.
- * @see IWorkbenchWindowActionDelegate
- */
-public class RecordAction implements IWorkbenchWindowActionDelegate, IRecorderListener {
- private IAction action;
-
- /**
- * The constructor.
- */
- public RecordAction() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.addRecorderListener(this);
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- this.action = action;
- if (recorder.isRecording()) {
- action.setEnabled(false);
- return;
- }
- RecordBlock.getInstance().startRecording();
- }
-
- /**
- * Selection in the workbench has been changed. We
- * can change the state of the 'real' action here
- * if we want, but this can only happen after
- * the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * We can use this method to dispose of any system
- * resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.removeRecorderListener(this);
- RecordBlock.dispose();
- }
-
- public void recordingStarted() {
- this.action.setEnabled(false);
- }
-
- public void recordingStopped() {
- this.action.setEnabled(true);
- }
-
- public void recordingInterrupted(int type) {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- RecordBlock.init(window);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordBlock.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordBlock.java
deleted file mode 100644
index d037297..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/RecordBlock.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.pde.internal.ui.tests.macro.IRecorderListener;
-import org.eclipse.pde.internal.ui.tests.macro.Macro;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class RecordBlock implements IRecorderListener {
- private IWorkbenchWindow window;
- private static RecordBlock instance;
-
- private RecordBlock() {
- }
-
- public static RecordBlock getInstance() {
- if (instance==null) {
- instance = new RecordBlock();
- }
- return instance;
- }
-
- public static void init(IWorkbenchWindow window) {
- if (instance==null) {
- getInstance().internalInit(window);
- }
- }
-
- private void internalInit(IWorkbenchWindow window) {
- this.window = window;
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.addRecorderListener(this);
- }
-
- public static void dispose() {
- if (instance!=null) {
- instance.internalDispose();
- instance=null;
- }
- }
-
- private void internalDispose() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.removeRecorderListener(this);
- }
-
- public void startRecording() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.startRecording();
- }
-
- public void stopRecording() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- Macro macro = recorder.stopRecording();
- StringWriter swriter = new StringWriter();
- PrintWriter pwriter = new PrintWriter(swriter);
- macro.write("", pwriter);
- pwriter.close();
- try {
- swriter.close();
- }
- catch (IOException e) {
- System.out.println(e);
- }
- String contents = swriter.toString();
- NewMacroWizard wizard = new NewMacroWizard(contents);
- WizardDialog wd = new WizardDialog(window.getShell(), wizard);
- wd.setMinimumPageSize(500, 500);
- wd.open();
- }
-
- public void recordingStarted() {
- }
-
- public void recordingStopped() {
- }
-
- public void recordingInterrupted(int interruptType) {
- if (interruptType==STOP)
- stopRecording();
- else if (interruptType==INDEX)
- insertIndex();
- }
-
- public void insertIndex() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- IndexWizard wizard = new IndexWizard(recorder);
- WizardDialog wd = new WizardDialog(window.getShell(), wizard);
- //wd.setMinimumPageSize(300, 400);
- wd.create();
- wd.getShell().setData(MacroManager.IGNORE, Boolean.TRUE);
- wd.getShell().setSize(300, 400);
- wd.open();
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/StopAction.java b/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/StopAction.java
deleted file mode 100644
index 68f5ac5..0000000
--- a/ui/org.eclipse.pde.ui.tests/Macro UI/org/eclipse/pde/internal/ui/tests/macro/StopAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.tests.macro;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.pde.internal.ui.tests.macro.IRecorderListener;
-import org.eclipse.pde.internal.ui.tests.macro.MacroManager;
-import org.eclipse.pde.internal.ui.tests.macro.MacroPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-
-public class StopAction implements IWorkbenchWindowActionDelegate, IRecorderListener {
- private IAction action;
- /**
- * The constructor.
- */
- public StopAction() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.addRecorderListener(this);
- }
-
- /**
- * The action has been activated. The argument of the
- * method represents the 'real' action sitting
- * in the workbench UI.
- * @see IWorkbenchWindowActionDelegate#run
- */
- public void run(IAction action) {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- this.action = action;
- if (!recorder.isRecording()) {
- action.setEnabled(false);
- return;
- }
- RecordBlock.getInstance().stopRecording();
- }
-
- /**
- * Selection in the workbench has been changed. We
- * can change the state of the 'real' action here
- * if we want, but this can only happen after
- * the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- public void recordingStarted() {
- if (action!=null)
- action.setEnabled(true);
- }
-
- public void recordingStopped() {
- if (action!=null)
- action.setEnabled(false);
- }
-
- public void recordingInterrupted(int type) {
- }
-
- /**
- * We can use this method to dispose of any system
- * resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- recorder.removeRecorderListener(this);
- RecordBlock.dispose();
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- RecordBlock.init(window);
- }
-}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/about.html b/ui/org.eclipse.pde.ui.tests/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/ui/org.eclipse.pde.ui.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/build.properties b/ui/org.eclipse.pde.ui.tests/build.properties
deleted file mode 100644
index 39cbf10..0000000
--- a/ui/org.eclipse.pde.ui.tests/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-source.tests.jar = src/,\
- Macro Manager/,\
- Macro UI/
-output.tests.jar = bin/
-bin.includes = tests.jar,\
- plugin.xml,\
- test.xml,\
- about.html,\
- scripts/,\
- schema/,\
- icons/,\
- META-INF/
diff --git a/ui/org.eclipse.pde.ui.tests/icons/external_tools.gif b/ui/org.eclipse.pde.ui.tests/icons/external_tools.gif
deleted file mode 100644
index b05bf3e..0000000
--- a/ui/org.eclipse.pde.ui.tests/icons/external_tools.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.ui.tests/icons/run_exc.gif b/ui/org.eclipse.pde.ui.tests/icons/run_exc.gif
deleted file mode 100644
index 57f4102..0000000
--- a/ui/org.eclipse.pde.ui.tests/icons/run_exc.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.ui.tests/icons/sample.gif b/ui/org.eclipse.pde.ui.tests/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/ui/org.eclipse.pde.ui.tests/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.ui.tests/icons/suspend_co.gif b/ui/org.eclipse.pde.ui.tests/icons/suspend_co.gif
deleted file mode 100644
index 161e3f5..0000000
--- a/ui/org.eclipse.pde.ui.tests/icons/suspend_co.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.ui.tests/icons/terminate_co.gif b/ui/org.eclipse.pde.ui.tests/icons/terminate_co.gif
deleted file mode 100644
index dc47edf..0000000
--- a/ui/org.eclipse.pde.ui.tests/icons/terminate_co.gif
+++ /dev/null
Binary files differ
diff --git a/ui/org.eclipse.pde.ui.tests/plugin.xml b/ui/org.eclipse.pde.ui.tests/plugin.xml
deleted file mode 100644
index 20b60c8..0000000
--- a/ui/org.eclipse.pde.ui.tests/plugin.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="macroSupport" name="Macro Support" schema="schema/macroSupport.exsd"/>
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="Sample Action Set"
- visible="true"
- id="org.eclipse.ui.macro.actionSet">
- <menu
- label="&Macros..."
- path="window/additions"
- id="macro">
- <separator name="group1"/>
- </menu>
- <action
- toolbarPath="sampleGroup"
- label="&Start Recording"
- class="org.eclipse.pde.internal.ui.tests.macro.RecordAction"
- tooltip="Start Recording"
- icon="icons/external_tools.gif"
- menubarPath="window/macro/group1"
- id="org.eclipse.pde.ui.tests.RecordAction"/>
- <action
- class="org.eclipse.pde.internal.ui.tests.macro.IndexAction"
- definitionId="org.eclipse.pde.ui.tests.index"
- icon="icons/suspend_co.gif"
- id="org.eclipse.pde.ui.tests.IndexAction"
- label="&Pause for Indexing"
- menubarPath="window/macro/group1"
- toolbarPath="sampleGroup"
- tooltip="Pause for Indexing"/>
- <action
- class="org.eclipse.pde.internal.ui.tests.macro.StopAction"
- definitionId="org.eclipse.pde.ui.tests.stopRecording"
- icon="icons/terminate_co.gif"
- id="org.eclipse.pde.ui.tests.StopAction"
- label="S&top Recording"
- menubarPath="window/macro/group1"
- toolbarPath="sampleGroup"
- tooltip="Stop Recording"/>
- <action
- enablesFor="1"
- toolbarPath="sampleGroup"
- label="&Playback"
- icon="icons/run_exc.gif"
- tooltip="&Run Macro"
- class="org.eclipse.pde.internal.ui.tests.macro.PlaybackAction"
- menubarPath="window/macro/group1"
- id="org.eclipse.pde.ui.tests.PlaybackAction">
- <enablement>
- <and>
- <objectClass name="org.eclipse.core.resources.IFile"/>
- <objectState name="extension" value="emc"/>
- </and>
- </enablement>
- </action>
- </actionSet>
- </extension>
- <extension
- point="org.eclipse.pde.ui.tests.macroSupport">
- <widgetResolver class="org.eclipse.pde.internal.ui.tests.macro.DefaultWidgetResolver"/>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Stops the recording of the macro"
- categoryId="org.eclipse.ui.category.window"
- name="Stop Macro Recording"
- id="org.eclipse.pde.ui.tests.stopRecording"/>
- <command
- description="Places a named index in the macro"
- categoryId="org.eclipse.ui.category.window"
- name="Index Macro"
- id="org.eclipse.pde.ui.tests.index"/>
- <keyBinding
- contextId="org.eclipse.ui.contexts.dialogAndWindow"
- commandId="org.eclipse.pde.ui.tests.stopRecording"
- keySequence="Ctrl+Shift+F11"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <keyBinding
- contextId="org.eclipse.ui.contexts.dialogAndWindow"
- commandId="org.eclipse.pde.ui.tests.index"
- keySequence="Ctrl+Shift+F10"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- </extension>
-</plugin>
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui.tests/schema/macroSupport.exsd b/ui/org.eclipse.pde.ui.tests/schema/macroSupport.exsd
deleted file mode 100644
index 0547335..0000000
--- a/ui/org.eclipse.pde.ui.tests/schema/macroSupport.exsd
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.pde.ui.tests">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.pde.ui.tests" id="macroSupport" name="Macro Support"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="widgetResolver" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="widgetResolver">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.ui.macro.IWidgetResolver"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.
-
-<br>
-
-All rights reserved. This program and the accompanying materials are made
-
-available under the terms of the Eclipse Public License v1.0 which
-
-accompanies this distribution, and is available at
-
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- </documentation>
- </annotation>
-
-</schema>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro1.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro1.emc
deleted file mode 100644
index 6c07ce3..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro1.emc
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.simple
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro10.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro10.emc
deleted file mode 100644
index 5be5b69..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro10.emc
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#10"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#10" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.osgi"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro11.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro11.emc
deleted file mode 100644
index 7fd66d7..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro11.emc
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#10" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.jface"/>
- </command>
- <command type="select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro12.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro12.emc
deleted file mode 100644
index 86b44f0..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro12.emc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.FeatureImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardPage" widgetId="org.eclipse.swt.widgets.Button#3" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Button#ButtonId=1"/>
- <command type="item-check" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Table#1" value="true">
- <item path="org.eclipse.pde"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro13.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro13.emc
deleted file mode 100644
index eb4572e..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro13.emc
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.FeatureImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardPage" widgetId="org.eclipse.swt.widgets.Button#3" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Button#ButtonId=1"/>
- <command type="item-check" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Table#1" value="true">
- <item path="org.eclipse.sdk"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro14.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro14.emc
deleted file mode 100644
index 01d0cfa..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro14.emc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.FeatureImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardPage" widgetId="org.eclipse.swt.widgets.Button#1" selection="true"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardPage" widgetId="org.eclipse.swt.widgets.Button#3" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Button#ButtonId=1"/>
- <command type="item-check" contextId="wizard-page/FeatureImportWizardDetailedPage" widgetId="org.eclipse.swt.widgets.Table#1" value="true">
- <item path="org.eclipse.pde"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro15.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro15.emc
deleted file mode 100644
index c21755e..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro15.emc
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewFeatureProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- com.example.test.feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.0
- </command>
- <command type="focus" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- Test Feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.1
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#4">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.featureEditor/feature.xml" widgetId="org.eclipse.ui.forms.widgets.Form#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro16.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro16.emc
deleted file mode 100644
index 1b333ff..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro16.emc
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewFeatureProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- com.example.test.feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.0
- </command>
- <command type="focus" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- Test Feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.1
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#4">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Button#1" selection="true"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#5">
- handler.jar
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.featureEditor/feature.xml" widgetId="org.eclipse.ui.forms.widgets.Form#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro17.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro17.emc
deleted file mode 100644
index 6f8f521..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro17.emc
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewFeatureProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- com.example.test.feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.0
- </command>
- <command type="focus" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Table#1"/>
- <command type="select" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Button#ButtonId=1"/>
- <command type="item-check" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Table#1" value="true">
- <item path="org.eclipse.pde.ui"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.featureEditor/feature.xml" widgetId="org.eclipse.ui.forms.widgets.Form#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro18.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro18.emc
deleted file mode 100644
index 2a01f4b..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro18.emc
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.plugin
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewFeatureProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.test.feature
- </command>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#2">
- com.example.test.feature
- </command>
- <command type="modify" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#3">
- 1.0.0
- </command>
- <command type="focus" contextId="wizard-page/specPage" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Table#1"/>
- <command type="select" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Button#ButtonId=1"/>
- <command type="item-check" contextId="wizard-page/pluginListPage" widgetId="org.eclipse.swt.widgets.Table#1" value="true">
- <item path="com.example.test.plugin"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.featureEditor/feature.xml" widgetId="org.eclipse.ui.forms.widgets.Form#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro19.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro19.emc
deleted file mode 100644
index 89ddece..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro19.emc
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro2.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro2.emc
deleted file mode 100644
index f69e319..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro2.emc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.simple
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="false"/>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#5" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro20.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro20.emc
deleted file mode 100644
index 7f19b40..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro20.emc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#5" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro21.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro21.emc
deleted file mode 100644
index cfec7f8..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro21.emc
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- src/abc
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro22.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro22.emc
deleted file mode 100644
index 87afd92..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro22.emc
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#4">
- bin/abc
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro23.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro23.emc
deleted file mode 100644
index 7c3be33..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro23.emc
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="modify" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Text#5">
- .
- </command>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#1" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="wait"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro24.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro24.emc
deleted file mode 100644
index 05e93a8..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro24.emc
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro25.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro25.emc
deleted file mode 100644
index 1e643fc..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro25.emc
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="default-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewProjectWizard"/>
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/page2" widgetId="org.eclipse.swt.widgets.Button#2" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="focus" contextId="editor/org.eclipse.pde.ui.manifestEditor/MANIFEST.MF" widgetId="org.eclipse.swt.widgets.Text#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribid/close">
- <parent widgetId="file"/>
- </command>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro26.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro26.emc
deleted file mode 100644
index fe61f81..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro26.emc
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="false">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewLibraryPluginProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <shell id="org.eclipse.ui.dialogs.ElementTreeSelectionDialog" return-code="0">
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-expand" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui/pdeuiant.jar"/>
- </command>
- <command type="select" contextId="shell" widgetId="org.eclipse.swt.widgets.Button#ButtonId=0"/>
- </shell>
- <command type="focus" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#4">
- 1.0.1
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#6">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="false"/>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#4" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro27.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro27.emc
deleted file mode 100644
index 7c0d61b..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro27.emc
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="false">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewLibraryPluginProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <shell id="org.eclipse.ui.dialogs.ElementTreeSelectionDialog" return-code="0">
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-expand" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui/pdeuiant.jar"/>
- </command>
- <command type="select" contextId="shell" widgetId="org.eclipse.swt.widgets.Button#ButtonId=0"/>
- </shell>
- <command type="focus" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#4">
- 1.0.1
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#6">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="true"/>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#4" selection="false"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro28.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro28.emc
deleted file mode 100644
index 54a394d..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro28.emc
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="false">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewLibraryPluginProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <shell id="org.eclipse.ui.dialogs.ElementTreeSelectionDialog" return-code="0">
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-expand" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui/pdeuiant.jar"/>
- </command>
- <command type="select" contextId="shell" widgetId="org.eclipse.swt.widgets.Button#ButtonId=0"/>
- </shell>
- <command type="focus" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#4">
- 1.0.1
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#6">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="false"/>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#4" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro29.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro29.emc
deleted file mode 100644
index 875660b..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro29.emc
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="select" contextId="menus" widgetId="contribclass/org.eclipse.ui.actions.NewWizardMenu">
- <parent widgetId="file"/>
- <parent widgetId="new"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.jdt.ui.wizards.JavaProjectWizard"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="false">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-expand" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.PDE"/>
- </command>
- <command type="item-select" contextId="wizard-page/newWizardSelectionPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.NewLibraryPluginProjectWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="select" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <shell id="org.eclipse.ui.dialogs.ElementTreeSelectionDialog" return-code="0">
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-expand" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="/org.eclipse.pde.ui"/>
- </command>
- <command type="item-select" contextId="shell" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="/org.eclipse.pde.ui/pdeuiant.jar"/>
- </command>
- <command type="select" contextId="shell" widgetId="org.eclipse.swt.widgets.Button#ButtonId=0"/>
- </shell>
- <command type="focus" contextId="wizard-page/jars" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#1">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3">
- com.example.xyz
- </command>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5">
- Xyz Plug-in
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#3"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#4">
- 1.0.1
- </command>
- <command type="focus" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#5"/>
- <command type="modify" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Text#6">
- Eclipse.org
- </command>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#3" selection="true"/>
- <command type="select" contextId="wizard-page/main" widgetId="org.eclipse.swt.widgets.Button#4" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- <command type="wait"/>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro3.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro3.emc
deleted file mode 100644
index d34ec05..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro3.emc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="default-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.core.filebuffers"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro4.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro4.emc
deleted file mode 100644
index 3aaca15..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro4.emc
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="default-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#9" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.osgi"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro5.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro5.emc
deleted file mode 100644
index 8788e5b..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro5.emc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.jface"/>
- </command>
- <command type="select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro6.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro6.emc
deleted file mode 100644
index a2a41bb..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro6.emc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="item-expand" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.ui.PluginDevelopment"/>
- </command>
- <command type="default-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.core.filebuffers"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro7.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro7.emc
deleted file mode 100644
index 5aa8f5c..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro7.emc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="item-expand" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1" value="true">
- <item path="org.eclipse.pde.ui.PluginDevelopment"/>
- </command>
- <command type="default-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.osgi"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro8.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro8.emc
deleted file mode 100644
index e4ea211..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro8.emc
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="default-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Tree#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.jface"/>
- </command>
- <command type="select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Button#8"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/scripts/macro9.emc b/ui/org.eclipse.pde.ui.tests/scripts/macro9.emc
deleted file mode 100644
index a20936e..0000000
--- a/ui/org.eclipse.pde.ui.tests/scripts/macro9.emc
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<macro version="0.1">
- <shell id="org.eclipse.ui.internal.WorkbenchWindow" return-code="0">
- <command type="select" contextId="menus" widgetId="contribid/importExport">
- <parent widgetId="file"/>
- </command>
- <shell id="org.eclipse.jface.wizard.WizardDialog" return-code="0">
- <command type="focus" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1"/>
- <command type="choice-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.TabFolder#1" choiceId="item#0"/>
- <command type="item-select" contextId="wizard-page/importExportPage" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.pde.ui.PluginImportWizard"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#1"/>
- <command type="focus" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#10"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#8" selection="false"/>
- <command type="select" contextId="wizard-page/first" widgetId="org.eclipse.swt.widgets.Button#10" selection="true"/>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=15"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=14"/>
- <command type="default-select" contextId="wizard-page/detailed" widgetId="org.eclipse.swt.widgets.Table#1">
- <item path="org.eclipse.core.filebuffers"/>
- </command>
- <command type="select" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- <command type="wait"/>
- <command type="focus" contextId="wizard" widgetId="org.eclipse.swt.widgets.Button#ButtonId=16"/>
- </shell>
- <command type="focus" contextId="view/org.eclipse.jdt.ui.PackageExplorer" widgetId="org.eclipse.swt.widgets.Tree#1"/>
- </shell>
-</macro>
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java
deleted file mode 100644
index 36bc5f9..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests;
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllPDETests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test Suite for org.eclipse.pde.ui"); //$NON-NLS-1$
- //suite.addTest(AllNewProjectTests.suite());
- //suite.addTest(AllNewFeatureProjectTests.suite());
- //suite.addTest(AllImportTests.suite());
- //suite.addTest(NewSiteProjectTest.suite());
- return suite;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/Catalog.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/Catalog.java
deleted file mode 100644
index b2fabb6..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/Catalog.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests;
-
-public class Catalog {
-
- public static final String SIMPLE_PLUGIN_1 = "macro1.emc";
- public static final String SIMPLE_PLUGIN_2 = "macro2.emc";
- public static final String IMPORT_LINKS_1 = "macro3.emc";
- public static final String IMPORT_LINKS_2 = "macro4.emc";
- public static final String IMPORT_LINKS_3 = "macro5.emc";
- public static final String IMPORT_BINARY_1 = "macro6.emc";
- public static final String IMPORT_BINARY_2 = "macro7.emc";
- public static final String IMPORT_BINARY_3 = "macro8.emc";
- public static final String IMPORT_SOURCE_1 = "macro9.emc";
- public static final String IMPORT_SOURCE_2 = "macro10.emc";
- public static final String IMPORT_SOURCE_3 = "macro11.emc";
- public static final String IMPORT_BINARY_FEATURE_1 = "macro12.emc";
- public static final String IMPORT_BINARY_FEATURE_2 = "macro13.emc";
- public static final String IMPORT_SOURCE_FEATURE = "macro14.emc";
- public static final String SIMPLE_FEATURE_1 = "macro15.emc";
- public static final String SIMPLE_FEATURE_2 = "macro16.emc";
- public static final String FEATURE_WITH_PLUGIN_1 = "macro17.emc";
- public static final String FEATURE_WITH_PLUGIN_2 = "macro18.emc";
- public static final String BASIC_JAVA_PLUGIN_1 = "macro19.emc";
- public static final String BASIC_JAVA_PLUGIN_2 = "macro20.emc";
- public static final String BASIC_JAVA_PLUGIN_3 = "macro21.emc";
- public static final String BASIC_JAVA_PLUGIN_4 = "macro22.emc";
- public static final String BASIC_JAVA_PLUGIN_5 = "macro23.emc";
- public static final String BASIC_JAVA_PLUGIN_6 = "macro24.emc";
- public static final String BASIC_JAVA_PLUGIN_7 = "macro25.emc";
- public static final String LIBRARY_PLUGIN_1 = "macro26.emc";
- public static final String LIBRARY_PLUGIN_2 = "macro27.emc";
- public static final String LIBRARY_PLUGIN_3 = "macro28.emc";
- public static final String LIBRARY_PLUGIN_4 = "macro29.emc";
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/PDETestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/PDETestCase.java
deleted file mode 100644
index 2a1a2ff..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/PDETestCase.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests;
-
-import java.io.*;
-import java.net.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.pde.internal.ui.*;
-import org.eclipse.pde.internal.ui.tests.macro.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.intro.*;
-
-import junit.framework.*;
-
-public abstract class PDETestCase extends TestCase {
-
- private static boolean FIRST_TEST = true;
-
- private static IWorkbench fWorkbench;
-
- protected void setUp() throws Exception {
- if (FIRST_TEST) {
- fWorkbench = PlatformUI.getWorkbench();
-
- // close intro
- IIntroManager intro = fWorkbench.getIntroManager();
- intro.closeIntro(intro.getIntro());
-
- // open PDE perspective
- fWorkbench.showPerspective(PDEPlugin.PERSPECTIVE_ID, fWorkbench.getActiveWorkbenchWindow());
-
- // set to false
- FIRST_TEST = false;
- }
- }
-
- protected void playScript(String scriptName) {
- InputStream stream = null;
- try {
- MacroManager recorder = MacroPlugin.getDefault().getMacroManager();
- URL url = Platform.getBundle("org.eclipse.pde.ui.tests").getEntry("scripts/" + scriptName);
- if (url == null)
- fail("Script \"" + scriptName + "\" could not be found");
- stream = url.openStream();
- recorder.play(fWorkbench.getDisplay(), fWorkbench.getActiveWorkbenchWindow(), scriptName, stream);
- recorder.shutdown();
- } catch (CoreException e) {
- fail("Error playing the script: \"" + scriptName + "\"");
- } catch (IOException e) {
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- protected void tearDown() {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
- try {
- for (int i = 0; i < projects.length; i++) {
- projects[i].delete(true, new NullProgressMonitor());
- }
- } catch (CoreException e) {
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/AllImportTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/AllImportTests.java
deleted file mode 100644
index 149c47a..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/AllImportTests.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.imports;
-
-import junit.framework.*;
-
-public class AllImportTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test Suite to test the plug-in and feature import wizards."); //$NON-NLS-1$
- suite.addTest(ImportWithLinksTestCase.suite());
- suite.addTest(ImportAsBinaryTestCase.suite());
- suite.addTest(ImportAsSourceTestCase.suite());
- suite.addTest(ImportFeatureTestCase.suite());
- return suite;
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsBinaryTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsBinaryTestCase.java
deleted file mode 100644
index 10dadd2..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsBinaryTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.imports;
-
-import junit.framework.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.ui.tests.*;
-
-public class ImportAsBinaryTestCase extends PDETestCase {
-
- public static Test suite() {
- return new TestSuite(ImportAsBinaryTestCase.class);
- }
-
- public void testImportBinary1() {
- playScript(Catalog.IMPORT_BINARY_1);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.core.filebuffers"));
- } catch (CoreException e) {
- fail("testImportBinary1:" + e);
- }
- }
-
- public void testImportBinary2() {
- playScript(Catalog.IMPORT_BINARY_2);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.osgi"));
- } catch (CoreException e) {
- fail("testImportBinary2:" + e);
- }
- }
-
- public void testImportBinary3() {
- playScript(Catalog.IMPORT_BINARY_3);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = root.getProjects();
- assertTrue(projects.length > 0);
- for (int i = 0; i < projects.length; i++) {
- verifyProject(projects[i]);
- }
- } catch (CoreException e) {
- fail("testImportBinary3:" + e);
- }
- }
-
- private void verifyProject(IProject project) throws CoreException {
- assertTrue("Project was not created.", project.exists());
- assertNotNull(project.getPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY));
- if (project.hasNature(JavaCore.NATURE_ID))
- assertTrue(checkSourceAttached(JavaCore.create(project)));
- }
-
- private boolean checkSourceAttached(IJavaProject jProject) throws CoreException {
- IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IClasspathEntry entry = roots[i].getRawClasspathEntry();
- if (entry.getEntryKind() != IClasspathEntry.CPE_LIBRARY
- || entry.getEntryKind() != IClasspathEntry.CPE_CONTAINER
- || !entry.getPath().equals(new Path(PDECore.CLASSPATH_CONTAINER_ID)))
- continue;
- if (roots[i].getSourceAttachmentPath() == null)
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsSourceTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsSourceTestCase.java
deleted file mode 100644
index 10c38fe..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportAsSourceTestCase.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.imports;
-
-import junit.framework.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.ui.tests.*;
-
-public class ImportAsSourceTestCase extends PDETestCase {
-
- public static Test suite() {
- return new TestSuite(ImportAsSourceTestCase.class);
- }
-
- public void testImportSource1() {
- playScript(Catalog.IMPORT_SOURCE_1);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.core.filebuffers"));
- } catch (CoreException e) {
- fail("testImportSource1:" + e);
- }
- }
-
- public void testImportSource2() {
- playScript(Catalog.IMPORT_SOURCE_2);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.osgi"));
- } catch (CoreException e) {
- fail("testImportSource2:" + e);
- }
- }
-
- public void testImportSource3() {
- playScript(Catalog.IMPORT_SOURCE_3);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = root.getProjects();
- assertTrue(projects.length > 0);
- for (int i = 0; i < projects.length; i++) {
- verifyProject(projects[i]);
- }
- } catch (CoreException e) {
- fail("testImportSource3:" + e);
- }
- }
-
- private void verifyProject(IProject project) throws CoreException {
- assertTrue("Project was not created.", project.exists());
- if (project.hasNature(JavaCore.NATURE_ID))
- assertTrue(checkSourceAttached(JavaCore.create(project)));
- }
-
- private boolean checkSourceAttached(IJavaProject jProject) throws CoreException {
- IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IClasspathEntry entry = roots[i].getRawClasspathEntry();
- if (entry.getEntryKind() != IClasspathEntry.CPE_CONTAINER
- || !entry.getPath().equals(new Path(PDECore.CLASSPATH_CONTAINER_ID)))
- continue;
- if (roots[i].getSourceAttachmentPath() == null)
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportFeatureTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportFeatureTestCase.java
deleted file mode 100644
index 8667702..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportFeatureTestCase.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.imports;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.feature.FeatureChild;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureChild;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.ui.tests.Catalog;
-import org.eclipse.pde.ui.tests.PDETestCase;
-
-public class ImportFeatureTestCase extends PDETestCase {
-
- public static Test suite() {
- return new TestSuite(ImportFeatureTestCase.class);
- }
-
- public void testImportBinaryFeature1() {
- playScript(Catalog.IMPORT_BINARY_FEATURE_1);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.pde-feature"), true);
- verifyModel("org.eclipse.pde", "org.eclipse.pde-feature");
- } catch (CoreException e) {
- fail("testImportBinaryFeature1:" + e);
- }
- }
-
- public void testImportBinaryFeature2() {
- playScript(Catalog.IMPORT_BINARY_FEATURE_2);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.sdk-feature"), true);
- verifyModel("org.eclipse.sdk", "org.eclipse.sdk-feature");
- IFeature feature = PDECore.getDefault().getFeatureModelManager()
- .findFeatureModels("org.eclipse.sdk")[0].getFeature();
- IFeatureChild[] included = feature.getIncludedFeatures();
- assertTrue("SDK feature does not include other features",
- included.length > 0);
- boolean foundPDE = false;
- for (int i = 0; i < included.length; i++) {
- IFeature inclFeature = ((FeatureChild) included[i])
- .getReferencedFeature();
- if (inclFeature != null
- && "org.eclipse.pde".equals(inclFeature.getId())) {
- foundPDE = true;
- }
- }
- assertTrue("Included feature not found.", foundPDE);
- } catch (CoreException e) {
- fail("testImportBinaryFeature2:" + e);
- }
- }
-
- public void testImportFeatureAsSource() {
- playScript(Catalog.IMPORT_SOURCE_FEATURE);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.pde-feature"), false);
- verifyModel("org.eclipse.pde", "org.eclipse.pde-feature");
- } catch (CoreException e) {
- fail("testImportFeatureAsSource:" + e);
- }
- }
-
- private void verifyProject(IProject project, boolean binary)
- throws CoreException {
- assertTrue("Project was not created.", project.exists());
- if (binary) {
- assertTrue(
- "Project not binary.",
- PDECore.BINARY_PROJECT_VALUE
- .equals(project
- .getPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY)));
- } else {
- assertFalse(
- "Project is binary.",
- PDECore.BINARY_PROJECT_VALUE
- .equals(project
- .getPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY)));
-
- }
- }
-
- private void verifyModel(String featureId, String projectName)
- throws CoreException {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager()
- .findFeatureModels(featureId);
- assertTrue("Model not found.", models.length > 0);
- IFeature feature = models[0].getFeature();
- assertTrue("Model has no feature.", feature != null);
- if (feature.getInstallHandler() == null) {
- assertFalse("Project has Java nature.", root
- .getProject(projectName).hasNature(JavaCore.NATURE_ID));
- } else {
- assertTrue("Project does not have Java nature.", root.getProject(
- projectName).hasNature(JavaCore.NATURE_ID));
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportWithLinksTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportWithLinksTestCase.java
deleted file mode 100644
index e861abf..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/ImportWithLinksTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.imports;
-
-import junit.framework.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.ui.tests.*;
-
-public class ImportWithLinksTestCase extends PDETestCase {
-
- public static Test suite() {
- return new TestSuite(ImportWithLinksTestCase.class);
- }
-
- public void testImportLinks1() {
- playScript(Catalog.IMPORT_LINKS_1);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.core.filebuffers"));
- } catch (CoreException e) {
- fail("testImportLinks1:" + e);
- }
- }
-
- public void testImportLinks2() {
- playScript(Catalog.IMPORT_LINKS_2);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- verifyProject(root.getProject("org.eclipse.osgi"));
- } catch (CoreException e) {
- fail("testImportLinks2:" + e);
- }
- }
-
- public void testImportLinks3() {
- playScript(Catalog.IMPORT_LINKS_3);
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = root.getProjects();
- assertTrue(projects.length > 0);
- for (int i = 0; i < projects.length; i++) {
- verifyProject(projects[i]);
- }
- } catch (CoreException e) {
- fail("testImportLinks3:" + e);
- }
- }
-
- private void verifyProject(IProject project) throws CoreException {
- assertTrue("Project was not created.", project.exists());
- assertTrue(WorkspaceModelManager.isBinaryPluginProject(project));
- if (project.hasNature(JavaCore.NATURE_ID))
- assertTrue(checkSourceAttached(JavaCore.create(project)));
- }
-
- private boolean checkSourceAttached(IJavaProject jProject) throws CoreException {
- IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IClasspathEntry entry = roots[i].getRawClasspathEntry();
- if (entry.getEntryKind() != IClasspathEntry.CPE_LIBRARY
- || entry.getEntryKind() != IClasspathEntry.CPE_CONTAINER
- || !entry.getPath().equals(new Path(PDECore.CLASSPATH_CONTAINER_ID)))
- continue;
- if (roots[i].getSourceAttachmentPath() == null)
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java
deleted file mode 100644
index 8b7d19b..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.performance;
-
-import org.eclipse.pde.ui.tests.performance.parts.*;
-
-import junit.framework.*;
-
-public class PDEPerformanceTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Performance Test Suite for org.eclipse.pde.ui"); //$NON-NLS-1$
- suite.addTest(OpenManifestEditorPerfTest.suite());
- suite.addTest(SchemaPerfTest.suite());
- suite.addTest(InitializeModelsPerfTest.suite());
- return suite;
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/InitializeModelsPerfTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/InitializeModelsPerfTest.java
deleted file mode 100644
index 458ca82..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/InitializeModelsPerfTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.performance.parts;
-
-import java.io.File;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.pde.internal.core.ExternalModelManager;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.PDEState;
-import org.eclipse.pde.internal.core.PluginPathFinder;
-import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.PerformanceTestCase;
-
-public class InitializeModelsPerfTest extends PerformanceTestCase {
-
- public static Test suite() {
- return new TestSuite(InitializeModelsPerfTest.class);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- deleteContent(new File(PDECore.getDefault().getStateLocation().toOSString()));
- }
-
- public void testModels() throws Exception {
- tagAsSummary("Initialize Plug-ins (no caching)", Dimension.ELAPSED_PROCESS);
- String path = ExternalModelManager.getEclipseHome().toOSString();
- startMeasuring();
- new PDEState(PluginPathFinder.getPluginPaths(path), false, new NullProgressMonitor());
- stopMeasuring();
- commitMeasurements();
- assertPerformance();
- }
-
- public void testCachedModels() throws Exception {
- tagAsGlobalSummary("Initialize Plug-ins (with caching)", Dimension.ELAPSED_PROCESS);
- String path = ExternalModelManager.getEclipseHome().toOSString();
- new PDEState(PluginPathFinder.getPluginPaths(path), true, new NullProgressMonitor());
- startMeasuring();
- new PDEState(PluginPathFinder.getPluginPaths(path), true, new NullProgressMonitor());
- stopMeasuring();
- commitMeasurements();
- assertPerformance();
- }
-
- protected void tearDown() throws Exception {
- deleteContent(new File(PDECore.getDefault().getStateLocation().toOSString()));
- }
-
- private void deleteContent(File curr) {
- if (curr.exists()) {
- if (curr.isDirectory()) {
- File[] children = curr.listFiles();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- deleteContent(children[i]);
- }
- }
- }
- curr.delete();
- }
- }
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java
deleted file mode 100644
index a6a5280..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.performance.parts;
-
-import junit.framework.*;
-
-import org.eclipse.pde.internal.ui.editor.plugin.*;
-import org.eclipse.test.performance.*;
-import org.eclipse.ui.*;
-
-public class OpenManifestEditorPerfTest extends PerformanceTestCase {
-
- public static Test suite() {
- return new TestSuite(OpenManifestEditorPerfTest.class);
- }
-
- public void testOpen() throws Exception {
- tagAsGlobalSummary("Open Plug-in Editor", Dimension.ELAPSED_PROCESS); //$NON-NLS-1$
- IWorkbenchPage page= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- for (int i = 0; i < 20; i++) {
- startMeasuring();
- ManifestEditor.openPluginEditor("org.eclipse.core.runtime"); //$NON-NLS-1$
- stopMeasuring();
- page.closeAllEditors(false);
- }
- commitMeasurements();
- assertPerformance();
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/SchemaPerfTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/SchemaPerfTest.java
deleted file mode 100644
index 09b226d..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/SchemaPerfTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.performance.parts;
-
-import junit.framework.*;
-
-import org.eclipse.pde.core.plugin.IPluginExtensionPoint;
-import org.eclipse.pde.core.plugin.IPluginModelBase;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.test.performance.*;
-
-public class SchemaPerfTest extends PerformanceTestCase {
-
- public static Test suite() {
- return new TestSuite(SchemaPerfTest.class);
- }
-
- public void testLoadAllSchemas() throws Exception {
- tagAsSummary("Loading all schemas", Dimension.ELAPSED_PROCESS);
- IPluginModelBase[] models = PDECore.getDefault().getModelManager().getAllPlugins();
- startMeasuring();
- for (int i = 0; i < models.length; i++) {
- IPluginExtensionPoint[] extPoints = models[i].getPluginBase().getExtensionPoints();
- for (int j = 0; j < extPoints.length; j++) {
- PDECore.getDefault().getSchemaRegistry().getSchema(extPoints[j].getFullId());
- }
- }
- stopMeasuring();
- commitMeasurements();
- assertPerformance();
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/NewSiteProjectTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/NewSiteProjectTest.java
deleted file mode 100644
index f877eac..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/NewSiteProjectTest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.pde.internal.PDE;
-import org.eclipse.pde.internal.core.site.WorkspaceSiteModel;
-import org.eclipse.pde.internal.ui.wizards.site.NewSiteProjectCreationOperation;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-
-public class NewSiteProjectTest extends TestCase {
- private static final String EXISTING_PROJECT_NAME = "ExistingSiteProject"; //$NON-NLS-1$
-
- public static Test suite() {
- return new TestSuite(NewSiteProjectTest.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- if ("testExistingSiteProject".equalsIgnoreCase(getName())) { //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(EXISTING_PROJECT_NAME);
- project.create(new NullProgressMonitor());
- project.open(new NullProgressMonitor());
- IFile file = project.getFile(new Path("site.xml")); //$NON-NLS-1$
- String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
- + "<site>" //$NON-NLS-1$
- + "<category-def name=\"new_category_1\" label=\"New Category 1\"/>" //$NON-NLS-1$
- + "</site>"; //$NON-NLS-1$
- ByteArrayInputStream source = new ByteArrayInputStream(content
- .getBytes("ASCII")); //$NON-NLS-1$
- if (file.exists())
- file
- .setContents(source, true, false,
- new NullProgressMonitor());
- else
- file.create(source, true, new NullProgressMonitor());
- project.delete(false, true, new NullProgressMonitor());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
- try {
- for (int i = 0; i < projects.length; i++) {
- projects[i].delete(true, new NullProgressMonitor());
- }
- } catch (CoreException e) {
- // do nothing if deletion fails. No need to fail the test.
- }
- super.tearDown();
- }
-
- private void createSite(IProject project, IPath path, String webLocation)
- throws InvocationTargetException, InterruptedException {
- NewSiteProjectCreationOperation createOperation = new NewSiteProjectCreationOperation(
- Display.getDefault(), project, path, webLocation);
- IProgressService progressService = PlatformUI.getWorkbench()
- .getProgressService();
- progressService.runInUI(progressService, createOperation, null);
- }
-
- /**
- * @param project
- */
- private void ensureCreated(IProject project) {
- assertTrue("Project not created.", project.exists()); //$NON-NLS-1$
- assertTrue("Project not open.", project.isOpen()); //$NON-NLS-1$
- try {
- assertTrue("Site nature not added.", project //$NON-NLS-1$
- .hasNature(PDE.SITE_NATURE));
- } catch (Exception e) {
- }
- assertTrue("site.xml not created.", project //$NON-NLS-1$
- .exists(new Path("site.xml"))); //$NON-NLS-1$
- WorkspaceSiteModel model = new WorkspaceSiteModel(project
- .getFile(new Path("site.xml"))); //$NON-NLS-1$
- model.load();
- assertTrue("Model cannot be loaded.", model.isLoaded()); //$NON-NLS-1$
- assertTrue("Model is not valid.", model.isValid()); //$NON-NLS-1$
- assertFalse("ISite is null.", model.getSite() == null); //$NON-NLS-1$
- model.dispose();
- }
-
- public void testExistingSiteProject() {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- EXISTING_PROJECT_NAME);
- IPath path = Platform.getLocation();
- try {
- createSite(project, path, null);
- } catch (Exception e) {
- e.printStackTrace();
- fail("testExistingSiteProject: " + e); //$NON-NLS-1$
- }
- ensureCreated(project);
- WorkspaceSiteModel model = new WorkspaceSiteModel(project
- .getFile(new Path("site.xml"))); //$NON-NLS-1$
- model.load();
- assertTrue("Existig site overwritten.", model.getSite() //$NON-NLS-1$
- .getCategoryDefinitions().length > 0);
- model.dispose();
-
- }
-
- public void testSiteProject() {
- String projectName = "SiteProject"; //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- IPath path = Platform.getLocation();
- try {
- createSite(project, path, null);
- } catch (Exception e) {
- e.printStackTrace();
- fail("testSiteProject: " + e); //$NON-NLS-1$
- }
- ensureCreated(project);
- assertFalse("index.html should have not been generated.", project //$NON-NLS-1$
- .exists(new Path("index.html"))); //$NON-NLS-1$
- }
-
- public void testSiteProjectWithWeb() {
- String projectName = "SiteProjectWithWeb"; //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- IPath path = Platform.getLocation();
- try {
- createSite(project, path, "testWeb"); //$NON-NLS-1$
- } catch (Exception e) {
- e.printStackTrace();
- fail("testSiteProjectWithWeb: " + e); //$NON-NLS-1$
- }
- ensureCreated(project);
- assertTrue("index.html not generated.", project.exists(new Path( //$NON-NLS-1$
- "index.html"))); //$NON-NLS-1$
- IFolder webFolder = project.getFolder(new Path("testWeb")); //$NON-NLS-1$
- assertTrue("Web folder not generated.", webFolder.exists()); //$NON-NLS-1$
- assertTrue("site.xsl not generated.", webFolder.exists(new Path( //$NON-NLS-1$
- "site.xsl"))); //$NON-NLS-1$
- assertTrue("site.css not generated.", webFolder.exists(new Path( //$NON-NLS-1$
- "site.css"))); //$NON-NLS-1$
- }
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/AllNewFeatureProjectTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/AllNewFeatureProjectTests.java
deleted file mode 100644
index d14d01e..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/AllNewFeatureProjectTests.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.feature;
-
-import junit.framework.*;
-
-public class AllNewFeatureProjectTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test Suite to test new feature project creation wizards."); //$NON-NLS-1$
- suite.addTest(SimpleFeatureTestCase.suite());
- suite.addTest(FeatureWithPluginTestCase.suite());
- return suite;
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/FeatureWithPluginTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/FeatureWithPluginTestCase.java
deleted file mode 100644
index b2a8d97..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/FeatureWithPluginTestCase.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.feature;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.pde.core.plugin.IPluginModel;
-import org.eclipse.pde.internal.core.PDECore;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
-import org.eclipse.pde.ui.tests.Catalog;
-import org.eclipse.pde.ui.tests.wizards.plugin.NewProjectTest;
-
-public class FeatureWithPluginTestCase extends NewProjectTest {
-
- private static final String PROJECT_NAME = "com.example.test.feature";
-
- public static Test suite() {
- return new TestSuite(FeatureWithPluginTestCase.class);
- }
-
- public void testFeatureWithExternalPlugin() {
- playScript(Catalog.FEATURE_WITH_PLUGIN_1);
- verifyProjectExistence();
- verifyFeatureModel("org.eclipse.pde.ui");
- }
-
- public void testFeatureWithWorkspacePlugin() {
- playScript(Catalog.FEATURE_WITH_PLUGIN_2);
- verifyProjectExistence();
- verifyFeatureModel("com.example.test.plugin");
- }
-
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- private void verifyFeatureModel(String refPlugin) {
- IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager()
- .findFeatureModels(PROJECT_NAME);
- assertTrue("Model is not found.", models.length > 0);
- IFeature feature = models[0].getFeature();
- assertNotNull("Model's feature is null.", feature);
- IFeaturePlugin[] plugins = feature.getPlugins();
- assertTrue("Feature does not contain plug-in " + refPlugin + ".",
- plugins.length == 1);
- String pluginId = plugins[0].getId();
- assertNotNull("Feature plug-in ID is null.", pluginId);
- assertTrue(refPlugin.equals(pluginId));
- IPluginModel pluginModel = PDECore.getDefault().getModelManager()
- .findPluginModel(pluginId);
- assertNotNull("Model for feature plug-in " + pluginId + " not found ", pluginModel);
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/SimpleFeatureTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/SimpleFeatureTestCase.java
deleted file mode 100644
index 39dc75c..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/feature/SimpleFeatureTestCase.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.feature;
-
-import junit.framework.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.pde.core.build.*;
-import org.eclipse.pde.internal.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.internal.core.build.*;
-import org.eclipse.pde.internal.core.ifeature.IFeature;
-import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
-import org.eclipse.pde.ui.tests.*;
-import org.eclipse.pde.ui.tests.wizards.plugin.NewProjectTest;
-
-public class SimpleFeatureTestCase extends NewProjectTest {
-
- private static final String PROJECT_NAME = "com.example.test.feature";
-
- public static Test suite() {
- return new TestSuite(SimpleFeatureTestCase.class);
- }
-
- public void testSimpleFeatureProject() {
- playScript(Catalog.SIMPLE_FEATURE_1);
- verifyProjectContent(false);
- }
-
- public void testSimpleFeatureWithInstallHandlerProject() {
- playScript(Catalog.SIMPLE_FEATURE_2);
- verifyProjectContent(true);
- }
-
- private void verifyProjectContent(boolean isJava) {
- verifyProjectExistence();
- assertNatures(isJava);
- verifyFeatureModel(isJava);
- verifyBuildProperties(isJava);
- }
-
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- private void assertNatures(boolean isJava) {
- assertTrue("Feature project does not have a feature nature.",
- hasNature(PDE.FEATURE_NATURE));
- assertFalse("Feature project had plugin nature.",
- hasNature(PDE.PLUGIN_NATURE));
- if (isJava) {
- assertTrue("Java Project has no Java nature.",
- hasNature(JavaCore.NATURE_ID));
- } else {
- assertFalse("Simple Project has a Java nature.",
- hasNature(JavaCore.NATURE_ID));
- }
- }
-
- private void verifyFeatureModel(boolean isJava) {
- IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager()
- .findFeatureModels(PROJECT_NAME);
- assertTrue("Model is not found.", models.length > 0);
- IFeature feature = models[0].getFeature();
- assertNotNull("Model's feature is null.", feature);
- assertEquals(PROJECT_NAME, feature.getId());
- assertEquals("1.0.1", feature.getVersion());
- assertEquals("Eclipse.org", feature.getProviderName());
- assertEquals("Test Feature", feature.getLabel());
- assertTrue(feature.isValid());
- assertTrue((feature.getInstallHandler() != null) == isJava);
- }
-
- private void verifyBuildProperties(boolean isJava) {
- IFile buildFile = getProject().getFile("build.properties"); //$NON-NLS-1$
- assertTrue("Build.properties does not exist.", buildFile.exists());
-
- IBuildModel model = new WorkspaceBuildModel(buildFile);
- try {
- model.load();
- } catch (CoreException e) {
- fail("Model cannot be loaded:" + e);
- }
-
- IBuild build = model.getBuild();
- assertEquals(isJava ? 3 : 1, build.getBuildEntries().length);
- IBuildEntry entry = build.getEntry("bin.includes");
- assertNotNull(entry);
- String[] tokens = entry.getTokens();
- assertEquals(isJava ? 2 : 1, tokens.length);
- assertEquals(tokens[0], "feature.xml");
- if (isJava) {
- assertEquals(tokens[1], "handler.jar");
-
- entry = build.getEntry("source.handler.jar");
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- String sourceFolder = PreferenceConstants.getPreferenceStore()
- .getString(PreferenceConstants.SRCBIN_SRCNAME);
- assertEquals(tokens[0], sourceFolder + "/");
-
- entry = build.getEntry("output.handler.jar");
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- String buildFolder = PreferenceConstants.getPreferenceStore()
- .getString(PreferenceConstants.SRCBIN_BINNAME);
- assertEquals(tokens[0], buildFolder + "/");
- }
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/AllNewProjectTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/AllNewProjectTests.java
deleted file mode 100644
index 2bb5d2b..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/AllNewProjectTests.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.plugin;
-
-import junit.framework.*;
-
-public class AllNewProjectTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test Suite to test the new plug-in project creation wizard."); //$NON-NLS-1$
- suite.addTest(SimplePluginTestCase.suite());
- suite.addTest(BasicJavaPluginTestCase.suite());
- suite.addTest(LibraryPluginTestCase.suite());
- return suite;
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/BasicJavaPluginTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/BasicJavaPluginTestCase.java
deleted file mode 100644
index 94b949b..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/BasicJavaPluginTestCase.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.plugin;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.pde.core.build.*;
-import org.eclipse.pde.core.plugin.*;
-import org.eclipse.pde.internal.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.internal.core.build.*;
-import org.eclipse.pde.ui.tests.*;
-
-import junit.framework.*;
-
-public class BasicJavaPluginTestCase extends NewProjectTest {
-
- private static final String PROJECT_NAME = "com.example.xyz";
-
- public static Test suite() {
- return new TestSuite(BasicJavaPluginTestCase.class);
- }
-
- public void testMinimalJavaPlugin() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_1);
- verifyProject(true);
- verifyPluginModel(null, ".", true);
- verifyBuildProperties(true, ".", "src", "bin");
- } catch (CoreException e) {
- fail("testMinimalJavaPlugin:" + e);
- }
- }
-
- public void testMinimalJavaPluginWithoutManifest() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_2);
- verifyProject(false);
- verifyPluginModel(null, "xyz.jar", false);
- verifyBuildProperties(false, "xyz.jar", "src", "bin");
- } catch (CoreException e) {
- fail("testMinimalJavaPluginWithoutManifest:" + e);
- }
- }
-
- public void testMultiSegmentSourceFolder() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_3);
- verifyProject(true, null, "src/abc", "bin");
- verifyPluginModel(null, ".", true);
- verifyBuildProperties(true, ".", "src/abc", "bin");
- } catch (CoreException e) {
- fail("testMultiSegmentSourceFolder:" + e);
- }
- }
-
- public void testMultiSegmentOutputFolder() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_4);
- verifyProject(true, null, "src", "bin/abc");
- verifyPluginModel(null, ".", true);
- verifyBuildProperties(true, ".", "src", "bin/abc");
- } catch (CoreException e) {
- fail("testMultiSegmentOutputFolder:" + e);
- }
- }
-
- public void testUIPlugin() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_6);
- verifyProject(true, "com.example.xyz.XyzPlugin", "src", "bin");
- verifyPluginModel("com.example.xyz.XyzPlugin", ".", true);
- verifyBuildProperties(true, ".", "src", "bin");
- verifyType(true, "com.example.xyz.XyzPlugin");
- } catch (CoreException e) {
- fail("testUIPlugin:" + e);
- }
- }
-
- public void testNonUIPlugin() {
- try {
- playScript(Catalog.BASIC_JAVA_PLUGIN_7);
- verifyProject(true, "com.example.xyz.XyzPlugin", "src", "bin");
- verifyPluginModel("com.example.xyz.XyzPlugin", ".", true);
- verifyBuildProperties(true, ".", "src", "bin");
- verifyType(false, "com.example.xyz.XyzPlugin");
- } catch (CoreException e) {
- fail("testNonUIPlugin:" + e);
- }
- }
-
- public void verifyType(boolean ui, String className) throws CoreException {
- if (className != null) {
- IJavaProject jProject = JavaCore.create(getProject());
- IType type = jProject.findType(className);
- assertNotNull(type);
- assertTrue(type.isClass());
- assertFalse(type.isBinary());
- if (ui)
- assertEquals("AbstractUIPlugin", type.getSuperclassName());
- else
- assertEquals("Plugin", type.getSuperclassName());
- }
-
- }
-
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- private void verifyProject(boolean isBundle) throws CoreException {
- verifyProject(isBundle, null, "src", "bin");
- }
-
- private void verifyProject(boolean isBundle, String className, String srcFolder, String outputFolder) throws CoreException {
- verifyProjectExistence();
- verifyNatures();
- verifyManifestFiles(isBundle);
- verifyClasspath(className, srcFolder, outputFolder);
- }
-
- private void verifyNatures() {
- assertTrue("Project does not have a PDE nature.", hasNature(PDE.PLUGIN_NATURE));
- assertTrue("Simple Project has a Java nature.", hasNature(JavaCore.NATURE_ID));
- }
-
- private void verifyManifestFiles(boolean isBundle) {
- if (isBundle) {
- assertTrue(getProject().getFile("META-INF/MANIFEST.MF").exists());
- assertFalse(getProject().getFile("plugin.xml").exists());
- } else {
- assertTrue(getProject().getFile("plugin.xml").exists());
- assertFalse(getProject().getFile("META-INF/MANIFEST.MF").exists());
- }
- }
-
- private void verifyClasspath(String className, String srcFolder, String outputFolder) throws CoreException {
- IJavaProject jProject = JavaCore.create(getProject());
- IPath expected = new Path(getProjectName()).append(outputFolder).makeAbsolute();
- assertEquals(expected, jProject.getOutputLocation());
-
- IClasspathEntry[] entries = jProject.getRawClasspath();
- assertEquals(3, entries.length);
-
- // verify source folder
- IClasspathEntry entry = entries[0];
- assertEquals(IClasspathEntry.CPE_SOURCE, entry.getEntryKind());
- assertEquals(new Path(getProjectName()).append(srcFolder).makeAbsolute(), entry.getPath());
-
- // verify JRE container
- entry = entries[1];
- assertEquals(IClasspathEntry.CPE_CONTAINER, entry.getEntryKind());
- assertEquals(new Path(JavaRuntime.JRE_CONTAINER), entry.getPath());
-
- // verify PDE container
- entry = entries[2];
- assertEquals(IClasspathEntry.CPE_CONTAINER, entry.getEntryKind());
- assertEquals(new Path(PDECore.CLASSPATH_CONTAINER_ID), entry.getPath());
-
- IPackageFragmentRoot[] roots = jProject.findPackageFragmentRoots(entry);
- assertEquals(className == null, roots.length == 0);
-
- // verify no errors
- assertEquals(0, getProject().findMarkers(null, true, IResource.DEPTH_INFINITE).length);
-
- }
-
- private void verifyPluginModel(String className, String libraryName, boolean bundle) {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(getProject());
- assertTrue("Model is not found.", model != null);
- IPlugin plugin = (IPlugin)model.getPluginBase();
- assertEquals("com.example.xyz", plugin.getId());
- assertEquals("1.0.0", plugin.getVersion());
- assertEquals("EXAMPLE", plugin.getProviderName());
- assertEquals("Xyz Plug-in", plugin.getName());
- if (className == null)
- assertNull(plugin.getClassName());
- else
- assertEquals(className, plugin.getClassName());
- assertEquals(bundle ? 0 : 1, plugin.getLibraries().length);
- if (!bundle)
- assertEquals(libraryName, plugin.getLibraries()[0].getName());
- assertEquals(0, plugin.getExtensionPoints().length);
- assertEquals(0, plugin.getExtensions().length);
- }
-
- private void verifyBuildProperties(boolean isBundle, String libraryName, String srcFolder, String outputFolder) {
- IFile buildFile = getProject().getFile("build.properties"); //$NON-NLS-1$
- assertTrue("Build.properties does not exist.", buildFile.exists());
-
- IBuildModel model = new WorkspaceBuildModel(buildFile);
- try {
- model.load();
- } catch (CoreException e) {
- fail("Model cannot be loaded:" + e);
- }
-
- IBuild build = model.getBuild();
- assertEquals(3, build.getBuildEntries().length);
-
- // verify bin.includes
- IBuildEntry entry = build.getEntry("bin.includes");
- assertNotNull(entry);
- String[] tokens = entry.getTokens();
- assertEquals(2, tokens.length);
- assertEquals(isBundle ? "META-INF/" : "plugin.xml", tokens[0]);
- if (!libraryName.equals("."))
- assertEquals(libraryName, tokens[1]);
-
- // verify source.<libraryName> and output.<libraryName>
- entry = build.getEntry("source." + libraryName);
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- assertEquals(srcFolder + "/", tokens[0]);
-
- // verify output.<libraryName> and output.<libraryName>
- entry = build.getEntry("output." + libraryName);
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- assertEquals(outputFolder + "/", tokens[0]);
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/LibraryPluginTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/LibraryPluginTestCase.java
deleted file mode 100644
index bed2e91..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/LibraryPluginTestCase.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.plugin;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.pde.core.build.*;
-import org.eclipse.pde.core.plugin.*;
-import org.eclipse.pde.internal.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.internal.core.build.*;
-import org.eclipse.pde.ui.tests.*;
-
-import junit.framework.*;
-
-public class LibraryPluginTestCase extends NewProjectTest {
-
- private static final String PROJECT_NAME = "com.example.xyz";
-
- public static Test suite() {
- return new TestSuite(LibraryPluginTestCase.class);
- }
-
- public void testLibrariesFromWorkspacePlugin() {
- try {
- playScript(Catalog.LIBRARY_PLUGIN_1);
- verifyProject(false, "pdeuiant.jar", "bin");
- verifyPluginModel(null, "pdeuiant.jar");
- verifyBuildProperties(false, false, "pdeuiant.jar");
- } catch (CoreException e) {
- fail("testLibrariesFromWorkspacePlugin:" + e);
- }
- }
-
- public void testLibrariesFromWorkspacePluginWithManifest() {
- try {
- playScript(Catalog.LIBRARY_PLUGIN_2);
- verifyProject(true, "pdeuiant.jar", "bin");
- verifyPluginModel(null, "pdeuiant.jar");
- verifyBuildProperties(true, false, "pdeuiant.jar");
- } catch (CoreException e) {
- fail("testLibrariesFromWorkspacePluginWithManifest:" + e);
- }
- }
-
- public void testUnzipFromWorkspacePlugin() {
- try {
- playScript(Catalog.LIBRARY_PLUGIN_3);
- verifyProject(false, ".", "bin");
- verifyPluginModel(null, ".");
- verifyBuildProperties(false, true, ".");
- } catch (CoreException e) {
- fail("testLibrariesFromWorkspacePlugin:" + e);
- }
- }
-
- public void testUnzipFromWorkspacePluginWithManifest() {
- try {
- playScript(Catalog.LIBRARY_PLUGIN_4);
- verifyProject(true, ".", "bin");
- verifyPluginModel(null, ".");
- verifyBuildProperties(true, true, ".");
- } catch (CoreException e) {
- fail("testLibrariesFromWorkspacePluginWithManifest:" + e);
- }
- }
-
- public void verifyType(boolean ui, String className) throws CoreException {
- if (className != null) {
- IJavaProject jProject = JavaCore.create(getProject());
- IType type = jProject.findType(className);
- assertNotNull(type);
- assertTrue(type.isClass());
- assertFalse(type.isBinary());
- if (ui)
- assertEquals("AbstractUIPlugin", type.getSuperclassName());
- else
- assertEquals("Plugin", type.getSuperclassName());
- }
-
- }
-
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- private void verifyProject(boolean isBundle, String libName, String outputFolder) throws CoreException {
- verifyProjectExistence();
- verifyNatures();
- verifyManifestFiles(isBundle);
- verifyClasspath(libName, outputFolder);
- }
-
- private void verifyNatures() {
- assertTrue("Project does not have a PDE nature.", hasNature(PDE.PLUGIN_NATURE));
- assertTrue("Simple Project has a Java nature.", hasNature(JavaCore.NATURE_ID));
- }
-
- private void verifyManifestFiles(boolean isBundle) {
- if (isBundle) {
- assertTrue(getProject().getFile("META-INF/MANIFEST.MF").exists());
- assertFalse(getProject().getFile("plugin.xml").exists());
- } else {
- assertTrue(getProject().getFile("plugin.xml").exists());
- assertFalse(getProject().getFile("META-INF/MANIFEST.MF").exists());
- }
- }
-
- private void verifyClasspath(String libName, String outputFolder) throws CoreException {
- IJavaProject jProject = JavaCore.create(getProject());
- IPath expected = new Path(getProjectName()).append(outputFolder).makeAbsolute();
- assertEquals(expected, jProject.getOutputLocation());
-
- IClasspathEntry[] entries = jProject.getRawClasspath();
- assertEquals(3, entries.length);
-
- // verify library
- IClasspathEntry entry = entries[0];
- assertEquals(IClasspathEntry.CPE_LIBRARY, entry.getEntryKind());
- assertEquals(new Path(getProjectName()).append(libName).makeAbsolute(), entry.getPath());
-
- // verify JRE container
- entry = entries[1];
- assertEquals(IClasspathEntry.CPE_CONTAINER, entry.getEntryKind());
- assertEquals(new Path(JavaRuntime.JRE_CONTAINER), entry.getPath());
-
- // verify PDE container
- entry = entries[2];
- assertEquals(IClasspathEntry.CPE_CONTAINER, entry.getEntryKind());
- assertEquals(new Path(PDECore.CLASSPATH_CONTAINER_ID), entry.getPath());
-
- // verify no errors
- assertEquals(0, getProject().findMarkers(null, true, IResource.DEPTH_INFINITE).length);
-
- }
-
- private void verifyPluginModel(String className, String libraryName) {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(getProject());
- assertTrue("Model is not found.", model != null);
- IPlugin plugin = (IPlugin)model.getPluginBase();
- assertEquals("com.example.xyz", plugin.getId());
- assertEquals("1.0.1", plugin.getVersion());
- assertEquals("Eclipse.org", plugin.getProviderName());
- assertEquals("Xyz Plug-in", plugin.getName());
- if (className == null)
- assertNull(plugin.getClassName());
- else
- assertEquals(className, plugin.getClassName());
- assertEquals(1, plugin.getLibraries().length);
- assertEquals(libraryName, plugin.getLibraries()[0].getName());
- assertEquals(0, plugin.getExtensionPoints().length);
- assertEquals(0, plugin.getExtensions().length);
- }
-
- private void verifyBuildProperties(boolean isBundle, boolean isUnzip, String libraryName) {
- IFile buildFile = getProject().getFile("build.properties"); //$NON-NLS-1$
- assertTrue("Build.properties does not exist.", buildFile.exists());
-
- IBuildModel model = new WorkspaceBuildModel(buildFile);
- try {
- model.load();
- } catch (CoreException e) {
- fail("Model cannot be loaded:" + e);
- }
-
- IBuild build = model.getBuild();
- assertEquals(isUnzip ? 3 : 1, build.getBuildEntries().length);
-
- // verify bin.includes
- IBuildEntry entry = build.getEntry("bin.includes");
- assertNotNull(entry);
- String[] tokens = entry.getTokens();
- assertEquals(2, tokens.length);
- assertEquals(isBundle ? "META-INF/" : "plugin.xml", tokens[0]);
- if (libraryName.equals("."))
- assertEquals("org/", tokens[1]);
- else
- assertEquals(libraryName, tokens[1]);
-
- if (isUnzip) {
- entry = build.getEntry("source..");
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- assertEquals(".", tokens[0]);
-
- entry = build.getEntry("output..");
- assertNotNull(entry);
- tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- assertEquals(".", tokens[0]);
-
- }
-
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/NewProjectTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/NewProjectTest.java
deleted file mode 100644
index 9fb4225..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/NewProjectTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.plugin;
-
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.pde.ui.tests.*;
-
-public abstract class NewProjectTest extends PDETestCase {
-
- protected void verifyProjectExistence() {
- assertTrue("Project does not exist", getProject().exists());
- }
-
- protected IProject getProject() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.getProject(getProjectName());
- }
-
- protected boolean hasNature(String nature) {
- boolean hasNature = false;
- try {
- hasNature = getProject().hasNature(nature);
- } catch (CoreException e) {
- }
- return hasNature;
- }
-
- protected abstract String getProjectName();
-
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/SimplePluginTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/SimplePluginTestCase.java
deleted file mode 100644
index 0743cda..0000000
--- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/wizards/plugin/SimplePluginTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.ui.tests.wizards.plugin;
-
-import junit.framework.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.pde.core.build.*;
-import org.eclipse.pde.core.plugin.*;
-import org.eclipse.pde.internal.*;
-import org.eclipse.pde.internal.core.*;
-import org.eclipse.pde.internal.core.build.*;
-import org.eclipse.pde.ui.tests.*;
-
-public class SimplePluginTestCase extends NewProjectTest {
-
- private static final String PROJECT_NAME = "com.example.simple";
-
- public static Test suite() {
- return new TestSuite(SimplePluginTestCase.class);
- }
-
- public void testSimplePluginProject() {
- playScript(Catalog.SIMPLE_PLUGIN_1);
- verifyProjectContent(true);
- }
-
- public void testSimplePluginWithoutManifest() {
- playScript(Catalog.SIMPLE_PLUGIN_2);
- verifyProjectContent(false);
- }
-
- private void verifyProjectContent(boolean isBundle) {
- verifyProjectExistence();
- verifyNatures();
- verifyManifestFiles(isBundle);
- verifyPluginModel();
- verifyBuildProperties(isBundle);
- }
-
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- private void verifyManifestFiles(boolean isBundle) {
- if (isBundle) {
- assertTrue(getProject().getFile("META-INF/MANIFEST.MF").exists());
- assertFalse(getProject().getFile("plugin.xml").exists());
- } else {
- assertTrue(getProject().getFile("plugin.xml").exists());
- assertFalse(getProject().getFile("META-INF/MANIFEST.MF").exists());
- }
- }
-
- private void verifyNatures() {
- assertTrue("Project does not have a PDE nature.", hasNature(PDE.PLUGIN_NATURE));
- assertFalse("Simple Project has a Java nature.", hasNature(JavaCore.NATURE_ID));
- }
-
- private void verifyPluginModel() {
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(getProject());
- assertTrue("Model is not found.", model != null);
- IPlugin plugin = (IPlugin)model.getPluginBase();
- assertEquals("com.example.simple", plugin.getId());
- assertEquals("1.0.0", plugin.getVersion());
- assertEquals("EXAMPLE", plugin.getProviderName());
- assertEquals("Simple Plug-in", plugin.getName());
- assertNull(plugin.getClassName());
- assertEquals(0, plugin.getLibraries().length);
- assertEquals(0, plugin.getExtensionPoints().length);
- assertEquals(0, plugin.getExtensions().length);
- }
-
- private void verifyBuildProperties(boolean isBundle) {
- IFile buildFile = getProject().getFile("build.properties"); //$NON-NLS-1$
- assertTrue("Build.properties does not exist.", buildFile.exists());
-
- IBuildModel model = new WorkspaceBuildModel(buildFile);
- try {
- model.load();
- } catch (CoreException e) {
- fail("Model cannot be loaded:" + e);
- }
-
- IBuild build = model.getBuild();
- assertEquals(1, build.getBuildEntries().length);
- IBuildEntry entry = build.getEntry("bin.includes");
- assertNotNull(entry);
- String[] tokens = entry.getTokens();
- assertEquals(1, tokens.length);
- assertEquals(isBundle ? "META-INF/" : "plugin.xml", tokens[0]);
- }
-
-}
diff --git a/ui/org.eclipse.pde.ui.tests/test.xml b/ui/org.eclipse.pde.ui.tests/test.xml
deleted file mode 100644
index a42ed4d..0000000
--- a/ui/org.eclipse.pde.ui.tests/test.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="eclipse-home" value="${basedir}/../.."/>
- <property name="plugin-name" value="org.eclipse.pde.ui.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
-
- <property name="location1" value="${eclipse-home}/pde_sniff_folder"/>
- <delete dir="${location1}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${location1}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.pde.ui.tests.AllPDETests"/>
- </ant>
-
- </target>
-
- <!-- This target holds code to cleanup the testing environment after the tests -->
- <!-- have been run. You can use this to delete temporary files that are created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen after all -->
- <!-- the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
- <!-- This target defines the performance tests that need to be run. -->
- <target name="performance-suite">
- <property name="your-performance-folder" value="${eclipse-home}/pde_performance_folder"/>
- <delete dir="${your-performance-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${your-performance-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.pde.ui.tests.performance.PDEPerformanceTests"/>
- </ant>
- </target>
-
- <!-- This target runs the performance test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="performance" depends="init,performance-suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>