Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/registry/GenericResourceFactory.java')
-rw-r--r--bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/registry/GenericResourceFactory.java57
1 files changed, 0 insertions, 57 deletions
diff --git a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/registry/GenericResourceFactory.java b/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/registry/GenericResourceFactory.java
deleted file mode 100644
index 0536d0f3b..000000000
--- a/bundles/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/registry/GenericResourceFactory.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.wst.ws.internal.registry;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-
-/**
- * Patterned after the ResourceFactory classes generated
- * by the EMF tools, this generic factory handles creation
- * of EMF resources for XML documents in general.
- */
-public class GenericResourceFactory extends XMLResourceFactoryImpl
-{
- /**
- * Holds an instance of <code>ExtendedMetaData</code>
- * for associating extended metadata with the
- * <code>Resource</code> returned by <code>createResource</code>.
- */
- protected ExtendedMetaData extendedMetaData;
-
- /**
- * Constructs a new <code>GenericResourceFactory</code>.
- */
- public GenericResourceFactory()
- {
- super();
- extendedMetaData = ExtendedMetaData.INSTANCE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.ecore.resource.Resource$Factory#createResource(org.eclipse.emf.common.util.URI)
- */
- public Resource createResource(URI uri)
- {
- XMLResource result = new XMLResourceImpl(uri);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
- return result;
- }
-}

Back to the top

undles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUILaunchListener.java?h=v200902112333'>bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUILaunchListener.java154
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIPlugin.java192
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchConfigurationTab.java141
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchShortcut.java333
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLTTabGroup.java59
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractParameterAction.java125
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractStylesheetAction.java201
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddExternalFileAction.java75
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddParameterAction.java65
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddWorkspaceFileAction.java121
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/ControlAccessibleListener.java54
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveDownAction.java79
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveUpAction.java82
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MultipleInputDialog.java435
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/OpenDialogAction.java66
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveAction.java59
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveParameterAction.java54
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/breakpoint/XSLBreakpointProvider.java160
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLBreakpointAdapterFactory.java49
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLLineBreakpointAdapter.java105
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLModelPresentation.java139
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IParametersChangedListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IStylesheetEntriesChangedListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java153
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParameterViewer.java121
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersBlock.java242
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersContentProvider.java81
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersLabelProvider.java54
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetContentProvider.java73
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetLabelProvider.java85
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetViewer.java130
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/TransformsBlock.java208
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/XSLMainTab.java223
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputFileBlock.java301
-rw-r--r--bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputTab.java73
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.classpath12
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.settings/org.eclipse.jdt.core.prefs20
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/META-INF/MANIFEST.MF25
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/build.properties8
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/icons/xslt_processor.gifbin161 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.properties5
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.xml70
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/JAXPDebugUIPlugin.java52
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/AddProcessorDialog.java384
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/BasePreferencePage.java30
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/InstalledProcessorsBlock.java646
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/Messages.java51
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorLibraryBlock.java344
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorsPreferencePage.java162
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/messages.properties31
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributeDialog.java161
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributesBlock.java367
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/InstallStandin.java29
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarContentProvider.java34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarLabelProvider.java26
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/Messages.java22
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertiesBlock.java378
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertyDialog.java160
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorBlock.java373
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDescriptor.java16
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDetailsDialog.java113
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.java37
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.properties14
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/XSLProcessorTab2.java98
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/messages.properties11
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/views/ResultView.java191
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs20
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/META-INF/MANIFEST.MF11
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/build.properties6
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/plugin.properties3
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/log4j.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/AbstractDebugger.java406
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/BreakPoint.java77
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugConstants.java70
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugRunner.java400
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/IXSLDebugger.java148
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/StyleFrame.java128
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/Variable.java159
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/IProcessorInvoker.java62
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/Messages.java48
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java301
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java246
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformationException.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java136
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/ConfigurationException.java32
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/CreationException.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/JAXPSAXProcessorInvoker.java228
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Main.java86
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Messages.java48
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/messages.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/messages.properties25
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/.settings/org.eclipse.jdt.core.prefs25
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultAttributes.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultOutputProperties.properties40
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/META-INF/MANIFEST.MF23
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/build.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/log4j.debug.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.properties9
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.xml51
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/schema/debugger.exsd145
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/schema/invoke.exsd93
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processor.exsd147
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processorType.exsd167
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IAttribute.java89
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IDebugger.java56
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IOutputProperty.java31
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInstall.java69
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInvoker.java20
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorJar.java36
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorType.java40
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ITransformerFactory.java7
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPLaunchConfigurationConstants.java28
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPRuntime.java330
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchAttributes.java104
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchProperties.java90
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/Messages.java61
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ProcessorInstall.java148
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Attribute.java104
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/DebuggerDescriptor.java67
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/FeaturePreferences.java122
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPJavaLaunchConfigurationDelegate.java440
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPLaunchingPlugin.java64
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/LaunchHelper.java245
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputProperty.java36
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputPropertyPreferences.java119
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PluginProcessorJar.java79
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PreferenceInitializer.java67
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorInvokerDescriptor.java96
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorJar.java64
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorPreferences.java169
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorType.java226
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/TransformerFactory.java27
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Utils.java58
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/AbstractRegistryReader.java126
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistry.java43
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistryReader.java97
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistry.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistryReader.java79
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistry.java181
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistryReader.java90
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistry.java146
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistryReader.java82
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/messages.properties47
-rw-r--r--bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/model/JAXPDebugTarget.java583
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.cvsignore4
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.jdt.core.prefs25
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.pde.prefs24
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/META-INF/MANIFEST.MF24
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/build.properties8
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/plugin.properties9
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/plugin.xml50
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/LaunchingPlugin.java71
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Messages.java21
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Utils.java57
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLPropertyTester.java21
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupDirector.java22
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupParticipant.java30
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourcePathComputerDelegate.java105
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/messages.properties11
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLLaunchConfigurationConstants.java37
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLTRuntime.java51
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/BaseLaunchHelper.java202
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchAttribute.java55
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchPipeline.java148
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchTransform.java205
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/PreferenceUtil.java159
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLConstants.java19
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLDebugTarget.java21
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/NodeListVariable.java97
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugElement.java54
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLLineBreakpoint.java79
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLStackFrame.java249
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLThread.java182
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLValue.java159
-rw-r--r--bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLVariable.java102
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/.project28
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/.settings/org.eclipse.jdt.core.prefs15
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/SaxonAttributes.properties89
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/SaxonOutputProperties.properties27
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/build.properties9
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/plugin.properties7
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/plugin.xml28
-rw-r--r--bundles/org.eclipse.wst.xsl.saxon/src-debugger/README.txt1
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/.classpath15
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.jdt.core.prefs87
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.pde.prefs22
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/META-INF/MANIFEST.MF44
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/build.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/ancestor.gifbin573 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/directional.gifbin470 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/family.gifbin598 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/field_default_obj.gifbin118 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/function.gifbin100 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/import.gifbin114 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/imports.gifbin185 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/mode.gifbin176 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/new_xml.gifbin370 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/newdtd_wiz.gifbin360 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/operation.gifbin142 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/over_co.gifbin131 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/package_obj.gifbin227 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/template.gifbin100 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/variable.gifbin191 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/xml_perspective.gifbin86 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_file.gifbin354 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_launch.gifbin300 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl.ui/plugin.properties35
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/plugin.xml352
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/ListWorkbenchAdapter.java59
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/Messages.java18
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StructuredTextViewerConfigurationXSL.java135
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StylesheetView.java159
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLModelAdapterFactory.java33
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIConstants.java17
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIPlugin.java154
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLWorkbenchAdapter.java98
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewDTDFileWizardDelegate.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWSDLFileWizardDelegate.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWizardAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXMLFileWizardDelegate.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSDFileWizardDelegate.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSLFileWizardDelegate.java42
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXMLElementContentAssistRequest.java379
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXSLContentAssistRequest.java252
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CallTemplateContentAssistRequest.java103
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CustomCompletionProposal.java63
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/ExcludeResultPrefixesContentAssist.java120
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/IContentAssistProposalRequest.java20
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/NullContentAssistRequest.java53
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/SelectAttributeContentAssist.java287
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateModeAttributeContentAssist.java103
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateNameAttributeContentAssist.java99
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TestAttributeContentAssist.java89
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XPathElementContentAssist.java118
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistProcessor.java453
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistRequestFactory.java184
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLElementContentAssistRequest.java124
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/contentmodel/XSLContentModelGenerator.java165
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/HrefContentAssistRequest.java184
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/PathComparator.java36
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/doubleclick/XSLDoubleClickStrategy.java118
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicator.java61
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorImageProvider.java64
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorManager.java173
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/SourceFileHyperlink.java119
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLEditor.java73
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLHyperlinkDetector.java236
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/handlers/OpenDeclarationHandler.java87
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/messages.properties5
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/perspective/XMLPerspectiveFactory.java106
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractValidationSettingsPage.java352
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractXSLPreferencePage.java202
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ComboData.java51
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/MainPreferencePage.java75
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/PropertyPreferencePage.java305
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ValidationPreferencePage.java166
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLSyntaxColoringPage.java926
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLTemplatePreferencePage.java46
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLUIPreferenceInitializer.java56
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLValidationPreferencePage.java343
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/IStyleConstantsXSL.java31
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/LineStyleProviderForXSL.java519
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLRegionMap.java81
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLTextAttributeMap.java113
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLRegionMap.java56
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLTextAttributeMap.java98
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/TemplateContextTypeXSL.java33
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/VersionTemplateVariableResolverXSL.java38
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/XSLTemplatesPage.java249
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImageHelper.java161
-rwxr-xr-xbundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImages.java59
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/DelegatingSourceValidatorForXSL.java93
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLErrorListener.java80
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLMarkupValidator.java95
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileTemplatesWizardPage.java413
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizard.java147
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizardPage.java146
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateContentProvider.java26
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateLabelProvider.java29
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/templates/file_templates.xml34
-rw-r--r--bundles/org.eclipse.wst.xsl.ui/xslfiles/syntaxcoloring.xsl8
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.cvsignore4
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.project34
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.pde.prefs24
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/META-INF/MANIFEST.MF17
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/XalanAttributes.properties21
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/XalanOutputProperties.properties37
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/build.properties10
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/plugin.properties8
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/plugin.xml45
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanDebugger.java93
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanPrintTraceListener.java104
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanRootStyleFrame.java78
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanStyleFrame.java200
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java167
-rw-r--r--bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java218
-rw-r--r--bundles/org.eclipse.wst.xsl/.project22
-rw-r--r--bundles/org.eclipse.wst.xsl/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.wst.xsl/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsl/about.ini31
-rw-r--r--bundles/org.eclipse.wst.xsl/about.mappings6
-rw-r--r--bundles/org.eclipse.wst.xsl/about.properties20
-rw-r--r--bundles/org.eclipse.wst.xsl/build.properties8
-rw-r--r--bundles/org.eclipse.wst.xsl/plugin.properties3
-rw-r--r--bundles/org.eclipse.wst.xsl/wtp_prod32.gifbin1752 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsl/wtp_prod32.pngbin2672 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/.cvsignore2
-rw-r--r--docs/org.eclipse.wst.xsl.doc/.project27
-rw-r--r--docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.wst.validation.prefs15
-rw-r--r--docs/org.eclipse.wst.xsl.doc/META-INF/MANIFEST.MF10
-rw-r--r--docs/org.eclipse.wst.xsl.doc/about.html34
-rw-r--r--docs/org.eclipse.wst.xsl.doc/build.properties9
-rw-r--r--docs/org.eclipse.wst.xsl.doc/build.xml44
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/concepts/RescuingXSLTfromNicheStatus.xml502
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/concepts/concepts.xml40
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/concepts/gettingstarted.xml10
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/editor/editor.xml382
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/general/general.xml62
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist1.pngbin58353 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist2.pngbin60069 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/calltemplate.pngbin26069 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/hrefAssistance.pngbin24019 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/modeAssistance.pngbin25596 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/namedTemplate.pngbin42870 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override1.pngbin8801 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override2.pngbin8848 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/syntaxColoring.pngbin35022 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/templatesView.pngbin34095 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/editor/xslproposals.pngbin39002 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/launching/launchShortct.pngbin52144 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/launching/nodesetVariable.pngbin45509 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/launching/resultView.pngbin38017 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/XPathTemplates.pngbin52055 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/projectLevelValidation.pngbin65981 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xm_template_xslnewfile.pngbin51651 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslSyntaxColoring.pngbin50885 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_InstalledProcessors.pngbin19110 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_outputproperties.pngbin35947 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslfeatures.pngbin15952 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslpreferences.pngbin34200 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/launching/launching.xml165
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/legal.xml20
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/preferences/preferences.xml197
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/samples/samples.xml35
-rw-r--r--docs/org.eclipse.wst.xsl.doc/docbook/xslhelp.dbk25
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/about.html34
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/book.css214
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/concepts/concepts.html418
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/concepts/resources.html5
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor.html12
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_coloring.html11
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist.html19
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_calltemplate.html9
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_exclude.html21
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_include.html15
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_modeassist.html17
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_namedtemplate.html7
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_contentassist_selecttest.html27
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_debugging.html15
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_markers.html12
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_templates.html11
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/editor/xsleditor_validation.html36
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/general/general.html27
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/ExcludeContentAssist1.pngbin58353 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/ExcludeContentAssist2.pngbin60069 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/calltemplate.pngbin26069 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/hrefAssistance.pngbin24019 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/modeAssistance.pngbin25596 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/namedTemplate.pngbin42870 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/override1.pngbin8801 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/override2.pngbin8848 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/syntaxColoring.pngbin35022 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/templatesView.pngbin34095 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/editor/xslproposals.pngbin39002 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/general/xinclude.pngbin2834 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/launching/launchShortct.pngbin52144 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/launching/nodesetVariable.pngbin45509 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/launching/resultView.pngbin38017 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/XPathTemplates.pngbin52055 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/projectLevelValidation.pngbin65981 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xm_template_xslnewfile.pngbin51651 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xslSyntaxColoring.pngbin50885 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xsl_InstalledProcessors.pngbin19110 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xsl_outputproperties.pngbin35947 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xslfeatures.pngbin15952 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/images/preferences/xslpreferences.pngbin34200 -> 0 bytes-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/index.html5
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/introduction/gettingstarted.html3
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/debugging.html13
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/debugging_common.html15
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/debugging_processors.html16
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/debugging_variablesview.html10
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/debuglaunching.html3
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/launching/launching.html7
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/legal.html11
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/syntaxColoring.html8
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/validation.html8
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xpathexport.html1
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xpathimport.html1
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xpathtemplates.html25
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xsloutputproperties.html6
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xslpreferences.html18
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/preferences/xslprocessors.html4
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/reference/maintopic.html13
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/reference/subtopic.html13
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/reference/subtopic2.html13
-rw-r--r--docs/org.eclipse.wst.xsl.doc/html/samples/samples.html11
-rw-r--r--docs/org.eclipse.wst.xsl.doc/plugin.properties3
-rw-r--r--docs/org.eclipse.wst.xsl.doc/plugin.xml5
-rw-r--r--docs/org.eclipse.wst.xsl.doc/toc.xml1
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/.classpath7
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/.project33
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/.settings/org.eclipse.wst.validation.prefs17
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/META-INF/MANIFEST.MF12
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/about.html34
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/build.properties12
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/build.xml80
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/.cvsignore299
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/.cvsignore1
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/extension_point/org_eclipse_wst_xsl_jaxp_launching_debugger.html61
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/extension_point/org_eclipse_wst_xsl_jaxp_launching_invoke.html41
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/extension_point/org_eclipse_wst_xsl_jaxp_launching_processor.html63
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/extension_point/org_eclipse_wst_xsl_jaxp_launching_processorType.html73
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.core.XPathCorePlugin.html17
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper.html119
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.XPathUIMessages.html53
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.XPathViewPlugin.html63
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.DOMNodeLabelProvider.html11
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.DOMTreeContentProvider.html33
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.DOMViewerFilter.html17
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.EditNamespacePrefixDialog.html37
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.EditorReferenceLabelProvider.html15
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.RefreshAction.html9
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.ShowInSourceAction.html9
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.XMLEditorsContentProvider.html21
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.XPathAction.html9
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xml.xpath.ui.views.XPathNavigator.html45
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.core.Messages.html71
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.core.ValidationPreferences.html95
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.core.XSLCore.html52
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.core.resolver.ResolverExtension.html21
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.core.resolver.XSLVersionHandler.html67
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanDebugger.html17
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanPrintTraceListener.html17
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanRootStyleFrame.html13
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanStyleFrame.html35
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanTraceListener.html23
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/org.eclipse.wst.xsl.xalan.debugger.XalanVariable.html29
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/html/toc.html13
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/jeltohtml.xsl393
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/jeltotoc.xsl40
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/doc/schema.css71
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/lib/.cvsignore2
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/plugin.properties14
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/plugin.xml13
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/src/org/eclipse/wst/xsl/sdk/documentation/Activator.java50
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/toc.xml61
-rw-r--r--docs/org.eclipse.wst.xsl.sdk.documentation/tocExtension.xml15
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/.project17
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/.settings/org.eclipse.pde.prefs16
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/build.properties7
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/epl-v10.html328
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/feature.properties138
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/feature.xml40
-rw-r--r--features/org.eclipse.wst.xsl_sdk.feature/license.html96
517 files changed, 0 insertions, 38318 deletions
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.classpath b/bundles/org.eclipse.wst.xsl.debug.ui/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.cvsignore b/bundles/org.eclipse.wst.xsl.debug.ui/.cvsignore
deleted file mode 100644
index ac6029b..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-javaCompiler...args
-build.xml
-@dot
-temp.folder
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.project b/bundles/org.eclipse.wst.xsl.debug.ui/.project
deleted file mode 100644
index ded342e..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.debug.ui</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 0a7bb6d..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu Jan 03 22:24:01 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c2dd24e..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,25 +0,0 @@
-#Tue Feb 10 05:29:19 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index bf7b476..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri May 09 15:32:34 BST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fdd8568..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Fri Jan 04 09:04:43 EST 2008
-compilers.incompatible-environment=1
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.missing-bundle-classpath-entries=0
-compilers.p.missing-packages=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-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/bundles/org.eclipse.wst.xsl.debug.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.debug.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 62b3091..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl.debug.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.xsl.launching;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.xsl.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.osgi.util;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.eclipse.wst.xsl.debug.internal.util;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.debug.ui,
- org.eclipse.wst.xsl.internal.debug.ui;x-friends:="org.eclipse.wst.xsl.jaxp.debug,org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.internal.debug.ui.actions;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.internal.debug.ui.breakpoint;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.internal.debug.ui.model;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.internal.debug.ui.tabs.main;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching",
- org.eclipse.wst.xsl.internal.debug.ui.tabs.output;x-friends:="org.eclipse.wst.xsl.jaxp.debug, org.eclipse.wst.jaxp.debug.ui, org.eclipse.wst.xsl.jaxp.launching"
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/about.html b/bundles/org.eclipse.wst.xsl.debug.ui/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/build.properties b/bundles/org.eclipse.wst.xsl.debug.ui/build.properties
deleted file mode 100644
index 878da21..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- plugin.properties,\
- icons/
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/brkp_obj.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/brkp_obj.gif
deleted file mode 100644
index a831fe7..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/brkp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/localvariable_obj.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/localvariable_obj.gif
deleted file mode 100644
index 3244b26..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/localvariable_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/operation.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/operation.gif
deleted file mode 100644
index b55d9e3..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/operation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/sample.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_launch.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_launch.gif
deleted file mode 100644
index bfe15f8..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_launch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_output.gif b/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_output.gif
deleted file mode 100644
index 45fb08d..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/icons/xslt_output.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.properties b/bundles/org.eclipse.wst.xsl.debug.ui/plugin.properties
deleted file mode 100644
index 394942b..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.debug.ui
-Bundle-Name.0 = XSL Debugger UI (Incubating)
-launchMode.description.0 = Create a configuration to debug an XSLT transformation
-launchMode.description.1 = Create a configuration to run an XSLT transformation
-context.description.0 = Context for debugging XSLT
-context.name.0 = XSLT Debugging
-shortcut.label.0 = XSL Transformation
-shortcut.label.1 = XSLT Transformation
-Bundle-Vendor.0 = Eclipse.org
-description.description.0 = Run an XSLT transformation using the selected file(s)
-description.description.1 = Debug an XSLT transformation using the selected file(s)
-description.description.2 = Profile an XSLT transformation using the selected file(s) \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml b/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml
deleted file mode 100644
index d9cb66c..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.wst.xml.perspective">
- <actionSet id="org.eclipse.debug.ui.debugActionSet" />
- <actionSet id="org.eclipse.debug.ui.launchActionSet" />
- <actionSet id="org.eclipse.debug.ui.breakpointActionSet" />
- <actionSet id="org.eclipse.debug.ui.profileActionSet" />
- </perspectiveExtension>
- </extension>
-
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage icon="icons/xslt_launch.gif"
- configTypeID="org.eclipse.wst.xsl.launching.launchConfigurationType"
- id="org.eclipse.wst.xsl.internal.debug.ui.launchConfigurationTypeImage" />
- </extension>
-
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- class="org.eclipse.wst.xsl.internal.debug.ui.XSLTTabGroup"
- id="org.eclipse.wst.xsl.internal.debug.ui.launchConfigurationTabGroup.xslt"
- type="org.eclipse.wst.xsl.launching.launchConfigurationType">
- <launchMode description="%launchMode.description.0"
- mode="debug" perspective="org.eclipse.debug.ui.DebugPerspective" />
- <launchMode description="%launchMode.description.1"
- mode="run" perspective="org.eclipse.wst.xml.perspective" />
- </launchConfigurationTabGroup>
- </extension>
-
- <extension point="org.eclipse.ui.contexts">
- <context description="%context.description.0"
- id="org.eclipse.wst.xsl.debug.ui.context" name="%context.name.0"
- parentId="org.eclipse.debug.ui.debugging">
- </context>
- </extension>
-
- <extension point="org.eclipse.debug.ui.debugModelPresentations">
- <debugModelPresentation
- class="org.eclipse.wst.xsl.internal.debug.ui.model.XSLModelPresentation"
- id="org.eclipse.wst.xsl.launching.XSLDebugModel">
- </debugModelPresentation>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut
- class="org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchShortcut"
- icon="icons/xslt_launch.gif"
- id="org.eclipse.wst.xsl.debug.ui.launchshortcut"
- label="%shortcut.label.0"
- modes="run, debug, profile">
- <contextualLaunch>
- <enablement>
- <with variable="selection">
- <iterate>
- <adapt
- type="org.eclipse.core.resources.IFile">
- <or>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.core.runtime.xml" />
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.wst.xml.core.xmlsource" />
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.wst.xml.core.xslsource" />
- </or>
- </adapt>
- </iterate>
- </with>
- </enablement>
- </contextualLaunch>
- <description
- description="%description.description.0"
- mode="run">
- </description>
- <description
- description="%description.description.1"
- mode="debug">
- </description>
- <description
- description="%description.description.2"
- mode="profile">
- </description>
- </shortcut>
- </extension>
-
- <extension point="org.eclipse.debug.ui.debugModelContextBindings">
- <modelContextBinding
- contextId="org.eclipse.wst.xsl.debug.ui.context"
- debugModelId="org.eclipse.wst.xsl.launching.XSLDebugModel">
- </modelContextBinding>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.breakpoint">
- <breakpointContribution
- id="org.eclipse.wst.xsl.debug.ui.providers">
-<!-- <provider contentTypes="org.eclipse.wst.xml.core.xslsource"
- class="org.eclipse.wst.xsl.internal.debug.ui.breakpoint.XSLBreakpointProvider:*xsl,*xslt"
- id="org.eclipse.wst.xsl.debug.ui.XSLBreakpointProvider" /> -->
- <!-- TODO add this back in when we can do something with breakpoints on XML files -->
- <provider contentTypes="org.eclipse.wst.xml.core.xslsource,org.eclipse.wst.xml.core.xmlsource,org.eclipse.core.runtime.xml"
- class="org.eclipse.wst.xsl.internal.debug.ui.breakpoint.XSLBreakpointProvider:*xsl,*xslt,*xml"
- id="org.eclipse.wst.xsl.debug.ui.XSLBreakpointProvider" />
- </breakpointContribution>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLDebugPluginImages.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLDebugPluginImages.java
deleted file mode 100755
index afc145b..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLDebugPluginImages.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 223557 - initial API and implementation
- * Holger Voormann - Icons for Processor, Output, and Launch tabs
- *******************************************************************************/
-package org.eclipse.wst.xsl.debug.internal.util;
-
-/**
- * Bundle of most images used by the XSL Debug Plugins
- */
-public class XSLDebugPluginImages {
-
- /**
- * Path to the XSLT Processor Images used for launch configurations
- */
- public static final String IMG_PROCESSOR_TAB = "icons/xslt_processor.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XSLT Output Images used for launch configurations
- */
- public static final String IMG_OUTPUT_TAB = "icons/xslt_output.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XSLT Launch Images used for launch configurations
- */
- public static final String IMG_MAIN_TAB = "icons/xslt_launch.gif"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLPluginImageHelper.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLPluginImageHelper.java
deleted file mode 100755
index 86843b5..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/internal/util/XSLPluginImageHelper.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.debug.internal.util;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author david carver based on work by amywu
- */
-public class XSLPluginImageHelper {
- private static XSLPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a XMLEditorPluginImageHelper
- */
- public synchronized static XSLPluginImageHelper getInstance() {
- if (instance == null) {
- instance = new XSLPluginImageHelper();
- }
- return instance;
- }
-
- // save a descriptor for each image
- @SuppressWarnings("unchecked")
- private HashMap fImageDescRegistry = null;
- private final String PLUGINID = XSLDebugUIPlugin.PLUGIN_ID;
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
- getImageRegistry().put(resource, image);
- }
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- @SuppressWarnings("unchecked")
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- @SuppressWarnings("unchecked")
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null) {
- fImageDescRegistry = new HashMap();
- }
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/Messages.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/Messages.java
deleted file mode 100644
index 602e110..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/Messages.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - updated to meet Galileo requirements
- *******************************************************************************/
-package org.eclipse.wst.xsl.debug.ui;
-
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Messages for the debug.ui package.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.debug.ui.messages"; //$NON-NLS-1$
-
- /**
- * A name for the remove action.
- */
- public static String RemoveAction_Text;
-
- /**
- * A name for the <code>AddWorkspaceFileAction</code> action.
- */
- public static String AddWorkspaceFileAction_Text;
-
- /**
- * A name for the <code>AddExternalFileAction</code> action.
- */
- public static String AddExternalFileAction_Text;
-
- /**
- * A name for the <code>MoveDownAction</code> action.
- */
- public static String MoveDownAction_Text;
-
- /**
- * A name for the <code>MoveUpAction</code> action.
- */
- public static String MoveUpAction_Text;
-
- /**
- * A heading for the <code>AddExternalFileAction</code> dialog.
- */
- public static String AddExternalFileAction_Selection_3;
-
- /**
- * A message for the <code>AddWorkspaceFileAction</code> dialog.
- */
- public static String AddWorkspaceFileAction_DialogMessage;
-
- /**
- * A title for the <code>AddWorkspaceFileAction</code> dialog.
- */
- public static String AddWorkspaceFileAction_DialogTitle;
-
- /**
- * A name for the <code>AddParameterAction</code> action.
- */
- public static String AddParameterAction;
-
- /**
- * A name for the <code>RemoveParameterAction</code> action.
- */
- public static String RemoveParameterAction;
-
- /**
- * A label for the Variables button.
- */
- public static String VariablesFieldButton_Text;
-
- /**
- * A title for the <code>AddParameterAction</code> dialog.
- */
- public static String AddParameterAction_Dialog;
-
- /**
- * A label for the <code>AddParameterAction</code> name text box.
- */
- public static String AddParameterAction_Dialog_Name;
-
- /**
- * A label for the <code>AddParameterAction</code> type combo.
- */
- public static String AddParameterAction_Dialog_Type;
-
- /**
- * A label for the <code>AddParameterAction</code> value text box.
- */
- public static String AddParameterAction_Dialog_Value;
-
- public static String XSLBreakpointProvider_0;
-
- public static String StylesheetEntryLabelProvider_Invalid_path;
-
- public static String TransformsBlock_0;
-
- public static String TransformsBlock_Name;
-
- public static String InputFileBlock_DIRECTORY_NOT_SPECIFIED;
-
- public static String InputFileBlock_DIRECTORY_DOES_NOT_EXIST;
-
- public static String InputFileBlock_GROUP_NAME;
-
- public static String InputFileBlock_DEFAULT_RADIO;
-
- public static String InputFileBlock_OTHER_RADIO;
-
- public static String InputFileBlock_DIALOG_MESSAGE;
-
- public static String InputFileBlock_WORKSPACE_DIALOG_MESSAGE;
-
- public static String InputFileBlock_VARIABLES_BUTTON;
-
- public static String InputFileBlock_FILE_SYSTEM_BUTTON;
-
- public static String InputFileBlock_WORKSPACE_BUTTON;
-
- public static String InputFileBlock_Name;
-
- public static String InputFileBlock_Exception_occurred_reading_configuration;
-
- public static String InputFileBlock_WORKSPACE_DIALOG_TITLE;
-
- public static String XSLMainTab_TabName;
-
- public static String TransformsBlock_ParametersLabel;
-
- public static String TransformsBlock_StylesheetsLabel;
-
- public static String ParametersBlock_0;
- public static String ParametersBlock_1;
- public static String ParametersBlock_10;
- public static String ParametersBlock_11;
- public static String ParametersBlock_2;
- public static String ParametersBlock_3;
- public static String ParametersBlock_4;
- public static String ParametersBlock_5;
- public static String ParametersBlock_6;
- public static String ParametersBlock_7;
- public static String ParametersBlock_8;
- public static String ParametersBlock_9;
-
- public static String OutputPropertiesBlock_0;
- public static String OutputPropertiesBlock_1;
- public static String OutputPropertiesBlock_13;
- public static String OutputPropertiesBlock_3;
- public static String OutputPropertiesBlock_4;
- public static String OutputPropertiesBlock_5;
- public static String OutputPropertiesBlock_7;
- public static String OutputPropertiesBlock_8;
- public static String OutputPropertiesBlock_9;
- public static String OutputTab_0;
- public static String OutputTab_1;
-
- public static String OutputTypeBlock_Group_Name;
-
- public static String OutputFileBlock_0;
-
- public static String OutputFileBlock_7;
-
- public static String OutputFileBlock_8;
-
- public static String OutputFileBlock_9;
-
- public static String OutputFileBlock_DIRECTORY_NOT_SPECIFIED;
-
- public static String OutputFileBlock_DIRECTORY_DOES_NOT_EXIST;
-
- public static String OutputFileBlock_GROUP_NAME;
-
- public static String OutputFileBlock_DEFAULT_RADIO;
-
- public static String OutputFileBlock_OTHER_RADIO;
-
- public static String OutputFileBlock_DIALOG_MESSAGE;
-
- public static String OutputFileBlock_WORKSPACE_DIALOG_MESSAGE;
-
- public static String OutputFileBlock_VARIABLES_BUTTON;
-
- public static String OutputFileBlock_FILE_SYSTEM_BUTTON;
-
- public static String OutputFileBlock_WORKSPACE_BUTTON;
-
- public static String OutputFileBlock_Name;
-
- public static String OutputFileBlock_Exception_occurred_reading_configuration;
-
- public static String OutputFileBlock_WORKSPACE_DIALOG_TITLE;
-
- public static String OutputFileBlock_Exception_occurred_saving_configuration;
-
- public static String OutputFOFileBlock_DIRECTORY_NOT_SPECIFIED;
-
- public static String OutputFOFileBlock_DIRECTORY_DOES_NOT_EXIST;
-
- public static String OutputFOFileBlock_GROUP_NAME;
-
- public static String OutputFOFileBlock_DEFAULT_RADIO;
-
- public static String OutputFOFileBlock_OTHER_RADIO;
-
- public static String OutputFOFileBlock_DIALOG_MESSAGE;
-
- public static String OutputFOFileBlock_WORKSPACE_DIALOG_MESSAGE;
-
- public static String OutputFOFileBlock_VARIABLES_BUTTON;
-
- public static String OutputFOFileBlock_FILE_SYSTEM_BUTTON;
-
- public static String OutputFOFileBlock_WORKSPACE_BUTTON;
-
- public static String OutputFOFileBlock_Name;
-
- public static String OutputFOFileBlock_Exception_occurred_reading_configuration;
-
- public static String OutputFOFileBlock_WORKSPACE_DIALOG_TITLE;
-
- public static String OutputFOFileBlock_Exception_occurred_saving_configuration;
-
- public static String ResourceSelectionBlock_0;
- public static String XSLLaunchShortcut_0;
- public static String XSLLaunchShortcut_1;
- public static String XSLLaunchShortcut_2;
- public static String XSLLaunchShortcut_6;
- public static String XSLSelectExisting;
-
-
-
- private Messages() {
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/messages.properties b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/messages.properties
deleted file mode 100644
index 5c259ea..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/messages.properties
+++ /dev/null
@@ -1,125 +0,0 @@
-ResourceSelectionBlock_0=File:
-XSLLaunchShortcut_0=Select an input file for the transformation
-XSLLaunchShortcut_1=Input File
-XSLLaunchShortcut_2=Select a Launch Configuration
-XSLLaunchShortcut_6=Error
-XSLSelectExisting=&Select existing configuration:
-#Action Messages
-RemoveAction_Text=Remove
-AddWorkspaceFileAction_Text=Add Files
-AddExternalFileAction_Text=Add External Files
-MoveDownAction_Text=Move Down
-MoveUpAction_Text=Move Up
-AddExternalFileAction_Selection_3=
-AddWorkspaceFileAction_DialogMessage=Choose Stylesheet
-AddWorkspaceFileAction_DialogTitle=
-AddParameterAction=Add Parameter
-RemoveParameterAction=Remove Parameter
-VariablesFieldButton_Text=Variables...
-AddParameterAction_Dialog=Add XSLT Parameter
-AddParameterAction_Dialog_Name=Name:
-AddParameterAction_Dialog_Type=Type:
-AddParameterAction_Dialog_Value=Value:
-#Breakpoint
-XSLBreakpointProvider_0=unsupported input type
-
-StylesheetEntryLabelProvider_Invalid_path=Invalid path
-XSLMainTab_TabName=Main
-
-TransformsBlock_0=TransformsBlock
-TransformsBlock_Name=Transformation Pipeline
-TransformsBlock_ParametersLabel=Parameters for stylesheet:
-TransformsBlock_StylesheetsLabel=Stylesheets:
-
-InputFileBlock_DIRECTORY_NOT_SPECIFIED=Input file not specified
-InputFileBlock_DIRECTORY_DOES_NOT_EXIST=Input file does not exist
-InputFileBlock_GROUP_NAME=XML Input File
-InputFileBlock_DEFAULT_RADIO=Use default
-InputFileBlock_OTHER_RADIO=Other
-InputFileBlock_DIALOG_MESSAGE=Select an external input file
-InputFileBlock_WORKSPACE_DIALOG_MESSAGE=Select an input file from the workspace
-InputFileBlock_VARIABLES_BUTTON=Variables...
-InputFileBlock_FILE_SYSTEM_BUTTON=File System...
-InputFileBlock_WORKSPACE_BUTTON=Workspace...
-InputFileBlock_Name=XML Input File
-InputFileBlock_Exception_occurred_reading_configuration=Exception occurred reading configuration
-InputFileBlock_WORKSPACE_DIALOG_TITLE=File Selection
-
-RemoveAction_Text=Remove
-AddWorkspaceFileAction_Text=Add Files
-AddExternalFileAction_Text=Add External Files
-MoveDownAction_Text=Move Down
-MoveUpAction_Text=Move Up
-AddExternalFileAction_Selection_3=
-AddWorkspaceFileAction_DialogMessage=Choose Stylesheet
-AddWorkspaceFileAction_DialogTitle=
-AddParameterAction=Add Parameter
-RemoveParameterAction=Remove Parameter
-VariablesFieldButton_Text=Variables...
-AddParameterAction_Dialog=Add XSLT Parameter
-AddParameterAction_Dialog_Name=Name:
-AddParameterAction_Dialog_Type=Type:
-AddParameterAction_Dialog_Value=Value:
-
-ParametersBlock_0=Name
-ParametersBlock_1=Type
-ParametersBlock_10=type
-ParametersBlock_11=value
-ParametersBlock_2=Value
-ParametersBlock_3=name
-ParametersBlock_4=type
-ParametersBlock_5=value
-ParametersBlock_6=type
-ParametersBlock_7=value
-ParametersBlock_8=type
-ParametersBlock_9=Transformation Parameters
-
-OutputPropertiesBlock_0=Use properties from preferences
-OutputPropertiesBlock_1=Change Preferences...
-OutputPropertiesBlock_13=Output Properties
-OutputPropertiesBlock_3=Use specific properties
-OutputPropertiesBlock_4=Property
-OutputPropertiesBlock_5=Value
-OutputPropertiesBlock_7=property
-OutputPropertiesBlock_8=value
-OutputPropertiesBlock_9=value
-OutputTab_0=Output Properties
-OutputTab_1=Output
-
-
-
-OutputTypeBlock_Group_Name=Output Type
-OutputFileBlock_0=Use default location
-OutputFileBlock_7=Location:
-OutputFileBlock_8=Open file on completion
-OutputFileBlock_9=Output File
-OutputFileBlock_DIRECTORY_NOT_SPECIFIED=Transform output file not specified
-OutputFileBlock_DIRECTORY_DOES_NOT_EXIST=Transform output file does not exist
-OutputFileBlock_GROUP_NAME=Transform Output File
-OutputFileBlock_DEFAULT_RADIO=Default
-OutputFileBlock_OTHER_RADIO=Other
-OutputFileBlock_DIALOG_MESSAGE=Select an external output file
-OutputFileBlock_WORKSPACE_DIALOG_MESSAGE=Select an output file from the workspace
-OutputFileBlock_VARIABLES_BUTTON=Variables...
-OutputFileBlock_FILE_SYSTEM_BUTTON=File System...
-OutputFileBlock_WORKSPACE_BUTTON=Workspace...
-OutputFileBlock_Name=Transform Output File
-OutputFileBlock_Exception_occurred_reading_configuration=Exception occurred reading configuration
-OutputFileBlock_Exception_occurred_saving_configuration=Exception occurred saving launch configuration
-OutputFileBlock_WORKSPACE_DIALOG_TITLE=File Selection
-
-OutputFOFileBlock_DIRECTORY_NOT_SPECIFIED=Renderer output file not specified
-OutputFOFileBlock_DIRECTORY_DOES_NOT_EXIST=Renderer output file does not exist
-OutputFOFileBlock_GROUP_NAME=Renderer Output File
-OutputFOFileBlock_DEFAULT_RADIO=Default
-OutputFOFileBlock_OTHER_RADIO=Other
-OutputFOFileBlock_DIALOG_MESSAGE=Select an external output file
-OutputFOFileBlock_WORKSPACE_DIALOG_MESSAGE=Select an output file from the workspace
-OutputFOFileBlock_VARIABLES_BUTTON=Variables...
-OutputFOFileBlock_FILE_SYSTEM_BUTTON=File System...
-OutputFOFileBlock_WORKSPACE_BUTTON=Workspace...
-OutputFOFileBlock_Name=Renderer Output File
-OutputFOFileBlock_Exception_occurred_reading_configuration=Exception occurred reading configuration
-OutputFOFileBlock_Exception_occurred_saving_configuration=Exception occurred saving launch configuration
-OutputFOFileBlock_WORKSPACE_DIALOG_TITLE=File Selection
-
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/AbstractTableBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/AbstractTableBlock.java
deleted file mode 100644
index 53bc5c1..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/AbstractTableBlock.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * An <code>AbstractLaunchConfigurationTab</code> specialised for blocks that
- * contain a table. This abstract class conveniently saves and restores the table's
- * column settings.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public abstract class AbstractTableBlock extends AbstractLaunchConfigurationTab
-{
- private int fSortColumn;
-
- protected abstract Table getTable();
-
- protected abstract IDialogSettings getDialogSettings();
-
- protected abstract String getQualifier();
-
- protected void setSortColumn(int column)
- {
- fSortColumn = column;
- }
-
- /**
- * Persist table settings into the give dialog store, prefixed with the
- * given key.
- */
- public void saveColumnSettings()
- {
- int columnCount = getTable().getColumnCount();
- for (int i = 0; i < columnCount; i++)
- {
- getDialogSettings().put(getQualifier() + ".columnWidth" + i, getTable().getColumn(i).getWidth()); //$NON-NLS-1$
- }
- getDialogSettings().put(getQualifier() + ".sortColumn", fSortColumn); //$NON-NLS-1$
- }
-
- /**
- * Restore table settings from the given dialog store using the given key.
- */
- public void restoreColumnSettings()
- {
- getTable().layout(true);
- restoreColumnWidths(getDialogSettings(), getQualifier());
- int col = 0;
- try
- {
- col = getDialogSettings().getInt(getQualifier() + ".sortColumn"); //$NON-NLS-1$
- }
- catch (NumberFormatException e)
- {
- col = 1;
- }
- setSortColumn(col);
- }
-
- private void restoreColumnWidths(IDialogSettings settings, String qualifier)
- {
- int columnCount = getTable().getColumnCount();
- for (int i = 0; i < columnCount; i++)
- {
- int width = -1;
- try
- {
- width = settings.getInt(qualifier + ".columnWidth" + i); //$NON-NLS-1$
- }
- catch (NumberFormatException e)
- {
- }
-
- if (width > 0)
- getTable().getColumn(i).setWidth(width);
- }
- }
-
- @Override
- public void dispose()
- {
- if (getTable() != null && !getTable().isDisposed())
- saveColumnSettings();
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java
deleted file mode 100644
index 588b3a3..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-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.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-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.DirectoryDialog;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-
-/**
- * A block that shows a text box with buttons for browsing workspace or the filesystem
- * in order to populate the text box with a file path.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public abstract class ResourceSelectionBlock extends AbstractLaunchConfigurationTab
-{
- protected static final int ERROR_DIRECTORY_NOT_SPECIFIED = 1;
- protected static final int ERROR_DIRECTORY_DOES_NOT_EXIST = 2;
- protected static final int GROUP_NAME = 3;
- protected static final int USE_DEFAULT_RADIO = 4;
- protected static final int USE_OTHER_RADIO = 5;
- protected static final int DIRECTORY_DIALOG_MESSAGE = 6;
- protected static final int WORKSPACE_DIALOG_MESSAGE = 7;
- protected static final int VARIABLES_BUTTON = 8;
- protected static final int FILE_SYSTEM_BUTTON = 9;
- protected static final int WORKSPACE_BUTTON = 10;
- protected static final int WORKSPACE_DIALOG_TITLE = 11;
-
- protected Button fWorkspaceButton;
- protected Button fFileSystemButton;
- protected Button fVariablesButton;
- protected Button useDefaultCheckButton;
- protected Text resourceText;
- protected WidgetListener widgetListener = new WidgetListener();
- private ILaunchConfiguration fLaunchConfiguration;
- protected final boolean showDefault;
- private final int resourceType;
- private final boolean mustExist;
- protected boolean required;
- protected String defaultResource;
- protected String resource;
- protected String fileLabel = Messages.ResourceSelectionBlock_0;
-
- private final ISelectionStatusValidator validator = new ISelectionStatusValidator()
- {
- public IStatus validate(Object[] selection)
- {
- if (selection.length == 0)
- {
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- for (int i = 0; i < selection.length; i++)
- {
- if (resourceType == IResource.FOLDER && !(selection[i] instanceof IContainer))
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- else if (resourceType == IResource.FILE && !(selection[i] instanceof IFile))
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- return new Status(IStatus.OK, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- };
-
- class WidgetListener extends SelectionAdapter implements ModifyListener
- {
- public void modifyText(ModifyEvent e)
- {
- textModified();
- updateLaunchConfigurationDialog();
- }
-
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- Object source = e.getSource();
- if (source == fWorkspaceButton)
- {
- handleWorkspaceResourceBrowseButtonSelected();
- }
- else if (source == fFileSystemButton)
- {
- handleExternalResourceBrowseButtonSelected();
- }
- else if (source == fVariablesButton)
- {
- handleResourceVariablesButtonSelected();
- }
- else if (source == useDefaultCheckButton)
- {
- updateResourceText(useDefaultCheckButton.getSelection());
- }
- }
- }
-
- /**
- * Same as <code>new ResourceSelectionBlock(true)</code>
- */
- public ResourceSelectionBlock()
- {
- this(true);
- }
-
- /**
- * Same as <code>new ResourceSelectionBlock(IResource.FOLDER,showDefault)</code>
- *
- * @param showDefault true if this should have a 'Show Default' button
- */
- public ResourceSelectionBlock(boolean showDefault)
- {
- this(IResource.FOLDER, showDefault);
- }
-
- /**
- * Same as <code>new ResourceSelectionBlock(resourceType,showDefault,true)</code>
- *
- * @param resourceType the type of resource to select - IResource.FOLDER or IResource.FILE
- * @param showDefault true if this should have a 'Show Default' button
- */
- public ResourceSelectionBlock(int resourceType, boolean showDefault)
- {
- this(resourceType, showDefault, true);
- }
-
- /**
- * Same as <code>new ResourceSelectionBlock(resourceType,showDefault,required,true)</code>
- *
- * @param resourceType the type of resource to select - IResource.FOLDER or IResource.FILE
- * @param showDefault true if this should have a 'Show Default' button
- * @param required true if a blank text box is invalid
- */
- public ResourceSelectionBlock(int resourceType, boolean showDefault, boolean required)
- {
- this(resourceType, showDefault, required, true);
- }
-
- /**
- * Create a new instance of this.
- *
- * @param resourceType the type of resource to select - IResource.FOLDER or IResource.FILE
- * @param showDefault true if this should have a 'Show Default' button
- * @param required true if a blank text box is invalid
- * @param mustExist true of the selected resource must already exist
- */
- public ResourceSelectionBlock(int resourceType, boolean showDefault, boolean required, boolean mustExist)
- {
- super();
- this.showDefault = showDefault;
- this.resourceType = resourceType;
- this.required = required;
- this.mustExist = mustExist;
- }
-
- public void createControl(Composite parent)
- {
- Composite group = createContainer(parent);
- setControl(group);
- createContents(group);
- }
-
- protected Composite createContainer(Composite parent)
- {
- Group group = new Group(parent, SWT.NONE);
- group.setText(getMessage(GROUP_NAME));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp...
- GridLayout groupLayout = new GridLayout();
- groupLayout.numColumns = 2;
- groupLayout.makeColumnsEqualWidth = false;
- group.setLayout(groupLayout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
- group.setFont(parent.getFont());
- return group;
- }
-
- protected void createContents(Composite parent)
- {
- createCheckboxAndText(parent);
- createButtons(parent);
- }
-
- protected void createCheckboxAndText(Composite parent)
- {
- if (showDefault)
- {
- useDefaultCheckButton = createCheckButton(parent, getMessage(USE_DEFAULT_RADIO));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 2;
- useDefaultCheckButton.setLayoutData(gd);
- useDefaultCheckButton.addSelectionListener(widgetListener);
- }
-
- Composite specificFileComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- if (showDefault)
- layout.marginLeft = 20;
- else
- layout.marginLeft = 0;
- layout.marginHeight = 0;
- specificFileComp.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- specificFileComp.setLayoutData(gd);
-
- if (showDefault)
- {
- Label label = new Label(specificFileComp, SWT.NONE);
- label.setText(fileLabel);
- }
-
- resourceText = new Text(specificFileComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = showDefault ? 1 : 2;
- resourceText.setLayoutData(gd);
- resourceText.setFont(parent.getFont());
- resourceText.addModifyListener(widgetListener);
- }
-
- protected void createButtons(Composite parent)
- {
- // filler
- new Label(parent, SWT.NONE);
-
- Composite buttonComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonComp.setLayout(layout);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gd.horizontalSpan = 1;
- buttonComp.setLayoutData(gd);
- buttonComp.setFont(parent.getFont());
-
- fWorkspaceButton = createPushButton(buttonComp, getMessage(WORKSPACE_BUTTON), null);
- fWorkspaceButton.addSelectionListener(widgetListener);
-
- fFileSystemButton = createPushButton(buttonComp, getMessage(FILE_SYSTEM_BUTTON), null);
- fFileSystemButton.addSelectionListener(widgetListener);
-
- fVariablesButton = createPushButton(buttonComp, getMessage(VARIABLES_BUTTON), null);
- fVariablesButton.addSelectionListener(widgetListener);
- }
-
- protected void updateResourceText(boolean useDefault)
- {
- if (useDefault)
- {
- resourceText.setText(defaultResource == null ? "" : defaultResource); //$NON-NLS-1$
- }
- else
- {
- resourceText.setText(resource == null ? "" : resource); //$NON-NLS-1$
- }
- resourceText.setEnabled(!useDefault);
- fFileSystemButton.setEnabled(!useDefault);
- fVariablesButton.setEnabled(!useDefault);
- fWorkspaceButton.setEnabled(!useDefault);
- }
-
- @Override
- public void dispose()
- {
- }
-
- protected void handleExternalResourceBrowseButtonSelected()
- {
- String currentWorkingDir = getText();
- String selected = null;
- if (resourceType == IResource.FOLDER)
- {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(getMessage(DIRECTORY_DIALOG_MESSAGE));
- if (!currentWorkingDir.trim().equals("")) //$NON-NLS-1$
- {
- File path = new File(currentWorkingDir);
- if (path.exists())
- {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
- selected = dialog.open();
- }
- else
- {
- FileDialog dialog = new FileDialog(getShell());
- if (!currentWorkingDir.trim().equals("")) //$NON-NLS-1$
- {
- File path = new File(currentWorkingDir);
- if (path.exists())
- {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
- String[] fileExtensions = getFileExtensions();
- if (fileExtensions != null)
- {
- String[] filterExtensions = new String[fileExtensions.length];
- for (int i = 0; i < fileExtensions.length; i++)
- {
- String ext = fileExtensions[i];
- filterExtensions[i] = "*." + ext; //$NON-NLS-1$
- }
- dialog.setFilterExtensions(filterExtensions);
- }
- selected = dialog.open();
- }
- if (selected != null)
- {
- resourceText.setText(selected);
- }
- }
-
- protected String[] getFileExtensions()
- {
- return null;
- }
-
- protected void handleWorkspaceResourceBrowseButtonSelected()
- {
- IPath path = openWorkspaceResourceDialog();
- if (path != null)
- setText("${workspace_loc:" + path.toString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected IPath openWorkspaceResourceDialog()
- {
- IResource currentResource = getResource();
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(getMessage(WORKSPACE_DIALOG_TITLE));
- dialog.setMessage(getMessage(WORKSPACE_DIALOG_MESSAGE));
- dialog.setValidator(validator);
- dialog.addFilter(new ViewerFilter()
- {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (element instanceof IContainer)
- return true;
- if (resourceType != IResource.FILE)
- return false;
- IFile file = (IFile) element;
- String[] extensions = getFileExtensions();
- if (extensions == null)
- return true;
- String fileExt = file.getFileExtension();
- if (fileExt != null)
- {
- for (String ext : extensions)
- {
- if (fileExt.equalsIgnoreCase(ext))
- return true;
- }
- }
- return false;
- }
- });
- ViewerFilter filter = getResourceFilter();
- if (filter != null)
- dialog.addFilter(filter);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setInitialSelection(currentResource);
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setAllowMultiple(false);
-
- if (dialog.open() == Window.OK)
- {
- Object[] elements = dialog.getResult();
- if (elements.length > 0)
- return ((IResource) elements[0]).getFullPath();
- }
- return null;
- }
-
- protected ViewerFilter getResourceFilter()
- {
- return null;
- }
-
- /**
- * Returns the selected workspace container,or <code>null</code>
- */
- protected IResource getResource()
- {
- String path = getText();
- if (path.length() > 0)
- {
- IResource res = null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- if (path.startsWith("${workspace_loc:")) //$NON-NLS-1$
- {
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try
- {
- path = manager.performStringSubstitution(path, false);
- URI pathURI = new URL(path).toURI();
- if (resourceType == IResource.FOLDER)
- {
- IContainer[] containers = root.findContainersForLocationURI(pathURI);
- if (containers.length > 0)
- {
- res = containers[0];
- }
- }
- else if (resourceType == IResource.FILE)
- {
- IFile[] files = root.findFilesForLocationURI(pathURI);
- if (files.length > 0)
- {
- res = files[0];
- }
- }
- }
- catch (CoreException e)
- {
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- else
- {
- res = root.findMember(path);
- }
- return res;
- }
- return null;
- }
-
- protected void handleResourceVariablesButtonSelected()
- {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variableText = dialog.getVariableExpression();
- if (variableText != null)
- {
- resourceText.insert(variableText);
- }
- }
-
- protected abstract void setDefaultResource();
-
- @Override
- public boolean isValid(ILaunchConfiguration config)
- {
- setErrorMessage(null);
- setMessage(null);
- // if variables are present, we cannot resolve the directory
- String workingDirPath = getText();
- if (workingDirPath.indexOf("${") >= 0) //$NON-NLS-1$
- {
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try
- {
- manager.validateStringVariables(workingDirPath);
- if (mustExist)
- {
- String path = manager.performStringSubstitution(workingDirPath);
- validateResource(path);
- }
- }
- catch (CoreException e)
- {
- setErrorMessage(e.getMessage());
- return false;
- }
- }
- else if (mustExist && workingDirPath.length() > 0)
- {
- return validateResource(workingDirPath);
- }
- else if (required && workingDirPath.length() == 0)
- {
- setErrorMessage(getMessage(ERROR_DIRECTORY_NOT_SPECIFIED));
- }
- return true;
- }
-
- protected boolean validateResource(String workingDirPath)
- {
- if (resourceType == IResource.FOLDER)
- {
- IContainer container = (IContainer) getResource();
- if (container == null)
- {
- File dir = new File(workingDirPath);
- if (dir.isDirectory())
- {
- return true;
- }
- }
- else
- return true;
- }
- else if (resourceType == IResource.FILE)
- {
- File file = new File(workingDirPath);
- if (file.isFile())
- {
- return true;
- }
- }
- setErrorMessage(getMessage(ERROR_DIRECTORY_DOES_NOT_EXIST));
- return false;
- }
-
- protected abstract String getMessage(int type);
-
- protected void textModified()
- {
- }
-
- protected String getText()
- {
- return resourceText.getText().trim();
- }
-
- protected void setText(String text)
- {
- resourceText.setText(text);
- }
-
- protected void setLaunchConfiguration(ILaunchConfiguration config)
- {
- fLaunchConfiguration = config;
- }
-
- protected ILaunchConfiguration getLaunchConfiguration()
- {
- return fLaunchConfiguration;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIConstants.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIConstants.java
deleted file mode 100644
index c983bae..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIConstants.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-/**
- * Constants for the XSL Debug UI.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class XSLDebugUIConstants
-{
- private static final String PREFIX = XSLDebugUIPlugin.PLUGIN_ID + '.';
- /**
- * Constant used to store column setting preferences for the <code>InstalledProcessorsBlock</code>
- */
- public static final String PROCESSOR_DETAILS_DIALOG = PREFIX + "PROCESSOR_DETAILS_DIALOG"; //$NON-NLS-1$
- /**
- * Constant used to store column setting preferences for the <code>ParametersBlock</code>
- */
- public static final String MAIN_PARAMATERS_BLOCK = PREFIX + "MAIN_PARAMATERS_BLOCK"; //$NON-NLS-1$
- /**
- * Constant used to store column setting preferences for the <code>TransformsBlock</code>
- */
- public static final String MAIN_TRANSFORMS_BLOCK = PREFIX + "MAIN_TRANSFORMS_BLOCK"; //$NON-NLS-1$
- /**
- * Constant used to store column setting preferences for the <code>OutputBlock</code>
- */
- public static final String OUTPUT_BLOCK = PREFIX + "OUTPUT_BLOCK"; //$NON-NLS-1$
- /**
- * The id of the XSL editor
- */
- public static final String XSL_EDITOR_ID = "org.eclipse.wst.xsl.ui.XSLEditor"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUILaunchListener.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUILaunchListener.java
deleted file mode 100644
index 8cbefaf..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUILaunchListener.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import java.io.File;
-
-import org.eclipse.core.commands.common.CommandException;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.xsl.launching.config.BaseLaunchHelper;
-
-/**
- * A listener to XSL launches. When an XSL launch is terminated, this performs the UI parts of the
- * XSL launching - such as open the editor on the output file, and format it.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class XSLDebugUILaunchListener implements ILaunchesListener2
-{
- public static final String XSL_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.wst.xsl.launching.launchConfigurationType";
-
- /**
- * Starts the launch listening
- */
- public void start()
- {
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- }
-
- /**
- * Stops the launch listening
- */
- public void stop()
- {
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- }
-
- public void launchesTerminated(ILaunch[] launches)
- {
- for (ILaunch launch : launches)
- {
- ILaunchConfigurationType configType = null;
- try
- {
- configType = launch.getLaunchConfiguration().getType();
- }
- catch (CoreException e)
- {
- // do nothing
- }
- if (configType != null && XSL_LAUNCH_CONFIGURATION_TYPE.equals(configType.getIdentifier()))
- {
- try
- {
- BaseLaunchHelper launchHelper = new BaseLaunchHelper(launch.getLaunchConfiguration());
- File file = launchHelper.getTarget();
- IFile ifile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(file.getAbsolutePath()));
- if (ifile != null)
- {// refresh this workspace file..
- try
- {
- ifile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
- openFileIfRequired(launchHelper);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
- }
- }
-
- public void launchesAdded(ILaunch[] launches)
- {
- // do nothing
- }
-
- public void launchesChanged(ILaunch[] launches)
- {
- // do nothing
- }
-
- public void launchesRemoved(ILaunch[] launches)
- {
- // do nothing
- }
-
- private void openFileIfRequired(final BaseLaunchHelper launchHelper)
- {
- if (launchHelper.getOpenFileOnCompletion())
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- // Open editor on new file.
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- File file = launchHelper.getTarget();
- Path path = new Path(file.getAbsolutePath());
- IFileStore filestore = EFS.getLocalFileSystem().getStore(path);
- IDE.openEditorOnFileStore(dw.getActivePage(), filestore);
-
- if (launchHelper.getFormatFileOnCompletion())
- {
- // format the editor contents
- IHandlerService p = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
- p.executeCommand("org.eclipse.wst.sse.ui.format.document", null);
- }
- }
- catch (PartInitException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (CommandException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
- });
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIPlugin.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIPlugin.java
deleted file mode 100644
index 5cf1503..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLDebugUIPlugin.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.preference.PreferenceNode;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-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;
-
-/**
- * The XSL Debug UI plugin.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class XSLDebugUIPlugin extends AbstractUIPlugin
-{
- /**
- * The id of this.
- */
- public static final String PLUGIN_ID = "org.eclipse.wst.xsl.debug.ui"; //$NON-NLS-1$
-
- // The shared instance
- private static XSLDebugUIPlugin plugin;
-
- private XSLDebugUILaunchListener launchListener = new XSLDebugUILaunchListener();
-
- /**
- * Create a new instance of this.
- */
- public XSLDebugUIPlugin()
- {
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- launchListener.start();
- }
-
- @Override
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- launchListener.stop();
- super.stop(context);
- }
-
- /**
- * Get the singleton instance of this.
- *
- * @return the singleton
- */
- public static XSLDebugUIPlugin getDefault()
- {
- return plugin;
- }
-
- /**
- * Get an ImageDescriptor from a path in this bundle.
- *
- * @param path the path to the image
- * @return the ImageDescriptor
- */
- public static ImageDescriptor getImageDescriptor(String path)
- {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
- * Convenience method for opening a given preference page.
- *
- * @param id the id of the preference page
- * @param page the preference page to show
- */
- public static void showPreferencePage(String id, IPreferencePage page)
- {
- final IPreferenceNode targetNode = new PreferenceNode(id, page);
-
- PreferenceManager manager = new PreferenceManager();
- manager.addToRoot(targetNode);
- final PreferenceDialog dialog = new PreferenceDialog(XSLDebugUIPlugin.getActiveWorkbenchShell(), manager);
- final boolean[] result = new boolean[]
- { false };
- BusyIndicator.showWhile(XSLDebugUIPlugin.getStandardDisplay(), new Runnable()
- {
- public void run()
- {
- dialog.create();
- dialog.setMessage(targetNode.getLabelText());
- result[0] = (dialog.open() == Window.OK);
- }
- });
- }
-
- /**
- * Get the current Display if possible, or else the default Display.
- *
- * @return the current or default Display
- */
- public static Display getStandardDisplay()
- {
- Display display;
- display = Display.getCurrent();
- if (display == null)
- display = Display.getDefault();
- return display;
- }
-
- /**
- * Get the active workbench window from the workbench.
- *
- * @return the active workbench window
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow()
- {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- /**
- * Get the shell of the active workbench window.
- *
- * @return the active workbench shell
- */
- public static Shell getActiveWorkbenchShell()
- {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window != null)
- {
- return window.getShell();
- }
- return null;
- }
-
- /**
- * Get the active page of the active workbench window.
- *
- * @return the active page
- */
- public static IWorkbenchPage getActivePage()
- {
- IWorkbenchWindow w = getActiveWorkbenchWindow();
- if (w != null)
- {
- return w.getActivePage();
- }
- return null;
- }
-
- /**
- * Log the given exception by creating a new Status.
- *
- * @param e the exception to log
- */
- public static void log(Exception e)
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, "", e)); //$NON-NLS-1$
- }
-
- /**
- * Log the given core exception.
- *
- * @param e the exception to log
- */
- public static void log(CoreException e)
- {
- getDefault().getLog().log(e.getStatus());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchConfigurationTab.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchConfigurationTab.java
deleted file mode 100644
index beeabcf..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchConfigurationTab.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The base class for XSL launch configuration tabs which allows a number of 'blocks' to be added.
- * Each block must itself fully implement <code>ILaunchConfigurationTab</code>.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public abstract class XSLLaunchConfigurationTab extends AbstractLaunchConfigurationTab
-{
- private ILaunchConfigurationTab[] blocks;
-
- protected void setBlocks(ILaunchConfigurationTab[] blocks)
- {
- this.blocks = blocks;
- }
-
- public void createControl(Composite parent)
- {
- Composite comp = new Composite(parent, SWT.NONE);
- comp.setFont(parent.getFont());
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- comp.setLayout(layout);
- setControl(comp);
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- for (ILaunchConfigurationTab element : blocks)
- element.setDefaults(configuration);
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- for (ILaunchConfigurationTab element : blocks)
- element.initializeFrom(configuration);
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- for (ILaunchConfigurationTab element : blocks)
- element.performApply(configuration);
- }
-
- @Override
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog)
- {
- super.setLaunchConfigurationDialog(dialog);
- for (ILaunchConfigurationTab element : blocks)
- element.setLaunchConfigurationDialog(dialog);
- }
-
- @Override
- public void dispose()
- {
- for (ILaunchConfigurationTab element : blocks)
- element.dispose();
- }
-
- @Override
- public void activated(ILaunchConfigurationWorkingCopy workingCopy)
- {
- // don't call initializeFrom
- // super.activated(workingCopy);
- for (ILaunchConfigurationTab element : blocks)
- element.activated(workingCopy);
- }
-
-// @Override
-// protected boolean isDirty()
-// {
-// for (ILaunchConfigurationTab element : blocks)
-// if (((XSLLaunchConfigurationTab)element).isDirty())
-// return true;
-// return super.isDirty();
-// }
-
- @Override
- public boolean isValid(ILaunchConfiguration configuration)
- {
- boolean valid = true;
- for (ILaunchConfigurationTab element : blocks)
- valid &= element.isValid(configuration);
- return valid;
- }
-
- @Override
- public String getErrorMessage()
- {
- String m = super.getErrorMessage();
- if (m == null)
- {
- for (ILaunchConfigurationTab element : blocks)
- {
- m = element.getErrorMessage();
- if (m != null)
- break;
- }
- }
- return m;
- }
-
- @Override
- public String getMessage()
- {
- String m = super.getMessage();
- if (m == null)
- {
- for (ILaunchConfigurationTab element : blocks)
- {
- m = element.getMessage();
- if (m != null)
- break;
- }
- }
- return m;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchShortcut.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchShortcut.java
deleted file mode 100644
index 9690dfa..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLLaunchShortcut.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-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.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.InputFileBlock;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.launching.config.BaseLaunchHelper;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * <table border=1>
- * <th>
- * <tr>
- * <td>XML Files</td>
- * <td>XSL Files</td>
- * <td>Action</td>
- * </tr>
- * </th>
- * <tbody>
- * <tr>
- * <td>1</td>
- * <td>0</td>
- * <td>Launch assuming embedded stylesheet instruction</td>
- * </tr>
- * <tr>
- * <td>0</td>
- * <td>&gt;=1</td>
- * <td>Open dialog - prompt for input file</td>
- * </tr>
- * <tr>
- * <td>1</td>
- * <td>&gt;=1</td>
- * <td>Launch</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * <p>The launch shortcut should not appear in the menu for any other combination of files</p>
- * <p>In all cases, a check must be performed to find any existing launch configuration that uses the selected files.</p>
- *
- * @author Doug
- * @since 1.0
- */
-public class XSLLaunchShortcut implements ILaunchShortcut
-{
- private IFile xmlFile;
- private IPath xmlFilePath;
- private IFile[] xslFiles;
-
- public void launch(ISelection selection, String mode)
- {
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection ssel = (IStructuredSelection)selection;
- searchAndLaunch(ssel.toArray(),mode);
- }
- }
-
- public void launch(IEditorPart editor, String mode)
- {
- IEditorInput input = editor.getEditorInput();
- if (input != null)
- {
- IFile file = (IFile) input.getAdapter(IFile.class);
- if (file != null)
- searchAndLaunch(new Object[]{ file }, mode);
- }
- }
-
- private void searchAndLaunch(Object[] objects, String mode)
- {
- if (fillFiles(objects))
- {
- // ensure we have an input file
- if (xmlFile == null)
- promptForInput();
- if (xmlFile != null || xmlFilePath != null)
- launch(mode);
- }
- }
-
- private void promptForInput()
- {
- // prompt for input xml file
- StatusDialog dialog = new StatusDialog(getShell()){
- private InputFileBlock inputFileBlock = new InputFileBlock(null);
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- Composite comp = (Composite)super.createDialogArea(parent);
- comp.setFont(parent.getFont());
- GridLayout layout = new GridLayout(1, false);
- comp.setLayout(layout);
-
- Label label = new Label(comp,SWT.NONE);
- label.setFont(comp.getFont());
- GridData gd = new GridData();
- gd.horizontalIndent = 5;
- gd.verticalIndent = 5;
- gd.widthHint = 380;
- label.setLayoutData(gd);
- label.setText(Messages.XSLLaunchShortcut_0);
-
- inputFileBlock.createControl(comp);
- return comp;
- }
-
- @Override
- protected void okPressed()
- {
- IResource res = inputFileBlock.getResource();
- if (res == null)
- xmlFilePath = new Path(inputFileBlock.getText());
- else if (ResourcesPlugin.getWorkspace().getRoot().exists(res.getFullPath()) && res.getType() == IResource.FILE)
- xmlFile = (IFile)res;
- super.okPressed();
- }
-
- };
- dialog.setHelpAvailable(false);
- dialog.setStatusLineAboveButtons(true);
- dialog.setTitle(Messages.XSLLaunchShortcut_1);
- dialog.open();
- }
-
- private boolean fillFiles(Object[] selections)
- {
- xmlFile = null;
- xmlFilePath = null;
- List<IFile> xslFileList = new ArrayList<IFile>();
- for (Object object : selections)
- {
- IResource resource = (IResource)object;
- if (resource.getType() == IResource.FILE)
- {
- IFile file = (IFile)resource;
- if (XSLCore.isXMLFile(file))
- {
- if (XSLCore.isXSLFile(file))
- xslFileList.add(file);
- else if (xmlFile==null)
- xmlFile = file;
- else
- return false; // no action if we have more than than 1 xml file
- }
- }
- }
- xslFiles = xslFileList.toArray(new IFile[0]);
- return true;
- }
-
- private void launch(String mode)
- {
- if (xmlFile!=null)
- xmlFilePath = xmlFile.getLocation();
- ILaunchConfiguration config = null;
- try
- {
- config = findOrCreateLaunchConfiguration();
- if (config!=null)
- DebugUITools.launch(config, mode);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- private ILaunchManager getLaunchManager()
- {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private ILaunchConfigurationType getConfigurationType()
- {
- return getLaunchManager().getLaunchConfigurationType(XSLLaunchConfigurationConstants.ID_LAUNCH_CONFIG_TYPE);
- }
-
- private ILaunchConfiguration findOrCreateLaunchConfiguration() throws CoreException
- {
- ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(getConfigurationType());
- List<ILaunchConfiguration> candidateConfigs = new ArrayList<ILaunchConfiguration>(configs.length);
- for (ILaunchConfiguration config : configs)
- {
- String inputFile = config.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null);
- try
- {
- inputFile = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(inputFile);
- }
- catch (CoreException e)
- {
- // just ignore this one
- continue;
- }
- Path path = new Path(inputFile);
- // the source xml file must be the same
- if (path.equals(xmlFilePath))
- {
- BaseLaunchHelper lh = new BaseLaunchHelper(config);
- // all the selected stylesheets must be in the pipeline
- boolean found = false;
- for (IFile stylesheet : xslFiles)
- {
- found = false;
- for (Iterator<LaunchTransform> iter = lh.getPipeline().getTransformDefs().iterator(); iter.hasNext();)
- {
- LaunchTransform lt = iter.next();
- if (lt.getLocation().equals(stylesheet.getLocation()))
- {
- found = true;
- break;
- }
- }
- if (!found)
- break;
- }
- if (found)
- candidateConfigs.add(config);
- }
- }
-
- ILaunchConfiguration config = null;
- int candidateCount = candidateConfigs.size();
- if (candidateCount == 1)
- config = candidateConfigs.get(0);
- else if (candidateCount > 1)
- config = chooseConfiguration(candidateConfigs);
- else
- config = createConfiguration();
-
- return config;
- }
-
- private ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList)
- {
- IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setElements(configList.toArray());
- dialog.setTitle(Messages.XSLLaunchShortcut_2);
- dialog.setMessage(Messages.XSLSelectExisting);
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- labelProvider.dispose();
- if (result == Window.OK)
- {
- return (ILaunchConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- private ILaunchConfiguration createConfiguration()
- {
- ILaunchConfiguration config = null;
- try
- {
- ILaunchConfigurationType configType = getConfigurationType();
- ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(xmlFilePath.lastSegment()));
- if (xmlFile != null)
- wc.setAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, "${workspace_loc:" + xmlFile.getFullPath().toPortableString()+"}"); //$NON-NLS-1$ //$NON-NLS-2$
- else
- wc.setAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, xmlFilePath.toPortableString());
-
- wc.setAttribute(XSLLaunchConfigurationConstants.ATTR_USE_DEFAULT_OUTPUT_FILE, true);
- wc.setAttribute(XSLLaunchConfigurationConstants.ATTR_OPEN_FILE, true);
-
- LaunchPipeline pipeline = new LaunchPipeline();
- for (IFile element : xslFiles)
- {
- pipeline.addTransformDef(new LaunchTransform(element.getFullPath().toPortableString(), LaunchTransform.RESOURCE_TYPE));
- }
- wc.setAttribute(XSLLaunchConfigurationConstants.ATTR_PIPELINE, pipeline.toXML());
- if (xmlFile!=null)
- wc.setMappedResources(new IResource[]{ xmlFile.getProject() });
- config = wc.doSave();
- }
- catch (CoreException exception)
- {
- MessageDialog.openError(getShell(), Messages.XSLLaunchShortcut_6, exception.getStatus().getMessage());
- }
- return config;
- }
-
- protected Shell getShell()
- {
- return XSLDebugUIPlugin.getActiveWorkbenchShell();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLTTabGroup.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLTTabGroup.java
deleted file mode 100644
index 42ba093..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/XSLTTabGroup.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.XSLMainTab;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.output.OutputTab;
-
-/**
- *The tab group for the XSL tabs.
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class XSLTTabGroup extends AbstractLaunchConfigurationTabGroup
-{
- /**
- * Create a new instance of this.
- */
- public XSLTTabGroup()
- {
- }
-
- public void createTabs(ILaunchConfigurationDialog dialog, String mode)
- {
- XSLMainTab main = new XSLMainTab();
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { main, new OutputTab(main) };
- tabs = addTabs(tabs, new ILaunchConfigurationTab[] { new SourceLookupTab(), new CommonTab() });
-
- setTabs(tabs);
- }
-
- private ILaunchConfigurationTab[] addTabs(ILaunchConfigurationTab[] tabs1, ILaunchConfigurationTab[] tabs2)
- {
- ILaunchConfigurationTab[] newTabs = new ILaunchConfigurationTab[tabs1.length + tabs2.length];
- System.arraycopy(tabs1, 0, newTabs, 0, tabs1.length);
- System.arraycopy(tabs2, 0, newTabs, tabs1.length, tabs2.length);
- return newTabs;
- }
-
- @Override
- public void setTabs(ILaunchConfigurationTab[] tabs)
- {
- // TODO Auto-generated method stub
- super.setTabs(tabs);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractParameterAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractParameterAction.java
deleted file mode 100644
index d19b75b..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractParameterAction.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.ParameterViewer;
-
-/**
- * A convenient base class for add/remove parameter actions.
- *
- * @author Doug Satchwell
- */
-public abstract class AbstractParameterAction extends SelectionListenerAction
-{
- private ParameterViewer viewer;
- private Button button;
- private Shell shell;
-
- protected AbstractParameterAction(String text, ParameterViewer viewer)
- {
- super(text);
- setViewer(viewer);
- }
-
- /**
- * Set the viewer.
- *
- * @param viewer the parametere viewer
- */
- public void setViewer(ParameterViewer viewer)
- {
- if (this.viewer != null)
- {
- this.viewer.removeSelectionChangedListener(this);
- }
- this.viewer = viewer;
- if (viewer != null)
- {
- viewer.addSelectionChangedListener(this);
- update();
- }
- }
-
- protected ParameterViewer getViewer()
- {
- return viewer;
- }
-
- /**
- * Set the button associated with the action.
- *
- * @param button the button
- */
- public void setButton(Button button)
- {
- this.button = button;
- button.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent evt)
- {
- run();
- }
- });
- button.setEnabled(isEnabled());
- }
-
- @Override
- public void setEnabled(boolean enabled)
- {
- super.setEnabled(enabled);
- if (button != null)
- {
- button.setEnabled(enabled);
- }
- }
-
- protected void update()
- {
- selectionChanged((IStructuredSelection) getViewer().getSelection());
- }
-
- protected Shell getShell()
- {
- if (shell == null)
- {
- shell = getViewer().getShell();
- }
- return shell;
- }
-
- /**
- * Set the shell that will be used for opening a dialog.
- *
- * @param shell the shell to use
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
-
- @Override
- protected boolean updateSelection(IStructuredSelection selection)
- {
- return getViewer().updateSelection(getActionType(), selection);
- }
-
- protected int getActionType()
- {
- return AbstractStylesheetAction.DEFAULT;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractStylesheetAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractStylesheetAction.java
deleted file mode 100644
index d2d8b61..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AbstractStylesheetAction.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-/**
- * A convenient base class for actions associated with the stylesheet viewer.
- *
- * @author Doug Satchwell
- */
-public abstract class AbstractStylesheetAction extends SelectionListenerAction
-{
- /**
- * The default action type.
- */
- public static final int DEFAULT = 0;
- /**
- * The action type for add actions.
- */
- public static final int ADD = 1;
- /**
- * The action type for remove actions.
- */
- public static final int REMOVE = 2;
- /**
- * The action type for move actions.
- */
- public static final int MOVE = 3;
-
- private StylesheetViewer viewer;
- private Button button;
- private Shell shell;
-
- protected AbstractStylesheetAction(String text, StylesheetViewer viewer)
- {
- super(text);
- setViewer(viewer);
- }
-
- /**
- * Add an array of LaunchTransform's to the viewer.
- *
- * @param res launch transforms to add
- */
- public void addTransforms(LaunchTransform[] res)
- {
- viewer.addTransforms(res);
- }
-
- /**
- * Set the viewer associated with this action.
- *
- * @param viewer the viewer
- */
- public void setViewer(StylesheetViewer viewer)
- {
- if (this.viewer != null)
- {
- this.viewer.removeSelectionChangedListener(this);
- }
- this.viewer = viewer;
- if (viewer != null)
- {
- viewer.addSelectionChangedListener(this);
- update();
- }
- }
-
- protected StylesheetViewer getViewer()
- {
- return viewer;
- }
-
- /**
- * Set the button associated with this action.
- *
- * @param button the button
- */
- public void setButton(Button button)
- {
- this.button = button;
- button.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent evt)
- {
- run();
- }
- });
- button.setEnabled(isEnabled());
- }
-
- @Override
- public void setEnabled(boolean enabled)
- {
- super.setEnabled(enabled);
- if (button != null)
- {
- button.setEnabled(enabled);
- }
- }
-
- protected void update()
- {
- selectionChanged((IStructuredSelection) getViewer().getSelection());
- }
-
- protected Shell getShell()
- {
- if (shell == null)
- {
- shell = getViewer().getShell();
- }
- return shell;
- }
-
- /**
- * Set the shell to be used for opening a dialog.
- *
- * @param shell the shell to use
- */
- public void setShell(Shell shell)
- {
- this.shell = shell;
- }
-
- @Override
- protected boolean updateSelection(IStructuredSelection selection)
- {
- return getViewer().updateSelection(getActionType(), selection);
- }
-
- protected int getActionType()
- {
- return DEFAULT;
- }
-
- protected List<?> getOrderedSelection()
- {
- List<?> selection = ((IStructuredSelection) getViewer().getSelection()).toList();
- return selection;
- }
-
- protected List<LaunchTransform> getEntriesAsList()
- {
- // IStylesheetEntry[] entries = getViewer().getEntries();
- // List list = new ArrayList(entries.length);
- // for (int i = 0; i < entries.length; i++) {
- // list.add(entries[i]);
- // }
- LaunchPipeline lp = (LaunchPipeline) getViewer().getInput();
- return lp.getTransformDefs();
- }
-
- protected void setEntries(List<?> list)
- {
- getViewer().setEntries(list.toArray(new LaunchTransform[list.size()]));
- // // update all selection listeners
- // getViewer().setSelection(getViewer().getSelection());
- }
-
- protected boolean isIndexSelected(IStructuredSelection selection, int index)
- {
- if (selection.isEmpty())
- {
- return false;
- }
- Iterator<?> entries = selection.iterator();
- List<?> list = getEntriesAsList();
- while (entries.hasNext())
- {
- Object next = entries.next();
- if (list.indexOf(next) == index)
- {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddExternalFileAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddExternalFileAction.java
deleted file mode 100644
index d4c9f6c..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddExternalFileAction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-
-/**
- * An action that opens a dialog to allow the user to select a file from the file system.
- *
- * @author Doug Satchwell
- */
-public class AddExternalFileAction extends OpenDialogAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer the stylesheet viewer
- * @param dialogSettingsPrefix a prefix to use for saving dialog preferences
- */
- public AddExternalFileAction(StylesheetViewer viewer, String dialogSettingsPrefix)
- {
- super(Messages.AddExternalFileAction_Text, viewer, dialogSettingsPrefix);
- }
-
- @Override
- public void run()
- {
- String lastUsedPath = getDialogSetting(LAST_PATH_SETTING);
- if (lastUsedPath == null)
- {
- lastUsedPath = ""; //$NON-NLS-1$
- }
- FileDialog dialog = new FileDialog(getShell(), SWT.MULTI);
- dialog.setText(Messages.AddExternalFileAction_Selection_3);
- dialog.setFilterPath(lastUsedPath);
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- IContentType contentType = contentTypeManager.getContentType("org.eclipse.wst.xml.core.xslsource"); //$NON-NLS-1$
- String[] xslContentTypes = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
-
- dialog.setFilterExtensions(xslContentTypes);
- String res = dialog.open();
- if (res == null)
- {
- return;
- }
-
- IPath filterPath = new Path(dialog.getFilterPath());
- LaunchTransform[] lts = new LaunchTransform[1];
- IPath path = new Path(res).makeAbsolute();
- lts[0] = new LaunchTransform(path.toPortableString(), LaunchTransform.EXTERNAL_TYPE);
-
- setDialogSetting(LAST_PATH_SETTING, filterPath.toOSString());
-
- addTransforms(lts);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddParameterAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddParameterAction.java
deleted file mode 100644
index 805e312..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddParameterAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.ParameterViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * An action that opens a dialog to allow the user to add a parameter to a transform.
- *
- * @author Doug Satchwell
- */
-public class AddParameterAction extends AbstractParameterAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer teh viewer
- */
- public AddParameterAction(ParameterViewer viewer)
- {
- super(Messages.AddParameterAction, viewer);
- }
-
- @Override
- public void run()
- {
- MultipleInputDialog dialog = new MultipleInputDialog(getShell(), Messages.AddParameterAction_Dialog);
- String namelabel = Messages.AddParameterAction_Dialog_Name;
- dialog.addTextField(namelabel, null, false);
- String variableslabel = Messages.AddParameterAction_Dialog_Value;
- dialog.addVariablesField(variableslabel, null, false);
- dialog.open();
-
- if (dialog.getReturnCode() == Window.OK)
- {
- String name = dialog.getStringValue(namelabel);
- String value = dialog.getStringValue(variableslabel);
- LaunchAttribute parameter = null;
- if (value != null && value.indexOf("${") > -1) //$NON-NLS-1$
- parameter = new LaunchAttribute(name, null, value);
- else
- parameter = new LaunchAttribute(name, null, value);
- getViewer().addParameter(parameter);
- }
- }
-
- @Override
- public void setEnabled(boolean enabled)
- {
- // do nothing
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddWorkspaceFileAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddWorkspaceFileAction.java
deleted file mode 100644
index 1ff35b7..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/AddWorkspaceFileAction.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * An action that opens a dialog to allow the user to select a file in the workspace.
- *
- * @author Doug Satchwell
- */
-public class AddWorkspaceFileAction extends AbstractStylesheetAction
-{
- private final ISelectionStatusValidator validator = new ISelectionStatusValidator()
- {
- public IStatus validate(Object[] selection)
- {
- if (selection.length == 0)
- {
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- for (int i = 0; i < selection.length; i++)
- {
- if (!(selection[i] instanceof IFile))
- {
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- }
- return new Status(IStatus.OK, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- };
-
- /**
- * Create a new instance of this.
- *
- * @param viewer the viewer
- */
- public AddWorkspaceFileAction(StylesheetViewer viewer)
- {
- super(Messages.AddWorkspaceFileAction_Text, viewer);
- }
-
- @Override
- public void run()
- {
-
- // ViewerFilter filter= new StylesheetFilter(getSelectedJars());
-
- ILabelProvider lp = new WorkbenchLabelProvider();
- ITreeContentProvider cp = new WorkbenchContentProvider();
-
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), lp, cp);
- dialog.setValidator(validator);
- dialog.setTitle(Messages.AddWorkspaceFileAction_DialogTitle);
- dialog.setMessage(Messages.AddWorkspaceFileAction_DialogMessage);
- dialog.addFilter(new ViewerFilter()
- {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (!(element instanceof IResource))
- return false;
- IResource resource = (IResource)element;
- if (resource.getType() == IResource.FILE)
- {
- if (!XSLCore.isXSLFile((IFile)resource))
- return false;
- }
- return true;
- }
- });
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
-
- if (dialog.open() == Window.OK)
- {
- Object[] elements = dialog.getResult();
- LaunchTransform[] res = new LaunchTransform[elements.length];
- for (int i = 0; i < res.length; i++)
- {
- IResource elem = (IResource) elements[i];
- res[i] = new LaunchTransform(elem.getFullPath().toPortableString(), LaunchTransform.RESOURCE_TYPE);
- }
- addTransforms(res);
- }
- }
-
- @Override
- protected int getActionType()
- {
- return ADD;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/ControlAccessibleListener.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/ControlAccessibleListener.java
deleted file mode 100644
index 71caaf6..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/ControlAccessibleListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Used to help with accessibility.
- *
- * @author Doug Satchwell
- */
-public class ControlAccessibleListener extends AccessibleAdapter
-{
- private final String controlName;
-
- private ControlAccessibleListener(String name)
- {
- controlName = name;
- }
-
- @Override
- public void getName(AccessibleEvent e)
- {
- e.result = controlName;
- }
-
- /**
- * Helper for adding an instance of this to the given control.
- *
- * @param comp the control to add this to
- * @param name the name for this
- */
- public static void addListener(Control comp, String name)
- {
- // strip mnemonic
- String[] strs = name.split("&"); //$NON-NLS-1$
- StringBuffer stripped = new StringBuffer();
- for (String element : strs)
- {
- stripped.append(element);
- }
- comp.getAccessible().addAccessibleListener(new ControlAccessibleListener(stripped.toString()));
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveDownAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveDownAction.java
deleted file mode 100644
index fe7dda7..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveDownAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * The action for moving a stylesheet further down in the transformation pipeline.
- *
- * @author Doug Satchwell
- */
-public class MoveDownAction extends AbstractStylesheetAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer
- */
- public MoveDownAction(StylesheetViewer viewer)
- {
- super(Messages.MoveDownAction_Text, viewer);
- }
-
- @Override
- public void run()
- {
- List<?> targets = getOrderedSelection();
- if (targets.isEmpty())
- {
- return;
- }
- List<LaunchTransform> list = getEntriesAsList();
- int bottom = list.size() - 1;
- int index = 0;
- for (int i = targets.size() - 1; i >= 0; i--)
- {
- Object target = targets.get(i);
- index = list.indexOf(target);
- if (index < bottom)
- {
- bottom = index + 1;
- Object temp = list.get(bottom);
- list.set(bottom, (LaunchTransform)target);
- list.set(index, (LaunchTransform)temp);
- }
- bottom = index;
- }
- setEntries(list);
- }
-
- @Override
- protected boolean updateSelection(IStructuredSelection selection)
- {
- if (selection.isEmpty())
- {
- return false;
- }
- return getViewer().updateSelection(getActionType(), selection) && !isIndexSelected(selection, getEntriesAsList().size() - 1);
- }
-
- @Override
- protected int getActionType()
- {
- return MOVE;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveUpAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveUpAction.java
deleted file mode 100644
index 0dffbc8..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MoveUpAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * The action for moving a stylesheet further up in the transformation pipeline.
- *
- * @author Doug Satchwell
- */
-public class MoveUpAction extends AbstractStylesheetAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer
- */
- public MoveUpAction(StylesheetViewer viewer)
- {
- super(Messages.MoveUpAction_Text, viewer);
- }
-
- @Override
- public void run()
- {
- List<?> targets = getOrderedSelection();
- if (targets.isEmpty())
- {
- return;
- }
- int top = 0;
- int index = 0;
- List<LaunchTransform> list = getEntriesAsList();
- Iterator<?> entries = targets.iterator();
- while (entries.hasNext())
- {
- Object target = entries.next();
- index = list.indexOf(target);
- if (index > top)
- {
- top = index - 1;
- Object temp = list.get(top);
- list.set(top, (LaunchTransform)target);
- list.set(index, (LaunchTransform)temp);
- }
- top = index;
- }
- setEntries(list);
- }
-
- @Override
- protected boolean updateSelection(IStructuredSelection selection)
- {
- if (selection.isEmpty())
- {
- return false;
- }
- return getViewer().updateSelection(getActionType(), selection) && !isIndexSelected(selection, 0);
- }
-
- @Override
- protected int getActionType()
- {
- return MOVE;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MultipleInputDialog.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MultipleInputDialog.java
deleted file mode 100644
index 41d4d7b..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/MultipleInputDialog.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactor
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Scrollable;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * A dialog with handy methods for adding simple controls to itself.
- *
- * @author Doug Satchwell
- */
-public class MultipleInputDialog extends Dialog
-{
- protected static final String FIELD_NAME = "FIELD_NAME"; //$NON-NLS-1$
- protected static final int TEXT = 100;
- protected static final int BROWSE = 101;
- protected static final int VARIABLE = 102;
- protected static final int COMBO = 103;
-
- protected Composite panel;
-
- protected List<FieldSummary> fieldList = new ArrayList<FieldSummary>();
- protected List<Scrollable> controlList = new ArrayList<Scrollable>();
- protected List<Validator> validators = new ArrayList<Validator>();
- @SuppressWarnings("unchecked")
- protected Map<Object, Comparable> valueMap = new HashMap<Object, Comparable>();
-
- private final String title;
-
- /**
- * Create a new instance of this.
- *
- * @param shell the shell to open the dialog on
- * @param title the title for the dialog
- */
- public MultipleInputDialog(final Shell shell, final String title)
- {
- super(shell);
- this.title = title;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- @Override
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- if (title != null)
- {
- shell.setText(title);
- }
-
- }
-
- @Override
- protected Control createButtonBar(Composite parent)
- {
- Control bar = super.createButtonBar(parent);
- validateFields();
- return bar;
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- Composite container = (Composite) super.createDialogArea(parent);
- // ((GridData) parent.getLayoutData()).heightHint = 400;
- // ((GridData) parent.getLayoutData()).widthHint = 400;
-
- container.setLayout(new GridLayout(2, false));
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- // gd.heightHint = 200;
- container.setLayoutData(gd);
-
- panel = new Composite(container, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- for (Iterator<FieldSummary> i = fieldList.iterator(); i.hasNext();)
- {
- FieldSummary field = i.next();
- switch (field.type)
- {
- case TEXT:
- createTextField(field.name, field.initialValue, field.allowsEmpty);
- break;
- // case BROWSE:
- // createBrowseField(field.name, field.initialValue,
- // field.allowsEmpty);
- // break;
- case VARIABLE:
- createVariablesField(field.name, field.initialValue, field.allowsEmpty);
- break;
- case COMBO:
- createComboField(field.name, field.initialIndex, field.items);
- break;
- }
- }
-
- fieldList = null; // allow it to be gc'd
- Dialog.applyDialogFont(container);
-
- return container;
- }
-
- /**
- * Add a label, text box and button for browsing the for a file.
- *
- * @param labelText the label
- * @param initialValue the initial value
- * @param allowsEmpty true if the text box can be empty
- */
- public void addBrowseField(String labelText, String initialValue, boolean allowsEmpty)
- {
- fieldList.add(new FieldSummary(BROWSE, labelText, initialValue, allowsEmpty));
- }
-
- /**
- * Add a label and a text box.
- *
- * @param labelText the label
- * @param initialValue the initial value
- * @param allowsEmpty true if the text box can be empty
- */
- public void addTextField(String labelText, String initialValue, boolean allowsEmpty)
- {
- fieldList.add(new FieldSummary(TEXT, labelText, initialValue, allowsEmpty));
- }
-
- /**
- * Add a label, a text box and a button for selecting variables.
- *
- * @param labelText the label
- * @param initialValue the initial value
- * @param allowsEmpty true if the text box can be empty
- */
- public void addVariablesField(String labelText, String initialValue, boolean allowsEmpty)
- {
- fieldList.add(new FieldSummary(VARIABLE, labelText, initialValue, allowsEmpty));
- }
-
- /**
- * Add a label and a combo.
- *
- * @param labelText the label
- * @param initialIndex the initial selection index
- * @param items the array of items for the combo
- */
- public void addComboField(String labelText, int initialIndex, String[] items)
- {
- fieldList.add(new FieldSummary(COMBO, labelText, items, initialIndex));
- }
-
- protected void createTextField(String labelText, String initialValue, boolean allowEmpty)
- {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- final Text text = new Text(panel, SWT.SINGLE | SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- text.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null)
- {
- text.setText(initialValue);
- }
-
- if (!allowEmpty)
- {
- validators.add(new Validator()
- {
- @Override
- public boolean validate()
- {
- return !text.getText().equals(""); //$NON-NLS-1$
- }
- });
- text.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- validateFields();
- }
- });
- }
-
- controlList.add(text);
- }
-
- protected void createVariablesField(String labelText, String initialValue, boolean allowEmpty)
- {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite comp = new Composite(panel, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 200;
- text.setLayoutData(data);
- text.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null)
- {
- text.setText(initialValue);
- }
-
- if (!allowEmpty)
- {
- validators.add(new Validator()
- {
- @Override
- public boolean validate()
- {
- return !text.getText().equals(""); //$NON-NLS-1$
- }
- });
-
- text.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- validateFields();
- }
- });
- }
-
- Button button = createButton(comp, IDialogConstants.IGNORE_ID, Messages.VariablesFieldButton_Text, false);
- button.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- int code = dialog.open();
- if (code == IDialogConstants.OK_ID)
- {
- String variable = dialog.getVariableExpression();
- if (variable != null)
- {
- text.insert(variable);
- }
- }
- }
- });
-
- controlList.add(text);
-
- }
-
- protected void createComboField(String labelText, int initialValue, String[] items)
- {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite comp = new Composite(panel, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Combo combo = new Combo(comp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- // GridData data = new GridData(GridData.FILL_HORIZONTAL);
- // data.widthHint = 200;
- // combo.setLayoutData(data);
-
- combo.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, combo.getSize().y);
-
- combo.setItems(items);
- combo.select(initialValue);
-
- controlList.add(combo);
- }
-
- @Override
- protected void okPressed()
- {
- for (Iterator<Scrollable> i = controlList.iterator(); i.hasNext();)
- {
- Control control = i.next();
- if (control instanceof Text)
- {
- valueMap.put(control.getData(FIELD_NAME), ((Text) control).getText());
- }
- else if (control instanceof Combo)
- {
- Combo combo = (Combo) control;
- valueMap.put(control.getData(FIELD_NAME), new Integer(combo.getSelectionIndex()));
- }
- }
- controlList = null;
- super.okPressed();
- }
-
- @Override
- public int open()
- {
- applyDialogFont(panel);
- return super.open();
- }
-
- protected Object getValue(String key)
- {
- return valueMap.get(key);
- }
-
- protected String getStringValue(String key)
- {
- return (String) getValue(key);
- }
-
- protected int getIntValue(String key)
- {
- return ((Integer) getValue(key)).intValue();
- }
-
- protected void validateFields()
- {
- for (Iterator<Validator> i = validators.iterator(); i.hasNext();)
- {
- Validator validator = i.next();
- if (!validator.validate())
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- return;
- }
- }
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
-
- private String getDialogSettingsSectionName()
- {
- return XSLDebugUIPlugin.PLUGIN_ID + ".MULTIPLE_INPUT_DIALOG"; //$NON-NLS-1$
- }
-
- @Override
- protected IDialogSettings getDialogBoundsSettings()
- {
- IDialogSettings settings = XSLDebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null)
- {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-
- protected class FieldSummary
- {
- int initialIndex;
- int type;
- String name;
- String initialValue;
- boolean allowsEmpty;
- String[] items;
-
- public FieldSummary(int type, String name, String initialValue, boolean allowsEmpty)
- {
- this.type = type;
- this.name = name;
- this.initialValue = initialValue;
- this.allowsEmpty = allowsEmpty;
- }
-
- public FieldSummary(int type, String name, String[] items, int initialIndex)
- {
- this.type = type;
- this.name = name;
- this.items = items;
- }
- }
-
- protected class Validator
- {
- boolean validate()
- {
- return true;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/OpenDialogAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/OpenDialogAction.java
deleted file mode 100644
index 3c269b0..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/OpenDialogAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-
-/**
- * An action that opens a dialog.
- *
- * @author Doug Satchwell
- */
-public class OpenDialogAction extends AbstractStylesheetAction
-{
- protected static final String LAST_PATH_SETTING = "LAST_PATH_SETTING"; //$NON-NLS-1$
- private String fPrefix = null;
-
- /**
- * Create a new instance of this
- *
- * @param label the dialog title
- * @param viewer a viewer that this dialog is associated with
- * @param dialogSettingsPrefix the prefix to use for saving dialog preferences
- */
- public OpenDialogAction(String label, StylesheetViewer viewer, String dialogSettingsPrefix)
- {
- super(label, viewer);
- fPrefix = dialogSettingsPrefix;
- }
-
- protected String getDialogSettingsPrefix()
- {
- return fPrefix;
- }
-
- protected String getDialogSetting(String settingName)
- {
- return getDialogSettings().get(getDialogSettingsPrefix() + "." + settingName); //$NON-NLS-1$
- }
-
- protected void setDialogSetting(String settingName, String value)
- {
- getDialogSettings().put(getDialogSettingsPrefix() + "." + settingName, value); //$NON-NLS-1$
- }
-
- protected IDialogSettings getDialogSettings()
- {
- IDialogSettings settings = XSLDebugUIPlugin.getDefault().getDialogSettings();
- return settings;
- }
-
- @Override
- protected int getActionType()
- {
- return ADD;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveAction.java
deleted file mode 100644
index c5aee7d..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.StylesheetViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * An action that removes a selection from a viewer.
- *
- * @author Doug Satchwell
- */
-public class RemoveAction extends AbstractStylesheetAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer the viewer that will have its selection removed
- */
- public RemoveAction(StylesheetViewer viewer)
- {
- super(Messages.RemoveAction_Text, viewer);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void run()
- {
- IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
- getViewer().removeEntries((LaunchTransform[]) selection.toList().toArray(new LaunchTransform[0]));
- }
-
- @Override
- protected boolean updateSelection(IStructuredSelection selection)
- {
- if (selection.isEmpty())
- {
- return false;
- }
- return getViewer().updateSelection(getActionType(), selection);
- }
-
- @Override
- protected int getActionType()
- {
- return MOVE;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveParameterAction.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveParameterAction.java
deleted file mode 100644
index aa32f6a..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/actions/RemoveParameterAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.ParameterViewer;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * An action that removes a selection from a viewer.
- *
- * @author Doug Satchwell
- */
-public class RemoveParameterAction extends AbstractParameterAction
-{
- /**
- * Create a new instance of this.
- *
- * @param viewer the viewer that will have its selection removed
- */
- public RemoveParameterAction(ParameterViewer viewer)
- {
- super(Messages.RemoveParameterAction, viewer);
- }
-
- @Override
- public void run()
- {
- IStructuredSelection sel = getStructuredSelection();
- if (sel.size() > 0)
- {
- LaunchAttribute[] entries = new LaunchAttribute[sel.size()];
- int i = 0;
- for (Iterator<?> iter = sel.iterator(); iter.hasNext(); i++)
- {
- LaunchAttribute att = (LaunchAttribute) iter.next();
- entries[i] = att;
- }
- getViewer().removeEntries(entries);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/breakpoint/XSLBreakpointProvider.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/breakpoint/XSLBreakpointProvider.java
deleted file mode 100644
index 3f9c4fa..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/breakpoint/XSLBreakpointProvider.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 245772 - NLS Message refactoring
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.breakpoint;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.launching.model.XSLLineBreakpoint;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-/**
- * An SSE <code>IBreakpointProvider</code> for XSL files.
- *
- * @author Doug Satchwell
- */
-public class XSLBreakpointProvider implements IBreakpointProvider, IExecutableExtension
-{
- public IStatus addBreakpoint(IDocument document, IEditorInput input, int editorLineNumber, int offset) throws CoreException
- {
- // check if there is a valid position to set breakpoint
- int pos = getValidPosition(document, editorLineNumber);
- IStatus status = null;
- if (pos >= 0)
- {
- IResource res = getResourceFromInput(input);
- if (res != null)
- {
- boolean add = true;
- if (add)
- {
- IBreakpoint point = new XSLLineBreakpoint(res, editorLineNumber, pos, pos);
- if (point == null)
- {
- status = new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XSLBreakpointProvider_0, null);
- }
- else
- {
- // DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(point);
- }
- }
- }
- else if (input instanceof IStorageEditorInput)
- {
- res = ResourcesPlugin.getWorkspace().getRoot();
- String id = input.getName();
- if (input instanceof IStorageEditorInput && ((IStorageEditorInput) input).getStorage() != null && ((IStorageEditorInput) input).getStorage().getFullPath() != null)
- {
- id = ((IStorageEditorInput) input).getStorage().getFullPath().toString();
- }
- Map<String, String> attributes = new HashMap<String, String>();
- attributes.put(StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY, id);
- IBreakpoint point = new XSLLineBreakpoint(res, editorLineNumber, pos, pos);
- if (point == null)
- {
- status = new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XSLBreakpointProvider_0, null);
- }
- }
- }
- if (status == null)
- {
- status = new Status(IStatus.OK, XSLDebugUIPlugin.PLUGIN_ID, IStatus.OK, "JSPUIMessages.OK", null); //$NON-NLS-1$
- }
- return status;
- }
-
- public IResource getResource(IEditorInput input)
- {
- return getResourceFromInput(input);
- }
-
- private IResource getResourceFromInput(IEditorInput input)
- {
- IResource resource = (IResource) input.getAdapter(IFile.class);
- if (resource == null)
- {
- resource = (IResource) input.getAdapter(IResource.class);
- }
- return resource;
- }
-
- private int getValidPosition(IDocument idoc, int editorLineNumber)
- {
- int result = -1;
- if (idoc != null)
- {
- int startOffset = 0;
- int endOffset = 0;
- try
- {
- IRegion line = idoc.getLineInformation(editorLineNumber - 1);
- startOffset = line.getOffset();
- endOffset = Math.max(line.getOffset(), line.getOffset() + line.getLength());
-
- String lineText = idoc.get(startOffset, endOffset - startOffset).trim();
-
- // blank lines or PI's cannot have breakpoints
- if (lineText.trim().equals("") || lineText.startsWith("<?")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- result = -1;
- }
- else
- {
- // get all partitions for current line
- ITypedRegion[] partitions = null;
-
- partitions = idoc.computePartitioning(startOffset, endOffset - startOffset);
-
- for (int i = 0; i < partitions.length; ++i)
- {
- // String type = partitions[i].getType();
- result = partitions[i].getOffset();
- }
- }
- }
- catch (BadLocationException e)
- {
- result = -1;
- }
- }
- return result;
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException
- {
- // not used
- }
-
- public void setSourceEditingTextTools(ISourceEditingTextTools tools)
- {
- // not used
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLBreakpointAdapterFactory.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLBreakpointAdapterFactory.java
deleted file mode 100644
index db68b8f..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLBreakpointAdapterFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xsl.core.XSLCore;
-
-/**
- * Creates a toggle breakpoint adapter
- */
-public class XSLBreakpointAdapterFactory implements IAdapterFactory
-{
- @SuppressWarnings("unchecked")
- public Object getAdapter(Object adaptableObject, Class adapterType)
- {
- if (adaptableObject instanceof ITextEditor)
- {
- ITextEditor editorPart = (ITextEditor) adaptableObject;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
- if (resource != null && resource instanceof IFile)
- {
- if (XSLCore.isXSLFile((IFile)resource))
- {
- return new XSLLineBreakpointAdapter();
- }
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Class[] getAdapterList()
- {
- return new Class[]
- { IToggleBreakpointsTarget.class };
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLLineBreakpointAdapter.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLLineBreakpointAdapter.java
deleted file mode 100644
index 870045d..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLLineBreakpointAdapter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.ILineBreakpoint;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.launching.model.IXSLConstants;
-import org.eclipse.wst.xsl.launching.model.XSLLineBreakpoint;
-
-/**
- * An <code>IToggleBreakpointsTarget</code> for XSL breakpoints.
- *
- * @author Doug Satchwell
- */
-public class XSLLineBreakpointAdapter implements IToggleBreakpointsTarget
-{
- public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException
- {
- ITextEditor textEditor = getEditor(part);
- if (textEditor != null)
- {
- IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IResource.class);
- ITextSelection textSelection = (ITextSelection) selection;
- int lineNumber = textSelection.getStartLine();
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IXSLConstants.ID_XSL_DEBUG_MODEL);
- for (IBreakpoint breakpoint : breakpoints)
- {
- if (resource.equals(breakpoint.getMarker().getResource()))
- {
- if (((ILineBreakpoint) breakpoint).getLineNumber() == (lineNumber + 1))
- {
- // remove
- breakpoint.delete();
- return;
- }
- }
- }
- // create line breakpoint (doc line numbers start at 0)
- XSLLineBreakpoint lineBreakpoint = new XSLLineBreakpoint(resource, lineNumber + 1, 1, 1);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
- }
- }
-
- public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection)
- {
- return getEditor(part) != null;
- }
-
- /**
- * Returns the editor being used to edit a XSL file, associated with the
- * given part, or <code>null</code> if none.
- */
- private ITextEditor getEditor(IWorkbenchPart part)
- {
- if (part instanceof ITextEditor)
- {
- ITextEditor editorPart = (ITextEditor) part;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
- if (resource != null && resource.getType() == IResource.FILE)
- {
- if (XSLCore.isXSLFile((IFile)resource))
- {
- return editorPart;
- }
- }
- }
- return null;
- }
-
- public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException
- {
- }
-
- public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection)
- {
- return false;
- }
-
- public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException
- {
- }
-
- public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection)
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLModelPresentation.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLModelPresentation.java
deleted file mode 100644
index 3b72474..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/model/XSLModelPresentation.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 214235 - Added NodeList specific images.
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ILineBreakpoint;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIConstants;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.launching.model.NodeListVariable;
-import org.eclipse.wst.xsl.launching.model.XSLVariable;
-import org.w3c.dom.Node;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-/**
- * An <code>IDebugModelPresentation</code> for XSL debugging.
- *
- * @author Doug Satchwell
- */
-public class XSLModelPresentation extends LabelProvider implements IDebugModelPresentation
-{
- private Image localImg;
-
- public void setAttribute(String attribute, Object value)
- {
- }
-
- @Override
- public Image getImage(Object element)
- {
- if (element instanceof XSLVariable)
- {
- XSLVariable var = (XSLVariable) element;
- if (var.getScope().equals(XSLVariable.LOCAL_SCOPE))
- {
- if (localImg == null)
- localImg = XSLDebugUIPlugin.getImageDescriptor("/icons/localvariable_obj.gif").createImage(); //$NON-NLS-1$
- return localImg;
- }
- }
- if (element instanceof NodeListVariable) {
- NodeListVariable nodeVar = (NodeListVariable) element;
- if (nodeVar.getNode() != null) {
- Node node = nodeVar.getNode();
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ELEMENT);
- }
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
- }
- if (node.getNodeType() == Node.COMMENT_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_COMMENT);
- }
- if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_PROCESSINGINSTRUCTION);
- }
- if (node.getNodeType() == Node.CDATA_SECTION_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION);
- }
- if (node.getNodeType() == Node.ENTITY_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY);
- }
- if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY_REFERENCE);
- }
- if (node.getNodeType() == Node.TEXT_NODE) {
- localImg = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_TXTEXT);
- }
- return localImg;
- }
- }
- return null;
- }
-
- @Override
- public String getText(Object element)
- {
- return null;
- }
-
- @Override
- public void dispose()
- {
- if (localImg != null)
- localImg.dispose();
- super.dispose();
- }
-
- public void computeDetail(IValue value, IValueDetailListener listener)
- {
- String detail = ""; //$NON-NLS-1$
- try
- {
- detail = value.getValueString();
- }
- catch (DebugException e)
- {
- }
- listener.detailComputed(value, detail);
- }
-
- public IEditorInput getEditorInput(Object element)
- {
- if (element instanceof IFile)
- {
- return new FileEditorInput((IFile) element);
- }
- if (element instanceof ILineBreakpoint)
- {
- return new FileEditorInput((IFile) ((ILineBreakpoint) element).getMarker().getResource());
- }
- return null;
- }
-
- public String getEditorId(IEditorInput input, Object element)
- {
- if (element instanceof IFile || element instanceof ILineBreakpoint)
- {
- return XSLDebugUIConstants.XSL_EDITOR_ID;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IParametersChangedListener.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IParametersChangedListener.java
deleted file mode 100644
index 13d8a71..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IParametersChangedListener.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-public interface IParametersChangedListener
-{
- void parametersChanged(ParameterViewer viewer);
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IStylesheetEntriesChangedListener.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IStylesheetEntriesChangedListener.java
deleted file mode 100644
index b1fe798..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/IStylesheetEntriesChangedListener.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-public interface IStylesheetEntriesChangedListener
-{
- void entriesChanged(StylesheetViewer viewer);
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java
deleted file mode 100644
index 7658e58..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-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.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-import org.eclipse.wst.xsl.internal.debug.ui.ResourceSelectionBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-
-
-public class InputFileBlock extends ResourceSelectionBlock
-{
- private static final String XMLSOURCE_CONTENTTYPE = "org.eclipse.wst.xml.core.xmlsource";
- private final IFile defaultFile;
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-
- public InputFileBlock(IFile defaultFile)
- {
- super(IResource.FILE, false);
- this.defaultFile = defaultFile;
- }
-
- @Override
- protected String[] getFileExtensions()
- {
- IContentType contentType = contentTypeManager.getContentType(XMLSOURCE_CONTENTTYPE);
- String[] xmlContentTypes = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
-
- return xmlContentTypes;
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- String path = ""; //$NON-NLS-1$
- if (defaultFile != null)
- path = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", defaultFile.getFullPath().toPortableString()); //$NON-NLS-1$
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, path);
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- setLaunchConfiguration(configuration);
- try
- {
- String wd = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null);
- if (wd != null)
- {
- setText(wd);
- }
- }
- catch (CoreException e)
- {
- setErrorMessage(Messages.InputFileBlock_Exception_occurred_reading_configuration + e.getStatus().getMessage());
- XSLDebugUIPlugin.log(e);
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, getText());
- }
-
- public String getName()
- {
- return Messages.InputFileBlock_Name;
- }
-
- @Override
- protected void setDefaultResource() {
- // TODO Auto-generated method stub
-
- }
-
-
- @Override
- protected void textModified()
- {
- IPath path = null;
- String workingDirPath = getText();
- if (workingDirPath.indexOf("${") >= 0) //$NON-NLS-1$
- {
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try
- {
- manager.validateStringVariables(workingDirPath);
- path = new Path(manager.performStringSubstitution(workingDirPath));
- }
- catch (CoreException e)
- {
- }
- }
- else if (workingDirPath.length() > 0)
- {
- path = new Path(workingDirPath);
- }
- }
-
- @Override
- protected String getMessage(int type)
- {
- switch (type)
- {
- case ERROR_DIRECTORY_NOT_SPECIFIED:
- return Messages.InputFileBlock_DIRECTORY_NOT_SPECIFIED;
- case ERROR_DIRECTORY_DOES_NOT_EXIST:
- return Messages.InputFileBlock_DIRECTORY_DOES_NOT_EXIST;
- case GROUP_NAME:
- return Messages.InputFileBlock_GROUP_NAME;
- case USE_DEFAULT_RADIO:
- return Messages.InputFileBlock_DEFAULT_RADIO;
- case USE_OTHER_RADIO:
- return Messages.InputFileBlock_OTHER_RADIO;
- case DIRECTORY_DIALOG_MESSAGE:
- return Messages.InputFileBlock_DIALOG_MESSAGE;
- case WORKSPACE_DIALOG_MESSAGE:
- return Messages.InputFileBlock_WORKSPACE_DIALOG_MESSAGE;
- case VARIABLES_BUTTON:
- return Messages.InputFileBlock_VARIABLES_BUTTON;
- case FILE_SYSTEM_BUTTON:
- return Messages.InputFileBlock_FILE_SYSTEM_BUTTON;
- case WORKSPACE_BUTTON:
- return Messages.InputFileBlock_WORKSPACE_BUTTON;
- case WORKSPACE_DIALOG_TITLE:
- return Messages.InputFileBlock_WORKSPACE_DIALOG_TITLE;
- }
- return "" + type; //$NON-NLS-1$
- }
-
- @Override
- protected void updateResourceText(boolean useDefault)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParameterViewer.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParameterViewer.java
deleted file mode 100644
index 5ba94db..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParameterViewer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AbstractStylesheetAction;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-
-public class ParameterViewer extends TableViewer
-{
- private final ListenerList fListeners = new ListenerList();
-
- public ParameterViewer(Table table)
- {
- super(table);
-
- table.addKeyListener(new KeyAdapter()
- {
- @Override
- public void keyPressed(KeyEvent event)
- {
- // TODO - removal
- // if (updateSelection(AbstractStylesheetAction.REMOVE,
- // (IStructuredSelection)getSelection()) && event.character ==
- // SWT.DEL && event.stateMask == 0)
- // {
- // List selection = getSelectionFromWidget();
- // getStylesheetContentProvider().removeEntries((IStylesheetEntry[])selection.toArray(new
- // IStylesheetEntry[0]));
- // notifyChanged();
- // }
- }
- });
- }
-
- private ParametersContentProvider getParametersContentProvider()
- {
- return (ParametersContentProvider) super.getContentProvider();
- }
-
- public Shell getShell()
- {
- return getControl().getShell();
- }
-
- public boolean isEnabled()
- {
- return true;
- }
-
- public boolean updateSelection(int actionType, IStructuredSelection selection)
- {
- switch (actionType)
- {
- case AbstractStylesheetAction.ADD:
- return true;
- case AbstractStylesheetAction.REMOVE:
- case AbstractStylesheetAction.MOVE:
- default:
- break;
- }
- return selection.size() > 0;
- }
-
- public IStructuredSelection getSelectedEntries()
- {
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- return selection;
- }
-
- public void addParameter(LaunchAttribute parameter)
- {
- getParametersContentProvider().addParameter(parameter);
- notifyChanged();
- }
-
- public void removeEntries(LaunchAttribute[] entries)
- {
- getParametersContentProvider().removeParameters(entries);
- notifyChanged();
- }
-
- public LaunchAttribute[] getParameters()
- {
- return getParametersContentProvider().getParameters();
- }
-
- public void addParametersChangedListener(IParametersChangedListener listener)
- {
- fListeners.add(listener);
- }
-
- public void removeParametersChangedListener(IParametersChangedListener listener)
- {
- fListeners.remove(listener);
- }
-
- private void notifyChanged()
- {
- Object[] listeners = fListeners.getListeners();
- for (Object element : listeners)
- {
- ((IParametersChangedListener) element).parametersChanged(this);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersBlock.java
deleted file mode 100644
index 7d33ad7..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersBlock.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Font;
-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.Group;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-import org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIConstants;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AbstractParameterAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AddParameterAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.RemoveParameterAction;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class ParametersBlock extends AbstractTableBlock
-{
- private ParameterViewer parametersViewer;
- private Button addParameterButton;
- private Button removeParameterButton;
- private final TransformsBlock transformsBlock;
- private final ISelectionChangedListener selectionListener = new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection stylesheetSelection = (IStructuredSelection) event.getSelection();
- if (stylesheetSelection.size() == 1)
- setTransform((LaunchTransform) stylesheetSelection.getFirstElement());
- else
- setTransform(null);
- updateEnabled();
- }
- };
- private Table fTable;
-
- public ParametersBlock(TransformsBlock transformsBlock)
- {
- super();
- this.transformsBlock = transformsBlock;
- }
-
- protected void setTransform(LaunchTransform transform)
- {
- parametersViewer.setInput(transform);
- }
-
- protected void updateEnabled()
- {
- IStructuredSelection stylesheetSelection = (IStructuredSelection) transformsBlock.getStylesheetViewer().getSelection();
- boolean enabled = stylesheetSelection.size() == 1;
- parametersViewer.getTable().setEnabled(enabled);
- addParameterButton.setEnabled(enabled);
- IStructuredSelection parametersSelection = (IStructuredSelection) parametersViewer.getSelection();
- removeParameterButton.setEnabled(enabled && !parametersSelection.isEmpty());
- }
-
- public void createControl(Composite parent)
- {
- Font font = parent.getFont();
-
- Group group = new Group(parent, SWT.NONE);
- group.setText(getName());
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- group.setLayoutData(gd);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- group.setLayout(layout);
- group.setFont(font);
-
- setControl(group);
-
- fTable = new Table(group, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
-
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- // data.heightHint = 100;
- fTable.setLayoutData(data);
- fTable.setFont(font);
-
- fTable.setHeaderVisible(true);
- fTable.setLinesVisible(true);
-
- TableColumn column1 = new TableColumn(fTable, SWT.NONE);
- column1.setWidth(150);
- column1.setResizable(true);
- column1.setText(Messages.ParametersBlock_0);
-
- TableColumn column3 = new TableColumn(fTable, SWT.NONE);
- column3.setWidth(250);
- column3.setResizable(true);
- column3.setText(Messages.ParametersBlock_2);
-
- parametersViewer = new ParameterViewer(fTable);
- parametersViewer.setLabelProvider(new ParametersLabelProvider());
- parametersViewer.setContentProvider(new ParametersContentProvider());
- parametersViewer.addParametersChangedListener(new IParametersChangedListener()
- {
-
- public void parametersChanged(ParameterViewer viewer)
- {
- updateLaunchConfigurationDialog();
- }
- });
- parametersViewer.getTable().addKeyListener(new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- RemoveParameterAction ra = new RemoveParameterAction(parametersViewer);
- ra.run();
- updateLaunchConfigurationDialog();
- }
- }
- });
-
- parametersViewer.setColumnProperties(new String[]
- { "name", "value" }); //$NON-NLS-1$ //$NON-NLS-2$
- TextCellEditor textEditor = new TextCellEditor(fTable);
- CellEditor[] editors = new CellEditor[]
- { null, textEditor };
- parametersViewer.setCellEditors(editors);
- parametersViewer.setCellModifier(new ICellModifier()
- {
- public boolean canModify(Object element, String property)
- {
- return "value".equals(property); //$NON-NLS-1$
- }
-
- public Object getValue(Object element, String property)
- {
- LaunchAttribute att = (LaunchAttribute) element;
- return att.value == null ? "" : att.value; //$NON-NLS-1$
- }
-
- public void modify(Object element, String property, Object value)
- {
- Item item = (Item) element;
- LaunchAttribute att = (LaunchAttribute) item.getData();
- att.value = (String) value;
- parametersViewer.update(att, null);
- updateLaunchConfigurationDialog();
- }
- });
-
- Composite parameterButtonComp = new Composite(group, SWT.NONE);
- GridLayout parameterButtonCompLayout = new GridLayout();
- parameterButtonCompLayout.marginHeight = 0;
- parameterButtonCompLayout.marginWidth = 0;
- parameterButtonComp.setLayout(parameterButtonCompLayout);
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- parameterButtonComp.setLayoutData(gd);
- parameterButtonComp.setFont(font);
-
- addParameterButton = createButton(parameterButtonComp, new AddParameterAction(parametersViewer));
- removeParameterButton = createButton(parameterButtonComp, new RemoveParameterAction(parametersViewer));
-
- transformsBlock.getStylesheetViewer().addSelectionChangedListener(selectionListener);
-
- restoreColumnSettings();
- }
-
- protected Button createButton(Composite pathButtonComp, AbstractParameterAction action)
- {
- Button button = createPushButton(pathButtonComp, action.getText(), null);
- action.setButton(button);
- return button;
- }
-
- @Override
- protected Table getTable()
- {
- return fTable;
- }
-
- @Override
- protected IDialogSettings getDialogSettings()
- {
- return XSLDebugUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getQualifier()
- {
- return XSLDebugUIConstants.MAIN_PARAMATERS_BLOCK;
- }
-
- public String getName()
- {
- return Messages.ParametersBlock_9;
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- // handled by the Tab
- updateEnabled();
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- // handled by the Tab
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- // handled by the Tab
- }
-
- @Override
- public void dispose()
- {
- if (transformsBlock.getStylesheetViewer() != null)
- transformsBlock.getStylesheetViewer().removeSelectionChangedListener(selectionListener);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersContentProvider.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersContentProvider.java
deleted file mode 100644
index 6dcb886..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersContentProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class ParametersContentProvider implements IStructuredContentProvider
-{
- private LaunchTransform stylesheetEntry;
- private ParameterViewer parameterViewer;
-
- public Object[] getElements(Object inputElement)
- {
- if (stylesheetEntry == null)
- return new Object[0];
- return stylesheetEntry.getParameters().toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- stylesheetEntry = (LaunchTransform) newInput;
- parameterViewer = (ParameterViewer) viewer;
- }
-
- public void dispose()
- {
- }
-
- public LaunchAttribute[] getParameters()
- {
- return stylesheetEntry.getParameters().toArray(new LaunchAttribute[0]);
- }
-
- public void removeParameters(LaunchAttribute[] entries)
- {
- for (LaunchAttribute parameter : entries)
- {
- stylesheetEntry.getParameters().remove(parameter);
- }
- TableItem[] items = parameterViewer.getTable().getItems();
- List<LaunchAttribute> entryList = Arrays.asList(entries);
- Object sel = null;
- for (int i = items.length - 1; i >= 0; i--)
- {
- TableItem item = items[i];
- if (!entryList.contains(item.getData()))
- {
- sel = item.getData();
- break;
- }
- }
- parameterViewer.remove(entries);
-
- if (sel != null)
- parameterViewer.setSelection(new StructuredSelection(sel), true);
- }
-
- public void addParameter(LaunchAttribute parameter)
- {
- stylesheetEntry.getParameters().add(parameter);
- parameterViewer.add(parameter);
- parameterViewer.setSelection(new StructuredSelection(parameter), true);
- // parameterViewer.refresh();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersLabelProvider.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersLabelProvider.java
deleted file mode 100644
index e5da79f..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/ParametersLabelProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-
-public class ParametersLabelProvider implements ITableLabelProvider
-{
- public String getColumnText(Object element, int columnIndex)
- {
- LaunchAttribute p = (LaunchAttribute) element;
- switch (columnIndex)
- {
- case 0:
- return p.uri;
- case 1:
- return p.value;
- }
- return "!"; //$NON-NLS-1$
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void dispose()
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetContentProvider.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetContentProvider.java
deleted file mode 100644
index 17c34ad..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetContentProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class StylesheetContentProvider implements IStructuredContentProvider
-{
- private TableViewer tableViewer;
- private LaunchPipeline pipeline;
-
- public StylesheetContentProvider()
- {
- }
-
- public Object[] getElements(Object inputElement)
- {
- return pipeline.getTransformDefs().toArray(new LaunchTransform[0]);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- tableViewer = (TableViewer) viewer;
- pipeline = (LaunchPipeline) newInput;
- }
-
- public void dispose()
- {
- }
-
- public void setEntries(LaunchTransform[] transforms)
- {
- pipeline.setTransformDefs(new ArrayList<LaunchTransform>(Arrays.asList(transforms)));
- tableViewer.refresh();
- }
-
- public void addEntries(LaunchTransform[] res, Object beforeElement)
- {
- for (LaunchTransform transform : res)
- {
- pipeline.addTransformDef(transform);
- }
- tableViewer.add(res);
- // select the first new one
- tableViewer.setSelection(new StructuredSelection(res[0]), true);
- }
-
- public void removeEntries(LaunchTransform[] res)
- {
- for (LaunchTransform transform : res)
- {
- pipeline.removeTransformDef(transform);
- }
- tableViewer.refresh();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetLabelProvider.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetLabelProvider.java
deleted file mode 100644
index d897e27..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetLabelProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-public class StylesheetLabelProvider extends LabelProvider
-{
- private Image image = XSLDebugUIPlugin.getImageDescriptor("icons/xslt_launch.gif").createImage();
-
- @Override
- public Image getImage(Object element)
- {
- return image;
- }
-
- @Override
- public String getText(Object element)
- {
- LaunchTransform lt = (LaunchTransform) element;
- int index = lt.getPipeline().getTransformDefs().indexOf(lt);
-
- IPath path;
- try
- {
- path = lt.getPath();
- }
- catch (CoreException e)
- {
- return MessageFormat.format(Messages.StylesheetEntryLabelProvider_Invalid_path, new Object[]
- { "null" }); //$NON-NLS-1$
- }
-
- if (path == null)
- {
- return MessageFormat.format(Messages.StylesheetEntryLabelProvider_Invalid_path, new Object[]
- { "null" }); //$NON-NLS-1$
- }
- else if (!path.isAbsolute() || !path.isValidPath(path.toString()))
- {
- return MessageFormat.format(Messages.StylesheetEntryLabelProvider_Invalid_path, new Object[]
- { path.toString() });
- }
-
- String[] segments = path.segments();
- StringBuffer displayPath = new StringBuffer();
- if (segments.length > 0)
- {
- displayPath.append(segments[segments.length - 1]);
- displayPath.append(" - "); //$NON-NLS-1$
- String device = path.getDevice();
- if (device != null)
- {
- displayPath.append(device);
- }
- displayPath.append(File.separator);
- for (int i = 0; i < segments.length - 1; i++)
- {
- displayPath.append(segments[i]).append(File.separator);
- }
- }
- else
- {
- displayPath.append(path.toString());
- }
- return (index + 1) + ") " + displayPath.toString(); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetViewer.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetViewer.java
deleted file mode 100644
index 7044e11..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/StylesheetViewer.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AbstractStylesheetAction;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class StylesheetViewer extends TableViewer
-{
- private final ListenerList listenerList = new ListenerList();
-
- public StylesheetViewer(Composite parent)
- {
- super(parent);
-
- getTable().addKeyListener(new KeyAdapter()
- {
- @Override
- public void keyPressed(KeyEvent event)
- {
- if (updateSelection(AbstractStylesheetAction.REMOVE, (IStructuredSelection) getSelection()) && event.character == SWT.DEL && event.stateMask == 0)
- {
- List<?> selection = getSelectionFromWidget();
- getStylesheetContentProvider().removeEntries(selection.toArray(new LaunchTransform[0]));
- notifyChanged();
- }
- }
- });
- }
-
- private StylesheetContentProvider getStylesheetContentProvider()
- {
- return (StylesheetContentProvider) super.getContentProvider();
- }
-
- public void setEntries(LaunchTransform[] transforms)
- {
- getStylesheetContentProvider().setEntries(transforms);
- notifyChanged();
- }
-
- public LaunchTransform[] getEntries()
- {
- return (LaunchTransform[]) getStylesheetContentProvider().getElements(null);
- }
-
- public Shell getShell()
- {
- return getControl().getShell();
- }
-
- public boolean isEnabled()
- {
- return true;
- }
-
- public boolean updateSelection(int actionType, IStructuredSelection selection)
- {
- switch (actionType)
- {
- case AbstractStylesheetAction.ADD:
- return true;
- case AbstractStylesheetAction.REMOVE:
- case AbstractStylesheetAction.MOVE:
- default:
- break;
- }
- return selection.size() > 0;
- }
-
- public IStructuredSelection getSelectedEntries()
- {
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- return selection;
- }
-
- public void addTransforms(LaunchTransform[] res)
- {
- IStructuredSelection sel = (IStructuredSelection) getSelection();
- Object beforeElement = sel.getFirstElement();
- if (getEntries().length > 1 && beforeElement == null)
- beforeElement = getEntries()[getEntries().length - 1];
- getStylesheetContentProvider().addEntries(res, beforeElement);
- notifyChanged();
- }
-
- public void removeEntries(LaunchTransform[] entries)
- {
- getStylesheetContentProvider().removeEntries(entries);
- notifyChanged();
- }
-
- public void addEntriesChangedListener(IStylesheetEntriesChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeEntriesChangedListener(IStylesheetEntriesChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- private void notifyChanged()
- {
- Object[] listeners = listenerList.getListeners();
- for (Object element : listeners)
- {
- ((IStylesheetEntriesChangedListener) element).entriesChanged(this);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/TransformsBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/TransformsBlock.java
deleted file mode 100644
index 1f67daa..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/TransformsBlock.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Font;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIConstants;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AbstractStylesheetAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AddExternalFileAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.AddWorkspaceFileAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.MoveDownAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.MoveUpAction;
-import org.eclipse.wst.xsl.internal.debug.ui.actions.RemoveAction;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-
-public class TransformsBlock extends AbstractTableBlock implements IStylesheetEntriesChangedListener
-{
- protected static final String DIALOG_SETTINGS_PREFIX = "TransformsBlock";
- private StylesheetViewer stylesheetViewer;
- private LaunchPipeline pipeline;
-
- public TransformsBlock()
- {
- super();
- }
-
- public void createControl(Composite parent)
- {
- Font font = parent.getFont();
-
- Group group = new Group(parent, SWT.NONE);
- group.setText(getName());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(gd);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- group.setLayout(layout);
- group.setFont(font);
-
- setControl(group);
-
- stylesheetViewer = new StylesheetViewer(group);
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- stylesheetViewer.getTable().setLayoutData(gd);
- stylesheetViewer.addEntriesChangedListener(this);
- stylesheetViewer.getControl().setFont(font);
- stylesheetViewer.setLabelProvider(new StylesheetLabelProvider());
- stylesheetViewer.setContentProvider(new StylesheetContentProvider());
- stylesheetViewer.getTable().addKeyListener(new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- RemoveAction ra = new RemoveAction(stylesheetViewer);
- ra.run();
- updateLaunchConfigurationDialog();
- }
- }
- });
-
- Composite upDownButtonComp = new Composite(group, SWT.NONE);
- GridLayout upDownButtonLayout = new GridLayout();
- upDownButtonLayout.marginHeight = 0;
- upDownButtonLayout.marginWidth = 0;
- upDownButtonComp.setLayout(upDownButtonLayout);
- gd = new GridData(SWT.FILL, SWT.FILL, false, true);
- upDownButtonComp.setLayoutData(gd);
- upDownButtonComp.setFont(font);
-
- createArrowButton(upDownButtonComp, new MoveUpAction(stylesheetViewer), SWT.UP);
- Label spacer = new Label(upDownButtonComp, SWT.NONE);
- gd = new GridData(SWT.NONE, SWT.FILL, false, true);
- spacer.setLayoutData(gd);
- createArrowButton(upDownButtonComp, new MoveDownAction(stylesheetViewer), SWT.DOWN);
-
- Composite pathButtonComp = new Composite(group, SWT.NONE);
- GridLayout pathButtonLayout = new GridLayout();
- pathButtonLayout.marginHeight = 0;
- pathButtonLayout.marginWidth = 0;
- pathButtonComp.setLayout(pathButtonLayout);
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
- pathButtonComp.setLayoutData(gd);
- pathButtonComp.setFont(font);
-
- createButton(pathButtonComp, new AddWorkspaceFileAction(stylesheetViewer));
- createButton(pathButtonComp, new AddExternalFileAction(stylesheetViewer, DIALOG_SETTINGS_PREFIX));
- createButton(pathButtonComp, new RemoveAction(stylesheetViewer));
- }
-
- public Viewer getStylesheetViewer()
- {
- return stylesheetViewer;
- }
-
- protected Button createArrowButton(Composite pathButtonComp, AbstractStylesheetAction action, int updown)
- {
- Button b = new Button(pathButtonComp, SWT.ARROW | updown);
- GridData gd = new GridData();
- b.setLayoutData(gd);
- action.setButton(b);
- return b;
- }
-
- protected Button createButton(Composite pathButtonComp, AbstractStylesheetAction action)
- {
- Button button = createPushButton(pathButtonComp, action.getText(), null);
- action.setButton(button);
- return button;
- }
-
- public String getName()
- {
- return Messages.TransformsBlock_Name;
- }
-
- public void setPipeline(LaunchPipeline pipeline)
- {
- this.pipeline = pipeline;
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- stylesheetViewer.setInput(pipeline);
- if (pipeline.getTransformDefs().size() > 0)
- {
- stylesheetViewer.setSelection(new StructuredSelection(pipeline.getTransformDefs().get(0)));
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- }
-
- public void entriesChanged(StylesheetViewer viewer)
- {
- setDirty(true);
- updateLaunchConfigurationDialog();
- }
-
- @Override
- protected void setSortColumn(int column)
- {
- switch (column)
- {
- // case 1:
- // sortByName();
- // break;
- // case 2:
- // sortByType();
- // break;
- }
- super.setSortColumn(column);
- }
-
- @Override
- protected Table getTable()
- {
- return stylesheetViewer == null ? null : stylesheetViewer.getTable();
- }
-
- @Override
- protected IDialogSettings getDialogSettings()
- {
- return XSLDebugUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getQualifier()
- {
- return XSLDebugUIConstants.MAIN_TRANSFORMS_BLOCK;
- }
-
- @Override
- public void dispose()
- {
- if (stylesheetViewer != null)
- stylesheetViewer.removeEntriesChangedListener(this);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/XSLMainTab.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/XSLMainTab.java
deleted file mode 100644
index 7e51b84..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/XSLMainTab.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007,2008 Chase Technology Ltd - http://www.chasetechnology.co.uk and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver - STAR - bug 223557 - Added Images contributed by Holger Voorman
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.main;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.debug.internal.util.XSLDebugPluginImages;
-import org.eclipse.wst.xsl.debug.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchConfigurationTab;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class XSLMainTab extends XSLLaunchConfigurationTab
-{
- private final InputFileBlock inputFileBlock;
- private final TransformsBlock transformsBlock;
- private final ParametersBlock parametersBlock;
- public LaunchPipeline pipeline;
-
- // private RenderBlock renderBlock;
- // private OutputBlock outputBlock;
-
- public XSLMainTab()
- {
- IResource[] resourceContext = getContext();
- IFile inputFile = getXMLInput(resourceContext);
-
- inputFileBlock = new InputFileBlock(inputFile);
- transformsBlock = new TransformsBlock();
- parametersBlock = new ParametersBlock(transformsBlock);
- // renderBlock = new RenderBlock();
- // outputBlock = new OutputBlock();
-
- setBlocks(new ILaunchConfigurationTab[]
- { inputFileBlock, transformsBlock, parametersBlock }); // ,renderBlock,outputBlock});
- }
-
- @Override
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- Composite comp = (Composite) getControl();
- GridLayout layout = new GridLayout(1, false);
- comp.setLayout(layout);
-
- inputFileBlock.createControl(comp);
- transformsBlock.createControl(comp);
- parametersBlock.createControl(comp);
- // renderBlock.createControl(comp);
- // outputBlock.createControl(comp);
- }
-
- @Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- LaunchPipeline lp = new LaunchPipeline();
- IResource[] resourceContext = getContext();
- IFile[] stylesheets = getXSLStylesheets(resourceContext);
- for (IFile file : stylesheets)
- {
- LaunchTransform lt = new LaunchTransform(file.getFullPath().toPortableString(), LaunchTransform.RESOURCE_TYPE);
- lp.addTransformDef(lt);
- }
- savePipeline(configuration, lp);
- super.setDefaults(configuration);
- }
-
- @Override
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- pipeline = null;
- try
- {
- String s = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_PIPELINE, (String) null);
- if (s != null && s.length() > 0)
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
- pipeline = LaunchPipeline.fromXML(inputStream);
- }
- else
- {
- pipeline = new LaunchPipeline();
- }
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- transformsBlock.setPipeline(pipeline);
- super.initializeFrom(configuration);
- }
-
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- super.performApply(configuration);
- savePipeline(configuration, pipeline);
- }
-
- private void savePipeline(ILaunchConfigurationWorkingCopy configuration, LaunchPipeline pipeline)
- {
- try
- {
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_PIPELINE, pipeline.toXML());
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- public String getName()
- {
- return Messages.XSLMainTab_TabName;
- }
-
- private static IResource[] getContext()
- {
-
- // IProject[] projects =
- // ResourcesPlugin.getWorkspace().getRoot().getProjects();
- // project.setInput( projects);
- // String s = configuration.getAttribute(
- // IXSLTLaunchConfiguration.PROJECT, "");
- // IProject project = null;
- // if( s.equals(""))
- // {
- // if( projects.length>0)
- // {
- // project = projects[ 0];
- // }
- // }
- // else
- // project = ResourcesPlugin.getWorkspace().getRoot().getProject( s);
-
- IWorkbenchPage page = XSLDebugUIPlugin.getActivePage();
- List<Object> resources = new ArrayList<Object>();
- if (page != null)
- {
- // use selections to find the project
- ISelection selection = page.getSelection();
- if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection)
- {
- IStructuredSelection ss = (IStructuredSelection) selection;
- for (Iterator<?> iter = ss.iterator(); iter.hasNext();)
- {
- Object element = iter.next();
- if (element instanceof IResource)
- resources.add(element);
- }
- return resources.toArray(new IResource[0]);
- }
- // use current editor to find the project
- IEditorPart part = page.getActiveEditor();
- if (part != null)
- {
- IEditorInput input = part.getEditorInput();
- IFile file = (IFile) input.getAdapter(IFile.class);
- if (file != null)
- return new IResource[]
- { file };
- }
- }
- return new IResource[0];
- }
-
- private IFile getXMLInput(IResource[] context)
- {
- for (IResource resource : context)
- {
- if (resource instanceof IFile && ("xml".equalsIgnoreCase(resource.getFileExtension()) || "xhtml".equalsIgnoreCase(resource.getFileExtension()))) //$NON-NLS-1$ //$NON-NLS-2$
- return (IFile) resource;
- }
- return null;
- }
-
- private IFile[] getXSLStylesheets(IResource[] context)
- {
- List<IResource> stylesheets = new ArrayList<IResource>();
- for (IResource resource : context)
- {
- if (resource instanceof IFile && XSLCore.isXSLFile((IFile)resource))
- stylesheets.add(resource);
- }
- return stylesheets.toArray(new IFile[0]);
-
- }
-
- @Override
- public Image getImage() {
- return XSLPluginImageHelper.getInstance().getImage(XSLDebugPluginImages.IMG_MAIN_TAB);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputFileBlock.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputFileBlock.java
deleted file mode 100644
index 5d42ad2..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputFileBlock.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.output;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-import org.eclipse.wst.xsl.internal.debug.ui.ResourceSelectionBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.launching.XSLTRuntime;
-
-public class OutputFileBlock extends ResourceSelectionBlock
-{
- private Button openFileCheckButton;
- private Button formatFileCheckButton;
- private String inputFilename;
- private Text fileNameText;
- private String defaultOutputFileName;
- private String outputFileName;
-
- public OutputFileBlock()
- {
- super(IResource.FOLDER, true, true, false);
- }
-
- @Override
- protected String getMessage(int type)
- {
- switch (type)
- {
- case ERROR_DIRECTORY_NOT_SPECIFIED:
- return Messages.OutputFOFileBlock_DIRECTORY_NOT_SPECIFIED;
- case ERROR_DIRECTORY_DOES_NOT_EXIST:
- return Messages.OutputFOFileBlock_DIRECTORY_DOES_NOT_EXIST;
- case GROUP_NAME:
- return getName();
- case USE_DEFAULT_RADIO:
- return Messages.OutputFileBlock_0;
- case USE_OTHER_RADIO:
- return Messages.OutputFOFileBlock_OTHER_RADIO;
- case DIRECTORY_DIALOG_MESSAGE:
- return Messages.OutputFOFileBlock_DIALOG_MESSAGE;
- case WORKSPACE_DIALOG_MESSAGE:
- return Messages.OutputFOFileBlock_WORKSPACE_DIALOG_MESSAGE;
- case VARIABLES_BUTTON:
- return Messages.OutputFOFileBlock_VARIABLES_BUTTON;
- case FILE_SYSTEM_BUTTON:
- return Messages.OutputFOFileBlock_FILE_SYSTEM_BUTTON;
- case WORKSPACE_BUTTON:
- return Messages.OutputFOFileBlock_WORKSPACE_BUTTON;
- case WORKSPACE_DIALOG_TITLE:
- return Messages.OutputFOFileBlock_WORKSPACE_DIALOG_TITLE;
- }
- return "" + type; //$NON-NLS-1$
- }
-
- @Override
- protected void setDefaultResource()
- {}
-
- @Override
- protected void createCheckboxAndText(Composite parent)
- {
- if (showDefault)
- {
- useDefaultCheckButton = createCheckButton(parent, getMessage(USE_DEFAULT_RADIO));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 2;
- useDefaultCheckButton.setLayoutData(gd);
- useDefaultCheckButton.addSelectionListener(widgetListener);
- }
-
- Composite specificFileComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- if (showDefault)
- layout.marginLeft = 20;
- else
- layout.marginLeft = 0;
- layout.marginHeight = 0;
- specificFileComp.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- specificFileComp.setLayoutData(gd);
-
- Label label = new Label(specificFileComp, SWT.NONE);
- label.setText("Filename");
-
- fileNameText = new Text(specificFileComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = showDefault ? 1 : 2;
- fileNameText.setLayoutData(gd);
- fileNameText.setFont(parent.getFont());
- fileNameText.addModifyListener(widgetListener);
-
- if (showDefault)
- {
- label = new Label(specificFileComp, SWT.NONE);
- label.setText(Messages.OutputFileBlock_7);
- }
-
- resourceText = new Text(specificFileComp, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = showDefault ? 1 : 2;
- resourceText.setLayoutData(gd);
- resourceText.setFont(parent.getFont());
- resourceText.addModifyListener(widgetListener);
- }
-
- @Override
- protected void createButtons(Composite parent)
- {
- Composite checkComposite = new Composite(parent,SWT.NONE);
- checkComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- GridLayout gl = new GridLayout();
- gl.marginWidth = 0;
- checkComposite.setLayout(gl);
-
- openFileCheckButton = createCheckButton(checkComposite, Messages.OutputFileBlock_8);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 1;
- openFileCheckButton.setLayoutData(gd);
- openFileCheckButton.addSelectionListener(new SelectionListener()
- {
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (openFileCheckButton.getSelection())
- {
- formatFileCheckButton.setEnabled(true);
- updateLaunchConfigurationDialog();
- }
- else
- {
- formatFileCheckButton.setEnabled(false);
- formatFileCheckButton.setSelection(false);
- }
- }
- });
-
- formatFileCheckButton = createCheckButton(checkComposite, "Format file on completion");
- gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 1;
- formatFileCheckButton.setLayoutData(gd);
- formatFileCheckButton.addSelectionListener(new SelectionListener()
- {
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- updateLaunchConfigurationDialog();
- }
- });
-
- Composite buttonComp = new Composite(parent, SWT.TOP);
- GridLayout layout = new GridLayout(3, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonComp.setLayout(layout);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_BEGINNING);
- gd.horizontalSpan = 1;
- buttonComp.setLayoutData(gd);
- buttonComp.setFont(parent.getFont());
-
- fWorkspaceButton = createPushButton(buttonComp, getMessage(WORKSPACE_BUTTON), null);
- fWorkspaceButton.addSelectionListener(widgetListener);
-
- fFileSystemButton = createPushButton(buttonComp, getMessage(FILE_SYSTEM_BUTTON), null);
- fFileSystemButton.addSelectionListener(widgetListener);
-
- fVariablesButton = createPushButton(buttonComp, getMessage(VARIABLES_BUTTON), null);
- fVariablesButton.addSelectionListener(widgetListener);
- }
-
- public String getName()
- {
- return Messages.OutputFileBlock_9;
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- try
- {
- inputFilename = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, ""); //$NON-NLS-1$
- updateDefaultOutputFile();
-
- boolean useDefault = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_USE_DEFAULT_OUTPUT_FILE, true);
- useDefaultCheckButton.setSelection(useDefault);
-
- outputFileName = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FILENAME, defaultOutputFileName);
- resource = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FOLDER, defaultResource);
-
- updateResourceText(useDefault);
-
- boolean openFileOnCompletion = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OPEN_FILE, true);
- openFileCheckButton.setSelection(openFileOnCompletion);
-
- boolean formatFileOnCompletion = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_FORMAT_FILE, false);
- formatFileCheckButton.setSelection(formatFileOnCompletion);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- boolean useDefault = useDefaultCheckButton.getSelection();
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_USE_DEFAULT_OUTPUT_FILE, useDefault);
-
- String outputFile = resourceText.getText();
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FOLDER, outputFile);
-
- String outputFileName = fileNameText.getText();
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FILENAME, outputFileName);
-
- boolean openFileOnCompletion = openFileCheckButton.getSelection();
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OPEN_FILE, openFileOnCompletion);
-
- boolean formatFileOnCompletion = formatFileCheckButton.getSelection();
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_FORMAT_FILE, formatFileOnCompletion);
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_USE_DEFAULT_OUTPUT_FILE, true);
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FOLDER, (String)null);
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FILENAME, (String)null);
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_OPEN_FILE, true);
- configuration.setAttribute(XSLLaunchConfigurationConstants.ATTR_FORMAT_FILE, false);
- }
-
- @Override
- protected void updateResourceText(boolean useDefault)
- {
- fileNameText.setEnabled(!useDefault);
- if (useDefault)
- fileNameText.setText(defaultOutputFileName == null ? "" : defaultOutputFileName); //$NON-NLS-1$
- else
- fileNameText.setText(outputFileName == null ? defaultOutputFileName : outputFileName);
- super.updateResourceText(useDefault);
- }
-
- private void updateDefaultOutputFile()
- {
- try
- {
- IPath path = XSLTRuntime.defaultOutputFileForInputFile(inputFilename);
- // determine whether this path exists in the workspace
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(path);
- if (files.length > 0)
- {// inside workspace
- IPath p = new Path(files[0].getProject().getName());
- p.append(files[0].getParent().getProjectRelativePath());
- defaultResource = "${workspace_loc:/"+p.toString()+"}";
- }
- else
- {// outside workspace
- IPath p = path.removeLastSegments(1);
- defaultResource = p.toOSString();
- }
- defaultOutputFileName = path.lastSegment();
- }
- catch (CoreException e)
- {
- // do nothing
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputTab.java b/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputTab.java
deleted file mode 100644
index 9a417e6..0000000
--- a/bundles/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/output/OutputTab.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.debug.ui.tabs.output;
-
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsl.debug.internal.util.XSLDebugPluginImages;
-import org.eclipse.wst.xsl.debug.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.debug.ui.Messages;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchConfigurationTab;
-import org.eclipse.wst.xsl.internal.debug.ui.tabs.main.XSLMainTab;
-
-public class OutputTab extends XSLLaunchConfigurationTab
-{
- private final OutputFileBlock outputFileBlock;
-
- public OutputTab(XSLMainTab main)
- {
- outputFileBlock = new OutputFileBlock();
-// outputBlock = new OutputPropertiesBlock(main);
-
-// setBlocks(new ILaunchConfigurationTab[]
-// { outputBlock, outputFileBlock });
- setBlocks(new ILaunchConfigurationTab[]
- { outputFileBlock });
- }
-
- @Override
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- Composite comp = (Composite) getControl();
- GridLayout layout = new GridLayout(1, false);
- comp.setLayout(layout);
-
- outputFileBlock.createControl(comp);
-
-// Group group = new Group(comp, SWT.NULL);
-// group.setText(Messages.OutputTab_0);
-// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-// group.setLayoutData(gd);
-// layout = new GridLayout(2, false);
-// group.setLayout(layout);
-
-// outputBlock.createControl(group);
- }
-
- @Override
- public String getId()
- {
- return "org.eclipse.wst.xsl.internal.debug.ui.tabs.output";
- }
-
- public String getName()
- {
- return Messages.OutputTab_1;
- }
-
- @Override
- public Image getImage() {
- return XSLPluginImageHelper.getInstance().getImage(XSLDebugPluginImages.IMG_OUTPUT_TAB);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.classpath b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.classpath
deleted file mode 100644
index 88c91a8..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/xsl/internal/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/xsl/ui/internal/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.project b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.project
deleted file mode 100644
index 6a6f79d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.jaxp.debug.ui</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f455492..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,20 +0,0 @@
-#Tue Feb 10 05:26:00 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 8a0b589..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xsl.jaxp.debug.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xsl.jaxp.debug.ui.internal.JAXPDebugUIPlugin
-Bundle-Vendor: %vendorName
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xsl.debug.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xsl.launching;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.xsl.jaxp.launching;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.xsl.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,2.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,2.0.0)",
- org.eclipse.jdt.debug.ui;bundle-version="[3.3.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/about.html b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/about.html
deleted file mode 100644
index ed30003..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>August, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/build.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/build.properties
deleted file mode 100644
index 647fcc0..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- icons/,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/icons/xslt_processor.gif b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/icons/xslt_processor.gif
deleted file mode 100644
index 5e71289..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/icons/xslt_processor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.properties
deleted file mode 100644
index f81236c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.jaxp.debug.ui
-vendorName = Eclipse.org
-pluginName = XSL JAXP Debug UI (Incubating)
-pageNameJavaProcessors = Java Processors
-viewNameResult = Result \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.xml b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.xml
deleted file mode 100644
index af972da..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/plugin.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension point="org.eclipse.debug.ui.launchConfigurationTabs">
- <tab
- class="org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.XSLProcessorTab2"
- group="org.eclipse.wst.xsl.internal.debug.ui.launchConfigurationTabGroup.xslt"
- id="org.eclipse.wst.xsl.debug.ui.jaxp.tabs.processor" name="Processor">
- <associatedDelegate
- delegate="org.eclipse.wst.xsl.launching.internal.jaxp.JAXPLaunchConfigurationDelegate">
- </associatedDelegate>
- <placement after="org.eclipse.wst.xsl.internal.debug.ui.tabs.output">
- </placement>
- </tab>
- <tab class="org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab"
- group="org.eclipse.wst.xsl.internal.debug.ui.launchConfigurationTabGroup.xslt"
- id="org.eclipse.jdt.debug.ui.javaJRETab" name="JRE">
- <associatedDelegate
- delegate="org.eclipse.wst.xsl.launching.internal.jaxp.JAXPLaunchConfigurationDelegate">
- </associatedDelegate>
- <placement after="org.eclipse.wst.xsl.debug.ui.jaxp.tabs.processor">
- </placement>
- </tab>
- <tab class="org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab"
- group="org.eclipse.wst.xsl.internal.debug.ui.launchConfigurationTabGroup.xslt"
- id="org.eclipse.jdt.debug.ui.javaClasspathTab" name="Classpath">
- <associatedDelegate
- delegate="org.eclipse.wst.xsl.launching.internal.jaxp.JAXPLaunchConfigurationDelegate">
- </associatedDelegate>
- <placement after="org.eclipse.jdt.debug.ui.javaJRETab">
- </placement>
- </tab>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <page category="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage"
- class="org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences.ProcessorsPreferencePage"
- id="org.eclipse.wst.xsl.ui.preferences.java" name="%pageNameJavaProcessors">
- </page>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- class="org.eclipse.wst.xsl.jaxp.debug.ui.internal.views.ResultView"
- id="org.eclipse.wst.xsl.jaxp.debug.ui.resultview"
- name="%viewNameResult"
- category="org.eclipse.wst.xml">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.debug.ui.DebugPerspective">
- <view
- id="org.eclipse.wst.xsl.jaxp.debug.ui.view1"
- minimized="false"
- relationship="stack"
- relative="org.eclipse.ui.console.ConsoleView"
- visible="false">
- </view>
- </perspectiveExtension>
- </extension>
-
- <extension point="org.eclipse.debug.ui.contextViewBindings">
- <contextViewBinding
- contextId="org.eclipse.wst.xsl.debug.ui.context"
- viewId="org.eclipse.wst.xsl.jaxp.debug.ui.resultview">
- </contextViewBinding>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/JAXPDebugUIPlugin.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/JAXPDebugUIPlugin.java
deleted file mode 100644
index 182d3e5..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/JAXPDebugUIPlugin.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JAXPDebugUIPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.xsl.jaxp.debug.ui";
-
- // The shared instance
- private static JAXPDebugUIPlugin plugin;
-
- /**
- * The constructor
- */
- public JAXPDebugUIPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static JAXPDebugUIPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/AddProcessorDialog.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/AddProcessorDialog.java
deleted file mode 100644
index f9b92b1..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/AddProcessorDialog.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-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.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.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.InstallStandin;
-import org.eclipse.wst.xsl.jaxp.launching.IDebugger;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class AddProcessorDialog extends StatusDialog
-{
- private final InstallStandin standinProcessor;
- private final IProcessorType[] processorTypes;
- private IProcessorType selectedProcessorType;
- private ComboViewer processorTypeField;
- private ProcessorLibraryBlock fLibraryBlock;
- private Text processorNameField;
- private final IStatus[] fStati;
- private int fPrevIndex = -1;
- private final InstalledProcessorsBlock block;
- private boolean adding;
-
- public AddProcessorDialog(InstalledProcessorsBlock block, Shell parent, IProcessorType[] types, IProcessorInstall install)
- {
- super(parent);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.block = block;
- fStati = new IStatus[5];
- for (int i = 0; i < fStati.length; i++)
- {
- fStati[i] = Status.OK_STATUS;
- }
- processorTypes = types;
- selectedProcessorType = install != null ? install.getProcessorType() : types[0];
- InstallStandin standin = null;
- if (install == null)
- {
- adding = true;
- standin = new InstallStandin(JAXPRuntime.createUniqueProcessorId(selectedProcessorType), "", selectedProcessorType.getId(), null, new IProcessorJar[0]); //$NON-NLS-1$
- }
- else
- {
- standin = new InstallStandin(install);
- }
- standinProcessor = standin;
- }
-
- @Override
- protected void configureShell(Shell newShell)
- {
- super.configureShell(newShell);
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp...
- }
-
- protected void createDialogFields(Composite parent)
- {
- GridData gd;
- Label label;
-
- label = new Label(parent, SWT.NONE);
- label.setText(Messages.AddProcessorDialog_processorName);
- processorNameField = new Text(parent, SWT.BORDER);
- gd = new GridData(SWT.NONE, SWT.NONE, false, false);
- gd.widthHint = convertWidthInCharsToPixels(50);
- gd.horizontalSpan = 2;
- processorNameField.setLayoutData(gd);
-
- label = new Label(parent, SWT.NONE);
- label.setText(Messages.AddProcessorDialog_processorType);
- processorTypeField = new ComboViewer(parent, SWT.READ_ONLY);
- gd = new GridData();
- gd.horizontalSpan = 2;
- processorTypeField.getCombo().setLayoutData(gd);
- processorTypeField.setContentProvider(new IStructuredContentProvider()
- {
-
- private Object input;
-
- public Object[] getElements(Object inputElement)
- {
- return (IProcessorType[]) input;
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- input = newInput;
- }
- });
- processorTypeField.setLabelProvider(new LabelProvider()
- {
- @Override
- public String getText(Object element)
- {
- return ((IProcessorType) element).getLabel();
- }
- });
-
- }
-
- protected void createFieldListeners()
- {
- processorTypeField.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateProcessorType();
- }
- });
-
- processorNameField.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- setProcessorNameStatus(validateProcessorName());
- updateStatusLine();
- }
- });
- }
-
- protected String getProcessorName()
- {
- return processorNameField.getText();
- }
-
- @Override
- protected Control createDialogArea(Composite ancestor)
- {
- Composite parent = (Composite) super.createDialogArea(ancestor);
- ((GridLayout) parent.getLayout()).numColumns = 3;
-// ((GridData) parent.getLayoutData()).heightHint = 400;
-// ((GridData) parent.getLayoutData()).widthHint = 400;
-
- createDialogFields(parent);
-
- Label l = new Label(parent, SWT.NONE);
- l.setText(Messages.AddProcessorDialog_jars);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- l.setLayoutData(gd);
-
- fLibraryBlock = new ProcessorLibraryBlock(this);
- Control block = fLibraryBlock.createControl(parent);
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 3;
- block.setLayoutData(gd);
-
- initializeFields();
- createFieldListeners();
- applyDialogFont(parent);
-
- return parent;
- }
-
- private void updateProcessorType()
- {
- int selIndex = processorTypeField.getCombo().getSelectionIndex();
- if (selIndex == fPrevIndex)
- {
- return;
- }
- fPrevIndex = selIndex;
- if (selIndex >= 0 && selIndex < processorTypes.length)
- {
- selectedProcessorType = processorTypes[selIndex];
- }
- fLibraryBlock.initializeFrom(standinProcessor, selectedProcessorType);
- updateStatusLine();
- }
-
- @Override
- public void create()
- {
- super.create();
- processorNameField.setFocus();
- }
-
- private void initializeFields()
- {
- processorTypeField.setInput(processorTypes);
- if (adding)
- {
- processorNameField.setText(""); //$NON-NLS-1$
- processorTypeField.setSelection(new StructuredSelection(processorTypes[0]));
- fLibraryBlock.initializeFrom(standinProcessor, selectedProcessorType);
- }
- else
- {
- processorTypeField.getCombo().setEnabled(false);
- processorTypeField.setSelection(new StructuredSelection(standinProcessor.getProcessorType()));
- processorNameField.setText(standinProcessor.getName());
-
- fLibraryBlock.initializeFrom(standinProcessor, selectedProcessorType);
- }
- setProcessorNameStatus(validateProcessorName());
- updateStatusLine();
- }
-
- private IStatus validateProcessorName()
- {
- IStatus status = Status.OK_STATUS;
- String name = processorNameField.getText();
- if (name == null || name.trim().length() == 0)
- {
- status = new Status(IStatus.INFO, XSLDebugUIPlugin.PLUGIN_ID, IStatus.OK, Messages.AddProcessorDialog_enterName, null);
- }
- else
- {
- if (block.isDuplicateName(name) && (standinProcessor == null || !name.equals(standinProcessor.getName())))
- {
- status = new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, IStatus.OK, Messages.AddProcessorDialog_duplicateName, null);
- }
- else
- {
- // IStatus s = ResourcesPlugin.getWorkspace().validateName(name,
- // IResource.FILE);
- // if (!s.isOK())
- // {
- // status.setError(MessageFormat.format(Messages.AddProcessorDialog_Processor_name_must_be_a_valid_file_name,
- // new String[]
- // { s.getMessage() }));
- // }
- }
- }
- return status;
- }
-
- protected IStatus validateVersionStatus()
- {
- IStatus status = Status.OK_STATUS;
- return status;
- }
-
- protected void updateStatusLine()
- {
- IStatus max = null;
- for (IStatus curr : fStati)
- {
- if (curr.matches(IStatus.ERROR))
- {
- updateStatus(curr);
- return;
- }
- if (max == null || curr.getSeverity() > max.getSeverity())
- {
- max = curr;
- }
- }
- updateStatus(max);
- }
-
- @Override
- protected void okPressed()
- {
- doOkPressed();
- super.okPressed();
- }
-
- private void doOkPressed()
- {
- if (adding)
- {
- setFieldValuesToProcessor(standinProcessor);
- block.processorAdded(standinProcessor);
- }
-// else
-// setFieldValuesToProcessor((ProcessorInstall)editedProcessor);
- }
-
- protected void setFieldValuesToProcessor(InstallStandin processor)
- {
- processor.setName(processorNameField.getText());
- processor.setProcessorTypeId(selectedProcessorType.getId());
-
- IDebugger[] debuggers = JAXPRuntime.getDebuggers();
- for (IDebugger element : debuggers)
- {
- if (element.getProcessorType().equals(selectedProcessorType))
- processor.setDebuggerId(element.getId());
- }
-
- fLibraryBlock.performApply(processor);
- }
-
- protected File getAbsoluteFileOrEmpty(String path)
- {
- if (path == null || path.length() == 0)
- {
- return new File(""); //$NON-NLS-1$
- }
- return new File(path).getAbsoluteFile();
- }
-
- private void setProcessorNameStatus(IStatus status)
- {
- fStati[0] = status;
- }
-
- protected IStatus getSystemLibraryStatus()
- {
- return fStati[3];
- }
-
- protected void setSystemLibraryStatus(IStatus status)
- {
- fStati[3] = status;
- }
-
- protected void setVersionStatus(IStatus status)
- {
- fStati[2] = status;
- }
-
- @Override
- protected void updateButtonsEnableState(IStatus status)
- {
- Button ok = getButton(IDialogConstants.OK_ID);
- if (ok != null && !ok.isDisposed())
- ok.setEnabled(status.getSeverity() == IStatus.OK);
- }
-
- @Override
- protected void setButtonLayoutData(Button button)
- {
- super.setButtonLayoutData(button);
- }
-
- protected String getDialogSettingsSectionName()
- {
- return "ADD_PROCESSOR_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- @Override
- protected IDialogSettings getDialogBoundsSettings()
- {
-// IDialogSettings settings = XSLDebugUIPlugin.getDefault().getDialogSettings();
-// IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
-// if (section == null)
-// {
-// section = settings.addNewSection(getDialogSettingsSectionName());
-// }
-// return section;
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/BasePreferencePage.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/BasePreferencePage.java
deleted file mode 100644
index 73db6bf..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/BasePreferencePage.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-public class BasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- @Override
- protected Control createContents(Composite parent)
- {
- return null;
- }
-
- public void init(IWorkbench workbench)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/InstalledProcessorsBlock.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/InstalledProcessorsBlock.java
deleted file mode 100644
index 91d06b2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/InstalledProcessorsBlock.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIConstants;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.InstallStandin;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class InstalledProcessorsBlock extends AbstractTableBlock implements ISelectionProvider
-{
- private Composite fControl;
- private final List<IProcessorInstall> processors = new ArrayList<IProcessorInstall>();
- private CheckboxTableViewer tableViewer;
- private Button fAddButton;
- private Button fRemoveButton;
- private Button fEditButton;
- private final ListenerList fSelectionListeners = new ListenerList();
- private ISelection fPrevSelection = new StructuredSelection();
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- fSelectionListeners.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- fSelectionListeners.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return new StructuredSelection(tableViewer.getCheckedElements());
- }
-
- public void setSelection(ISelection selection)
- {
- if (selection instanceof IStructuredSelection)
- {
- if (!selection.equals(fPrevSelection))
- {
- fPrevSelection = selection;
- Object jre = ((IStructuredSelection) selection).getFirstElement();
- if (jre == null)
- {
- tableViewer.setCheckedElements(new Object[0]);
- }
- else
- {
- tableViewer.setCheckedElements(new Object[]
- { jre });
- tableViewer.reveal(jre);
- }
- fireSelectionChanged();
- }
- }
- }
-
- public void createControl(Composite ancestor)
- {
-
- Composite parent = new Composite(ancestor, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- parent.setLayout(layout);
- Font font = ancestor.getFont();
- parent.setFont(font);
- fControl = parent;
-
- GridData data;
-
- Label tableLabel = new Label(parent, SWT.NONE);
- tableLabel.setText(Messages.InstalledProcessorsBlock_0);
- data = new GridData();
- data.horizontalSpan = 2;
- tableLabel.setLayoutData(data);
- tableLabel.setFont(font);
-
- Table fTable = new Table(parent, SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL);
-
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 450;
- fTable.setLayoutData(data);
- fTable.setFont(font);
-
- fTable.setHeaderVisible(true);
- fTable.setLinesVisible(true);
-
- TableColumn column1 = new TableColumn(fTable, SWT.NONE);
- column1.setWidth(180);
- column1.setResizable(true);
- column1.setText(Messages.InstalledProcessorsBlock_1);
- column1.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- sortByName();
- }
- });
-
- TableColumn column2 = new TableColumn(fTable, SWT.NONE);
- column2.setWidth(90);
- column2.setResizable(true);
- column2.setText(Messages.InstalledProcessorsBlock_2);
- column2.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- sortByType();
- }
- });
-
- TableColumn column4 = new TableColumn(fTable, SWT.NONE);
- column4.setWidth(180);
- column4.setResizable(true);
- column4.setText(Messages.InstalledProcessorsBlock_4);
- column4.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- sortByVersion();
- }
- });
-
- tableViewer = new CheckboxTableViewer(fTable);
- tableViewer.setLabelProvider(new VMLabelProvider());
- tableViewer.setContentProvider(new ProcessorsContentProvider());
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent evt)
- {
- enableButtons();
- }
- });
-
- tableViewer.addCheckStateListener(new ICheckStateListener()
- {
- public void checkStateChanged(CheckStateChangedEvent event)
- {
- if (event.getChecked())
- {
- setCheckedInstall((IProcessorInstall) event.getElement());
- }
- else
- {
- setCheckedInstall(null);
- }
- }
- });
-
- tableViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent e)
- {
- if (!tableViewer.getSelection().isEmpty())
- {
- editProcessor();
- }
- }
- });
- fTable.addKeyListener(new KeyAdapter()
- {
- @Override
- public void keyPressed(KeyEvent event)
- {
- if (event.character == SWT.DEL && event.stateMask == 0)
- {
- removeProcessors();
- }
- }
- });
-
- Composite buttons = new Composite(parent, SWT.NULL);
- buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttons.setLayout(layout);
- buttons.setFont(font);
-
- fAddButton = createPushButton(buttons, Messages.InstalledProcessorsBlock_5);
- fAddButton.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event evt)
- {
- addProcessor();
- }
- });
-
- fEditButton = createPushButton(buttons, Messages.InstalledProcessorsBlock_6);
- fEditButton.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event evt)
- {
- editProcessor();
- }
- });
-
- fRemoveButton = createPushButton(buttons, Messages.InstalledProcessorsBlock_7);
- fRemoveButton.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event evt)
- {
- removeProcessors();
- }
- });
-
- // copied from ListDialogField.CreateSeparator()
- Label separator = new Label(buttons, SWT.NONE);
- separator.setVisible(false);
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.verticalAlignment = GridData.BEGINNING;
- gd.heightHint = 4;
- separator.setLayoutData(gd);
-
- fillWithWorkspaceProcessors();
- enableButtons();
-
- restoreColumnSettings();
- }
-
- protected void fillWithWorkspaceProcessors()
- {
- List<InstallStandin> standins = new ArrayList<InstallStandin>();
- IProcessorType[] types = JAXPRuntime.getProcessorTypes();
- for (IProcessorType type : types)
- {
- IProcessorInstall[] installs = JAXPRuntime.getProcessors(type.getId());
- for (IProcessorInstall install : installs)
- {
- standins.add(new InstallStandin(install));
- }
- }
- setProcessors(standins.toArray(new IProcessorInstall[standins.size()]));
- }
-
- private void fireSelectionChanged()
- {
- SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection());
- Object[] listeners = fSelectionListeners.getListeners();
- for (Object element : listeners)
- {
- ISelectionChangedListener listener = (ISelectionChangedListener) element;
- listener.selectionChanged(event);
- }
- }
-
- /**
- * Sorts by type, and name within type.
- */
- private void sortByType()
- {
- tableViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- IProcessorInstall left = (IProcessorInstall) e1;
- IProcessorInstall right = (IProcessorInstall) e2;
- return left.getProcessorType().getLabel().compareToIgnoreCase(right.getProcessorType().getLabel());
- }
-
- @Override
- public boolean isSorterProperty(Object element, String property)
- {
- return true;
- }
- });
- }
-
- private void sortByVersion()
- {
- tableViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- IProcessorInstall left = (IProcessorInstall) e1;
- IProcessorInstall right = (IProcessorInstall) e2;
- return left.getSupports().compareToIgnoreCase(right.getSupports());
- }
-
- @Override
- public boolean isSorterProperty(Object element, String property)
- {
- return true;
- }
- });
- }
-
- /**
- * Sorts by name.
- */
- private void sortByName()
- {
- tableViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- if ((e1 instanceof IProcessorInstall) && (e2 instanceof IProcessorInstall))
- {
- IProcessorInstall left = (IProcessorInstall) e1;
- IProcessorInstall right = (IProcessorInstall) e2;
- return left.getName().compareToIgnoreCase(right.getName());
- }
- return super.compare(viewer, e1, e2);
- }
-
- @Override
- public boolean isSorterProperty(Object element, String property)
- {
- return true;
- }
- });
- }
-
- private void enableButtons()
- {
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
- int selectionCount = selection.size();
- fEditButton.setEnabled(selectionCount == 1 && !((IProcessorInstall)selection.getFirstElement()).isContributed());
- if (selectionCount > 0 && selectionCount < tableViewer.getTable().getItemCount())
- {
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext())
- {
- IProcessorInstall install = (IProcessorInstall) iterator.next();
- if (install.isContributed())
- {
- fRemoveButton.setEnabled(false);
- return;
- }
- }
- fRemoveButton.setEnabled(true);
- }
- else
- {
- fRemoveButton.setEnabled(false);
- }
- }
-
- protected Button createPushButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- button.setLayoutData(GridDataFactory.fillDefaults().create());
- return button;
- }
-
- @Override
- public Control getControl()
- {
- return fControl;
- }
-
- protected void setProcessors(IProcessorInstall[] vms)
- {
- processors.clear();
- for (IProcessorInstall element : vms)
- {
- processors.add(element);
- }
- tableViewer.setInput(processors);
- // tableViewer.refresh();
- }
-
- public IProcessorInstall[] getProcessors()
- {
- return processors.toArray(new IProcessorInstall[processors.size()]);
- }
-
- private void addProcessor()
- {
- AddProcessorDialog dialog = new AddProcessorDialog(this, getShell(), JAXPRuntime.getProcessorTypesExclJREDefault(), null);
- dialog.setTitle(Messages.AddProcessorDialog_Add_Title);
- if (dialog.open() != Window.OK)
- {
- return;
- }
- }
-
- public void processorAdded(IProcessorInstall install)
- {
- processors.add(install);
- tableViewer.add(install);
- tableViewer.setSelection(new StructuredSelection(install), true);
- }
-
- public boolean isDuplicateName(String name)
- {
- for (int i = 0; i < processors.size(); i++)
- {
- IProcessorInstall install = processors.get(i);
- if (install.getName().equals(name))
- {
- return true;
- }
- }
- return false;
- }
-
- private void editProcessor()
- {
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
- IProcessorInstall install = (IProcessorInstall) selection.getFirstElement();
- if (install == null)
- {
- return;
- }
- if (!install.isContributed())
- {
-// ProcessorDetailsDialog dialog = new ProcessorDetailsDialog(getShell(), install);
-// dialog.open();
-// }
-// else
-// {
- AddProcessorDialog dialog = new AddProcessorDialog(this, getShell(), JAXPRuntime.getProcessorTypesExclJREDefault(), install);
- dialog.setTitle(Messages.AddProcessorDialog_Edit_Title);
- if (dialog.open() != Window.OK)
- {
- return;
- }
- // fillWithWorkspaceProcessors();
- tableViewer.refresh();
- }
- }
-
- private void removeProcessors()
- {
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
- IProcessorInstall[] vms = new IProcessorInstall[selection.size()];
- Iterator<?> iter = selection.iterator();
- int i = 0;
- while (iter.hasNext())
- {
- vms[i] = (IProcessorInstall) iter.next();
- i++;
- }
- removeProcessors(vms);
- }
-
- public void removeProcessors(IProcessorInstall[] theInstalls)
- {
- IStructuredSelection prev = (IStructuredSelection) getSelection();
- for (IProcessorInstall element : theInstalls)
- {
- processors.remove(element);
- }
- tableViewer.refresh();
- IStructuredSelection curr = (IStructuredSelection) getSelection();
- if (!curr.equals(prev))
- {
- IProcessorInstall[] installs = getProcessors();
- if (curr.size() == 0 && installs.length == 1)
- {
- // pick a default install automatically
- setSelection(new StructuredSelection(installs[0]));
- }
- else
- {
- fireSelectionChanged();
- }
- }
- }
-
- public void setCheckedInstall(IProcessorInstall install)
- {
- if (install == null)
- {
- setSelection(new StructuredSelection());
- }
- else
- {
- setSelection(new StructuredSelection(install));
- }
- }
-
- public IProcessorInstall getCheckedInstall()
- {
- Object[] objects = tableViewer.getCheckedElements();
- if (objects.length == 0)
- {
- return null;
- }
- return (IProcessorInstall) objects[0];
- }
-
- @Override
- protected void setSortColumn(int column)
- {
- switch (column)
- {
- case 1:
- sortByName();
- break;
- case 2:
- sortByType();
- break;
- }
- super.setSortColumn(column);
- }
-
- @Override
- protected Table getTable()
- {
- return tableViewer.getTable();
- }
-
- @Override
- protected IDialogSettings getDialogSettings()
- {
- return XSLDebugUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getQualifier()
- {
- return XSLDebugUIConstants.PROCESSOR_DETAILS_DIALOG;
- }
-
- public String getName()
- {
- return null;
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- }
-
- private class ProcessorsContentProvider implements IStructuredContentProvider
- {
- public Object[] getElements(Object input)
- {
- return processors.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public void dispose()
- {
- }
- }
-
- private class VMLabelProvider extends LabelProvider implements ITableLabelProvider
- {
- public String getColumnText(Object element, int columnIndex)
- {
- if (element instanceof IProcessorInstall)
- {
- IProcessorInstall install = (IProcessorInstall) element;
- switch (columnIndex)
- {
- case 0:
- return install.getName();
- case 1:
- return install.getProcessorType().getLabel();
- case 2:
- if (install.getDebugger() != null)
- {
- return install.getDebugger().getName();
- }
- return Messages.InstalledProcessorsBlock_8;
- }
- }
- return element.toString();
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/Messages.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/Messages.java
deleted file mode 100644
index 43404e1..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/Messages.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences.messages"; //$NON-NLS-1$
- static
- {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
-
- public static String AddProcessorDialog_1;
- public static String AddProcessorDialog_7;
- public static String AddProcessorDialog_Edit_Title;
- public static String AddProcessorDialog_Add_Title;
- public static String AddProcessorDialog_jars;
- public static String AddProcessorDialog_attributes;
- public static String AddProcessorDialog_processorName;
- public static String AddProcessorDialog_processorType;
- public static String AddProcessorDialog_enterName;
- public static String AddProcessorDialog_duplicateName;
-
- public static String ProcessorLibraryBlock_6;
- public static String ProcessorLibraryBlock_AddButton;
- public static String ProcessorLibraryBlock_RemoveButton;
- public static String ProcessorLibraryBlock_AddWorkspaceButton;
- public static String ProcessorLibraryBlock_FileDialog_Title;
- public static String ProcessorLibraryBlock_WorkspaceFileDialog_Title;
- public static String ProcessorLibraryBlock_WorkspaceFileDialog_Message;
-
- public static String InstalledProcessorsBlock_0;
- public static String InstalledProcessorsBlock_1;
- public static String InstalledProcessorsBlock_2;
- public static String InstalledProcessorsBlock_3;
- public static String InstalledProcessorsBlock_4;
- public static String InstalledProcessorsBlock_5;
- public static String InstalledProcessorsBlock_6;
- public static String InstalledProcessorsBlock_7;
- public static String InstalledProcessorsBlock_8;
-
- public static String ProcessorsPreferencePage_0;
- public static String ProcessorsPreferencePage_1;
- public static String ProcessorsPreferencePage_2;
-
- private Messages()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorLibraryBlock.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorLibraryBlock.java
deleted file mode 100644
index b352dc8..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorLibraryBlock.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-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.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-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.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.InstallStandin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.JarContentProvider;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.JarLabelProvider;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class ProcessorLibraryBlock implements SelectionListener, ISelectionChangedListener
-{
- protected static final String LAST_PATH_SETTING = "LAST_PATH_SETTING"; //$NON-NLS-1$
- protected static final String LAST_WORKSPACE_PATH_SETTING = "LAST_WORKSPACE_PATH_SETTING"; //$NON-NLS-1$
- protected static final String DIALOG_SETTINGS_PREFIX = "ProcessorLibraryBlock"; //$NON-NLS-1$
- protected InstallStandin install;
- protected IProcessorType installType;
- protected AddProcessorDialog addDialog = null;
- protected TableViewer tableViewer;
- private Button removeButton;
- private Button addButton;
- private Button addWorkspaceButton;
-
- private final ISelectionStatusValidator validator = new ISelectionStatusValidator()
- {
- public IStatus validate(Object[] selection)
- {
- if (selection.length == 0)
- {
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- for (Object element : selection)
- {
- if (element instanceof IFolder)
- return new Status(IStatus.ERROR, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- else if (element instanceof IFile)
- {
- // IFile file = (IFile) selection[i];
- // TODO check that the file is not already on the classpath
- }
- }
- return new Status(IStatus.OK, XSLDebugUIPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- };
-
- public ProcessorLibraryBlock(AddProcessorDialog dialog)
- {
- addDialog = dialog;
- }
-
- public Control createControl(Composite parent)
- {
- Font font = parent.getFont();
-
- Composite comp = new Composite(parent, SWT.NONE);
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns = 2;
- topLayout.marginHeight = 0;
- topLayout.marginWidth = 0;
- comp.setLayout(topLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(gd);
-
- tableViewer = new TableViewer(comp);
- gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 6;
- tableViewer.getControl().setLayoutData(gd);
- JarContentProvider fLibraryContentProvider = new JarContentProvider();
- tableViewer.setContentProvider(fLibraryContentProvider);
- tableViewer.setLabelProvider(new JarLabelProvider());
- tableViewer.addSelectionChangedListener(this);
-
- Composite pathButtonComp = new Composite(comp, SWT.NONE);
- GridLayout pathButtonLayout = new GridLayout();
- pathButtonLayout.marginHeight = 0;
- pathButtonLayout.marginWidth = 0;
- pathButtonComp.setLayout(pathButtonLayout);
- gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
- pathButtonComp.setLayoutData(gd);
- pathButtonComp.setFont(font);
-
- addWorkspaceButton = createPushButton(pathButtonComp, Messages.ProcessorLibraryBlock_AddWorkspaceButton);
- addWorkspaceButton.addSelectionListener(this);
-
- addButton = createPushButton(pathButtonComp, Messages.ProcessorLibraryBlock_AddButton);
- addButton.addSelectionListener(this);
-
- removeButton = createPushButton(pathButtonComp, Messages.ProcessorLibraryBlock_RemoveButton);
- removeButton.addSelectionListener(this);
-
- return comp;
- }
-
- protected Button createPushButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.PUSH);
- button.setFont(parent.getFont());
- button.setText(label);
- addDialog.setButtonLayoutData(button);
- return button;
- }
-
- protected void createVerticalSpacer(Composite comp, int colSpan)
- {
- Label label = new Label(comp, SWT.NONE);
- GridData gd = new GridData();
- gd.horizontalSpan = colSpan;
- label.setLayoutData(gd);
- }
-
- public void initializeFrom(InstallStandin standin, IProcessorType type)
- {
- install = standin;
- installType = type;
- if (install != null)
- tableViewer.setInput(install);
- update();
- }
-
- /**
- * Updates buttons and status based on current libraries
- */
- public void update()
- {
- updateButtons();
- IStatus status = Status.OK_STATUS;
- if (install != null && install.getProcessorJars().length == 0)
- {
- status = new Status(IStatus.INFO, XSLDebugUIPlugin.PLUGIN_ID, 0, Messages.ProcessorLibraryBlock_6, null);
- }
- addDialog.setSystemLibraryStatus(status);
- addDialog.updateStatusLine();
- }
-
- public void performApply(InstallStandin standin)
- {
- standin.setProcessorJars(install.getProcessorJars());
- }
-
- protected IProcessorInstall getVMInstall()
- {
- return install;
- }
-
- protected IProcessorType getVMInstallType()
- {
- return installType;
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- Object source = e.getSource();
- if (source == removeButton)
- {
- remove((IStructuredSelection) tableViewer.getSelection());
- }
- else if (source == addButton)
- {
- addExternal((IStructuredSelection) tableViewer.getSelection());
- }
- else if (source == addWorkspaceButton)
- {
- addWorkspace((IStructuredSelection) tableViewer.getSelection());
- }
- update();
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- private void addExternal(IStructuredSelection selection)
- {
- IDialogSettings dialogSettings = XSLDebugUIPlugin.getDefault().getDialogSettings();
- String lastUsedPath = dialogSettings.get(LAST_PATH_SETTING);
- if (lastUsedPath == null)
- {
- lastUsedPath = ""; //$NON-NLS-1$
- }
- FileDialog dialog = new FileDialog(tableViewer.getControl().getShell(), SWT.MULTI);
- dialog.setText(Messages.ProcessorLibraryBlock_FileDialog_Title);
- dialog.setFilterExtensions(new String[]
- { "*.jar;*.zip" }); //$NON-NLS-1$
- dialog.setFilterPath(lastUsedPath);
- String res = dialog.open();
- if (res == null)
- {
- return;
- }
- String[] fileNames = dialog.getFileNames();
- int nChosen = fileNames.length;
-
- IPath filterPath = new Path(dialog.getFilterPath());
- IProcessorJar[] libs = new IProcessorJar[nChosen];
- for (int i = 0; i < nChosen; i++)
- {
- libs[i] = JAXPRuntime.createProcessorJar(filterPath.append(fileNames[i]).makeAbsolute());
- }
- dialogSettings.put(LAST_PATH_SETTING, filterPath.toOSString());
-
- IProcessorJar[] currentJars = install.getProcessorJars();
- IProcessorJar[] newJars = new IProcessorJar[currentJars.length + libs.length];
- System.arraycopy(currentJars, 0, newJars, 0, currentJars.length);
- System.arraycopy(libs, 0, newJars, currentJars.length, libs.length);
- install.setProcessorJars(newJars);
-
- tableViewer.add(libs);
- }
-
- private void addWorkspace(IStructuredSelection selection)
- {
- IDialogSettings dialogSettings = XSLDebugUIPlugin.getDefault().getDialogSettings();
- String lastUsedPath = dialogSettings.get(LAST_WORKSPACE_PATH_SETTING);
- IPath lastPath = null;
- if (lastUsedPath != null)
- {
- lastPath = Path.fromPortableString(lastUsedPath);
- }
-
- // IResource currentResource = getResource();
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(tableViewer.getControl().getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(Messages.ProcessorLibraryBlock_WorkspaceFileDialog_Title);
- dialog.setMessage(Messages.ProcessorLibraryBlock_WorkspaceFileDialog_Message);
- dialog.setValidator(validator);
- dialog.addFilter(new ViewerFilter()
- {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (element instanceof IContainer)
- return true;
- else if (element instanceof IFile)
- {
- IFile file = (IFile) element;
- String extension = file.getFileExtension();
- if (extension == null)
- return false;
- return extension.equals("jar"); //$NON-NLS-1$
- }
- return false;
- }
- });
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- if (lastPath != null)
- dialog.setInitialSelection(lastPath);
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setAllowMultiple(true);
-
- if (dialog.open() == Window.OK)
- {
- Object[] elements = dialog.getResult();
- if (elements.length > 0)
- {
- IProcessorJar[] libs = new IProcessorJar[elements.length];
- for (int i = 0; i < elements.length; i++)
- {
- IFile jar = (IFile) elements[i];
- libs[i] = JAXPRuntime.createProcessorJar(jar.getFullPath());
- }
- IProcessorJar[] currentJars = install.getProcessorJars();
- IProcessorJar[] newJars = new IProcessorJar[currentJars.length + libs.length];
- System.arraycopy(currentJars, 0, newJars, 0, currentJars.length);
- System.arraycopy(libs, 0, newJars, currentJars.length, libs.length);
- install.setProcessorJars(newJars);
-
- tableViewer.add(libs);
-
- lastPath = libs[0].getPath();
- lastPath = lastPath.uptoSegment(lastPath.segmentCount());
- dialogSettings.put(LAST_WORKSPACE_PATH_SETTING, lastPath.toPortableString());
- }
- }
- }
-
- private void remove(IStructuredSelection selection)
- {
- List<IProcessorJar> currentJars = new ArrayList<IProcessorJar>(Arrays.asList(install.getProcessorJars()));
- for (Iterator<?> iter = selection.iterator(); iter.hasNext();)
- {
- currentJars.remove(iter.next());
- }
- install.setProcessorJars(currentJars.toArray(new IProcessorJar[0]));
- tableViewer.remove(selection.toArray());
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateButtons();
- }
-
- private void updateButtons()
- {
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
- removeButton.setEnabled(!selection.isEmpty());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorsPreferencePage.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorsPreferencePage.java
deleted file mode 100644
index 53e4eef..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/ProcessorsPreferencePage.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class ProcessorsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- private InstalledProcessorsBlock processorsBlock;
-
- public ProcessorsPreferencePage()
- {
- super();
- // only used when page is shown programatically
- setTitle(Messages.ProcessorsPreferencePage_0);
- setDescription(Messages.ProcessorsPreferencePage_1);
- }
-
- public void init(IWorkbench workbench)
- {
- }
-
- @Override
- protected Control createContents(Composite ancestor)
- {
- initializeDialogUnits(ancestor);
-
- noDefaultAndApplyButton();
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- ancestor.setLayout(layout);
-
- processorsBlock = new InstalledProcessorsBlock();
- processorsBlock.createControl(ancestor);
- Control control = processorsBlock.getControl();
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 1;
- control.setLayoutData(data);
-
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp...
-
- initDefaultInstall();
- processorsBlock.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- IProcessorInstall install = getCurrentDefaultProcessor();
- if (install == null)
- {
- setValid(false);
- setErrorMessage(Messages.ProcessorsPreferencePage_2);
- }
- else
- {
- setValid(true);
- setErrorMessage(null);
- }
- }
- });
- applyDialogFont(ancestor);
- return ancestor;
- }
-
- @Override
- public boolean performOk()
- {
- processorsBlock.saveColumnSettings();
- final boolean[] ok = new boolean[1];
- try
- {
- final IProcessorInstall[] installs = processorsBlock.getProcessors();
- final IProcessorInstall defaultProcessor = getCurrentDefaultProcessor();
- IRunnableWithProgress runnable = new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- {
- try
- {
- JAXPRuntime.saveProcessorPreferences(installs,defaultProcessor,monitor);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- ok[0] = !monitor.isCanceled();
- }
- };
- XSLDebugUIPlugin.getDefault().getWorkbench().getProgressService().busyCursorWhile(runnable);
- }
- catch (InvocationTargetException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (InterruptedException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- return ok[0];
- }
-
- private void initDefaultInstall()
- {
- IProcessorInstall realDefault = JAXPRuntime.getDefaultProcessor();
- if (realDefault != null)
- {
- IProcessorInstall[] installs = processorsBlock.getProcessors();
- for (IProcessorInstall fakeInstall : installs)
- {
- if (fakeInstall.getId().equals(realDefault.getId()))
- {
- verifyDefaultVM(fakeInstall);
- break;
- }
- }
- }
- }
-
- private void verifyDefaultVM(IProcessorInstall install)
- {
- if (install != null)
- {
- processorsBlock.setCheckedInstall(install);
- }
- else
- {
- processorsBlock.setCheckedInstall(null);
- }
- }
-
- private IProcessorInstall getCurrentDefaultProcessor()
- {
- return processorsBlock.getCheckedInstall();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/messages.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/messages.properties
deleted file mode 100644
index cfd4e7f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/preferences/messages.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-AddProcessorDialog_1=Supported versions:
-AddProcessorDialog_7=Processor must support at least one XSLT version
-AddProcessorDialog_Edit_Title=Edit Processor
-AddProcessorDialog_Add_Title=Add Processor
-AddProcessorDialog_processorName=Processor Name:
-AddProcessorDialog_processorType=Processor Type:
-AddProcessorDialog_jars=Libraries:
-AddProcessorDialog_attributes=Attributes:
-AddProcessorDialog_enterName=A name must be entered for this processor
-AddProcessorDialog_duplicateName=The name has already been used
-InstalledProcessorsBlock_0=Installed Java XSLT Processors:
-InstalledProcessorsBlock_1=Name
-InstalledProcessorsBlock_2=Type
-InstalledProcessorsBlock_3=XSLT Versions
-InstalledProcessorsBlock_4=Debugger
-InstalledProcessorsBlock_5=Add
-InstalledProcessorsBlock_6=Edit
-InstalledProcessorsBlock_7=Remove
-InstalledProcessorsBlock_8=None
-
-ProcessorLibraryBlock_6=One or more jar files must be specified
-ProcessorLibraryBlock_AddButton=Add External JARs
-ProcessorLibraryBlock_AddWorkspaceButton=Add Workspace JARs
-ProcessorLibraryBlock_RemoveButton=Remove
-ProcessorLibraryBlock_FileDialog_Title=External JARs
-ProcessorLibraryBlock_WorkspaceFileDialog_Title=Workspace JARs
-ProcessorLibraryBlock_WorkspaceFileDialog_Message=Select the JARs that make up the XSLT processor
-
-ProcessorsPreferencePage_0=Java XSLT Processors
-ProcessorsPreferencePage_1=Add, remove or edit XSLT processor definitions.\nBy default, the checked Processor is used for all transformations.
-ProcessorsPreferencePage_2=Select a default XSLT Processor
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributeDialog.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributeDialog.java
deleted file mode 100644
index 885ec53..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributeDialog.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-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.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsl.jaxp.launching.IAttribute;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchAttributes;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-
-public class AttributeDialog extends StatusDialog
-{
- private Table table;
- private TableViewer tViewer;
- private Text text;
- private List<IAttribute> attributes = new ArrayList<IAttribute>();
- private List<IAttribute> selectedAttributes = new ArrayList<IAttribute>();
-
- public AttributeDialog(Shell parent, LaunchAttributes launchAttributes)
- {
- super(parent);
- setTitle("Select Processor Attributes");
-
- Set<String> attributeSet = new HashSet<String>();
- for (LaunchAttribute att : launchAttributes.getAttributes())
- {
- attributeSet.add(att.uri);
- }
- for (IProcessorType type : JAXPRuntime.getProcessorTypes())
- {
- for (IAttribute attribute : type.getAttributes())
- {
- if (!attributeSet.contains(attribute.getURI()))
- {
- attributeSet.add(attribute.getURI());
- attributes.add(attribute);
- }
- }
- }
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- Composite comp = new Composite(parent,SWT.NONE);
- GridData gd = new GridData(SWT.FILL,SWT.FILL,true,true);
- gd.widthHint = 400;
- comp.setLayoutData(gd);
- comp.setLayout(new GridLayout());
-
- Label label = new Label(comp,SWT.NONE);
- label.setText("Select one or more attributes to set on the XSLT processor.");
-
-
- table = new Table(comp,SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.MULTI);
- table.setHeaderVisible(false);
- gd = new GridData(SWT.FILL,SWT.FILL,true,true);
- gd.verticalIndent = 10;
- gd.heightHint = 200;
- table.setLayoutData(gd);
-
- tViewer = new TableViewer(table);
- tViewer.setContentProvider(new IStructuredContentProvider()
- {
- public Object[] getElements(Object inputElement)
- {
- return attributes.toArray(new IAttribute[0]);
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
- });
- tViewer.setLabelProvider(new LabelProvider(){
- @Override
- public String getText(Object element)
- {
- IAttribute attribute = (IAttribute)element;
- return attribute.getURI();
- }
- });
- tViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- IAttribute a1 = (IAttribute) e1;
- IAttribute a2 = (IAttribute) e2;
- return a1.getURI().compareTo(a2.getURI());
- }
- });
- tViewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- selectedAttributes = sel.toList();
- if (sel.isEmpty())
- text.setText("");
- else
- {
- IAttribute attribute = (IAttribute)sel.getFirstElement();
- text.setText(attribute.getDescription());
- }
- }
- });
- tViewer.addDoubleClickListener(new IDoubleClickListener(){
- public void doubleClick(DoubleClickEvent event)
- {
- buttonPressed(IDialogConstants.OK_ID);
- }
- });
- tViewer.setInput(attributes);
-
- text = new Text(comp,SWT.BORDER | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
- text.setEditable(false);
- gd = new GridData(SWT.FILL,SWT.FILL,true,false);
- gd.heightHint = 80;
- text.setLayoutData(gd);
-
- if (attributes.size() > 0)
- {
- tViewer.setSelection(new StructuredSelection(tViewer.getElementAt(0)), true);
- }
-
- return comp;
- }
-
- public List<IAttribute> getAttributes()
- {
- return selectedAttributes;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributesBlock.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributesBlock.java
deleted file mode 100644
index fbe1111..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/AttributesBlock.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.EditingSupport;
-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.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.JAXPDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.IAttribute;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchAttributes;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-
-public class AttributesBlock extends AbstractTableBlock
-{
- private Table table;
- private TableViewer tViewer;
- private LaunchAttributes attributes;
- private Button removeButton;
- private Map<String,IAttribute> attributeUris = new HashMap<String,IAttribute>();
-
- public AttributesBlock()
- {
- for (IProcessorType type : JAXPRuntime.getProcessorTypes())
- {
- for (IAttribute attribute : type.getAttributes())
- {
- attributeUris.put(attribute.getURI(), attribute);
- }
- }
- }
-
- @Override
- protected IDialogSettings getDialogSettings()
- {
- return XSLDebugUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getQualifier()
- {
- return JAXPDebugUIPlugin.PLUGIN_ID+"."+getClass().getCanonicalName();
- }
-
- @Override
- protected Table getTable()
- {
- return table;
- }
-
- public void createControl(Composite parent)
- {
- TabItem item = new TabItem((TabFolder)parent,SWT.NONE);
- item.setText("Attributes");
-
- Composite composite = new Composite(parent,SWT.NONE);
- GridLayout layout = new GridLayout(2,false);
- layout.marginBottom = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- item.setControl(composite);
-
- table = new Table(composite,SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.MULTI);
- table.setHeaderVisible(true);
- table.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
- table.addKeyListener(new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- performRemove();
- }
- }
- });
-
- TableColumn tc1 = new TableColumn(table,SWT.NONE);
- tc1.setText("Name");
- tc1.setWidth(350);
- tc1.setResizable(true);
-
- TableColumn tc2 = new TableColumn(table,SWT.NONE);
- tc2.setText("Value");
- tc2.setWidth(50);
- tc2.setResizable(true);
-
- Composite buttonComp = new Composite(composite,SWT.FILL);
- buttonComp.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- GridLayout gl = new GridLayout();
- gl.marginWidth = 0;
- buttonComp.setLayout(gl);
-
- Button addButton = new Button(buttonComp,SWT.PUSH);
- addButton.setText("Add");
- addButton.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- addButton.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- public void widgetSelected(SelectionEvent e)
- {
- AttributeDialog dialog = new AttributeDialog(getShell(),attributes);
- if (dialog.open() == Window.OK)
- {
- List<IAttribute> newAttributes = dialog.getAttributes();
- LaunchAttribute first = null;
- for (IAttribute attribute : newAttributes)
- {
- LaunchAttribute att = new LaunchAttribute(attribute.getURI(),"string",null);
- if (first == null)
- first = att;
- attributes.addAttribute(att);
- }
- if (newAttributes.size() > 0)
- {
- tViewer.refresh();
- tViewer.setSelection(new StructuredSelection(first), true);
- tViewer.editElement(first, 1);
- updateLaunchConfigurationDialog();
- }
- }
- }
- });
-
- removeButton = new Button(buttonComp,SWT.PUSH);
- removeButton.setText("Remove");
- removeButton.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- removeButton.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- public void widgetSelected(SelectionEvent e)
- {
- performRemove();
- }
- });
-
- setControl(table);
-
- tViewer = new TableViewer(table);
- tViewer.setContentProvider(new IStructuredContentProvider()
- {
- public Object[] getElements(Object inputElement)
- {
- return attributes.getAttributes().toArray(new LaunchAttribute[0]);
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- attributes = (LaunchAttributes) newInput;
- }
- });
- tViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- LaunchAttribute a1 = (LaunchAttribute) e1;
- LaunchAttribute a2 = (LaunchAttribute) e2;
- return a1.uri.compareTo(a2.uri);
- }
- });
- tViewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateRemoveButton();
- }
- });
-
- TableViewerColumn tvc1 = new TableViewerColumn(tViewer,tc1);
- tvc1.setLabelProvider(new CellLabelProvider(){
- @Override
- public void update(ViewerCell cell)
- {
- LaunchAttribute tv = (LaunchAttribute) cell.getElement();
- cell.setText(tv.uri);
- }
-
- @Override
- public int getToolTipTimeDisplayed(Object object)
- {
- return 5000;
- }
-
- @Override
- public String getToolTipText(Object element)
- {
- LaunchAttribute tv = (LaunchAttribute) element;
- return attributeUris.get(tv.uri).getDescription();
- }
-
- });
-
-// ColumnViewerToolTipSupport.enableFor(tViewer);
-
- TableViewerColumn tvc2 = new TableViewerColumn(tViewer,tc2);
- tvc2.setLabelProvider(new CellLabelProvider(){
- @Override
- public void update(ViewerCell cell)
- {
- LaunchAttribute tv = (LaunchAttribute) cell.getElement();
- cell.setText(tv.value);
- }
- });
-
- tvc2.setEditingSupport(new EditingSupport(tViewer){
-
- @Override
- protected boolean canEdit(Object element)
- {
- return true;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element)
- {
- return new TextCellEditor(table);
- }
-
- @Override
- protected Object getValue(Object element)
- {
- LaunchAttribute tv = (LaunchAttribute)element;
- return tv.value == null ? "" : tv.value;
- }
-
- @Override
- protected void setValue(Object element, Object value)
- {
- LaunchAttribute tv = (LaunchAttribute)element;
- tv.setValue((String)value);
- updateLaunchConfigurationDialog();
- tViewer.update(tv, null);
- }
-
- });
-
- restoreColumnSettings();
- }
-
- protected void updateRemoveButton()
- {
- removeButton.setEnabled(!tViewer.getSelection().isEmpty());
- }
-
- public String getName()
- {
- return Messages.getString("AttributesBlock.16"); //$NON-NLS-1$
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- }
-
- private void initializeAttributesFromStorage(ILaunchConfiguration configuration) throws CoreException
- {
- String s = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_ATTRIBUTES, (String) null);
- if (s != null && s.length() > 0)
- {
- attributes = LaunchAttributes.fromXML(new ByteArrayInputStream(s.getBytes()));
- }
- else
- {
- attributes = new LaunchAttributes();
- }
- tViewer.setInput(attributes);
- updateRemoveButton();
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- try
- {
- initializeAttributesFromStorage(configuration);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- try
- {
- String xml = attributes.toXML();
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_ATTRIBUTES, xml);
- }
- catch (ParserConfigurationException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (IOException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (TransformerException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- private void performRemove()
- {
- IStructuredSelection sel = (IStructuredSelection)tViewer.getSelection();
- for (Iterator iterator = sel.iterator(); iterator.hasNext();)
- {
- LaunchAttribute att = (LaunchAttribute) iterator.next();
- attributes.removeAtribute(att.uri);
- }
- tViewer.refresh();
- updateLaunchConfigurationDialog();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/InstallStandin.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/InstallStandin.java
deleted file mode 100644
index 35b3927..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/InstallStandin.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall;
-
-public class InstallStandin extends ProcessorInstall
-{
- public InstallStandin(IProcessorInstall install)
- {
- super(install.getId(), install.getName(), install.getProcessorType().getId(), install.getProcessorJars(), install.getDebugger() != null ? install.getDebugger().getId() : null, install
- .getSupports(), install.isContributed());
- }
-
- public InstallStandin(String id, String name, String typeId, String debuggerId, IProcessorJar[] jars)
- {
- super(id, name, typeId, jars, debuggerId, "", false); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarContentProvider.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarContentProvider.java
deleted file mode 100644
index f37a0de..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarContentProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-
-public class JarContentProvider implements IStructuredContentProvider
-{
- private IProcessorInstall install;
-
- public Object[] getElements(Object inputElement)
- {
- return install.getProcessorJars();
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- install = (IProcessorInstall) newInput;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarLabelProvider.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarLabelProvider.java
deleted file mode 100644
index 5ded313..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/JarLabelProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-
-public class JarLabelProvider extends LabelProvider
-{
- @Override
- public String getText(Object element)
- {
- IProcessorJar jar = (IProcessorJar) element;
- IPath path = jar.getPath();
- return path.lastSegment() + " - " + path.removeLastSegments(1).toOSString() + ""; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/Messages.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/Messages.java
deleted file mode 100644
index ea96ce6..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/Messages.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertiesBlock.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertiesBlock.java
deleted file mode 100644
index 82ad964..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertiesBlock.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.EditingSupport;
-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.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.JAXPDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.IOutputProperty;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchProperties;
-
-public class OutputPropertiesBlock extends AbstractTableBlock
-{
- private Table table;
- private TableViewer tViewer;
- private LaunchProperties properties;
- private Button removeButton;
- private Map<String,IOutputProperty> propertyUris = new HashMap<String,IOutputProperty>();
-
- public OutputPropertiesBlock()
- {
- for (IProcessorType type : JAXPRuntime.getProcessorTypes())
- {
- for (IOutputProperty property : type.getOutputProperties())
- {
- propertyUris.put(property.getURI(), property);
- }
- }
- }
-
- @Override
- protected IDialogSettings getDialogSettings()
- {
- return XSLDebugUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getQualifier()
- {
- return JAXPDebugUIPlugin.PLUGIN_ID+"."+getClass().getCanonicalName();
- }
-
- @Override
- protected Table getTable()
- {
- return table;
- }
-
- public void createControl(Composite parent)
- {
- TabItem item = new TabItem((TabFolder)parent,SWT.NONE);
- item.setText("Output Properties");
-
- Composite composite = new Composite(parent,SWT.NONE);
- GridLayout layout = new GridLayout(2,false);
- layout.marginBottom = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- item.setControl(composite);
-
- table = new Table(composite,SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.MULTI);
- table.setHeaderVisible(true);
- table.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
- table.addKeyListener(new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- performRemove();
- }
- }
- });
-
-
- TableColumn tc1 = new TableColumn(table,SWT.NONE);
- tc1.setText("Name");
- tc1.setWidth(350);
- tc1.setResizable(true);
-
- TableColumn tc2 = new TableColumn(table,SWT.NONE);
- tc2.setText("Value");
- tc2.setWidth(50);
- tc2.setResizable(true);
-
- Composite buttonComp = new Composite(composite,SWT.FILL);
- buttonComp.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- GridLayout gl = new GridLayout();
- gl.marginWidth = 0;
- buttonComp.setLayout(gl);
-
- Button addButton = new Button(buttonComp,SWT.PUSH);
- addButton.setText("Add");
- addButton.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- addButton.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- public void widgetSelected(SelectionEvent e)
- {
- OutputPropertyDialog dialog = new OutputPropertyDialog(getShell(),properties);
- if (dialog.open() == Window.OK)
- {
- List<IOutputProperty> newProperties = dialog.getOutpuProperties();
- String first = null;
- for (IOutputProperty property : newProperties)
- {
- String att = property.getURI();
- if (first == null)
- first = att;
- properties.setProperty(property.getURI(), null);
- }
- if (newProperties.size() > 0)
- {
- tViewer.refresh();
- tViewer.setSelection(new StructuredSelection(first), true);
- tViewer.editElement(first, 1);
- updateLaunchConfigurationDialog();
- }
- }
- }
- });
-
- removeButton = new Button(buttonComp,SWT.PUSH);
- removeButton.setText("Remove");
- removeButton.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
- removeButton.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
- public void widgetSelected(SelectionEvent e)
- {
- performRemove();
- }
- });
-
- setControl(table);
-
- tViewer = new TableViewer(table);
- tViewer.setContentProvider(new IStructuredContentProvider()
- {
- public Object[] getElements(Object inputElement)
- {
- return properties.getProperties().keySet().toArray(new String[0]);
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
- });
- tViewer.setSorter(new ViewerSorter());
- tViewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateRemoveButton();
- }
- });
-
- TableViewerColumn tvc1 = new TableViewerColumn(tViewer,tc1);
- tvc1.setLabelProvider(new CellLabelProvider(){
- @Override
- public void update(ViewerCell cell)
- {
- String tv = (String) cell.getElement();
- cell.setText(tv);
- }
-
- @Override
- public int getToolTipTimeDisplayed(Object object)
- {
- return 5000;
- }
-
- @Override
- public String getToolTipText(Object element)
- {
- String tv = (String) element;
- return propertyUris.get(tv).getDescription();
- }
-
- });
-
-// ColumnViewerToolTipSupport.enableFor(tViewer);
-
- TableViewerColumn tvc2 = new TableViewerColumn(tViewer,tc2);
- tvc2.setLabelProvider(new CellLabelProvider(){
- @Override
- public void update(ViewerCell cell)
- {
- String tv = (String) cell.getElement();
- String val = properties.getProperty(tv);
- cell.setText(val == null ? "" : val);
- }
- });
-
- tvc2.setEditingSupport(new EditingSupport(tViewer){
-
- @Override
- protected boolean canEdit(Object element)
- {
- return true;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element)
- {
- return new TextCellEditor(table);
- }
-
- @Override
- protected Object getValue(Object element)
- {
- String tv = (String)element;
- String val = properties.getProperty(tv);
- return val == null ? "" : val;
- }
-
- @Override
- protected void setValue(Object element, Object value)
- {
- String tv = (String)element;
- properties.setProperty(tv, (String)value);
- updateLaunchConfigurationDialog();
- tViewer.update(tv, null);
- }
-
- });
-
- restoreColumnSettings();
- }
-
- protected void updateRemoveButton()
- {
- removeButton.setEnabled(!tViewer.getSelection().isEmpty());
- }
-
- public String getName()
- {
- return Messages.getString("AttributesBlock.16"); //$NON-NLS-1$
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
-// LaunchProperties p = new LaunchProperties();
-// p.setProperty("indent", "yes");
-// try
-// {
-// String xml = p.toXML();
-// configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_OUTPUT_PROPERTIES, xml);
-// }
-// catch (ParserConfigurationException e)
-// {
-// XSLDebugUIPlugin.log(e);
-// }
-// catch (IOException e)
-// {
-// XSLDebugUIPlugin.log(e);
-// }
-// catch (TransformerException e)
-// {
-// XSLDebugUIPlugin.log(e);
-// }
- }
-
- private void initializePropertiesFromStorage(ILaunchConfiguration configuration) throws CoreException
- {
- String s = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_OUTPUT_PROPERTIES, (String) null);
- if (s != null && s.length() > 0)
- {
- properties = LaunchProperties.fromXML(new ByteArrayInputStream(s.getBytes()));
- }
- else
- {
- properties = new LaunchProperties();
- }
- tViewer.setInput(properties);
- updateRemoveButton();
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- try
- {
- initializePropertiesFromStorage(configuration);
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- try
- {
- String xml = properties.toXML();
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_OUTPUT_PROPERTIES, xml);
- }
- catch (ParserConfigurationException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (IOException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- catch (TransformerException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- private void performRemove()
- {
- IStructuredSelection sel = (IStructuredSelection)tViewer.getSelection();
- for (Iterator iterator = sel.iterator(); iterator.hasNext();)
- {
- String att = (String) iterator.next();
- properties.removeProperty(att);
- }
- tViewer.refresh();
- updateLaunchConfigurationDialog();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertyDialog.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertyDialog.java
deleted file mode 100644
index 2fc7b7c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/OutputPropertyDialog.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-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.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsl.jaxp.launching.IOutputProperty;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchProperties;
-
-public class OutputPropertyDialog extends StatusDialog
-{
- private Table table;
- private TableViewer tViewer;
- private Text text;
- private List<IOutputProperty> properties = new ArrayList<IOutputProperty>();
- private List<IOutputProperty> selectedProperties = new ArrayList<IOutputProperty>();
-
- public OutputPropertyDialog(Shell parent, LaunchProperties launchProperties)
- {
- super(parent);
- setTitle("Select Output Properties");
-
- Set<String> propertySet = new HashSet<String>();
- for (String att : launchProperties.getProperties().keySet())
- {
- propertySet.add(att);
- }
- for (IProcessorType type : JAXPRuntime.getProcessorTypes())
- {
- for (IOutputProperty property : type.getOutputProperties())
- {
- if (!propertySet.contains(property.getURI()))
- {
- propertySet.add(property.getURI());
- properties.add(property);
- }
- }
- }
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- Composite comp = new Composite(parent,SWT.NONE);
- GridData gd = new GridData(SWT.FILL,SWT.FILL,true,true);
- gd.widthHint = 400;
- comp.setLayoutData(gd);
- comp.setLayout(new GridLayout());
-
- Label label = new Label(comp,SWT.NONE);
- label.setText("Select one or more output properties for the transformation.");
-
-
- table = new Table(comp,SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.MULTI);
- table.setHeaderVisible(false);
- gd = new GridData(SWT.FILL,SWT.FILL,true,true);
- gd.verticalIndent = 10;
- gd.heightHint = 200;
- table.setLayoutData(gd);
-
- tViewer = new TableViewer(table);
- tViewer.setContentProvider(new IStructuredContentProvider()
- {
- public Object[] getElements(Object inputElement)
- {
- return properties.toArray(new IOutputProperty[0]);
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
- });
- tViewer.setLabelProvider(new LabelProvider(){
- @Override
- public String getText(Object element)
- {
- IOutputProperty property = (IOutputProperty)element;
- return property.getURI();
- }
- });
- tViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- IOutputProperty a1 = (IOutputProperty) e1;
- IOutputProperty a2 = (IOutputProperty) e2;
- return a1.getURI().compareTo(a2.getURI());
- }
- });
- tViewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- selectedProperties = sel.toList();
- if (sel.isEmpty())
- text.setText("");
- else
- {
- IOutputProperty property = (IOutputProperty)sel.getFirstElement();
- text.setText(property.getDescription());
- }
- }
- });
- tViewer.addDoubleClickListener(new IDoubleClickListener(){
- public void doubleClick(DoubleClickEvent event)
- {
- buttonPressed(IDialogConstants.OK_ID);
- }
- });
- tViewer.setInput(properties);
-
- text = new Text(comp,SWT.BORDER | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
- text.setEditable(false);
- gd = new GridData(SWT.FILL,SWT.FILL,true,false);
- gd.heightHint = 80;
- text.setLayoutData(gd);
-
- if (properties.size() > 0)
- {
- tViewer.setSelection(new StructuredSelection(tViewer.getElementAt(0)), true);
- }
-
- return comp;
- }
-
- public List<IOutputProperty> getOutpuProperties()
- {
- return selectedProperties;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorBlock.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorBlock.java
deleted file mode 100644
index ab72b9c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorBlock.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.preferences.ProcessorsPreferencePage;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class ProcessorBlock extends AbstractLaunchConfigurationTab
-{
- private Button usePreferencesRadio;
- private Button alterPreferencesButton;
- private Button overridePreferencesRadio;
- private Combo runCombo;
- private Button installedProcessorsButton;
- private ComboViewer runComboViewer;
- private ComboViewer factoryComboViewer;
- private ITransformerFactory currentFactory;
-
- public ProcessorBlock()
- {
- }
-
- public void createControl(Composite parent)
- {
- Font font = parent.getFont();
-
- Composite group = new Composite(parent, SWT.NULL);
- setControl(group);
- group.setLayout(new GridLayout(2, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- group.setFont(font);
-// group.setText(ProcessorMessages.ProcessorBlock_0);
-
- usePreferencesRadio = new Button(group, SWT.RADIO);
- usePreferencesRadio.setText(ProcessorMessages.ProcessorBlock_1);
- usePreferencesRadio.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- preferencesSelected();
- updateLaunchConfigurationDialog();
- }
- });
-
- alterPreferencesButton = new Button(group, SWT.PUSH);
- alterPreferencesButton.setText(ProcessorMessages.ProcessorBlock_2);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gd.widthHint = 150;
- alterPreferencesButton.setLayoutData(gd);
- alterPreferencesButton.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- IPreferencePage page = new ProcessorsPreferencePage();
- showPrefPage("org.eclipse.wst.xslt.launching.ui.preferences.ProcessorPreferencePage", page); //$NON-NLS-1$
- }
- });
-
- overridePreferencesRadio = new Button(group, SWT.RADIO);
- overridePreferencesRadio.setText(ProcessorMessages.ProcessorBlock_4);
- overridePreferencesRadio.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- overrideSelected();
- updateLaunchConfigurationDialog();
- }
- });
-
- installedProcessorsButton = new Button(group, SWT.PUSH);
- installedProcessorsButton.setText(ProcessorMessages.ProcessorsComboBlock_1);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gd.widthHint = 150;
- installedProcessorsButton.setLayoutData(gd);
- installedProcessorsButton.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- IPreferencePage page = new ProcessorsPreferencePage();
- showPrefPage("org.eclipse.wst.xslt.launching.ui.preferences.ProcessorPreferencePage", page); //$NON-NLS-1$
- }
- });
-
- Composite settingsComp = new Composite(group, SWT.NONE);
- GridLayout gl = new GridLayout(3, false);
- gl.marginHeight = 2;
- settingsComp.setLayout(gl);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalIndent = 15;
- gd.horizontalSpan = 2;
- settingsComp.setLayoutData(gd);
- settingsComp.setFont(font);
-
- Label label = new Label(settingsComp, SWT.NONE);
- label.setText(ProcessorMessages.ProcessorBlock_6);
- runCombo = new Combo(settingsComp, SWT.READ_ONLY | SWT.SINGLE);
- runCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- runComboViewer = new ComboViewer(runCombo);
- runComboViewer.setContentProvider(new ComboContentProvider());
- runComboViewer.setLabelProvider(new ComboLabelProvider());
- runComboViewer.setInput(JAXPRuntime.getProcessors());
- runComboViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection sel = (IStructuredSelection) event.getSelection();
- if (!sel.isEmpty())
- {
- IProcessorInstall processor = (IProcessorInstall) sel.getFirstElement();
-
- if (processor.getProcessorType().getTransformerFactories().length > 1)
- factoryComboViewer.getCombo().setVisible(true);
- else
- factoryComboViewer.getCombo().setVisible(false);
-
- factoryComboViewer.setInput(processor.getProcessorType());
-
- boolean found = false;
- for (ITransformerFactory tf : processor.getProcessorType().getTransformerFactories())
- {
- if (tf.equals(currentFactory))
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- currentFactory = processor.getProcessorType().getDefaultTransformerFactory();
- if (currentFactory!=null)
- factoryComboViewer.setSelection(new StructuredSelection(currentFactory));
- }
- }
- updateLaunchConfigurationDialog();
- }
- });
-
- Combo factoryCombo = new Combo(settingsComp, SWT.READ_ONLY | SWT.SINGLE);
- factoryCombo.setLayoutData(new GridData(80,SWT.DEFAULT));
- factoryComboViewer = new ComboViewer(factoryCombo);
- factoryComboViewer.setContentProvider(new IStructuredContentProvider(){
-
- private IProcessorType type;
-
- public Object[] getElements(Object inputElement)
- {
- return type.getTransformerFactories();
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.type = (IProcessorType)newInput;
- }
-
- });
- factoryComboViewer.setLabelProvider(new LabelProvider(){
- @Override
- public String getText(Object element)
- {
- ITransformerFactory f = (ITransformerFactory)element;
- return f.getName(); // + " - " + f.getFactoryClass();
- }
- });
- factoryComboViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- currentFactory = (ITransformerFactory)((IStructuredSelection)event.getSelection()).getFirstElement();
- updateLaunchConfigurationDialog();
- }
- });
-
-// overridePreferencesButton = new Button(group,SWT.CHECK);
-// overridePreferencesButton.setText("Override preferences");
-// gd = new GridData(SWT.NONE,SWT.NONE,false,false);
-// overridePreferencesButton.setLayoutData(gd);
-// overridePreferencesButton.addSelectionListener(new SelectionListener(){
-// public void widgetDefaultSelected(SelectionEvent e)
-// {}
-//
-// public void widgetSelected(SelectionEvent e)
-// {
-// firePreferenceProcessorChanged(overridePreferencesButton.getSelection());
-// }
-// });
- }
-
-
- private void preferencesSelected()
- {
- alterPreferencesButton.setEnabled(true);
- installedProcessorsButton.setEnabled(false);
- runCombo.setEnabled(false);
- factoryComboViewer.getCombo().setEnabled(false);
- runComboViewer.setSelection(new StructuredSelection(getRunProcessorPreference()), true);
- }
-
- private void overrideSelected()
- {
- alterPreferencesButton.setEnabled(false);
- installedProcessorsButton.setEnabled(true);
- factoryComboViewer.getCombo().setEnabled(true);
- runCombo.setEnabled(true);
- }
-
- private void showPrefPage(String id, IPreferencePage page)
- {
- XSLDebugUIPlugin.showPreferencePage(id, page);
- // now refresh everything
- runComboViewer.setInput(JAXPRuntime.getProcessors());
- runComboViewer.setSelection(new StructuredSelection(getRunProcessorPreference()), true);
- // preferencesSelected();
- }
-
- public String getName()
- {
- return ProcessorMessages.ProcessorBlock_7;
- }
-
- public void initializeFrom(ILaunchConfiguration configuration)
- {
- try
- {
- boolean useDefaultProcessor = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, true);
- if (useDefaultProcessor)
- {
- usePreferencesRadio.setSelection(true);
- overridePreferencesRadio.setSelection(false);
- preferencesSelected();
- }
- else
- {
- usePreferencesRadio.setSelection(false);
- overridePreferencesRadio.setSelection(true);
- overrideSelected();
-
- IProcessorInstall runInstall = null;
- String runId = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR, (String) null);
- if (runId != null)
- runInstall = JAXPRuntime.getProcessor(runId);
- if (runInstall == null)
- runInstall = getRunProcessorPreference();
- runComboViewer.setSelection(new StructuredSelection(runInstall));
-
-
- String factoryId = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_TRANSFORMER_FACTORY, (String) null);
- if (factoryId == null)
- {
- currentFactory = runInstall.getProcessorType().getDefaultTransformerFactory();
- }
- else
- {
- for (ITransformerFactory tf : runInstall.getProcessorType().getTransformerFactories())
- {
- if (tf.getFactoryClass().equals(factoryId))
- {
- currentFactory = tf;
- break;
- }
- }
- }
-
- if (currentFactory == null)
- {
- currentFactory = runInstall.getProcessorType().getDefaultTransformerFactory();
- }
- if (currentFactory != null)
- {
- factoryComboViewer.setSelection(new StructuredSelection(currentFactory), true);
- }
- }
- }
- catch (CoreException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- }
-
- private IProcessorInstall getRunProcessorPreference()
- {
- return JAXPRuntime.getDefaultProcessor();
- }
-
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- boolean usePreferences = usePreferencesRadio.getSelection();
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, usePreferences);
- if (!usePreferences)
- {
- IProcessorInstall runprocessor = (IProcessorInstall) ((IStructuredSelection) runComboViewer.getSelection()).getFirstElement();
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR, runprocessor.getId());
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_TRANSFORMER_FACTORY, currentFactory == null ? null : currentFactory.getFactoryClass());
- }
- }
-
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
- {
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, true);
- configuration.setAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR, (String) null);
- }
-
- private class ComboContentProvider implements IStructuredContentProvider
- {
- public Object[] getElements(Object inputElement)
- {
- return JAXPRuntime.getProcessors();
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
- }
-
- private class ComboLabelProvider extends LabelProvider
- {
- @Override
- public String getText(Object element)
- {
- IProcessorInstall install = (IProcessorInstall) element;
- return install.getName();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDescriptor.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDescriptor.java
deleted file mode 100644
index 83bf92f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDescriptor.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-public abstract class ProcessorDescriptor
-{
- public abstract String getDescription();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDetailsDialog.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDetailsDialog.java
deleted file mode 100644
index e0621f5..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorDetailsDialog.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-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.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-
-public class ProcessorDetailsDialog extends Dialog
-{
- private final IProcessorInstall install;
-
- public ProcessorDetailsDialog(Shell shell, IProcessorInstall install)
- {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.install = install;
- }
-
- @Override
- protected void configureShell(Shell newShell)
- {
- super.configureShell(newShell);
- newShell.setText(ProcessorMessages.ProcessorDetailsDialog_Title);
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp...
- }
-
- @Override
- protected Control createDialogArea(Composite ancestor)
- {
- Composite parent = (Composite) super.createDialogArea(ancestor);
- GridLayout layout = new GridLayout(2, false);
- parent.setLayout(layout);
-
- // type
- createLabel(parent, ProcessorMessages.ProcessorDetailsDialog_installType);
- createLabel(parent, install.getProcessorType().getLabel());
-
- // name
- createLabel(parent, ProcessorMessages.ProcessorDetailsDialog_installName);
- createLabel(parent, install.getName());
-
- // jars
- Label label = createLabel(parent, ProcessorMessages.ProcessorDetailsDialog_installClasspath);
- GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING);
- label.setLayoutData(gd);
- TableViewer libraryViewer = new TableViewer(parent);
- gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 6;
- libraryViewer.getControl().setLayoutData(gd);
- libraryViewer.setContentProvider(new JarContentProvider());
- libraryViewer.setLabelProvider(new JarLabelProvider());
- libraryViewer.setInput(install);
-
- applyDialogFont(parent);
- return parent;
- }
-
- private Label createLabel(Composite parent, String text)
- {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- return label;
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- protected String getDialogSettingsSectionName()
- {
- return "XSL_DETAILS_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- @Override
- protected IDialogSettings getDialogBoundsSettings()
- {
- IDialogSettings settings = XSLDebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null)
- {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create OK and Cancel buttons by default
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.java
deleted file mode 100644
index ba4e159..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.osgi.util.NLS;
-
-class ProcessorMessages extends NLS
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor.ProcessorMessages"; //$NON-NLS-1$
-
- public static String ProcessorBlock_0;
- public static String ProcessorBlock_1;
- public static String ProcessorBlock_2;
- public static String ProcessorBlock_4;
- public static String ProcessorBlock_6;
- public static String ProcessorBlock_7;
- public static String ProcessorsComboBlock_1;
- public static String ProcessorDetailsDialog_Title;
- public static String ProcessorDetailsDialog_installName;
- public static String ProcessorDetailsDialog_installType;
- public static String ProcessorDetailsDialog_installClasspath;
-
- static
- {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ProcessorMessages.class);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.properties
deleted file mode 100644
index caa7275..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/ProcessorMessages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-ProcessorBlock_0=XSLT Processor
-ProcessorBlock_1=Use processor from preferences
-ProcessorBlock_2=Change preferences...
-ProcessorBlock_4=Use specific processor
-ProcessorBlock_6=Processor:
-ProcessorBlock_7=Processor
-ProcessorsComboBlock_1=&Installed processors...
-
-ProcessorDetailsDialog_Title=Built-in XSLT Processor
-ProcessorDetailsDialog_installName=Name:
-ProcessorDetailsDialog_installType=Type:
-ProcessorDetailsDialog_installClasspath=Libraries:
-
-
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/XSLProcessorTab2.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/XSLProcessorTab2.java
deleted file mode 100644
index 5d648c4..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/XSLProcessorTab2.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver - bug 223557 - Added images contributed by Holger Voormann
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.tabs.processor;
-
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchConfigurationTab;
-import org.eclipse.wst.xsl.jaxp.debug.ui.internal.JAXPDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class XSLProcessorTab2 extends XSLLaunchConfigurationTab
-{
- private final ProcessorBlock processorBlock;
- private final AttributesBlock attributesBlock;
- private final OutputPropertiesBlock outputPropertiesBlock;
- private Image image;
-
- public XSLProcessorTab2()
- {
- attributesBlock = new AttributesBlock();
- outputPropertiesBlock = new OutputPropertiesBlock();
- processorBlock = new ProcessorBlock();
-
- setBlocks(new ILaunchConfigurationTab[]
- { processorBlock , attributesBlock, outputPropertiesBlock });
- }
-
- @Override
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- Composite comp = (Composite) getControl();
-
- processorBlock.createControl(comp);
-
- TabFolder tabFolder = new TabFolder(comp,SWT.NONE);
- tabFolder.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
-
- outputPropertiesBlock.createControl(tabFolder);
- attributesBlock.createControl(tabFolder);
- }
-
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
- {
- super.performApply(configuration);
- IProcessorInvoker invoker = JAXPRuntime.getProcessorInvokers()[0];
- configuration.setAttribute(JAXPLaunchConfigurationConstants.INVOKER_DESCRIPTOR, invoker.getId());
- }
-
- public String getName()
- {
- return Messages.getString("XSLProcessorTab.0"); //$NON-NLS-1$
- }
-
- @Override
- public String getId()
- {
- return "org.eclipse.wst.xsl.debug.ui.jaxp.tabs.processor";
- }
-
- @Override
- public Image getImage()
- {
- if (image == null)
- {
- ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(JAXPDebugUIPlugin.PLUGIN_ID, "icons/xslt_processor.gif");
- image = id.createImage();
- }
- return image;
- }
-
- @Override
- public void dispose()
- {
- if (image != null)
- image.dispose();
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/messages.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/messages.properties
deleted file mode 100644
index 1cebef7..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/tabs/processor/messages.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-AttributesBlock.1=Change Preferences...
-AttributesBlock.10=type
-AttributesBlock.11=value
-AttributesBlock.12=value
-AttributesBlock.16=Processor Attributes
-AttributesBlock.3=Use specific attributes
-AttributesBlock.4=Attribute
-AttributesBlock.5=Type
-AttributesBlock.6=Value
-AttributesBlock.9=name
-XSLProcessorTab.0=Processor
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/views/ResultView.java b/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/views/ResultView.java
deleted file mode 100644
index 62395bd..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug.ui/src/org/eclipse/wst/xsl/jaxp/debug/ui/internal/views/ResultView.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.ui.internal.views;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget;
-import org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL;
-
-/**
- * TODO handle multiple concurrent debugging processes (and bring the current results to the top depending on which selected in Debug view)
- *
- * @author Doug Satchwell
- */
-public class ResultView extends ViewPart implements IDebugEventSetListener
-{
- private SourceViewer sv;
-
- @Override
- public void dispose()
- {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- super.dispose();
- }
-
- @Override
- public void createPartControl(Composite parent)
- {
- this.sv = createViewer(parent);
-
- // handle any launches already added
- IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
- for (IDebugTarget debugTarget : targets)
- {
- if (debugTarget instanceof JAXPDebugTarget)
- {
- handleDebugTarget((JAXPDebugTarget)debugTarget);
- }
- }
- // listen to further launches
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- private SourceViewer createViewer(Composite parent)
- {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationXSL();
-
- @Override
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- @Override
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
- };
- SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- viewer.configure(sourceViewerConfiguration);
- viewer.setEditable(false);
- return viewer;
- }
-
- @Override
- public void setFocus()
- {}
-
- public void handleDebugEvents(DebugEvent[] events)
- {
- for (DebugEvent debugEvent : events)
- {
- if (debugEvent.getKind() == DebugEvent.CREATE && debugEvent.getSource() instanceof JAXPDebugTarget)
- {
- handleDebugTarget((JAXPDebugTarget)debugEvent.getSource());
- }
- }
- }
-
- private void handleDebugTarget(JAXPDebugTarget xdt)
- {
- // first, clear the viewer
- sv.setDocument(null);
-
- final Reader reader = xdt.getGenerateReader();
- IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService)getSite().getService(IWorkbenchSiteProgressService.class);
- service.schedule(new Job("Result view job"){
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try
- {
- char[] c = new char[8192]; // this is the default BufferedWriter size, so we will usually get chunks of this size
- int size;
- while((size = reader.read(c)) != -1)
- {
- writeString(new String(c,0,size));
- }
- }
- catch (IOException e)
- {
- // ignore
- }
- finally
- {
- monitor.done();
- }
- return status;
- }
-
- private void writeString(final String s)
- {
- getSite().getShell().getDisplay().syncExec(new Runnable(){
-
- public void run()
- {
- // if this is the first lot of data, determine the correct content type and set the appropriate document
- if (sv.getDocument() == null)
- {
- IDocument document;
- if (s.startsWith("<!DOCTYPE html"))
- {
- String contentType = "org.eclipse.wst.html.core.htmlsource";
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentType);
- document = scratchModel.getStructuredDocument();
- }
- else if (s.startsWith("<?xml"))
- {
- String contentType = "org.eclipse.core.runtime.xml";
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentType);
- document = scratchModel.getStructuredDocument();
- }
- else
- {
- // TODO how to create a plain text Document??
- document = null;
- }
- sv.setDocument(document);
- }
- try
- {
- sv.getDocument().replace(sv.getDocument().getLength(), 0, s);
- }
- catch (BadLocationException e)
- {
- XSLDebugUIPlugin.log(e);
- }
- sv.revealRange(sv.getDocument().getLength(),0);
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(ResultView.this);
- }
- });
- }
- });
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/.classpath b/bundles/org.eclipse.wst.xsl.jaxp.debug/.classpath
deleted file mode 100644
index 2fbb7a2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/.project b/bundles/org.eclipse.wst.xsl.jaxp.debug/.project
deleted file mode 100644
index 96358c2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.jaxp.debug</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f915f19..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,20 +0,0 @@
-#Tue Feb 10 05:26:11 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.jaxp.debug/META-INF/MANIFEST.MF
deleted file mode 100644
index 21dd829..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xsl.jaxp.debug
-Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: %vendorName
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Require-Bundle: org.apache.commons.logging;bundle-version="1.0.4";visibility:=reexport
-Export-Package: org.eclipse.wst.xsl.jaxp.debug.debugger,
- org.eclipse.wst.xsl.jaxp.debug.invoker
-Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/about.html b/bundles/org.eclipse.wst.xsl.jaxp.debug/about.html
deleted file mode 100644
index ed30003..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>August, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/build.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug/build.properties
deleted file mode 100644
index d944674..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/plugin.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug/plugin.properties
deleted file mode 100644
index 50e0ca0..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.jaxp.debug
-vendorName = Eclipse.org
-pluginName = XSL JAXP Debugger (Incubating) \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/log4j.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/log4j.properties
deleted file mode 100644
index 09bb551..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/log4j.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-# Set root logger level to DEBUG and its appenders are A1 and A2
-log4j.rootLogger=DEBUG, A2
-
-# A2 is set to be a ConsoleAppender
-log4j.appender.A2=org.apache.log4j.ConsoleAppender
-
-# A2 uses PatternLayout.
-log4j.appender.A2.layout=org.apache.log4j.PatternLayout
-log4j.appender.A2.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{1} %x - %m%n
-
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/AbstractDebugger.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/AbstractDebugger.java
deleted file mode 100644
index c099904..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/AbstractDebugger.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Stack;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException;
-
-/**
- * An implementation of <code>IXSLDebugger</code>.
- *
- * This class can be subclassed in order to provide debugging for a particular XSLT processor.
- *
- * @author Doug Satchwell
- */
-public abstract class AbstractDebugger implements IXSLDebugger
-{
- private static final Log log = LogFactory.getLog(AbstractDebugger.class);
-
- private static final int ACTION_DO_NOTHING = 0;
- private static final int ACTION_STOP = 1;
- private static final int ACTION_QUIT = 2;
- private static final int ACTION_SUSPEND = 3;
- private static final int ACTION_RESUME = 4;
- private static final int ACTION_STEP_INTO = 5;
- private static final int ACTION_STEP_OVER = 6;
- private static final int ACTION_STEP_RETURN = 7;
-
- private static final String EVENT_STARTED = "started"; //$NON-NLS-1$
- private static final String EVENT_STOPPED = "stopped"; //$NON-NLS-1$
- private static final String EVENT_SUSPENDED = "suspended client"; //$NON-NLS-1$
- private static final String EVENT_SUSPENDED_STEP = "suspended step"; //$NON-NLS-1$
- private static final String EVENT_RESUMED = "resumed client"; //$NON-NLS-1$
- private static final String EVENT_RESUMED_STEP = "resumed step"; //$NON-NLS-1$
-
- private IProcessorInvoker invoker;
- private int action;
- private Writer eventWriter;
- private Writer generatedWriter;
- private final Set breakpoints = Collections.synchronizedSet(new HashSet());
- private final Stack stack = new Stack();
- private StyleFrame stepOverFrame;
- private BreakPoint breakpoint;
- private URL sourceURL;
- private Result result;
-
- private int stepOverStackSize;
-
- public void setInvoker(IProcessorInvoker invoker)
- {
- this.invoker = invoker;
- }
-
- public void setEventWriter(Writer writer)
- {
- eventWriter = writer;
- }
-
- public void setGeneratedWriter(Writer writer)
- {
- this.generatedWriter = writer;
- }
-
- public void setSource(URL sourceURL)
- {
- this.sourceURL = sourceURL;
- }
-
- public void setTarget(final Writer writer)
- {
- result = new StreamResult(new Writer(){
- public void write(char[] cbuf, int off, int len) throws IOException
- {
- writer.write(cbuf, off, len);
- generatedWriter.write(cbuf,off,len);
- }
-
- public void close() throws IOException
- {
- writer.close();
- generatedWriter.close();
- }
-
- public void flush() throws IOException
- {
- writer.flush();
- generatedWriter.flush();
- }
- });
- }
-
- public void run()
- {
- if (action != ACTION_QUIT)
- {
- debuggerStarted();
- try
- {
- invoker.transform(sourceURL, result);
- }
- catch (TransformationException e)
- {
- log.error("Transform failed", e); //$NON-NLS-1$
- }
- debuggerStopped();
- }
- }
-
- public synchronized void suspend()
- {
- action = ACTION_SUSPEND;
- notify();
- }
-
- public synchronized void resume()
- {
- action = ACTION_RESUME;
- notify();
- }
-
- public synchronized void stepInto()
- {
- action = ACTION_STEP_INTO;
- notify();
- }
-
- public synchronized void stepOver()
- {
- action = ACTION_STEP_OVER;
- stepOverFrame = peekStyleFrame();
- stepOverStackSize = stack.size();
- notify();
- }
-
- public synchronized void stepReturn()
- {
- action = ACTION_STEP_RETURN;
- stepOverStackSize = stack.size();
- notify();
- }
-
- public synchronized void quit()
- {
- action = ACTION_QUIT;
- }
-
- public String stack()
- {
- StringBuffer sb = new StringBuffer();
- synchronized (stack)
- {
- for (Iterator iter = stack.iterator(); iter.hasNext();)
- {
- StyleFrame frame = (StyleFrame) iter.next();
- sb.append(frame.toString());
- for (Iterator iter2 = frame.getVariableStack().iterator(); iter2.hasNext();)
- {
- sb.append("|"); //$NON-NLS-1$
- Variable v = (Variable) iter2.next();
- sb.append(v.getId());
- }
- if (iter.hasNext())
- sb.append("$$$"); //$NON-NLS-1$
- }
- }
- return sb.toString();
- }
-
- /**
- * Check whether the debugger has been stopped and perform the appropriate action if so.
- */
- public synchronized void checkStopped()
- {
- if (action == ACTION_QUIT)
- debuggerQuit();
- else if (action == ACTION_STOP)
- debuggerStopped();
- }
-
- /**
- * Check whether the debugger is currently suspended or stepping at the given breakpoint and style frame,
- * and perform the appropriate action if so.
- *
- * @param styleFrame the styleframe to check
- * @param breakpoint the current location
- */
- public synchronized void checkSuspended(StyleFrame styleFrame, BreakPoint breakpoint)
- {
- // do not suspend unless the line actually changed
- if (breakpoint.equals(this.breakpoint))
- return;
- int stackSize;
- synchronized (stack)
- {
- stackSize = stack.size();
- }
- // do not suspend if there is nothing in the stack
- if (stackSize == 0)
- return;
- switch (action)
- {
- case ACTION_SUSPEND:
- debuggerSuspendedClient(breakpoint);
- break;
- case ACTION_STEP_OVER:
- // suspend if we are in the same template or we are moving up the stack
- if (styleFrame.equals(stepOverFrame) || stackSize < stepOverStackSize)
- debuggerSuspendedStep(breakpoint);
- break;
- case ACTION_STEP_INTO:
- debuggerSuspendedStep(breakpoint);
- break;
- case ACTION_STEP_RETURN:
- // suspend if we moved up the stack
- if (stackSize < stepOverStackSize)
- debuggerSuspendedStep(breakpoint);
- break;
- default:
- checkBreakpoint(breakpoint);
- }
- }
-
- private synchronized void checkBreakpoint(BreakPoint breakpoint)
- {
- if (isBreakpoint(breakpoint))
- debuggerSuspendedBreakpoint(breakpoint);
- }
-
- /**
- * Called when the next transform in the pipeline has begun.
- */
- public synchronized void debuggerTransformStarted()
- {
- stack.clear();
- }
-
- protected synchronized void debuggerStarted()
- {
- action = ACTION_DO_NOTHING;
- sendEvent(EVENT_STARTED);
- }
-
- protected synchronized void debuggerStopped()
- {
- action = ACTION_DO_NOTHING;
- sendEvent(EVENT_STOPPED);
- }
-
- private synchronized void debuggerQuit()
- {
- // just wait here indefinitely until the JVM exists, just to make sure
- // we don't send any further events
- try
- {
- wait();
- }
- catch (InterruptedException e)
- {
- }
- }
-
- private synchronized void debuggerSuspendedBreakpoint(BreakPoint breakpoint)
- {
- sendEvent("suspended breakpoint " + breakpoint); //$NON-NLS-1$
- debuggerSuspended(breakpoint);
- }
-
- private synchronized void debuggerSuspendedStep(BreakPoint breakpoint)
- {
- sendEvent(EVENT_SUSPENDED_STEP);
- debuggerSuspended(breakpoint);
- }
-
- private synchronized void debuggerSuspendedClient(BreakPoint breakpoint)
- {
- sendEvent(EVENT_SUSPENDED);
- debuggerSuspended(breakpoint);
- }
-
- public synchronized void debuggerSuspended(BreakPoint breakpoint)
- {
- this.breakpoint = breakpoint;
- do
- {
- try
- {
- wait();
- }
- catch (InterruptedException e)
- {
- }
- }
- while (action != ACTION_RESUME && action != ACTION_STEP_INTO && action != ACTION_STEP_OVER && action != ACTION_STEP_RETURN && action != ACTION_STOP);
- debuggerResumed();
- }
-
- private synchronized void debuggerResumed()
- {
- if (action == ACTION_STEP_INTO || action == ACTION_STEP_OVER || action == ACTION_STEP_RETURN)
- sendEvent(EVENT_RESUMED_STEP);
- else
- sendEvent(EVENT_RESUMED);
- }
-
- private synchronized void sendEvent(String event)
- {
- try
- {
- log.info("Sending event: " + event+" eventWriter="+eventWriter); //$NON-NLS-1$//$NON-NLS-2$
- eventWriter.write(event + "\n"); //$NON-NLS-1$
- eventWriter.flush();
- }
- catch (IOException e)
- {
- log.error("Error sending event", e); //$NON-NLS-1$
- }
- }
-
- public void addBreakpoint(BreakPoint breakpoint)
- {
- log.info("Adding breakpoint: " + breakpoint); //$NON-NLS-1$
- breakpoints.add(breakpoint);
- }
-
- public void removeBreakpoint(BreakPoint breakpoint)
- {
- log.info("Removing breakpoint: " + breakpoint); //$NON-NLS-1$
- breakpoints.remove(breakpoint);
- }
-
- private boolean isBreakpoint(BreakPoint breakpoint)
- {
- // do not check for breakpoint unless the line or filename actually changed
- if (breakpoint.equals(this.breakpoint))
- return false;
- this.breakpoint = null;
- return breakpoints.contains(breakpoint);
- }
-
- /**
- * Pop a style frame from the stack.
- *
- * @return the popped style frame
- */
- public StyleFrame popStyleFrame()
- {
- synchronized (stack)
- {
- StyleFrame styleFrame = (StyleFrame) stack.pop();
- if (styleFrame.getParent() != null)
- styleFrame.getParent().removeChild(styleFrame);
- log.trace("Popped frame: " + styleFrame + " (size after pop=" + stack.size() + ")"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- return styleFrame;
- }
- }
-
- /**
- * Push a style frame onto the stack.
- *
- * @param styleFrame
- */
- public void pushStyleFrame(StyleFrame styleFrame)
- {
- synchronized (stack)
- {
- stack.push(styleFrame);
- log.trace("Pushed frame: " + styleFrame + " (size after push=" + stack.size() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- /**
- * Peek a style frame from the stack.
- *
- * @return the peeked style frame
- */
- public StyleFrame peekStyleFrame()
- {
- synchronized (stack)
- {
- if (stack.size() > 0)
- return (StyleFrame) stack.peek();
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/BreakPoint.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/BreakPoint.java
deleted file mode 100644
index 0b6000d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/BreakPoint.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-/**
- * A line number in a file.
- *
- * @author Doug Satchwell
- */
-public class BreakPoint
-{
- private String file;
- private final int line;
-
- /**
- * Construct a new instance of this for the given file and line number.
- *
- * @param file the file path
- * @param line the line number
- */
- public BreakPoint(String file, int line)
- {
- this.file = file;
- this.line = line;
- }
-
- /**
- * Get the file location.
- *
- * @return the file
- */
- public String getFile()
- {
- return file;
- }
-
- /**
- * Get the line number
- *
- * @return the line number
- */
- public int getLine()
- {
- return line;
- }
-
- public int hashCode()
- {
- int hash = 3 * file.hashCode() + 5 * line;
- return hash;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- return true;
- if (obj instanceof BreakPoint)
- {
- BreakPoint b = (BreakPoint) obj;
- return b.file.equals(file) && b.line == line;
- }
- return false;
- }
-
- public String toString()
- {
- return file + " " + line; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugConstants.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugConstants.java
deleted file mode 100644
index 2383a29..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugConstants.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-/**
- * Constants used by the debugger.
- *
- * <p>
- * Note that class is loaded both on the Eclipse classpath and the
- * launched transformation process, such that they can use exactly the same constants
- * for communication.
- * </p>
- *
- * @author Doug Satchwell
- */
-public class DebugConstants
-{
- /**
- * The constant used to notify the debugger to start.
- */
- public static final String REQUEST_START = "start"; //$NON-NLS-1$
- /**
- * The constant used to signify addition of a breakpoint.
- */
- public static final String REQUEST_ADD_BREAKPOINT = "add"; //$NON-NLS-1$
- /**
- * The constant used to signify removal of a breakpoint.
- */
- public static final String REQUEST_REMOVE_BREAKPOINT = "remove"; //$NON-NLS-1$
- /**
- * The constant used to signify step into.
- */
- public static final String REQUEST_STEP_INTO = "step into"; //$NON-NLS-1$
- /**
- * The constant used to signify step over.
- */
- public static final String REQUEST_STEP_OVER = "step over"; //$NON-NLS-1$
- /**
- * The constant used to signify suspension.
- */
- public static final String REQUEST_SUSPEND = "suspend"; //$NON-NLS-1$
- /**
- * The constant used to signify resume.
- */
- public static final String REQUEST_RESUME = "resume"; //$NON-NLS-1$
- /**
- * The constant used to request the stack.
- */
- public static final String REQUEST_STACK = "stack"; //$NON-NLS-1$
- /**
- * The constant used to request a variable.
- */
- public static final String REQUEST_VARIABLE = "var"; //$NON-NLS-1$
- /**
- * The constant used to request a variable value.
- */
- public static final String REQUEST_VALUE = "value"; //$NON-NLS-1$
- /**
- * The constant used to signify step return.
- */
- public static final String REQUEST_STEP_RETURN = "step return"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugRunner.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugRunner.java
deleted file mode 100644
index 1be1ce2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/DebugRunner.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker;
-import org.xml.sax.InputSource;
-
-/**
- * The entry point to the debug process which is responsible for configuring a debugger
- * and then communicating with the Eclipse process via sockets using a common set of commands.
- *
- * <ul>
- * <li>instantiates an implementation of <code>IXSLDebugger</code>
- * <li>configures the debugger with the transformation pipeline
- * <li>starts the debugger in a separate thread
- * <li>the main thread is then used to listen to incoming requests and call the appropriate debugger methods
- * </ul>
- *
- * @author Doug Satchwell
- */
-public class DebugRunner
-{
- private static final Log log = LogFactory.getLog(DebugRunner.class);
-
- private final BufferedReader requestIn;
- private final Writer requestOut;
- private final Writer eventOut;
- private final Writer generatedStream;
- private Socket eventSocket;
- private Socket requestSocket;
- private Socket generateSocket;
-
- /**
- * Create a new instance of this using the supplied readers and writers.
- *
- * @param requestIn the reader for reading incoming requests
- * @param requestOut the writer for acknowledging requests
- * @param eventOut the writer for publishing debug events
- */
- public DebugRunner(BufferedReader requestIn, PrintWriter requestOut, PrintWriter eventOut, PrintWriter generatedStream)
- {
- this.requestOut = requestOut;
- this.requestIn = requestIn;
- this.eventOut = eventOut;
- this.generatedStream = generatedStream;
- }
-
- /**
- * Create a new instance of this given a request port and an event port.
- *
- * @param requestPort the port to listen to requests and send acknowledgements
- * @param eventPort the port for publishing debug events
- * @throws IOException if there was a problem opening a socket
- */
- public DebugRunner(int requestPort, int eventPort, int generatePort) throws IOException
- {
- requestSocket = getSocket(requestPort);
- eventSocket = getSocket(eventPort);
- generateSocket = getSocket(generatePort);
- requestIn = new BufferedReader(new InputStreamReader(requestSocket.getInputStream()));
- requestOut = new PrintWriter(requestSocket.getOutputStream(), true);
- eventOut = new PrintWriter(eventSocket.getOutputStream(), true);
- generatedStream = new BufferedWriter(new PrintWriter(generateSocket.getOutputStream(), true));
- }
-
- /**
- * This method starts the given debugger in its own thread, and blocks while waiting
- * for incoming requests from the request port, until there are no more requests.
- *
- * @param debugger the debugger to start in a thread
- * @throws TransformationException if a problem occurred while transforming
- * @throws IOException
- */
- public void loop(IXSLDebugger debugger) throws TransformationException, IOException
- {
- debugger.setEventWriter(eventOut);
- debugger.setGeneratedWriter(generatedStream);
- String inputLine, response;
- // signal we are ready to receive requests
- eventOut.write("ready\n"); //$NON-NLS-1$
- eventOut.flush();
- log.debug("entering loop"); //$NON-NLS-1$
- try
- {
- while ((inputLine = requestIn.readLine()) != null)
- {
- response = inputLine;
- log.debug("REQUEST:" + inputLine); //$NON-NLS-1$
- Thread debuggerThread = null;
- if (DebugConstants.REQUEST_START.equals(inputLine))
- {
- debuggerThread = new Thread(debugger, "debugger"); //$NON-NLS-1$
- debuggerThread.start();
- }
- /*
- * else if (REQUEST_QUIT.equals(inputLine)) { }
- */
- else if (DebugConstants.REQUEST_STEP_INTO.equals(inputLine))
- {
- debugger.stepInto();
- }
- else if (DebugConstants.REQUEST_STEP_OVER.equals(inputLine))
- {
- debugger.stepOver();
- }
- else if (DebugConstants.REQUEST_STEP_RETURN.equals(inputLine))
- {
- debugger.stepReturn();
- }
- else if (DebugConstants.REQUEST_SUSPEND.equals(inputLine))
- {
- debugger.suspend();
- }
- else if (DebugConstants.REQUEST_RESUME.equals(inputLine))
- {
- debugger.resume();
- }
- else if (DebugConstants.REQUEST_STACK.equals(inputLine))
- {
- response = debugger.stack();
- }
- else if (inputLine.startsWith(DebugConstants.REQUEST_VARIABLE))
- {
- String data = inputLine.substring(DebugConstants.REQUEST_VARIABLE.length() + 1);
- int id = Integer.parseInt(data);
- Variable var = debugger.getVariable(id);
- log.debug("var "+id+" = "+var); //$NON-NLS-1$ //$NON-NLS-2$
- response = var.getScope() + "&" + var.getName(); //$NON-NLS-1$
- }
- else if (inputLine.startsWith(DebugConstants.REQUEST_VALUE))
- {
- String data = inputLine.substring(DebugConstants.REQUEST_VALUE.length() + 1);
- int id = Integer.parseInt(data);
- Variable var = debugger.getVariable(id);
- response = var.getType() + "&" + var.getValueFirstLine(); //$NON-NLS-1$
- }
- else if (inputLine.startsWith(DebugConstants.REQUEST_ADD_BREAKPOINT))
- {
- int index = inputLine.lastIndexOf(' ');
- String file = inputLine.substring(DebugConstants.REQUEST_ADD_BREAKPOINT.length() + 1, index);
- String line = inputLine.substring(index + 1);
- BreakPoint breakpoint = new BreakPoint(file, Integer.parseInt(line));
- debugger.addBreakpoint(breakpoint);
- }
- else if (inputLine.startsWith(DebugConstants.REQUEST_REMOVE_BREAKPOINT))
- {
- int index = inputLine.lastIndexOf(' ');
- String file = inputLine.substring(DebugConstants.REQUEST_REMOVE_BREAKPOINT.length() + 1, index);
- String line = inputLine.substring(index + 1);
- BreakPoint breakpoint = new BreakPoint(file, Integer.parseInt(line));
- debugger.removeBreakpoint(breakpoint);
- }
- else
- {
- response = "What?"; //$NON-NLS-1$
- }
- // confirm request
- log.debug("RESPONSE:" + response); //$NON-NLS-1$
- requestOut.write(response + "\n"); //$NON-NLS-1$
- requestOut.flush();
-
- /*
- * if (REQUEST_QUIT.equals(inputLine)) { waitForFinish(debuggerThread); break; }
- */
- }
- }
- catch (Exception e)
- {
- throw new TransformationException(e.getMessage(), e);
- }
- log.debug("exited loop"); //$NON-NLS-1$
- eventOut.write("terminated\n"); //$NON-NLS-1$
- eventOut.flush();
- }
-
- /**
- * Dispose of this - close all open sockets.
- * @throws IOException
- */
- public void dispose() throws IOException
- {
- if (requestIn != null)
- {
- try
- {
- requestIn.close();
- }
- catch (IOException e)
- {
- log.error("Could not close request input stream", e); //$NON-NLS-1$
- }
- }
- if (requestOut != null)
- {
- requestOut.close();
- }
- if (eventOut != null)
- {
- eventOut.close();
- }
- if (requestSocket != null)
- {
- try
- {
- requestSocket.close();
- }
- catch (IOException e)
- {
- log.error("Could not close request socket", e); //$NON-NLS-1$
- }
- }
- if (eventSocket != null)
- {
- try
- {
- eventSocket.close();
- }
- catch (IOException e)
- {
- log.error("Could not close event socket", e); //$NON-NLS-1$
- }
- }
- }
-
- private static Socket getSocket(int port) throws IOException
- {
- InetAddress localhost = InetAddress.getByName("localhost"); //$NON-NLS-1$
- ServerSocket serverSocket = new ServerSocket(port, 5, localhost);
- Socket clientSocket = serverSocket.accept();
- serverSocket.close();
- return clientSocket;
- }
-
- /**
- * Expected arguments:
- *
- * <ol>
- * <li>the class name of the invoker
- * <li>the file name of the XML launch configuration file
- * <li>the URL of the source document
- * <li>the file of the output document
- * <li>not used (anything)
- * <li>the class name of the <code>IXSLDebugger</code> instance
- * <li>the port used for requests
- * <li>the port used for debug events
- * <li>the port used for generate events
- * </ol>
- *
- * @param args
- */
- public static void main(String[] args)
- {
- log.info("javax.xml.transform.TransformerFactory=" + System.getProperty("javax.xml.transform.TransformerFactory")); //$NON-NLS-1$//$NON-NLS-2$
- log.info("java.endorsed.dirs=" + System.getProperty("java.endorsed.dirs")); //$NON-NLS-1$//$NON-NLS-2$
-
- String invokerClassName = args[0];
- File launchFile = new File(args[1]);
- String src = args[2];
- String target = args[3];
- String debuggerClassName = args[5];
-
- log.info("src: " + src); //$NON-NLS-1$
- log.info("target: " + target); //$NON-NLS-1$
- log.info("launchFile: " + launchFile); //$NON-NLS-1$
- log.info("debugger: " + debuggerClassName); //$NON-NLS-1$
-
- DebugRunner debugRunner = null;
- try
- {
- final IXSLDebugger debugger = createDebugger(debuggerClassName);
- // create the invoker
- IProcessorInvoker invoker = new JAXPSAXProcessorInvoker()
- {
-
- protected TransformerFactory createTransformerFactory()
- {
- TransformerFactory tFactory = super.createTransformerFactory();
- debugger.setTransformerFactory(tFactory);
- return tFactory;
- }
-
- public void addStylesheet(URL stylesheet, Map parameters, Properties outputProperties, URIResolver resolver) throws TransformerConfigurationException
- {
- InputSource inputsource = new InputSource(stylesheet.toString());
- // if required in future, parse the document with line numbers (to get the end line numbers)
-// XMLReaderWrapper reader = new XMLReaderWrapper(createReader());
-// SAXSource source = new SAXSource(reader,inputsource);
- addStylesheet(new SAXSource(inputsource), resolver, parameters, outputProperties);
- }
-
- protected Transformer addStylesheet(Source source, URIResolver resolver, Map parameters, Properties outputProperties) throws TransformerConfigurationException
- {
- Transformer transformer = super.addStylesheet(source, resolver, parameters, outputProperties);
- debugger.addTransformer(transformer);
- return transformer;
- }
- };
-
- if (args.length == 9)
- {
- int requestPort = Integer.parseInt(args[6]);
- int eventPort = Integer.parseInt(args[7]);
- int generatePort = Integer.parseInt(args[8]);
-
- log.debug("requestPort: " + requestPort); //$NON-NLS-1$
- log.debug("eventPort: " + eventPort); //$NON-NLS-1$
- log.debug("generatePort: " + generatePort); //$NON-NLS-1$
-
- try
- {
- debugRunner = new DebugRunner(requestPort, eventPort, generatePort);
- }
- catch (Exception e)
- {
- handleFatalError("Could not instantiate invoker: " + invokerClassName, e); //$NON-NLS-1$
- }
- }
- else
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- debugRunner = new DebugRunner(br, new PrintWriter(System.out), new PrintWriter(System.err), null);
- System.out.println("xsl>"); //$NON-NLS-1$
- }
-
- PipelineDefinition pipeline = new PipelineDefinition(launchFile);
- pipeline.configure(invoker);
-
- debugger.setInvoker(invoker);
- debugger.setSource(new URL(src));
- debugger.setTarget(new FileWriter(new File(target)));
-
- debugRunner.loop(debugger);
- }
- catch (Exception e)
- {
- handleFatalError(e.getMessage(), e);
- }
- finally
- {
- if (debugRunner != null)
- {
- try
- {
- debugRunner.dispose();
- }
- catch (IOException e)
- {
- handleFatalError(e.getMessage(), e);
- }
- }
- }
- }
-
- private static IXSLDebugger createDebugger(String classname) throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- Class clazz = Class.forName(classname);
- return (IXSLDebugger) clazz.newInstance();
- }
-
- private static void handleFatalError(String msg, Throwable t)
- {
- log.fatal(msg, t);
- System.exit(1);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/IXSLDebugger.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/IXSLDebugger.java
deleted file mode 100644
index b4f0b0e..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/IXSLDebugger.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-import java.io.Writer;
-import java.net.URL;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.eclipse.wst.xsl.jaxp.debug.invoker.IProcessorInvoker;
-
-/**
- * An interface to XSL debugger instances.
- *
- * @author Doug Satchwell
- */
-public interface IXSLDebugger extends Runnable
-{
- /**
- * Set the invoker to use.
- *
- * @param invoker the invoker to set
- */
- void setInvoker(IProcessorInvoker invoker);
-
- /**
- * Set the transformer factory to use.
- *
- * @param factory the factory to use
- */
- void setTransformerFactory(TransformerFactory factory);
-
- /**
- * Add a transformer to this.
- *
- * @param transformer
- */
- void addTransformer(Transformer transformer);
-
- /**
- * Set the Writer for this to write events to.
- *
- * @param writer the writer to write events to
- */
- void setEventWriter(Writer writer);
-
- /**
- * Set the ObjectOutputStream for this to write generated events to.
- *
- * @param writer the stream to write generate events to
- */
- void setGeneratedWriter(Writer writer);
-
- /**
- * Set the URL of the transformation source file.
- *
- * @param sourceURL the source URL
- */
- void setSource(URL sourceURL);
-
- /**
- * Set the transformation Result.
- *
- * @param writer the result
- */
- void setTarget(Writer writer);
-
- /**
- * Add a breakpoint to this.
- *
- * @param breakpoint
- */
- void addBreakpoint(BreakPoint breakpoint);
-
- /**
- * Remove a breakpoint from this.
- *
- * @param breakpoint
- */
- void removeBreakpoint(BreakPoint breakpoint);
-
- /**
- * Perform a 'step into' operation.
- */
- void stepInto();
-
- /**
- * Perform a 'step over' operation.
- */
- void stepOver();
-
- /**
- * Perform a 'step return' operation.
- */
- void stepReturn();
-
- /**
- * Perform a 'suspend' operation.
- */
- void suspend();
-
- /**
- * Perform a 'resume' operation.
- */
- void resume();
-
- /**
- * Quit debugging.
- */
- void quit();
-
- /**
- * Generate a string that represents the current call stack of frames and their variables.
- * <p>
- * Frames are generated with the following format: <i>file</i>|<i>frameId</i>|<i>lineNumber</i>|<i>name</i>
- * This is immediately followed with the id's of the frame's variables (each variable id being unique for the whole process).
- * </p>
- * <p>
- * The separator for frames is $$$. Within a frame, the separator for variable id's is |.
- * </p>
- * <p>
- * e.g. file:/tran1.xsl|1|12|xsl:template name="temp1"|1|2|3$$$file:/tran2.xsl|2|34|xsl:template name="temp2"|4|5|6
- *
- * This defines 2 frames with id's 1 and 2, which are occur in files tran1.xsl and tran2.xsl respectively.
- * Frame 1 is currently at line 12, in a template with name temp1, and it defines 3 variables with id's 1, 2 and 3.
- * </p>
- *
- * @return the generated string
- */
- String stack();
-
- /**
- * Get the variable with the given id.
- *
- * @param id the id of the variable
- * @return the variable
- */
- Variable getVariable(int id);
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/StyleFrame.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/StyleFrame.java
deleted file mode 100644
index f77ef9a..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/StyleFrame.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An <code>xsl:template</code> that forms part of the call stack.
- *
- * @author Doug Satchwell
- */
-public abstract class StyleFrame
-{
- private static int nextId;
- private final StyleFrame parent;
- private final List children = new ArrayList();
- private final int id;
-
- /**
- * Create a new instance of this using the given frame as its parent (may be null if this is the root frame).
- *
- * @param parent the parent frame
- */
- public StyleFrame(StyleFrame parent)
- {
- this.id = nextId++;
- this.parent = parent;
- if (parent != null)
- parent.addChild(this);
- }
-
- /**
- * A unique id for this frame
- *
- * @return a unique id for this frame
- */
- public int getId()
- {
- return id;
- }
-
- /**
- * Get the name of this frame.
- *
- * @return the name of this
- */
- public abstract String getName();
-
- /**
- * Get the file in which this frame is found.
- *
- * @return the filename for this
- */
- public abstract String getFilename();
-
- /**
- * Get the line number at which the frame is currently located.
- *
- * @return the line number at which this is held
- */
- public abstract int getCurrentLine();
-
- /**
- * Get a list of <code>Variables</code>'s
- *
- * @return the list of variables for this frame
- */
- public abstract List getVariableStack();
-
- /**
- * Get the parent of this.
- *
- * @return the parent frame
- */
- public StyleFrame getParent()
- {
- return parent;
- }
-
- /**
- * Add a child frame to this.
- *
- * @param child the frame to add
- */
- public void addChild(StyleFrame child)
- {
- children.add(child);
- }
-
- /**
- * Remove a child frame from this.
- *
- * @param child the frame to remove
- */
- public void removeChild(StyleFrame child)
- {
- children.remove(child);
- }
-
- /**
- * Get the children of this
- *
- * @return a list of <code>StyleFrame</code>'s
- */
- public List getChildren()
- {
- return children;
- }
-
- /**
- * Creates a string in the format <i>file</i>|<i>frameId</i>|<i>lineNumber</i>|<i>name</i>.
- * Since pipe is used as a separator, the name has any pipe (|) characters replaced with the literal '%@_PIPE_@%'
- */
- public String toString()
- {
- String safename = getName().replaceAll("\\|", "%@_PIPE_@%"); //$NON-NLS-1$//$NON-NLS-2$
- return getFilename() + "|" + getId() + "|" + getCurrentLine() + "|" + safename; //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/Variable.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/Variable.java
deleted file mode 100644
index ace25eb..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/debugger/Variable.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 214235 - Changed max value size to 2meg.
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.debugger;
-
-/**
- * An abstract class that XSL processor implementations can subclass for their variables.
- *
- * @author Doug Satchwell
- * @author David Carver
- */
-public abstract class Variable
-{
- private static int idSequence = 0;
-
- /**
- * The constant denoting a local scope variable.
- */
- public static final String LOCAL_SCOPE = "L"; //$NON-NLS-1$
- /**
- * The constant denoting a tunnel scope variable.
- */
- public static final String TUNNEL_SCOPE = "T"; //$NON-NLS-1$
- /**
- * The constant denoting a global scope variable.
- */
- public static final String GLOBAL_SCOPE = "G"; //$NON-NLS-1$
-
- protected final static int MAXIMUM_VALUE_SIZE = 2097152;
-
- protected static final String UNRESOLVED = "unresolved"; //$NON-NLS-1$
- protected static final String BOOLEAN = "boolean"; //$NON-NLS-1$
- protected static final String NUMBER = "number"; //$NON-NLS-1$
- protected static final String STRING = "string"; //$NON-NLS-1$
- protected static final String NODESET = "nodeset"; //$NON-NLS-1$
- protected static final String OBJECT = "object"; //$NON-NLS-1$
- protected static final String UNKNOWN = "unknown"; //$NON-NLS-1$
-
- protected final String name;
- protected final String scope;
- protected final int slotNumber;
-
- private int id;
-
- /**
- * Create a new instance of this with the given name, scope and slot number.
- *
- * @param name the name of this
- * @param scope the scope of this
- * @param slotNumber the slot number of this
- */
- public Variable(String name, String scope, int slotNumber)
- {
- this.name = name;
- this.scope = scope;
- this.slotNumber = slotNumber;
- this.id = idSequence++;
- }
-
- /**
- * Get the id used for this.
- *
- * @return the variable id
- */
- public int getId()
- {
- return id;
- }
-
- /**
- * Get the variable name.
- *
- * @return the variable name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Get the type of this variable e.g. string, or node
- *
- * @return the variable type
- */
- public abstract String getType();
-
- /**
- * Get the scope of this variable - one of <code>LOCAL_SCOPE</code>, <code>TUNNEL_SCOPE</code> or <code>GLOBAL_SCOPE</code>.
- *
- * @return the variable scope
- */
- public String getScope()
- {
- return scope;
- }
-
- /**
- * Get the current value of this variable as a String.
- *
- * @return the value of this
- */
- public abstract String getValue();
-
- /**
- * Get the first line of the value truncating to <code>MAXIMUM_VALUE_SIZE</code> where necessary.
- *
- * @return the first line of the value
- */
- public String getValueFirstLine()
- {
- String value = getValue();
- if (value != null)
- {
- // make sure it is not too long
- value = value.replace('\n', '.');
- if (value.length() > MAXIMUM_VALUE_SIZE)
- value = value.substring(0, MAXIMUM_VALUE_SIZE);
- }
- else
- value = ""; //$NON-NLS-1$
- return value;
- }
-
- /**
- * Get the slot number for this.
- *
- * @return the slot number
- */
- public int getSlotNumber()
- {
- return slotNumber;
- }
-
- public int hashCode()
- {
- return 3 * scope.hashCode() + 5 * slotNumber;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- return true;
- if (obj instanceof Variable)
- {
- Variable v = (Variable) obj;
- return v.scope.equals(scope) && slotNumber == v.slotNumber;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/IProcessorInvoker.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/IProcessorInvoker.java
deleted file mode 100644
index 21b657b..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/IProcessorInvoker.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.URIResolver;
-
-
-/**
- * Interface used by the launched process to define the XSL transformation pipeline.
- * The <code>setAttributes</code> and <code>addStylesheet</code> methods should be called
- * before calling <code>transform</code> to do the actual transformation.
- *
- * <p>
- * If <code>addStylesheet</code> is not called before <code>transform</code>, then
- * it is assumed that the source document contains and embedded stylesheet instruction.
- * </p>
- *
- * @author Doug Satchwell
- */
-public interface IProcessorInvoker
-{
- /**
- * Set the processor-specific attributes to use.
- *
- * @param attributes a map of String v. String attributes
- */
- void setAttributes(Map attributes);
-
- /**
- * Add a stylesheet to the pipeline (order is important).
- *
- * @param stylesheet the URL of the stylesheet to add
- * @param parameters the map of parameters for the stylesheet
- * @param outputProperties the output properties
- * @param resolver the <code>URIResolver</code> to use
- * @throws TransformerConfigurationException if stylesheet could not be added
- */
- void addStylesheet(URL stylesheet, Map parameters, Properties outputProperties, URIResolver resolver) throws TransformerConfigurationException;
-
- /**
- * Perform the actual transformation.
- *
- * @param source the URL of the XML source document
- * @param res the transformation result
- * @throws TransformationException if the transformation failed
- */
- void transform(URL source, Result res) throws TransformationException;
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/Messages.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/Messages.java
deleted file mode 100644
index 9e6942a..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/Messages.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Messages for the configuration.
- *
- * @author Doug Satchwell
- */
-class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.debug.invoker.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- /**
- * Get a message for the given key.
- *
- * @param key the message key
- * @return the message
- */
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java
deleted file mode 100644
index 198f999..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/PipelineDefinition.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-import java.io.BufferedInputStream;
-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.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerConfigurationException;
-
-import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.ConfigurationException;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * The definition of the transformation pipeline.
- * <p>
- * This class is loaded on both the Eclipse classpath and the transformation process's classpath.
- * The whole definition is serialized to an XML document by the Eclipse launcher, and is then
- * read by the transformation process when launched.
- * </p>
- *
- * @author Doug Satchwell
- */
-public class PipelineDefinition
-{
- private String sourceURL;
- private String targetFile;
- private final List transformDefs = new ArrayList();
- private final Set attributes = new HashSet();
- private boolean useEmbedded;
-
- /**
- * Create a new empty instance of this.
- */
- public PipelineDefinition()
- {
- }
-
- /**
- * Create a new instance of this by reading the specified XML file.
- *
- * @param launchFile the XSL file to load
- * @throws SAXException if problems occur during parsing
- * @throws IOException if problems occur during parsing
- * @throws ParserConfigurationException if problems occur during parsing
- */
- public PipelineDefinition(File launchFile) throws SAXException, IOException, ParserConfigurationException
- {
- this(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new BufferedInputStream(new FileInputStream(launchFile))));
- }
-
- /**
- * Create a new instance of this from the specified document
- *
- * @param doc the Document to create this from
- */
- public PipelineDefinition(Document doc)
- {
- Element rootEl = doc.getDocumentElement();
-
- Element attributesEl = (Element) rootEl.getElementsByTagName("Attributes").item(0); //$NON-NLS-1$
- NodeList attributeEls = attributesEl.getElementsByTagName("Attribute"); //$NON-NLS-1$
- for (int i = 0; i < attributeEls.getLength(); i++)
- {
- Element attributeEl = (Element) attributeEls.item(i);
- String name = attributeEl.getAttribute("name"); //$NON-NLS-1$
- String type = attributeEl.getAttribute("type"); //$NON-NLS-1$
- String value = attributeEl.getAttribute("value"); //$NON-NLS-1$
- addAttribute(new TypedValue(name, type, value));
- }
-
- Element transformsEl = (Element) rootEl.getElementsByTagName("Transforms").item(0); //$NON-NLS-1$
- String useEmbedded = transformsEl.getAttribute("useEmbedded"); //$NON-NLS-1$
- boolean embedded = Boolean.getBoolean(useEmbedded);
- setUseEmbedded(embedded);
- if (!embedded)
- {
- NodeList transformEls = transformsEl.getElementsByTagName("Transform"); //$NON-NLS-1$
- for (int i = 0; i < transformEls.getLength(); i++)
- {
- Element transformEl = (Element) transformEls.item(i);
- TransformDefinition tdef = TransformDefinition.fromXML(transformEl);
- addTransformDef(tdef);
- }
- }
- }
-
- /**
- * Configure the invoker from this.
- *
- * @param invoker the invoker to configure
- * @throws ConfigurationException if an exception occurs during configuration
- */
- public void configure(IProcessorInvoker invoker) throws ConfigurationException
- {
- Map attVals = new HashMap();
- for (Iterator iter = attributes.iterator(); iter.hasNext();)
- {
- TypedValue att = (TypedValue) iter.next();
- Object value;
- try
- {
- value = att.createValue();
- }
- catch (CreationException e)
- {
- throw new ConfigurationException(e.getMessage(), e);
- }
- attVals.put(att.uri, value);
- }
- invoker.setAttributes(attVals);
-
- for (Iterator iter = transformDefs.iterator(); iter.hasNext();)
- {
- TransformDefinition tdef = (TransformDefinition) iter.next();
- Map params = null;
- try
- {
- params = tdef.getParametersAsMap();
- }
- catch (CreationException e)
- {
- throw new ConfigurationException(Messages.getString("PipelineDefinition.8"), e); //$NON-NLS-1$
- }
- URL url = null;
- try
- {
- url = new URL(tdef.getStylesheetURL());
- }
- catch (MalformedURLException e)
- {
- throw new ConfigurationException(Messages.getString("PipelineDefinition.9") + tdef.getStylesheetURL(), e); //$NON-NLS-1$
- }
- Properties properties = tdef.getOutputProperties();
- try
- {
- invoker.addStylesheet(url, params, properties, null);
- }
- catch (TransformerConfigurationException e)
- {
- throw new ConfigurationException(Messages.getString("PipelineDefinition.10") + tdef.getStylesheetURL(), null); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Get the set of attributes defined.
- *
- * @return the set of attributes
- */
- public Set getAttributes()
- {
- return attributes;
- }
-
- /**
- * Add a attribute to this configuration
- *
- * @param attribute the attribute to add
- */
- public void addAttribute(TypedValue attribute)
- {
- attributes.add(attribute);
- }
-
- /**
- * Remove a attribute from the set of attributes
- *
- * @param attribute the attribute to remove
- */
- public void removeAttribute(TypedValue attribute)
- {
- attributes.remove(attribute);
- }
-
- /**
- * Get the list of <code>TransformDefinition</code>'s.
- *
- * @return the list of transform definitions
- */
- public List getTransformDefs()
- {
- return transformDefs;
- }
-
- /**
- * Add a transform definition to this.
- *
- * @param tdef the transform definition to add
- */
- public void addTransformDef(TransformDefinition tdef)
- {
- transformDefs.add(tdef);
- }
-
- /**
- * Remove a transform definition from this.
- *
- * @param tdef the transform definition to remove
- */
- public void removeTransformDef(TransformDefinition tdef)
- {
- transformDefs.remove(tdef);
- }
-
- /**
- * Set whether to use an XSL declaration embedded in the XML file
- *
- * @param embedded true to use embedded
- */
- public void setUseEmbedded(boolean embedded)
- {
- useEmbedded = embedded;
- }
-
- /**
- * Get whether to use an XSL declaration embedded in the XML file
- *
- * @return true if embedded
- */
- public boolean useEmbedded()
- {
- return useEmbedded;
- }
-
- /**
- * Serialize this to a DOM Document.
- *
- * @return the serialized document
- * @throws ParserConfigurationException if a problem occurs during serialization
- */
- public Document toXML() throws ParserConfigurationException
- {
- Document doc = newDocument();
- Element rootEl = doc.createElement("Pipeline"); //$NON-NLS-1$
- rootEl.setAttribute("source", sourceURL); //$NON-NLS-1$
- rootEl.setAttribute("target", targetFile); //$NON-NLS-1$
- doc.appendChild(rootEl);
-
- Element attributesEl = doc.createElement("Attributes"); //$NON-NLS-1$
- rootEl.appendChild(attributesEl);
- for (Iterator iter = attributes.iterator(); iter.hasNext();)
- {
- TypedValue attribute = (TypedValue) iter.next();
- Element attributeEl = doc.createElement("Attribute"); //$NON-NLS-1$
- attributeEl.setAttribute("name", attribute.uri); //$NON-NLS-1$
- attributeEl.setAttribute("type", attribute.type); //$NON-NLS-1$
- attributeEl.setAttribute("value", attribute.value); //$NON-NLS-1$
- attributesEl.appendChild(attributeEl);
- }
-
- rootEl.setAttribute("useEmbedded", String.valueOf(useEmbedded)); //$NON-NLS-1$
- if (!useEmbedded)
- {
- Element transformsEl = doc.createElement("Transforms"); //$NON-NLS-1$
- rootEl.appendChild(transformsEl);
- for (Iterator iter = transformDefs.iterator(); iter.hasNext();)
- {
- TransformDefinition tdef = (TransformDefinition) iter.next();
- Element tdefEl = tdef.asXML(doc);
- transformsEl.appendChild(tdefEl);
- }
- }
-
- return doc;
- }
-
- private static Document newDocument() throws ParserConfigurationException
- {
- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Document doc = docBuilder.newDocument();
- return doc;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java
deleted file mode 100644
index 8679d90..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformDefinition.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A definition of a particular step in the transformation pipeline.
- *
- * @author Doug Satchwell
- */
-public class TransformDefinition
-{
- private String stylesheetURL;
- private String resolverClass;
- private Properties outputProperties = new Properties();
- private final Set parameters = new HashSet();
-
- /**
- * Get the parameters as a map of name (<code>String</code>) v. value <code>TypedValue</code>.
- *
- * @return a map of names and values
- * @throws CreationException if an exception occurred during object creation
- */
- public Map getParametersAsMap() throws CreationException
- {
- Map m = new HashMap();
- for (Iterator iter = parameters.iterator(); iter.hasNext();)
- {
- TypedValue tv = (TypedValue) iter.next();
- String key = tv.uri;
- Object value = tv.createValue();
- m.put(key, value);
- }
- return m;
- }
-
- /**
- * The set of parameters
- *
- * @return a set of <code>TypedValue</code>'s
- */
- public Set getParameters()
- {
- return parameters;
- }
-
- /**
- * Add a parameter to the set of parameters
- *
- * @param parameter the parameter to add
- */
- public void addParameter(TypedValue parameter)
- {
- parameters.add(parameter);
- }
-
- /**
- * Remove a parameter.
- *
- * @param parameter the parameter to remove
- */
- public void removeParameter(TypedValue parameter)
- {
- parameters.remove(parameter);
- }
-
- /**
- * Get the output properties for this.
- *
- * @return the output properties
- */
- public Properties getOutputProperties()
- {
- return outputProperties;
- }
-
- /**
- * Set the output properties for this.
- *
- * @param outputProperties the output properties to set
- */
- public void setOutputProperties(Properties outputProperties)
- {
- this.outputProperties = outputProperties;
- }
-
- /**
- * Set the value of a specific output property.
- *
- * @param name the output property
- * @param value the value
- */
- public void setOutputProperty(String name, String value)
- {
- outputProperties.put(name, value);
- }
-
- /**
- * Remove an output property.
- *
- * @param name the output property to remove
- */
- public void removeOutputProperty(String name)
- {
- outputProperties.remove(name);
- }
-
- /**
- * Get the name of the <code>URIResolver</code> class to use.
- *
- * @return the resolver's class name
- */
- public String getResolverClass()
- {
- return resolverClass;
- }
-
- /**
- * Set the name of the <code>URIResolver</code> class to use.
- *
- * @param resolver the resolver's class name
- */
- public void setResolverClass(String resolver)
- {
- resolverClass = resolver;
- }
-
- /**
- * Get the URL of the stylesheet.
- *
- * @return the stylesheet URL
- */
- public String getStylesheetURL()
- {
- return stylesheetURL;
- }
-
- /**
- * Set the URL of the stylesheet.
- *
- * @param stylesheet the stylesheet URL
- */
- public void setStylesheetURL(String stylesheet)
- {
- stylesheetURL = stylesheet;
- }
-
- /**
- * Serialize this to a Document fragment.
- *
- * @param doc the document to attach to
- * @return the root element of the fragment
- */
- public Element asXML(Document doc)
- {
- Element tdefEl = doc.createElement("Transform"); //$NON-NLS-1$
- tdefEl.setAttribute(Messages.getString("TransformDefinition.1"), stylesheetURL); //$NON-NLS-1$
- if (resolverClass != null)
- tdefEl.setAttribute("uriResolver", resolverClass); //$NON-NLS-1$
- Element opEl = doc.createElement("OutputProperties"); //$NON-NLS-1$
- tdefEl.appendChild(opEl);
- for (Iterator iter = outputProperties.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- Element propEl = doc.createElement("Property"); //$NON-NLS-1$
- propEl.setAttribute("name", (String) entry.getKey()); //$NON-NLS-1$
- propEl.setAttribute("value", (String) entry.getValue()); //$NON-NLS-1$
- opEl.appendChild(propEl);
- }
- Element paramsEl = doc.createElement("Parameters"); //$NON-NLS-1$
- tdefEl.appendChild(paramsEl);
- for (Iterator iter = parameters.iterator(); iter.hasNext();)
- {
- Element propEl = doc.createElement("Parameter"); //$NON-NLS-1$
- TypedValue param = (TypedValue) iter.next();
- propEl.setAttribute("name", param.uri); //$NON-NLS-1$
- propEl.setAttribute("type", param.type); //$NON-NLS-1$
- propEl.setAttribute("value", param.value); //$NON-NLS-1$
- paramsEl.appendChild(propEl);
- }
- return tdefEl;
- }
-
- /**
- * Create a new instance of this from its serialized form.
- *
- * @param transformEl the element to create this from
- * @return a new instance of this
- */
- public static TransformDefinition fromXML(Element transformEl)
- {
- TransformDefinition tdef = new TransformDefinition();
- String url = transformEl.getAttribute("url"); //$NON-NLS-1$
- tdef.setStylesheetURL(url);
- String uriResolver = transformEl.getAttribute("uriResolver"); //$NON-NLS-1$
- tdef.setResolverClass(uriResolver);
-
- Element opEl = (Element) transformEl.getElementsByTagName("OutputProperties").item(0); //$NON-NLS-1$
- if (opEl != null)
- {
- NodeList propEls = opEl.getElementsByTagName("Property"); //$NON-NLS-1$
- for (int i = 0; i < propEls.getLength(); i++)
- {
- Element propEl = (Element) propEls.item(i);
- String name = propEl.getAttribute("name"); //$NON-NLS-1$
- String value = propEl.getAttribute("value"); //$NON-NLS-1$
- tdef.setOutputProperty(name, value);
- }
- }
-
- Element paramsEl = (Element) transformEl.getElementsByTagName(Messages.getString("TransformDefinition.18")).item(0); //$NON-NLS-1$
- if (paramsEl != null)
- {
- NodeList paramEls = paramsEl.getElementsByTagName(Messages.getString("TransformDefinition.19")); //$NON-NLS-1$
- for (int i = 0; i < paramEls.getLength(); i++)
- {
- Element paramEl = (Element) paramEls.item(i);
- String name = paramEl.getAttribute(Messages.getString("TransformDefinition.20")); //$NON-NLS-1$
- String type = paramEl.getAttribute(Messages.getString("TransformDefinition.21")); //$NON-NLS-1$
- String value = paramEl.getAttribute(Messages.getString("TransformDefinition.22")); //$NON-NLS-1$
- tdef.addParameter(new TypedValue(name, type, value));
- }
- }
-
- return tdef;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformationException.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformationException.java
deleted file mode 100644
index aa0acaf..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TransformationException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-/**
- * Checked Exception for transformation errors.
- *
- * @author Doug Satchwell
- */
-public class TransformationException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Create a new instance of this with the given message.
- *
- * @param message the message
- */
- public TransformationException(String message)
- {
- super(message);
- }
-
- /**
- * Create a new instance of this with the given message and cause.
- *
- * @param message the message
- * @param cause the cause
- */
- public TransformationException(String message, Throwable cause)
- {
- super(message, cause);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java
deleted file mode 100644
index ad51c4d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/TypedValue.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker;
-
-import org.eclipse.wst.xsl.jaxp.debug.invoker.internal.CreationException;
-
-/**
- * A value that is to be instantiated from a particular type e.g. Double, Object.
- *
- * @author Doug Satchwell
- */
-public class TypedValue
-{
- public static final String TYPE_STRING = "string"; //$NON-NLS-1$
- private static final String TYPE_BOOLEAN = "boolean"; //$NON-NLS-1$
- private static final String TYPE_INT = "int"; //$NON-NLS-1$
- private static final String TYPE_DOUBLE = "double"; //$NON-NLS-1$
- private static final String TYPE_FLOAT = "float"; //$NON-NLS-1$
- private static final String TYPE_CLASS = "class"; //$NON-NLS-1$
- private static final String TYPE_OBJECT = "object"; //$NON-NLS-1$
-
- final String uri;
- final String type;
- final String value;
-
- /**
- * Create a new instance of this from the given information.
- *
- * @param uri the URI
- * @param type the type of value
- * @param value the value
- */
- public TypedValue(String uri, String type, String value)
- {
- this.uri = uri;
- this.type = type;
- this.value = value;
- }
-
- /**
- * Create the type of object defined by this.
- *
- * @return the value
- * @throws CreationException if a problem occurred
- */
- public Object createValue() throws CreationException
- {
- Object o = null;
- if (TYPE_STRING.equals(type))
- {
- o = value;
- }
- else if (TYPE_BOOLEAN.equals(type))
- {
- boolean b = "yes".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value); //$NON-NLS-1$ //$NON-NLS-2$
- o = new Boolean(b);
- }
- else if (TYPE_INT.equals(type))
- {
- try
- {
- o = new Integer(value);
- }
- catch (NumberFormatException e)
- {
- throw new CreationException(Messages.getString("TypedValue.9") + value + Messages.getString("TypedValue.10"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if (TYPE_DOUBLE.equals(type))
- {
- try
- {
- o = new Double(value);
- }
- catch (NumberFormatException e)
- {
- throw new CreationException(Messages.getString("TypedValue.11") + value + Messages.getString("TypedValue.12"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if (TYPE_FLOAT.equals(type))
- {
- try
- {
- o = new Float(value);
- }
- catch (NumberFormatException e)
- {
- throw new CreationException(Messages.getString("TypedValue.13") + value + Messages.getString("TypedValue.14"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if (TYPE_CLASS.equals(type))
- {
- try
- {
- o = Class.forName(value);
- }
- catch (ClassNotFoundException e)
- {
- throw new CreationException(Messages.getString("TypedValue.15") + value + Messages.getString("TypedValue.16"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if (TYPE_OBJECT.equals(type))
- {
- try
- {
- Class c = Class.forName(value);
- o = c.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- throw new CreationException(Messages.getString("TypedValue.17") + value + Messages.getString("TypedValue.18"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (InstantiationException e)
- {
- throw new CreationException(Messages.getString("TypedValue.19") + value + Messages.getString("TypedValue.20"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (IllegalAccessException e)
- {
- throw new CreationException(Messages.getString("TypedValue.21") + value + Messages.getString("TypedValue.22"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else
- {
- throw new CreationException(Messages.getString("TypedValue.23") + type + Messages.getString("TypedValue.24")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return o;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/ConfigurationException.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/ConfigurationException.java
deleted file mode 100644
index 7526c73..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/ConfigurationException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker.internal;
-
-/**
- * An exception thrown when configuration of an XSL transform pipeline fails.
- *
- * @author Doug Satchwell
- */
-public class ConfigurationException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Create the exception.
- *
- * @param msg the exception message
- * @param t the underlying cause
- */
- public ConfigurationException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/CreationException.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/CreationException.java
deleted file mode 100644
index bba07bf..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/CreationException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker.internal;
-
-/**
- * Checked Exception for object creation errors.
- *
- * @author Doug Satchwell
- */
-public class CreationException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Create a new instance of this with the given message.
- *
- * @param message the message
- */
- public CreationException(String message)
- {
- super(message);
- }
-
- /**
- * Create a new instance of this with the given message and cause.
- *
- * @param message the message
- * @param cause the cause
- */
- public CreationException(String message, Throwable cause)
- {
- super(message, cause);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/JAXPSAXProcessorInvoker.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/JAXPSAXProcessorInvoker.java
deleted file mode 100644
index 40c424c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/JAXPSAXProcessorInvoker.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker.internal;
-
-import java.net.URL;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-
-/**
- * An implementation of <code>IProcessorInvoker</code> that uses JAXP as the underlying
- * transformation mechanism.
- *
- * @author Doug Satchwell
- */
-public class JAXPSAXProcessorInvoker implements IProcessorInvoker
-{
- private static final Log log = LogFactory.getLog(JAXPSAXProcessorInvoker.class);
-
- private XMLReader reader;
- private SAXTransformerFactory tFactory;
- private TransformerHandler th;
-
- /**
- * Create a new instance of this.
- *
- * @throws SAXException if errors occur while creating an <code>XMLReader</code>
- * @throws ParserConfigurationException if errors occur while creating an <code>XMLReader</code>
- */
- public JAXPSAXProcessorInvoker() throws SAXException, ParserConfigurationException
- {
- reader = createReader();
- }
-
- protected XMLReader createReader() throws SAXException, ParserConfigurationException
- {
- SAXParserFactory spf = SAXParserFactory.newInstance();
- spf.setNamespaceAware(true);
- return spf.newSAXParser().getXMLReader();
- }
-
- public void setAttributes(Map attributes) throws TransformerFactoryConfigurationError
- {
- createTransformerFactory();
- for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String uri = (String) entry.getKey();
- Object value = entry.getValue();
- log.info(Messages.getString("JAXPSAXProcessorInvoker.0") + uri + Messages.getString("JAXPSAXProcessorInvoker.1") + value); //$NON-NLS-1$ //$NON-NLS-2$
- tFactory.setAttribute(uri, value);
- }
- }
-
- protected TransformerFactory createTransformerFactory()
- {
- tFactory = (SAXTransformerFactory) TransformerFactory.newInstance();
- tFactory.setErrorListener(new ErrorListener()
- {
-
- public void error(TransformerException exception) throws TransformerException
- {
- log.error(exception.getMessageAndLocation());
- }
-
- public void fatalError(TransformerException exception) throws TransformerException
- {
- log.error(exception.getMessageAndLocation(), exception);
- throw exception;
- }
-
- public void warning(TransformerException exception) throws TransformerException
- {
- log.warn(exception.getMessageAndLocation());
- }
-
- });
- return tFactory;
- }
-
- public void addStylesheet(URL stylesheet, Map parameters, Properties outputProperties, URIResolver resolver) throws TransformerConfigurationException
- {
- InputSource inputsource = new InputSource(stylesheet.toString());
-
- // TODO parse document with linenumbers
-
- // XMLReader reader = createReader();
- // LineReadingContentHandler ch = new LineReadingContentHandler();
- // reader.setContentHandler(ch);
- SAXSource source = new SAXSource(inputsource);
-
- addStylesheet(source, resolver, parameters, outputProperties);
-
- }
-
- protected Transformer addStylesheet(Source source, URIResolver resolver, Map parameters, Properties outputProperties) throws TransformerConfigurationException
- {
- if (tFactory == null)
- createTransformerFactory();
-
- TransformerHandler newTh = tFactory.newTransformerHandler(source);
- Transformer transformer = newTh.getTransformer();
-
- if (resolver != null)
- transformer.setURIResolver(resolver);
-
- if (parameters != null)
- {
- for (Iterator iter = parameters.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String name = (String) entry.getKey();
- Object value = entry.getValue();
- log.info(Messages.getString("JAXPSAXProcessorInvoker.2") + name + Messages.getString("JAXPSAXProcessorInvoker.3") + value); //$NON-NLS-1$ //$NON-NLS-2$
- transformer.setParameter(name, value);
- }
- }
- if (outputProperties != null)
- {
- StringBuffer sb = new StringBuffer();
- for (Iterator iter = outputProperties.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- sb.append(entry.getKey()).append("=").append(entry.getValue()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (outputProperties.size() > 0)
- {
- log.info(Messages.getString("JAXPSAXProcessorInvoker.6") + sb.toString()); //$NON-NLS-1$
- transformer.setOutputProperties(outputProperties);
- }
- }
-
- if (th != null)
- th.setResult(new SAXResult(newTh));
- else {
- reader.setContentHandler(newTh);
- try {
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", newTh);
- } catch (SAXNotRecognizedException ex) {
- log.warn("Unable to set lexical content handler. Comments and Processing instructions may be skipped");
- } catch (SAXNotSupportedException e) {
- log.warn("Lexical property not supported. Comments and Processing instructions may be skipped");
- }
- }
- th = newTh;
- return th.getTransformer();
- }
-
- public void transform(URL sourceURL, Result res) throws TransformationException
- {
- transform(new InputSource(sourceURL.toExternalForm()), res);
- }
-
- /**
- * Transform using an InputSource rather than a URL
- *
- * @param inputsource the InputSource to use
- * @param res the Result
- * @throws TransformationException if an error occurred during transformation
- */
- public void transform(InputSource inputsource, Result res) throws TransformationException
- {
- try
- {
- if (th == null)
- {// no stylesheets have been added, so try to use embedded...
- SAXSource saxSource = new SAXSource(inputsource);
- Source src = saxSource;
- String media = null, title = null, charset = null;
- while (true)
- {
- src = tFactory.getAssociatedStylesheet(src, media, title, charset);
- if (src != null)
- {
- addStylesheet(saxSource, null, Collections.EMPTY_MAP, new Properties());
- }
- else
- {
- throw new TransformationException(Messages.getString("JAXPSAXProcessorInvoker.7") + inputsource.getSystemId()); //$NON-NLS-1$
- }
- }
- }
- th.setResult(res);
- log.info(Messages.getString("JAXPSAXProcessorInvoker.8")); //$NON-NLS-1$
- reader.parse(inputsource);
- log.info(Messages.getString("JAXPSAXProcessorInvoker.9")); //$NON-NLS-1$
- }
- catch (Exception e)
- {
- throw new TransformationException(e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Main.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Main.java
deleted file mode 100644
index 1ccdce8..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Main.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker.internal;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.net.URL;
-
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition;
-
-/**
- * The class whose <code>main</code> method is called when launching the transformation process from
- * Eclipse.
- *
- * @author Doug Satchwell
- */
-public class Main
-{
- private static final Log log = LogFactory.getLog(Main.class);
-
- /**
- * The <code>main</code> method called when launching the transformation process.
- * There are 4 required arguments:
- * <ol>
- * <li>The class name of the <code>IProcessorInvoker</code> to use
- * <li>The launch file (serialized <code>PipelineDefinition</code>)
- * <li>The URL of the source XML document
- * <li>The file where output will be written
- * </ol>
- *
- * @param args the 4 required arguments
- */
- public static void main(String[] args)
- {
- log.info("javax.xml.transform.TransformerFactory=" + System.getProperty("javax.xml.transform.TransformerFactory")); //$NON-NLS-1$ //$NON-NLS-2$
- log.info("java.endorsed.dirs=" + System.getProperty("java.endorsed.dirs")); //$NON-NLS-1$ //$NON-NLS-2$
-
- String invokerClassName = args[0];
- File launchFile = new File(args[1]);
- String src = args[2];
- String target = args[3];
-
- log.info(Messages.getString("Main.4") + launchFile); //$NON-NLS-1$
-
- // create the invoker
- IProcessorInvoker invoker = null;
- try
- {
- Class clazz = Class.forName(invokerClassName);
- invoker = (IProcessorInvoker) clazz.newInstance();
- }
- catch (Exception e)
- {
- handleFatalError(Messages.getString("Main.5") + invokerClassName, e); //$NON-NLS-1$
- }
- try
- {
- PipelineDefinition pipeline = new PipelineDefinition(launchFile);
- pipeline.configure(invoker);
- invoker.transform(new URL(src), new StreamResult(new FileOutputStream(new File(target))));
- }
- catch (Exception e)
- {
- handleFatalError(e.getMessage(), e);
- }
- }
-
- private static void handleFatalError(String msg, Throwable t)
- {
- log.fatal(msg, t);
- System.exit(1);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Messages.java b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Messages.java
deleted file mode 100644
index 7ee3995..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/Messages.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.debug.invoker.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Messages for the transformation.
- *
- * @author Doug Satchwell
- */
-public class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.debug.invoker.internal.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- /**
- * Get a message for the given key.
- *
- * @param key the message key
- * @return the message
- */
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/messages.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/messages.properties
deleted file mode 100644
index ff8f9a1..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/internal/messages.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-JAXPSAXProcessorInvoker.0=Setting attribute '
-JAXPSAXProcessorInvoker.1=' to value
-JAXPSAXProcessorInvoker.2=Setting parameter '
-JAXPSAXProcessorInvoker.3=' to value
-JAXPSAXProcessorInvoker.6=Setting properties:
-JAXPSAXProcessorInvoker.7=No embedded stylesheet instruction for file:
-JAXPSAXProcessorInvoker.8=Transforming...
-JAXPSAXProcessorInvoker.9=Done.
-Main.4=launchFile:
-Main.5=Could not instantiate invoker:
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/messages.properties b/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/messages.properties
deleted file mode 100644
index fea9b3c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.debug/src/org/eclipse/wst/xsl/jaxp/debug/invoker/messages.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-PipelineDefinition.10=Error with stylesheet:
-PipelineDefinition.8=Could not instantiate parameter
-PipelineDefinition.9=Invalid stylesheet URL:
-TransformDefinition.1=url
-TransformDefinition.18=Parameters
-TransformDefinition.19=Parameter
-TransformDefinition.20=name
-TransformDefinition.21=type
-TransformDefinition.22=value
-TypedValue.10=' to an Integer
-TypedValue.11=Could not convert value '
-TypedValue.12=' to a Double
-TypedValue.13=Could not convert value '
-TypedValue.14=' to a Float
-TypedValue.15=Class '
-TypedValue.16=' could not be located (check the classpath)
-TypedValue.17=Class '
-TypedValue.18=' could not be located (check the classpath)
-TypedValue.19=Object '
-TypedValue.20=' could not be instantiated
-TypedValue.21=Object '
-TypedValue.22=\ could not be instantiated
-TypedValue.23=Attribute type '
-TypedValue.24=' is not recognised
-TypedValue.9=Could not convert value '
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/.classpath b/bundles/org.eclipse.wst.xsl.jaxp.launching/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/.project b/bundles/org.eclipse.wst.xsl.jaxp.launching/.project
deleted file mode 100644
index 8dea7ec..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.jaxp.launching</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.jaxp.launching/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c96ca37..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,25 +0,0 @@
-#Tue Feb 10 05:25:45 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultAttributes.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultAttributes.properties
deleted file mode 100644
index 9c244d2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultAttributes.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-############################################################################### \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultOutputProperties.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultOutputProperties.properties
deleted file mode 100644
index ad23e9d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/JREDefaultOutputProperties.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-###############################################################################
-
-method=method
-method.DESC="xml" | "html" | "text" | qname-but-not-ncname
-
-version=version
-version.DESC=specifies the version of the output method
-
-indent=indent
-indent.DESC=specifies whether the XSLT processor may add additional whitespace when outputting the result tree; the value must be yes or no
-
-encoding=encoding
-encoding.DESC=specifies the preferred character encoding that the XSLT processor should use to encode sequences of characters as sequences of bytes; the value of the attribute should be treated case-insensitively; the value must contain only characters in the range #x21 to #x7E (i.e. printable ASCII characters); the value should either be a charset registered with the Internet Assigned Numbers Authority [IANA], [RFC2278] or start with X-
-
-media-type=media-type
-media-type.DESC=specifies the media type (MIME content type) of the data that results from outputting the result tree; the charset parameter should not be specified explicitly; instead, when the top-level media type is text, a charset parameter should be added according to the character encoding actually used by the output method
-
-doctype-system=doctype-system
-doctype-system.DESC=specifies the system identifier to be used in the document type declaration
-
-doctype-public=doctype-public
-doctype-public.DESC=specifies the public identifier to be used in the document type declaration
-
-omit-xml-declaration=omit-xml-declaration
-omit-xml-declaration.DESC=specifies whether the XSLT processor should output an XML declaration; the value must be yes or no
-
-standalone=standalone
-standalone.DESC=specifies whether the XSLT processor should output a standalone document declaration; the value must be yes or no
-
-cdata-section-elements=cdata-section-elements
-cdata-section-elements.DESC=specifies a list of the names of elements whose text node children should be output using CDATA sections \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.jaxp.launching/META-INF/MANIFEST.MF
deleted file mode 100644
index b9bbf16..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl.jaxp.launching;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.variables;bundle-version="[3.2.100,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xsl.launching;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.xsl.jaxp.debug;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jface;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.osgi.util;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.eclipse.wst.xsl.jaxp.launching,
- org.eclipse.wst.xsl.jaxp.launching.internal;x-internal:=true,
- org.eclipse.wst.xsl.jaxp.launching.internal.registry;x-internal:=true,
- org.eclipse.wst.xsl.jaxp.launching.model
-Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/about.html b/bundles/org.eclipse.wst.xsl.jaxp.launching/about.html
deleted file mode 100644
index ed30003..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>August, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/build.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/build.properties
deleted file mode 100644
index cfc36a5..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- schema/,\
- JREDefaultAttributes.properties,\
- JREDefaultOutputProperties.properties,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/log4j.debug.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/log4j.debug.properties
deleted file mode 100644
index 62dfb61..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/log4j.debug.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-# Set root logger level to DEBUG and its appenders are A1 and A2
-log4j.rootLogger=ERROR, A2
-
-# A2 is set to be a ConsoleAppender
-log4j.appender.A2=org.apache.log4j.ConsoleAppender
-
-# A2 uses PatternLayout.
-log4j.appender.A2.layout=org.apache.log4j.PatternLayout
-log4j.appender.A2.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{1} %x - %m%n
-
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.properties
deleted file mode 100644
index e337d56..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = XSL JAXP Launching (Incubating)
-launchDelegate.name.0 = Java
-processorType.label.1 = JRE Default
-processor.label.1 = JRE Instance Default
-debugger = debugger
-invoke = invoke
-processor = processor
-processorType = processorType \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.xml b/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.xml
deleted file mode 100644
index e52549f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/plugin.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension-point id="debugger" name="%debugger" schema="schema/debugger.exsd"/>
- <extension-point id="invoke" name="%invoke" schema="schema/invoke.exsd"/>
- <extension-point id="processor" name="%processor" schema="schema/processor.exsd"/>
- <extension-point id="processorType" name="%processorType" schema="schema/processorType.exsd"/>
- <extension
- point="org.eclipse.debug.core.launchDelegates">
- <launchDelegate
- delegate="org.eclipse.wst.xsl.jaxp.launching.internal.JAXPJavaLaunchConfigurationDelegate"
- delegateDescription="The XSLT Launcher for JAXP supports running and debugging transformations using JAXP-compliant XSLT processors"
- id="org.eclipse.wst.xsl.launching.internal.jaxp.JAXPLaunchConfigurationDelegate"
- modes="run, debug"
- name="%launchDelegate.name.0"
- type="org.eclipse.wst.xsl.launching.launchConfigurationType">
- </launchDelegate>
- </extension>
-
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.xsl.jaxp.launching.internal.PreferenceInitializer">
- </initializer>
- </extension>
-
- <extension point="org.eclipse.wst.xsl.jaxp.launching.invoke">
- <invoker id="org.eclipse.wst.xsl.launching.jaxp.invoke"
- class="org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker"
- classpath="${eclipse_orbit:org.eclipse.wst.xsl.jaxp.debug};${eclipse_orbit:org.apache.commons.logging};${eclipse_orbit:org.apache.log4j}" />
- </extension>
-
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.processorType">
- <processorType
- attributeProperties="JREDefaultAttributes.properties"
- id="org.eclipse.wst.xsl.launching.processorType.jreDefault"
- label="%processorType.label.1"
- outputProperties="JREDefaultOutputProperties.properties" />
- </extension>
-
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.processor">
- <processor
- classpath=""
- id="org.eclipse.wst.xsl.launching.jre.default"
- label="%processor.label.1"
- processorTypeId="org.eclipse.wst.xsl.launching.processorType.jreDefault"
- supports="1.0"/>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/debugger.exsd b/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/debugger.exsd
deleted file mode 100644
index ef80f04..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/debugger.exsd
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xsl.launching.jaxp" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.xsl.launching.jaxp" id="debugger" name="XSLT Debugger"/>
- </appinfo>
- <documentation>
- Contribute a debugger for a particular JAXP processor type (e.g. Saxon). The extension point primarily defines the classpath and transformer factory to be used when debugging.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="debugger" 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="debugger">
- <annotation>
- <documentation>
- A debugger for a processor type
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- A unique id for this debugger
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A name to be displayed in the UI
- </documentation>
- </annotation>
- </attribute>
- <attribute name="classpath" type="string" use="required">
- <annotation>
- <documentation>
- A &apos;;&apos;-separated classpath required to run the debugger (in addition to that already added by the processor itself).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="processorTypeId" type="string" use="required">
- <annotation>
- <documentation>
- The processor type that this debugger works with
- </documentation>
- </annotation>
- </attribute>
- <attribute name="className" type="string" use="required">
- <annotation>
- <documentation>
- A fully-qualified class that implement the IXSLDebugger interface. It is easier to extend AbstractXSLDebugger.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.xsl.jaxp.debug.debugger.IXSLDebugger"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="transformerFactoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The fully-qualified class name of the transformer factory to use for debugging. This must be one of the transformer factories belonging to the processor type.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="javax.xml.transform.TransformerFactory:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.xsl.jaxp.launching.debugger&quot;&gt;
- &lt;debugger
- className=&quot;org.eclipse.wst.xsl.xalan.debugger.XalanDebugger&quot;
- classpath=&quot;${eclipse_orbit:org.eclipse.wst.xsl.xalan}&quot;
- id=&quot;org.eclipse.wst.xsl.xalan.debugger&quot;
- name=&quot;Xalan 2.5.1 or greater&quot;
- processorTypeId=&quot;org.eclipse.wst.xsl.xalan.processorType&quot;
- transformerFactoryClass=&quot;org.apache.xalan.processor.TransformerFactoryImpl&quot;&gt;
- &lt;/debugger&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2007 Chase Technology Ltd - &lt;a href=&quot;http://www.chasetechnology.co.uk&quot;&gt;http://www.chasetechnology.co.uk&lt;/a&gt;.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/invoke.exsd b/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/invoke.exsd
deleted file mode 100644
index 8f0c1f2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/invoke.exsd
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xsl.launching.jaxp" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.xsl.launching.jaxp" id="invoke" name="XSLT Processor Invoker"/>
- </appinfo>
- <documentation>
- &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element internal="true" />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="invoker"/>
- </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="invoker">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique id for this invoker
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- A class that implements the IProcessorInvoker interface
- </documentation>
- </annotation>
- </attribute>
- <attribute name="classpath" type="string" use="required">
- <annotation>
- <documentation>
- A semi-colon separated list of jars relative to the root of the contributing plugin. One of the jars must contain the Invoker class named in the class attribute.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2007 Chase Technology Ltd - &lt;a href=&quot;http://www.chasetechnology.co.uk&quot;&gt;http://www.chasetechnology.co.uk&lt;/a&gt;.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processor.exsd b/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processor.exsd
deleted file mode 100644
index e59e08c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processor.exsd
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xsl.launching.jaxp" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.xsl.launching.jaxp" id="processor" name="XSLT Processor"/>
- </appinfo>
- <documentation>
- Contribute a Java XSLT processor instance (e.g. Xalan 2.7.0). The extension point primarily defines the classpath to be used when launching an XSLT transformation.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="processor" 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="processor">
- <annotation>
- <appinfo>
- <meta.element labelAttribute="label"/>
- </appinfo>
- <documentation>
- An instance of a JAXP-compliant XSLT processor
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- A unique id for this processor instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A label for this instance to be displayed in the UI
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="processorTypeId" type="string" use="required">
- <annotation>
- <documentation>
- The id for the processor type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="classpath" type="string" use="required">
- <annotation>
- <documentation>
- The classpath to use when this processor is launched
- </documentation>
- </annotation>
- </attribute>
- <attribute name="debuggerId" type="string">
- <annotation>
- <documentation>
- The id of a debugger to associate with the processor
- </documentation>
- </annotation>
- </attribute>
- <attribute name="supports" type="string" use="required">
- <annotation>
- <documentation>
- A comma-separated list of supported XSLT versions e.g. 1.0,2.0
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.xsl.jaxp.launching.processor&quot;&gt;
- &lt;!-- An adopter can specify the ${eclipse_orbit: } variable to indicate which eclipse
- bundle should be added to the class path. --&gt;
- &lt;processor
- classpath=&quot;${eclipse_orbit:org.apache.xalan};${eclipse_orbit:org.apache.xml.serializer};${eclipse_orbit:org.apache.bcel};${eclipse_orbit:java_cup.runtime}&quot;
- id=&quot;org.eclipse.wst.xsl.launching.xalan.processor&quot;
- label=&quot;%processor.label.1&quot;
- processorTypeId=&quot;org.eclipse.wst.xsl.xalan.processorType&quot;
- debuggerId=&quot;org.eclipse.wst.xsl.xalan.debugger&quot;
- supports=&quot;1.0&quot;&gt;
- &lt;/processor&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2007 Chase Technology Ltd - &lt;a href=&quot;http://www.chasetechnology.co.uk&quot;&gt;http://www.chasetechnology.co.uk&lt;/a&gt;.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processorType.exsd b/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processorType.exsd
deleted file mode 100644
index eaada5f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/schema/processorType.exsd
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xsl.launching.jaxp" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.wst.xsl.launching.jaxp" id="processorType" name="XSLT Processor Type"/>
- </appinfo>
- <documentation>
- Contribute a Java XSLT processor type (e.g. Xalan, Saxon). The processor type defines which JAXP attributes and output properies are supported, and also the transformer factory classes it contains.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="processorType" 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="processorType">
- <annotation>
- <appinfo>
- <meta.element labelAttribute="label"/>
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="transformerFactory" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique id for the processor type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- Name for display in the UI
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="outputProperties" type="string">
- <annotation>
- <documentation>
- Location of a properties file containing the list of the processors output properties. Must be a path relative to the root of the bundle.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="attributeProperties" type="string">
- <annotation>
- <documentation>
- Location of a properties file containing the list of the attributes supported by this processor. Must be a path relative to the root of the bundle.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="transformerFactory">
- <annotation>
- <documentation>
- A TransformerFactory for this type
- </documentation>
- </annotation>
- <complexType>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The fully-qualified transformer factory class
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="javax.xml.transform.TransformerFactory:"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A name for this transformer factory to be displayed in the UI
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.xsl.jaxp.launching.processorType&quot;&gt;
- &lt;processorType
- attributeProperties=&quot;XalanAttributes.properties&quot;
- id=&quot;org.eclipse.wst.xsl.xalan.processorType&quot;
- label=&quot;%processorType.label.0&quot;
- outputProperties=&quot;XalanOutputProperties.properties&quot;&gt;
- &lt;transformerFactory
- factoryClass=&quot;org.apache.xalan.processor.TransformerFactoryImpl&quot;
- name=&quot;Interpretive&quot;&gt;
- &lt;/transformerFactory&gt;
- &lt;transformerFactory
- factoryClass=&quot;org.apache.xalan.xsltc.trax.TransformerFactoryImpl&quot;
- name=&quot;Compiling&quot;&gt;
- &lt;/transformerFactory&gt;
- &lt;/processorType&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2007 Chase Technology Ltd - &lt;a href=&quot;http://www.chasetechnology.co.uk&quot;&gt;http://www.chasetechnology.co.uk&lt;/a&gt;.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IAttribute.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IAttribute.java
deleted file mode 100644
index 467914b..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IAttribute.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * A attribute supported by an XSLT processor.
- *
- * @author Doug Satchwell
- */
-public interface IAttribute
-{
- /**
- * Constant for attributes of type <code>string</code>
- * @see #getType()
- */
- String TYPE_STRING = "string"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>boolean</code>
- * @see #getType()
- */
- String TYPE_BOOLEAN = "boolean"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>int</code>
- * @see #getType()
- */
- String TYPE_INT = "int"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>double</code>
- * @see #getType()
- */
- String TYPE_DOUBLE = "double"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>float</code>
- * @see #getType()
- */
- String TYPE_FLOAT = "float"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>class</code>
- * @see #getType()
- */
- String TYPE_CLASS = "class"; //$NON-NLS-1$
-
- /**
- * Constant for attributes of type <code>object</code>
- * @see #getType()
- */
- String TYPE_OBJECT = "object"; //$NON-NLS-1$
-
- /**
- * Get the URI for this attribute
- * @return the attribute URI
- */
- String getURI();
-
- /**
- * Get a description for this attribute
- * @return the attribute description
- */
- String getDescription();
-
- /**
- * Get the type of this attribute. Will match one of the TYPE constants in this interface.
- * @return the attribute type: one of <code>TYPE_STRING</code>, <code>TYPE_BOOLEAN</code>,
- * <code>TYPE_INT</code>, <code>TYPE_DOUBLE</code>, <code>TYPE_FLOAT</code>, <code>TYPE_CLASS</code>,
- * or <code>TYPE_OBJECT</code>
- */
- String getType();
-
- /**
- * Determine whether the given value is a valid one for this attribute.
- * @return an <code>IStatus</code> with severity <code>OK</code> if valid, or <code>ERROR</code> if invalid.
- */
- IStatus validateValue(String value);
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IDebugger.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IDebugger.java
deleted file mode 100644
index 5502f95..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IDebugger.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-/**
- * An XSLT debugger. Typically this will have been
- * contributed via the <code>org.eclipse.wst.xsl.launching.debugger</code> extension point.
- *
- * @author Doug Satchwell
- */
-public interface IDebugger
-{
- /**
- * Get the unique id for this debugger.
- * @return debugger id
- */
- String getId();
-
- /**
- * Get the set of bundle-relative jar files to add to the classpath.
- * @return array of bundle-relative jars
- */
- String[] getClassPath();
-
- /**
- * Get a unique name for this debugger
- * @return the name for the debugger
- */
- String getName();
-
- /**
- * Get the processor type that this debugger is associated with
- * @return the processor type
- */
- IProcessorType getProcessorType();
-
- /**
- * Get the class name for this debugger
- * @return the class name
- */
- String getClassName();
-
- /**
- * Get the transformer factory this debugger is associated with
- * @return the transformer factory
- */
- String getTransformerFactory();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IOutputProperty.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IOutputProperty.java
deleted file mode 100644
index 9bd2c76..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IOutputProperty.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-/**
- * An output property supported by an XSLT processor.
- *
- * @author Doug Satchwell
- */
-public interface IOutputProperty
-{
- /**
- * Get the URI of this output property.
- * @return a unique URI
- */
- String getURI();
-
- /**
- * Get a description for this output property.
- * @return a description
- */
- String getDescription();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInstall.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInstall.java
deleted file mode 100644
index 4cab27b..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInstall.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-/**
- * An instance of an XSLT processor (e.g. Xalan 2.7.0).
- *
- * @see IProcessorInstall
- * @author Doug Satchwell
- */
-public interface IProcessorInstall
-{
- /**
- * Get the unqiue id of this install
- * @return the unique id
- */
- String getId();
-
- /**
- * Get the name of this install
- * @return the name of this install
- */
- String getName();
-
- /**
- * Get the the processor type associated with this install
- * @return the processor type id
- */
- IProcessorType getProcessorType();
-
- /**
- * Get the jar files for this processor
- * @return a set of jar files
- */
- IProcessorJar[] getProcessorJars();
-
- /**
- * Get whether this install has been contributed via the <code>org.eclipse.wst.xsl.launching.processor</code> extension point.
- * @return <code>true</code> if contributed via the extension point, otherwise <code>false</code>.
- */
- boolean isContributed();
-
- /**
- * Get the list of supported XSLT versions
- * @return <code>true</code> if this install has a debugger, otherwise <code>false</code>.
- */
- // TODO deprecate and use boolean supports instaed
- String getSupports();
-
- /**
- * Get whether this install supports the specified xslt version.
- * @return <code>true</code> if this install supports the version, otherwise <code>false</code>.
- */
- boolean supports(String xsltVersion);
-
- /**
- * Get the debugger associated with this install
- * @return the debugger, or null if no debugger has been set
- */
- IDebugger getDebugger();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInvoker.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInvoker.java
deleted file mode 100644
index 540101a..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorInvoker.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-public interface IProcessorInvoker
-{
- String getId();
-
- String getInvokerClassName();
-
- String[] getClasspathEntries();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorJar.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorJar.java
deleted file mode 100644
index 53052bb..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorJar.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * A jar file for an XSLT processor
- *
- * @see IProcessorInstall
- * @author Doug Satchwell
- */
-public interface IProcessorJar
-{
- /**
- * The path may be relative or absolute; in the workspace or external.
- * @return the path to this jar
- */
- IPath getPath();
-
- /**
- * The URL will always be absolute and can be opened.
- * @return a URL to the jar
- */
- URL asURL();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorType.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorType.java
deleted file mode 100644
index d13e700..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/IProcessorType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import java.util.Map;
-
-/**
- * A particular type of XSLT Processor (e.g. Xalan) for which there may be any number of installs.
- *
- * @see IProcessorInstall
- * @author Doug Satchwell
- */
-public interface IProcessorType
-{
- String getId();
-
- String getLabel();
-
- boolean isJREDefault();
-
- ITransformerFactory[] getTransformerFactories();
-
- IAttribute[] getAttributes();
-
- Map<String, String> getAttributeValues();
-
- IOutputProperty[] getOutputProperties();
-
- Map<String, String> getOutputPropertyValues();
-
- ITransformerFactory getDefaultTransformerFactory();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ITransformerFactory.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ITransformerFactory.java
deleted file mode 100644
index 64716ab..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ITransformerFactory.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.launching;
-
-public interface ITransformerFactory
-{
- String getName();
- String getFactoryClass();
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPLaunchConfigurationConstants.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPLaunchConfigurationConstants.java
deleted file mode 100644
index a1cf82d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPLaunchConfigurationConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-
-public class JAXPLaunchConfigurationConstants
-{
- public static final String INVOKER_DESCRIPTOR = JAXPLaunchingPlugin.PLUGIN_ID + ".INVOKER_DESCRIPTOR"; //$NON-NLS-1$
- public static final String ATTR_PROCESSOR = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_PROCESSOR"; //$NON-NLS-1$
- public static final String ATTR_OUTPUT_PROPERTIES = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_OUTPUT_PROPERTIES"; //$NON-NLS-1$
- public static final String ATTR_ATTRIBUTES = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_ATTRIBUTES"; //$NON-NLS-1$
- public static final String ATTR_DEFAULT_DEBUGGING_INSTALL_ID = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_DEFAULT_DEBUGGING_INSTALL_ID"; //$NON-NLS-1$
- public static final String ATTR_USE_DEFAULT_PROCESSOR = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_USE_DEFAULT_PROCESSOR"; //$NON-NLS-1$
- public static final String ATTR_TRANSFORMER_FACTORY = JAXPLaunchingPlugin.PLUGIN_ID + ".ATTR_TRANSFORMER_FACTORY";
-
- public static final String XALAN_TYPE_ID = "org.eclipse.wst.xsl.xalan.processorType"; //$NON-NLS-1$
- public static final String SAXON_TYPE_ID = "org.eclipse.wst.xsl.saxon.processorType"; //$NON-NLS-1$
- public static final String SAXON_1_0_TYPE_ID = "org.eclipse.wst.xsl.saxon_1_0.processorType"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPRuntime.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPRuntime.java
deleted file mode 100644
index 8b9e82b..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/JAXPRuntime.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-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.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.jaxp.launching.internal.FeaturePreferences;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.internal.OutputPropertyPreferences;
-import org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorPreferences;
-import org.eclipse.wst.xsl.jaxp.launching.internal.registry.DebuggerRegistry;
-import org.eclipse.wst.xsl.jaxp.launching.internal.registry.InvokerRegistry;
-import org.eclipse.wst.xsl.jaxp.launching.internal.registry.ProcessorRegistry;
-import org.eclipse.wst.xsl.jaxp.launching.internal.registry.ProcessorTypeRegistry;
-
-public class JAXPRuntime
-{
- public static final String PREF_PROCESSOR_XML = "PREF_PROCESSOR_XML"; //$NON-NLS-1$
- public static final String PREF_FEATURE_XML = "PREF_FEATURE_XML"; //$NON-NLS-1$
- public static final String PREF_OUTPUT_PROPERTIES_XML = "PREF_OUTPUT_PROPERTIES_XML"; //$NON-NLS-1$
- public static final String JRE_DEFAULT_PROCESSOR_ID = "org.eclipse.wst.xsl.launching.jre.default"; //$NON-NLS-1$
- public static final String JRE_DEFAULT_PROCESSOR_TYPE_ID = "org.eclipse.wst.xsl.launching.processorType.jreDefault"; //$NON-NLS-1$
-
- private static byte[] NEXT_ID_LOCK = new byte[0];
- private static byte[] REGISTRY_LOCK = new byte[0];
-
- private static int lastStandinID;
- private static ProcessorTypeRegistry processorTypeRegistry;
- private static ProcessorRegistry processorRegistry;
- private static InvokerRegistry invokerRegistry;
- private static DebuggerRegistry debuggerRegistry;
-
- private static ProcessorTypeRegistry getProcessorTypeRegistry()
- {
- synchronized (REGISTRY_LOCK)
- {
- if (processorTypeRegistry == null)
- processorTypeRegistry = new ProcessorTypeRegistry();
- }
- return processorTypeRegistry;
- }
-
- public static ProcessorRegistry getProcessorRegistry()
- {
- synchronized (REGISTRY_LOCK)
- {
- if (processorRegistry == null)
- processorRegistry = new ProcessorRegistry();
- }
- return processorRegistry;
- }
-
- private static InvokerRegistry getInvokerRegistry()
- {
- synchronized (REGISTRY_LOCK)
- {
- if (invokerRegistry == null)
- invokerRegistry = new InvokerRegistry();
- }
- return invokerRegistry;
- }
-
- private static DebuggerRegistry getDebuggerRegistry()
- {
- synchronized (REGISTRY_LOCK)
- {
- if (debuggerRegistry == null)
- debuggerRegistry = new DebuggerRegistry();
- }
- return debuggerRegistry;
- }
-
- private static void savePreferences()
- {
- JAXPLaunchingPlugin.getDefault().savePluginPreferences();
- synchronized (REGISTRY_LOCK)
- {
- // force the registries to be re-initialised next time it is required
- processorRegistry = null;
- processorTypeRegistry = null;
- }
- }
-
- /**
- * Find a unique processor install id. Check existing 'real' processors, as
- * well as the last id used for a standin.
- */
- public static String createUniqueProcessorId(IProcessorType type)
- {
- IProcessorInstall[] installs = JAXPRuntime.getProcessors(type.getId());
- String id = null;
- synchronized (NEXT_ID_LOCK)
- {
- do
- {
- id = String.valueOf(++lastStandinID);
- }
- while (isTaken(id, installs));
- }
- return id;
- }
-
- public static IProcessorJar createProcessorJar(IPath path)
- {
- return new ProcessorJar(path);
- }
-
- private static boolean isTaken(String id, IProcessorInstall[] installs)
- {
- for (IProcessorInstall install : installs)
- {
- if (install.getId().equals(id))
- return true;
- }
- return false;
- }
-
- public static IDebugger[] getDebuggers()
- {
- return getDebuggerRegistry().getDebuggers();
- }
-
- public static IDebugger getDebugger(String id)
- {
- return getDebuggerRegistry().getDebugger(id);
- }
-
- public static IProcessorInstall[] getProcessors()
- {
- return getProcessorRegistry().getProcessors();
- }
-
- public static IProcessorInstall[] getProcessors(String typeId)
- {
- return getProcessorRegistry().getProcessors(typeId);
- }
-
- public static IProcessorInstall getProcessor(String processorId)
- {
- IProcessorInstall[] processors = getProcessors();
- for (IProcessorInstall install : processors)
- {
- if (install.getId().equals(processorId))
- return install;
- }
- return null;
- }
-
- public static IProcessorInstall getDefaultProcessor()
- {
- return getProcessorRegistry().getDefaultProcessor();
- }
-
- public static IProcessorInstall getJREDefaultProcessor()
- {
- return getProcessorRegistry().getJREDefaultProcessor();
- }
-
- public static IProcessorType[] getProcessorTypes()
- {
- return getProcessorTypeRegistry().getProcessorTypes();
- }
-
- public static IProcessorType[] getProcessorTypesExclJREDefault()
- {
- return getProcessorTypeRegistry().getProcessorTypesExclJREDefault();
- }
-
- public static IProcessorType getProcessorType(String id)
- {
- return getProcessorTypeRegistry().getProcessorType(id);
- }
-
- public static IProcessorInvoker getProcessorInvoker(String invokerId)
- {
- return getInvokerRegistry().getProcessorInvoker(invokerId);
- }
-
- public static IProcessorInvoker[] getProcessorInvokers()
- {
- return getInvokerRegistry().getProcessorInvokers();
- }
-
- private static Preferences getPreferences()
- {
- return JAXPLaunchingPlugin.getDefault().getPluginPreferences();
- }
-
- public static void saveFeaturePreferences(Map<IProcessorType, Map<String, String>> typeFeatures, IProgressMonitor monitor) throws CoreException
- {
- if (monitor.isCanceled())
- return;
- try
- {
- monitor.beginTask(Messages.XSLTRuntime_5, 100);
- FeaturePreferences prefs = new FeaturePreferences();
- Map<String,Map<String,String>> typeIdFeatures = new HashMap<String,Map<String,String>>(typeFeatures.size());
- for (IProcessorType type : typeFeatures.keySet())
- {
- Map<String,String> values = typeFeatures.get(type);
- typeIdFeatures.put(type.getId(), values);
- }
- prefs.setTypeFeatures(typeIdFeatures);
- String xml = prefs.getAsXML();
- monitor.worked(40);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.getPreferences().setValue(JAXPRuntime.PREF_FEATURE_XML, xml);
- monitor.worked(30);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.savePreferences();
- monitor.worked(30);
- }
- catch (Exception e)
- {
- throw new CoreException(new Status(IStatus.ERROR,JAXPLaunchingPlugin.PLUGIN_ID,Messages.XSLTRuntime_6,e));
- }
- finally
- {
- monitor.done();
- }
- }
-
- public static void saveOutputPropertyPreferences(Map<IProcessorType, Map<String,String>> typeProperties, IProgressMonitor monitor) throws CoreException
- {
- if (monitor.isCanceled())
- return;
- try
- {
- monitor.beginTask(Messages.XSLTRuntime_7, 100);
- OutputPropertyPreferences prefs = new OutputPropertyPreferences();
- for (IProcessorType type : typeProperties.keySet())
- {
- prefs.setOutputPropertyValues(type.getId(), typeProperties.get(type));
- }
- String xml = prefs.getAsXML();
- monitor.worked(40);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.getPreferences().setValue(JAXPRuntime.PREF_OUTPUT_PROPERTIES_XML, xml);
- monitor.worked(30);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.savePreferences();
- monitor.worked(30);
- }
- catch (Exception e)
- {
- throw new CoreException(new Status(IStatus.ERROR,JAXPLaunchingPlugin.PLUGIN_ID,Messages.XSLTRuntime_8,e));
- }
- finally
- {
- monitor.done();
- }
- }
-
- public static void saveProcessorPreferences(IProcessorInstall[] installs, IProcessorInstall defaultInstall, IProgressMonitor monitor) throws CoreException
- {
- if (monitor.isCanceled())
- return;
- try
- {
- monitor.beginTask(Messages.XSLTRuntime_9, 100);
- ProcessorPreferences prefs = new ProcessorPreferences();
- if (defaultInstall != null)
- prefs.setDefaultProcessorId(defaultInstall.getId());
- prefs.setProcessors(new ArrayList<IProcessorInstall>(Arrays.asList(installs)));
- String xml = prefs.getAsXML();
- monitor.worked(40);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.getPreferences().setValue(JAXPRuntime.PREF_PROCESSOR_XML, xml);
- monitor.worked(30);
- if (monitor.isCanceled())
- return;
- JAXPRuntime.savePreferences();
- monitor.worked(30);
- }
- catch (Exception e)
- {
- throw new CoreException(new Status(IStatus.ERROR,JAXPLaunchingPlugin.PLUGIN_ID,Messages.XSLTRuntime_10,e));
- }
- finally
- {
- monitor.done();
- }
- }
-
- public static Map<String,String> createDefaultOutputProperties(String typeId)
- {
- Map<String,String> props = new HashMap<String,String>();
- if (JRE_DEFAULT_PROCESSOR_TYPE_ID.equals(typeId))
- props.put("indent", "yes"); //$NON-NLS-1$ //$NON-NLS-2$
- else if (JAXPLaunchConfigurationConstants.XALAN_TYPE_ID.equals(typeId))
- {
- props.put("indent", "yes"); //$NON-NLS-1$ //$NON-NLS-2$
- props.put("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (JAXPLaunchConfigurationConstants.SAXON_TYPE_ID.equals(typeId))
- {
- props.put("indent", "yes"); //$NON-NLS-1$ //$NON-NLS-2$
- props.put("{http://saxon.sf.net/}indent-spaces", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (JAXPLaunchConfigurationConstants.SAXON_1_0_TYPE_ID.equals(typeId))
- {
- props.put("indent", "yes"); //$NON-NLS-1$ //$NON-NLS-2$
- props.put("{http://saxon.sf.net/}indent-spaces", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return props;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchAttributes.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchAttributes.java
deleted file mode 100644
index bfd8691..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchAttributes.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-public class LaunchAttributes
-{
- private final Set<LaunchAttribute> attributes = new HashSet<LaunchAttribute>();
-
- public Set<LaunchAttribute> getAttributes()
- {
- return attributes;
- }
-
- public void addAttribute(LaunchAttribute attribute)
- {
- attributes.add(attribute);
- }
-
- public LaunchAttribute getAttribute(String uri)
- {
- for (Iterator<LaunchAttribute> iter = attributes.iterator(); iter.hasNext();)
- {
- LaunchAttribute tv = iter.next();
- if (tv.uri.equals(uri))
- return tv;
- }
- return null;
- }
-
- public void removeAtribute(String uri)
- {
- for (Iterator<LaunchAttribute> iter = attributes.iterator(); iter.hasNext();)
- {
- LaunchAttribute attribute = iter.next();
- if (attribute.uri.equals(uri))
- iter.remove();
- }
- }
-
- public String toXML() throws ParserConfigurationException, IOException, TransformerException
- {
- Document doc = PreferenceUtil.getDocument();
-
- Element attributesEl = doc.createElement("Attributes"); //$NON-NLS-1$
- doc.appendChild(attributesEl);
-
- for (Iterator<LaunchAttribute> iter = attributes.iterator(); iter.hasNext();)
- {
- LaunchAttribute attribute = iter.next();
- Element attributeEl = doc.createElement("Attribute"); //$NON-NLS-1$
- attributeEl.setAttribute("name", attribute.uri); //$NON-NLS-1$
- attributeEl.setAttribute("type", attribute.type); //$NON-NLS-1$
- attributeEl.setAttribute("value", attribute.value); //$NON-NLS-1$
- attributesEl.appendChild(attributeEl);
- }
-
- return PreferenceUtil.serializeDocument(doc);
- }
-
- public static LaunchAttributes fromXML(InputStream inputStream) throws CoreException
- {
- Document doc = PreferenceUtil.getDocument(inputStream);
-
- LaunchAttributes pdef = new LaunchAttributes();
-
- Element attributesEl = doc.getDocumentElement();
-
- NodeList attributeEls = attributesEl.getElementsByTagName("Attribute"); //$NON-NLS-1$
- for (int i = 0; i < attributeEls.getLength(); i++)
- {
- Element attributeEl = (Element) attributeEls.item(i);
- String name = attributeEl.getAttribute("name"); //$NON-NLS-1$
- String type = attributeEl.getAttribute("type"); //$NON-NLS-1$
- String value = attributeEl.getAttribute("value"); //$NON-NLS-1$
- pdef.addAttribute(new LaunchAttribute(name, type, value));
- }
-
- return pdef;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchProperties.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchProperties.java
deleted file mode 100644
index 469614f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/LaunchProperties.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-public class LaunchProperties
-{
- private final Map<String, String> properties = new HashMap<String, String>();
-
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- public void setProperty(String name, String value)
- {
- properties.put(name, value);
- }
-
- public String getProperty(String name)
- {
- return properties.get(name);
- }
-
- public void removeProperty(String name)
- {
- properties.remove(name);
- }
-
- public String toXML() throws ParserConfigurationException, IOException, TransformerException
- {
- Document doc = PreferenceUtil.getDocument();
-
- Element propertysEl = doc.createElement("Properties"); //$NON-NLS-1$
- doc.appendChild(propertysEl);
-
- for (Map.Entry<String, String> property : properties.entrySet())
- {
- String name = property.getKey();
- String value = property.getValue();
- Element propertyEl = doc.createElement("Property"); //$NON-NLS-1$
- propertyEl.setAttribute("name", name); //$NON-NLS-1$
- propertyEl.setAttribute("value", value); //$NON-NLS-1$
- propertysEl.appendChild(propertyEl);
- }
-
- return PreferenceUtil.serializeDocument(doc);
- }
-
- public static LaunchProperties fromXML(InputStream inputStream) throws CoreException
- {
- Document doc = PreferenceUtil.getDocument(inputStream);
-
- LaunchProperties pdef = new LaunchProperties();
-
- Element propertysEl = doc.getDocumentElement();
-
- NodeList propertyEls = propertysEl.getElementsByTagName("Property"); //$NON-NLS-1$
- for (int i = 0; i < propertyEls.getLength(); i++)
- {
- Element propertyEl = (Element) propertyEls.item(i);
- String name = propertyEl.getAttribute("name"); //$NON-NLS-1$
- String value = propertyEl.getAttribute("value"); //$NON-NLS-1$
- pdef.setProperty(name, value);
- }
-
- return pdef;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/Messages.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/Messages.java
deleted file mode 100644
index 912627e..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/Messages.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.launching;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.jaxp.launching.messages"; //$NON-NLS-1$
-
- public static String XSLTRuntime_10;
- public static String XSLTRuntime_5;
- public static String XSLTRuntime_6;
- public static String XSLTRuntime_7;
- public static String XSLTRuntime_8;
- public static String XSLTRuntime_9;
-
- public static String Attribute_0;
- public static String Attribute_1;
- public static String Attribute_2;
- public static String Attribute_5;
- public static String PluginProcessorJar_0;
- public static String ProcessorType_2;
- public static String ProcessorType_3;
- public static String ProcessorType_4;
- public static String ProcessorType_5;
- public static String Utils_0;
- public static String Utils_1;
- public static String XSLTLaunchConfigurationDelegate_0;
- public static String XSLTLaunchConfigurationDelegate_1;
- public static String XSLTLaunchConfigurationDelegate_2;
- public static String XSLTLaunchConfigurationDelegate_23;
- public static String XSLTLaunchConfigurationDelegate_3;
- public static String XSLTLaunchConfigurationDelegate_31;
- public static String XSLTLaunchConfigurationDelegate_4;
- public static String XSLTLaunchConfigurationDelegate_5;
- public static String XSLTLaunchConfigurationDelegate_6;
- public static String XSLTLaunchConfigurationDelegate_7;
-
- public static String AbstractRegistryReader_3;
- public static String AbstractRegistryReader_5;
- public static String AbstractRegistryReader_6;
- public static String AbstractRegistryReader_7;
- public static String AbstractRegistryReader_8;
- public static String AbstractRegistryReader_9;
- public static String LaunchHelper_0;
- public static String LaunchHelper_1;
-
- public static String XSLDebugTarget_0;
- public static String XSLDebugTarget_1;
- public static String XSLDebugTarget_19;
- public static String XSLDebugTarget_2;
- public static String XSLDebugTarget_20;
- public static String XSLDebugTarget_3;
- public static String XSLDebugTarget_4;
-
- private Messages() {
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ProcessorInstall.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ProcessorInstall.java
deleted file mode 100644
index 6ee8717..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/ProcessorInstall.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.internal.PluginProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.internal.Utils;
-
-public class ProcessorInstall implements IProcessorInstall
-{
- private final String id;
- private String name;
- private String type;
- private IProcessorJar[] jars;
- private final boolean contributed;
- private String debuggerId;
- private String supports;
-
- public ProcessorInstall(String id, String label, String typeId, IProcessorJar[] jars, String debuggerId, String supports, boolean contributed)
- {
- this.id = id;
- name = label;
- type = typeId;
- this.debuggerId = debuggerId;
- this.contributed = contributed;
- this.jars = jars;
- this.supports = supports;
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public IProcessorJar[] getProcessorJars()
- {
- return jars;
- }
-
- public void setProcessorJars(IProcessorJar[] jars)
- {
- this.jars = jars;
- }
-
- public String getProcessorTypeId()
- {
- return type;
- }
-
- public IProcessorType getProcessorType()
- {
- return JAXPRuntime.getProcessorType(type);
- }
-
- public void setProcessorTypeId(String id)
- {
- type = id;
- }
-
- public boolean isContributed()
- {
- return contributed;
- }
-
- public static IProcessorJar[] createJars(String bundleId, String classpath)
- {
- IProcessorJar[] jars;
- if (classpath == null)
- return new IProcessorJar[0];
- String[] jarstring = classpath.split(";"); //$NON-NLS-1$
- jars = new IProcessorJar[jarstring.length];
- for (int i = 0; i < jarstring.length; i++)
- {
- String jar = jarstring[i];
- try
- {
- if (jar.startsWith("${eclipse_orbit:") && jar.endsWith("}")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- jar = jar.substring("${eclipse_orbit:".length()); //$NON-NLS-1$
- jar = jar.substring(0,jar.length()-1);
- //jar = Utils.getFileLocation(jar,"");
- jars[i] = new PluginProcessorJar(jar, null);
- }
- else
- {
- jar = Utils.getFileLocation(bundleId,jar);
- jars[i] = new PluginProcessorJar(bundleId, new Path(jar));
- }
- }
- catch (CoreException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- return jars;
- }
-
- public boolean hasDebugger()
- {
- return debuggerId != null;
- }
-
- public boolean supports(String xsltVersion)
- {
- return supports.indexOf(xsltVersion) >= 0;
- }
-
- public String getSupports()
- {
- return supports;
- }
-
- public void setSupports(String supports)
- {
- this.supports = supports;
- }
-
- public IDebugger getDebugger()
- {
- return JAXPRuntime.getDebugger(debuggerId);
- }
-
- public void setDebuggerId(String debuggerId)
- {
- this.debuggerId = debuggerId;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Attribute.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Attribute.java
deleted file mode 100644
index ce1c8af..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Attribute.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.jaxp.launching.IAttribute;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-
-public class Attribute implements IAttribute, Comparable<Object>
-{
- private final String uri;
- private final String description;
- private final String type;
-
- public Attribute(String uri, String type, String description)
- {
- this.uri = uri;
- this.type = type;
- this.description = description;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public String getType()
- {
- return type;
- }
-
- public String getURI()
- {
- return uri;
- }
-
- public IStatus validateValue(String value)
- {
- IStatus status = null;
- if (TYPE_BOOLEAN.equals(type))
- {
- boolean valid = "true".equals(value) || "false".equals(value); //$NON-NLS-1$ //$NON-NLS-2$
- if (!valid)
- status = new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, 0, Messages.Attribute_2, null);
- }
- else if (TYPE_INT.equals(type))
- {
- try
- {
- Integer.parseInt(value);
- }
- catch (NumberFormatException e)
- {
- status = new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, 0, Messages.Attribute_1, null);
- }
- }
- else if (TYPE_DOUBLE.equals(type))
- {
- try
- {
- Double.parseDouble(value);
- }
- catch (NumberFormatException e)
- {
- status = new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, 0, Messages.Attribute_0, null);
- }
- }
- else if (TYPE_FLOAT.equals(type))
- {
- try
- {
- Float.parseFloat(value);
- }
- catch (NumberFormatException e)
- {
- status = new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, 0, Messages.Attribute_5, null);
- }
- }
- else if (TYPE_CLASS.equals(type) || TYPE_OBJECT.equals(type))
- {
- //status = JavaConventions.validateJavaTypeName(value);
- }
- return status;
- }
-
- public int compareTo(Object o)
- {
- if (o instanceof IAttribute)
- {
- IAttribute f = (IAttribute) o;
- return f.getURI().compareTo(getURI());
- }
- return 0;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/DebuggerDescriptor.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/DebuggerDescriptor.java
deleted file mode 100644
index 421dc71..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/DebuggerDescriptor.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import org.eclipse.wst.xsl.jaxp.launching.IDebugger;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-public class DebuggerDescriptor implements IDebugger
-{
- private final String[] classpath;
- private final String id;
- private final String bundleId;
- private final String name;
- private final String processorTypeId;
- private final String className;
- private final String transformerFactory;
-
- public DebuggerDescriptor(String id, String bundleId, String className, String[] classpath, String name, String processorTypeId, String transformerFactory)
- {
- this.id = id;
- this.classpath = classpath;
- this.bundleId = bundleId;
- this.name = name;
- this.processorTypeId = processorTypeId;
- this.className = className;
- this.transformerFactory = transformerFactory;
- }
-
- public String getClassName()
- {
- return className;
- }
-
- public String[] getClassPath()
- {
- return ProcessorInvokerDescriptor.createEntries(bundleId, classpath);
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public IProcessorType getProcessorType()
- {
- return JAXPRuntime.getProcessorType(processorTypeId);
- }
-
- public String getTransformerFactory()
- {
- return transformerFactory;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/FeaturePreferences.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/FeaturePreferences.java
deleted file mode 100644
index 52dc5f9..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/FeaturePreferences.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class FeaturePreferences
-{
- private Map<String, Map<String, String>> typeFeatures;
-
- public Map<String, String> getFeaturesValues(String typeId)
- {
- return typeFeatures.get(typeId);
- }
-
- public void setTypeFeatures(Map<String, Map<String, String>> typeFeatures)
- {
- this.typeFeatures = typeFeatures;
- }
-
- public String getAsXML() throws ParserConfigurationException, IOException, TransformerException
- {
- Document doc = PreferenceUtil.getDocument();
- Element config = doc.createElement("featurePreferences"); //$NON-NLS-1$
- doc.appendChild(config);
-
- for (String typeId : typeFeatures.keySet())
- {
- Element processorTypeElement = typeAsElement(doc, typeId);
- Map<String, String> featureValues = typeFeatures.get(typeId);
- featureValuesAsElement(doc, processorTypeElement, featureValues);
- config.appendChild(processorTypeElement);
- }
-
- // Serialize the Document and return the resulting String
- return PreferenceUtil.serializeDocument(doc);
- }
-
- public static FeaturePreferences fromXML(InputStream inputStream) throws CoreException
- {
- FeaturePreferences prefs = new FeaturePreferences();
-
- // Do the parsing and obtain the top-level node
- Document doc = PreferenceUtil.getDocument(inputStream);
- Element config = doc.getDocumentElement();
-
- Map<String, Map<String, String>> typeFeatures = new HashMap<String, Map<String, String>>();
- Element[] processorTypeEls = PreferenceUtil.getChildElements(config, "processorType"); //$NON-NLS-1$
- for (int i = 0; i < processorTypeEls.length; ++i)
- {
- Element processorTypeEl = processorTypeEls[i];
- String type = elementAsType(processorTypeEl);
- Map<String, String> featureValues = elementAsFeatureValues(processorTypeEl);
- typeFeatures.put(type, featureValues);
- }
-
- prefs.setTypeFeatures(typeFeatures);
-
- return prefs;
- }
-
- private static String elementAsType(Element parent)
- {
- String id = parent.getAttribute("id"); //$NON-NLS-1$
- return id;
- }
-
- private static Element typeAsElement(Document doc, String type)
- {
- Element element = doc.createElement("processorType"); //$NON-NLS-1$
- element.setAttribute("id", type); //$NON-NLS-1$
- return element;
- }
-
- private static Map<String, String> elementAsFeatureValues(Element element)
- {
- Element[] featureEls = PreferenceUtil.getChildElements(element, "feature"); //$NON-NLS-1$
- Map<String, String> featureValues = new HashMap<String, String>(featureEls.length);
- for (Element featureEl : featureEls)
- {
- String uri = featureEl.getAttribute("uri"); //$NON-NLS-1$
- String value = featureEl.getAttribute("value"); //$NON-NLS-1$
- featureValues.put(uri, value);
- }
- return featureValues;
- }
-
- private static void featureValuesAsElement(Document doc, Element featuresEl, Map<String, String> featureValues)
- {
- if (featureValues != null)
- {
- for (Map.Entry<String,String> entry2 : featureValues.entrySet())
- {
- String uri = entry2.getKey();
- String value = entry2.getValue();
- Element element = doc.createElement("feature"); //$NON-NLS-1$
- element.setAttribute("uri", uri); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
- featuresEl.appendChild(element);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPJavaLaunchConfigurationDelegate.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPJavaLaunchConfigurationDelegate.java
deleted file mode 100644
index c655f27..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPJavaLaunchConfigurationDelegate.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-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.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.jdt.launching.IVMRunner;
-import org.eclipse.jdt.launching.JavaLaunchDelegate;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsl.jaxp.launching.IDebugger;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-import org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget;
-import org.eclipse.wst.xsl.launching.model.IXSLConstants;
-
-public class JAXPJavaLaunchConfigurationDelegate extends JavaLaunchDelegate implements IDebugEventSetListener
-{
- private String mode;
- LaunchHelper launchHelper;
-
- @Override
- public synchronized void launch(ILaunchConfiguration configuration, final String mode, final ILaunch launch, IProgressMonitor monitor) throws CoreException
- {
- this.mode = mode;
- launchHelper.save(getLaunchConfigFile());
-
- // set the launch name
- IProcessorInstall install = getProcessorInstall(configuration, mode);
- String tfactory = getTransformerFactory(install);
- String name = install.getName();
- if (tfactory != null)
- name += "[" + tfactory + "]";
- launch.setAttribute("launchName", name);
-
- // the super.launch will add a Java source director if we set it to null here
- final ISourceLocator configuredLocator = launch.getSourceLocator();
- launch.setSourceLocator(null);
-
- super.launch(configuration, mode, launch, monitor);
-
- // now get the java source locator
- final ISourceLocator javaSourceLookupDirector = launch.getSourceLocator();
- // now add our own participant to the java director
- launch.setSourceLocator(new ISourceLocator(){
-
- public Object getSourceElement(IStackFrame stackFrame)
- {
- // simply look at one and then the other
- Object sourceElement = javaSourceLookupDirector.getSourceElement(stackFrame);
- if (sourceElement == null)
- sourceElement = configuredLocator.getSourceElement(stackFrame);
- return sourceElement;
- }});
-
-// IJavaDebugTarget javaTarget = (IJavaDebugTarget)launch.getDebugTarget();
-// launch.removeDebugTarget(javaTarget);
-
- IDebugTarget javaTarget = launch.getDebugTarget();
- IDebugTarget xslTarget = new JAXPDebugTarget(launch, launch.getProcesses()[0], launchHelper);
-
- // remove java as the primary target and make xsl the primary target
- launch.removeDebugTarget(javaTarget);
- launch.addDebugTarget(xslTarget);
- // add this here to make java the non-primary target
- // launch.addDebugTarget(javaTarget);
-
- // launch.addDebugTarget(new JavaXSLDebugTarget(launch, launch.getProcesses()[0], launchHelper, javaTarget));
-
-
- }
-
- /**
- * Get the Java breakpoint and the XSL breakpoints
- */
- @Override
- protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration)
- {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- if (!breakpointManager.isEnabled())
- return null;
-
- IBreakpoint[] javaBreakpoints = super.getBreakpoints(configuration);
- IBreakpoint[] xslBreakpoints = breakpointManager.getBreakpoints(IXSLConstants.ID_XSL_DEBUG_MODEL);
- IBreakpoint[] breakpoints = new IBreakpoint[javaBreakpoints.length+xslBreakpoints.length];
- System.arraycopy(javaBreakpoints, 0, breakpoints, 0, javaBreakpoints.length);
- System.arraycopy(xslBreakpoints, 0, breakpoints, javaBreakpoints.length, xslBreakpoints.length);
-
- return breakpoints;
- }
-
- @Override
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
- {
- this.launchHelper = new LaunchHelper(configuration);
- if (mode.equals(ILaunchManager.DEBUG_MODE))
- {
- // TODO don't like having UI code in the launching plugin...where else can it go?
- final IProcessorInstall install = getProcessorInstall(configuration, ILaunchManager.RUN_MODE);
- if (install.getDebugger() == null)
- {
- final boolean[] result = new boolean[]
- { false };
- // open a dialog for choosing a different install that does have
- // an associated debugger
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
- {
- public void run()
- {
- String debuggingInstallId = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPLaunchConfigurationConstants.ATTR_DEFAULT_DEBUGGING_INSTALL_ID);
- IProcessorInstall processor = JAXPRuntime.getProcessor(debuggingInstallId);
-
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-
- String title = Messages.XSLTLaunchConfigurationDelegate_0;
- String message = Messages.XSLTLaunchConfigurationDelegate_1 + install.getName() + Messages.XSLTLaunchConfigurationDelegate_2
- + Messages.XSLTLaunchConfigurationDelegate_3 + processor.getName() + Messages.XSLTLaunchConfigurationDelegate_4;
-
- MessageDialog dialog = new MessageDialog(dw.getShell(), title, null, message, MessageDialog.QUESTION,
- new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); // yes is the default
-
- result[0] = dialog.open() == 0;
- }
- });
- return result[0];
- }
- else
- {
- String debuggerTF = install.getDebugger().getTransformerFactory();
- String installTF = launchHelper.getTransformerFactory() == null ? null : launchHelper.getTransformerFactory().getFactoryClass();
- if (!debuggerTF.equals(installTF))
- {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
- {
- public void run()
- {
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-
- String title = "Change Transformer Factory";
- String message = install.getName() + " must use the " + launchHelper.getTransformerFactory().getName() + " transformer factory when debugging.\n"
- + "Be aware that this may give different results to the " + launchHelper.getTransformerFactory().getName() + " transformer factory configured for this launch configuration.";
-
- MessageDialog dialog = new MessageDialog(dw.getShell(), title, null, message, MessageDialog.WARNING,
- new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); // yes is the default
- dialog.open();
- }
- });
- }
- }
- }
- return super.preLaunchCheck(configuration, mode, monitor);
- }
-
- @Override
- public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode) throws CoreException
- {
- // comment this out in order to get java debugging as well as XSL debugging
-// if (ILaunchManager.DEBUG_MODE.equals(mode))
-// return super.getVMRunner(configuration, ILaunchManager.RUN_MODE);
- return super.getVMRunner(configuration, mode);
- }
-
- private File getLaunchConfigFile()
- {
- IPath launchPath = Platform.getStateLocation(JAXPLaunchingPlugin.getDefault().getBundle()).append("launch"); //$NON-NLS-1$
- File launchDir = launchPath.toFile();
- if (!launchDir.exists())
- launchDir.mkdir();
- File file = new File(launchDir, "launch.xml"); //$NON-NLS-1$
- return file;
- }
-
- @Override
- public IPath getWorkingDirectoryPath(ILaunchConfiguration configuration) throws CoreException
- {
- // TODO changes are afoot so that working directory can be gotten from the Common launch tab
-
-// String path = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR_WORKING_DIR, (String) null);
-// if (path != null)
-// {
-// path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(path);
-// return new Path(path);
-// }
- return null;
- }
-
- private IProcessorInvoker getProcessorInvokerDescriptor(ILaunchConfiguration configuration) throws CoreException
- {
- String invokerId = configuration.getAttribute(JAXPLaunchConfigurationConstants.INVOKER_DESCRIPTOR, "org.eclipse.wst.xsl.launching.jaxp.invoke");
- return JAXPRuntime.getProcessorInvoker(invokerId);
- }
-
- public static IProcessorInstall getProcessorInstall(ILaunchConfiguration configuration, String mode) throws CoreException
- {
- IProcessorInstall install = LaunchHelper.getProcessorInstall(configuration);
- if (mode.equals(ILaunchManager.DEBUG_MODE) && install.getDebugger() == null)
- {
- String debuggingInstallId = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPLaunchConfigurationConstants.ATTR_DEFAULT_DEBUGGING_INSTALL_ID);
- install = JAXPRuntime.getProcessor(debuggingInstallId);
- }
- return install;
- }
-
- @Override
- public String getMainTypeName(ILaunchConfiguration configuration) throws CoreException
- {
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return "org.eclipse.wst.xsl.jaxp.debug.debugger.DebugRunner"; //$NON-NLS-1$
- return "org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main"; //$NON-NLS-1$
- }
-
- @Override
- public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException
- {
- // classname, sourceurl, output file
- IProcessorInvoker invoker = getProcessorInvokerDescriptor(configuration);
- String clazz = invoker.getInvokerClassName();
-
- StringBuffer sb = new StringBuffer();
- sb.append(clazz);
- sb.append(" "); //$NON-NLS-1$
- sb.append("\"" + getLaunchConfigFile().getAbsolutePath() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append(" "); //$NON-NLS-1$
- sb.append("\"" + launchHelper.getSource() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append(" "); //$NON-NLS-1$
- sb.append("\"" + launchHelper.getTarget().getAbsolutePath() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- {
- IProcessorInstall install = getProcessorInstall(configuration, mode);
- if (install.getDebugger() != null)
- {
- IDebugger debugger = install.getDebugger();
- String className = debugger.getClassName();
- sb.append(" -debug ").append(className).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append(launchHelper.getRequestPort());
- sb.append(" ").append(launchHelper.getEventPort()); //$NON-NLS-1$
- sb.append(" ").append(launchHelper.getGeneratePort()); //$NON-NLS-1$
- }
- }
-
- return sb.toString();
- }
-
- @Override
- public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException
- {
- // get the classpath defined by the user
- String[] userClasspath = super.getClasspath(configuration);
-
- // get the classpath required for the transformation
- IProcessorInvoker invoker = getProcessorInvokerDescriptor(configuration);
- List<String> invokerCP = new ArrayList<String>();
- for (String entry : invoker.getClasspathEntries())
- {
- invokerCP.add(entry);
- }
-
- // add the debugger...
- IProcessorInstall install = getProcessorInstall(configuration, mode);
- if (ILaunchManager.DEBUG_MODE.equals(mode) && install.getDebugger() != null)
- {
- String[] jars = install.getDebugger().getClassPath();
- for (String jar : jars)
- {
- invokerCP.add(jar);
- }
- }
-
- String[] invokerClasspath = invokerCP.toArray(new String[0]);
-
- // add them together
- String[] classpath = new String[userClasspath.length + invokerClasspath.length];
- System.arraycopy(invokerClasspath, 0, classpath, 0, invokerClasspath.length);
- System.arraycopy(userClasspath, 0, classpath, invokerClasspath.length, userClasspath.length);
-
- return classpath;
- }
-
- @Override
- public String getVMArguments(ILaunchConfiguration configuration) throws CoreException
- {
- String vmargs = super.getVMArguments(configuration);
-
- IProcessorInstall install = getProcessorInstall(configuration, mode);
- if (install != null && !install.getProcessorType().isJREDefault())
- {
- // clear the endorsed dir
- File tempDir = getEndorsedDir();
- if (tempDir.exists())
- {
- File[] children = tempDir.listFiles();
- for (File child : children)
- {
- child.delete();
- }
- tempDir.delete();
- }
- tempDir.mkdir();
-
- // move the required jars to the endorsed dir
- IProcessorJar[] jars = install.getProcessorJars();
- for (int i = 0; i < jars.length; i++)
- {
- URL entry = jars[i].asURL();
- if (entry == null)
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XSLTLaunchConfigurationDelegate_23 + jars[i], null));
- File file = new File(tempDir, "END_" + i + ".jar"); //$NON-NLS-1$ //$NON-NLS-2$
- moveFile(entry, file);
- }
- // add the endorsed dir
- vmargs += " -Djava.endorsed.dirs=\"" + tempDir.getAbsolutePath() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
- String tfactory = getTransformerFactory(install);
- if (tfactory != null)
- vmargs += " -Djavax.xml.transform.TransformerFactory=" + tfactory; //$NON-NLS-1$
-
-// if (ILaunchManager.DEBUG_MODE.equals(mode))
-// {
-// // in debug mode, set the logging to ERROR. This prevents the console from popping up on top of the result view!
-// try
-// {
-// URL url = FileLocator.resolve(FileLocator.find(Platform.getBundle(JAXPLaunchingPlugin.PLUGIN_ID), new Path("/log4j.debug.properties"), null));
-// vmargs += " -Dlog4j.configuration=\""+url.toExternalForm()+"\""; //$NON-NLS-1$
-// }
-// catch (IOException e)
-// {
-// JAXPLaunchingPlugin.log(e);
-// }
-// }
- }
- return vmargs;
- }
-
- private String getTransformerFactory(IProcessorInstall install)
- {
- String tfactory = null;
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- tfactory = install.getDebugger().getTransformerFactory();
- else
- {
- ITransformerFactory t = launchHelper.getTransformerFactory();
- if (t != null)
- tfactory = t.getFactoryClass();
- }
- return tfactory;
- }
-
- private File getEndorsedDir()
- {
- IPath tempLocation = Platform.getStateLocation(JAXPLaunchingPlugin.getDefault().getBundle()).append("endorsed"); //$NON-NLS-1$
- return tempLocation.toFile();
- }
-
- private static void moveFile(URL src, File target) throws CoreException
- {
- BufferedOutputStream bos = null;
- BufferedInputStream bis = null;
- try
- {
- bos = new BufferedOutputStream(new FileOutputStream(target));
- bis = new BufferedInputStream(src.openStream());
- while (bis.available() > 0)
- {
- int size = bis.available();
- if (size > 1024)
- size = 1024;
- byte[] b = new byte[size];
- bis.read(b, 0, b.length);
- bos.write(b);
- }
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XSLTLaunchConfigurationDelegate_7 + src + Messages.XSLTLaunchConfigurationDelegate_31 + target, e));
- }
- finally
- {
- if (bis != null)
- {
- try
- {
- bis.close();
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- if (bos != null)
- {
- try
- {
- bos.close();
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPLaunchingPlugin.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPLaunchingPlugin.java
deleted file mode 100644
index 6eaac30..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/JAXPLaunchingPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JAXPLaunchingPlugin extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.xsl.jaxp.launching";
-
- // The shared instance
- private static JAXPLaunchingPlugin plugin;
-
- /**
- * The constructor
- */
- public JAXPLaunchingPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static JAXPLaunchingPlugin getDefault() {
- return plugin;
- }
-
- public static void log(Exception e)
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, "", e)); //$NON-NLS-1$
- }
-
- public static void log(CoreException e)
- {
- getDefault().getLog().log(e.getStatus());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/LaunchHelper.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/LaunchHelper.java
deleted file mode 100644
index aaf7234..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/LaunchHelper.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.TransformDefinition;
-import org.eclipse.wst.xsl.jaxp.debug.invoker.TypedValue;
-import org.eclipse.wst.xsl.jaxp.launching.IAttribute;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchAttributes;
-import org.eclipse.wst.xsl.jaxp.launching.LaunchProperties;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-import org.eclipse.wst.xsl.launching.config.BaseLaunchHelper;
-import org.eclipse.wst.xsl.launching.config.LaunchAttribute;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-
-public class LaunchHelper extends BaseLaunchHelper
-{
- private final LaunchAttributes attributes;
- private final LaunchProperties outputProperties;
- private final ITransformerFactory transformerFactory;
-
- public LaunchHelper(ILaunchConfiguration configuration) throws CoreException
- {
- super(configuration);
- attributes = hydrateAttributes(configuration);
- outputProperties = hydrateOutputProperties(configuration);
- transformerFactory = hydrateTransformerFactory(configuration);
- }
-
- public LaunchProperties getProperties()
- {
- return outputProperties;
- }
-
- public LaunchAttributes getAttributes()
- {
- return attributes;
- }
-
- public void save(File file) throws CoreException
- {
- BufferedWriter writer = null;
- try
- {
- // ensure it exists
- file.createNewFile();
- writer = new BufferedWriter(new FileWriter(file));
- PipelineDefinition pdef = new PipelineDefinition();
- for (Iterator<?> iter = attributes.getAttributes().iterator(); iter.hasNext();)
- {
- LaunchAttribute att = (LaunchAttribute) iter.next();
- pdef.addAttribute(new TypedValue(att.uri, TypedValue.TYPE_STRING, att.value));
- }
- for (Iterator<?> iter = pipeline.getTransformDefs().iterator(); iter.hasNext();)
- {
- LaunchTransform lt = (LaunchTransform) iter.next();
- TransformDefinition tdef = new TransformDefinition();
- URL url = pathToURL(lt.getLocation());
- tdef.setStylesheetURL(url.toExternalForm());
- tdef.setResolverClass(lt.getResolver());
- for (Iterator<?> iterator = lt.getParameters().iterator(); iterator.hasNext();)
- {
- LaunchAttribute att = (LaunchAttribute) iterator.next();
- tdef.addParameter(new TypedValue(att.uri, TypedValue.TYPE_STRING, att.getResolvedValue()));
- }
- // set the output props for the LAST transform only
- if (!iter.hasNext())
- {
- for (Map.Entry<String, String> entry : outputProperties.getProperties().entrySet())
- {
- String name = entry.getKey();
- String value = entry.getValue();
- if (name != null && value != null)
- tdef.setOutputProperty(name, value);
- }
- }
- pdef.addTransformDef(tdef);
- }
-
- Document doc = pdef.toXML();
- String s = PreferenceUtil.serializeDocument(doc);
- writer.write(s);
- }
- catch (FileNotFoundException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.LaunchHelper_0, e));
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.LaunchHelper_1, e));
- }
- catch (ParserConfigurationException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, "ParserConfigurationException", e)); //$NON-NLS-1$
- }
- catch (TransformerException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, "TransformerException", e)); //$NON-NLS-1$
- }
- finally
- {
- if (writer != null)
- {
- try
- {
- writer.close();
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- }
- }
-
- public static LaunchProperties hydrateOutputProperties(ILaunchConfiguration configuration) throws CoreException
- {
- LaunchProperties properties = new LaunchProperties();
- boolean usePreferenceProperties = false; //configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_PROPERTIES_FROM_PREFERENCES, true);
- IProcessorType pt = getProcessorInstall(configuration).getProcessorType();
- if (usePreferenceProperties)
- {
- for (Map.Entry<String, String> entry : pt.getOutputPropertyValues().entrySet())
- {
- String name = entry.getKey();
- String value = entry.getValue();
- properties.setProperty(name, value);
- }
- }
- else
- {
- String s = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_OUTPUT_PROPERTIES, (String) null);
- if (s != null && s.length() > 0)
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
- properties = LaunchProperties.fromXML(inputStream);
- }
- }
- return properties;
- }
-
- private static LaunchAttributes hydrateAttributes(ILaunchConfiguration configuration) throws CoreException
- {
- LaunchAttributes attributes = new LaunchAttributes();
- boolean useDefaultAttributes = false; //configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_FEATURES_FROM_PREFERENCES, true);
- if (useDefaultAttributes)
- {
- IProcessorType pt = getProcessorInstall(configuration).getProcessorType();
- Map<String, String> fvals = pt.getAttributeValues();
- for (Map.Entry<String, String> entry : fvals.entrySet())
- {
- String uri = entry.getKey();
- IAttribute attribute = getAttribute(pt.getAttributes(), uri);
- attributes.addAttribute(new LaunchAttribute(uri, "string", entry.getValue()));
- }
- }
- else
- {
- String s = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_ATTRIBUTES, (String) null);
- if (s != null && s.length() > 0)
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
- attributes = LaunchAttributes.fromXML(inputStream);
- }
- }
- return attributes;
- }
-
- private static IAttribute getAttribute(IAttribute[] attributes, String uri)
- {
- for (IAttribute attribute : attributes)
- {
- if (attribute.getURI().equals(uri))
- return attribute;
- }
- return null;
- }
-
-
- public static IProcessorInstall getProcessorInstall(ILaunchConfiguration configuration) throws CoreException
- {
- boolean useDefaultProcessor = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, true);
- if (useDefaultProcessor)
- return JAXPRuntime.getDefaultProcessor();
- String processorId = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_PROCESSOR, ""); //$NON-NLS-1$
- IProcessorInstall processor = JAXPRuntime.getProcessor(processorId);
- return processor;
- }
-
- private static ITransformerFactory hydrateTransformerFactory(ILaunchConfiguration configuration) throws CoreException
- {
- IProcessorType type = getProcessorInstall(configuration).getProcessorType();
- boolean useDefaultFactory = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_USE_DEFAULT_PROCESSOR, true);
- if (useDefaultFactory)
- return type.getDefaultTransformerFactory();
-
- String factoryId = configuration.getAttribute(JAXPLaunchConfigurationConstants.ATTR_TRANSFORMER_FACTORY, (String)null);
- if (factoryId == null)
- return null;
-
- for (ITransformerFactory factory : type.getTransformerFactories())
- {
- if (factory.getFactoryClass().equals(factoryId))
- return factory;
- }
- return null;
- }
-
- public ITransformerFactory getTransformerFactory()
- {
- return transformerFactory;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputProperty.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputProperty.java
deleted file mode 100644
index c00c96f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputProperty.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import org.eclipse.wst.xsl.jaxp.launching.IOutputProperty;
-
-public class OutputProperty implements IOutputProperty
-{
- private final String name;
- private final String desc;
-
- public OutputProperty(String key, String desc)
- {
- this.name = key;
- this.desc = desc;
- }
-
- public String getDescription()
- {
- return desc;
- }
-
- public String getURI()
- {
- return name;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputPropertyPreferences.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputPropertyPreferences.java
deleted file mode 100644
index 4073133..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/OutputPropertyPreferences.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class OutputPropertyPreferences
-{
- private final Map<String, Map<String,String>> typeProperties = new HashMap<String, Map<String,String>>();
-
- public Map<String,String> getOutputPropertyValues(String typeId)
- {
- return typeProperties.get(typeId);
- }
-
- public void setOutputPropertyValues(String typeId, Map<String,String> properties)
- {
- typeProperties.put(typeId, properties);
- }
-
- public String getAsXML() throws ParserConfigurationException, IOException, TransformerException
- {
- Document doc = PreferenceUtil.getDocument();
- Element config = doc.createElement("outputPropertyPreferences"); //$NON-NLS-1$
- doc.appendChild(config);
-
- for (String type : typeProperties.keySet())
- {
- Element processorTypeElement = typeAsElement(doc, type);
- Map<String,String> propertyValues = typeProperties.get(type);
- featureValuesAsElement(doc, processorTypeElement, propertyValues);
- config.appendChild(processorTypeElement);
- }
-
- // Serialize the Document and return the resulting String
- return PreferenceUtil.serializeDocument(doc);
- }
-
- public static OutputPropertyPreferences fromXML(InputStream inputStream) throws CoreException
- {
- OutputPropertyPreferences prefs = new OutputPropertyPreferences();
-
- // Do the parsing and obtain the top-level node
- Document doc = PreferenceUtil.getDocument(inputStream);
- Element config = doc.getDocumentElement();
-
- Element[] processorTypeEls = PreferenceUtil.getChildElements(config, "processorType"); //$NON-NLS-1$
- for (int i = 0; i < processorTypeEls.length; ++i)
- {
- Element processorTypeEl = processorTypeEls[i];
- String type = elementAsType(processorTypeEl);
- Map<String,String> featureValues = elementAsPropertyValues(processorTypeEl);
- prefs.setOutputPropertyValues(type, featureValues);
- }
-
- return prefs;
- }
-
- private static String elementAsType(Element parent)
- {
- String id = parent.getAttribute("id"); //$NON-NLS-1$
- return id;
- }
-
- private static Element typeAsElement(Document doc, String type)
- {
- Element element = doc.createElement("processorType"); //$NON-NLS-1$
- element.setAttribute("id", type); //$NON-NLS-1$
- return element;
- }
-
- private static Map<String, String> elementAsPropertyValues(Element element)
- {
- Element[] propertyEls = PreferenceUtil.getChildElements(element, "property"); //$NON-NLS-1$
- Map<String, String> propertyValues = new HashMap<String,String>();
- for (Element featureEl : propertyEls)
- {
- String name = featureEl.getAttribute("name"); //$NON-NLS-1$
- String value = featureEl.getAttribute("value"); //$NON-NLS-1$
- propertyValues.put(name, value);
- }
- return propertyValues;
- }
-
- private static void featureValuesAsElement(Document doc, Element featuresEl, Map<String, String> propertyValues)
- {
- if (propertyValues != null)
- {
- for (Map.Entry<String, String> entry : propertyValues.entrySet())
- {
- String name = entry.getKey();
- String value = entry.getValue();
- Element element = doc.createElement("property"); //$NON-NLS-1$
- element.setAttribute("name", name); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
- featuresEl.appendChild(element);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PluginProcessorJar.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PluginProcessorJar.java
deleted file mode 100644
index a3c7fa1..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PluginProcessorJar.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-import org.osgi.framework.Bundle;
-
-public class PluginProcessorJar implements IProcessorJar
-{
- private final String pluginId;
- private final IPath path;
-
- public PluginProcessorJar(String pluginId, IPath path)
- {
- this.pluginId = pluginId;
- this.path = path;
- }
-
- public URL asURL()
- {
- URL url = null;
- try
- {
- // FIXME very clumsy way to get location orbit jar file
- // There is surely a better way, but I can'd find it.
- if (path == null)
- {
- url = Platform.getBundle(pluginId).getEntry("/"); //$NON-NLS-1$
- url = FileLocator.resolve(url);
- String s = url.getPath();
- if (s.endsWith("!/")) //$NON-NLS-1$
- {
- s = s.substring(0,s.length()-2);
- }
- url = new URL(s);
- }
- else
- {
- Bundle bundle = Platform.getBundle(pluginId);
- IPath jarPath = new Path("/" + path); //$NON-NLS-1$
- url = FileLocator.find(bundle, jarPath, null);
- if (url != null)
- url = FileLocator.resolve(url);
- }
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- return url;
- }
-
- public IPath getPath()
- {
- return path;
- }
-
- @Override
- public String toString()
- {
- return "Plugin " + pluginId + Messages.PluginProcessorJar_0 + path; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PreferenceInitializer.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PreferenceInitializer.java
deleted file mode 100644
index 0bf1bca..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/PreferenceInitializer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-
-/**
- * Class used to initialize default preference values.
- */
-public class PreferenceInitializer extends AbstractPreferenceInitializer
-{
-
- @Override
- public void initializeDefaultPreferences()
- {
- IEclipsePreferences node = new DefaultScope().getNode(JAXPLaunchingPlugin.PLUGIN_ID);
-
- ProcessorPreferences prefs = new ProcessorPreferences();
- prefs.setDefaultProcessorId(JAXPRuntime.JRE_DEFAULT_PROCESSOR_ID);
-
- OutputPropertyPreferences outputPrefs = new OutputPropertyPreferences();
- outputPrefs.setOutputPropertyValues(JAXPRuntime.JRE_DEFAULT_PROCESSOR_TYPE_ID, JAXPRuntime.createDefaultOutputProperties(JAXPRuntime.JRE_DEFAULT_PROCESSOR_TYPE_ID));
- outputPrefs.setOutputPropertyValues(JAXPLaunchConfigurationConstants.XALAN_TYPE_ID, JAXPRuntime.createDefaultOutputProperties(JAXPLaunchConfigurationConstants.XALAN_TYPE_ID));
- outputPrefs.setOutputPropertyValues(JAXPLaunchConfigurationConstants.SAXON_TYPE_ID, JAXPRuntime.createDefaultOutputProperties(JAXPLaunchConfigurationConstants.SAXON_TYPE_ID));
- outputPrefs.setOutputPropertyValues(JAXPLaunchConfigurationConstants.SAXON_1_0_TYPE_ID, JAXPRuntime.createDefaultOutputProperties(JAXPLaunchConfigurationConstants.SAXON_1_0_TYPE_ID));
-
- try
- {
- String xml = prefs.getAsXML();
- node.put(JAXPRuntime.PREF_PROCESSOR_XML, xml);
-
- xml = outputPrefs.getAsXML();
- node.put(JAXPRuntime.PREF_OUTPUT_PROPERTIES_XML, xml);
-
- node.put(JAXPLaunchConfigurationConstants.ATTR_DEFAULT_DEBUGGING_INSTALL_ID, "org.eclipse.wst.xsl.launching.xalan.processor"); //$NON-NLS-1$
- }
- catch (ParserConfigurationException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- catch (TransformerException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorInvokerDescriptor.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorInvokerDescriptor.java
deleted file mode 100644
index f0ac933..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorInvokerDescriptor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker;
-
-public class ProcessorInvokerDescriptor implements IProcessorInvoker
-{
-
- private final String invokerClass;
- private final String[] classpath;
- private final String id;
- private final String bundleId;
-
- public ProcessorInvokerDescriptor(String id, String bundleId, String invokerClass, String[] classpath)
- {
- this.id = id;
- this.bundleId = bundleId;
- this.invokerClass = invokerClass;
- this.classpath = classpath;
- }
-
- public String[] getClasspathEntries()
- {
- return createEntries(bundleId,classpath);
- }
-
- public static String[] createEntries(String bundleId, String[] classpath)
- {
- List<String> entries = new ArrayList<String>();
- try {
- // if in dev mode, use the bin dir
- if (Platform.inDevelopmentMode())
- entries.add(Utils.getFileLocation(bundleId, "/bin")); //$NON-NLS-1$
- for (String jar : classpath)
- {
- String entry = null;
- if (jar.startsWith("${eclipse_orbit:") && jar.endsWith("}")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- jar = jar.substring("${eclipse_orbit:".length()); //$NON-NLS-1$
- jar = jar.substring(0,jar.length()-1);
- try
- {
- File bundleFile = FileLocator.getBundleFile(Platform.getBundle(jar));
- if (bundleFile.isDirectory())
- entry = Utils.getPluginLocation(jar) + "/bin";
- else
- entry = Utils.getPluginLocation(jar);
- }
- catch (IOException e)
- {}
- }
- else
- {
- entry = Utils.getFileLocation(bundleId,jar);
- }
- if (entry!=null)
- entries.add(entry);
- }
- }
- catch (CoreException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- return entries.toArray(new String[0]);
- }
-
- /**
- * The name of the class that implements IProcessorInvoker
- */
- public String getInvokerClassName()
- {
- return invokerClass;
- }
-
- public String getId()
- {
- return id;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorJar.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorJar.java
deleted file mode 100644
index fe1c76a..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorJar.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-
-public class ProcessorJar implements IProcessorJar
-{
- private final IPath path;
-
- public ProcessorJar(IPath path)
- {
- this.path = path;
- }
-
- public URL asURL()
- {
- URL url = null;
- try
- {
- // first try to resolve as workspace-relative path
- IPath rootPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- File file = new File(rootPath.append(path).toOSString());
- if (file.exists())
- url = file.toURL();
- else
- {
- // now try to resolve as an absolute path
- file = new File(path.toOSString());
- url = file.toURL();
- }
- }
- catch (MalformedURLException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- return url;
- }
-
- public IPath getPath()
- {
- return path;
- }
-
- @Override
- public String toString()
- {
- return path.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorPreferences.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorPreferences.java
deleted file mode 100644
index 6dc12b1..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorPreferences.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall;
-import org.eclipse.wst.xsl.launching.config.PreferenceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class ProcessorPreferences
-{
- private String defaultProcessorId;
- private List<IProcessorInstall> processors = new ArrayList<IProcessorInstall>();
-
- public void setProcessors(List<IProcessorInstall> processors)
- {
- this.processors = processors;
- }
-
- public List<IProcessorInstall> getProcessors()
- {
- return processors;
- }
-
- public String getDefaultProcessorId()
- {
- return defaultProcessorId;
- }
-
- public void setDefaultProcessorId(String defaultProcessorId)
- {
- this.defaultProcessorId = defaultProcessorId;
- }
-
- public String getAsXML() throws ParserConfigurationException, IOException, TransformerException
- {
- Document doc = PreferenceUtil.getDocument();
- Element config = doc.createElement("processorSettings"); //$NON-NLS-1$
- doc.appendChild(config);
-
- // Set the defaultVM attribute on the top-level node
- if (defaultProcessorId != null)
- {
- config.setAttribute("defaultProcessor", defaultProcessorId); //$NON-NLS-1$
- }
-
- for (Iterator<IProcessorInstall> iter = processors.iterator(); iter.hasNext();)
- {
- IProcessorInstall install = iter.next();
- if (!install.isContributed())
- {
- Element vmTypeElement = installAsElement(doc, install);
- config.appendChild(vmTypeElement);
- }
- }
-
- // Serialize the Document and return the resulting String
- return PreferenceUtil.serializeDocument(doc);
- }
-
- public static ProcessorPreferences fromXML(InputStream inputStream) throws CoreException
- {
- ProcessorPreferences prefs = new ProcessorPreferences();
-
- Document doc = PreferenceUtil.getDocument(inputStream);
- Element config = doc.getDocumentElement();
-
- // Populate the default VM-related fields
- prefs.setDefaultProcessorId(config.getAttribute("defaultProcessor")); //$NON-NLS-1$
-
- List<IProcessorInstall> processors = new ArrayList<IProcessorInstall>();
- // Traverse the parsed structure and populate the VMType to VM Map
- Element[] processorEls = PreferenceUtil.getChildElements(config, "processor"); //$NON-NLS-1$
- for (int i = 0; i < processorEls.length; ++i)
- {
- IProcessorInstall processor = elementAsInstall(processorEls[i]);
- processors.add(processor);
- }
-
- prefs.setProcessors(processors);
-
- return prefs;
- }
-
- private static IProcessorInstall elementAsInstall(Element parent)
- {
- String id = parent.getAttribute("id"); //$NON-NLS-1$
- String label = parent.getAttribute("label"); //$NON-NLS-1$
- String typeId = parent.getAttribute("type"); //$NON-NLS-1$
- String supports = parent.getAttribute("supports"); //$NON-NLS-1$
- String debuggerId = parent.getAttribute("debuggerId"); //$NON-NLS-1$
-
- IProcessorJar[] jars = null;
- Element[] jarsEls = PreferenceUtil.getChildElements(parent, "jars"); //$NON-NLS-1$
- if (jarsEls.length == 1)
- {
- jars = elementAsJars(jarsEls[0]);
- }
- IProcessorInstall install = new ProcessorInstall(id, label, typeId, jars, debuggerId, supports, false);
- return install;
- }
-
- private static Element installAsElement(Document doc, IProcessorInstall install)
- {
- Element element = doc.createElement("processor"); //$NON-NLS-1$
- element.setAttribute("id", install.getId()); //$NON-NLS-1$
- element.setAttribute("label", install.getName()); //$NON-NLS-1$
- element.setAttribute("type", install.getProcessorType().getId()); //$NON-NLS-1$
- element.setAttribute("supports", install.getSupports()); //$NON-NLS-1$
- element.setAttribute("debuggerId", install.getDebugger() != null ? install.getDebugger().getId() : null); //$NON-NLS-1$
- element.appendChild(jarsAsElement(doc, install.getProcessorJars()));
- return element;
- }
-
- private static IProcessorJar[] elementAsJars(Element element)
- {
- Element[] jarEls = PreferenceUtil.getChildElements(element, "jar"); //$NON-NLS-1$
- List<ProcessorJar> jars = new ArrayList<ProcessorJar>(jarEls.length);
- for (Element jarEl : jarEls)
- {
- Node node = jarEl.getFirstChild();
- if (node != null && node.getNodeType() == Node.TEXT_NODE)
- {
- String path = ((Text) node).getNodeValue();
- jars.add(new ProcessorJar(Path.fromPortableString(path)));
- }
- }
- return jars.toArray(new IProcessorJar[0]);
- }
-
- private static Element jarsAsElement(Document doc, IProcessorJar[] jars)
- {
- Element jarsEl = doc.createElement("jars"); //$NON-NLS-1$
- for (IProcessorJar jar : jars)
- {
- if (jar != null && jar.getPath() != null)
- {
- Element jarEl = doc.createElement("jar"); //$NON-NLS-1$
- Text text = doc.createTextNode(jar.getPath().toPortableString());
- jarEl.appendChild(text);
- jarsEl.appendChild(jarEl);
- }
- }
- return jarsEl;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorType.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorType.java
deleted file mode 100644
index 4ed8fe6..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/ProcessorType.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.jaxp.launching.IAttribute;
-import org.eclipse.wst.xsl.jaxp.launching.IOutputProperty;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-
-public class ProcessorType implements IProcessorType
-{
- private static final String DESC_SUFFIX = ".DESC"; //$NON-NLS-1$
- private static final String TYPE_SUFFIX = ".TYPE"; //$NON-NLS-1$
-
- private final String id;
- private final String name;
- private final ITransformerFactory[] transformerFactories;
- private final URL attributePropertiesURL;
- private final URL outputPropertiesURL;
-
- private IAttribute[] attributes;
- private IOutputProperty[] outputProperties;
- private Map<String, String> outputPropertyValues;
- private Map<String, String> attributeValues;
-
- public ProcessorType(String id, String name, URL attributePropertiesURL, URL outputPropertiesURL, Map<String, String> attributeValues, Map<String, String> outputPropertyValues, ITransformerFactory[] transformerFactories)
- {
- this.id = id;
- this.name = name;
- this.attributePropertiesURL = attributePropertiesURL;
- this.outputPropertiesURL = outputPropertiesURL;
- this.attributeValues = attributeValues;
- this.transformerFactories = transformerFactories;
- this.outputPropertyValues = outputPropertyValues;
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getLabel()
- {
- return name;
- }
-
- public Map<String, String> getAttributeValues()
- {
- return attributeValues;
- }
-
- public IAttribute[] getAttributes()
- {
- if (attributes == null)
- {
- if (attributePropertiesURL != null)
- attributes = loadAttributes();
- else
- attributes = new IAttribute[0];
- }
- return attributes;
- }
-
- public Map<String,String> getOutputPropertyValues()
- {
- return outputPropertyValues;
- }
-
- public boolean isJREDefault()
- {
- return JAXPRuntime.JRE_DEFAULT_PROCESSOR_TYPE_ID.equals(id);
- }
-
- public ITransformerFactory[] getTransformerFactories()
- {
- return transformerFactories;
- }
-
- public ITransformerFactory getDefaultTransformerFactory()
- {
- if (transformerFactories.length > 0)
- return transformerFactories[0];
- return null;
- }
-
- public IOutputProperty[] getOutputProperties()
- {
- if (outputProperties == null)
- {
- if (outputPropertiesURL != null)
- outputProperties = loadOutputProperties();
- else
- outputProperties = new IOutputProperty[0];
- }
- return outputProperties;
- }
-
- private IOutputProperty[] loadOutputProperties()
- {
- BufferedInputStream is = null;
- List<OutputProperty> outputs = new ArrayList<OutputProperty>();
- Properties props = new Properties();
- try
- {
-
- is = new BufferedInputStream(outputPropertiesURL.openStream());
- props.load(is);
- for (Object element : props.keySet())
- {
- String key = (String) element;
- if (!key.endsWith(DESC_SUFFIX))
- {
- String name = key;
- String uri = props.getProperty(key);
- String desc = props.getProperty(key + DESC_SUFFIX);
- if (uri != null && name != null && desc != null)
- {
- OutputProperty prop = new OutputProperty(uri.trim(), desc);
- outputs.add(prop);
- }
- else
- {
- JAXPLaunchingPlugin.log(new CoreException(new Status(IStatus.WARNING, JAXPLaunchingPlugin.PLUGIN_ID, Messages.ProcessorType_2 + outputPropertiesURL
- + Messages.ProcessorType_3 + key)));
- }
- }
- }
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- finally
- {
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- }
- return outputs.toArray(new IOutputProperty[0]);
- }
-
- private IAttribute[] loadAttributes()
- {
- BufferedInputStream is = null;
- List<Attribute> attributesList = new ArrayList<Attribute>();
- try
- {
- is = new BufferedInputStream(attributePropertiesURL.openStream());
- Properties props = new Properties();
- props.load(is);
-
- for (Object element : props.keySet())
- {
- String key = (String) element;
- if (!key.endsWith(DESC_SUFFIX) && !key.endsWith(TYPE_SUFFIX))
- {
- String uri = props.getProperty(key);
- String type = props.getProperty(key + TYPE_SUFFIX);
- String desc = props.getProperty(key + DESC_SUFFIX);
- if (uri != null && type != null && desc != null)
- {
- Attribute attribute = new Attribute(uri.trim(), type.trim(), desc);
- attributesList.add(attribute);
- }
- else
- {
- JAXPLaunchingPlugin.log(new CoreException(new Status(IStatus.WARNING, JAXPLaunchingPlugin.PLUGIN_ID, Messages.ProcessorType_4 + attributePropertiesURL
- + Messages.ProcessorType_5 + key)));
- }
- }
- }
-
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- finally
- {
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- }
- IAttribute[] attributes = attributesList.toArray(new IAttribute[0]);
- Arrays.sort(attributes);
- return attributes;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/TransformerFactory.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/TransformerFactory.java
deleted file mode 100644
index 4049d42..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/TransformerFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-
-public class TransformerFactory implements ITransformerFactory
-{
- private final String factoryClass;
- private final String name;
-
- public TransformerFactory(String name,String factoryClass)
- {
- super();
- this.factoryClass = factoryClass;
- this.name = name;
- }
-
- public String getFactoryClass()
- {
- return factoryClass;
- }
-
- public String getName()
- {
- return name;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Utils.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Utils.java
deleted file mode 100644
index f81f28a..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/Utils.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.wst.xsl.jaxp.launching.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-
-public class Utils
-{
-
- public static String getFileLocation(String bundleId, String path) throws CoreException
- {
- String location = null;
- try
- {
- URL url = FileLocator.find(Platform.getBundle(bundleId), new Path(path), null);
- if (url != null)
- {
- URL fileUrl = FileLocator.toFileURL(url);
- File file = new File(fileUrl.getFile());
- location = file.getAbsolutePath();
- }
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Utils_0 + path + Messages.Utils_1 + bundleId, e));
- }
- return location;
- }
-
- public static String getPluginLocation(String bundleId) throws CoreException
- {
- String location = null;
- try
- {
- URL url = new URL("platform:/plugin/"+bundleId);
- if (url != null)
- {
- URL fileUrl = FileLocator.toFileURL(url);
- File file = new File(fileUrl.getFile());
- location = file.getAbsolutePath();
- }
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Utils_0 + bundleId + Messages.Utils_1 + bundleId, e));
- }
- return location;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/AbstractRegistryReader.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/AbstractRegistryReader.java
deleted file mode 100644
index cf218c2..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/AbstractRegistryReader.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-
-public abstract class AbstractRegistryReader
-{
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
- protected static void logError(IConfigurationElement element, String text)
- {
- IExtension extension = element.getDeclaringExtension();
- StringBuffer buf = new StringBuffer();
- buf.append("Plugin " + extension.getNamespaceIdentifier() + Messages.AbstractRegistryReader_3 + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$
- buf.append("\n" + text); //$NON-NLS-1$
- JAXPLaunchingPlugin.log(new CoreException(new Status(IStatus.ERROR, JAXPLaunchingPlugin.PLUGIN_ID, IStatus.OK, buf.toString(), null)));
- }
-
- protected static void logMissingAttribute(IConfigurationElement element, String attributeName)
- {
- logError(element, Messages.AbstractRegistryReader_5 + attributeName + Messages.AbstractRegistryReader_6);
- }
-
- protected static void logMissingElement(IConfigurationElement element, String elementName)
- {
- logError(element, Messages.AbstractRegistryReader_7 + elementName + Messages.AbstractRegistryReader_8);
- }
-
- protected static void logUnknownElement(IConfigurationElement element)
- {
- logError(element, Messages.AbstractRegistryReader_9 + element.getName());
- }
-
- public static IExtension[] orderExtensions(IExtension[] extensions)
- {
- IExtension[] sortedExtension = new IExtension[extensions.length];
- System.arraycopy(extensions, 0, sortedExtension, 0, extensions.length);
- Comparator<IExtension> comparer = new Comparator<IExtension>()
- {
- public int compare(IExtension arg0, IExtension arg1)
- {
- String s1 = arg0.getNamespaceIdentifier();
- String s2 = arg1.getNamespaceIdentifier();
- return s1.compareToIgnoreCase(s2);
- }
- };
- Collections.sort(Arrays.asList(sortedExtension), comparer);
- return sortedExtension;
- }
-
- protected abstract boolean readElement(IConfigurationElement element);
-
- protected void readElementChildren(IConfigurationElement element)
- {
- readElements(element.getChildren());
- }
-
- protected void readElements(IConfigurationElement[] elements)
- {
- for (int i = 0; i < elements.length; i++)
- {
- if (!readElement(elements[i]))
- logUnknownElement(elements[i]);
- }
- }
-
- protected void readExtension(IExtension extension)
- {
- readElements(extension.getConfigurationElements());
- }
-
- public void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
- {
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point == null)
- return;
- IExtension[] extensions = point.getExtensions();
- extensions = orderExtensions(extensions);
- for (IExtension element : extensions)
- readExtension(element);
- }
-
- public static String getDescription(IConfigurationElement configElement)
- {
- IConfigurationElement[] children = configElement.getChildren(TAG_DESCRIPTION);
- if (children.length >= 1)
- {
- return children[0].getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- public static String getClassValue(IConfigurationElement configElement, String classAttributeName)
- {
- String className = configElement.getAttribute(classAttributeName);
- if (className != null)
- return className;
- IConfigurationElement[] candidateChildren = configElement.getChildren(classAttributeName);
- if (candidateChildren.length == 0)
- return null;
-
- return candidateChildren[0].getAttribute(ATT_CLASS);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistry.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistry.java
deleted file mode 100644
index 68a0bbd..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xsl.jaxp.launching.IDebugger;
-import org.eclipse.wst.xsl.jaxp.launching.internal.DebuggerDescriptor;
-
-public class DebuggerRegistry
-{
- private final Map<String, DebuggerDescriptor> debuggers = new HashMap<String, DebuggerDescriptor>();
-
- public DebuggerRegistry()
- {
- DebuggerRegistryReader registryReader = new DebuggerRegistryReader();
- registryReader.addConfigs(this);
- }
-
- public IDebugger getDebugger(String id)
- {
- return debuggers.get(id);
- }
-
- public IDebugger[] getDebuggers()
- {
- return debuggers.values().toArray(new IDebugger[0]);
- }
-
- public void addDebugger(DebuggerDescriptor desc)
- {
- debuggers.put(desc.getId(), desc);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistryReader.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistryReader.java
deleted file mode 100644
index 98b9ee8..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/DebuggerRegistryReader.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.internal.DebuggerDescriptor;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-
-public class DebuggerRegistryReader extends AbstractRegistryReader
-{
- public static final String TAG_DEBUGGER = "debugger"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_CLASSNAME = "className"; //$NON-NLS-1$
- public static final String ATT_CLASSPATH = "classpath"; //$NON-NLS-1$
- public static final String ATT_NAME = "name"; //$NON-NLS-1$
- public static final String ATT_PROCESSOR_TYPE_ID = "processorTypeId"; //$NON-NLS-1$
- public static final String ATT_TRANSFORMER_FACTORY = "transformerFactoryClass"; //$NON-NLS-1$
-
- private DebuggerRegistry registry;
-
- @Override
- protected boolean readElement(IConfigurationElement element)
- {
- if (!element.getName().equals(TAG_DEBUGGER))
- return false;
-
- String id = element.getAttribute(ATT_ID);
- if (id == null)
- {
- logMissingAttribute(element, ATT_ID);
- return true;
- }
-
- String className = element.getAttribute(ATT_CLASSNAME);
- if (className == null)
- {
- logMissingAttribute(element, ATT_CLASSNAME);
- return true;
- }
-
- String classpath = element.getAttribute(ATT_CLASSPATH);
- if (classpath == null)
- {
- logMissingAttribute(element, ATT_CLASSPATH);
- return true;
- }
-
- String[] entries = classpath.split(";"); //$NON-NLS-1$
- for (int i = 0; i < entries.length; i++)
- {
- String string = entries[i];
- entries[i] = string.trim();
- }
-
- String name = element.getAttribute(ATT_NAME);
- if (name == null)
- {
- logMissingAttribute(element, ATT_NAME);
- return true;
- }
-
- String processorTypeId = element.getAttribute(ATT_PROCESSOR_TYPE_ID);
- if (processorTypeId == null)
- {
- logMissingAttribute(element, ATT_PROCESSOR_TYPE_ID);
- return true;
- }
- String tFact = element.getAttribute(ATT_TRANSFORMER_FACTORY);
-
- registry.addDebugger(new DebuggerDescriptor(id, element.getContributor().getName(), className, entries, name, processorTypeId, tFact));
-
- return true;
- }
-
- public void readElement(DebuggerRegistry registry, IConfigurationElement element)
- {
- this.registry = registry;
- readElement(element);
- }
-
- public void addConfigs(DebuggerRegistry registry)
- {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- this.registry = registry;
- readRegistry(extensionRegistry, JAXPLaunchingPlugin.PLUGIN_ID, "debugger"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistry.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistry.java
deleted file mode 100644
index 5cb816f..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistry.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInvoker;
-
-public class InvokerRegistry
-{
- private final Map<String, IProcessorInvoker> invokers = new HashMap<String, IProcessorInvoker>();
-
- public InvokerRegistry()
- {
- InvokerRegistryReader registryReader = new InvokerRegistryReader();
- registryReader.addConfigs(this);
- }
-
- public IProcessorInvoker getProcessorInvoker(String id)
- {
- return invokers.get(id);
- }
-
- public IProcessorInvoker[] getProcessorInvokers()
- {
- return invokers.values().toArray(new IProcessorInvoker[0]);
- }
-
- public void addInvokerDescriptor(IProcessorInvoker desc)
- {
- invokers.put(desc.getId(), desc);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistryReader.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistryReader.java
deleted file mode 100644
index b9e6137..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/InvokerRegistryReader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorInvokerDescriptor;
-
-public class InvokerRegistryReader extends AbstractRegistryReader
-{
- public static final String TAG_INVOKE = "invoker"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String ATT_CLASSPATH = "classpath"; //$NON-NLS-1$
-
- private InvokerRegistry registry;
-
- @Override
- protected boolean readElement(IConfigurationElement element)
- {
- if (!element.getName().equals(TAG_INVOKE))
- return false;
-
- String id = element.getAttribute(ATT_ID);
- if (id == null)
- {
- logMissingAttribute(element, ATT_ID);
- return true;
- }
-
- String classname = element.getAttribute(ATT_CLASS);
- if (classname == null)
- {
- logMissingAttribute(element, ATT_CLASS);
- return true;
- }
-
- String classpath = element.getAttribute(ATT_CLASSPATH);
- if (classpath == null)
- {
- logMissingAttribute(element, ATT_CLASSPATH);
- return true;
- }
-
- String[] entries = classpath.split(";"); //$NON-NLS-1$
- for (int i = 0; i < entries.length; i++)
- {
- String string = entries[i];
- entries[i] = string.trim();
- }
-
- registry.addInvokerDescriptor(new ProcessorInvokerDescriptor(id, element.getContributor().getName(), classname, entries));
-
- return true;
- }
-
- public void readElement(InvokerRegistry registry, IConfigurationElement element)
- {
- this.registry = registry;
- readElement(element);
- }
-
- public void addConfigs(InvokerRegistry registry)
- {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- this.registry = registry;
- readRegistry(extensionRegistry, JAXPLaunchingPlugin.PLUGIN_ID, "invoke"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistry.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistry.java
deleted file mode 100644
index 7dd4008..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistry.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorJar;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.ProcessorInstall;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorPreferences;
-
-public class ProcessorRegistry
-{
- private final List<ProcessorInstall> contributedInstalls = new ArrayList<ProcessorInstall>();
- private List<IProcessorInstall> userInstalls = new ArrayList<IProcessorInstall>();
- private IProcessorInstall defaultProcessor;
- private IProcessorInstall jreDefaultProcessor;
- private IProcessorInstall[] installs;
-
- public ProcessorRegistry()
- {
- initializeFromStorage();
- }
-
- private void initializeFromStorage()
- {
- // read from the registry
- ProcessorRegistryReader registryReader = new ProcessorRegistryReader();
- registryReader.addConfigs(this);
- // find the jre default
- for (Iterator<ProcessorInstall> iter = contributedInstalls.iterator(); iter.hasNext();)
- {
- IProcessorInstall install = iter.next();
- if (install.getId().equals(JAXPRuntime.JRE_DEFAULT_PROCESSOR_ID))
- {
- jreDefaultProcessor = install;
- break;
- }
- }
- // read from the preferences
- addPersistedVMs();
- }
-
- private void addPersistedVMs()
- {
- // Try retrieving the VM preferences from the preference store
- String vmXMLString = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPRuntime.PREF_PROCESSOR_XML);
-
- // If the preference was found, load VMs from it into memory
- if (vmXMLString.length() > 0)
- {
- try
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(vmXMLString.getBytes());
- ProcessorPreferences prefs = ProcessorPreferences.fromXML(inputStream);
- String defaultProcessorId = prefs.getDefaultProcessorId();
- userInstalls = prefs.getProcessors();
- for (Iterator<IProcessorInstall> iter = userInstalls.iterator(); iter.hasNext();)
- {
- IProcessorInstall install = iter.next();
- if (install.getId().equals(defaultProcessorId))
- {
- defaultProcessor = install;
- }
- }
- if (defaultProcessor == null)
- {
- for (Iterator<ProcessorInstall> iter = contributedInstalls.iterator(); iter.hasNext();)
- {
- IProcessorInstall install = iter.next();
- if (defaultProcessor == null && install.getId().equals(defaultProcessorId))
- {
- defaultProcessor = install;
- }
- }
- }
- }
- catch (CoreException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
- // make the JRE the default default
- if (defaultProcessor == null)
- {
- defaultProcessor = jreDefaultProcessor;
- }
- }
-
- public void addProcessor(String bundleId, String id, String label, String processorTypeId, String classpath, String debuggerId, String supports)
- {
- IProcessorJar[] jars = ProcessorInstall.createJars(bundleId, classpath);
- contributedInstalls.add(new ProcessorInstall(id, label, processorTypeId, jars, debuggerId, supports, true));
- }
-
- public void addProcessor(IProcessorInstall install)
- {
- if (!install.isContributed())
- userInstalls.add(install);
- IProcessorInstall[] newinstalls = new IProcessorInstall[installs.length + 1];
- System.arraycopy(installs, 0, newinstalls, 0, installs.length);
- newinstalls[installs.length] = install;
- installs = newinstalls;
- }
-
- public void removeProcessor(int index)
- {
- IProcessorInstall removed = installs[index];
- if (!removed.isContributed())
- userInstalls.remove(removed);
- IProcessorInstall[] newinstalls = new IProcessorInstall[installs.length - 1];
- System.arraycopy(installs, 0, newinstalls, 0, index);
- System.arraycopy(installs, index + 1, newinstalls, index, newinstalls.length - index);
- installs = newinstalls;
- }
-
- public IProcessorInstall[] getProcessors()
- {
- if (installs == null)
- {
- installs = new IProcessorInstall[contributedInstalls.size() + userInstalls.size()];
- int startIndex = 0;
- for (int i = 0; i < contributedInstalls.size(); i++)
- {
- installs[i] = contributedInstalls.get(i);
- startIndex = i + 1;
- }
- for (int i = 0; i < userInstalls.size(); i++)
- {
- installs[startIndex + i] = userInstalls.get(i);
- }
- }
- return installs;
- }
-
- public IProcessorInstall[] getProcessors(String id)
- {
- IProcessorInstall[] installs = getProcessors();
- List<IProcessorInstall> result = new ArrayList<IProcessorInstall>();
- for (IProcessorInstall type : installs)
- {
- if (type.getProcessorType().getId().equals(id))
- result.add(type);
- }
- return result.toArray(new IProcessorInstall[0]);
- }
-
- public void setDefaultProcessor(IProcessorInstall defaultInstall)
- {
- defaultProcessor = defaultInstall;
- }
-
- public IProcessorInstall getDefaultProcessor()
- {
- return defaultProcessor;
- }
-
- public IProcessorInstall getJREDefaultProcessor()
- {
- return jreDefaultProcessor;
- }
-
- public IProcessorInstall[] getContributedProcessors()
- {
- return contributedInstalls.toArray(new IProcessorInstall[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistryReader.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistryReader.java
deleted file mode 100644
index 1be3d31..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorRegistryReader.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-
-public class ProcessorRegistryReader extends AbstractRegistryReader
-{
- public static final String TAG_processor = "processor"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_LABEL = "label"; //$NON-NLS-1$
- public static final String ATT_TYPE_ID = "processorTypeId"; //$NON-NLS-1$
- public static final String ATT_DEBUGGER_ID = "debuggerId"; //$NON-NLS-1$
- public static final String ATT_CLASSPATH = "classpath"; //$NON-NLS-1$
- public static final String ATT_SUPPORTS = "supports"; //$NON-NLS-1$
-
- private ProcessorRegistry registry;
-
- @Override
- protected boolean readElement(IConfigurationElement element)
- {
- if (!element.getName().equals(TAG_processor))
- return false;
-
- String id = element.getAttribute(ATT_ID);
- if (id == null)
- {
- logMissingAttribute(element, ATT_ID);
- return true;
- }
-
- String label = element.getAttribute(ATT_LABEL);
- if (label == null)
- {
- logMissingAttribute(element, ATT_LABEL);
- return true;
- }
-
- String processorTypeId = element.getAttribute(ATT_TYPE_ID);
- if (processorTypeId == null)
- {
- logMissingAttribute(element, ATT_TYPE_ID);
- return true;
- }
-
- String classpath = element.getAttribute(ATT_CLASSPATH);
- if (classpath == null)
- {
- logMissingAttribute(element, ATT_CLASSPATH);
- return true;
- }
-
- String debuggerId = element.getAttribute(ATT_DEBUGGER_ID);
-
- String supports = element.getAttribute(ATT_SUPPORTS);
- if (classpath == null)
- {
- logMissingAttribute(element, ATT_SUPPORTS);
- return true;
- }
-
- registry.addProcessor(element.getContributor().getName(), id, label, processorTypeId, classpath, debuggerId, supports);
-
- return true;
- }
-
- public void readElement(ProcessorRegistry registry, IConfigurationElement element)
- {
- this.registry = registry;
- readElement(element);
- }
-
- public void addConfigs(ProcessorRegistry registry)
- {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- this.registry = registry;
- readRegistry(extensionRegistry, JAXPLaunchingPlugin.PLUGIN_ID, "processor"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistry.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistry.java
deleted file mode 100644
index e5ff44c..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistry.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import java.io.ByteArrayInputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.IProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.ITransformerFactory;
-import org.eclipse.wst.xsl.jaxp.launching.JAXPRuntime;
-import org.eclipse.wst.xsl.jaxp.launching.internal.FeaturePreferences;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.jaxp.launching.internal.OutputPropertyPreferences;
-import org.eclipse.wst.xsl.jaxp.launching.internal.ProcessorType;
-import org.eclipse.wst.xsl.jaxp.launching.internal.TransformerFactory;
-
-public class ProcessorTypeRegistry
-{
- protected static final String DESC_SUFFIX = ".DESC"; //$NON-NLS-1$
- protected static final String TYPE_SUFFIX = ".TYPE"; //$NON-NLS-1$
-
- private final List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>();
- private IProcessorType[] installTypes;
-
- public ProcessorTypeRegistry()
- {
- ProcessorTypeRegistryReader registryReader = new ProcessorTypeRegistryReader();
- registryReader.addConfigs(this);
- }
-
- public IProcessorType[] getProcessorTypes()
- {
- if (installTypes == null)
- {
- List<ProcessorType> types = new ArrayList<ProcessorType>();
- String featureXMLString = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPRuntime.PREF_FEATURE_XML);
- // If the preference was found, load VMs from it into memory
- FeaturePreferences prefs = null;
- if (featureXMLString.length() > 0)
- {
- try
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(featureXMLString.getBytes());
- prefs = FeaturePreferences.fromXML(inputStream);
- }
- catch (CoreException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
-
- String propXMLString = JAXPLaunchingPlugin.getDefault().getPluginPreferences().getString(JAXPRuntime.PREF_OUTPUT_PROPERTIES_XML);
- // If the preference was found, load VMs from it into memory
- OutputPropertyPreferences outputprefs = null;
- if (propXMLString.length() > 0)
- {
- try
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(propXMLString.getBytes());
- outputprefs = OutputPropertyPreferences.fromXML(inputStream);
- }
- catch (CoreException e)
- {
- JAXPLaunchingPlugin.log(e);
- }
- }
-
- for (Iterator<IConfigurationElement> iter = elements.iterator(); iter.hasNext();)
- {
- IConfigurationElement element = iter.next();
- String id = element.getAttribute(ProcessorTypeRegistryReader.ATT_ID);
- String label = element.getAttribute(ProcessorTypeRegistryReader.ATT_LABEL);
- Map<String, String> featureValues = new HashMap<String, String>();
- Map<String, String> propertyValues = new HashMap<String, String>();
- if (prefs != null && prefs.getFeaturesValues(id) != null)
- featureValues.putAll(prefs.getFeaturesValues(id));
- if (outputprefs != null && outputprefs.getOutputPropertyValues(id) != null)
- propertyValues.putAll(outputprefs.getOutputPropertyValues(id));
-
- String outputProperties = element.getAttribute(ProcessorTypeRegistryReader.ATT_OUTPUT_PROPERTIES);
- URL outputPropertiesURL = FileLocator.find(Platform.getBundle(element.getContributor().getName()), new Path(outputProperties), null);
- String featureProperties = element.getAttribute(ProcessorTypeRegistryReader.ATT_ATTRIBUTE_PROPERTIES);
- URL featurePropertiesURL = FileLocator.find(Platform.getBundle(element.getContributor().getName()), new Path(featureProperties), null);
-
- List<ITransformerFactory> transFactoryList = new ArrayList<ITransformerFactory>();
- IConfigurationElement[] transFactEls = element.getChildren(ProcessorTypeRegistryReader.EL_TRANSFORMER_FACTORY);
- for (IConfigurationElement transFactEl : transFactEls)
- {
- String transFactoryName = transFactEl.getAttribute(ProcessorTypeRegistryReader.ATT_TRANSFORMER_FACTORY_NAME);
- String transFactoryClass = transFactEl.getAttribute(ProcessorTypeRegistryReader.ATT_TRANSFORMER_FACTORY_CLASS);
- transFactoryList.add(new TransformerFactory(transFactoryName,transFactoryClass));
- }
-
- types.add(new ProcessorType(id, label, featurePropertiesURL, outputPropertiesURL, featureValues, propertyValues, transFactoryList.toArray(new ITransformerFactory[0])));
- }
- installTypes = types.toArray(new IProcessorType[0]);
- }
- return installTypes;
- }
-
- public IProcessorType[] getProcessorTypesExclJREDefault()
- {
- IProcessorType[] installTypes = getProcessorTypes();
- List<IProcessorType> exclTypes = new ArrayList<IProcessorType>(installTypes.length - 1);
- for (IProcessorType type : installTypes)
- {
- if (!type.isJREDefault())
- exclTypes.add(type);
- }
- return exclTypes.toArray(new IProcessorType[0]);
- }
-
- public void addType(IConfigurationElement element)
- {
- elements.add(element);
- }
-
- public IProcessorType getProcessorType(String id)
- {
- IProcessorType[] installTypes = getProcessorTypes();
- for (IProcessorType type : installTypes)
- {
- if (type.getId().equals(id))
- return type;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistryReader.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistryReader.java
deleted file mode 100644
index 201e2f6..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/internal/registry/ProcessorTypeRegistryReader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.internal.registry;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-
-public class ProcessorTypeRegistryReader extends AbstractRegistryReader
-{
- public static final String TAG_processorType = "processorType"; //$NON-NLS-1$
- public static final String ATT_ID = "id"; //$NON-NLS-1$
- public static final String ATT_LABEL = "label"; //$NON-NLS-1$
- public static final String ATT_OUTPUT_PROPERTIES = "outputProperties"; //$NON-NLS-1$
- public static final String ATT_ATTRIBUTE_PROPERTIES = "attributeProperties"; //$NON-NLS-1$
- public static final String EL_TRANSFORMER_FACTORY = "transformerFactory";
- public static final String ATT_TRANSFORMER_FACTORY_NAME = "name";
- public static final String ATT_TRANSFORMER_FACTORY_CLASS = "factoryClass";
-
- private ProcessorTypeRegistry registry;
-
- @Override
- protected boolean readElement(IConfigurationElement element)
- {
- if (!element.getName().equals(TAG_processorType))
- return false;
-
- String id = element.getAttribute(ATT_ID);
- if (id == null)
- {
- logMissingAttribute(element, ATT_ID);
- return true;
- }
-
- String label = element.getAttribute(ATT_LABEL);
- if (label == null)
- {
- logMissingAttribute(element, ATT_LABEL);
- return true;
- }
-
- String outputProperties = element.getAttribute(ATT_OUTPUT_PROPERTIES);
- if (outputProperties == null)
- {
- logMissingAttribute(element, ATT_OUTPUT_PROPERTIES);
- return true;
- }
-
- String featureProperties = element.getAttribute(ATT_ATTRIBUTE_PROPERTIES);
- if (featureProperties == null)
- {
- logMissingAttribute(element, ATT_ATTRIBUTE_PROPERTIES);
- return true;
- }
-
- registry.addType(element);
-
- return true;
- }
-
- public void readElement(ProcessorTypeRegistry registry, IConfigurationElement element)
- {
- this.registry = registry;
- readElement(element);
- }
-
- protected void addConfigs(ProcessorTypeRegistry registry)
- {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- this.registry = registry;
- readRegistry(extensionRegistry, JAXPLaunchingPlugin.PLUGIN_ID, "processorType"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/messages.properties b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/messages.properties
deleted file mode 100644
index fb7ee3d..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/messages.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-XSLTRuntime_10=Failed to save process preferences
-XSLTRuntime_5=Saving attributes...
-XSLTRuntime_6=Failed to save attribute preferences
-XSLTRuntime_7=Saving properties...
-XSLTRuntime_8=Failed to save output property preferences
-XSLTRuntime_9=Saving processors...
-
-Attribute_0=Value must be a double
-Attribute_1=Value must be an integer
-Attribute_2=Valid values are 'true' or 'false'
-Attribute_5=Value must be a float
-PluginProcessorJar_0=, path
-ProcessorType_2=Output properties file
-ProcessorType_3=\ not configured properly for key
-ProcessorType_4=Attribute properties file
-ProcessorType_5=\ not configured properly for key
-Utils_0=Error determining jar file location:
-Utils_1=\ from bundle:
-XSLTLaunchConfigurationDelegate_0=Switch to Default Debugger
-XSLTLaunchConfigurationDelegate_1=The
-XSLTLaunchConfigurationDelegate_2=\ XSLT processor does not support debugging_\n
-XSLTLaunchConfigurationDelegate_23=Could not locate jar file
-XSLTLaunchConfigurationDelegate_3=Would you like to debug using the default
-XSLTLaunchConfigurationDelegate_31=\ to
-XSLTLaunchConfigurationDelegate_4=\ processor instead?
-XSLTLaunchConfigurationDelegate_5=launch
-XSLTLaunchConfigurationDelegate_6=launch.xml
-XSLTLaunchConfigurationDelegate_7=Error copying url
-
-AbstractRegistryReader_3=, extension
-AbstractRegistryReader_5=Required attribute '
-AbstractRegistryReader_6=' not defined
-AbstractRegistryReader_7=Required sub element '
-AbstractRegistryReader_8=' not defined
-AbstractRegistryReader_9=Unknown extension tag found:
-
-LaunchHelper_0=File not found
-LaunchHelper_1=IO Exception
-
-XSLDebugTarget_0=Unable to connect to debugger
-XSLDebugTarget_1=localhost
-XSLDebugTarget_19=Request failed:
-XSLDebugTarget_2=Could not connect to socket
-XSLDebugTarget_20=Event Dispatch
-XSLDebugTarget_3=\ after
-XSLDebugTarget_4=\ attempts
-
diff --git a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/model/JAXPDebugTarget.java b/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/model/JAXPDebugTarget.java
deleted file mode 100644
index 6e68ca3..0000000
--- a/bundles/org.eclipse.wst.xsl.jaxp.launching/src/org/eclipse/wst/xsl/jaxp/launching/model/JAXPDebugTarget.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.jaxp.launching.model;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.net.ConnectException;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
-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.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ILineBreakpoint;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.DebugConstants;
-import org.eclipse.wst.xsl.jaxp.launching.Messages;
-import org.eclipse.wst.xsl.jaxp.launching.internal.JAXPLaunchingPlugin;
-import org.eclipse.wst.xsl.launching.config.BaseLaunchHelper;
-import org.eclipse.wst.xsl.launching.model.IXSLConstants;
-import org.eclipse.wst.xsl.launching.model.IXSLDebugTarget;
-import org.eclipse.wst.xsl.launching.model.XSLDebugElement;
-import org.eclipse.wst.xsl.launching.model.XSLStackFrame;
-import org.eclipse.wst.xsl.launching.model.XSLThread;
-import org.eclipse.wst.xsl.launching.model.XSLValue;
-import org.eclipse.wst.xsl.launching.model.XSLVariable;
-
-public class JAXPDebugTarget extends XSLDebugElement implements IXSLDebugTarget {
- private final byte[] STACK_FRAMES_LOCK = new byte[0];
- private final byte[] VALUE_MAP_LOCK = new byte[0];
- private final byte[] WRITE_LOCK = new byte[0];
-
- private final int CONNECT_ATTEMPTS = 60;
- private final int CONNECT_WAIT = 1000;
-
- private final IProcess process;
- private final ILaunch launch;
- private XSLThread thread;
- private IThread[] threads = new IThread[0];
- private IStackFrame[] stackFramesCache = new IStackFrame[0];
-
- private EventDispatchJob eventDispatch;
-
- private final Map<Integer, XSLVariable> variableMapCache = new HashMap<Integer, XSLVariable>();
- private final Map<XSLVariable, XSLValue> valueMapCache = new HashMap<XSLVariable, XSLValue>();
- private String name;
- private boolean suspended;
-
- private Socket requestSocket;
- private Socket eventSocket;
- private Socket generateSocket;
- private BufferedReader requestReader;
- private BufferedReader eventReader;
- private PrintWriter requestWriter;
- private Reader generateReader;
- private boolean stale;
-
- public JAXPDebugTarget(ILaunch launch, IProcess process,
- BaseLaunchHelper BaseLaunchHelper) throws CoreException {
- super(null);
- this.launch = launch;
- this.process = process;
- this.requestSocket = attemptConnect(BaseLaunchHelper.getRequestPort());
- this.eventSocket = attemptConnect(BaseLaunchHelper.getEventPort());
- this.generateSocket = attemptConnect(BaseLaunchHelper.getGeneratePort());
-
- if (!process.isTerminated()) {
- try {
- this.eventReader = new BufferedReader(new InputStreamReader(eventSocket.getInputStream()));
- this.requestWriter = new PrintWriter(requestSocket.getOutputStream());
- this.requestReader = new BufferedReader(new InputStreamReader(requestSocket.getInputStream()));
- this.generateReader = new InputStreamReader(generateSocket.getInputStream());
- } catch (IOException e) {
- abort(Messages.XSLDebugTarget_0, e);
- }
- this.thread = new XSLThread(this);
- this.threads = new IThread[] { thread };
- this.eventDispatch = new EventDispatchJob();
- this.eventDispatch.schedule();
-
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- }
- }
-
- public Reader getGenerateReader()
- {
- return generateReader;
- }
-
- private void abort(String message, Throwable e) throws DebugException {
- if (!getDebugTarget().isTerminated())
- getDebugTarget().getProcess().terminate();
- throw new DebugException(new Status(IStatus.ERROR,
- JAXPLaunchingPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, message,
- e));
- }
-
- private Socket attemptConnect(int port) throws CoreException {
- Socket socket = null;
- for (int i = 0; i < CONNECT_ATTEMPTS; i++) {
- // break out if process is terminated
- if (process.isTerminated())
- break;
- try {
- socket = new Socket(
- Messages.XSLDebugTarget_1, port);
- } catch (ConnectException e) {
- } catch (IOException e) {
- }
- if (socket != null)
- break;
- try {
- Thread.sleep(CONNECT_WAIT);
- } catch (InterruptedException e) {
- }
- }
- if (socket == null && !process.isTerminated())
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- JAXPLaunchingPlugin.PLUGIN_ID,
- Messages.XSLDebugTarget_2 + port + Messages.XSLDebugTarget_3 + CONNECT_ATTEMPTS + Messages.XSLDebugTarget_4));
- return socket;
- }
-
- public IProcess getProcess() {
- return process;
- }
-
- public IThread[] getThreads() throws DebugException {
- return threads;
- }
-
- public boolean hasThreads() throws DebugException {
- return threads != null && threads.length > 0;
- }
-
- public String getName() throws DebugException {
- if (name == null) {
- name = launch.getAttribute("launchName");
- }
- return name;
- }
-
- public boolean supportsBreakpoint(IBreakpoint breakpoint) {
- if (breakpoint.getModelIdentifier().equals(
- IXSLConstants.ID_XSL_DEBUG_MODEL)
- && breakpoint instanceof ILineBreakpoint) {
- // try
- // {
- // ILineBreakpoint lb = (ILineBreakpoint) breakpoint;
- // IMarker marker = lb.getMarker();
- // for (Iterator<?> iter =
- // BaseLaunchHelper.getPipeline().getTransformDefs().iterator();
- // iter.hasNext();)
- // {
- // LaunchTransform lt = (LaunchTransform) iter.next();
- // if (marker.getResource().getLocation().equals(lt.getLocation()))
- // return true;
- // }
- // }
- // catch (CoreException e)
- // {
- // JAXPLaunchingPlugin.log(e);
- // }
- return true;
- }
- return false;
- }
-
- @Override
- public IDebugTarget getDebugTarget() {
- return this;
- }
-
- @Override
- public ILaunch getLaunch() {
- return launch;
- }
-
- public boolean canTerminate() {
- return getProcess().canTerminate();
- }
-
- public boolean isTerminated() {
- return getProcess().isTerminated();
- }
-
- public void terminate() throws DebugException {
- synchronized (WRITE_LOCK) {
- getProcess().terminate();
- }
- }
-
- public boolean canResume() {
- return !isTerminated() && isSuspended();
- }
-
- public boolean canSuspend() {
- return !isTerminated() && !isSuspended();
- }
-
- public boolean isSuspended() {
- return suspended;
- }
-
- public void resume() throws DebugException {
- sendRequest(DebugConstants.REQUEST_RESUME);
- }
-
- private void resumed(int detail) {
- suspended = false;
- thread.fireResumeEvent(detail);
- }
-
- private void suspended(int detail) {
- suspended = true;
- thread.fireSuspendEvent(detail);
- }
-
- public void suspend() throws DebugException {
- sendRequest(DebugConstants.REQUEST_SUSPEND);
- }
-
- public void breakpointAdded(IBreakpoint breakpoint) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- ILineBreakpoint lb = (ILineBreakpoint) breakpoint;
- if (breakpoint.isEnabled()) {
- try {
- IMarker marker = lb.getMarker();
- if (marker != null) {
- URL file = marker.getResource().getLocation()
- .toFile().toURI().toURL();
- sendRequest(DebugConstants.REQUEST_ADD_BREAKPOINT
- + " " + file + " " + lb.getLineNumber()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (CoreException e) {
- JAXPLaunchingPlugin.log(e);
- } catch (MalformedURLException e) {
- JAXPLaunchingPlugin.log(e);
- }
- }
- } catch (CoreException e) {
- }
- }
- }
-
- public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- ILineBreakpoint lb = (ILineBreakpoint) breakpoint;
- IMarker marker = lb.getMarker();
- if (marker != null) {
- URL file = marker.getResource().getLocation().toFile()
- .toURI().toURL();
- sendRequest(DebugConstants.REQUEST_REMOVE_BREAKPOINT
- + " " + file + " " + lb.getLineNumber()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (CoreException e) {
- JAXPLaunchingPlugin.log(e);
- } catch (MalformedURLException e) {
- JAXPLaunchingPlugin.log(e);
- }
- }
- }
-
- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
- if (supportsBreakpoint(breakpoint)) {
- try {
- if (breakpoint.isEnabled()) {
- breakpointAdded(breakpoint);
- } else {
- breakpointRemoved(breakpoint, null);
- }
- } catch (CoreException e) {
- }
- }
- }
-
- @Override
- public boolean canDisconnect() {
- // TODO implement disconnect
- return false;
- }
-
- @Override
- public void disconnect() throws DebugException {
- // TODO implement disconnect
- }
-
- @Override
- public boolean isDisconnected() {
- // TODO implement disconnect
- return false;
- }
-
- public boolean supportsStorageRetrieval() {
- return false;
- }
-
- public IMemoryBlock getMemoryBlock(long startAddress, long length)
- throws DebugException {
- return null;
- }
-
- private void ready() {
- fireCreationEvent();
- installDeferredBreakpoints();
- try {
- sendRequest(DebugConstants.REQUEST_START);
- } catch (DebugException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Install breakpoints that are already registered with the breakpoint
- * manager.
- */
- private void installDeferredBreakpoints() {
- IBreakpoint[] breakpoints = DebugPlugin.getDefault()
- .getBreakpointManager().getBreakpoints(
- IXSLConstants.ID_XSL_DEBUG_MODEL);
- for (IBreakpoint element : breakpoints) {
- breakpointAdded(element);
- }
- }
-
- private void terminated() {
- suspended = true;
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- threads = new IThread[0];
- fireTerminateEvent();
- }
-
- /**
- * Returns the current stack frames in the target.
- */
- public IStackFrame[] getStackFrames() throws DebugException {
- synchronized (STACK_FRAMES_LOCK) {
- if (stale) {
- stale = false;
- String framesData = sendRequest(DebugConstants.REQUEST_STACK);
- String[] frames = framesData.split("\\$\\$\\$"); //$NON-NLS-1$
- IStackFrame[] sf = new IStackFrame[frames.length];
- List<IStackFrame> currentFrames = Arrays
- .asList(stackFramesCache);
- for (int i = 0; i < frames.length; i++) {
- String data = frames[i];
- XSLStackFrame frame = new XSLStackFrame(thread, data, i);
- int index;
- if ((index = currentFrames.indexOf(frame)) != -1) {
- XSLStackFrame curr = (XSLStackFrame) currentFrames
- .get(index);
- curr.setLineNumber(frame.getLineNumber());
- curr.setVariables(frame.getVariables());
- frame = curr;
- }
- sf[frames.length - i - 1] = frame;
- }
- stackFramesCache = sf;
- }
- return stackFramesCache;
- }
- }
-
- private void ressetStackFramesCache() {
- stale = true;
- synchronized (VALUE_MAP_LOCK) {
- valueMapCache.clear();
- }
- }
-
- /**
- * Single step the interpreter.
- */
- public void stepOver() throws DebugException {
- sendRequest(DebugConstants.REQUEST_STEP_OVER);
- }
-
- public void stepInto() throws DebugException {
- sendRequest(DebugConstants.REQUEST_STEP_INTO);
- }
-
- public void stepReturn() throws DebugException {
- sendRequest(DebugConstants.REQUEST_STEP_RETURN);
- }
-
- public XSLVariable getVariable(int varId) throws DebugException {
- synchronized (variableMapCache) {
- XSLVariable var = variableMapCache.get(varId);
- if (var == null) {
- var = new XSLVariable(this, varId);
- String res = sendRequest(DebugConstants.REQUEST_VARIABLE
- + " " + varId); //$NON-NLS-1$
- String[] data = res.split("&"); //$NON-NLS-1$
- var.setScope(data[0]);
- var.setName(data[1]);
- variableMapCache.put(varId, var);
- }
- return var;
- }
- }
-
- public IValue getVariableValue(XSLVariable variable) throws DebugException {
- synchronized (VALUE_MAP_LOCK) {
- XSLValue value = valueMapCache.get(variable);
- if (value == null) {
- if (isSuspended()) {
- String res = sendRequest(DebugConstants.REQUEST_VALUE
- + " " + variable.getId()); //$NON-NLS-1$
- String[] data = res.split("&"); //$NON-NLS-1$
- String type = data[0];
- String theval;
- if (data.length > 1)
- theval = data[1];
- else
- theval = ""; //$NON-NLS-1$
- value = new XSLValue(this, type, theval);
- valueMapCache.put(variable, value);
- } else {
- // anything as long as not null!
- value = new XSLValue(this, "G", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return value;
- }
- }
-
- private String sendRequest(String request) throws DebugException {
- String response = null;
- synchronized (WRITE_LOCK) {
-// if (Debug.debugLauncher) {
-// System.out.println("REQUEST: " + request);
-// }
- requestWriter.println(request);
- requestWriter.flush();
- try {
- // wait for response
- response = requestReader.readLine();
-// if (Debug.debugLauncher) {
-// System.out.println("RESPONSE: " + response);
-// }
- } catch (IOException e) {
- abort(Messages.XSLDebugTarget_19 + request, e);
- }
- }
- return response;
- }
-
- private void breakpointHit(String event) {
- // determine which breakpoint was hit, and set the thread's breakpoint
- int lastSpace = event.lastIndexOf(' ');
- if (lastSpace > 0) {
- String line = event.substring(lastSpace + 1);
- int lineNumber = Integer.parseInt(line);
- IBreakpoint[] breakpoints = DebugPlugin.getDefault()
- .getBreakpointManager().getBreakpoints(
- IXSLConstants.ID_XSL_DEBUG_MODEL);
- for (IBreakpoint breakpoint : breakpoints) {
- if (supportsBreakpoint(breakpoint)) {
- if (breakpoint instanceof ILineBreakpoint) {
- ILineBreakpoint lineBreakpoint = (ILineBreakpoint) breakpoint;
- try {
- if (lineBreakpoint.getLineNumber() == lineNumber) {
- thread
- .setBreakpoints(new IBreakpoint[] { breakpoint });
- break;
- }
- } catch (CoreException e) {
- }
- }
- }
- }
- }
- suspended(DebugEvent.BREAKPOINT);
- }
-
- private class EventDispatchJob extends Job {
-
- public EventDispatchJob() {
- super(Messages.XSLDebugTarget_20);
- setSystem(true);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- String event = ""; //$NON-NLS-1$
- while (!isTerminated() && event != null) {
- try {
- event = eventReader.readLine();
- if (event != null) {
- thread.setBreakpoints(null);
- thread.setStepping(false);
- if (event.equals("ready")) //$NON-NLS-1$
- {
- ready();
- } else if (event.equals("stopped")) //$NON-NLS-1$
- {
- try {
- terminate();
- } catch (DebugException e) {
- }
- } else if (event.equals("terminated")) //$NON-NLS-1$
- {
- terminated();
- } else if (event.startsWith("resumed")) //$NON-NLS-1$
- {
- if (event.endsWith("step")) //$NON-NLS-1$
- {
- thread.setStepping(true);
- resumed(DebugEvent.STEP_OVER);
- } else if (event.endsWith("client")) //$NON-NLS-1$
- {
- resumed(DebugEvent.CLIENT_REQUEST);
- } else {
- debugEventMsg(event);
- }
- } else if (event.startsWith("suspended")) //$NON-NLS-1$
- {
- // clear down the frames so that they are re-fetched
- ressetStackFramesCache();
- if (event.endsWith("client")) //$NON-NLS-1$
- {
- suspended(DebugEvent.CLIENT_REQUEST);
- } else if (event.endsWith("step")) //$NON-NLS-1$
- {
- suspended(DebugEvent.STEP_END);
- } else if (event.indexOf("breakpoint") >= 0) //$NON-NLS-1$
- {
- breakpointHit(event);
- } else {
- debugEventMsg(event);
- }
- } else {
- debugEventMsg(event);
- }
- }
- } catch (IOException e) {
- terminated();
- }
- }
- return Status.OK_STATUS;
- }
-
- private void debugEventMsg(String event) {
-// if (Debug.debugLauncher) {
-// System.out.println("Did not understand event:" + event);
-// }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/.classpath b/bundles/org.eclipse.wst.xsl.launching/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.launching/.cvsignore b/bundles/org.eclipse.wst.xsl.launching/.cvsignore
deleted file mode 100644
index d4a255d..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-javaCompiler...args
-temp.folder
-@dot
diff --git a/bundles/org.eclipse.wst.xsl.launching/.project b/bundles/org.eclipse.wst.xsl.launching/.project
deleted file mode 100644
index f123aca..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.launching</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 3bacc8f..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu Jan 03 22:24:25 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2286d8a..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,25 +0,0 @@
-#Tue Feb 10 05:25:23 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index c1fc3ed..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,24 +0,0 @@
-#Wed Jul 30 20:56:56 BST 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-bundle-classpath-entries=0
-compilers.p.missing-packages=2
-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-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xsl.launching/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.launching/META-INF/MANIFEST.MF
deleted file mode 100644
index e36703b..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl.launching;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xsl.internal.launching.LaunchingPlugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xsl.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.osgi.util;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.eclipse.wst.xsl.internal.launching;x-internal:=true,
- org.eclipse.wst.xsl.launching,
- org.eclipse.wst.xsl.launching.config,
- org.eclipse.wst.xsl.launching.model
diff --git a/bundles/org.eclipse.wst.xsl.launching/about.html b/bundles/org.eclipse.wst.xsl.launching/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.launching/build.properties b/bundles/org.eclipse.wst.xsl.launching/build.properties
deleted file mode 100644
index 9a7834a..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- plugin.properties
-jars.compile.order = . \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.launching/plugin.properties b/bundles/org.eclipse.wst.xsl.launching/plugin.properties
deleted file mode 100644
index 99c515f..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/plugin.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.launching
-Bundle-Name.0 = XSL Transform Launching (Incubating)
-launchConfigurationType.name.0 = XSL
-sourceLocator.name.0 = XSLT Source Lookup Director
-extension-point.name.0 = XSLT Processor Invoker
-extension-point.name.1 = XSLT Processor Type
-extension-point.name.2 = XSLT Processor
-extension-point.name.3 = XSLT Debugger
-Bundle-Vendor.0 = Eclipse.org \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.launching/plugin.xml b/bundles/org.eclipse.wst.xsl.launching/plugin.xml
deleted file mode 100644
index cbb1e6a..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/plugin.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- sourceLocatorId="org.eclipse.wst.xsl.launching.sourceLookupDirector"
- sourcePathComputerId="org.eclipse.wst.xsl.launching.sourcePathComputer"
- id="org.eclipse.wst.xsl.launching.launchConfigurationType"
- name="%launchConfigurationType.name.0" />
- </extension>
-
- <extension
- point="org.eclipse.debug.core.sourceLocators">
- <sourceLocator
- name="%sourceLocator.name.0"
- class="org.eclipse.wst.xsl.internal.launching.XSLTSourceLookupDirector"
- id="org.eclipse.wst.xsl.launching.sourceLookupDirector">
- </sourceLocator>
- </extension>
-
- <extension
- point="org.eclipse.debug.core.sourcePathComputers">
- <sourcePathComputer
- class="org.eclipse.wst.xsl.internal.launching.XSLTSourcePathComputerDelegate"
- id="org.eclipse.wst.xsl.launching.sourcePathComputer">
- </sourcePathComputer>
- </extension>
-
- <extension
- point="org.eclipse.debug.core.breakpoints">
- <breakpoint
- id="xslLineBreakpoint"
- markerType="org.eclipse.wst.xsl.launching.xslLineBreakpointMarker"
- class="org.eclipse.wst.xsl.launching.model.XSLLineBreakpoint">
- </breakpoint>
- </extension>
-
- <extension
- id="xslLineBreakpointMarker"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.debug.core.lineBreakpointMarker">
- </super>
- <persistent
- value="true">
- </persistent>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/LaunchingPlugin.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/LaunchingPlugin.java
deleted file mode 100644
index d8abb17..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/LaunchingPlugin.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.launching;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class LaunchingPlugin extends Plugin
-{
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.xsl.launching"; //$NON-NLS-1$
-
- // The shared instance
- private static LaunchingPlugin plugin;
-
- /**
- * The constructor
- */
- public LaunchingPlugin()
- {
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static LaunchingPlugin getDefault()
- {
- return plugin;
- }
-
- public static void log(Exception e)
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, "", e)); //$NON-NLS-1$
- }
-
- public static void log(CoreException e)
- {
- getDefault().getLog().log(e.getStatus());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Messages.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Messages.java
deleted file mode 100644
index 362e3a8..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Messages.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.xsl.internal.launching;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.internal.launching.messages"; //$NON-NLS-1$
-
- public static String Utils_0;
- public static String Utils_1;
-
- public static String XSLLineBreakpoint_0;
- public static String XSLStackFrame_5;
-
- private Messages() {
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Utils.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Utils.java
deleted file mode 100644
index 014425a..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/Utils.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.wst.xsl.internal.launching;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-public class Utils
-{
-
- public static String getFileLocation(String bundleId, String path) throws CoreException
- {
- String location = null;
- try
- {
- URL url = FileLocator.find(Platform.getBundle(bundleId), new Path(path), null);
- if (url != null)
- {
- URL fileUrl = FileLocator.toFileURL(url);
- File file = new File(fileUrl.getFile());
- location = file.getAbsolutePath();
- }
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Utils_0 + path + Messages.Utils_1 + bundleId, e));
- }
- return location;
- }
-
- public static String getPluginLocation(String bundleId) throws CoreException
- {
- String location = null;
- try
- {
- URL url = new URL("platform:/plugin/"+bundleId);
- if (url != null)
- {
- URL fileUrl = FileLocator.toFileURL(url);
- File file = new File(fileUrl.getFile());
- location = file.getAbsolutePath();
- }
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Utils_0 + bundleId + Messages.Utils_1 + bundleId, e));
- }
- return location;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLPropertyTester.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLPropertyTester.java
deleted file mode 100644
index 12dd6b3..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLPropertyTester.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.launching;
-
-import org.eclipse.core.expressions.PropertyTester;
-
-public class XSLPropertyTester extends PropertyTester
-{
- public boolean test(Object arg0, String arg1, Object[] arg2, Object arg3)
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupDirector.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupDirector.java
deleted file mode 100644
index ea3e73c..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupDirector.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.launching;
-
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
-
-public class XSLTSourceLookupDirector extends AbstractSourceLookupDirector
-{
- public void initializeParticipants()
- {
- addParticipants(new ISourceLookupParticipant[]{ new XSLTSourceLookupParticipant() });
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupParticipant.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupParticipant.java
deleted file mode 100644
index 2e23289..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourceLookupParticipant.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.launching;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant;
-import org.eclipse.wst.xsl.launching.model.XSLStackFrame;
-
-/**
- * Translate a stack frame into a source file name
- */
-public class XSLTSourceLookupParticipant extends AbstractSourceLookupParticipant
-{
- public String getSourceName(Object object) throws CoreException
- {
- if (object instanceof XSLStackFrame)
- {
- return ((XSLStackFrame) object).getSourceName();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourcePathComputerDelegate.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourcePathComputerDelegate.java
deleted file mode 100644
index 7509a80..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/XSLTSourcePathComputerDelegate.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.internal.launching;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
-import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.launching.config.LaunchPipeline;
-import org.eclipse.wst.xsl.launching.config.LaunchTransform;
-
-public class XSLTSourcePathComputerDelegate implements ISourcePathComputerDelegate
-{
- public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException
- {
- List<ISourceContainer> containers = new ArrayList<ISourceContainer>();
-
- String sourceFileExpr = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null);
- IPath sourceFile = getSubstitutedPath(sourceFileExpr);
- LaunchPipeline pipeline = hydratePipeline(configuration);
-
- // TODO have some way of knowing whether it is an IResource or not
- containers.add(new DirectorySourceContainer(sourceFile, false));
-
- for (Iterator<?> iter = pipeline.getTransformDefs().iterator(); iter.hasNext();)
- {
- LaunchTransform transform = (LaunchTransform) iter.next();
- IPath path = transform.getPath();
- ISourceContainer sourceContainer = null;
- if (transform.getPathType().equals(LaunchTransform.RESOURCE_TYPE))
- {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
- IContainer container = resource.getParent();
- if (container.getType() == IResource.PROJECT)
- {
- sourceContainer = new ProjectSourceContainer((IProject) container, false);
- }
- else if (container.getType() == IResource.FOLDER)
- {
- sourceContainer = new FolderSourceContainer(container, false);
- }
- }
- else
- {
- sourceContainer = new DirectorySourceContainer(path, false);
- }
- containers.add(sourceContainer);
- }
-
- // if (sourceContainer == null)
- // {
- // sourceContainer = new WorkspaceSourceContainer();
- // }
-
- return containers.toArray(new ISourceContainer[0]);
- }
-
- private static LaunchPipeline hydratePipeline(ILaunchConfiguration configuration) throws CoreException
- {
- LaunchPipeline pipeline = null;
- String s = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_PIPELINE, (String) null);
- if (s != null && s.length() > 0)
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
- pipeline = LaunchPipeline.fromXML(inputStream);
- }
- return pipeline;
- }
-
- private static IPath getSubstitutedPath(String path) throws CoreException
- {
- if (path != null)
- {
- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(path);
- return new Path(path);
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/messages.properties b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/messages.properties
deleted file mode 100644
index 47111ff..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/internal/launching/messages.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-Utils_0=Error determining jar file location:
-Utils_1=\ from bundle:
-XSLDebugTarget_0=Unable to connect to debugger
-XSLDebugTarget_1=localhost
-XSLDebugTarget_19=Request failed:
-XSLDebugTarget_2=Could not connect to socket
-XSLDebugTarget_20=Event Dispatch
-XSLDebugTarget_3=\ after
-XSLDebugTarget_4=\ attempts
-XSLLineBreakpoint_0=Line Breakpoint:
-XSLStackFrame_5=\ line: \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLLaunchConfigurationConstants.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLLaunchConfigurationConstants.java
deleted file mode 100644
index 3c4904d..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLLaunchConfigurationConstants.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching;
-
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-
-public class XSLLaunchConfigurationConstants
-{
- public static final String ATTR_INPUT_FILE = LaunchingPlugin.PLUGIN_ID + ".ATTR_INPUT_FILE"; //$NON-NLS-1$
- public static final String ATTR_USE_DEFAULT_OUTPUT_FILE = LaunchingPlugin.PLUGIN_ID + ".ATTR_USE_DEFAULT_OUTPUT_FILE"; //$NON-NLS-1$
-
- /**
- * @since 1.0
- */
- public static final String ATTR_OUTPUT_FOLDER = LaunchingPlugin.PLUGIN_ID + ".ATTR_OUTPUT_FOLDER"; //$NON-NLS-1$
-
- /**
- * @since 1.0
- */
- public static final String ATTR_OUTPUT_FILENAME = LaunchingPlugin.PLUGIN_ID + ".ATTR_OUTPUT_FILENAME"; //$NON-NLS-1$
- public static final String ID_LAUNCH_CONFIG_TYPE = LaunchingPlugin.PLUGIN_ID + ".launchConfigurationType"; //$NON-NLS-1$
- public static final String ATTR_PIPELINE = LaunchingPlugin.PLUGIN_ID + ".ATTR_PIPELINE"; //$NON-NLS-1$
- public static final String ATTR_OPEN_FILE = LaunchingPlugin.PLUGIN_ID + ".ATTR_OPEN_FILE"; //$NON-NLS-1$
-
- /**
- * @since 1.0
- */
- public static final String ATTR_FORMAT_FILE = LaunchingPlugin.PLUGIN_ID + ".ATTR_FORMAT_FILE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLTRuntime.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLTRuntime.java
deleted file mode 100644
index 24c76da..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/XSLTRuntime.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-
-public class XSLTRuntime
-{
- private static byte[] NEXT_ID_LOCK = new byte[0];
- private static byte[] REGISTRY_LOCK = new byte[0];
-
- private static int lastStandinID;
-
- private static void savePreferences()
- {
- LaunchingPlugin.getDefault().savePluginPreferences();
- }
-
- private static Preferences getPreferences()
- {
- return LaunchingPlugin.getDefault().getPluginPreferences();
- }
-
- /**
- * Creates a default Output File for the given input file string.
- * @return Returns an IPath for the Output File.
- * @since 1.0
- */
- public static IPath defaultOutputFileForInputFile(String inputFileExpression) throws CoreException
- {
- String file = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(inputFileExpression);
- IPath inputFilePath = new Path(file);
- inputFilePath = inputFilePath.removeFileExtension();
- inputFilePath = inputFilePath.addFileExtension("out.xml");
- return inputFilePath;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/BaseLaunchHelper.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/BaseLaunchHelper.java
deleted file mode 100644
index e8ab855..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/BaseLaunchHelper.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.config;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.ServerSocket;
-import java.net.URL;
-
-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.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-import org.eclipse.wst.xsl.launching.XSLLaunchConfigurationConstants;
-import org.eclipse.wst.xsl.launching.XSLTRuntime;
-
-/**
- * @since 1.0
- */
-public class BaseLaunchHelper
-{
- private final URL source;
- private final File target;
- protected final LaunchPipeline pipeline;
- private int requestPort = -1;
- private int eventPort = -1;
- private int generatePort = -1;
- private final boolean openFileOnCompletion;
- private final boolean formatFileOnCompletion;
-
- public BaseLaunchHelper(ILaunchConfiguration configuration) throws CoreException
- {
- source = hydrateSourceFileURL(configuration);
- target = hydrateOutputFile(configuration);
- pipeline = hydratePipeline(configuration);
- openFileOnCompletion = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OPEN_FILE, true);
- formatFileOnCompletion = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_FORMAT_FILE, false);
- }
-
- public int getRequestPort()
- {
- if (requestPort == -1)
- requestPort = findFreePort();
- return requestPort;
- }
-
- public int getEventPort()
- {
- if (eventPort == -1)
- eventPort = findFreePort();
- return eventPort;
- }
-
- public int getGeneratePort()
- {
- if (generatePort == -1)
- generatePort = findFreePort();
- return generatePort;
- }
-
- public LaunchPipeline getPipeline()
- {
- return pipeline;
- }
-
- public URL getSource()
- {
- return source;
- }
-
- public File getTarget()
- {
- return target;
- }
-
- private static LaunchPipeline hydratePipeline(ILaunchConfiguration configuration) throws CoreException
- {
- LaunchPipeline pipeline = null;
- String s = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_PIPELINE, (String) null);
- if (s != null && s.length() > 0)
- {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes());
- pipeline = LaunchPipeline.fromXML(inputStream);
- }
- return pipeline;
- }
-
- public static URL hydrateSourceFileURL(ILaunchConfiguration configuration) throws CoreException
- {
- IPath sourceFile = hydrateSourceFile(configuration);
- return pathToURL(sourceFile);
- }
-
- private static IPath hydrateSourceFile(ILaunchConfiguration configuration) throws CoreException
- {
- String sourceFileExpr = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null);
- return getSubstitutedPath(sourceFileExpr);
- }
-
- protected static URL pathToURL(IPath sourceFile) throws CoreException
- {
- URL url = null;
- try
- {
- url = sourceFile.toFile().toURL();
- }
- catch (MalformedURLException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, sourceFile.toString(), e));
- }
- return url;
- }
-
- public static File hydrateOutputFile(ILaunchConfiguration configuration) throws CoreException
- {
- IPath outputFile = null;
- boolean useDefaultOutputFile = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_USE_DEFAULT_OUTPUT_FILE, true);
- if (!useDefaultOutputFile)
- {
- String outputFileName = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FILENAME, (String) null);
- String outputFolderExpr = configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_OUTPUT_FOLDER, (String) null);
- outputFile = getSubstitutedPath(outputFolderExpr).append(outputFileName);
- }
- else
- {
- outputFile = XSLTRuntime.defaultOutputFileForInputFile(configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_INPUT_FILE, (String) null));
- }
- return outputFile.toFile();
- }
-
- private static IPath getSubstitutedPath(String path) throws CoreException
- {
- if (path != null)
- {
- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(path);
- return new Path(path);
- }
- return null;
- }
-
- /**
- * Returns a free port number on localhost, or -1 if unable to find a free
- * port.
- *
- * @return a free port number on localhost, or -1 if unable to find a free
- * port
- */
- public static int findFreePort()
- {
- ServerSocket socket = null;
- try
- {
- socket = new ServerSocket(0);
- return socket.getLocalPort();
- }
- catch (IOException e)
- {
- LaunchingPlugin.log(e);
- }
- finally
- {
- if (socket != null)
- {
- try
- {
- socket.close();
- }
- catch (IOException e)
- {
- LaunchingPlugin.log(e);
- }
- }
- }
- return -1;
- }
-
- public boolean getOpenFileOnCompletion()
- {
- return openFileOnCompletion;
- }
-
-
- public boolean getFormatFileOnCompletion()
- {
- return formatFileOnCompletion;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchAttribute.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchAttribute.java
deleted file mode 100644
index 26f1c9d..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchAttribute.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.config;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.variables.VariablesPlugin;
-
-public class LaunchAttribute
-{
- public final String uri;
- public String type;
- public String value;
-
- public LaunchAttribute(String uri, String type, String value)
- {
- this.uri = uri;
- this.type = type;
- this.value = value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public String getResolvedValue() throws CoreException
- {
- return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
- }
-
- @Override
- public int hashCode()
- {
- return uri.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof LaunchAttribute)
- {
- LaunchAttribute att = (LaunchAttribute) obj;
- return att.uri.equals(uri);
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchPipeline.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchPipeline.java
deleted file mode 100644
index fe4ca39..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchPipeline.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.config;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-public class LaunchPipeline
-{
- private List<LaunchTransform> transformDefs = new ArrayList<LaunchTransform>();
- private final Properties outputProperties = new Properties();
-
- public Properties getOutputProperties()
- {
- return outputProperties;
- }
-
- public void addOutputProperty(String name, String value)
- {
- outputProperties.put(name, value);
- }
-
- public List<LaunchTransform> getTransformDefs()
- {
- return transformDefs;
- }
-
- public void setTransformDefs(List<LaunchTransform> transforms)
- {
- transformDefs = transforms;
- }
-
- public void addTransformDef(LaunchTransform tdef)
- {
- tdef.setPipeline(this);
- transformDefs.add(tdef);
- }
-
- public void removeTransformDef(LaunchTransform tdef)
- {
- transformDefs.remove(tdef);
- }
-
- public String toXML() throws CoreException
- {
- String xml = null;
- try
- {
- Document doc = PreferenceUtil.getDocument();
- Element rootEl = doc.createElement("Pipeline"); //$NON-NLS-1$
- doc.appendChild(rootEl);
-
- Element opEl = doc.createElement("OutputProperties"); //$NON-NLS-1$
- rootEl.appendChild(opEl);
- for (Object element : outputProperties.entrySet())
- {
- Map.Entry entry = (Map.Entry) element;
- Element propEl = doc.createElement("Property"); //$NON-NLS-1$
- propEl.setAttribute("name", (String) entry.getKey()); //$NON-NLS-1$
- propEl.setAttribute("value", (String) entry.getValue()); //$NON-NLS-1$
- opEl.appendChild(propEl);
- }
-
- for (Iterator<LaunchTransform> iter = transformDefs.iterator(); iter.hasNext();)
- {
- LaunchTransform tdef = iter.next();
- Element tdefEl = tdef.asXML(doc);
- rootEl.appendChild(tdefEl);
- }
-
- xml = PreferenceUtil.serializeDocument(doc);
- }
- catch (DOMException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
- catch (ParserConfigurationException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
- catch (TransformerException e)
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
- return xml;
- }
-
- public static LaunchPipeline fromXML(InputStream inputStream) throws CoreException
- {
- Document doc = PreferenceUtil.getDocument(inputStream);
-
- LaunchPipeline pdef = new LaunchPipeline();
-
- Element rootEl = doc.getDocumentElement();
-
- Element opEl = (Element) rootEl.getElementsByTagName("OutputProperties").item(0); //$NON-NLS-1$
- if (opEl != null)
- {
- NodeList propEls = opEl.getElementsByTagName("Property"); //$NON-NLS-1$
- for (int i = 0; i < propEls.getLength(); i++)
- {
- Element propEl = (Element) propEls.item(i);
- String name = propEl.getAttribute("name"); //$NON-NLS-1$
- String value = propEl.getAttribute("value"); //$NON-NLS-1$
- pdef.addOutputProperty(name, value);
- }
- }
-
- NodeList transformEls = rootEl.getElementsByTagName("Transform"); //$NON-NLS-1$
- for (int i = 0; i < transformEls.getLength(); i++)
- {
- Element transformEl = (Element) transformEls.item(i);
- LaunchTransform tdef = LaunchTransform.fromXML(transformEl);
- pdef.addTransformDef(tdef);
- }
-
- return pdef;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchTransform.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchTransform.java
deleted file mode 100644
index da2528a..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchTransform.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.config;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-public class LaunchTransform
-{
- public static final String RESOURCE_TYPE = "resource"; //$NON-NLS-1$
- public static final String EXTERNAL_TYPE = "external"; //$NON-NLS-1$
-
- private final String stylesheet;
- private final String pathType;
- private String resolver;
- private final Set<LaunchAttribute> parameters = new HashSet<LaunchAttribute>();
- private LaunchPipeline pipeline;
-
- /**
- * The path may be an IResource to a file in the workspace, or an IPath to a
- * file outside of the workspace - depending on the pathType. The path
- * should be created using IPath.toPortableString(). The path may also
- * contain variables defined by the VariablePlugin.
- *
- * @param path
- * @param pathType
- */
- public LaunchTransform(String path, String pathType)
- {
- stylesheet = path;
- this.pathType = pathType;
- }
-
- public Set<LaunchAttribute> getParameters()
- {
- return parameters;
- }
-
- public void addParameter(LaunchAttribute parameter)
- {
- parameters.add(parameter);
- }
-
- public String getResolver()
- {
- return resolver;
- }
-
- public void setResolver(String resolver)
- {
- this.resolver = resolver;
- }
-
- public IPath getPath() throws CoreException
- {
- String substitutedValue = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(stylesheet);
- return Path.fromPortableString(substitutedValue);
- }
-
- public String getPathType()
- {
- return pathType;
- }
-
- /**
- * The full path to the file in the local file system (with any string
- * subsitutions already made).
- *
- * @return
- * @throws CoreException
- */
- public IPath getLocation() throws CoreException
- {
- IPath partialPath = getPath();
- IPath fullPath = null;
- if (RESOURCE_TYPE.equals(pathType))
- {
- IFile file = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember(partialPath);
- fullPath = file.getLocation();
- }
- else if (EXTERNAL_TYPE.equals(pathType))
- {
- fullPath = partialPath;
- }
- return fullPath;
- }
-
- public Element asXML(Document doc)
- {
- Element tdefEl = doc.createElement("Transform"); //$NON-NLS-1$
- tdefEl.setAttribute("path", stylesheet); //$NON-NLS-1$
- tdefEl.setAttribute("pathType", pathType); //$NON-NLS-1$
- if (resolver != null)
- tdefEl.setAttribute("uriResolver", resolver); //$NON-NLS-1$
- Element paramsEl = doc.createElement("Parameters"); //$NON-NLS-1$
- tdefEl.appendChild(paramsEl);
- for (Iterator<LaunchAttribute> iter = parameters.iterator(); iter.hasNext();)
- {
- LaunchAttribute param = iter.next();
- Element propEl = doc.createElement("Parameter"); //$NON-NLS-1$
- propEl.setAttribute("name", param.uri); //$NON-NLS-1$
- propEl.setAttribute("value", param.value); //$NON-NLS-1$
- paramsEl.appendChild(propEl);
- }
- return tdefEl;
- }
-
- public static LaunchTransform fromXML(Element transformEl)
- {
- String path = transformEl.getAttribute("path"); //$NON-NLS-1$
- String pathType = transformEl.getAttribute("pathType"); //$NON-NLS-1$
-
- LaunchTransform tdef = new LaunchTransform(path, pathType);
-
- String uriResolver = transformEl.getAttribute("uriResolver"); //$NON-NLS-1$
- tdef.setResolver(uriResolver);
-
- Element paramsEl = (Element) transformEl.getElementsByTagName("Parameters").item(0); //$NON-NLS-1$
- NodeList paramEls = paramsEl.getElementsByTagName("Parameter"); //$NON-NLS-1$
- for (int i = 0; i < paramEls.getLength(); i++)
- {
- Element paramEl = (Element) paramEls.item(i);
- String name = paramEl.getAttribute("name"); //$NON-NLS-1$
- String type = paramEl.getAttribute("type"); //$NON-NLS-1$
- String value = paramEl.getAttribute("value"); //$NON-NLS-1$
- tdef.addParameter(new LaunchAttribute(name, type, value));
- }
-
- return tdef;
- }
-
- public void setPipeline(LaunchPipeline pipeline)
- {
- this.pipeline = pipeline;
- }
-
- public LaunchPipeline getPipeline()
- {
- return pipeline;
- }
-
- /*
- * private File getURIResolverDirectory(ILaunchConfiguration configuration)
- * throws CoreException { File resolverDir = null; String baseURIType =
- * configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_BASE_URI_TYPE,
- * XSLLaunchConfigurationConstants.BASE_URI_WORKING_DIR_RELATIVE); if
- * (XSLLaunchConfigurationConstants.BASE_URI_ABSOLUTE.equals(baseURIType)) {
- * String uriDir =
- * configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_BASE_URI_DIRECTORY,
- * (String)null); if (uriDir!=null) { String pathExpr =
- * VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(uriDir);
- * Path path = new Path(pathExpr); if (path.isAbsolute()) { File dir = new
- * File(path.toOSString()); if (dir.isDirectory() && dir.exists()) { return
- * dir; } // This may be a workspace relative path returned by a variable. //
- * However variable paths start with a slash and thus are thought to // be
- * absolute, so fall through to below } IResource res =
- * ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (res
- * instanceof IContainer && res.exists()) return res.getLocation().toFile();
- * abort("URI path is invalid",null,0); } } else if
- * (XSLLaunchConfigurationConstants.BASE_URI_STYLESHEET_RELATIVE.equals(baseURIType)) {
- * resolverDir = getStylesheetRelativeURIResolver(configuration); } // no
- * need to handle the case of working_dir relative - this is the default for
- * JAXP so return null return resolverDir; }
- *
- * private File getStylesheetRelativeURIResolver(ILaunchConfiguration
- * configuration) throws CoreException { List stylesheets =
- * configuration.getAttribute(XSLLaunchConfigurationConstants.ATTR_STYLESHEETS_LIST,(List)null);
- * if (stylesheets == null || stylesheets.size() == 0) abort("No stylesheets
- * defined for this launch configuration", null, 0); else { String sheet =
- * (String)stylesheets.get(0); String pathExpr =
- * VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(sheet);
- * Path path = new Path(pathExpr); if (path.isAbsolute()) { File file = new
- * File(path.toOSString()); if (file.exists()) { File dir =
- * file.getParentFile(); return dir; } // This may be a workspace relative
- * path returned by a variable. // However variable paths start with a slash
- * and thus are thought to // be absolute IResource res =
- * ResourcesPlugin.getWorkspace().getRoot().findMember(path); IContainer
- * parent = res.getParent(); if (parent.exists()) return
- * parent.getLocation().toFile(); abort("Stylesheet path is
- * invalid",null,0); } else { IResource res =
- * ResourcesPlugin.getWorkspace().getRoot().findMember(path); IContainer
- * parent = res.getParent(); if (parent.exists()) return
- * parent.getLocation().toFile(); abort("Stylesheet path is
- * invalid",null,0); } } return null; }
- */
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/PreferenceUtil.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/PreferenceUtil.java
deleted file mode 100644
index 00ec0d6..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/PreferenceUtil.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.config;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * @since 1.0
- */
-public class PreferenceUtil
-{
-
- public static void createCoreException(Throwable e) throws CoreException
- {
- throw new CoreException(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
-
- public static Document getDocument() throws ParserConfigurationException
- {
- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Document doc = docBuilder.newDocument();
- return doc;
- }
-
- public static String serializeDocument(Document doc) throws IOException, TransformerException
- {
- ByteArrayOutputStream s = new ByteArrayOutputStream();
-
- TransformerFactory factory = TransformerFactory.newInstance();
- Transformer transformer = factory.newTransformer();
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-
- DOMSource source = new DOMSource(doc);
- StreamResult outputTarget = new StreamResult(s);
- transformer.transform(source, outputTarget);
-
- return s.toString("UTF8"); //$NON-NLS-1$
- }
-
- public static Element[] getChildElements(Element parent, String name)
- {
- List<Element> children = new ArrayList<Element>();
- NodeList list = parent.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i)
- {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE)
- {
- Element processorElement = (Element) node;
- if (processorElement.getNodeName().equals(name))
- {
- children.add(processorElement);
- }
- }
- }
- return children.toArray(new Element[0]);
- }
-
- public static String getNodeText(Node node)
- {
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE:
- NodeList childNodes = node.getChildNodes();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < childNodes.getLength(); i++)
- {
- Node child = childNodes.item(i);
- if (child.getNodeType() == Node.TEXT_NODE)
- {
- sb.append(child.getNodeValue());
- }
- }
- return sb.toString();
- case Node.TEXT_NODE:
- case Node.ATTRIBUTE_NODE:
- default:
- return node.getNodeValue();
- }
- }
-
- public static Document getDocument(InputStream stream) throws CoreException
- {
- Document doc = null;
- try
- {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
- doc = parser.parse(new InputSource(stream));
- }
- catch (SAXException e)
- {
- PreferenceUtil.createCoreException(e);
- }
- catch (IOException e)
- {
- PreferenceUtil.createCoreException(e);
- }
- catch (ParserConfigurationException e)
- {
- PreferenceUtil.createCoreException(e);
- }
- catch (FactoryConfigurationError e)
- {
- PreferenceUtil.createCoreException(e);
- }
- finally
- {
- try
- {
- stream.close();
- }
- catch (IOException e)
- {
- PreferenceUtil.createCoreException(e);
- }
- }
- return doc;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLConstants.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLConstants.java
deleted file mode 100644
index 1fa47da..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLConstants.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-public interface IXSLConstants
-{
-
- public static final String ID_XSL_DEBUG_MODEL = "org.eclipse.wst.xsl.launching.XSLDebugModel"; //$NON-NLS-1$
- public static final String MARKER_ID = "org.eclipse.wst.xsl.launching.xslLineBreakpointMarker"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLDebugTarget.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLDebugTarget.java
deleted file mode 100644
index 3e9e554..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/IXSLDebugTarget.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IValue;
-
-public interface IXSLDebugTarget extends IDebugTarget
-{
- XSLVariable getVariable(int varId) throws DebugException;
-
- IStackFrame[] getStackFrames() throws DebugException;
-
- void stepInto() throws DebugException;
-
- void stepOver() throws DebugException;
-
- void stepReturn() throws DebugException;
-
- IValue getVariableValue(XSLVariable variable) throws DebugException;
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/NodeListVariable.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/NodeListVariable.java
deleted file mode 100644
index 4571a17..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/NodeListVariable.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 STAR and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 214235 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.w3c.dom.Node;
-
-/**
- * NodeListVariable represents a XSL Nodeset. This is typically a group of nodes that
- * matched a particular XPath expression, and are stored in an XSLT variable.
- *
- * @since 1.0
- */
-public class NodeListVariable extends XSLDebugElement implements IVariable {
-
- private Node node = null;
-
- private IDebugTarget debugTarget;
-
- public NodeListVariable(IDebugTarget target, Node nodeListNode) {
- super(target);
- node = nodeListNode;
- debugTarget = target;
- }
-
- public String getName() throws DebugException {
- // TODO Auto-generated method stub
- String nodeName = "";
- if (node.getPrefix() != null) {
- nodeName = nodeName + node.getPrefix() + ":";
- }
- if (node.getNodeName() != null) {
- nodeName = nodeName + node.getNodeName();
- }
- return nodeName;
- }
-
- public String getReferenceTypeName() throws DebugException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IValue getValue() throws DebugException {
- String nodeValue = "";
- if (node.getNodeValue() != null) {
- nodeValue = node.getNodeValue();
- }
- //IValue value = new XSLValue(debugTarget, "string", nodeValue);
- IValue value = new XSLValue(debugTarget, "string", node);
- return value;
- }
-
- public boolean hasValueChanged() throws DebugException {
- return false;
- }
-
- public boolean supportsValueModification() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean verifyValue(String expression) throws DebugException {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean verifyValue(IValue value) throws DebugException {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void setValue(String expression) throws DebugException {
- // TODO Auto-generated method stub
-
- }
-
- public void setValue(IValue value) throws DebugException {
- // TODO Auto-generated method stub
-
- }
-
- public Node getNode() {
- return node;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugElement.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugElement.java
deleted file mode 100644
index 6f09f2f..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugElement.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.DebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IDisconnect;
-import org.eclipse.debug.core.model.ITerminate;
-
-public abstract class XSLDebugElement extends DebugElement implements IDisconnect
-{
- public XSLDebugElement(IDebugTarget target)
- {
- super(target);
- }
-
- public String getModelIdentifier()
- {
- return IXSLConstants.ID_XSL_DEBUG_MODEL;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == ITerminate.class) {
- return getDebugTarget();
- }
- return super.getAdapter(adapter);
- }
-
- public boolean canDisconnect()
- {
- return getDebugTarget().canDisconnect();
- }
-
- public void disconnect() throws DebugException
- {
- getDebugTarget().disconnect();
- }
-
- public boolean isDisconnected()
- {
- return getDebugTarget().isDisconnected();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLLineBreakpoint.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLLineBreakpoint.java
deleted file mode 100644
index 9ef5581..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLLineBreakpoint.java
+++ /dev/null
@@ -1,79 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Bjorn Freeman-Benson - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.LineBreakpoint;
-import org.eclipse.wst.xsl.internal.launching.Messages;
-
-public class XSLLineBreakpoint extends LineBreakpoint
-{
- private int lineNumber;
-
- public XSLLineBreakpoint()
- {
- }
-
- public XSLLineBreakpoint(final IResource resource, final int lineNumber, final int charStart, final int charEnd) throws CoreException
- {
- this.lineNumber = lineNumber;
- IWorkspaceRunnable runnable = new IWorkspaceRunnable()
- {
- public void run(IProgressMonitor monitor) throws CoreException
- {
- IMarker marker = resource.createMarker(IXSLConstants.MARKER_ID);
- setMarker(marker);
- marker.setAttribute(IBreakpoint.ID, getModelIdentifier());
- marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE);
- marker.setAttribute(IMarker.MESSAGE, Messages.XSLLineBreakpoint_0 + resource.getName() + " [line: " + lineNumber + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
- marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
- marker.setAttribute(IMarker.CHAR_START, new Integer(charStart));
- marker.setAttribute(IMarker.CHAR_END, new Integer(charEnd));
-
- register(true);
- }
- };
- run(getMarkerRule(resource), runnable);
- }
-
- @Override
- public int getLineNumber() throws CoreException
- {
- int line = super.getLineNumber();
- return line == -1 ? lineNumber : line;
- }
-
- protected void register(boolean register) throws CoreException
- {
- DebugPlugin plugin = DebugPlugin.getDefault();
- if (plugin != null && register)
- {
- plugin.getBreakpointManager().addBreakpoint(this);
- }
- else
- {
- setRegistered(false);
- }
- }
-
- public String getModelIdentifier()
- {
- return IXSLConstants.ID_XSL_DEBUG_MODEL;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLStackFrame.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLStackFrame.java
deleted file mode 100644
index 432600f..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLStackFrame.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.wst.xsl.internal.launching.LaunchingPlugin;
-import org.eclipse.wst.xsl.internal.launching.Messages;
-
-/**
- * XSL stack frame.
- */
-public class XSLStackFrame extends XSLDebugElement implements IStackFrame
-{
- private final XSLThread xslThread;
- private int id;
- private String name;
- private int lineNumber;
- private String xslFileName;
- private IVariable[] variables;
-
- public XSLStackFrame(XSLThread thread, String data, int index)
- {
- super(thread.getDebugTarget());
- this.xslThread = thread;
- init(data,(IXSLDebugTarget) thread.getDebugTarget());
- }
-
- private void init(String data,IXSLDebugTarget debugTarget)
- {
-
- String[] strings = data.split("\\|"); //$NON-NLS-1$
- String fileName = strings[0];
- try
- {
- URL url = new URL(fileName);
- Path p = new Path(url.getFile());
- xslFileName = (new Path(fileName)).lastSegment();
-
- String idString = strings[1];
- id = Integer.parseInt(idString);
- String pc = strings[2];
- lineNumber = Integer.parseInt(pc);
- String safename = strings[3];
-
- int theIndex;
- while ((theIndex = safename.indexOf("%@_PIPE_@%")) != -1) //$NON-NLS-1$
- {
- safename = safename.substring(0, theIndex) + "|" + safename.substring(theIndex + "%@_PIPE_@%".length(), safename.length()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- name = p.lastSegment() + " " + safename; //$NON-NLS-1$
-
- variables = new XSLVariable[strings.length-4];
- for (int i=0;i<variables.length;i++)
- {
- int varId = Integer.parseInt(strings[i+4]);
- try
- {
- XSLVariable var = debugTarget.getVariable(varId);
- variables[i] = var;
- }
- catch (DebugException e)
- {
- LaunchingPlugin.log(e);
- }
- }
- }
- catch (MalformedURLException e)
- {
- LaunchingPlugin.log(e);
- }
- }
-
- public IThread getThread()
- {
- return xslThread;
- }
-
- public IVariable[] getVariables() throws DebugException
- {
- return variables;
- }
-
- public boolean hasVariables() throws DebugException
- {
- return variables.length > 0;
- }
-
- public int getLineNumber() throws DebugException
- {
- return lineNumber;
- }
-
- public int getCharStart() throws DebugException
- {
- return -1;
- }
-
- public int getCharEnd() throws DebugException
- {
- return -1;
- }
-
- public String getName() throws DebugException
- {
- return name + Messages.XSLStackFrame_5 + lineNumber;
- }
-
- public IRegisterGroup[] getRegisterGroups() throws DebugException
- {
- return null;
- }
-
- public boolean hasRegisterGroups() throws DebugException
- {
- return false;
- }
-
- public boolean canStepInto()
- {
- return getThread().canStepInto();
- }
-
- public boolean canStepOver()
- {
- return getThread().canStepOver();
- }
-
- public boolean canStepReturn()
- {
- return getThread().canStepReturn();
- }
-
- public boolean isStepping()
- {
- return getThread().isStepping();
- }
-
- public void stepInto() throws DebugException
- {
- getThread().stepInto();
- }
-
- public void stepOver() throws DebugException
- {
- getThread().stepOver();
- }
-
- public void stepReturn() throws DebugException
- {
- getThread().stepReturn();
- }
-
- public boolean canResume()
- {
- return getThread().canResume();
- }
-
- public boolean canSuspend()
- {
- return getThread().canSuspend();
- }
-
- public boolean isSuspended()
- {
- return getThread().isSuspended();
- }
-
- public void resume() throws DebugException
- {
- getThread().resume();
- }
-
- public void suspend() throws DebugException
- {
- getThread().suspend();
- }
-
- public boolean canTerminate()
- {
- return getThread().canTerminate();
- }
-
- public boolean isTerminated()
- {
- return getThread().isTerminated();
- }
-
- public void terminate() throws DebugException
- {
- getThread().terminate();
- }
-
- /**
- * Returns the name of the source file this stack frame is associated with.
- */
- public String getSourceName()
- {
- return xslFileName;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof XSLStackFrame)
- {
- XSLStackFrame sf = (XSLStackFrame) obj;
- return sf.id == id;
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- return getSourceName().hashCode() + id;
- }
-
- protected int getIdentifier()
- {
- return id;
- }
-
- public void setLineNumber(int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
- public void setVariables(IVariable[] variables)
- {
- this.variables = variables;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLThread.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLThread.java
deleted file mode 100644
index e92f16e..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLThread.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-
-public class XSLThread extends XSLDebugElement implements IThread
-{
-
- /**
- * Breakpoints this thread is suspended at or <code>null</code> if none.
- */
- private IBreakpoint[] fBreakpoints;
-
- /**
- * Whether this thread is stepping
- */
- private boolean fStepping = false;
-
- /**
- * Constructs a new thread for the given target
- */
- public XSLThread(IDebugTarget target)
- {
- super(target);
- }
-
- public IStackFrame[] getStackFrames() throws DebugException
- {
- if (isSuspended())
- {
- return ((IXSLDebugTarget) getDebugTarget()).getStackFrames();
- }
- else
- {
- return new IStackFrame[0];
- }
- }
-
- public boolean hasStackFrames() throws DebugException
- {
- return isSuspended();
- }
-
- public int getPriority() throws DebugException
- {
- return 0;
- }
-
- public IStackFrame getTopStackFrame() throws DebugException
- {
- IStackFrame[] frames = getStackFrames();
- if (frames.length > 0)
- {
- return frames[0];
- }
- return null;
- }
-
- public String getName() throws DebugException
- {
- return "Thread[1]"; //$NON-NLS-1$
- }
-
- public IBreakpoint[] getBreakpoints()
- {
- if (fBreakpoints == null)
- {
- return new IBreakpoint[0];
- }
- return fBreakpoints;
- }
-
- /**
- * Sets the breakpoints this thread is suspended at, or <code>null</code>
- * if none.
- *
- * @param breakpoints
- * the breakpoints this thread is suspended at, or
- * <code>null</code> if none
- * @since 1.0
- */
- public void setBreakpoints(IBreakpoint[] breakpoints)
- {
- fBreakpoints = breakpoints;
- }
-
- public boolean canResume()
- {
- return isSuspended();
- }
-
- public boolean canSuspend()
- {
- return !isSuspended();
- }
-
- public boolean isSuspended()
- {
- return getDebugTarget().isSuspended();
- }
-
- public void resume() throws DebugException
- {
- getDebugTarget().resume();
- }
-
- public void suspend() throws DebugException
- {
- getDebugTarget().suspend();
- }
-
- public boolean canStepInto()
- {
- return isSuspended();
- }
-
- public boolean canStepOver()
- {
- return isSuspended();
- }
-
- public boolean canStepReturn()
- {
- return isSuspended();
- }
-
- public boolean isStepping()
- {
- return fStepping;
- }
-
- public void stepInto() throws DebugException
- {
- ((IXSLDebugTarget) getDebugTarget()).stepInto();
- }
-
- public void stepOver() throws DebugException
- {
- ((IXSLDebugTarget) getDebugTarget()).stepOver();
- }
-
- public void stepReturn() throws DebugException
- {
- ((IXSLDebugTarget) getDebugTarget()).stepReturn();
- }
-
- public boolean canTerminate()
- {
- return !isTerminated();
- }
-
- public boolean isTerminated()
- {
- return getDebugTarget().isTerminated();
- }
-
- public void terminate() throws DebugException
- {
- getDebugTarget().terminate();
- }
-
- /**
- * @since 1.0
- */
- public void setStepping(boolean stepping)
- {
- fStepping = stepping;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLValue.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLValue.java
deleted file mode 100644
index ee26faf..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLValue.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 214235 - Node List expansion
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-public class XSLValue extends XSLDebugElement implements IValue
-{
- private String fValue;
- private String type;
- private boolean hasVariables;
- private Node actualNode;
-
- /**
- * @since 1.0
- */
- public XSLValue(IDebugTarget target, String type, Node node) {
- super(target);
- actualNode = node;
- String value = "";
- if (node.getNodeValue() != null) {
- value = node.getNodeValue();
- }
- init(target, type, value);
- }
- public XSLValue(IDebugTarget target, String type, String value)
- {
- super(target);
- init(target, type, value);
- }
-
- private void init(IDebugTarget target, String type, String value) {
- this.type = type;
- fValue = value;
- }
-
-
-
- public String getReferenceTypeName() throws DebugException
- {
- return type;
- }
-
- public String getValueString() throws DebugException
- {
- if ("string".equals(type)) //$NON-NLS-1$
- return "'"+fValue+"'"; //$NON-NLS-1$ //$NON-NLS-2$
- return fValue;
- }
-
- public boolean isAllocated() throws DebugException
- {
- return true;
- }
-
- public IVariable[] getVariables() throws DebugException
- {
- List<IVariable> variableList = new ArrayList<IVariable>();
- if (actualNode != null) {
- if (actualNode.hasAttributes()) {
- getAttributes(variableList, actualNode);
- }
- variableList.addAll(getNodeListVariables(actualNode.getChildNodes()));
- }
- if (type.equals("nodeset") && !(fValue.equals("<EMPTY NODESET>"))) {
- createNodeSetVariables(variableList);
- }
- IVariable[] variables = new IVariable[variableList.size()];
- variableList.toArray(variables);
- return variables;
- }
- private void createNodeSetVariables(List<IVariable> variableList) {
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
- NodeList nodeList = null;
- try {
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- String nodeSet = "<nodeset>" + fValue + "</nodeset>";
- InputStream is = new ByteArrayInputStream(nodeSet.getBytes());
- Document doc = builder.parse(is);
- Node firstChild = doc.getFirstChild();
- nodeList = firstChild.getChildNodes();
- variableList.addAll(getNodeListVariables(nodeList));
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- private List<IVariable> getNodeListVariables(NodeList nodeList) {
- List<IVariable> variableList = new ArrayList<IVariable>();
- IVariable[] returnVars = new IVariable[nodeList.getLength()];
- if (nodeList != null) {
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node node = nodeList.item(i);
-// if (node.hasAttributes()) {
-// getAttributes(variableList, node);
-// }
- IVariable variable = new NodeListVariable(getDebugTarget(), node);
- variableList.add(variable);
- }
- }
- return variableList;
- }
- private void getAttributes(List<IVariable> variableList, Node node) {
- NamedNodeMap nodeMap = node.getAttributes();
- for (int item = 0; item < nodeMap.getLength(); item++) {
- Attr attribute = (Attr) nodeMap.item(item);
- IVariable variable = new NodeListVariable(getDebugTarget(), attribute);
- variableList.add(variable);
- }
- }
-
- public boolean hasVariables() throws DebugException
- {
- hasVariables = false;
- if (actualNode != null) {
- hasVariables = actualNode.hasChildNodes();
- } else if (type.equals("nodeset")) {
- hasVariables = true;
- } else {
- hasVariables = false;
- }
- if (fValue.equals("<EMPTY NODESET>")) {
- hasVariables = false;
- }
-
- return hasVariables;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLVariable.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLVariable.java
deleted file mode 100644
index 0b7a469..0000000
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLVariable.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.launching.model;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.w3c.dom.NodeList;
-
-public class XSLVariable extends XSLDebugElement implements IVariable
-{
- public static final String LOCAL_SCOPE = "L"; //$NON-NLS-1$
- public static final String TUNNEL_SCOPE = "T"; //$NON-NLS-1$
- public static final String GLOBAL_SCOPE = "G"; //$NON-NLS-1$
-
- private final int id;
- private String fName;
- private String scope;
- private String type;
- private NodeList nodeList;
-
- public XSLVariable(IDebugTarget target, int id)
- {
- super(target);
- this.id = id;
- }
-
- public int getId()
- {
- return id;
- }
-
- public IValue getValue() throws DebugException
- {
- return ((IXSLDebugTarget) getDebugTarget()).getVariableValue(this);
- }
-
- public void setName(String name)
- {
- this.fName = name;
- }
-
- public String getName() throws DebugException
- {
- return fName;
- }
-
- public String getReferenceTypeName() throws DebugException
- {
- if (GLOBAL_SCOPE.equals(scope))
- return "global"; //$NON-NLS-1$
- return "local"; //$NON-NLS-1$
- }
-
- public boolean hasValueChanged() throws DebugException
- {
- return false;
- }
-
- public void setValue(String expression) throws DebugException
- {
- }
-
- public void setValue(IValue value) throws DebugException
- {
- }
-
- public boolean supportsValueModification()
- {
- return false;
- }
-
- public boolean verifyValue(String expression) throws DebugException
- {
- return false;
- }
-
- public boolean verifyValue(IValue value) throws DebugException
- {
- return false;
- }
-
- public void setScope(String scope)
- {
- this.scope = scope;
- }
-
- public String getScope()
- {
- return scope;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.saxon/.classpath b/bundles/org.eclipse.wst.xsl.saxon/.classpath
deleted file mode 100644
index de15a1a..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src-debugger"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.saxon/.project b/bundles/org.eclipse.wst.xsl.saxon/.project
deleted file mode 100644
index f884eee..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.saxon</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/bundles/org.eclipse.wst.xsl.saxon/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.saxon/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index eca9f36..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Tue Feb 10 05:24:56 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
diff --git a/bundles/org.eclipse.wst.xsl.saxon/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.saxon/META-INF/MANIFEST.MF
deleted file mode 100644
index c12d9e1..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl.saxon;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/bundles/org.eclipse.wst.xsl.saxon/SaxonAttributes.properties b/bundles/org.eclipse.wst.xsl.saxon/SaxonAttributes.properties
deleted file mode 100644
index d64ab0e..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/SaxonAttributes.properties
+++ /dev/null
@@ -1,89 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-###############################################################################
-ALLOW_EXTERNAL_FUNCTIONS=http://saxon.sf.net/feature/allow-external-functions
-ALLOW_EXTERNAL_FUNCTIONS.TYPE=boolean
-ALLOW_EXTERNAL_FUNCTIONS.DESC=true if the stylesheet allows external functions to be called. Default is true. The setting false is recommended in an environment where untrusted stylesheets may be executed. Setting this value to false also disables user-defined extension elements, together with the writing of multiple output files, all of which carry similar security risks.
-
-TRACE_EXTERNAL_FUNCTIONS=http://saxon.sf.net/feature/trace-external-functions
-TRACE_EXTERNAL_FUNCTIONS.TYPE=boolean
-TRACE_EXTERNAL_FUNCTIONS.DESC=true if the tracing of calls to external Java methods is required. Default is false. This switch is useful when analyzing why Saxon fails to find a Java method to match an extension function call in the stylesheet, or why it chooses one method over another when several are available. The trace output is sent to System.err.
-
-TIMING=http://saxon.sf.net/feature/timing
-TIMING.TYPE=boolean
-TIMING.DESC=true if basic timing information is to be output to the standard error output stream.
-
-TREE_MODEL=http://saxon.sf.net/feature/treeModel
-TREE_MODEL.TYPE=int
-TREE_MODEL.DESC=Builder.STANDARD_TREE or Builder.TINY_TREE. Selects an implementation of the Saxon tree model. The default is Builder.TINY_TREE.
-
-TRACE_LISTENER=http://saxon.sf.net/feature/traceListener
-TRACE_LISTENER.TYPE=object
-TRACE_LISTENER.DESC=an instance of the class net.sf.saxon.trace.TraceListener. This object will be notified of significant events occurring during the transformation, for tracing or debugging purposes.
-
-LINE_NUMBERING=http://saxon.sf.net/feature/linenumbering
-LINE_NUMBERING.TYPE=boolean
-LINE_NUMBERING.DESC=indicates whether line numbers are to be maintained for the source document. This will not be possible if the source document is supplied as a DOM. The line numbers are accessible through the tracing interface, and also via the saxon:line-number() extension function.
-
-RECOVERY_POLICY=http://saxon.sf.net/feature/recoveryPolicy
-RECOVERY_POLICY.TYPE=int
-RECOVERY_POLICY.DESC=An Integer. Indicates how dynamic errors should be handled. One of the values (defined as constants in the Controller class) RECOVER_SILENTLY, RECOVER_WITH_WARNINGS, or DO_NOT_RECOVER).
-
-MESSAGE_EMITTER_CLASS=http://saxon.sf.net/feature/messageEmitterClass
-MESSAGE_EMITTER_CLASS.TYPE=class
-MESSAGE_EMITTER_CLASS.DESC=The full name of a saxon emitter class. that implements the net.sf.saxon.output.Emitter interface; the class will be used to format the output of the xsl:message instruction.
-
-SOURCE_PARSER_CLASS=http://saxon.sf.net/feature/sourceParserClass
-SOURCE_PARSER_CLASS.TYPE=class
-SOURCE_PARSER_CLASS.DESC=The full name of a class that implements the org.xml.sax.XMLReader interface; the class will be used to parse source documents (that is, the principal source document plus any secondary source documents read using the document() function)
-
-STYLE_PARSER_CLASS=http://saxon.sf.net/feature/styleParserClass
-STYLE_PARSER_CLASS.TYPE=class
-STYLE_PARSER_CLASS.DESC=The full name of a class that implements the org.xml.sax.XMLReader interface; the class will be used to parse stylesheet documents (that is, the principal stylesheet module plus any secondary source documents read using xsl:include or xsl:import)
-
-OUTPUT_URI_RESOLVER=http://saxon.sf.net/feature/outputURIResolver
-OUTPUT_URI_RESOLVER.TYPE=object
-OUTPUT_URI_RESOLVER.DESC=An instance of the class net.sf.saxon.OutputURIResolver; this object will be used to resolve URIs of secondary result documents specified in the href attribute of the xsl:result-document instruction
-
-DTD_VALIDATION=http://saxon.sf.net/feature/validation
-DTD_VALIDATION.TYPE=boolean
-DTD_VALIDATION.DESC=Indicates whether the XML parser should be asked to validate source documents against their DTD. This applies to the initial source document and any source documents read using the document() function, unless handled by a user-written URIResolver.
-
-VALIDATION_WARNINGS=http://saxon.sf.net/feature/validation-warnings
-VALIDATION_WARNINGS.TYPE=boolean
-VALIDATION_WARNINGS.DESC=This determines whether validation errors in result documents should be treated as fatal. By default they are fatal; with this option set, they are treated as warnings.
-
-SCHEMA_VALIDATION=http://saxon.sf.net/feature/schema-validation
-SCHEMA_VALIDATION.TYPE=boolean
-SCHEMA_VALIDATION.DESC=This determines whether source documents should be parsed with schema-validation enabled.
-
-VERSION_WARNING=http://saxon.sf.net/feature/version-warning
-VERSION_WARNING.TYPE=boolean
-VERSION_WARNING.DESC=This determines whether a warning should be output when running an XSLT 2.0 processor against an XSLT 1.0 stylesheet. The XSLT specification requires this to be done by default.
-
-NAME_POOL=http://saxon.sf.net/feature/namePool
-NAME_POOL.TYPE=object
-NAME_POOL.DESC=A instance of class net.sf.saxon.om.NamePool. Indicates that the supplied NamePool should be used as the target (run-time) NamePool by all stylesheets compiled (using newTemplates()) after this call on setAttribute. Normally a single system-allocated NamePool is used for all stylesheets compiled while the Java VM remains loaded; this attribute allows user control over the allocation of NamePools. Note that source trees used as input to a transformation must be built using the same NamePool that is used when the stylesheet is compiled: this will happen automatically if the input to a transformation is supplied as a SAXSource or StreamSource but it is under user control if you build the source tree yourself.
-
-RECOGNIZE_URI_QUERY_PARAMETERS=http://saxon.sf.net/feature/recognize-uri-query-parameters
-RECOGNIZE_URI_QUERY_PARAMETERS.TYPE=boolean
-RECOGNIZE_URI_QUERY_PARAMETERS.DESC=determines whether query parameters (things after "?")\n\
- in a URI passed to the document() or doc() function are specially recognized by the system default URIResolver.\n\
- Allowed parameters include, for example validation=strict to perform schema validation, and strip-space=yes\n\
- to perform stripping of all whitespace-only text nodes
-
-COLLATION_URI_RESOLVER=http://saxon.sf.net/feature/collation-uri-resolver
-COLLATION_URI_RESOLVER.TYPE=object
-COLLATION_URI_RESOLVER.DESC=A net.sf.saxon.sort.CollationURIResolver used to resolve collation URIs used in stylesheets compiled or executed under the\n\
- control of this TransformerFactory
-
-COLLECTION_URI_RESOLVER=http://saxon.sf.net/feature/collection-uri-resolver
-COLLECTION_URI_RESOLVER.TYPE=object
-COLLECTION_URI_RESOLVER.DESC=A net.sf.saxon.sort.CollectionURIResolver used to resolve collection URIs used in calls of the collection() function \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.saxon/SaxonOutputProperties.properties b/bundles/org.eclipse.wst.xsl.saxon/SaxonOutputProperties.properties
deleted file mode 100644
index e979071..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/SaxonOutputProperties.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-###############################################################################
-INDENT_SPACES={http://saxon.sf.net/}indent-spaces
-INDENT_SPACES.DESC=(integer value).Defines the number of spaces used for indentation of output
-
-UNDECLARE_NAMESPACES={http://saxon.sf.net/}undeclare-namespaces
-UNDECLARE_NAMESPACES.DESC=include-content-type = "yes" | "no". This attribute is defined in XSLT 2.0. Indicates XML 1.1 namespace declarations are to be output.
-
-CHARACTER_REPRESENTATION={http://saxon.sf.net/}character-representation
-CHARACTER_REPRESENTATION.DESC=(rep1[;rep2]). Indicates the preferred way of representing non-ASCII characters in HTML and XML output. rep1 is for characters in the range 128-256, rep2 for those above 256.
-
-NEXT_IN_CHAIN={http://saxon.sf.net/}next-in-chain
-NEXT_IN_CHAIN.DESC=(uri). Indicates that the output is to be piped into another XSLT stylesheet to perform another transformation. The auxiliary property NEXT_IN_CHAIN_BASE_URI records the base URI of the stylesheet element where this attribute was found.
-
-TYPE_INFORMATION={http://saxon.sf.net/}type-information
-TYPE_INFORMATION.DESC=(none|preserve|strict|lax). Indicates the value of the type-information attribute: "none", "preserve", "strict", "lax"
-
-REQUIRE_WELL_FORMED={http://saxon.sf.net/}require-well-formed
-REQUIRE_WELL_FORMED.DESC=(yes|no). Indicates whether a user-supplied ContentHandler requires the stream of SAX events to be well-formed (that is, to have a single element node and no text nodes as children of the root). The default is "no". \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.saxon/about.html b/bundles/org.eclipse.wst.xsl.saxon/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.saxon/build.properties b/bundles/org.eclipse.wst.xsl.saxon/build.properties
deleted file mode 100644
index b44dde2..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-source.. = src-debugger/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- SaxonAttributes.properties,\
- SaxonOutputProperties.properties,\
- about.html,\
- plugin.xml,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.xsl.saxon/plugin.properties b/bundles/org.eclipse.wst.xsl.saxon/plugin.properties
deleted file mode 100644
index 4538751..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/plugin.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.saxon
-Bundle-Name.0 = XSL Saxon Support (Incubating)
-processorType.label.0 = Saxon (XSLT 2.0)
-processorType.label.1 = Saxon (XSLT 1.0)
-Bundle-Vendor.0 = Eclipse.org
-transformerFactorySaxon6 = Saxon 6
-transformerSaxonXSLT2 = Saxon 7 \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.saxon/plugin.xml b/bundles/org.eclipse.wst.xsl.saxon/plugin.xml
deleted file mode 100644
index 8be0a82..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/plugin.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.processorType">
- <processorType
- attributeProperties="SaxonAttributes.properties"
- id="org.eclipse.wst.xsl.saxon_1_0.processorType"
- label="%processorType.label.1"
- outputProperties="SaxonOutputProperties.properties">
- <transformerFactory
- factoryClass="com.icl.saxon.TransformerFactoryImpl"
- name="%transformerFactorySaxon6">
- </transformerFactory>
- </processorType>
- <processorType
- attributeProperties="SaxonAttributes.properties"
- id="org.eclipse.wst.xsl.saxon.processorType"
- label="%processorType.label.0"
- outputProperties="SaxonOutputProperties.properties">
- <transformerFactory
- factoryClass="net.sf.saxon.TransformerFactoryImpl"
- name="%transformerSaxonXSLT2">
- </transformerFactory>
- </processorType>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.saxon/src-debugger/README.txt b/bundles/org.eclipse.wst.xsl.saxon/src-debugger/README.txt
deleted file mode 100644
index 1063a57..0000000
--- a/bundles/org.eclipse.wst.xsl.saxon/src-debugger/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-Just a placeholder to ensure src folder appears. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/.classpath b/bundles/org.eclipse.wst.xsl.ui/.classpath
deleted file mode 100644
index fd14010..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <accessrules>
- <accessrule kind="accessible" pattern="org/apache/xpath/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**/xsl/core/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.ui/.project b/bundles/org.eclipse.wst.xsl.ui/.project
deleted file mode 100644
index b662d7d..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.ui</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 131218a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,87 +0,0 @@
-#Tue Feb 10 05:36:00 GMT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-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.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-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.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-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.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-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.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index ade4019..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,22 +0,0 @@
-#Fri Sep 05 23:58:31 GMT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=2
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xsl.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 943e6c6..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,44 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xsl.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xsl.ui.internal.XSLUIPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,2.0.0)",
- org.eclipse.ui.console;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.navigator.resources;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,2.0.0)",
- org.apache.xalan;bundle-version="[2.7.1,2.8.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,2.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.xsl.core;bundle-version="1.0.0",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.103,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.wst.xml.xpath.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.xml.xpath.core;bundle-version="[1.0.0,2.0.0)",
- com.ibm.icu;bundle-version="3.8.1"
-Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.wst.xsl.ui.internal;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.actions;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.contentassist.contentmodel;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.contentassist.href;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.doubleclick;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.handlers;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.perspective;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.style;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.util;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.validation;x-internal:=true,
- org.eclipse.wst.xsl.ui.internal.wizards;x-internal:=true
-Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.xsl.ui/about.html b/bundles/org.eclipse.wst.xsl.ui/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.ui/build.properties b/bundles/org.eclipse.wst.xsl.ui/build.properties
deleted file mode 100644
index 60e64be..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- plugin.properties,\
- templates/,\
- about.html,\
- xslfiles/
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/XSDFile.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/XSDFile.gif
deleted file mode 100644
index 3900f1b..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/ancestor.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/ancestor.gif
deleted file mode 100644
index 697db80..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/ancestor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/directional.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/directional.gif
deleted file mode 100644
index ec90bc2..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/directional.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/family.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/family.gif
deleted file mode 100644
index e917f3e..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/family.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/field_default_obj.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/field_default_obj.gif
deleted file mode 100644
index 6929d3d..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/field_default_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/function.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/function.gif
deleted file mode 100644
index a81fd68..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/function.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/import.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/import.gif
deleted file mode 100644
index 9e44ce5..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/import.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/imports.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/imports.gif
deleted file mode 100644
index ea94702..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/imports.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/mode.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/mode.gif
deleted file mode 100644
index f4a1ea1..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/mode.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/new_xml.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/new_xml.gif
deleted file mode 100644
index 9dfb62d..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/new_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/newdtd_wiz.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/newdtd_wiz.gif
deleted file mode 100644
index 10b1a77..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/operation.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/operation.gif
deleted file mode 100644
index b55d9e3..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/operation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/over_co.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/over_co.gif
deleted file mode 100644
index 938767b..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/over_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/package_obj.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/package_obj.gif
deleted file mode 100644
index 131c28d..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/package_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/template.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/template.gif
deleted file mode 100644
index 0b12869..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/variable.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/variable.gif
deleted file mode 100644
index f6d83cb..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/variable.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/xml_perspective.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/xml_perspective.gif
deleted file mode 100644
index f439b47..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/xml_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_file.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_file.gif
deleted file mode 100644
index 9b0eb46..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_file.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_launch.gif b/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_launch.gif
deleted file mode 100644
index bfe15f8..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/icons/full/xslt_launch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl.ui/plugin.properties b/bundles/org.eclipse.wst.xsl.ui/plugin.properties
deleted file mode 100644
index fc983b8..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/plugin.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-###############################################################################
-# Copyright (c) 2005-2007 Orangevolt (www.orangevolt.com)
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Lars Gersmann (www.orangevolt.com) - XSL UI support
-# David Carver - STAR - bug 215126, 213853
-#
-###############################################################################
-
-providerName=Eclipse.org
-pluginName=XSL Editor and Validation (Incubating)
-perspectiveName=XML
-page.name.0 = XSL
-
-editorName = XSL Editor
-wizardNameXSL = XSL
-wizardDescriptionXSL = Create a new XSL Stylesheet
-contextTypeNewXSL = New XSL
-pageNameTemplates = Templates
-pageNameValidation = Validation
-commandOpenSelection = Open Selection
-commandTooltipOpenSelection = Open Selection
-commandTooltipNewXMLFile = New XML File
-commandTooltipNewXMLFile2 = New XML File
-commandTooltipNewXSDFile = New XML Schema File
-commandTooltipNewXSLFile = New XSL File
-viewNameStylesheet = Stylesheet
-pageSyntaxColoring = Syntax Coloring
-XSL_Property_validation = XSLT Validation
-
-specification.label.0 = Override \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/plugin.xml b/bundles/org.eclipse.wst.xsl.ui/plugin.xml
deleted file mode 100644
index b905e92..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/plugin.xml
+++ /dev/null
@@ -1,352 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
- <extension point="org.eclipse.ui.perspectives">
- <perspective id="org.eclipse.wst.xsl.ui.perspective"
- class="org.eclipse.wst.xsl.ui.internal.perspective.XMLPerspectiveFactory"
- icon="$nl$/icons/full/xml_perspective.gif"
- name="%perspectiveName">
- </perspective>
- </extension>
-
- <extension point="org.eclipse.ui.editors">
- <editor name="%editorName"
- icon="$nl$/icons/full/xslt_file.gif"
- contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.SourcePageActionContributor"
- class="org.eclipse.wst.xsl.ui.internal.editor.XSLEditor"
- default="true"
- extensions="xsl,xslt"
- id="org.eclipse.wst.xsl.ui.XSLEditor">
- <contentTypeBinding contentTypeId="org.eclipse.wst.xml.core.xslsource" />
- </editor>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.wst.xsl.ui.XSLEditor" />
- </actionSetPartAssociation>
- <actionSetPartAssociation targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.xsl.ui.XSLEditor" />
- </actionSetPartAssociation>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL"
- target="org.eclipse.wst.xml.core.xslsource">
- </sourceViewerConfiguration>
- <doubleClickStrategy
- class="org.eclipse.wst.xsl.ui.internal.doubleclick.XSLDoubleClickStrategy"
- target="org.eclipse.wst.xsl.XSL_XPATH">
- </doubleClickStrategy>
- <provisionalDefinition
- type="activecontexts"
- value="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.cleanup, org.eclipse.wst.xml.comments, org.eclipse.wst.xml.selection, org.eclipse.wst.xml.dependencies, org.eclipse.wst.xml.grammar, org.eclipse.wst.xml.expand, org.eclipse.wst.xml.occurrences"
- target="org.eclipse.core.runtime.xml" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage, org.eclipse.wst.xsl.ui.template.preferencePage, org.eclipse.wst.xsl.ui.preferences.Validation, org.eclipse.wst.xml.xpath.ui.XPathPreferencePage, org.eclipse.wst.xsl.ui.XPath"
- target="org.eclipse.wst.xml.core.xslsource"/>
- </extension>
-
- <extension point="org.eclipse.ui.newWizards">
- <wizard category="org.eclipse.wst.XMLCategory"
- class="org.eclipse.wst.xsl.ui.internal.wizards.NewXSLFileWizard"
- finalPerspective="org.eclipse.wst.xsl.ui.perspective"
- icon="$nl$/icons/full/xslt_file.gif"
- id="org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard"
- name="%wizardNameXSL"
- preferredPerspectives="org.eclipse.wst.xsl.ui.perspective">
- <description>%wizardDescriptionXSL</description>
- <selection class="org.eclipse.core.resources.IResource">
- </selection>
- </wizard>
- </extension>
-
- <!-- XSL templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- class="org.eclipse.wst.xsl.ui.internal.templates.TemplateContextTypeXSL"
- id="xsl_new" name="%contextTypeNewXSL">
- </contextType>
- <include file="templates/file_templates.xml" />
- </extension>
-
-
- <extension point="org.eclipse.ui.preferencePages">
- <page category="org.eclipse.wst.xml.ui.preferences.xml"
- class="org.eclipse.wst.xsl.ui.internal.preferences.MainPreferencePage"
- id="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage"
- name="%page.name.0" />
- <page category="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage"
- class="org.eclipse.wst.xsl.ui.internal.preferences.XSLTemplatePreferencePage"
- id="org.eclipse.wst.xsl.ui.template.preferencePage"
- name="%pageNameTemplates">
- </page>
-
- <page category="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage"
- class="org.eclipse.wst.xsl.ui.internal.preferences.XSLValidationPreferencePage"
- id="org.eclipse.wst.xsl.ui.preferences.Validation"
- name="%pageNameValidation">
- </page>
- <page category="org.eclipse.wst.xsl.ui.preferences.BasePreferencePage"
- class="org.eclipse.wst.xsl.ui.internal.preferences.XSLSyntaxColoringPage"
- id="org.eclipse.wst.xsl.ui.preferences.SyntaxColoring"
- name="%pageSyntaxColoring"/>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator scope="total"
- class="org.eclipse.wst.xsl.ui.internal.validation.DelegatingSourceValidatorForXSL"
- id="org.eclipse.wst.xsl.ui.internal.validation.DelegatingSourceValidatorForXSL">
- <contentTypeIdentifier id="org.eclipse.wst.xml.core.xslsource">
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xsl.XSL_XPATH"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator scope="partial"
- class="org.eclipse.wst.xsl.ui.internal.validation.XSLMarkupValidator"
- id="org.eclipse.wst.xsl.ui.internal.validator.markupvalidator">
- <contentTypeIdentifier id="org.eclipse.wst.xml.core.xslsource">
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT" />
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT" />
- <partitionType id="org.eclipse.wst.xsl.XSL_XPATH" />
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.wst.xsl.ui.perspective">
- <newWizardShortcut
- id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
- </newWizardShortcut>
- <newWizardShortcut
- id="org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard">
- </newWizardShortcut>
- <newWizardShortcut
- id="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard">
- </newWizardShortcut>
- <newWizardShortcut
- id="org.eclipse.wst.wsdl.ui">
- </newWizardShortcut>
- <newWizardShortcut
- id="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard">
- </newWizardShortcut>
- </perspectiveExtension>
- </extension>
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard
- type="new"
- wizardId="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard">
- <enablement></enablement>
- </commonWizard>
- <commonWizard
- type="new"
- wizardId="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
- <enablement>
-
- </enablement>
- </commonWizard>
- <commonWizard
- type="new"
- wizardId="org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard">
- <enablement></enablement>
- </commonWizard>
- <commonWizard
- type="new"
- wizardId="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard">
- <enablement>
- </enablement>
- </commonWizard>
- <commonWizard
- type="new"
- wizardId="org.eclipse.wst.wsdl.ui">
- <enablement></enablement>
- </commonWizard>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.xsl.ui.internal.handlers.OpenDeclarationHandler"
- commandId="org.eclipse.wst.sse.ui.open.file.from.source">
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.eclipse.wst.sse.ui.StructuredTextEditor.EditorContext?before=additions">
- <command
- commandId="org.eclipse.wst.sse.ui.open.file.from.source"
- id="openSelection"
- label="%commandOpenSelection"
- style="push"
- tooltip="%commandTooltipOpenSelection">
- <visibleWhen
- checkEnabled="false">
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
- <toolbar
- id="org.eclipse.wst.xsl.ui.design.NewFileToolBar">
- <separator
- name="org.eclipse.wst.xsl.toolbar.separator.1"
- visible="true">
- </separator>
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="$nl$/icons/full/new_xml.gif"
- id="org.eclipse.wst.xsl.ui.newXMLFile"
- style="push"
- tooltip="%commandTooltipNewXMLFile">
- <parameter
- name="newWizardId"
- value="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
- </parameter>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xsl.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="$nl$/icons/full/newdtd_wiz.gif"
- id="org.eclipse.wst.xsl.ui.newDTDFile"
- style="push"
- tooltip="%commandTooltipNewXMLFile2">
- <parameter
- name="newWizardId"
- value="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard">
- </parameter>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xsl.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="$nl$/icons/full/XSDFile.gif"
- id="org.eclipse.wst.xsl.ui.newXSDFile"
- style="push"
- tooltip="%commandTooltipNewXSDFile">
- <parameter
- name="newWizardId"
- value="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard">
- </parameter>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xsl.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
-
- <command
- commandId="org.eclipse.ui.newWizard"
- icon="$nl$/icons/full/xslt_file.gif"
- id="org.eclipse.wst.xsl.ui.newXSLFile"
- style="push"
- tooltip="%commandTooltipNewXSLFile">
- <parameter
- name="newWizardId"
- value="org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard">
- </parameter>
- <visibleWhen checkEnabled="false">
- <with variable="activeWorkbenchWindow.activePerspective">
- <equals value="org.eclipse.wst.xsl.ui.perspective"/>
- </with>
- </visibleWhen>
- </command>
- <separator
- name="additions"
- visible="true">
- </separator>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- class="org.eclipse.wst.xsl.ui.internal.StylesheetView"
- id="org.eclipse.wst.xsl.ui.view.outline"
- name="%viewNameStylesheet"
- category="org.eclipse.wst.xml"
- restorable="true">
- </view>
- </extension>
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.wst.xsl.ui.internal.XSLModelAdapterFactory"
- adaptableType="org.eclipse.wst.xsl.core.model.XSLModelObject">
- <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
- </factory>
- </extension>
-
- <extension point="org.eclipse.ui.editors.annotationTypes">
- <type
- name="org.eclipse.wst.xsl.ui.override">
- </type>
- </extension>
- <extension
- point="org.eclipse.ui.editors.markerAnnotationSpecification">
- <specification
- annotationType="org.eclipse.wst.xsl.ui.override"
- label="%specification.label.0"
- icon="$nl$/icons/full/over_co.gif"
- annotationImageProvider ="org.eclipse.wst.xsl.ui.internal.editor.OverrideIndicatorImageProvider"
- textPreferenceKey="overrideIndicator"
- textPreferenceValue="false"
- highlightPreferenceKey="overrideIndicatorHighlighting"
- highlightPreferenceValue="false"
- contributesToHeader="false"
- overviewRulerPreferenceKey="overrideIndicatorInOverviewRuler"
- overviewRulerPreferenceValue="false"
- verticalRulerPreferenceKey="overrideIndicatorInVerticalRuler"
- verticalRulerPreferenceValue="true"
- colorPreferenceKey="overrideIndicatorColor"
- colorPreferenceValue="180,207,205"
- presentationLayer="3"
- showInNextPrevDropdownToolbarActionKey="showoverrideIndicatorInNextPrevDropdownToolbarAction"
- showInNextPrevDropdownToolbarAction="false"
- isGoToNextNavigationTargetKey="isOverrideIndicatorGoToNextNavigationTarget"
- isGoToNextNavigationTarget="false"
- isGoToPreviousNavigationTargetKey="isOverrideIndicatorGoToPreviousNavigationTarget"
- isGoToPreviousNavigationTarget="false"
- textStylePreferenceKey="overrideIndicatorTextStyle"
- textStylePreferenceValue="SQUIGGLES">
- </specification>
- </extension>
-
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.xsl.ui.internal.preferences.XSLUIPreferenceInitializer" />
- </extension>
-
- <extension point="org.eclipse.ui.propertyPages">
- <page
- name="%XSL_Property_validation"
- class="org.eclipse.wst.xsl.ui.internal.preferences.XSLValidationPreferencePage"
- id="org.eclipse.wst.xsl.ui.propertyPage.project.validation"
- category="ValidationPropertiesPage">
-- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
-
- </adapt>
- </enabledWhen>
- </page>
- </extension>
-
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/ListWorkbenchAdapter.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/ListWorkbenchAdapter.java
deleted file mode 100644
index 8b5a7c5..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/ListWorkbenchAdapter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal;
-
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsl.core.model.Stylesheet;
-
-public class ListWorkbenchAdapter implements IWorkbenchAdapter
-{
- private Object parent;
- private Object[] children;
- private String text;
- private ImageDescriptor image;
-
- public ListWorkbenchAdapter(Stylesheet stylesheet, List list, String label, String imgPath)
- {
- parent = stylesheet;
- if (list != null)
- children = list.toArray();
- else
- children = new Object[0];
- text = label;
- if (imgPath!=null)
- image = AbstractUIPlugin.imageDescriptorFromPlugin(XSLUIPlugin.PLUGIN_ID, imgPath);
- }
-
- public ImageDescriptor getImageDescriptor(Object object)
- {
- return image;
- }
-
- public String getLabel(Object o)
- {
- return text;
- }
-
- public Object[] getChildren(Object o)
- {
- return children;
- }
-
- public Object getParent(Object o)
- {
- return parent;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/Messages.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/Messages.java
deleted file mode 100644
index 98ca898..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/Messages.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsl.ui.internal.messages"; //$NON-NLS-1$
-
- public static String ExcludeResultPrefixesContentAssist;
- public static String NoContentAssistance;
- public static String XSLSyntaxColoringPage;
- public static String xsltStyleDocument;
- public static String MainPreferencePage;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StructuredTextViewerConfigurationXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StructuredTextViewerConfigurationXSL.java
deleted file mode 100644
index 4d42727..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StructuredTextViewerConfigurationXSL.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsl.ui.internal;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider; // import
- // org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-import org.eclipse.wst.xsl.core.internal.text.IXSLPartitions;
-import org.eclipse.wst.xsl.core.internal.text.rules.StructuredTextPartitionerForXSL;
-import org.eclipse.wst.xsl.ui.internal.contentassist.XSLContentAssistProcessor;
-import org.eclipse.wst.xsl.ui.internal.editor.XSLHyperlinkDetector;
-import org.eclipse.wst.xsl.ui.internal.style.LineStyleProviderForXSL;
-
-/**
- * StructuredTextViewerConfigurationXSL implements content assistance for
- * attributes and other XPath related functionality.
- *
- * @author dcarver
- *
- */
-public class StructuredTextViewerConfigurationXSL extends
- StructuredTextViewerConfigurationXML {
-
- private String[] fConfiguredContentTypes;
- private LineStyleProvider fLineStyleProviderForXSL;
-// private LineStyleProvider fLineStyleProviderForXML;
-
- /**
- * Configuration for XSL Content Types
- */
- public StructuredTextViewerConfigurationXSL() {
- super();
- }
-
- /**
- * Return the processors for the current content type.
- */
- @Override
- protected IContentAssistProcessor[] getContentAssistProcessors(
- ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor[] processors = null;
-
- if ((partitionType.equals(IStructuredPartitions.DEFAULT_PARTITION))
- || (partitionType.equals(IXMLPartitions.XML_DEFAULT))
- || (partitionType.equals(IXSLPartitions.XSL_XPATH))) {
- processors = new IContentAssistProcessor[] { new XSLContentAssistProcessor() };
- } else if (partitionType.equals(IStructuredPartitions.UNKNOWN_PARTITION)) {
- processors = new IContentAssistProcessor[] { new NoRegionContentAssistProcessor() };
- }
- return processors;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
- */
- @Override
- public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- if (sourceViewer == null
- || !fPreferenceStore
- .getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
- return null;
- IHyperlinkDetector[] superDetectors = super
- .getHyperlinkDetectors(sourceViewer);
- IHyperlinkDetector[] allDetectors = new IHyperlinkDetector[superDetectors.length + 1];
- allDetectors[0] = new XSLHyperlinkDetector();
- System.arraycopy(superDetectors, 0, allDetectors, 1,
- superDetectors.length);
- return allDetectors;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)
- */
- @Override
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- String[] xslTypes = StructuredTextPartitionerForXSL
- .getConfiguredContentTypes();
- fConfiguredContentTypes = new String[xslTypes.length + 2];
- fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
- fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
- int index = 0;
- System.arraycopy(xslTypes, 0, fConfiguredContentTypes, index += 2,
- xslTypes.length);
- }
- return fConfiguredContentTypes;
- }
-
- @Override
- public LineStyleProvider[] getLineStyleProviders(
- ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
- if (isXMLPartition(partitionType)) {
- providers = new LineStyleProvider[] {getLineStyleProviderForXSL()};
- }
- return providers;
- }
-
- private boolean isXMLPartition(String partitionType) {
- return partitionType.equals(IXMLPartitions.XML_DEFAULT)
- || partitionType.equals(IXMLPartitions.XML_CDATA)
- || partitionType.equals(IXMLPartitions.XML_COMMENT)
- || partitionType.equals(IXMLPartitions.XML_DECLARATION)
- || partitionType.equals(IXMLPartitions.XML_PI)
- || partitionType.equals(IXSLPartitions.XSL_XPATH);
- }
-
- protected LineStyleProvider getLineStyleProviderForXSL() {
- if (fLineStyleProviderForXSL == null) {
- fLineStyleProviderForXSL = new LineStyleProviderForXSL();
- }
- return fLineStyleProviderForXSL;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StylesheetView.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StylesheetView.java
deleted file mode 100644
index cbf5762..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/StylesheetView.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal;
-
-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.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.model.BaseWorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.core.model.XSLNode;
-
-/**
- *
- *
- */
-public class StylesheetView extends ViewPart
-{
- private IEditorPart activeEditor;
- //private boolean isFiringSelection;
- private TreeViewer tv;
- private IPartListener partListener = new IPartListener(){
-
- public void partActivated(IWorkbenchPart part)
- {
- if (part instanceof IEditorPart)
- {
- IEditorPart editor = (IEditorPart)part;
- IEditorInput edInput = editor.getEditorInput();
- if (edInput instanceof IFileEditorInput)
- {
- IFileEditorInput edFileInput = (IFileEditorInput)edInput;
- if (XSLCore.isXSLFile(edFileInput.getFile()))
- {
- activeEditor = editor;
- StylesheetModel model = XSLCore.getInstance().getStylesheet(edFileInput.getFile());
- tv.setInput(model.getStylesheet());
- }
- }
- }
- }
-
- public void partBroughtToTop(IWorkbenchPart part)
- {
- }
-
- public void partClosed(IWorkbenchPart part)
- {
- if (part == activeEditor)
- {
- tv.setInput(null);
- activeEditor = null;
- }
- }
-
- public void partDeactivated(IWorkbenchPart part)
- {
- }
-
- public void partOpened(IWorkbenchPart part)
- {
- }
-
- };
-
- @Override
- public void init(IViewSite site, IMemento memento) throws PartInitException
- {
- super.init(site, memento);
- site.getPage().addPartListener(partListener);
- }
-
- @Override
- public void dispose()
- {
- getSite().getPage().removePartListener(partListener);
- super.dispose();
- }
-
- @Override
- public void createPartControl(Composite parent)
- {
- Tree tree = new Tree(parent,SWT.NONE);
- this.tv = new TreeViewer(tree);
- tv.setContentProvider(new BaseWorkbenchContentProvider());
- tv.setLabelProvider(new WorkbenchLabelProvider());
- tv.addSelectionChangedListener(new ISelectionChangedListener(){
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (getSite().getPage().getActivePart() == StylesheetView.this)
- handleTreeSelection((IStructuredSelection)event.getSelection(),false);
- }
- });
- tv.addDoubleClickListener(new IDoubleClickListener(){
-
- public void doubleClick(DoubleClickEvent event)
- {
- handleTreeSelection((IStructuredSelection)event.getSelection(),true);
- }
-
- });
- }
-
- private void handleTreeSelection(IStructuredSelection selection, boolean reveal)
- {
- if (activeEditor != null)
- {
-// isFiringSelection = true;
- if (selection.getFirstElement() instanceof XSLNode)
- {
- XSLNode node = (XSLNode)selection.getFirstElement();
-
- ITextEditor textEditor = (ITextEditor)activeEditor.getAdapter(ITextEditor.class);
- if (textEditor != null)
- {
- //if (reveal)
- textEditor.selectAndReveal(node.getOffset(), 0);
- //else
- // textEditor.setHighlightRange(node.getOffset(), 0, true);
- }
- }
-// isFiringSelection = false;
- }
- }
-
- @Override
- public void setFocus()
- {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLModelAdapterFactory.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLModelAdapterFactory.java
deleted file mode 100644
index 8436b34..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLModelAdapterFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class XSLModelAdapterFactory implements IAdapterFactory
-{
- private static Class[] LIST = new Class[]{IWorkbenchAdapter.class};
- private IWorkbenchAdapter adapter = new XSLWorkbenchAdapter();
-
- public Object getAdapter(Object adaptableObject, Class adapterType)
- {
- if (IWorkbenchAdapter.class.equals(adapterType))
- return adapter;
- return null;
- }
-
- public Class[] getAdapterList()
- {
- return LIST;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIConstants.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIConstants.java
deleted file mode 100644
index 8966542..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIConstants.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal;
-
-public class XSLUIConstants
-{
- public static final String TEMPLATE_CONTEXT_XSL_NEW = "xsl_new";
- public static final String NEW_FILE_TEMPLATE_NAME = "NEW_FILE_TEMPLATE_NAME";
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIPlugin.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIPlugin.java
deleted file mode 100644
index 99754cf..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLUIPlugin.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class XSLUIPlugin extends AbstractUIPlugin {
-
- /**
- * The template store for the xsl editor.
- */
- private TemplateStore fTemplateStore;
-
-
- //private ScopedPreferenceStore preferenceStore;
-
- /**
- * The template context type registry for the xml editor.
- */
- private ContributionContextTypeRegistry fContextTypeRegistry;
-
- /**
- * The plugin id for this plugin.
- */
- static final public String PLUGIN_ID = "org.eclipse.wst.xsl.ui"; //$NON-NLS-1$
-
- // The shared instance
- private static XSLUIPlugin plugin;
-
- /**
- * The constructor
- */
- public XSLUIPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static XSLUIPlugin getDefault() {
- return plugin;
- }
-
- public static void log(Exception e)
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, 0, "", e)); //$NON-NLS-1$
- }
-
- public static void log(CoreException e)
- {
- getDefault().getLog().log(e.getStatus());
- }
-
- /**
- * Returns the template store for the xsl templates.
- *
- * @return the template store for the xsl templates
- */
- public TemplateStore getTemplateStore()
- {
- if (fTemplateStore == null)
- {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "org.eclipse.wst.xsl.ui.custom_templates"); //$NON-NLS-1$
- try
- {
- fTemplateStore.load();
- }
- catch (IOException e)
- {
- log(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the xsl plugin.
- *
- * @return the template context type registry for the xsl plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry()
- {
- if (fContextTypeRegistry == null)
- {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType("xsl_new"); //$NON-NLS-1$
- fContextTypeRegistry = registry;
- }
- return fContextTypeRegistry;
- }
-
- public static File makeFileFor(String directory, String filename) throws IOException {
- Bundle bundle = Platform.getBundle(XSLUIPlugin.PLUGIN_ID);
- URL url = bundle.getEntry("/");
- URL localURL = FileLocator.toFileURL(url);
- String installPath = localURL.getPath();
- String totalDirectory = installPath + directory;
- String totalPath = totalDirectory + "/" + filename;
- URL totalURL = new URL(url, totalPath);
- //URL finalurl = Platform.asLocalURL(totalURL);
- String finalFile = totalURL.getFile();
- File file = new File(finalFile);
- return file;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLWorkbenchAdapter.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLWorkbenchAdapter.java
deleted file mode 100644
index 3f04f23..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/XSLWorkbenchAdapter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsl.core.model.Import;
-import org.eclipse.wst.xsl.core.model.Include;
-import org.eclipse.wst.xsl.core.model.Stylesheet;
-import org.eclipse.wst.xsl.core.model.Template;
-import org.eclipse.wst.xsl.core.model.Variable;
-import org.eclipse.wst.xsl.core.model.XSLModelObject;
-
-class XSLWorkbenchAdapter implements IWorkbenchAdapter {
- private final Object[] EMPTY = new Object[0];
-
- public Object[] getChildren(Object o) {
- XSLModelObject obj = (XSLModelObject) o;
- switch (obj.getModelType()) {
- case STYLESHEET:
- Stylesheet stylesheet = (Stylesheet) obj;
- return new Object[] {
- new ListWorkbenchAdapter(stylesheet, null, stylesheet
- .getVersion(), "icons/full/xslt_launch.gif"),
- new ListWorkbenchAdapter(stylesheet, stylesheet
- .getImports(), "Imports", "icons/full/imports.gif"),
- new ListWorkbenchAdapter(stylesheet, stylesheet
- .getIncludes(), "Includes",
- "icons/full/imports.gif"),
- new ListWorkbenchAdapter(stylesheet, stylesheet
- .getGlobalVariables(), "Variables", null),
- new ListWorkbenchAdapter(stylesheet, stylesheet
- .getTemplates(), "Templates", null) };
- }
- return EMPTY;
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- XSLModelObject obj = (XSLModelObject) object;
- String path = null;
- switch (obj.getModelType()) {
- case STYLESHEET:
- path = "icons/full/xslt_launch.gif";
- break;
- case IMPORT:
- case INCLUDE:
- path = "icons/full/import.gif";
- break;
- case TEMPLATE:
- path = "icons/full/methdef_obj.gif";
- break;
- case VARIABLE:
- path = "icons/full/field_default_obj.gif";
- break;
- }
- return path == null ? null : AbstractUIPlugin.imageDescriptorFromPlugin(
- XSLUIPlugin.PLUGIN_ID, path);
- }
-
- public String getLabel(Object o) {
- String label = null;
- XSLModelObject obj = (XSLModelObject) o;
- switch (obj.getModelType()) {
- case STYLESHEET:
- Stylesheet stylesheet = (Stylesheet) obj;
- label = stylesheet.getVersion() == null ? "?" : stylesheet
- .getVersion();
- break;
- case IMPORT:
- Import imp = (Import) obj;
- label = imp.getHref();
- break;
- case INCLUDE:
- Include inc = (Include) obj;
- label = inc.getHref();
- break;
- case TEMPLATE:
- Template t = (Template) obj;
- StringBuffer sb = new StringBuffer();
- if (t.getName() != null)
- sb.append(t.getName()).append(" ");
- if (t.getMatch() != null)
- sb.append(t.getMatch()).append(" ");
- if (t.getMode() != null)
- sb.append("(").append(t.getMode()).append(")");
- label = sb.toString();
- break;
- case VARIABLE:
- Variable v = (Variable) obj;
- label = v.getName();
- break;
- }
- return label;
- }
-
- public Object getParent(Object o) {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewDTDFileWizardDelegate.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewDTDFileWizardDelegate.java
deleted file mode 100644
index b7a2d5e..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewDTDFileWizardDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class NewDTDFileWizardDelegate implements IWorkbenchWindowActionDelegate
-{
- private NewWizardAction openAction;
- private ISelection selection;
-
- public void init(IWorkbenchWindow window)
- {
- this.openAction = new NewWizardAction("org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard");
- }
-
- public void run(IAction action)
- {
- openAction.setSelection(selection);
- openAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public void dispose()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWSDLFileWizardDelegate.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWSDLFileWizardDelegate.java
deleted file mode 100644
index cd8da74..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWSDLFileWizardDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class NewWSDLFileWizardDelegate implements IWorkbenchWindowActionDelegate
-{
- private NewWizardAction openAction;
- private ISelection selection;
-
- public void init(IWorkbenchWindow window)
- {
- this.openAction = new NewWizardAction("org.eclipse.wst.wsdl.ui");
- }
-
- public void run(IAction action)
- {
- openAction.setSelection(selection);
- openAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public void dispose()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWizardAction.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWizardAction.java
deleted file mode 100644
index 842c2a3..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewWizardAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.wizards.IWizardDescriptor;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-public class NewWizardAction extends Action
-{
- private static final int SIZING_WIZARD_WIDTH = 500;
- private static final int SIZING_WIZARD_HEIGHT = 500;
-
- private ISelection selection;
- private String id;
-
- public NewWizardAction(String id)
- {
- this.id = id;
- }
-
- @Override
- public void run()
- {
- IWizardDescriptor desc = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id);
- if (desc == null)
- return;
- try
- {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- IWorkbenchWizard wizard = desc.createWizard();
-
- IStructuredSelection ssel = null;
- if (selection instanceof IStructuredSelection)
- {
- ssel = (IStructuredSelection) selection;
- }
- else
- {
- ssel = new StructuredSelection();
- }
- wizard.init(PlatformUI.getWorkbench(), ssel);
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(),IWorkbenchHelpContextIds.NEW_WIZARD);
- dialog.open();
- }
- catch (CoreException e)
- {
- XSLUIPlugin.log(e);
- }
- }
-
- public void setSelection(ISelection selection)
- {
- this.selection = selection;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXMLFileWizardDelegate.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXMLFileWizardDelegate.java
deleted file mode 100644
index b5232f8..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXMLFileWizardDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class NewXMLFileWizardDelegate implements IWorkbenchWindowActionDelegate
-{
- private NewWizardAction openAction;
- private ISelection selection;
-
- public void init(IWorkbenchWindow window)
- {
- this.openAction = new NewWizardAction("org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard");
- }
-
- public void run(IAction action)
- {
- openAction.setSelection(selection);
- openAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public void dispose()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSDFileWizardDelegate.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSDFileWizardDelegate.java
deleted file mode 100644
index e521fdb..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSDFileWizardDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class NewXSDFileWizardDelegate implements IWorkbenchWindowActionDelegate
-{
- private NewWizardAction openAction;
- private ISelection selection;
-
- public void init(IWorkbenchWindow window)
- {
- this.openAction = new NewWizardAction("org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard");
- }
-
- public void run(IAction action)
- {
- openAction.setSelection(selection);
- openAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public void dispose()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSLFileWizardDelegate.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSLFileWizardDelegate.java
deleted file mode 100644
index e14ca33..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/actions/NewXSLFileWizardDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class NewXSLFileWizardDelegate implements IWorkbenchWindowActionDelegate
-{
- private NewWizardAction openAction;
- private ISelection selection;
-
- public void init(IWorkbenchWindow window)
- {
- this.openAction = new NewWizardAction("org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard");
- }
-
- public void run(IAction action)
- {
- openAction.setSelection(selection);
- openAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public void dispose()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXMLElementContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXMLElementContentAssistRequest.java
deleted file mode 100644
index c248d74..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXMLElementContentAssistRequest.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper;
-import org.eclipse.wst.xsl.ui.internal.contentassist.contentmodel.XSLContentModelGenerator;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Adopters can extend this class to implement their own content assistance for Element
- * proposals using the XML Content Model.
- *
- * @author David Carver
- *
- */
-public abstract class AbstractXMLElementContentAssistRequest extends AbstractXSLContentAssistRequest {
-
- protected static final String XPATH_FIRST_XSLANCESTOR_NODE = "ancestor::xsl:*[1]";
- protected MarkupTagInfoProvider infoProvider = null;
- protected XSLContentModelGenerator contentModel;
-
- /**
- *
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public AbstractXMLElementContentAssistRequest(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length, filter, textViewer);
- }
-
- protected Iterator<CMNode> getAvailableContentNodes(IDOMDocument domDocument, Node ancestorNode, int includeOptions) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(domDocument);
- CMElementDeclaration cmElementDec = modelQuery.getCMElementDeclaration((Element)ancestorNode);
- List <CMNode> cmNodeList = modelQuery.getAvailableContent((Element)ancestorNode, cmElementDec, includeOptions);
- Iterator <CMNode> cmNodeIt = cmNodeList.iterator();
- return cmNodeIt;
- }
-
- protected CustomCompletionProposal createProposal(String proposedText, String additionalInfo, int offset,
- Image image, int startLength) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, offset, 0, startLength + proposedText.length() - getMatchString().length(),
- image, proposedText, null, additionalInfo, 0, true);
- return proposal;
- }
-
- protected Image getCMNodeImage(CMNode cmNode) {
- Image image = CMImageUtil.getImage(cmNode);
- if (image == null) {
- image = XMLEditorPluginImageHelper
- .getInstance()
- .getImage(
- XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- return image;
- }
-
- protected String getRequiredName(Node ownerNode, CMNode cmnode) {
- if (ownerNode != null) {
- return DOMNamespaceHelper.computeName(cmnode, ownerNode, null);
- }
- return cmnode.getNodeName();
- }
-
- /**
- * Retrieves cmnode's documentation to display in the completion proposal's
- * additional info. If no documentation exists for cmnode, try displaying
- * parentOrOwner's documentation
- *
- * String any documentation information to display for cmnode.
- * <code>null</code> if there is nothing to display.
- */
- protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
- String addlInfo = null;
-
- if (cmnode == null) {
- if (Debug.displayWarnings) {
- new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
- }
- return null;
- }
-
- addlInfo = getInfoProvider().getInfo(cmnode);
- if ((addlInfo == null) && (parentOrOwner != null)) {
- addlInfo = getInfoProvider().getInfo(parentOrOwner);
- }
- return addlInfo;
- }
-
- /**
- * Gets the infoProvider.
- *
- * fInfoProvider and if fInfoProvider was <code>null</code> create a new
- * instance
- */
- protected MarkupTagInfoProvider getInfoProvider() {
- if (infoProvider == null) {
- infoProvider = new MarkupTagInfoProvider();
- }
- return infoProvider;
- }
-
- protected boolean beginsWith(String aString, String prefix) {
- if ((aString == null) || (prefix == null)) {
- return true;
- }
- return aString.toLowerCase().startsWith(prefix.toLowerCase());
- }
-
- /**
- * Check to see if the current position is in an Attribute Region if so,
- * return true otherwise false
- * @return True if in attribute region, false otherwise.
- */
- protected boolean inAttributeRegion() {
- return replacementBeginPosition > documentRegion.getStartOffset(region) + region.getLength();
- }
-
- /**
- * Adds proposals for the XML_TAG_NAME region.
- * @param position
- */
- protected void addTagNameProposals(int position) {
-
- Node ancestorNode = null;
- try {
- ancestorNode = XSLTXPathHelper.selectSingleNode(getNode(),
- XPATH_FIRST_XSLANCESTOR_NODE);
- } catch (Exception ex) {
- return;
- }
-
- List<CMNode> cmnodes = null;
-
- if (ancestorNode.getNodeType() == Node.ELEMENT_NODE) {
- cmnodes = getAvailableChildElementDeclarations(
- (Element) ancestorNode, 0);
- Iterator<CMNode> nodeIterator = cmnodes.iterator();
- // chop off any leading <'s and whitespace from the matchstring
- while ((matchString.length() > 0)
- && (Character.isWhitespace(matchString.charAt(0)) || beginsWith(
- matchString, "<"))) {
- //$NON-NLS-1$
- matchString = matchString.substring(1);
- }
- if (!nodeIterator.hasNext()) {
- return;
- }
- while (nodeIterator.hasNext()) {
- CMNode elementDecl = nodeIterator.next();
- if (elementDecl != null) {
- // only add proposals for the child element's that begin
- // with the matchstring
- String proposedText = null;
-
- proposedText = contentModel.getRequiredName(ancestorNode,
- elementDecl);
- int cursorAdjustment = proposedText.length();
-
- if (elementDecl instanceof CMElementDeclaration) {
- CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
- if (ed.getContentType() == CMElementDeclaration.EMPTY) {
- proposedText += contentModel.getStartTagClose(
- ancestorNode, ed);
- cursorAdjustment = proposedText.length();
- } else {
- StringBuffer sb = new StringBuffer();
- contentModel.generateTag(ancestorNode, ed, sb);
- // since it's a name proposal, assume '<' is
- // already there
- // only return the rest of the tag
- proposedText = sb.toString().substring(1);
- cursorAdjustment = getCursorPositionForProposedText(proposedText);
-
- }
- }
- if (beginsWith(proposedText, matchString)) {
- Image image = CMImageUtil.getImage(elementDecl);
- if (image == null) {
- image = XMLEditorPluginImageHelper
- .getInstance()
- .getImage(
- XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- String proposedInfo = getAdditionalInfo(
- getCMElementDeclaration(getParent()), elementDecl);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- proposedText, getReplacementBeginPosition(),
- getReplacementLength(), cursorAdjustment,
- image, contentModel.getRequiredName(getParent(),
- elementDecl), null, proposedInfo,
- XMLRelevanceConstants.R_TAG_NAME);
- addProposal(proposal);
- }
- }
- }
- }
-
- }
-
- /** Returns a list of CMNodes that are available within this parent context
- * Given the grammar shown below and a snippet of XML code (where the '|'
- * indicated the cursor position)
- * the list would return all of the element declarations that are
- * potential child elements of Foo.
- *
- * grammar : Foo -> (A, B, C)
- * snippet : <Foo><A>|
- * result : {A, B, C}
- *
- * @param parent
- * @param childPosition
- * @return
- */
- protected List<CMNode> getAvailableChildElementDeclarations(Element parent,
- int childPosition) {
- List modelQueryActions = getAvailableChildrenAtIndex(parent,
- childPosition, ModelQuery.VALIDITY_NONE);
- Iterator iterator = modelQueryActions.iterator();
- List<CMNode> cmnodes = new Vector();
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- if ((childPosition < 0)
- || (((action.getStartIndex() <= childPosition) && (childPosition <= action
- .getEndIndex())))) {
- CMNode actionCMNode = action.getCMNode();
- if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
- cmnodes.add(actionCMNode);
- }
- }
- }
- return cmnodes;
- }
-
- protected List getAvailableChildrenAtIndex(Element parent, int index,
- int validityChecking) {
- List list = new ArrayList();
- CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
- if (parentDecl != null) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent
- .getOwnerDocument());
- // taken from ActionManagers
- // int editMode = modelQuery.getEditMode();
- int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
- int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES
- | ModelQuery.INCLUDE_SEQUENCE_GROUPS
- : ModelQuery.INCLUDE_CHILD_NODES;
- modelQuery.getInsertActions(parent, parentDecl, index, ic,
- validityChecking, list);
- }
- return list;
- }
-
- protected CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node
- .getOwnerDocument());
- if (modelQuery != null) {
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- }
- return result;
- }
-
- protected int getElementPosition(Node child) {
- Node parent = child.getParentNode();
- if (parent == null) {
- return 0;
- }
-
- NodeList children = parent.getChildNodes();
- if (children == null) {
- return 0;
- }
- int count = 0;
-
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i) == child) {
- return count;
- } else {
- // if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
- count++;
- }
- }
- return 0;
- }
-
- /**
- * This is the position the cursor should be in after the proposal is
- * applied
- *
- * @param proposedText
- * @return the position the cursor should be in after the proposal is
- * applied
- */
- protected int getCursorPositionForProposedText(String proposedText) {
- int cursorAdjustment;
- cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
- // otherwise, after the first tag
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.indexOf('>') + 1;
- }
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.length() + 1;
- }
-
- return cursorAdjustment;
- }
-
- protected ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- Iterator regionList = flatNode.getRegions().iterator();
- while (regionList.hasNext()) {
- ITextRegion region = (ITextRegion) regionList.next();
- if (isNameRegion(region)) {
- return region;
- }
- }
- return null;
- }
-
- /**
- * Checks to the see if the element is in the correct region.
- * @param region
- * @return
- */
- protected boolean isNameRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_TAG_NAME)
- || (type == DOMRegionContext.XML_ELEMENT_DECL_NAME)
- || (type == DOMRegionContext.XML_DOCTYPE_NAME) || (type == DOMRegionContext.XML_ATTLIST_DECL_NAME));
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXSLContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXSLContentAssistRequest.java
deleted file mode 100644
index 177f8cc..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/AbstractXSLContentAssistRequest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * An extension of the XML ContentAssistRequest class. This provides
- * a basis for the XSL content assistance. Classes may subclass this
- * class and implement specific functionality.
- *
- * @author dcarver
- *
- */
-public abstract class AbstractXSLContentAssistRequest implements IContentAssistProposalRequest {
- protected IStructuredDocumentRegion documentRegion = null;
- protected ArrayList<ICompletionProposal> macros = new ArrayList<ICompletionProposal>();
- protected String matchString;
- protected Node node = null;
- protected ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- protected ITextRegion region = null;
- protected int replacementBeginPosition;
- protected int replacementLength;
- protected ITextViewer textViewer = null;
-
-
- /**
- * Handles Content Assistance requests for Select Attributes. This is called an instantiated
- * through the use of the computeProposals method from the XSLContentAssistProcessor. It will
- * calculate the available proposals that are available for the XSL select attribute.
- *
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
-
- public AbstractXSLContentAssistRequest(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- setNode(node);
- setDocumentRegion(documentRegion);
- setRegion(completionRegion);
- setMatchString(filter);
- setReplacementBeginPosition(begin);
- setReplacementLength(length);
- this.textViewer = textViewer;
- }
-
- /**
- * Returns a list of proposals. Implementations are to provide the appropriate
- * implementation for the proposals they would like to return. Use of the getAllCompletionProposals
- * should be used to return the actual proposals from this method.
- * @return
- */
- public abstract ArrayList<ICompletionProposal> getCompletionProposals();
-
- protected ArrayList<ICompletionProposal> getAllCompletionProposals() {
- ArrayList<ICompletionProposal> allProposals = new ArrayList<ICompletionProposal>();
- if ((getProposals().size() > 0) || (getMacros().size() > 0)) {
- allProposals.addAll(getProposals());
- allProposals.addAll(getMacros());
- allProposals = sortProposals(allProposals);
- }
- return allProposals;
- }
-
-
- /**
- * Checks to make sure that the NodeList has data
- * @param nodes A NodeList object
- * @return True if has data, false if empty
- */
- protected boolean hasNodes(NodeList nodes) {
- return nodes != null && nodes.getLength() > 0;
- }
-
- /**
- * Get the cursor position within the Text Viewer
- * @return An int value containing the cursor position
- */
- protected int getCursorPosition() {
- return textViewer.getTextWidget().getCaretOffset();
- }
-
- protected Collection<NamespaceInfo> getNamespaces(IDOMElement element) {
- NamespaceTable table = new NamespaceTable(element.getOwnerDocument());
- table.visitElement(element);
-
- Collection<NamespaceInfo> namespaceInfoList = table.getNamespaceInfoCollection();
-
- return namespaceInfoList;
- }
-
- /**
- * Retrieves the base location for the IDOMDocument for this class. This is
- * used to populate a new Path class for retrieving an IFile instance.
- * @return
- */
- protected String getLocation() {
- IDOMDocument document = (IDOMDocument) node.getOwnerDocument();
- return document.getModel().getBaseLocation();
- }
-
- /**
- * @param newProposal
- */
- protected void addMacro(ICompletionProposal newProposal) {
- macros.add(newProposal);
- }
-
- protected void addProposal(ICompletionProposal newProposal) {
- proposals.add(newProposal);
- }
-
- protected IStructuredDocumentRegion getDocumentRegion() {
- return documentRegion;
- }
-
- protected List<ICompletionProposal> getMacros() {
- return macros;
- }
-
- protected java.lang.String getMatchString() {
- return matchString;
- }
-
- protected org.w3c.dom.Node getNode() {
- return node;
- }
-
- protected org.w3c.dom.Node getParent() {
- return node.getParentNode();
- }
-
- protected List<ICompletionProposal> getProposals() {
- return proposals;
- }
-
- protected ITextRegion getRegion() {
- return region;
- }
-
- protected int getReplacementBeginPosition() {
- return replacementBeginPosition;
- }
-
- protected int getReplacementLength() {
- return replacementLength;
- }
-
- protected int getStartOffset() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getStartOffset(getRegion());
- }
- return -1;
- }
-
- protected String getText() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getText(getRegion());
- }
- return ""; //$NON-NLS-1$
- }
-
- protected int getTextEndOffset() {
- if ((getDocumentRegion() != null) && (getRegion() != null)) {
- return ((ITextRegionCollection) getDocumentRegion()).getTextEndOffset(getRegion());
- }
- return -1;
- }
-
- protected void setDocumentRegion(IStructuredDocumentRegion region) {
- documentRegion = region;
- }
-
- protected void setMatchString(java.lang.String newMatchString) {
- matchString = newMatchString;
- }
-
-
- protected void setNode(org.w3c.dom.Node newNode) {
- node = newNode;
- }
-
-
- protected void setRegion(ITextRegion newRegion) {
- region = newRegion;
- }
-
- protected void setReplacementBeginPosition(int newReplacementBeginPosition) {
- replacementBeginPosition = newReplacementBeginPosition;
- }
-
-
- protected void setReplacementLength(int newReplacementLength) {
- replacementLength = newReplacementLength;
- }
-
- protected ArrayList<ICompletionProposal> sortProposals(ArrayList<ICompletionProposal> proposalsIn) {
- Collections.sort(proposalsIn, new ProposalComparator());
- return proposalsIn;
-
- }
-
- /**
- *
- * @return java.lang.String
- */
- @Override
- public java.lang.String toString() {
- return "Node: " + getNode() //$NON-NLS-1$
- + "\nParent: " + getParent() //$NON-NLS-1$
- + "\nStructuredDocumentRegion: " + StringUtils.escape(getDocumentRegion().toString()) //$NON-NLS-1$
- + "\nRegion: " + getRegion() //$NON-NLS-1$
- + "\nMatch string: '" + StringUtils.escape(getMatchString()) + "'" //$NON-NLS-2$//$NON-NLS-1$
- + "\nOffsets: [" + getReplacementBeginPosition() + "-" + (getReplacementBeginPosition() + getReplacementLength()) + "]\n"; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
-
- protected StylesheetModel getStylesheetModel() {
- IFile editorFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(getLocation()));
- StylesheetModel model = XSLCore.getInstance().getStylesheet(editorFile);
- return model;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CallTemplateContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CallTemplateContentAssistRequest.java
deleted file mode 100644
index 21a20b5..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CallTemplateContentAssistRequest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards in Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 243575 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.core.model.Template;
-import org.eclipse.wst.xsl.core.model.XSLAttribute;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * CallTemplateContentAssistance provides content assist proposals for
- * <xsl:call-with> templates. It will provide a list of all available
- * named templates.
- *
- * @author David Carver
- *
- */
-public class CallTemplateContentAssistRequest extends
- AbstractXSLContentAssistRequest {
-
- private static final String ATTR_MODE = "mode";
- private static final String ATTR_NAME = "name";
-
- /**
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public CallTemplateContentAssistRequest(Node node, IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length,
- filter, textViewer);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- proposals.clear();
-
- IFile editorFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(getLocation()));
-
- StylesheetModel model = XSLCore.getInstance().getStylesheet(editorFile);
-
- List<Template> templates = model.getTemplates();
-
- for (Template template : templates) {
- XSLAttribute attribute = template.getAttribute(ATTR_NAME);
- if (attribute != null) {
- String proposalInfo = getAdditionalInfo(template);
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- attribute.getValue(), getStartOffset() + 1, 0,
- attribute.getValue().length(), XSLPluginImageHelper
- .getInstance().getImage(
- XSLPluginImages.IMG_TEMPLATE), attribute
- .getValue(), null, proposalInfo, 0);
- addProposal(proposal);
- }
- }
- return getAllCompletionProposals();
- }
-
- protected String getAdditionalInfo(Template template) {
- XSLAttribute nameAttribute = template.getAttribute(ATTR_NAME);
-
- String proposalInfo = "Template Name: " + nameAttribute.getValue() +
- "\r\n" + "File:" + template.getStylesheet().getFile().getName();
-
- return proposalInfo;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CustomCompletionProposal.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CustomCompletionProposal.java
deleted file mode 100644
index 37a5e8a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/CustomCompletionProposal.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-
-public class CustomCompletionProposal extends
- org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal
- implements ICompletionProposalExtension4 {
-
- /**
- * @param replacementString
- * @param replacementOffset
- * @param replacementLength
- * @param cursorPosition
- * @param image
- * @param displayString
- * @param contextInformation
- * @param additionalProposalInfo
- * @param relevance
- */
- public CustomCompletionProposal(String replacementString,
- int replacementOffset, int replacementLength, int cursorPosition,
- Image image, String displayString,
- IContextInformation contextInformation,
- String additionalProposalInfo, int relevance) {
- super(replacementString, replacementOffset, replacementLength,
- cursorPosition, image, displayString, contextInformation,
- additionalProposalInfo, relevance);
- }
-
- /**
- * @param replacementString
- * @param replacementOffset
- * @param replacementLength
- * @param cursorPosition
- * @param image
- * @param displayString
- * @param contextInformation
- * @param additionalProposalInfo
- * @param relevance
- * @param updateReplacementLengthOnValidate
- */
- public CustomCompletionProposal(String replacementString,
- int replacementOffset, int replacementLength, int cursorPosition,
- Image image, String displayString,
- IContextInformation contextInformation,
- String additionalProposalInfo, int relevance,
- boolean updateReplacementLengthOnValidate) {
- super(replacementString, replacementOffset, replacementLength,
- cursorPosition, image, displayString, contextInformation,
- additionalProposalInfo, relevance,
- updateReplacementLengthOnValidate);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension4#isAutoInsertable()
- */
- public boolean isAutoInsertable() {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/ExcludeResultPrefixesContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/ExcludeResultPrefixesContentAssist.java
deleted file mode 100644
index 6a4eba1..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/ExcludeResultPrefixesContentAssist.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 230136 - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.ui.internal.Messages;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * Provides content assistance for xsl elements that have the
- * exclude-result-prefixes attribute. This will provide a list
- * of all known result prefixes that aren't currently in the attribute
- * list. This list is a space separated list. The XSL prefix is
- * excluded.
- *
- * @author dcarver
- * @since 1.0
- *
- */
-public class ExcludeResultPrefixesContentAssist extends AbstractXSLContentAssistRequest {
- private static final String EXCLUDE_RESULT_PREFIXES = "exclude-result-prefixes"; //$NON-NLS-1$
- private static final String DEFAULT = "#all"; //$NON-NLS-1$
- private static final String ADDITIONAL_INFO = Messages.ExcludeResultPrefixesContentAssist;
- protected String[] tokens = null;
-
- /**
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public ExcludeResultPrefixesContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length, filter, textViewer);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- proposals.clear();
-
- IDOMAttr attrNode = (IDOMAttr)((IDOMElement)getNode()).getAttributeNode(EXCLUDE_RESULT_PREFIXES);
- String excludeResultPrefixes = attrNode.getValue();
- int offset = getCursorPosition();
-
- if (excludeResultPrefixes == null || excludeResultPrefixes.equals(DEFAULT)) {
- return getAllCompletionProposals();
- }
-
- tokens = excludeResultPrefixes.split("\\s"); //$NON-NLS-1$
- if (tokens[0].equals("")) { //$NON-NLS-1$
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- DEFAULT, offset, 0, DEFAULT.length(),
- XSLPluginImageHelper.getInstance().getImage(XSLPluginImages.IMG_PREFIX),
- DEFAULT, null, null, 0);
- addProposal(proposal);
- }
- Collection<NamespaceInfo> namespaces = this.getNamespaces((IDOMElement)node);
- for (NamespaceInfo namespace : namespaces) {
-
- if (includePrefix(namespace)) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- namespace.prefix, offset, 0, namespace.prefix.length(),
- XSLPluginImageHelper.getInstance().getImage(XSLPluginImages.IMG_PREFIX),
- namespace.prefix, null, namespace.uri, 0);
- addProposal(proposal);
- }
- }
-
- return getAllCompletionProposals();
- }
-
- protected boolean includePrefix(NamespaceInfo namespace) {
- return !prefixExists(namespace.prefix) && !namespace.prefix.equals("") && !namespace.uri.equals(XSLCore.XSL_NAMESPACE_URI); //$NON-NLS-1$
- }
-
-
- protected boolean prefixExists(String prefix) {
- if (tokens == null || tokens.length == 0) {
- return false;
- }
- for (int cnt = 0; cnt < tokens.length; cnt++) {
- if (prefix.equals(tokens[cnt])) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/IContentAssistProposalRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/IContentAssistProposalRequest.java
deleted file mode 100644
index d294d1a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/IContentAssistProposalRequest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Provides content assistance ICompletionProposals.
- *
- * @author David Carver
- *
- */
-public interface IContentAssistProposalRequest {
-
- /**
- * Completion Proposals for a Content Assist Request.
- * @return
- */
- public ArrayList<ICompletionProposal> getCompletionProposals();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/NullContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/NullContentAssistRequest.java
deleted file mode 100644
index b78b7bf..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/NullContentAssistRequest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.Node;
-
-/**
- * An empty content assist request.
- * @author dcarver
- *
- */
-public class NullContentAssistRequest extends AbstractXSLContentAssistRequest {
- private ArrayList<ICompletionProposal> emptyProposals = new ArrayList<ICompletionProposal>();
-
- /**
- * A NULL ContentAssistRequest has no proposals.
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public NullContentAssistRequest(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length,
- filter, textViewer);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- return emptyProposals;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/SelectAttributeContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/SelectAttributeContentAssist.java
deleted file mode 100644
index 9cd1982..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/SelectAttributeContentAssist.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008, 2009 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 240170 - initial API and implementation
- * bug 259575 - fixed replacement issue and XPath tokenizer
- * position adjuster for matchString.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xsl.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.xpath.core.internal.parser.XPathParser;
-import org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper;
-import org.eclipse.wst.xml.xpath.ui.internal.contentassist.XPathTemplateCompletionProcessor;
-import org.eclipse.wst.xml.xpath.ui.internal.templates.TemplateContextTypeIdsXPath;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * This class provides content assistance for the XSL select attribute.
- *
- * @author dcarver
- *
- */
-public class SelectAttributeContentAssist extends AbstractXSLContentAssistRequest {
-
- private static final String XPATH_GLOBAL_VARIABLES = "/xsl:stylesheet/xsl:variable"; //$NON-NLS-1$
-
- /**
- * Retrieve all global parameters in the stylesheet.
- */
- private static final String XPATH_GLOBAL_PARAMS = "/xsl:stylesheet/xsl:param"; //$NON-NLS-1$
-
- /**
- * Limit selection of variables to those that are in the local scope.
- */
- private static final String XPATH_LOCAL_VARIABLES = "ancestor::xsl:template/descendant::xsl:variable"; //$NON-NLS-1$
-
- /**
- * Limit selection of params to those that are in the local scope.
- */
- private static final String XPATH_LOCAL_PARAMS = "ancestor::xsl:template/descendant::xsl:param"; //$NON-NLS-1$
-
- private XPathTemplateCompletionProcessor fTemplateProcessor = null;
- private List<String> fTemplateContexts = new ArrayList<String>();
- private static final byte[] XPATH_LOCK = new byte[0];
-
- /**
- * Handles Content Assistance requests for Select Attributes. This is called an instantiated
- * through the use of the computeProposals method from the XSLContentAssistProcessor. It will
- * calculate the available proposals that are available for the XSL select attribute.
- *
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public SelectAttributeContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length, filter, textViewer);
- // TODO Auto-generated constructor stub
- }
-
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- proposals.clear();
-
- adjustXPathStart();
-
- int offset = getReplacementBeginPosition();
- IDOMAttr attrNode = getAttribute("select");
-
- this.matchString = extractXPathMatchString(attrNode, getRegion(), getReplacementBeginPosition());
-
- addSelectProposals((Element)getNode().getParentNode(), offset);
-
- return getAllCompletionProposals();
- }
-
-
- private IDOMAttr getAttribute(String attrName) {
- return (IDOMAttr)((IDOMElement)getNode()).getAttributeNode(attrName);
- }
-
-
-
- /**
- * This needs to setup the content assistance correctly. Here is what needs to happen:
- * 1. Adjust the matchString (This should have been calculated earlier)
- * 2. Get the current tokens offset position..this will be the starting offset.
- * 3. Get the replacement length...this is the difference between the token offset and the next token or end of the string
- */
- protected void adjustXPathStart() {
- IDOMElement elem = (IDOMElement)getNode();
- IDOMAttr xpathNode = (IDOMAttr)elem.getAttributeNode("select");
-
- if (xpathNode != null) {
- XPathParser parser = new XPathParser(xpathNode.getValue());
- int startOffset = xpathNode.getValueRegionStartOffset() + parser.getTokenStartOffset(1, getReplacementBeginPosition() - xpathNode.getValueRegionStartOffset()) - 1;
- replacementLength = getReplacementBeginPosition() - startOffset;
- }
- }
-
- protected String extractXPathMatchString(IDOMAttr node, ITextRegion aRegion, int offset) {
- if (node == null || node.getValue().length() == 0) return "";
-
- if (matchString.length() < 1) {
- return matchString;
- }
-
- int column = offset - node.getValueRegionStartOffset() - 1;
- String nodeValue = node.getValue();
-
- int seperatorPos = getXPathSeperatorPos(column, nodeValue);
-
- if (seperatorPos >= column) {
- return "";
- }
-
- return node.getValue().substring(seperatorPos, column);
- }
-
-
- private int getXPathSeperatorPos(int column, String nodeValue) {
- char [] keyTokens = { '/', '[', ']', '(', ')', ',', ' '};
-
- int seperatorPos = 0;
-
- String potentialMatchString = nodeValue.substring(0, column);
-
- for (int cnt = 0; cnt < keyTokens.length; cnt++) {
- int keyPos = potentialMatchString.lastIndexOf(keyTokens[cnt]);
- if (keyPos >= 0 && keyPos <= column - 1) {
- seperatorPos = keyPos + 1;
- }
- }
-
- int axisPos = nodeValue.indexOf("::");
- if (axisPos > seperatorPos && axisPos <= column -1) {
- seperatorPos = axisPos + 1;
- }
- return seperatorPos;
- }
-
-
- protected void addSelectProposals(Element rootElement, int offset) {
- addContentModelProposals(offset);
- addGlobalProposals(rootElement, offset);
- addLocalProposals(getNode(), offset);
- addTemplates(TemplateContextTypeIdsXPath.AXIS, offset);
- addTemplates(TemplateContextTypeIdsXPath.XPATH, offset);
- addTemplates(TemplateContextTypeIdsXPath.CUSTOM, offset);
- addTemplates(TemplateContextTypeIdsXPath.OPERATOR, offset);
- }
-
-
- private void addContentModelProposals(int offset) {
- AbstractXMLElementContentAssistRequest xpathXMLproposals =
- new XPathElementContentAssist(node, documentRegion, getRegion(), offset - getMatchString().length(), getReplacementLength(), getMatchString(), textViewer);
- ArrayList<ICompletionProposal> xmlProposals = xpathXMLproposals.getCompletionProposals();
- proposals.addAll(xmlProposals);
- }
-
-
-
- /**
- * Adds XPath related templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- * @param startOffset
- */
- protected void addTemplates(String context, int startOffset) {
-
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor()
- .computeCompletionProposals(textViewer, startOffset);
- for (int i = 0; i < proposals.length; ++i) {
- ICompletionProposal proposal = proposals[i];
- if (matchString.length() > 0) {
- if (proposal.getDisplayString().startsWith(matchString) ) {
- addProposal(proposals[i]);
- }
- } else {
- addProposal(proposals[i]);
- }
- }
- }
- }
- }
-
-
-
- private void addLocalProposals(Node xpathnode, int offset) {
- addVariablesProposals(XPATH_LOCAL_VARIABLES, xpathnode, offset);
- addVariablesProposals(XPATH_LOCAL_PARAMS, xpathnode, offset);
- }
-
- private void addGlobalProposals(Node xpathnode, int offset) {
- addVariablesProposals(XPATH_GLOBAL_VARIABLES, xpathnode, offset);
- addVariablesProposals(XPATH_GLOBAL_PARAMS, xpathnode, offset);
- }
-
- /**
- * Adds Parameter and Variables as proposals. This
- * information is selected based on the XPath statement that is sent to it
- * and the input Node passed. It uses a custom composer to XSL Variable
- * proposal.
- *
- * @param xpath
- * @param xpathnode
- * @param contentAssistRequest
- * @param offset
- */
- private void addVariablesProposals(String xpath, Node xpathnode, int offset) {
- synchronized (XPATH_LOCK) {
- try {
- NodeList nodes = XSLTXPathHelper.selectNodeList(xpathnode, xpath);
- int startLength = getCursorPosition() - offset;
-
- if (hasNodes(nodes)) {
- for (int nodecnt = 0; nodecnt < nodes.getLength(); nodecnt++) {
- Node node = nodes.item(nodecnt);
-
- String variableName = "$" + node.getAttributes().getNamedItem("name").getNodeValue(); //$NON-NLS-1$ //$NON-NLS-2$
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- variableName, offset, 0, startLength + variableName.length(),
- XSLPluginImageHelper.getInstance().getImage(XSLPluginImages.IMG_VARIABLES),
- variableName, null, null, 0);
-
- if (matchString.length() > 0) {
- if (proposal.getDisplayString().startsWith(matchString)) {
- addProposal(proposal);
- }
- } else {
- addProposal(proposal);
- }
- }
- }
-
- } catch (TransformerException ex) {
- XSLUIPlugin.log(ex);
- }
- }
- }
-
- private XPathTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new XPathTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateModeAttributeContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateModeAttributeContentAssist.java
deleted file mode 100644
index 2332b5a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateModeAttributeContentAssist.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 243578 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.core.model.Template;
-import org.eclipse.wst.xsl.core.model.XSLAttribute;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * TemplateModeAttributeContentAssist provides content assistance proposals for
- * <xsl:templates> with a mode attribute. It looks at all the modes defined
- * within the xsl model, and pulls out any modes that have been defined.
- * @author dcarver
- * @since 1.0
- */
-public class TemplateModeAttributeContentAssist extends
- AbstractXSLContentAssistRequest {
-
- /**
- * Constructor for creating the TemplateMode Content Assistance class.
- *
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public TemplateModeAttributeContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length,
- filter, textViewer);
- }
-
- /**
- * The main method that returns an array of proposals. Returns the available
- * modes that have been defined in the {@link StylesheetModel}. If no proposals
- * are found it returns a NULL value.
- * @return ICompletionPropsal[]
- * @see org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- proposals.clear();
-
- StylesheetModel model = getStylesheetModel();
-
- addModeProposals(model);
- return getAllCompletionProposals();
- }
-
- /**
- * @param model
- */
- protected void addModeProposals(StylesheetModel model) {
- List<Template> templates = model.getTemplates();
- ArrayList<String> modes = new ArrayList<String>();
-
- for (Template template : templates) {
- XSLAttribute attribute = template.getAttribute("mode");
- IDOMNode xmlNode = (IDOMNode)node;
-
- if (attribute != null && xmlNode.getStartOffset() != template.getOffset()) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- attribute.getValue(), getStartOffset() + 1, 0,
- attribute.getValue().length(), XSLPluginImageHelper
- .getInstance().getImage(
- XSLPluginImages.IMG_MODE), attribute
- .getValue(), null, null, 0);
- if (modes.indexOf(attribute.getValue()) == -1) {
- proposals.add(proposal);
- modes.add(attribute.getValue());
- }
- }
- }
- modes.clear();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateNameAttributeContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateNameAttributeContentAssist.java
deleted file mode 100644
index 8125af9..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TemplateNameAttributeContentAssist.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) bug 243577 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xsl.core.model.CallTemplate;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * Provides content assistance for XSLT Named Templates. It provides a list
- * of available call-template names that have already been used with in the
- * stylesheet.
- *
- * @author David Carver
- * @since 1.0
- */
-public class TemplateNameAttributeContentAssist extends AbstractXSLContentAssistRequest {
-
- private static final String ATTR_NAME = "name";
-
- /**
- * Provides content assistance for XSLT Named Templates. Will provide a list
- * of proposals based on the available named-templates if any are defined in
- * the XSL Stylesheet model. Only provides a list of named templates that haven't already
- * been added as a proposal. Does not check to see if it's already is defined in the current stylesheet.
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public TemplateNameAttributeContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length, filter, textViewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsl.ui.internal.contentassist.AbstractXSLContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- proposals.clear();
-
- StylesheetModel model = getStylesheetModel();
- List<CallTemplate> templates = model.getCallTemplates();
-
- for (CallTemplate template : templates) {
- CustomCompletionProposal proposal = createProposal(template);
- addUniqueProposal(proposal);
- }
-
- return getAllCompletionProposals();
- }
-
- private void addUniqueProposal(CustomCompletionProposal proposal) {
- if (proposals.lastIndexOf(proposal) == -1) {
- if (matchString.length() > 0) {
- if (proposal.getDisplayString().startsWith(matchString)) {
- addProposal(proposal);
- }
- } else {
- addProposal(proposal);
- }
- }
- }
-
- private CustomCompletionProposal createProposal(CallTemplate template) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- template.getAttributeValue(ATTR_NAME), getStartOffset() + 1, 0,
- template.getAttributeValue(ATTR_NAME).length(), XSLPluginImageHelper
- .getInstance().getImage(
- XSLPluginImages.IMG_TEMPLATE), template
- .getAttributeValue(ATTR_NAME), null, null, 0);
- return proposal;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TestAttributeContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TestAttributeContentAssist.java
deleted file mode 100644
index 971ebb4..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/TestAttributeContentAssist.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 240170 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.xpath.core.internal.parser.XPathParser;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class provides content assistance for the xsl <emphasis>test</emphais> attribute.
- *
- * @author dcarver
- *
- */
-public class TestAttributeContentAssist extends SelectAttributeContentAssist {
-
- private String ATTR_TEST = "test"; //$NON-NLS$
- /**
- * Constructor for the XSL content assistance for the test attribute.
- *
- * @param node
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public TestAttributeContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length, filter,
- textViewer);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xsl.ui.internal.contentassist.SelectAttributeContentAssist#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
-
- adjustXPathStart();
-
- int offset = getReplacementBeginPosition();
- IDOMAttr attrNode = (IDOMAttr)((IDOMElement)getNode()).getAttributeNode("test");
-
- matchString = extractXPathMatchString(attrNode, getRegion(), getReplacementBeginPosition());
-
- addSelectProposals((Element)getNode().getParentNode(), offset);
-
- return getAllCompletionProposals();
- }
-
- /**
- * This needs to setup the content assistance correctly. Here is what needs to happen:
- * 1. Adjust the matchString (This should have been calculated earlier)
- * 2. Get the current tokens offset position..this will be the starting offset.
- * 3. Get the replacement length...this is the difference between the token offset and the next token or end of the string
- */
- @Override
- protected void adjustXPathStart() {
- IDOMElement elem = (IDOMElement)getNode();
- IDOMAttr xpathNode = (IDOMAttr)elem.getAttributeNode(ATTR_TEST);
-
- if (xpathNode != null) {
- XPathParser parser = new XPathParser(xpathNode.getValue());
- int startOffset = xpathNode.getValueRegionStartOffset() + parser.getTokenStartOffset(1, getReplacementBeginPosition() - xpathNode.getValueRegionStartOffset()) - 1;
- replacementLength = getReplacementBeginPosition() - startOffset;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XPathElementContentAssist.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XPathElementContentAssist.java
deleted file mode 100644
index 99908b4..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XPathElementContentAssist.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008, 2009 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 244978 - initial API and implementation
- * bug 259575 - replaces text if MatchString has a length with XML Content Model
- * proposals.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-import org.w3c.dom.Node;
-
-/**
- * This class provides XML Element proposals within XPath related items like
- * select, test, and match attributes. This will leverage an ContentModel that
- * has been loaded and try to provide all available XML elements that could be used.
- * It should be enhanced to know the elements to be used based on information from
- * the XPath.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XPathElementContentAssist extends
- AbstractXMLElementContentAssistRequest {
-
- /**
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public XPathElementContentAssist(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length,
- filter, textViewer);
- }
-
- /**
- * Provides a list of possible proposals for the XML Elements within the current
- * scope. This leverages the ContentModel that was loaded by the XML Catalog,
- * Custom Resolver, or the inferred grammar.
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- IDOMDocument domDocument = (IDOMDocument) node.getOwnerDocument();
-
- getXPathXMLElementProposals(domDocument);
-
-
- return getAllCompletionProposals();
- }
-
- private void getXPathXMLElementProposals(IDOMDocument domDocument) {
- try {
- Node ancestorNode = XSLTXPathHelper.selectSingleNode(getNode(),
- XPATH_FIRST_XSLANCESTOR_NODE);
-
- Iterator<CMNode> cmNodeIt = getAvailableContentNodes(domDocument,
- ancestorNode, ModelQuery.INCLUDE_CHILD_NODES);
-
- createXPathXMLProposals(ancestorNode, cmNodeIt);
-
- } catch (Exception ex) {
- XSLUIPlugin.log(ex);
- }
- }
-
- private void createXPathXMLProposals(Node ancestorNode,
- Iterator<CMNode> cmNodeIt) {
- while (cmNodeIt.hasNext()) {
- CMNode cmNode = cmNodeIt.next();
- String proposedText = getRequiredName(ancestorNode, cmNode);
- if (!(proposedText.contains("xsl:") || proposedText.contains("xslt:"))) {
- int offset = getReplacementBeginPosition();
- Image image = getCMNodeImage(cmNode);
- int startLength = getCursorPosition() - offset;
- String additionalInfo = getInfoProvider().getInfo(cmNode);
-
- if (matchString.length() > 0) {
- if (proposedText.startsWith(matchString)) {
- CustomCompletionProposal proposal = createProposal(
- proposedText, additionalInfo, offset, image, startLength);
- addProposal(proposal);
- }
- } else {
- CustomCompletionProposal proposal = createProposal(
- proposedText, additionalInfo, offset, image, startLength);
- addProposal(proposal);
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistProcessor.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistProcessor.java
deleted file mode 100644
index 87e840c..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistProcessor.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- * David Carver - STAR - bug 230958 - refactored to fix bug with getting
- * the DOM Document for the current editor
- * David Carver - STAR - bug 240170 - refactored code to help with narrowing of
- * results and easier maintenance.
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.ui.internal.Messages;
-import org.w3c.dom.Node;
-
-/**
- * The XSL Content Assist Processor provides content assistance for various
- * attributes values within the XSL Editor. This includes support for xpaths on
- * select statements as well as on test and match attributes.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XSLContentAssistProcessor implements IContentAssistProcessor {
-
- private String errorMessage = "";
- private ITextViewer textViewer = null;
- private ArrayList<ICompletionProposal> xslProposals;
- private ArrayList<ICompletionProposal> additionalProposals;
- private IndexedRegion treeNode;
- private Node node;
- private IDOMNode xmlNode;
- private IStructuredDocumentRegion sdRegion;
- private ITextRegion completionRegion;
- private String matchString;
- private int cursorPosition;
-
- /**
- * Provides an XSL Content Assist Processor class that is XSL aware and XML
- * aware.
- */
- public XSLContentAssistProcessor() {
- super();
- xslProposals = new ArrayList<ICompletionProposal>();
- additionalProposals = new ArrayList<ICompletionProposal>();
- }
-
- /**
- * CONTENT ASSIST STARTS HERE
- *
- * Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.
- *
- * @param textViewer
- * @param documentPosition
- * - the cursor location within the document
- *
- * @return an array of ICompletionProposal
- */
- public ICompletionProposal[] computeCompletionProposals(
- ITextViewer textViewer, int documentPosition) {
- initializeProposalVariables(textViewer, documentPosition);
-
- ICompletionProposal[] xmlProposals = getXMLProposals();
-
- additionalProposals = getAdditionalXSLElementProposals();
-
- xslProposals = getXSLNamespaceProposals();
-
- ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>();
- addProposals(xmlProposals, proposalList);
- proposalList.addAll(additionalProposals);
- proposalList.addAll(xslProposals);
-
- ICompletionProposal[] combinedProposals = combineProposals(proposalList);
-
- if (combinedProposals == null || combinedProposals.length == 0) {
- setErrorMessage(Messages.NoContentAssistance);
- }
-
- return combinedProposals;
- }
-
- /**
- * @param textViewer
- * @param documentPosition
- */
- private void initializeProposalVariables(ITextViewer textViewer,
- int documentPosition) {
- this.textViewer = textViewer;
- cursorPosition = documentPosition;
- treeNode = ContentAssistUtils.getNodeAt(textViewer, cursorPosition);
- node = getActualDOMNode((Node) treeNode);
- xmlNode = (IDOMNode) node;
- sdRegion = getStructuredDocumentRegion();
- completionRegion = getCompletionRegion(cursorPosition, node);
- matchString = getMatchString(sdRegion, completionRegion, cursorPosition);
- }
-
- private ArrayList<ICompletionProposal> getXSLNamespaceProposals() {
- if (XSLCore.isXSLNamespace(xmlNode)) {
- XSLContentAssistRequestFactory requestFactory = new XSLContentAssistRequestFactory(
- textViewer, cursorPosition, xmlNode, sdRegion,
- completionRegion, matchString);
-
- IContentAssistProposalRequest contentAssistRequest = requestFactory
- .getContentAssistRequest();
- xslProposals = contentAssistRequest.getCompletionProposals();
- }
- return xslProposals;
- }
-
- private ArrayList<ICompletionProposal> getAdditionalXSLElementProposals() {
- if (!XSLCore.isXSLNamespace(xmlNode)) {
- additionalProposals = new XSLElementContentAssistRequest(xmlNode,
- sdRegion, completionRegion, cursorPosition, 0, matchString,
- textViewer).getCompletionProposals();
- }
- return additionalProposals;
- }
-
- private ICompletionProposal[] getXMLProposals() {
- AbstractContentAssistProcessor processor = new XMLContentAssistProcessor();
-
- ICompletionProposal proposals[] = processor.computeCompletionProposals(
- textViewer, cursorPosition);
- return proposals;
- }
-
- private void addProposals(ICompletionProposal[] proposals,
- ArrayList<ICompletionProposal> proposalList) {
- if (proposals != null) {
- for (int cnt = 0; cnt < proposals.length; cnt++) {
- proposalList.add(proposals[cnt]);
- }
- }
- }
-
- private ICompletionProposal[] combineProposals(
- ArrayList<ICompletionProposal> proposalList) {
- ICompletionProposal[] combinedProposals = new ICompletionProposal[proposalList
- .size()];
- proposalList.toArray(combinedProposals);
- return combinedProposals;
- }
-
- /**
- * @param node
- * @return
- */
- private Node getActualDOMNode(Node node) {
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE)
- && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- return node;
- }
-
- /**
- * StructuredTextViewer must be set before using this.
- *
- * @param pos
- * @return
- */
- private IStructuredDocumentRegion getStructuredDocumentRegion() {
- return ContentAssistUtils.getStructuredDocumentRegion(textViewer,
- cursorPosition);
- }
-
- /**
- * Return the region whose content's require completion. This is something
- * of a misnomer as sometimes the user wants to be prompted for contents of
- * a non-existent ITextRegion, such as for enumerated attribute values
- * following an '=' sign.
- *
- * Copied from AbstractContentAssist Processor.
- */
- protected ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
- if (domnode == null) {
- return null;
- }
-
- ITextRegion region = null;
- int offset = documentPosition;
- IStructuredDocumentRegion flatNode = null;
- IDOMNode node = (IDOMNode) domnode;
-
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getStructuredDocument().getLength() == 0) {
- return null;
- }
- ITextRegion result = node.getStructuredDocument()
- .getRegionAtCharacterOffset(offset)
- .getRegionAtCharacterOffset(offset);
- while (result == null) {
- offset--;
- result = node.getStructuredDocument()
- .getRegionAtCharacterOffset(offset)
- .getRegionAtCharacterOffset(offset);
- }
- return result;
- }
-
- IStructuredDocumentRegion startTag = node
- .getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endTag = node
- .getEndStructuredDocumentRegion();
-
- if ((startTag != null) && (startTag.getStartOffset() <= offset)
- && (offset < startTag.getStartOffset() + startTag.getLength())) {
- flatNode = startTag;
- } else if ((endTag != null) && (endTag.getStartOffset() <= offset)
- && (offset < endTag.getStartOffset() + endTag.getLength())) {
- flatNode = endTag;
- }
-
- if (flatNode != null) {
- region = getCompletionRegion(offset, flatNode);
- } else {
- flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(
- offset);
- if ((flatNode.getStartOffset() <= documentPosition)
- && (flatNode.getEndOffset() >= documentPosition)) {
- if ((offset == flatNode.getStartOffset())
- && (flatNode.getPrevious() != null)
- && (((flatNode
- .getRegionAtCharacterOffset(documentPosition) != null) && (flatNode
- .getRegionAtCharacterOffset(documentPosition)
- .getType() != DOMRegionContext.XML_CONTENT))
- || (flatNode.getPrevious().getLastRegion()
- .getType() == DOMRegionContext.XML_TAG_OPEN) || (flatNode
- .getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN))) {
- region = flatNode.getPrevious().getLastRegion();
- } else if (flatNode.getEndOffset() == documentPosition) {
- region = flatNode.getLastRegion();
- } else {
- region = flatNode.getFirstRegion();
- }
- } else {
- region = flatNode.getLastRegion();
- }
- }
-
- return region;
- }
-
- protected ITextRegion getCompletionRegion(int offset,
- IStructuredDocumentRegion sdRegion) {
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
- if (region == null) {
- return null;
- }
-
- if (sdRegion.getStartOffset(region) == offset) {
- // The offset is at the beginning of the region
- if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset())
- && (sdRegion.getPrevious() != null)
- && (!sdRegion.getPrevious().isEnded())) {
- region = sdRegion.getPrevious().getRegionAtCharacterOffset(
- offset - 1);
- } else {
- // Is there no separating whitespace from the previous region?
- // If not,
- // then that region is the important one
- ITextRegion previousRegion = sdRegion
- .getRegionAtCharacterOffset(offset - 1);
- if ((previousRegion != null)
- && (previousRegion != region)
- && (previousRegion.getTextLength() == previousRegion
- .getLength())) {
- region = previousRegion;
- }
- }
- } else {
- // The offset is NOT at the beginning of the region
- if (offset > sdRegion.getStartOffset(region)
- + region.getTextLength()) {
- // Is the offset within the whitespace after the text in this
- // region?
- // If so, use the next region
- ITextRegion nextRegion = sdRegion
- .getRegionAtCharacterOffset(sdRegion
- .getStartOffset(region)
- + region.getLength());
- if (nextRegion != null) {
- region = nextRegion;
- }
- } else {
- // Is the offset within the important text for this region?
- // If so, then we've already got the right one.
- }
- }
-
- // valid WHITE_SPACE region handler (#179924)
- if ((region != null)
- && (region.getType() == DOMRegionContext.WHITE_SPACE)) {
- ITextRegion previousRegion = sdRegion
- .getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
- if (previousRegion != null) {
- region = previousRegion;
- }
- }
-
- return region;
- }
-
- private String getMatchString(IStructuredDocumentRegion parent,
- ITextRegion aRegion, int offset) {
- String matchString = "";
-
- if (isNotMatchStringRegion(parent, aRegion, offset)) {
- return matchString;
- }
-
- if (hasMatchString(parent, aRegion, offset)) {
- matchString = extractMatchString(parent, aRegion, offset);
- }
- return matchString;
- }
-
- private boolean isNotMatchStringRegion(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
- if (aRegion == null || parent == null)
- return true;
-
- String regionType = aRegion.getType();
- int totalRegionOffset = parent.getStartOffset(aRegion)
- + aRegion.getTextLength();
- return (isCloseRegion(aRegion)
- || hasNoMatchString(offset, regionType, totalRegionOffset));
- }
-
- private boolean isCloseRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_PI_CLOSE)
- || (type == DOMRegionContext.XML_TAG_CLOSE)
- || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
- || (type == DOMRegionContext.XML_CDATA_CLOSE)
- || (type == DOMRegionContext.XML_COMMENT_CLOSE)
- || (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE)
- || (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE)
- || (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) || (type == DOMRegionContext.XML_DECLARATION_CLOSE));
- }
-
- private boolean hasMatchString(IStructuredDocumentRegion parent,
- ITextRegion aRegion, int offset) {
- return (parent.getText(aRegion).length() > 0)
- && (parent.getStartOffset(aRegion) < offset);
- }
-
- private boolean hasNoMatchString(int offset, String regionType,
- int totalRegionOffset) {
- return regionType.equals(DOMRegionContext.XML_CONTENT)
- || regionType.equals(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)
- || regionType.equals(DOMRegionContext.XML_TAG_OPEN)
- || offset > totalRegionOffset;
- }
-
- private String extractMatchString(IStructuredDocumentRegion parent,
- ITextRegion aRegion, int offset) {
- String matchString;
- matchString = parent.getText(aRegion).substring(0,
- offset - parent.getStartOffset(aRegion));
- if (matchString.startsWith("\"")) {
- matchString = matchString.substring(1);
- }
- return matchString;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer,
- int offset) {
- return null;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of possible completions.
- *
- * the auto activation characters for completion proposal or
- * <code>null</code> if no auto activation is desired
- *
- * @return an array of activation characters
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- char[] completionProposals = { '"', '\'', ':', '[', '{', '<' };
-
- return completionProposals;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the error message for why content assistance didn't complete.
- *
- * @param errorMessage
- */
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistRequestFactory.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistRequestFactory.java
deleted file mode 100644
index ae677fa..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLContentAssistRequestFactory.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsl.ui.internal.contentassist.href.HrefContentAssistRequest;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A Factory that determines which Content Assist Request class is needed and
- * returns the appropriate class.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XSLContentAssistRequestFactory {
- private static final String ATTR_SELECT = "select"; //$NON-NLS-1$
- private static final String ATTR_TEST = "test"; //$NON-NLS-1$
- private static final String ATTR_MATCH = "match"; //$NON-NLS-1$
- private static final String ATTR_EXCLUDE_RESULT_PREFIXES = "exclude-result-prefixes"; //$NON-NLS-1$
- private static final String ATTR_MODE = "mode"; //$NON-NLS-1$
- private static final String ELEM_TEMPLATE = "template"; //$NON-NLS-1$
- private static final String ELEM_APPLYTEMPLATES = "apply-templates"; //$NON-NLS-1$
- private static final String ELEM_APPLY_IMPORTS = "apply-imports"; //$NON-NLS-1$
- private static final String ATTR_HREF = "href"; //$NON-NLS-1$
- private static final String ELEM_CALLTEMPLATE = "call-template"; //$NON-NLS-1$
- private static final String ATTR_NAME = "name"; //$NON-NLS-1$
- private ITextViewer textViewer;
- private int documentPosition;
- private IDOMNode xmlNode;
- private IStructuredDocumentRegion sdRegion;
- private ITextRegion completionRegion;
- private String matchString;
-
-
- /**
- * @param textViewer
- * @param documentPosition
- * @param xmlNode
- * @param sdRegion
- * @param completionRegion
- * @param matchString
- */
- public XSLContentAssistRequestFactory(ITextViewer textViewer, int documentPosition, IDOMNode xmlNode,
- IStructuredDocumentRegion sdRegion, ITextRegion completionRegion,
- String matchString) {
- this.textViewer = textViewer;
- this.documentPosition = documentPosition;
- this.xmlNode = xmlNode;
- this.sdRegion = sdRegion;
- this.completionRegion = completionRegion;
- this.matchString = matchString;
- }
- /**
- * Get the appropriate content assist request class for the XSL request.
- * @return
- */
- public IContentAssistProposalRequest getContentAssistRequest() {
- NamedNodeMap nodeMap = xmlNode.getAttributes();
- IDOMElement element = (IDOMElement) xmlNode;
- IContentAssistProposalRequest proposal = commonAttributeProposals(nodeMap);
-
- if (proposal instanceof NullContentAssistRequest) {
- if (isElementProposal(element)) {
- proposal = getElementProposals(nodeMap, element);
- }
- }
-
- return proposal;
- }
-
- private boolean isElementProposal(IDOMElement element) {
- String localName = element.getLocalName();
- return localName.equals(ELEM_TEMPLATE) ||
- localName.equals(ELEM_APPLYTEMPLATES) ||
- localName.equals(ELEM_CALLTEMPLATE);
- }
-
-
- private IContentAssistProposalRequest getElementProposals(NamedNodeMap nodeMap, IDOMElement element) {
- if (element.getLocalName().equals(ELEM_TEMPLATE)) {
- return getTemplateProposals(nodeMap);
- }
-
- if (element.getLocalName().equals(ELEM_APPLYTEMPLATES)
- || element.getLocalName().equals(ELEM_APPLY_IMPORTS)) {
- if (hasAttributeAtTextRegion(ATTR_MODE, nodeMap, completionRegion)) {
- return new TemplateModeAttributeContentAssist(xmlNode,
- sdRegion, completionRegion, documentPosition, 0,
- matchString, textViewer);
- }
-
- }
-
- if (element.getLocalName().equals(ELEM_CALLTEMPLATE)) {
- if (hasAttributeAtTextRegion(ATTR_NAME, nodeMap, completionRegion)) {
- return new CallTemplateContentAssistRequest(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
- }
-
- return new NullContentAssistRequest(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString, textViewer);
-
- }
-
- private IContentAssistProposalRequest getTemplateProposals(NamedNodeMap nodeMap) {
- if (hasAttributeAtTextRegion(ATTR_MODE, nodeMap, completionRegion)) {
- return new TemplateModeAttributeContentAssist(xmlNode,
- sdRegion, completionRegion, documentPosition, 0,
- matchString, textViewer);
- }
-
- if (hasAttributeAtTextRegion(ATTR_NAME, nodeMap, completionRegion)) {
- return new TemplateNameAttributeContentAssist( xmlNode,
- sdRegion, completionRegion, documentPosition, 0,
- matchString, textViewer);
- }
-
- return new NullContentAssistRequest(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString, textViewer);
-
- }
-
- private IContentAssistProposalRequest commonAttributeProposals(
- NamedNodeMap nodeMap) {
- if (hasAttributeAtTextRegion(ATTR_SELECT, nodeMap,
- completionRegion)) {
- return new SelectAttributeContentAssist(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
-
- if (hasAttributeAtTextRegion(ATTR_MATCH, nodeMap, completionRegion)) {
- return new SelectAttributeContentAssist(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
-
- if (hasAttributeAtTextRegion(ATTR_TEST, nodeMap, completionRegion)) {
- return new TestAttributeContentAssist(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
-
- if (hasAttributeAtTextRegion(ATTR_EXCLUDE_RESULT_PREFIXES,
- nodeMap, completionRegion)) {
- return new ExcludeResultPrefixesContentAssist(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
-
- if (hasAttributeAtTextRegion(ATTR_HREF, nodeMap, completionRegion)) {
- return new HrefContentAssistRequest(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString,
- textViewer);
- }
-
-
- return new NullContentAssistRequest(xmlNode, sdRegion,
- completionRegion, documentPosition, 0, matchString, textViewer);
- }
-
- protected boolean hasAttributeAtTextRegion(String attrName,
- NamedNodeMap nodeMap, ITextRegion aRegion) {
- IDOMAttr attrNode = (IDOMAttr) nodeMap.getNamedItem(attrName);
- return attrNode != null && attrNode.getValueRegion() != null
- && attrNode.getValueRegion().getStart() == aRegion.getStart();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLElementContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLElementContentAssistRequest.java
deleted file mode 100644
index 8157e2a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/XSLElementContentAssistRequest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 244978 - initial API and implementation
- * bug 263843 - Fix null pointer exception on region
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xsl.ui.internal.contentassist.contentmodel.XSLContentModelGenerator;
-import org.w3c.dom.Node;
-
-
-/**
- * This class provides content assistance proposals outside of the XSL namespace. Normal
- * XML editor content assistance only provides proposals for items within the same namespace
- * or if an element has children elements. This class extends this functionality by checking
- * for the first XSL ancestor and uses that to determine what proposals should be
- * provided in the way of xsl elements.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XSLElementContentAssistRequest extends
- AbstractXMLElementContentAssistRequest {
-
- /**
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public XSLElementContentAssistRequest(Node node,
- IStructuredDocumentRegion documentRegion,
- ITextRegion completionRegion, int begin, int length, String filter,
- ITextViewer textViewer) {
- super(node, documentRegion, completionRegion, begin, length,
- filter, textViewer);
- contentModel = new XSLContentModelGenerator();
- }
-
-
- /**
- * Calculate proposals for open content regions.
- */
- protected void computeTagOpenProposals() {
-
- if (replacementBeginPosition == documentRegion.getStartOffset(region)) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // at the start of an existing tag, right before the '<'
- computeTagNameProposals();
- }
- } else {
- // within the white space
- ITextRegion name = getNameRegion(((IDOMNode) node)
- .getStartStructuredDocumentRegion());
- if ((name != null)
- && ((documentRegion.getStartOffset(name) <= replacementBeginPosition) && (documentRegion
- .getEndOffset(name) >= replacementBeginPosition))) {
- // replace the existing name
- replacementBeginPosition = documentRegion.getStartOffset(name);
- replacementLength = name.getTextLength();
- } else {
- // insert a valid new name, or possibly an end tag
- // addEndTagProposals(contentAssistRequest);
- setReplacementLength(0);
- }
- addTagNameProposals(getElementPosition(node));
- }
- }
-
- /**
- * Provides a list of possible proposals for the XSL Elements within the current
- * scope.
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals() {
- if (region == null) {
- return new ArrayList<ICompletionProposal>();
- }
-
- if (region.getType() == DOMRegionContext.XML_TAG_OPEN) {
- computeTagOpenProposals();
- } else if (region.getType() == DOMRegionContext.XML_TAG_NAME) {
- computeTagNameProposals();
- }
- return getAllCompletionProposals();
- }
-
-
- /**
- * Calculates the proposals for the XML Tag Name Region.
- */
- protected void computeTagNameProposals() {
- // completing the *first* tag in "<tagname1 |<tagname2"
-
- // Ignore attributes
- if (inAttributeRegion()) {
- return;
- }
-
- addTagNameProposals(this.getElementPosition(node));
- // addEndTagNameProposals();
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/contentmodel/XSLContentModelGenerator.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/contentmodel/XSLContentModelGenerator.java
deleted file mode 100755
index 7f3e63c..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/contentmodel/XSLContentModelGenerator.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver (STAR) - bug 244978 - initial API and implementation based on
- * org.eclipse.wst.xml.ui.internal.contentassit.XMLContentModelGenerator
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentModelGenerator;
-import org.w3c.dom.Node;
-
-
-/**
- * This provides the ContentModel based off the XSL xml schema grammars and other
- * grammars provided by the xml editor.
- *
- * @since 1.1
- *
- */
-public class XSLContentModelGenerator extends AbstractContentModelGenerator {
-
-
- /**
- * XSLContentModelGenerator constructor comment.
- */
- public XSLContentModelGenerator() {
- super();
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentModelGenerator#generateAttribute(org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration, java.lang.StringBuffer)
- */
- @Override
- public void generateAttribute(CMAttributeDeclaration attrDecl, StringBuffer buffer) {
- if ((attrDecl == null) || (buffer == null)) {
- return;
- }
- int usage = attrDecl.getUsage();
- if (usage == CMAttributeDeclaration.REQUIRED) {
- buffer.append(" "); //$NON-NLS-1$
- generateRequiredAttribute(null, attrDecl, buffer); // todo pass
- // ownerNode as
- // 1st param
- }
- return;
- }
-
- @Override
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null) {
- return;
- }
- if (elementDecl.getContentType() != CMElementDeclaration.EMPTY) {
- buffer.append("</" + tagName + ">");//$NON-NLS-2$//$NON-NLS-1$
- }
- return;
- }
-
- /**
- * @param ownerNode
- * @param attrDecl
- * @param buffer
- */
- public void generateRequiredAttribute(Node ownerNode, CMAttributeDeclaration attrDecl, StringBuffer buffer) {
- if ((attrDecl == null) || (buffer == null)) {
- return;
- }
-
- // attribute name
- String attributeName = getRequiredName(ownerNode, attrDecl);
- CMDataType attrType = attrDecl.getAttrType();
- String defaultValue = null;
- // = sign
- buffer.append(attributeName + "="); //$NON-NLS-1$
- // attribute value
- if (attrType != null) {
- // insert any value that is implied
- if ((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (attrType.getImpliedValue() != null)) {
- defaultValue = attrType.getImpliedValue();
- }
- // otherwise, if an enumerated list of values exists, use the
- // first value
- else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
- defaultValue = attrType.getEnumeratedValues()[0];
- }
- }
-
- char attrQuote = '\"';
- // Found a double quote, wrap the attribute in single quotes
- if(defaultValue != null && defaultValue.indexOf(attrQuote) >= 0) {
- attrQuote = '\'';
- }
-
- buffer.append(attrQuote);
- buffer.append(((defaultValue != null) ? defaultValue : "")); //$NON-NLS-1$
- buffer.append(attrQuote);
- return;
- }
-
- @Override
- protected void generateStartTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if ((elementDecl == null) || (buffer == null)) {
- return;
- }
- buffer.append("<" + tagName);//$NON-NLS-1$
- generateAttributes(elementDecl, buffer);
- buffer.append(getStartTagClose(parentNode, elementDecl));
- return;
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentModelGenerator#getMinimalStartTagLength(org.w3c.dom.Node, org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration)
- */
- @Override
- public int getMinimalStartTagLength(Node node, CMElementDeclaration elementDecl) {
- if (elementDecl == null) {
- return 0;
- }
- if (requiresAttributes(elementDecl)) {
- return getRequiredName(node, elementDecl).length() + 2; // < +
- // name +
- // space
- }
- else {
- return 1 + getRequiredName(node, elementDecl).length() + getStartTagClose(node, elementDecl).length(); // < +
- // name
- // +
- // appropriate
- // close
- }
- }
-
- protected String getOtherClose(Node notATagNode) {
- return null;
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentModelGenerator#getStartTagClose(org.w3c.dom.Node, org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration)
- */
- @Override
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null) {
- return other;
- }
- if (elementDecl == null) {
- return ">";//$NON-NLS-1$
- }
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- return "/>"; //$NON-NLS-1$
- }
- return ">"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/HrefContentAssistRequest.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/HrefContentAssistRequest.java
deleted file mode 100644
index bedffb7..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/HrefContentAssistRequest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.contentassist.href;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-import org.eclipse.wst.xsl.ui.internal.contentassist.AbstractXSLContentAssistRequest;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImageHelper;
-import org.eclipse.wst.xsl.ui.internal.util.XSLPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * <p>This provides content assistance proposals for href attributes with a mode attribute.</p>
- * <p>Content assistance is restricted to files with the XSL content type that are in the same project as the file currently
- * being edited. This is because projects in the workspace can have completely different physical file locations, leading to
- * confusion in relative file paths across projects. Similarly, no content assistance is given for files external to the workspace.
- * Such files should be assigned an absolute 'file:///' URL.</p>
- *
- * @author Doug Satchwell
- * @since 1.0
- */
-public class HrefContentAssistRequest extends AbstractXSLContentAssistRequest
-{
- private List<IPath> pathList = new ArrayList<IPath>();
-
- private final class XSLFileResourceVisitor implements IResourceVisitor
- {
- private final String precedingText;
- private final IFile editorFile;
-
- private XSLFileResourceVisitor(IFile editorFile, String precedingText)
- {
- this.precedingText = precedingText;
- this.editorFile = editorFile;
- }
-
- public boolean visit(IResource resource) throws CoreException
- {
- if (resource.getType() == IResource.FILE)
- {
- IFile file = (IFile)resource;
- if (XSLCore.isXSLFile(file) && !file.equals(editorFile))
- {
- IPath path = getRelativePath(editorFile, file);
- if (path.toString().startsWith(precedingText))
- {
- pathList.add(path);
- }
- }
- }
- return true;
- }
- }
-
- /**
- * Constructor for creating the HrefContentAssistRequest class.
- *
- * @param node
- * @param parent
- * @param documentRegion
- * @param completionRegion
- * @param begin
- * @param length
- * @param filter
- * @param textViewer
- */
- public HrefContentAssistRequest(Node node, IStructuredDocumentRegion documentRegion, ITextRegion completionRegion, int begin, int length, String filter, ITextViewer textViewer)
- {
- super(node, documentRegion, completionRegion, begin, length, filter, textViewer);
- }
-
- /**
- * The main method that returns an array of proposals. Returns relative paths to files in the current project.
- *
- * @return ICompletionProposal[]
- * @see org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest#getCompletionProposals()
- */
- @Override
- public ArrayList<ICompletionProposal> getCompletionProposals()
- {
- pathList.clear();
- proposals.clear();
-
- try
- {
- String text = getText();
- String precedingText;
-
- int length = getCursorPosition()-getStartOffset();
- if (length > 0 && text.length() > length + 1)
- precedingText = text.substring(1,length);
- else
- precedingText = "";
- IFile editorFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(getLocation()));
- editorFile.getProject().accept(new XSLFileResourceVisitor(editorFile,precedingText));
-
- Collections.sort(pathList,new PathComparator());
- for (IPath path : pathList)
- {
- String pathString = path.toString();
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- pathString,
- getStartOffset() + 1,
- text.length()-2,
- pathString.length(),
- XSLPluginImageHelper.getInstance().getImage(XSLPluginImages.IMG_XSL_FILE),
- pathString,
- null,
- null,
- 0,
- true
- );
- proposals.add(proposal);
- }
- }
- catch (CoreException e)
- {
- XSLUIPlugin.log(e);
- }
-
- return proposals;
- }
-
- /**
- * Do not wish to sort the proposals - they are already sorted
- *
- * @return the same list, in the same order
- */
- protected List<ICompletionProposal> sortProposals(List<ICompletionProposal> proposalsIn) {
- return proposalsIn;
- }
-
- private IPath getRelativePath(IFile relativeTo, IFile file)
- {
- IPath filePath = file.getFullPath();
- IPath relativeToPath = relativeTo.getFullPath();
-
- IPath relPath;
- if (filePath.segmentCount() > relativeToPath.segmentCount())
- {
- relPath = filePath.removeFirstSegments(filePath.matchingFirstSegments(relativeToPath));
- }
- else if (filePath.segmentCount() < relativeToPath.segmentCount())
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < relativeToPath.segmentCount() - filePath.segmentCount(); i++)
- {
- sb.append("../");
- }
- sb.append(file.getName());
- relPath = new Path(sb.toString());
- }
- else
- {
- relPath = new Path(file.getName());
- }
- return relPath;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/PathComparator.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/PathComparator.java
deleted file mode 100644
index 2774070..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/contentassist/href/PathComparator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.contentassist.href;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.IPath;
-
-final class PathComparator implements Comparator<IPath>, Serializable
-{
- /**
- *
- */
- private static final long serialVersionUID = -4401179581193111280L;
-
- public int compare(IPath o1, IPath o2)
- {
- int countComp = o1.segmentCount() - o2.segmentCount();
- if (countComp != 0)
- return countComp;
-
- for(int i=0;i<o1.segmentCount();i++)
- {
- String seg1 = o1.segment(i);
- String seg2 = o2.segment(i);
- if (!seg1.equals(seg2))
- {
- if (seg1.equals(".."))
- return 1;
- if (seg2.equals(".."))
- return -1;
- }
- }
-
- return o1.toString().compareTo(o2.toString());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/doubleclick/XSLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/doubleclick/XSLDoubleClickStrategy.java
deleted file mode 100755
index c2d5d8f..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/doubleclick/XSLDoubleClickStrategy.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - Initial API and implementation, based on a patch
- * provided by Nik Matyushev in bug 195262.
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.doubleclick;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy;
-
-
-/**
- * XSLDoubleClickStrategy extends the XMLDoubleclickStrategy to take into
- * account those areas that may be involved in XPath Expressions.
- *
- *
- * @author dcarver
- *
- */
-public class XSLDoubleClickStrategy extends XMLDoubleClickStrategy {
- static final char[] XML_DELIMITERS = { ' ', '\'', '\"', '[', ']',
- '|', '(', ')', '{', '}', '=', '!' };
- static final char[] XML_PARENTHESIS = { '[', ']', '(', ')', '{',
- '}' };
-
- @Override
- protected Point getWord(String string, int cursor) {
- if (string == null) {
- return null;
- }
-
- int wordStart = 0;
- int wordEnd = string.length();
-
- wordStart = startOfWord(string, cursor, wordStart);
- wordEnd = endOfWord(string, cursor, wordEnd);
- wordEnd = checkXPathExpression(string, wordEnd);
-
- if ((wordStart == wordEnd) && !isQuoted(string)) {
- wordStart = 0;
- wordEnd = string.length();
- }
-
- return new Point(wordStart, wordEnd);
- }
-
- private int checkXPathExpression(String string, int wordEnd) {
- if (wordEnd < string.length() - 1) {
- // check paranthesis
- int[] flags = new int[XML_PARENTHESIS.length / 2];
- boolean found = false;
- int pos = wordEnd;
- do {
- char cur = string.charAt(pos);
- for (int i = 0; i < XML_PARENTHESIS.length; i++) {
- if (cur == XML_PARENTHESIS[i]) {
- flags[i / 2] += (i % 2 == 0 ? 1 : -1);
- found = true;
- }
- }
- boolean stop = true;
- boolean unbalanced = false;
- for (int i = 0; i < flags.length; i++) {
- stop = stop && flags[i] == 0;
- unbalanced |= flags[i] < 0;
- }
-
- if (!unbalanced) {
- pos++;
- }
- if (stop | unbalanced) {
- break;
- }
- } while (pos < string.length());
-
- if (found) {
- wordEnd = Math.min(string.length() - 1, pos);
- }
- }
- return wordEnd;
- }
-
- private int endOfWord(String string, int cursor, int wordEnd) {
- for (int i = 0; i < XML_DELIMITERS.length; i++) {
- char delim = XML_DELIMITERS[i];
- int end = string.indexOf(delim, cursor);
- wordEnd = Math.min(wordEnd, end == -1 ? string.length() : end);
- }
-
- if (wordEnd == string.length()) {
- wordEnd = cursor;
- }
- return wordEnd;
- }
-
- protected int startOfWord(String string, int cursor, int wordStart) {
- for (int i = 0; i < XML_DELIMITERS.length; i++) {
- char delim = XML_DELIMITERS[i];
- wordStart = Math.max(wordStart, string.lastIndexOf(delim,
- cursor - 1));
- }
-
- if (wordStart == -1) {
- wordStart = cursor;
- } else {
- wordStart++;
- }
- return wordStart;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicator.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicator.java
deleted file mode 100644
index ccd6d71..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-import org.eclipse.jface.text.source.Annotation;
-
-/**
- * Overwrite and override indicator annotation.
- *
- * @since 1.0
- */
-class OverrideIndicator extends Annotation
-{
-
- //private String fAstNodeKey;
-
- /**
- * Creates a new override annotation.
- *
- * @param isOverwriteIndicator
- * <code>true</code> if this annotation is an overwrite indicator, <code>false</code> otherwise
- * @param text
- * the text associated with this annotation
- * @param key
- * the method binding key
- * @since 1.0
- */
- OverrideIndicator(String text, String key)
- {
- super(OverrideIndicatorManager.ANNOTATION_TYPE, false, text);
- //fAstNodeKey = key;
- }
-
- /**
- * Opens and reveals the defining method.
- */
- public void open()
- {
- // CompilationUnit ast= SharedASTProvider.getAST(fJavaElement, SharedASTProvider.WAIT_ACTIVE_ONLY, null);
- // if (ast != null) {
- // ASTNode node= ast.findDeclaringNode(fAstNodeKey);
- // if (node instanceof MethodDeclaration) {
- // try {
- // IMethodBinding methodBinding= ((MethodDeclaration)node).resolveBinding();
- // IMethodBinding definingMethodBinding= Bindings.findOverriddenMethod(methodBinding, true);
- // if (definingMethodBinding != null) {
- // IJavaElement definingMethod= definingMethodBinding.getJavaElement();
- // if (definingMethod != null) {
- // JavaUI.openInEditor(definingMethod, true, true);
- // return;
- // }
- // }
- // } catch (CoreException e) {
- // ExceptionHandler.handle(e, JavaEditorMessages.OverrideIndicatorManager_open_error_title, JavaEditorMessages.OverrideIndicatorManager_open_error_messageHasLogEntry);
- // return;
- // }
- // }
- // }
- // String title= JavaEditorMessages.OverrideIndicatorManager_open_error_title;
- // String message= JavaEditorMessages.OverrideIndicatorManager_open_error_message;
- // MessageDialog.openError(JavaPlugin.getActiveWorkbenchShell(), title, message);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorImageProvider.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorImageProvider.java
deleted file mode 100644
index 05c0df9..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorImageProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * Image provider for {@link org.eclipse.wst.xsl.ui.internal.editor.jdt.internal.ui.javaeditor.OverrideIndicatorManager.OverrideIndicator} annotations.
- *
- * @since 3.0
- */
-public class OverrideIndicatorImageProvider implements IAnnotationImageProvider
-{
- private static final String OVERRIDE_IMG_DESC_ID = "OverrideIndicatorImageProvider.OVERRIDE_IMG_DESC_ID"; //$NON-NLS-1$
-
- /**
- * This does not support managing its own image.
- *
- * @param annotation
- * @return null
- */
- public Image getManagedImage(Annotation annotation)
- {
- return null;
- }
-
- /**
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
- */
- public String getImageDescriptorId(Annotation annotation)
- {
- if (!isImageProviderFor(annotation))
- return null;
- return OVERRIDE_IMG_DESC_ID;
- }
-
- /**
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
- */
- public ImageDescriptor getImageDescriptor(String imageDescritporId)
- {
- if (OVERRIDE_IMG_DESC_ID.equals(imageDescritporId))
- return AbstractUIPlugin.imageDescriptorFromPlugin(XSLUIPlugin.PLUGIN_ID, "icons/full/over_co.gif");
- return null;
- }
-
- private boolean isImageProviderFor(Annotation annotation)
- {
- return annotation != null && OverrideIndicatorManager.ANNOTATION_TYPE.equals(annotation.getType());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorManager.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorManager.java
deleted file mode 100644
index 98cbdb6..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/OverrideIndicatorManager.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.ISynchronizable;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.core.model.Template;
-
-/**
- * Manages the override and overwrite indicators for the given Java element and annotation model.
- *
- * @since 3.0
- */
-public class OverrideIndicatorManager
-{
-
-
- static final String ANNOTATION_TYPE = "org.eclipse.wst.xsl.ui.override"; //$NON-NLS-1$
-
- private IAnnotationModel fAnnotationModel;
- private Object fAnnotationModelLockObject;
- private Annotation[] fOverrideAnnotations;
-
- private IFile file;
-
- /**
- * Constructor requires the editors annotation model and the file the editor is looking at.
- *
- * @param annotationModel
- * @param file
- */
- public OverrideIndicatorManager(IAnnotationModel annotationModel, IFile file)
- {
- Assert.isNotNull(annotationModel);
-
- this.file = file;
- fAnnotationModel = annotationModel;
- fAnnotationModelLockObject = getLockObject(fAnnotationModel);
-
- updateAnnotations();
- }
-
- /**
- * Returns the lock object for the given annotation model.
- *
- * @param annotationModel
- * the annotation model
- * @return the annotation model's lock object
- * @since 1.0
- */
- private Object getLockObject(IAnnotationModel annotationModel)
- {
- if (annotationModel instanceof ISynchronizable)
- {
- Object lock = ((ISynchronizable) annotationModel).getLockObject();
- if (lock != null)
- return lock;
- }
- return annotationModel;
- }
-
- /**
- * Updates the override and implements annotations based on the given AST.
- *
- * @param ast
- * the compilation unit AST
- * @param progressMonitor
- * the progress monitor
- * @since 1.0
- */
- public void updateAnnotations()
- {
- StylesheetModel stylesheetComposed = XSLCore.getInstance().getStylesheet(file);
- final Map<Annotation,Position> annotationMap= new HashMap<Annotation,Position>(50);
- List<Template> nestedTemplates = stylesheetComposed.findAllNestedTemplates();
- for (Template template : stylesheetComposed.getStylesheet().getTemplates())
- {
- // check for overridden stylesheets
- for (Template nestedTemplate : nestedTemplates)
- {
- IFile nestedFile = nestedTemplate.getStylesheet().getFile();
- if (nestedFile != null)
- {
- if(template.matchesByMatchOrName(nestedTemplate))
- {// the template overrides another templates as its name matches, or its match and mode matches
- if (template.getName() != null)
- {
- String text = "overrides "+template.getName()+" in "+nestedFile.getName();
- annotationMap.put(
- new OverrideIndicator(text, "binding.getKey()"),
- new Position(template.getOffset(), template.getLength())
- );
- }
- else
- {
- String text = "overrides \""+template.getMatch()+"\"";
- String mode = template.getMode();
- if (mode != null)
- text += " ("+mode+")";
- text += " in "+nestedFile.getName();
- annotationMap.put(
- new OverrideIndicator(text, "binding.getKey()"),
- new Position(template.getOffset(), template.getLength())
- );
- }
- }
- }
- }
- }
-
- synchronized (fAnnotationModelLockObject)
- {
- if (fAnnotationModel instanceof IAnnotationModelExtension)
- {
- ((IAnnotationModelExtension) fAnnotationModel).replaceAnnotations(fOverrideAnnotations, annotationMap);
- }
- else
- {
- removeAnnotations();
- Iterator iter = annotationMap.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry mapEntry = (Map.Entry) iter.next();
- fAnnotationModel.addAnnotation((Annotation) mapEntry.getKey(), (Position) mapEntry.getValue());
- }
- }
- fOverrideAnnotations = annotationMap.keySet().toArray(new Annotation[annotationMap.keySet().size()]);
- }
- }
-
- /**
- * Removes all override indicators from this manager's annotation model.
- */
- void removeAnnotations()
- {
- if (fOverrideAnnotations == null)
- return;
-
- synchronized (fAnnotationModelLockObject)
- {
- if (fAnnotationModel instanceof IAnnotationModelExtension)
- {
- ((IAnnotationModelExtension) fAnnotationModel).replaceAnnotations(fOverrideAnnotations, null);
- }
- else
- {
- for (int i = 0, length = fOverrideAnnotations.length; i < length; i++)
- fAnnotationModel.removeAnnotation(fOverrideAnnotations[i]);
- }
- fOverrideAnnotations = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/SourceFileHyperlink.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/SourceFileHyperlink.java
deleted file mode 100644
index 7986d87..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/SourceFileHyperlink.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xsl.core.model.XSLNode;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * @author Doug Satchwell
- *
- */
-public class SourceFileHyperlink implements IHyperlink
-{
- private IRegion hyperLinkRegion;
- private IFile linkedFile;
- private XSLNode sourceArtifact;
-
- /**
- * @param hyperLinkRegion
- * @param linkedFile
- */
- public SourceFileHyperlink(IRegion hyperLinkRegion, IFile linkedFile)
- {
- this.hyperLinkRegion = hyperLinkRegion;
- this.linkedFile = linkedFile;
- }
-
- /**
- * @param hyperLinkRegion
- * @param linkedFile
- * @param node
- */
- public SourceFileHyperlink(IRegion hyperLinkRegion, IFile linkedFile, XSLNode node)
- {
- this.hyperLinkRegion = hyperLinkRegion;
- this.linkedFile = linkedFile;
- this.sourceArtifact = node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion()
- {
- return hyperLinkRegion;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText()
- {
- return linkedFile.getFullPath().toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open()
- {
- if (linkedFile != null && linkedFile.exists())
- {
- try
- {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, linkedFile, true);
- ITextEditor textEditor = (ITextEditor)editor.getAdapter(ITextEditor.class);
- if (sourceArtifact != null && textEditor != null)
- {
- IDocument openedDocument = (IDocument)editor.getAdapter(IDocument.class);
- if (openedDocument != null)
- {
- int lineOffset = openedDocument.getLineOffset(sourceArtifact.getLineNumber());
- int offset = lineOffset + sourceArtifact.getColumnNumber();
- //textEditor.selectAndReveal(offset, sourceArtifact.getLength());
- textEditor.setHighlightRange(offset, sourceArtifact.getLength(), true);
- }
- }
- }
- catch (PartInitException pie)
- {
- XSLUIPlugin.log(pie);
- }
- catch (BadLocationException e)
- {
- XSLUIPlugin.log(e);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLEditor.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLEditor.java
deleted file mode 100644
index d8b9654..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLEditor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.templates.ITemplatesPage;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xsl.ui.internal.templates.XSLTemplatesPage;
-
-/**
- * XSL specific extensions to the SSE UI that haven't yet been made
- * available to the SSE.
- *
- * @since 1.0
- */
-public class XSLEditor extends StructuredTextEditor
-{
- private OverrideIndicatorManager fOverrideIndicatorManager;
-
- /**
- * @since 1.0
- */
- private XSLTemplatesPage fTemplatesPage;
-
- @Override
- protected void doSetInput(IEditorInput input) throws CoreException
- {
- super.doSetInput(input);
- installOverrideIndicator();
- }
-
- public OverrideIndicatorManager getOverrideIndicatorManager()
- {
- return fOverrideIndicatorManager;
- }
-
- protected void installOverrideIndicator()
- {
- // uninstallOverrideIndicator();
- if (getEditorInput() instanceof FileEditorInput)
- {
- IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
- IFile file = ((FileEditorInput)getEditorInput()).getFile();
- fOverrideIndicatorManager = new OverrideIndicatorManager(model, file);
- }
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class required) {
- if (ITemplatesPage.class.equals(required)) {
- if (fTemplatesPage == null)
- fTemplatesPage = new XSLTemplatesPage(this);
- return fTemplatesPage;
- }
-
- return super.getAdapter(required);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLHyperlinkDetector.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLHyperlinkDetector.java
deleted file mode 100644
index afd7c4a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/editor/XSLHyperlinkDetector.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.editor;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsl.core.XSLCore;
-import org.eclipse.wst.xsl.core.model.Parameter;
-import org.eclipse.wst.xsl.core.model.StylesheetModel;
-import org.eclipse.wst.xsl.core.model.Template;
-import org.eclipse.wst.xsl.core.model.XSLAttribute;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * A hyperlink detector for XSL files.
- *
- * The detector makes use of the model built by SSE validation (found in <code>XSLCore</code>).
- *
- * Currently supports hyperlinking for includes, imports or called templates.
- *
- * @author Doug Satchwell
- */
-public class XSLHyperlinkDetector extends AbstractHyperlinkDetector
-{
- private static final String ELEM_WITH_PARAM = "with-param";
- private static final String ATTR_NAME = "name";
- private static final String ELM_CALL_TEMPLATE = "call-template";
-
- /**
- * Try to create hyperlinks for viewer and region
- *
- * @see AbstractHyperlinkDetector
- * @param textViewer
- * @param region
- * @param canShowMultipleHyperlinks
- * @return array of hyperlinks for current region
- */
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
- {
- IHyperlink hyperlink = null;
- if (region != null && textViewer != null)
- {
- return detectHyperlinks(textViewer.getDocument(), region, canShowMultipleHyperlinks);
- }
- return new IHyperlink[]{hyperlink};
- }
-
- /**
- * Try to create hyperlinks for document and region
- * @param document
- * @param region
- * @param canShowMultipleHyperlinks
- * @return array of hyperlinks for current region
- */
- public IHyperlink[] detectHyperlinks(IDocument document, IRegion region, boolean canShowMultipleHyperlinks)
- {
- IHyperlink hyperlink = null;
-
- if (region != null && document != null)
- {
- Node currentNode = XSLCore.getCurrentNode(document, region.getOffset());
-
- Element xslEl = null;
- Attr xslAttr = null;
- if (XSLCore.XSL_NAMESPACE_URI.equals(currentNode.getNamespaceURI())) {
- if (currentNode.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Attr att = (Attr) currentNode;
- xslEl = att.getOwnerElement();
- xslAttr = att;
- }
-
- if (currentNode.getNodeType() == Node.ELEMENT_NODE)
- {
- Element el = (Element)currentNode;
- xslEl = el;
- xslAttr = XSLCore.getCurrentAttrNode(el, region.getOffset());
- }
- }
-
- hyperlink = createHyperLink(document, hyperlink, xslEl, xslAttr);
- }
- return hyperlink == null ? null : new IHyperlink[]{hyperlink};
- }
-
- private IHyperlink createHyperLink(IDocument document,
- IHyperlink hyperlink, Element xslEl, Attr xslAttr) {
- if (xslEl != null && xslAttr != null)
- {
- IRegion hyperlinkRegion = getHyperlinkRegion(xslAttr);
- IFile file = getFileForDocument(document);
- if (file != null)
- {
- if (ELM_CALL_TEMPLATE.equals(xslEl.getLocalName()) && ATTR_NAME.equals(xslAttr.getLocalName()))
- {
- hyperlink = createCallTemplateHyperLink(file,xslAttr.getValue(), hyperlinkRegion);
- }
-
- if (ELEM_WITH_PARAM.equals(xslEl.getLocalName()) && ATTR_NAME.equals(xslAttr.getLocalName())) {
- hyperlink = createWithParamHyperLink(file, xslEl, xslAttr, hyperlinkRegion);
- }
- }
-
- }
- return hyperlink;
- }
-
-
- private IHyperlink createCallTemplateHyperLink(IFile currentFile, String templateName, IRegion hyperlinkRegion)
- {
- IHyperlink hyperlink = null;
- StylesheetModel sf = XSLCore.getInstance().getStylesheet(currentFile);
- if (sf != null)
- {
- List<Template> templates = sf.getTemplatesByName(templateName);
- if (templates != null && templates.size() == 1)
- {
- Template template = templates.get(0);
- hyperlink = new SourceFileHyperlink(hyperlinkRegion,template.getStylesheet().getFile(),template);
- }
- }
- return hyperlink;
- }
-
- private IHyperlink createWithParamHyperLink(IFile currentFile, Element elem, Attr attr, IRegion hyperlinkRegion)
- {
- IHyperlink hyperlink = null;
- StylesheetModel sf = XSLCore.getInstance().getStylesheet(currentFile);
- if (sf != null)
- {
- Node parentNode = elem.getParentNode();
- Attr parentAttribute = (Attr) parentNode.getAttributes().getNamedItem(ATTR_NAME);
- String templateName = parentAttribute.getValue();
- List<Template> templates = sf.getTemplatesByName(templateName);
-
- if (templates != null && templates.size() == 1)
- {
- Template template = templates.get(0);
- List<Parameter> parameters = template.getParameters();
- for(Parameter param : parameters) {
- String paramName = attr.getValue();
- XSLAttribute parameterNameAttr = param.getAttribute(ATTR_NAME);
- if (parameterNameAttr != null && parameterNameAttr.getValue().equals(paramName)) {
- hyperlink = new SourceFileHyperlink(hyperlinkRegion,template.getStylesheet().getFile(),param);
- }
- }
- }
- }
- return hyperlink;
- }
-
- private IRegion getHyperlinkRegion(Node node)
- {
- IRegion hyperRegion = null;
-
- if (node != null)
- {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE)
- {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE)
- {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null)
- {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue))
- {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- private IFile getFileForDocument(IDocument document)
- {
- IFile file = null;
- IStructuredModel sModel = null;
- try
- {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null)
- {
- IPath path = new Path(sModel.getBaseLocation());
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- finally
- {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return file != null && file.exists() ? file : null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/handlers/OpenDeclarationHandler.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/handlers/OpenDeclarationHandler.java
deleted file mode 100644
index 721764e..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/handlers/OpenDeclarationHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.xsl.ui.internal.editor.XSLHyperlinkDetector;
-
-public class OpenDeclarationHandler extends AbstractHandler
-{
- private XSLHyperlinkDetector detector = new XSLHyperlinkDetector();
-
- public Object execute(ExecutionEvent event) throws ExecutionException
- {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
-
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else
- {
- Object o = editor.getAdapter(ITextEditor.class);
- if (o != null)
- textEditor = (ITextEditor) o;
- }
- if (textEditor != null)
- {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- if (document != null)
- {
- // get current text selection
- ITextSelection textSelection = getCurrentSelection(textEditor);
- if (textSelection.isEmpty())
- {
- return null;
- }
- int offset = textSelection.getOffset();
- if (offset == -1)
- return null;
- IRegion region = new Region(offset, 0);
- IHyperlink[] links = detector.detectHyperlinks(document, region, true);
- if (links != null && links.length > 0)
- {
- IHyperlink link = links[0];
- link.open();
- }
- }
- }
-
- return null;
- }
-
- private ITextSelection getCurrentSelection(ITextEditor textEditor)
- {
- ISelectionProvider provider = textEditor.getSelectionProvider();
- if (provider != null)
- {
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection)
- {
- return (ITextSelection) selection;
- }
- }
- return TextSelection.emptySelection();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/messages.properties b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/messages.properties
deleted file mode 100644
index f593ed4..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/messages.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-MainPreferencePage = Expand the tree for more preferences.
-ExcludeResultPrefixesContentAssist = XML Namespace:
-NoContentAssistance = No Content Assistance Proposals Available.
-XSLSyntaxColoringPage = \nDefault colors and fonts for <a href="org.eclipse.wst.sse.ui.preferences.xml.colors">XML</a> can be configured on the XML Syntax Coloring page. Settings on this page only affect XSLT content.
-xsltStyleDocument = <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n <xsl:template match=\"/\"> <html>\n <body bgcolor=\"#ffffff\">\n <xsl:if test=\"$someValue\">\n <!-- ADD Some Code here -->\n </xsl:if>\n </body>\n </html>\n </xsl:template>\n</xsl:stylesheet>\n \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/perspective/XMLPerspectiveFactory.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/perspective/XMLPerspectiveFactory.java
deleted file mode 100644
index ffbdf62..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/perspective/XMLPerspectiveFactory.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005-2007 Standards for Technology in Automotive Retail
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - bug 213883 - initial api
- *******************************************************************************/
-
-package org.eclipse.wst.xsl.ui.internal.perspective;
-
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.ui.navigator.resources.ProjectExplorer;
-
-
-/**
- * @author dcarver
- *
- */
-public class XMLPerspectiveFactory implements IPerspectiveFactory {
-
- /**
- * Creates the initial layout. This is what the layout is reset to
- * when the Reset Perspective is selected. It takes as input a
- * IPageLayout object.
- *
- * @param layout
- */
- public void createInitialLayout(IPageLayout layout) {
- // Get the Editor Area
- String editorArea = layout.getEditorArea();
-
- this.addShortCutViews(layout);
- this.addShortCutPerspective(layout);
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet("org.eclipse.wst.xsl.ui.xslActionSet"); //$NON-NLS-1$
-
- // Turn on the Editor Area
- layout.setEditorAreaVisible(true);
- layout.setFixed(false);
-
- // Add the various views
- IFolderLayout left =
- layout.createFolder("left", IPageLayout.LEFT, (float) 0.26, editorArea); //$NON-NLS-1$
- left.addView(ProjectExplorer.VIEW_ID);
-
- IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float) 0.50, editorArea); //$NON-NLS-1$
- right.addView(IPageLayout.ID_OUTLINE);
- IFolderLayout bottomRight = layout.createFolder("bottom-right", IPageLayout.BOTTOM, (float) 0.50, "right");
- bottomRight.addView("org.eclipse.ui.texteditor.TemplatesView");
-
- // Add Outline to the bottom-left
- IFolderLayout bottomLeft =
- layout.createFolder("bottom-left", IPageLayout.BOTTOM, (float) 0.50, "left"); //$NON-NLS-1$ //$NON-NLS-2$
- bottomLeft.addView("org.eclipse.wst.xml.views.XPathView"); //$NON-NLS-1$
- //bottomLeft.addView("org.eclipse.wst.xml.xpath.ui.views.XPathNavigator"); //$NON-NLS-1$
-
- IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$
- bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
- bottom.addView(IPageLayout.ID_PROP_SHEET);
- bottom.addView(IConsoleConstants.ID_CONSOLE_VIEW);
- bottom.addView("org.eclipse.wst.common.snippets.internal.ui.SnippetsView"); //$NON-NLS-1$
-
- //layout.addNewWizardShortcut("org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.wst.xsl.ui.internal.wizards.NewStylesheetWizard"); //$NON-NLS-1$
- //layout.addNewWizardShortcut("org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"); //$NON-NLS-1$
- //layout.addNewWizardShortcut("org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"); //$NON-NLS-1$
- //layout.addNewWizardShortcut("org.eclipse.wst.wsdl.ui"); //$NON-NLS-1$
- //layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
- //layout.addNewWizardShortcut("additions");
-
- layout.addPerspectiveShortcut("org.eclipse.debug.ui.DebugPerspective"); //$NON-NLS-1$
-
- }
-
- /**
- * Adds View short cuts to the XML Perspective. The short cuts added are:
- * XPath Navigator
- * ProjectExplorer
- * Navigator
- * Problems View
- * Console View
- * @param layout
- */
- private void addShortCutViews(IPageLayout layout) {
- layout.addShowViewShortcut("org.eclipse.wst.xml.views.XPathView"); //$NON-NLS-1$
- layout.addShowViewShortcut("org.eclipse.wst.xml.xpath.ui.views.XPathNavigator"); //$NON-NLS-1$
- layout.addShowViewShortcut(ProjectExplorer.VIEW_ID);
- layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
- layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
- layout.addShowViewShortcut("org.eclipse.wst.common.snippets.internal.ui.SnippetsView"); //$NON-NLS-1$
- }
-
- private void addShortCutPerspective(IPageLayout layout) {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractValidationSettingsPage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractValidationSettingsPage.java
deleted file mode 100644
index 7bdfb72..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractValidationSettingsPage.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver (STAR) - bug 230072 - initial API and implementation
- * based on org.eclipse.wst.html.ui class of
- * the same name.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Based on org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock
- */
-abstract class AbstractValidationSettingsPage extends PropertyPreferencePage {
-
- private List fCombos;
- private List fExpandables;
-
- private SelectionListener fSelectionListener;
-
- private IPreferencesService fPreferencesService = null;
-
- private static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
-
- private ValidationFramework fValidation;
-
- public AbstractValidationSettingsPage() {
- super();
- fCombos = new ArrayList();
- fExpandables = new ArrayList();
- fPreferencesService = Platform.getPreferencesService();
- fValidation = ValidationFramework.getDefault();
- }
-
- /**
- * Creates a Combo widget in the composite <code>parent</code>. The data
- * in the Combo is associated with <code>key</code>. The Combo data is
- * generated based on the integer <code>values</code> where the index
- * of <code>values</code> corresponds to the index of <code>valueLabels</code>
- *
- * @param parent the composite to create the combo box in
- * @param label the label to give the combo box
- * @param key the unique key to identify the combo box
- * @param values the values represented by the combo options
- * @param valueLabels the calues displayed in the combo box
- * @param indent how far to indent the combo box label
- *
- * @return the generated combo box
- */
- protected Combo addComboBox(Composite parent, String label, String key, int[] values, String[] valueLabels, int indent) {
- GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
- gd.horizontalIndent= indent;
-
- Label labelControl= new Label(parent, SWT.LEFT);
- labelControl.setFont(JFaceResources.getDialogFont());
- labelControl.setText(label);
- labelControl.setLayoutData(gd);
-
- Combo comboBox= newComboControl(parent, key, values, valueLabels);
- comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- return comboBox;
- }
-
- /**
- * Creates a combo box and associates the combo data with the
- * combo box.
- *
- * @param composite the composite to create the combo box in
- * @param key the unique key to identify the combo box
- * @param values the values represented by the combo options
- * @param valueLabels the values displayed in the combo box
- *
- * @return the generated combo box
- */
- protected Combo newComboControl(Composite composite, String key, int[] values, String[] valueLabels) {
- ComboData data = new ComboData(key, values, -1);
-
- Combo comboBox= new Combo(composite, SWT.READ_ONLY);
- comboBox.setItems(valueLabels);
- comboBox.setData(data);
- comboBox.addSelectionListener(getSelectionListener());
- comboBox.setFont(JFaceResources.getDialogFont());
-
- makeScrollableCompositeAware(comboBox);
-
- int severity = -1;
- if(key != null)
- severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
-
- if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
- data.setSeverity(severity);
- data.originalSeverity = severity;
- }
-
- if(data.getIndex() >= 0)
- comboBox.select(data.getIndex());
-
- fCombos.add(comboBox);
- return comboBox;
- }
-
- protected SelectionListener getSelectionListener() {
- if (fSelectionListener == null) {
- fSelectionListener= new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- controlChanged(e.widget);
- }
- };
- }
- return fSelectionListener;
- }
-
- protected void controlChanged(Widget widget) {
- ComboData data= (ComboData) widget.getData();
- if (widget instanceof Combo) {
- data.setIndex(((Combo)widget).getSelectionIndex());
- } else {
- return;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#storeValues()
- */
- protected void storeValues() {
- if(fCombos == null || fCombos.size() == 0)
- return;
-
- Iterator it = fCombos.iterator();
-
- IScopeContext[] contexts = createPreferenceScopes();
-
- while(it.hasNext()) {
- ComboData data = (ComboData) ((Combo)it.next()).getData();
- if(data.getKey() != null) {
- contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
- }
- }
-
- for(int i = 0; i < contexts.length; i++) {
- try {
- contexts[i].getNode(getPreferenceNodeQualifier()).flush();
- }
- catch (BackingStoreException e) {
-
- }
- }
- }
-
- protected ExpandableComposite getParentExpandableComposite(Control control) {
- Control parent= control.getParent();
- while (!(parent instanceof ExpandableComposite) && parent != null) {
- parent= parent.getParent();
- }
- if (parent instanceof ExpandableComposite) {
- return (ExpandableComposite) parent;
- }
- return null;
- }
-
- protected ExpandableComposite createTwistie(Composite parent, String label, int nColumns) {
- ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
- excomposite.addExpansionListener(new ExpansionAdapter() {
- @Override
- public void expansionStateChanged(ExpansionEvent e) {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- fExpandables.add(excomposite);
- makeScrollableCompositeAware(excomposite);
- return excomposite;
- }
-
- protected final void expandedStateChanged(ExpandableComposite expandable) {
- ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(expandable);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.reflow(true);
- }
- }
-
- private void makeScrollableCompositeAware(Control control) {
- ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(control);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.adaptChild(control);
- }
- }
-
- protected ScrolledPageContent getParentScrolledComposite(Control control) {
- Control parent= control.getParent();
- while (!(parent instanceof ScrolledPageContent) && parent != null) {
- parent= parent.getParent();
- }
- if (parent instanceof ScrolledPageContent) {
- return (ScrolledPageContent) parent;
- }
- return null;
- }
-
- protected void storeSectionExpansionStates(IDialogSettings section) {
- for(int i = 0; i < fExpandables.size(); i++) {
- ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
- section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
- }
- }
-
- protected void restoreSectionExpansionStates(IDialogSettings settings) {
- for (int i= 0; i < fExpandables.size(); i++) {
- ExpandableComposite excomposite= (ExpandableComposite) fExpandables.get(i);
- if (settings == null) {
- excomposite.setExpanded(i == 0); // only expand the first node by default
- } else {
- excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
- }
- }
- }
-
- protected void resetSeverities() {
- IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
- for(int i = 0; i < fCombos.size(); i++) {
- ComboData data = (ComboData)((Combo)fCombos.get(i)).getData();
- int severity = defaultContext.getInt(data.getKey(), ValidationMessage.WARNING);
- data.setSeverity(severity);
- ((Combo)fCombos.get(i)).select(data.getIndex());
- }
- }
-
- protected boolean shouldRevalidateOnSettingsChange() {
- Iterator it = fCombos.iterator();
-
- while (it.hasNext()) {
- ComboData data = (ComboData) ((Combo) it.next()).getData();
- if (data.isChanged())
- return true;
- }
- return false;
- }
-
- @Override
- public boolean performOk() {
- if(super.performOk() && shouldRevalidateOnSettingsChange()) {
- MessageBox mb = new MessageBox(this.getShell(), SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_INFORMATION | SWT.RIGHT);
- mb.setText("XSL Validation");
- /* Choose which message to use based on if its project or workspace settings */
- String msg = (getProject() == null) ? "XSL Workspace Validation" : "XSL Project Level Validation";
- mb.setMessage(msg);
- switch(mb.open()) {
- case SWT.CANCEL:
- return false;
- case SWT.YES:
- ValidateJob job = new ValidateJob("XSL Validation Job");
- job.schedule();
- case SWT.NO:
- default:
- return true;
- }
- }
- return true;
- }
-
- /**
- * Performs validation after validation preferences have been modified.
- */
- private class ValidateJob extends Job {
-
- public ValidateJob(String name) {
- super(name);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- IProject[] projects = null;
- /* Changed preferences for a single project, only validate it */
- if(getProject() != null)
- projects = new IProject[] {getProject()};
- /* Workspace-wide preferences changed */
- else {
- /* Get all of the projects in the workspace */
- projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- IEclipsePreferences prefs = null;
- List projectList = new ArrayList();
-
- /* Filter out projects that use project-specific settings or have been closed */
- for(int i = 0; i < projects.length; i++) {
- prefs = new ProjectScope(projects[i]).getNode(getPreferenceNodeQualifier());
- if(projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
- projectList.add(projects[i]);
- }
- projects = (IProject[]) projectList.toArray(new IProject[projectList.size()]);
- }
- fValidation.validate(projects, true, false, monitor);
- }
- catch (CoreException ce) {
- status = Status.CANCEL_STATUS;
- }
-
- return status;
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractXSLPreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractXSLPreferencePage.java
deleted file mode 100644
index ae2a7d0..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/AbstractXSLPreferencePage.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.xsl.core.internal.XSLCorePlugin;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * Augments the SSE <code>AbstractPreferencePage</code> with support for expandable composites (twisties) and combos.
- *
- * @author Doug Satchwell
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage
- */
-public abstract class AbstractXSLPreferencePage extends AbstractPreferencePage
-{
- private final String SETTINGS_EXPANDED = getClass().getCanonicalName()+".SETTINGS_EXPANDED"; //$NON-NLS-1$
- private final String SETTINGS_SECTION_NAME = getClass().getCanonicalName()+".SETTINGS_SECTION_NAME";//$NON-NLS-1$
- private List<ExpandableComposite> fExpandables = new ArrayList<ExpandableComposite>();
-
- @Override
- protected final Control createContents(Composite parent)
- {
- createCommonContents(parent);
- loadPreferences();
- restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
- return parent;
- }
-
- /**
- * Called by createContents and must be implemented.
- *
- * @param parent
- * @return the composite
- */
- protected abstract Composite createCommonContents(Composite parent);
-
- protected Composite createTwistie(Composite parent, String label, int cols)
- {
- ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, cols, 1));
- excomposite.addExpansionListener(new ExpansionAdapter()
- {
- @Override
- public void expansionStateChanged(ExpansionEvent e)
- {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- fExpandables.add(excomposite);
- makeScrollableCompositeAware(excomposite);
-
- Composite twistieCient = new Composite(excomposite, SWT.NONE);
- excomposite.setClient(twistieCient);
-
- GridLayout layout = new GridLayout(2, false);
- layout.marginRight = 5;
- twistieCient.setLayout(layout);
-
- GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
- twistieCient.setLayoutData(gd);
-
- return twistieCient;
- }
-
- private final void expandedStateChanged(ExpandableComposite expandable)
- {
- ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(expandable);
- if (parentScrolledComposite != null)
- {
- parentScrolledComposite.reflow(true);
- }
- }
-
- private void makeScrollableCompositeAware(Control control)
- {
- ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
- if (parentScrolledComposite != null)
- {
- parentScrolledComposite.adaptChild(control);
- }
- }
-
- private ScrolledPageContent getParentScrolledComposite(Control control)
- {
- Control parent = control.getParent();
- while (!(parent instanceof ScrolledPageContent) && parent != null)
- {
- parent = parent.getParent();
- }
- if (parent instanceof ScrolledPageContent)
- {
- return (ScrolledPageContent) parent;
- }
- return null;
- }
-
- protected Combo createCombo(Composite parent, String label, String prefKey)
- {
- GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
-
- Label labelControl = new Label(parent, SWT.LEFT);
- labelControl.setFont(JFaceResources.getDialogFont());
- labelControl.setText(label);
- labelControl.setLayoutData(gd);
-
- Combo combo = createDropDownBox(parent);
- combo.addSelectionListener(this);
- combo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- return combo;
- }
-
- private void storeSectionExpansionStates(IDialogSettings section)
- {
- for (int i = 0; i < fExpandables.size(); i++)
- {
- ExpandableComposite comp = fExpandables.get(i);
- section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
- }
- }
-
- private IDialogSettings getDialogSettings()
- {
- return XSLUIPlugin.getDefault().getDialogSettings();
- }
-
- /**
- * Saves the expansion states before calling super.
- *
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- @Override
- public void dispose()
- {
- storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
- super.dispose();
- }
-
- private void restoreSectionExpansionStates(IDialogSettings settings)
- {
- for (int i = 0; i < fExpandables.size(); i++)
- {
- ExpandableComposite excomposite = fExpandables.get(i);
- if (settings == null)
- {
- excomposite.setExpanded(i == 0); // only expand the first node by default
- }
- else
- {
- excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
- }
- }
- }
-
- @Override
- protected Preferences getModelPreferences()
- {
- return XSLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /**
- * Save the preferences.
- *
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performOk()
- */
- @Override
- public boolean performOk()
- {
- boolean ok = super.performOk();
- if (ok)
- XSLCorePlugin.getDefault().savePluginPreferences();
- return ok;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ComboData.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ComboData.java
deleted file mode 100644
index 14346ec..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ComboData.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-class ComboData {
- private String fKey;
- private int[] fSeverities;
- private int fIndex;
- int originalSeverity = -2;
-
- public ComboData(String key, int[] severities, int index) {
- fKey = key;
- fSeverities = severities;
- fIndex = index;
- }
-
- public String getKey() {
- return fKey;
- }
-
- public void setIndex(int index) {
- fIndex = index;
- }
-
- public int getIndex() {
- return fIndex;
- }
-
- /**
- * Sets the severity index based on <code>severity</code>.
- * If the severity doesn't exist, the index is set to -1.
- *
- * @param severity the severity level
- */
- public void setSeverity(int severity) {
- for(int i = 0; fSeverities != null && i < fSeverities.length; i++) {
- if(fSeverities[i] == severity) {
- fIndex = i;
- return;
- }
- }
-
- fIndex = -1;
- }
-
- public int getSeverity() {
- return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
- }
-
- boolean isChanged() {
- return fSeverities[fIndex] != originalSeverity;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/MainPreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/MainPreferencePage.java
deleted file mode 100644
index 2ab0432..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/MainPreferencePage.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver - STAR - bug 213853 - Moved main preference page out of
- * debug ui and into XSL ui.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.xsl.ui.internal.Messages;
-
-/**
- *
- *
- */
-public class MainPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- /**
- * MainPreferncePage is the constructor for the XSL Preference Page
- */
- public MainPreferencePage()
- {
- super();
- noDefaultAndApplyButton();
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench)
- {
- }
-
- @Override
- protected Control createContents(Composite ancestor)
- {
- initializeDialogUnits(ancestor);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- ancestor.setLayout(layout);
-
- Label label = new Label(ancestor, SWT.NONE);
- label.setText(Messages.MainPreferencePage);
-
- applyDialogFont(ancestor);
- return ancestor;
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- @Override
- public boolean performOk()
- {
- return super.performOk();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/PropertyPreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/PropertyPreferencePage.java
deleted file mode 100644
index ce0165c..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/PropertyPreferencePage.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver (STAR) - bug 230072 - initial API and implementation
- * based on org.eclipse.wst.html.ui class of
- * the same name.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Link;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.dialogs.ListDialog;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceSorter;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Based loosely on org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage
- */
-abstract class PropertyPreferencePage extends PropertyPage implements IWorkbenchPreferencePage {
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/preferences-properties")); //$NON-NLS-1$ //$NON-NLS-2$
- /*
- * Disable link data, prevents the display of a "workspace" or "project"
- * settings link to prevent recursive dialog launching
- */
- private static final Object DISABLE_LINK = "DISABLE_LINK"; //$NON-NLS-1$
-
- private Map Data = null;
-
- private Button EnableProjectSettings;
-
- private Link ProjectSettingsLink;
-
- private Control Common;
-
- private ControlEnableState Enablements;
-
- public PropertyPreferencePage() {
- super();
- }
-
- @Override
- public final void applyData(Object data) {
- super.applyData(data);
- if (data instanceof Map) {
- Data = (Map) data;
- updateLinkEnablement();
- }
- }
-
- protected abstract Control createCommonContents(Composite composite);
-
- @Override
- public final Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
-
- Composite checkLinkComposite = new Composite(composite, SWT.NONE);
- checkLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- checkLinkComposite.setLayout(new GridLayout(2, false));
-
- if (getProject() != null) {
- EnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
- EnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings);
- EnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
- EnableProjectSettings.setSelection(enabledForProject);
- }
- else {
- Label spacer = new Label(checkLinkComposite, SWT.CHECK);
- spacer.setLayoutData(new GridData());
- }
-
- ProjectSettingsLink = new Link(checkLinkComposite, SWT.NONE);
- ProjectSettingsLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
-
- /*
- * "element" should be a project, if null, link to per-project
- * properties
- */
- if (getProject() != null) {
- ProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureWorkspaceSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
- else {
- ProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureProjectSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- updateLinkEnablement();
-
- ProjectSettingsLink.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (getProject() == null) {
- openProjectSettings();
- }
- else {
- openWorkspaceSettings();
- }
- }
-
- });
-
- if (getProject() != null) {
- Label line = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- line.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- }
-
- Common = createCommonContents(composite);
-
- Common.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (EnableProjectSettings != null) {
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- enablePreferenceContent(EnableProjectSettings.getSelection());
- }
- };
- selectionAdapter.widgetSelected(null);
- EnableProjectSettings.addSelectionListener(selectionAdapter);
- }
-
- applyDialogFont(composite);
- return composite;
- }
-
- protected IScopeContext[] createPreferenceScopes() {
- IProject project = getProject();
- if (project != null) {
- return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
- }
- return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- }
-
- protected abstract String getPreferenceNodeQualifier();
-
- protected abstract String getPreferencePageID();
-
- protected IProject getProject() {
- if (getElement() != null) {
- if (getElement() instanceof IProject) {
- return (IProject) getElement();
- }
- Object adapter = getElement().getAdapter(IProject.class);
- if (adapter instanceof IProject) {
- return (IProject) adapter;
- }
- adapter = getElement().getAdapter(IResource.class);
- if (adapter instanceof IProject) {
- return (IProject) adapter;
- }
- }
- return null;
- }
-
- protected abstract String getProjectSettingsKey();
-
- protected abstract String getPropertyPageID();
-
- protected boolean isElementSettingsEnabled() {
- return EnableProjectSettings != null && EnableProjectSettings.getSelection();
- }
-
- void openProjectSettings() {
- ListDialog dialog = new ListDialog(getShell()) {
-
- @Override
- protected Control createDialogArea(Composite container) {
- Control area = super.createDialogArea(container);
- getTableViewer().setSorter(new ResourceSorter(ResourceSorter.NAME));
- return area;
- }
- };
- dialog.setMessage(SSEUIMessages.PropertyPreferencePage_02);
- dialog.setContentProvider(new IStructuredContentProvider() {
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- return ((IWorkspace) inputElement).getRoot().getProjects();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
- dialog.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), SSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
- dialog.setInput(ResourcesPlugin.getWorkspace());
- dialog.setTitle(SSEUIMessages.PropertyPreferencePage_01);
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if (result.length > 0) {
- IProject project = (IProject) dialog.getResult()[0];
- Map data = new HashMap();
- data.put(DISABLE_LINK, Boolean.TRUE);
- PreferencesUtil.createPropertyDialogOn(getShell(), project, getPropertyPageID(), new String[]{getPropertyPageID()}, data).open();
- }
- }
- }
-
- void openWorkspaceSettings() {
- Map data = new HashMap();
- data.put(DISABLE_LINK, Boolean.TRUE);
- PreferencesUtil.createPreferenceDialogOn(getShell(), getPreferencePageID(), new String[]{getPreferencePageID()}, data).open();
- }
-
- @Override
- public boolean performOk() {
- boolean ok = super.performOk();
- IScopeContext[] preferenceScopes = createPreferenceScopes();
- if (getProject() != null) {
- if (isElementSettingsEnabled()) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- preferenceScopes[0].getNode(getPreferenceNodeQualifier()).putBoolean(getProjectSettingsKey(), EnableProjectSettings.getSelection());
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(getProjectSettingsKey());
- }
- }
- return ok;
- }
-
- @Override
- protected void performDefaults() {
- if(getProject() != null && EnableProjectSettings != null) {
- EnableProjectSettings.setSelection(false);
- enablePreferenceContent(false);
- }
- super.performDefaults();
- }
-
- private void updateLinkEnablement() {
- if (Data != null && ProjectSettingsLink != null) {
- ProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(Data.get(DISABLE_LINK)));
- }
- }
-
- /**
- * Controls the enablement of the common content region
- * of a property or preference page
- *
- * @param enable the enabled state of the common content
- * area
- */
- protected void enablePreferenceContent(boolean enable) {
- if(enable) {
- if(Enablements != null) {
- Enablements.restore();
- Enablements = null;
- }
- }
- else {
- if(Enablements == null)
- Enablements = ControlEnableState.disable(Common);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ValidationPreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ValidationPreferencePage.java
deleted file mode 100644
index 76e199d..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/ValidationPreferencePage.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.xsl.core.ValidationPreferences;
-
-/**
- * Preference page for XSL validator preferences.
- *
- * @author Doug Satchwell
- * @deprecated This has been replaced by XSLValidationPreferencePage
- */
-@Deprecated
-public class ValidationPreferencePage extends AbstractXSLPreferencePage
-{
- private static final String[] ERRORS = new String[] { "Error", "Warning", "Ignore" };
- private static final int[] ERROR_VALUES = new int[] { IMarker.SEVERITY_ERROR, IMarker.SEVERITY_WARNING, IMarker.SEVERITY_INFO };
- private static final Map<Integer, Integer> ERROR_MAP = new HashMap<Integer, Integer>();
- private Text maxErrorsText;
- private Map<String, Combo> combos = new HashMap<String, Combo>();
-
- static
- {
- ERROR_MAP.put(IMarker.SEVERITY_ERROR, 0);
- ERROR_MAP.put(IMarker.SEVERITY_WARNING, 1);
- ERROR_MAP.put(IMarker.SEVERITY_INFO, 2);
- }
-
- /**
- * Create a new instance of this.
- */
- public ValidationPreferencePage()
- {
- super();
- // only used when page is shown programatically
- setTitle("XSL Validation");
- setDescription("Configure validation preferences");
- }
-
- @Override
- protected Composite createCommonContents(Composite parent)
- {
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
-
- final ScrolledPageContent pageContent = new ScrolledPageContent(parent);
- pageContent.setLayoutData(new GridData(GridData.FILL_BOTH));
- pageContent.setExpandHorizontal(true);
- pageContent.setExpandVertical(true);
-
- Composite body = pageContent.getBody();
- body.setLayout(layout);
-
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
-
- createLabel(body, "Maximum number of errors reported per stylesheet:");
- maxErrorsText = createTextField(body);
- maxErrorsText.addModifyListener(this);
-
- Composite twistie;
-
- twistie = createTwistie(body,"Imports and Includes",2);
- createCombo(twistie, "Unresolved include/import:", ValidationPreferences.MISSING_INCLUDE);
- createCombo(twistie, "Circular references:", ValidationPreferences.CIRCULAR_REF);
-
- twistie = createTwistie(body,"Named Templates",2);
- createCombo(twistie, "Template name conflicts:", ValidationPreferences.TEMPLATE_CONFLICT);
- createCombo(twistie, "Duplicate parameterw:", ValidationPreferences.DUPLICATE_PARAMETER);
- createCombo(twistie, "Parameter without name attribute:", ValidationPreferences.NAME_ATTRIBUTE_MISSING);
- createCombo(twistie, "Parameter with empty name attribute:", ValidationPreferences.NAME_ATTRIBUTE_EMPTY);
-
- twistie = createTwistie(body,"Template Calls",2);
- createCombo(twistie, "Unresolved templates:", ValidationPreferences.CALL_TEMPLATES);
- createCombo(twistie, "Missing parameters:", ValidationPreferences.MISSING_PARAM);
- createCombo(twistie, "Parameters without value:", ValidationPreferences.EMPTY_PARAM);
-
- twistie = createTwistie(body,"XPath Problems",2);
- createCombo(twistie, "Incorrect XPath syntax:", ValidationPreferences.XPATHS);
-
- return parent;
- }
-
- @Override
- protected Combo createCombo(Composite parent, String label, String prefKey)
- {
- Combo combo = super.createCombo(parent, label, prefKey);
- combo.setItems(ERRORS);
- combos.put(prefKey, combo);
- return combo;
- }
-
- @Override
- protected void initializeValues()
- {
- int maxErrors = getModelPreferences().getInt(ValidationPreferences.MAX_ERRORS);
- maxErrorsText.setText(String.valueOf(maxErrors));
- for (Map.Entry<String, Combo> entry : combos.entrySet())
- {
- int val = getModelPreferences().getInt(entry.getKey());
- entry.getValue().select(ERROR_MAP.get(val));
- }
- }
-
- @Override
- protected void storeValues()
- {
- int maxErrors = Integer.parseInt(maxErrorsText.getText());
- getModelPreferences().setValue(ValidationPreferences.MAX_ERRORS, maxErrors);
- for (Map.Entry<String, Combo> entry : combos.entrySet())
- {
- int index = entry.getValue().getSelectionIndex();
- getModelPreferences().setValue(entry.getKey(), ERROR_VALUES[index]);
- }
- }
-
- @Override
- protected void validateValues()
- {
- String errorMessage = null;
- try
- {
- int maxErrors = Integer.parseInt(maxErrorsText.getText());
- if (maxErrors < 0)
- errorMessage = "Max errors must be a positive integer";
- }
- catch (NumberFormatException e)
- {
- errorMessage = "Max errors must be a positive integer";
- }
- setErrorMessage(errorMessage);
- setValid(errorMessage == null);
- }
-
- @Override
- protected void performDefaults()
- {
- int maxErrors = getModelPreferences().getDefaultInt(ValidationPreferences.MAX_ERRORS);
- maxErrorsText.setText(String.valueOf(maxErrors));
- for (Map.Entry<String, Combo> entry : combos.entrySet())
- {
- int def = getModelPreferences().getDefaultInt(entry.getKey());
- entry.getValue().select(ERROR_MAP.get(def));
- }
- super.performDefaults();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLSyntaxColoringPage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLSyntaxColoringPage.java
deleted file mode 100755
index e308725..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLSyntaxColoringPage.java
+++ /dev/null
@@ -1,926 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.preference.ColorSelector;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-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.Link;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-import org.eclipse.wst.xsl.ui.internal.style.IStyleConstantsXSL;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xsl.ui.internal.Messages;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * A preference page to configure our XSL syntax color. It resembles the XML
- * pages.
- *
- * @since 1.0
- */
-public class XSLSyntaxColoringPage extends PreferencePage implements
- IWorkbenchPreferencePage {
-
- private static final String SYNTAXCOLORING_XSL = "syntaxcoloring.xsl"; //$NON-NLS-1$
- private static final String XSLFILES_DIR = "xslfiles"; //$NON-NLS-1$
- private Button bold;
- private Label foregroundLabel;
- private Label backgroundLabel;
- private Button clearStyle;
- private Map contextToXSLStyleMap;
- private Color defaultForeground = null;
- private Color defaultBackground = null;
- private IStructuredDocument document;
- private ColorSelector foregroundColorEditor;
- private ColorSelector backgroundColorEditor;
- private Button italic;
- private OverlayPreferenceStore overlayStore;
- private Button strike;
- private Collection<String> stylePreferenceKeys;
- private StructuredViewer stylesViewer = null;
- private Map styleToDescriptionMap;
- private StyledText styledText;
- private Button underline;
-
- // activate controls based on the given local color type
- private void activate(String namedStyle) {
- Color foreground = defaultForeground;
- Color background = defaultBackground;
- if (namedStyle == null) {
- clearStyle.setEnabled(false);
- bold.setEnabled(false);
- italic.setEnabled(false);
- strike.setEnabled(false);
- underline.setEnabled(false);
- foregroundLabel.setEnabled(false);
- backgroundLabel.setEnabled(false);
- foregroundColorEditor.setEnabled(false);
- backgroundColorEditor.setEnabled(false);
- bold.setSelection(false);
- italic.setSelection(false);
- strike.setSelection(false);
- underline.setSelection(false);
- } else {
- TextAttribute attribute = getAttributeFor(namedStyle);
- clearStyle.setEnabled(true);
- bold.setEnabled(true);
- italic.setEnabled(true);
- strike.setEnabled(true);
- underline.setEnabled(true);
- foregroundLabel.setEnabled(true);
- backgroundLabel.setEnabled(true);
- foregroundColorEditor.setEnabled(true);
- backgroundColorEditor.setEnabled(true);
- bold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
- italic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
- strike
- .setSelection((attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0);
- underline
- .setSelection((attribute.getStyle() & TextAttribute.UNDERLINE) != 0);
- if (attribute.getForeground() != null) {
- foreground = attribute.getForeground();
- }
- if (attribute.getBackground() != null) {
- background = attribute.getBackground();
- }
- }
-
- foregroundColorEditor.setColorValue(foreground.getRGB());
- backgroundColorEditor.setColorValue(background.getRGB());
- }
-
- /**
- * Color the text in the sample area according to the current preferences
- */
- public void applyStyles() {
- if (styledText == null || styledText.isDisposed())
- return;
- IStructuredDocumentRegion documentRegion = document
- .getFirstStructuredDocumentRegion();
-
- while (documentRegion != null) {
- ITextRegionList regions = documentRegion.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion currentRegion = regions.get(i);
- // lookup the local coloring type and apply it
- // This could be potentially expensive as we get the model and
- // read it pretty consistently.
- String namedStyle = null;
- if (contextToXSLStyleMap.containsKey(currentRegion.getType())) {
- namedStyle = (String) contextToXSLStyleMap
- .get(currentRegion.getType());
- if (namedStyle == null)
- continue;
- TextAttribute attribute = getAttributeFor(namedStyle);
- if (attribute == null)
- continue;
- StyleRange style = new StyleRange(documentRegion
- .getStartOffset(currentRegion), currentRegion
- .getTextLength(), attribute.getForeground(),
- attribute.getBackground(), attribute.getStyle());
- style.strikeout = (attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
- style.underline = (attribute.getStyle() & TextAttribute.UNDERLINE) != 0;
- styledText.setStyleRange(style);
- }
- }
- documentRegion = documentRegion.getNext();
- }
- }
-
- public Button createCheckbox(Composite parent, String label) {
- Button button = new Button(parent, SWT.CHECK);
- button.setText(label);
- button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- return button;
- }
-
- /**
- * Creates composite control and sets the default layout data.
- */
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.makeColumnsEqualWidth = false;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- composite.setLayoutData(data);
- return composite;
- }
-
- @Override
- protected Control createContents(final Composite parent) {
- initializeDialogUnits(parent);
-
- defaultForeground = parent.getDisplay().getSystemColor(
- SWT.COLOR_LIST_FOREGROUND);
- defaultBackground = parent.getDisplay().getSystemColor(
- SWT.COLOR_LIST_BACKGROUND);
- Composite pageComponent = createComposite(parent, 2);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent,
- IHelpContextIds.XML_PREFWEBX_STYLES_HELPID);
-
- Link link = new Link(pageComponent, SWT.WRAP);
- link.setText(Messages.XSLSyntaxColoringPage);
- link.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- PreferencesUtil.createPreferenceDialogOn(parent.getShell(),
- e.text, null, null);
- }
- });
-
- GridData linkData = new GridData(SWT.FILL, SWT.BEGINNING, true, false,
- 2, 1);
- linkData.widthHint = 150; // only expand further if anyone else requires
- // it
- link.setLayoutData(linkData);
-
- new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
- new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
-
- SashForm editor = new SashForm(pageComponent, SWT.VERTICAL);
- GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData2.horizontalSpan = 2;
- editor.setLayoutData(gridData2);
- SashForm top = new SashForm(editor, SWT.HORIZONTAL);
- Composite styleEditor = createComposite(top, 1);
- ((GridLayout) styleEditor.getLayout()).marginRight = 5;
- ((GridLayout) styleEditor.getLayout()).marginLeft = 0;
- createLabel(styleEditor, XMLUIMessages.SyntaxColoringPage_0);
- stylesViewer = createStylesViewer(styleEditor);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.horizontalIndent = 0;
- Iterator iterator = styleToDescriptionMap.values().iterator();
- while (iterator.hasNext()) {
- gridData.widthHint = Math.max(gridData.widthHint,
- convertWidthInCharsToPixels(iterator.next().toString()
- .length()));
- }
- gridData.heightHint = convertHeightInCharsToPixels(5);
- stylesViewer.getControl().setLayoutData(gridData);
-
- Composite editingComposite = createComposite(top, 1);
- ((GridLayout) styleEditor.getLayout()).marginLeft = 5;
- createLabel(editingComposite, ""); //$NON-NLS-1$
- Button enabler = createCheckbox(editingComposite,
- XMLUIMessages.SyntaxColoringPage_2);
- enabler.setEnabled(false);
- enabler.setSelection(true);
- Composite editControls = createComposite(editingComposite, 2);
- ((GridLayout) editControls.getLayout()).marginLeft = 20;
-
- foregroundLabel = createLabel(editControls,
- SSEUIMessages.Foreground_UI_);
- ((GridData) foregroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
- foregroundLabel.setEnabled(false);
-
- foregroundColorEditor = new ColorSelector(editControls);
- Button fForegroundColor = foregroundColorEditor.getButton();
- GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
- fForegroundColor.setLayoutData(gd);
- foregroundColorEditor.setEnabled(false);
-
- backgroundLabel = createLabel(editControls,
- SSEUIMessages.Background_UI_);
- ((GridData) backgroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
- backgroundLabel.setEnabled(false);
-
- backgroundColorEditor = new ColorSelector(editControls);
- Button fBackgroundColor = backgroundColorEditor.getButton();
- gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
- fBackgroundColor.setLayoutData(gd);
- backgroundColorEditor.setEnabled(false);
-
- bold = createCheckbox(editControls, XMLUIMessages.SyntaxColoringPage_3);
- bold.setEnabled(false);
- ((GridData) bold.getLayoutData()).horizontalSpan = 2;
- italic = createCheckbox(editControls,
- XMLUIMessages.SyntaxColoringPage_4);
- italic.setEnabled(false);
- ((GridData) italic.getLayoutData()).horizontalSpan = 2;
- strike = createCheckbox(editControls,
- XMLUIMessages.SyntaxColoringPage_5);
- strike.setEnabled(false);
- ((GridData) strike.getLayoutData()).horizontalSpan = 2;
- underline = createCheckbox(editControls,
- XMLUIMessages.SyntaxColoringPage_6);
- underline.setEnabled(false);
- ((GridData) underline.getLayoutData()).horizontalSpan = 2;
- clearStyle = new Button(editingComposite, SWT.PUSH);
- clearStyle.setText(SSEUIMessages.Restore_Default_UI_); // = "Restore Default"
- clearStyle.setLayoutData(new GridData(SWT.BEGINNING));
- ((GridData) clearStyle.getLayoutData()).horizontalIndent = 20;
- clearStyle.setEnabled(false);
-
- Composite sampleArea = createComposite(editor, 1);
-
- ((GridLayout) sampleArea.getLayout()).marginLeft = 5;
- ((GridLayout) sampleArea.getLayout()).marginTop = 5;
- createLabel(sampleArea, SSEUIMessages.Sample_text__UI_); // = "&Sample text:"
- SourceViewer viewer = new SourceViewer(sampleArea, null, SWT.BORDER
- | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
- | SWT.READ_ONLY);
- styledText = viewer.getTextWidget();
- GridData gridData3 = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData3.widthHint = convertWidthInCharsToPixels(20);
- gridData3.heightHint = convertHeightInCharsToPixels(5);
- gridData3.horizontalSpan = 2;
- styledText.setLayoutData(gridData3);
- styledText.setEditable(false);
- styledText.setFont(JFaceResources
- .getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- styledText.addKeyListener(getTextKeyListener());
- styledText.addSelectionListener(getTextSelectionListener());
- styledText.addMouseListener(getTextMouseListener());
- styledText.addTraverseListener(getTraverseListener());
- setAccessible(styledText, SSEUIMessages.Sample_text__UI_);
-
- try {
- File file = XSLUIPlugin.makeFileFor(XSLSyntaxColoringPage.XSLFILES_DIR,
- XSLSyntaxColoringPage.SYNTAXCOLORING_XSL);
- document = StructuredModelManager.getModelManager()
- .createStructuredDocumentFor(file.getAbsolutePath(),
- new FileInputStream(file), null);
- } catch (Exception ex) {
- XSLUIPlugin.log(ex);
- }
-
- viewer.setDocument(document);
-
- top.setWeights(new int[] { 1, 1 });
- editor.setWeights(new int[] { 1, 1 });
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent,
- IHelpContextIds.XML_PREFWEBX_STYLES_HELPID);
-
- stylesViewer.setInput(getStylePreferenceKeys());
-
- applyStyles();
-
- stylesViewer
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (!event.getSelection().isEmpty()) {
- Object o = ((IStructuredSelection) event
- .getSelection()).getFirstElement();
- String namedStyle = o.toString();
- activate(namedStyle);
- if (namedStyle == null)
- return;
- }
- }
- });
-
- foregroundColorEditor.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- Object o = ((IStructuredSelection) stylesViewer
- .getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[0];
- // open color dialog to get new color
- String newValue = ColorHelper
- .toRGBString(foregroundColorEditor
- .getColorValue());
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[0] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle,
- newPrefString);
- applyStyles();
- styledText.redraw();
- }
- }
- }
- }
- });
-
- backgroundColorEditor.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- Object o = ((IStructuredSelection) stylesViewer
- .getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[1];
- // open color dialog to get new color
- String newValue = ColorHelper
- .toRGBString(backgroundColorEditor
- .getColorValue());
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[1] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle,
- newPrefString);
- applyStyles();
- styledText.redraw();
- activate(namedStyle);
- }
- }
- }
- }
- });
-
- bold.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) stylesViewer.getSelection())
- .getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[2];
- String newValue = String.valueOf(bold.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[2] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- styledText.redraw();
- }
- }
- }
- });
-
- italic.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) stylesViewer.getSelection())
- .getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[3];
- String newValue = String.valueOf(italic.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[3] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- styledText.redraw();
- }
- }
- }
- });
-
- strike.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) stylesViewer.getSelection())
- .getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[4];
- String newValue = String.valueOf(strike.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[4] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- styledText.redraw();
- }
- }
- }
- });
-
- underline.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) stylesViewer.getSelection())
- .getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[5];
- String newValue = String.valueOf(underline.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[5] = newValue;
- String newPrefString = ColorHelper
- .packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- styledText.redraw();
- }
- }
- }
- });
-
- clearStyle.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (stylesViewer.getSelection().isEmpty())
- return;
- String namedStyle = ((IStructuredSelection) stylesViewer
- .getSelection()).getFirstElement().toString();
- getOverlayStore().setToDefault(namedStyle);
- applyStyles();
- styledText.redraw();
- activate(namedStyle);
- }
- });
-
- return pageComponent;
- }
-
- private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(text);
- GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
- label.setLayoutData(data);
- label.setBackground(parent.getBackground());
- return label;
- }
-
- // protected Label createDescriptionLabel(Composite parent) {
- // return null;
- // }
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- private OverlayKey[] createOverlayStoreKeys() {
- List overlayKeys = new ArrayList();
-
- Iterator i = getStylePreferenceKeys().iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
- OverlayPreferenceStore.STRING, (String) i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys
- .size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- /**
- * Creates the List viewer where we see the various syntax element display
- * names--would it ever be a Tree like JDT's?
- *
- * @param parent
- * @return
- */
- private StructuredViewer createStylesViewer(Composite parent) {
- StructuredViewer stylesViewer = new ListViewer(parent, SWT.SINGLE
- | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- stylesViewer
- .setComparator(new ViewerComparator(Collator.getInstance()));
- stylesViewer.setLabelProvider(new LabelProvider() {
- @Override
- public String getText(Object element) {
- Object description = styleToDescriptionMap.get(element);
- if (description != null)
- return description.toString();
- return super.getText(element);
- }
- });
- stylesViewer.setContentProvider(new ITreeContentProvider() {
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- return getStylePreferenceKeys().toArray();
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return getStylePreferenceKeys();
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
- }
- });
- return stylesViewer;
- }
-
- @Override
- public void dispose() {
- if (overlayStore != null) {
- overlayStore.stop();
- }
- super.dispose();
- }
-
- @Override
- protected IPreferenceStore doGetPreferenceStore() {
- return XSLUIPlugin.getDefault().getPreferenceStore();
- }
-
- private TextAttribute getAttributeFor(String namedStyle) {
- TextAttribute ta = new TextAttribute(defaultForeground,
- defaultBackground, SWT.NORMAL);
-
- if (namedStyle != null && overlayStore != null) {
- // note: "namedStyle" *is* the preference key
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper
- .unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
-
- int fontModifier = SWT.NORMAL;
-
- if (stylePrefs.length > 2) {
- boolean on = Boolean.valueOf(stylePrefs[2]).booleanValue();
- if (on)
- fontModifier = fontModifier | SWT.BOLD;
- }
- if (stylePrefs.length > 3) {
- boolean on = Boolean.valueOf(stylePrefs[3]).booleanValue();
- if (on)
- fontModifier = fontModifier | SWT.ITALIC;
- }
- if (stylePrefs.length > 4) {
- boolean on = Boolean.valueOf(stylePrefs[4]).booleanValue();
- if (on)
- fontModifier = fontModifier
- | TextAttribute.STRIKETHROUGH;
- }
- if (stylePrefs.length > 5) {
- boolean on = Boolean.valueOf(stylePrefs[5]).booleanValue();
- if (on)
- fontModifier = fontModifier | TextAttribute.UNDERLINE;
- }
-
- ta = new TextAttribute((foreground != null) ? EditorUtility
- .getColor(foreground) : null,
- (background != null) ? EditorUtility
- .getColor(background) : null, fontModifier);
- }
- }
- return ta;
- }
-
- private String getNamedStyleAtOffset(int offset) {
- // ensure the offset is clean
- if (offset >= document.getLength())
- return getNamedStyleAtOffset(document.getLength() - 1);
- else if (offset < 0)
- return getNamedStyleAtOffset(0);
- IStructuredDocumentRegion documentRegion = document
- .getFirstStructuredDocumentRegion();
- while (documentRegion != null && !documentRegion.containsOffset(offset)) {
- documentRegion = documentRegion.getNext();
- }
- if (documentRegion != null) {
- // find the ITextRegion's Context at this offset
- ITextRegion interest = documentRegion
- .getRegionAtCharacterOffset(offset);
- if (interest == null)
- return null;
- if (offset > documentRegion.getTextEndOffset(interest))
- return null;
- String regionContext = interest.getType();
- if (regionContext == null)
- return null;
- // find the named style (internal/selectable name) for that
- // context
- String namedStyle = (String) contextToXSLStyleMap.get(regionContext);
- if (namedStyle != null) {
- return namedStyle;
- }
- }
- return null;
- }
-
- private OverlayPreferenceStore getOverlayStore() {
- return overlayStore;
- }
-
- private Collection<String> getStylePreferenceKeys() {
- if (stylePreferenceKeys == null) {
- List<String> styles = new ArrayList<String>();
- styles.add(IStyleConstantsXSL.TAG_BORDER);
- styles.add(IStyleConstantsXSL.TAG_NAME);
- styles.add(IStyleConstantsXSL.TAG_ATTRIBUTE_NAME);
- styles.add(IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE);
- stylePreferenceKeys = styles;
- }
- return stylePreferenceKeys;
- }
-
- private KeyListener getTextKeyListener() {
- return new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
-
- public void keyReleased(KeyEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
- };
- }
-
- private MouseListener getTextMouseListener() {
- return new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseUp(MouseEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
- };
- }
-
- private SelectionListener getTextSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- selectColorAtOffset(e.x);
- if (e.widget instanceof StyledText) {
- ((StyledText) e.widget).setSelection(e.x);
- }
- }
-
- public void widgetSelected(SelectionEvent e) {
- selectColorAtOffset(e.x);
- if (e.widget instanceof StyledText) {
- ((StyledText) e.widget).setSelection(e.x);
- }
- }
- };
- }
-
- private TraverseListener getTraverseListener() {
- return new TraverseListener() {
- /**
- * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
- */
- public void keyTraversed(TraverseEvent e) {
- if (e.widget instanceof StyledText) {
- if ((e.detail == SWT.TRAVERSE_TAB_NEXT)
- || (e.detail == SWT.TRAVERSE_TAB_PREVIOUS))
- e.doit = true;
- }
- }
- };
- }
-
- public void init(IWorkbench workbench) {
- setDescription(SSEUIMessages.SyntaxColoring_Description);
-
- styleToDescriptionMap = new HashMap();
- contextToXSLStyleMap = new HashMap();
-
- initStyleToDescriptionMap();
- initRegionContextToStyleMap();
-
- overlayStore = new OverlayPreferenceStore(getPreferenceStore(),
- createOverlayStoreKeys());
- overlayStore.load();
- overlayStore.start();
- }
-
- private void initRegionContextToStyleMap() {
- xslContextToStyleMap();
- }
-
-
- @SuppressWarnings("unchecked")
- private void xslContextToStyleMap() {
- contextToXSLStyleMap.put(DOMRegionContext.XML_TAG_OPEN,
- IStyleConstantsXSL.TAG_BORDER);
- contextToXSLStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN,
- IStyleConstantsXSL.TAG_BORDER);
- contextToXSLStyleMap.put(DOMRegionContext.XML_TAG_NAME,
- IStyleConstantsXSL.TAG_NAME);
- contextToXSLStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME,
- IStyleConstantsXSL.TAG_ATTRIBUTE_NAME);
- contextToXSLStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE,
- IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE);
- contextToXSLStyleMap.put(DOMRegionContext.XML_TAG_CLOSE,
- IStyleConstantsXSL.TAG_BORDER);
- contextToXSLStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE,
- IStyleConstantsXSL.TAG_BORDER);
- }
-
- @SuppressWarnings("unchecked")
- private void initStyleToDescriptionMap() {
- styleToDescriptionMap.put(IStyleConstantsXSL.TAG_BORDER,
- XMLUIMessages.Tag_Delimiters_UI_);
- styleToDescriptionMap.put(IStyleConstantsXSL.TAG_NAME,
- XMLUIMessages.Tag_Names_UI_);
- styleToDescriptionMap.put(IStyleConstantsXSL.TAG_ATTRIBUTE_NAME,
- XMLUIMessages.Attribute_Names_UI_);
- styleToDescriptionMap.put(IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE,
- XMLUIMessages.Attribute_Values_UI_);
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- stylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- styledText.redraw();
- }
-
- @Override
- public boolean performOk() {
- getOverlayStore().propagate();
-
- XSLUIPlugin.getDefault().savePluginPreferences();
- SSEUIPlugin.getDefault().savePluginPreferences();
- return true;
- }
-
- private void selectColorAtOffset(int offset) {
- String namedStyle = getNamedStyleAtOffset(offset);
- if (namedStyle != null) {
- stylesViewer.setSelection(new StructuredSelection(namedStyle));
- stylesViewer.reveal(namedStyle);
- } else {
- stylesViewer.setSelection(StructuredSelection.EMPTY);
- }
- activate(namedStyle);
- }
-
- /**
- * Specifically set the reporting name of a control for accessibility
- */
- private void setAccessible(Control control, String name) {
- if (control == null)
- return;
- final String n = name;
- control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- if (e.childID == ACC.CHILDID_SELF)
- e.result = n;
- }
- });
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLTemplatePreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLTemplatePreferencePage.java
deleted file mode 100644
index 2b09d62..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLTemplatePreferencePage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import org.eclipse.wst.xml.ui.internal.preferences.XMLTemplatePreferencePage;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * XSLTemplatePreferencePage sets up the template preference page that
- * contains the templates for xpath, xpath 2.0, axis, operators, and
- * exslt functions.
- *
- * @author dcarver
- *
- */
-public class XSLTemplatePreferencePage extends XMLTemplatePreferencePage {
-
- /**
- *
- */
- public XSLTemplatePreferencePage() {
- setPreferenceStore(XSLUIPlugin.getDefault().getPreferenceStore());
- setTemplateStore(XSLUIPlugin.getDefault().getTemplateStore());
- setContextTypeRegistry(XSLUIPlugin.getDefault().getTemplateContextRegistry());
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- @Override
- public boolean performOk() {
- boolean ok = super.performOk();
- XSLUIPlugin.getDefault().savePluginPreferences();
- return ok;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLUIPreferenceInitializer.java
deleted file mode 100755
index 63694ce..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-import org.eclipse.wst.xsl.ui.internal.style.IStyleConstantsXSL;
-
-/**
- * Sets default values for XML UI preferences
- */
-public class XSLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- IPreferenceStore store = XSLUIPlugin.getDefault().getPreferenceStore();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
-
- // XSL Style Preferences
- String BOLD = " | null | true"; //$NON-NLS-1$
- String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
- String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXSL.TAG_ATTRIBUTE_NAME, 127, 0, 127) + BOLD;
- store.setDefault(IStyleConstantsXSL.TAG_ATTRIBUTE_NAME, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
- store.setDefault(IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXSL.TAG_BORDER, 0, 128, 128) + BOLD;
- store.setDefault(IStyleConstantsXSL.TAG_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXSL.TAG_NAME, 63, 127, 127) + BOLD;
- store.setDefault(IStyleConstantsXSL.TAG_NAME, styleValue);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLValidationPreferencePage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLValidationPreferencePage.java
deleted file mode 100644
index dae7fa6..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/preferences/XSLValidationPreferencePage.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver - bug 230072 - initial API and implementation based on code from
- * Doug Satchwell, Jesper Moeller, and the
- * HTML Validation PreferencePage.
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.preferences;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.sse.ui.internal.util.PixelConverter;
-import org.eclipse.wst.xsl.core.ValidationPreferences;
-import org.eclipse.wst.xsl.core.internal.XSLCorePlugin;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-public class XSLValidationPreferencePage extends AbstractValidationSettingsPage implements ModifyListener {
-
- private static final String[] ERRORS = new String[] { "Error", "Warning", "Ignore" };
- private static final int[] ERROR_VALUES = new int[] { IMarker.SEVERITY_ERROR, IMarker.SEVERITY_WARNING, IMarker.SEVERITY_INFO };
- private static final Map<Integer, Integer> ERROR_MAP = new HashMap<Integer, Integer>();
- private Text maxErrorsText;
- private Map<String, Combo> combos = new HashMap<String, Combo>();
- private List<ExpandableComposite> Expandables = new ArrayList<ExpandableComposite>();
- private static final String SETTINGS_SECTION_NAME = "XSLValidationSeverities";//$NON-NLS-1$
- private PixelConverter fPixelConverter;
-
-
- static
- {
- ERROR_MAP.put(IMarker.SEVERITY_ERROR, 0);
- ERROR_MAP.put(IMarker.SEVERITY_WARNING, 1);
- ERROR_MAP.put(IMarker.SEVERITY_INFO, 2);
- }
-
- @Override
- protected Control createCommonContents(Composite parent) {
- final Composite page = new Composite(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- page.setLayout(layout);
-
- fPixelConverter = new PixelConverter(parent);
-
- final Composite content = createValidationSection(page);
-
- loadPreferences();
- restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
-
- GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
- content.setLayoutData(gridData);
-
- return page;
- }
-
- protected Composite createValidationSection(Composite parent)
- {
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
-
- final ScrolledPageContent pageContent = new ScrolledPageContent(parent);
- pageContent.setLayoutData(new GridData(GridData.FILL_BOTH));
- pageContent.setExpandHorizontal(true);
- pageContent.setExpandVertical(true);
-
- Composite body = pageContent.getBody();
- body.setLayout(layout);
-
- GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
- gd.horizontalIndent= 0;
-
- Label description = new Label(body, SWT.NONE);
- description.setText("Select the serverity level for the following validation problems:");
- description.setFont(pageContent.getFont());
- description.setLayoutData(gd);
-
-
- createLabel(body, "Maximum number of errors reported per stylesheet:");
- maxErrorsText = createTextField(body);
- maxErrorsText.addModifyListener(this);
-
- ExpandableComposite twistie;
-
- int columns = 3;
- twistie = createTwistie(body,"Imports and Includes",columns);
- Composite inner = createInnerComposite(parent, twistie, columns);
-
- String label = "Unresolved include/import:";
- createCombo(inner, label, ValidationPreferences.MISSING_INCLUDE);
-
- label = "Unresolved include/import:";
- inner = createInnerComposite(parent, twistie, columns);
- createCombo(inner, label, ValidationPreferences.MISSING_INCLUDE);
- createCombo(inner, "Circular references:", ValidationPreferences.CIRCULAR_REF);
-
- twistie = createTwistie(body,"Named Templates",columns);
- inner = createInnerComposite(parent, twistie, columns);
-
- createCombo(inner, "Template name conflicts:", ValidationPreferences.TEMPLATE_CONFLICT);
- createCombo(inner, "Duplicate parameterw:", ValidationPreferences.DUPLICATE_PARAMETER);
- createCombo(inner, "Parameter without name attribute:", ValidationPreferences.NAME_ATTRIBUTE_MISSING);
- createCombo(inner, "Parameter with empty name attribute:", ValidationPreferences.NAME_ATTRIBUTE_EMPTY);
-
- twistie = createTwistie(body,"Template Calls",columns);
- inner = createInnerComposite(parent, twistie, columns);
-
- createCombo(inner, "Unresolved templates:", ValidationPreferences.CALL_TEMPLATES);
- createCombo(inner, "Missing parameters:", ValidationPreferences.MISSING_PARAM);
- createCombo(inner, "Parameters without value:", ValidationPreferences.EMPTY_PARAM);
-
- twistie = createTwistie(body,"XPath Problems",columns);
- inner = createInnerComposite(parent, twistie, columns);
- createCombo(inner, "Incorrect XPath syntax:", ValidationPreferences.XPATHS);
-
- return parent;
- }
-
- private Composite createInnerComposite(Composite parent,
- ExpandableComposite twistie, int columns) {
- Composite inner = new Composite(twistie, SWT.NONE);
- inner.setFont(parent.getFont());
- inner.setLayout(new GridLayout(columns, false));
- twistie.setClient(inner);
- return inner;
- }
-
- protected Combo createCombo(Composite parent, String label, String key) {
- return addComboBox(parent, label, key, ERROR_VALUES, ERRORS, 0);
- }
-
- protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
-
- //GridData
- GridData data = new GridData(GridData.FILL);
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- return label;
- }
-
- protected Text createTextField(Composite parent) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.CENTER;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- text.setLayoutData(data);
-
- return text;
- }
-
- @Override
- protected ExpandableComposite createTwistie(Composite parent, String label, int nColumns) {
- ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
- excomposite.addExpansionListener(new ExpansionAdapter() {
- @Override
- public void expansionStateChanged(ExpansionEvent e) {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- Expandables.add(excomposite);
- makeScrollableCompositeAware(excomposite);
- return excomposite;
- }
-
- private void makeScrollableCompositeAware(Control control)
- {
- ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
- if (parentScrolledComposite != null)
- {
- parentScrolledComposite.adaptChild(control);
- }
- }
-
- @Override
- public void dispose() {
- storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
- super.dispose();
- }
-
- protected String getQualifier() {
- return XSLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- @Override
- protected String getPreferenceNodeQualifier() {
- return XSLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- @Override
- protected String getPreferencePageID() {
- return "org.eclipse.wst.xsl.ui.preferences.Validation";
- }
-
- @Override
- protected String getProjectSettingsKey() {
- return XSLCorePlugin.USE_PROJECT_SETTINGS;
- }
-
- protected IDialogSettings getDialogSettings() {
- return XSLUIPlugin.getDefault().getDialogSettings();
- }
-
- @Override
- protected String getPropertyPageID() {
- return "org.eclipse.wst.xsl.ui.propertyPage.project.validation";
- }
-
- public void init(IWorkbench workbench) {
-
- }
-
- public void modifyText(ModifyEvent e) {
- // If we are called too early, i.e. before the controls are created
- // then return
- // to avoid null pointer exceptions
- if (e.widget != null && e.widget.isDisposed())
- return;
-
- validateValues();
- enableValues();
- }
-
-
- @Override
- protected void storeValues()
- {
- int maxErrors = Integer.parseInt(maxErrorsText.getText());
- getModelPreferences().setValue(ValidationPreferences.MAX_ERRORS, maxErrors);
- for (Map.Entry<String, Combo> entry : combos.entrySet())
- {
- int index = entry.getValue().getSelectionIndex();
- getModelPreferences().setValue(entry.getKey(), ERROR_VALUES[index]);
- }
- super.storeValues();
- }
-
- protected Preferences getModelPreferences()
- {
- return XSLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected boolean loadPreferences() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- initializeValues();
- validateValues();
- enableValues();
- }
- });
- return true;
- }
-
- protected void initializeValues()
- {
- int maxErrors = getModelPreferences().getInt(ValidationPreferences.MAX_ERRORS);
- maxErrorsText.setText(String.valueOf(maxErrors));
- for (Map.Entry<String, Combo> entry : combos.entrySet())
- {
- int val = getModelPreferences().getInt(entry.getKey());
- entry.getValue().select(ERROR_MAP.get(val));
- }
- }
-
- protected void validateValues()
- {
- String errorMessage = null;
- try
- {
- int maxErrors = Integer.parseInt(maxErrorsText.getText());
- if (maxErrors < 0)
- errorMessage = "Max errors must be a positive integer";
- }
- catch (NumberFormatException e)
- {
- errorMessage = "Max errors must be a positive integer";
- }
- setErrorMessage(errorMessage);
- setValid(errorMessage == null);
- }
-
- protected void enableValues() {
- }
-
- @Override
- protected void performDefaults() {
- resetSeverities();
- super.performDefaults();
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.wst.xsl.ui.internal.preferences.AbstractValidationSettingsPage#performOk()
- */
- @Override
- public boolean performOk() {
- boolean result = super.performOk();
- storeValues();
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/IStyleConstantsXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/IStyleConstantsXSL.java
deleted file mode 100755
index dc222de..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/IStyleConstantsXSL.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Benjamin Muskalla, b.muskalla@gmx.net - [158660] character entities should have their own syntax highlighting preference
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsXSL {
- public static final String BACKGROUND = "xslbackground"; //$NON-NLS-1$
- public static final String DECL_BORDER = "xsldeclBoder";//$NON-NLS-1$
-
- public static final String FOREGROUND = "xslforeground"; //$NON-NLS-1$
-
- public static final String TAG_ATTRIBUTE_EQUALS = "xsltagAttributeEquals"; //$NON-NLS-1$
- public static final String TAG_ATTRIBUTE_NAME = "xsltagAttributeName";//$NON-NLS-1$
- public static final String TAG_ATTRIBUTE_VALUE = "xsltagAttributeValue";//$NON-NLS-1$
- public static final String TAG_BORDER = "xsltagBorder";//$NON-NLS-1$
- public static final String TAG_NAME = "xsltagName";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/LineStyleProviderForXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/LineStyleProviderForXSL.java
deleted file mode 100755
index e29dc4c..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/LineStyleProviderForXSL.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver (STAR) - initial api and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * This implements a Syntax Line Style Provider for XSL. It leverages some
- * information from the XML Syntax Coloring, but adds specific coloring for XSL
- * specific elements and attributes.
- *
- * @author David Carver
- * @since 1.0
- *
- */
-public class LineStyleProviderForXSL extends AbstractLineStyleProvider implements LineStyleProvider {
-
- protected IStructuredDocument structuredDocument;
- protected Highlighter highlighter;
- private boolean initialized;
- protected ReconcilerHighlighter recHighlighter = null;
-
- private IPreferenceStore xmlPreferenceStore = null;
- private IPreferenceStore xslPreferenceStore = null;
- private IPreferenceStore combinedPreferenceStore = null;
- private IPropertyChangeListener preferenceListener = new PropertyChangeListener();
-
- private class PropertyChangeListener implements IPropertyChangeListener {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // have to do it this way so others can override the method
- handlePropertyChange(event);
- }
- }
-
- @Override
- protected void commonInit(IStructuredDocument document,
- Highlighter highlighter) {
-
- structuredDocument = document;
- this.highlighter = highlighter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider#
- * prepareRegions(org.eclipse.jface.text.ITypedRegion, int, int,
- * java.util.Collection)
- */
- @Override
- public boolean prepareRegions(ITypedRegion typedRegion,
- int lineRequestStart, int lineRequestLength, Collection holdResults) {
- final int partitionStartOffset = typedRegion.getOffset();
- final int partitionLength = typedRegion.getLength();
- IStructuredDocumentRegion structuredDocumentRegion = getDocument()
- .getRegionAtCharacterOffset(partitionStartOffset);
- boolean handled = false;
-
- handled = prepareTextRegions(structuredDocumentRegion,
- partitionStartOffset, partitionLength, holdResults);
-
- return handled;
- }
-
- /**
- * @param region
- * @param start
- * @param length
- * @param holdResults
- * @return
- */
- protected boolean prepareTextRegion(ITextRegionCollection blockedRegion,
- int partitionStartOffset, int partitionLength,
- Collection holdResults) {
- boolean handled = false;
- final int partitionEndOffset = partitionStartOffset + partitionLength
- - 1;
- ITextRegion region = null;
- ITextRegionList regions = blockedRegion.getRegions();
- StyleRange styleRange = null;
-
- for (int i = 0; i < regions.size(); i++) {
- region = regions.get(i);
- TextAttribute attr = null;
- TextAttribute previousAttr = null;
- if (blockedRegion.getStartOffset(region) > partitionEndOffset)
- break;
- if (blockedRegion.getEndOffset(region) <= partitionStartOffset)
- continue;
-
- if (region instanceof ITextRegionCollection) {
- handled = prepareTextRegion((ITextRegionCollection) region,
- partitionStartOffset, partitionLength, holdResults);
- } else {
-
- attr = getAttributeFor(blockedRegion, region);
- if (attr != null) {
- handled = true;
- styleRange = applyStyleRange(blockedRegion,
- partitionStartOffset, partitionLength, holdResults,
- region, styleRange, attr, previousAttr);
- } else {
- previousAttr = null;
- }
- }
- }
- return handled;
- }
-
- private StyleRange applyStyleRange(ITextRegionCollection blockedRegion,
- int partitionStartOffset, int partitionLength,
- Collection holdResults, ITextRegion region, StyleRange styleRange,
- TextAttribute attr, TextAttribute previousAttr) {
- if (equalsPreviousAttribute(styleRange, attr, previousAttr)) {
- styleRange.length += region.getLength();
- } else {
- styleRange = createStyleRange(blockedRegion, region, attr,
- partitionStartOffset, partitionLength);
- holdResults.add(styleRange);
- previousAttr = attr;
- }
- return styleRange;
- }
-
- private boolean equalsPreviousAttribute(StyleRange styleRange,
- TextAttribute attr, TextAttribute previousAttr) {
- return (styleRange != null) && (previousAttr != null)
- && (previousAttr.equals(attr));
- }
-
- protected boolean prepareTextRegions(
- IStructuredDocumentRegion structuredDocumentRegion,
- int partitionStartOffset, int partitionLength,
- Collection holdResults) {
- boolean handled = false;
- final int partitionEndOffset = partitionStartOffset + partitionLength
- - 1;
- while (structuredDocumentRegion != null
- && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
- ITextRegion region = null;
- ITextRegionList regions = structuredDocumentRegion.getRegions();
-
- StyleRange styleRange = null;
- for (int i = 0; i < regions.size(); i++) {
- region = regions.get(i);
- TextAttribute attr = null;
- TextAttribute previousAttr = null;
- if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)
- break;
- if (structuredDocumentRegion.getEndOffset(region) <= partitionStartOffset)
- continue;
-
- if (region instanceof ITextRegionCollection) {
- boolean handledCollection = (prepareTextRegion(
- (ITextRegionCollection) region,
- partitionStartOffset, partitionLength, holdResults));
- handled = (!handled) ? handledCollection : handled;
- } else {
- attr = getAttributeFor(structuredDocumentRegion, region);
- if (attr == null) {
- previousAttr = null;
- } else {
- handled = true;
- styleRange = applyStyleRange(structuredDocumentRegion,
- partitionStartOffset, partitionLength,
- holdResults, region, styleRange, attr,
- previousAttr);
- }
- }
- }
- structuredDocumentRegion = structuredDocumentRegion.getNext();
- }
- return handled;
- }
-
- private StyleRange createStyleRange(
- ITextRegionCollection textRegionCollection, ITextRegion textRegion,
- TextAttribute attr, int startOffset, int length) {
- int startingOffset = textRegionCollection.getStartOffset(textRegion);
- if (startingOffset < startOffset)
- startingOffset = startOffset;
-
- int textEnd = startingOffset
- + textRegionCollection.getText(textRegion).length();
- int maxOffset = startOffset + length;
- int endingOffset = textRegionCollection.getEndOffset(textRegion);
-
- if (textEnd < endingOffset)
- endingOffset = textEnd;
- if (endingOffset > maxOffset)
- endingOffset = maxOffset;
- StyleRange result = new StyleRange(startingOffset, endingOffset
- - startingOffset, attr.getForeground(), attr.getBackground(),
- attr.getStyle());
- if ((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
- result.strikeout = true;
- }
- if ((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
- result.underline = true;
- }
- return result;
-
- }
-
- @Override
- protected TextAttribute getAttributeFor(ITextRegionCollection collection,
- ITextRegion textRegion) {
- if (textRegion == null) {
- return XMLTextAttributeMap.getInstance()
- .getTextAttributeMap().get(IStyleConstantsXML.CDATA_TEXT);
- }
-
- String type = textRegion.getType();
- if (collection.getText().contains("xsl:")) {
- return getXSLAttribute(type);
- }
-
- return getXMLAttribute(type);
- }
-
- private TextAttribute getXSLAttribute(String type) {
- Map<String, String> regionMap = XSLRegionMap.getInstance()
- .getRegionMap();
- Map<String, TextAttribute> textAttributes = XSLTextAttributeMap
- .getInstance().getTextAttributeMap();
- return getTextAttribute(type, regionMap, textAttributes);
- }
-
- private TextAttribute getXMLAttribute(String type) {
- Map<String, String> regionMap = XMLRegionMap.getInstance()
- .getRegionMap();
- Map<String, TextAttribute> textAttributes = XMLTextAttributeMap
- .getInstance().getTextAttributeMap();
-
- return getTextAttribute(type, regionMap, textAttributes);
- }
-
- private TextAttribute getTextAttribute(String type,
- Map<String, String> regionMap,
- Map<String, TextAttribute> textAttrMap) {
- return textAttrMap.get(regionMap.get(type));
- }
-
- @Override
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
- if (event == null)
- return;
-
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsXSL.TAG_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXSL.TAG_NAME;
- }
- if (IStyleConstantsXSL.TAG_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXSL.TAG_BORDER;
- }
- if (IStyleConstantsXSL.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXSL.TAG_ATTRIBUTE_NAME;
- }
- if (IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE;
- }
- if (styleKey == null)
- return;
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- }
-
- if(recHighlighter != null)
- recHighlighter.refreshDisplay();
-
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- @Override
- protected void addTextAttribute(String colorKey) {
- if (getColorPreferences() != null) {
- String prefString = getColorPreferences().getString(colorKey);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
- boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italic) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- updateTextAttribute(colorKey, foreground, background, style);
- }
- }
- }
-
- private void updateTextAttribute(String colorKey, RGB foreground,
- RGB background, int style) {
- TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
-
- TextAttribute textAttribute =
- XSLTextAttributeMap.getInstance().getTextAttributeMap().get(colorKey);
- if (textAttribute != null) {
- XSLTextAttributeMap.getInstance().getTextAttributeMap().put(colorKey, createTextAttribute);
- return;
- }
-
- textAttribute =
- XMLTextAttributeMap.getInstance().getTextAttributeMap().get(colorKey);
- if (textAttribute != null) {
- XMLTextAttributeMap.getInstance().getTextAttributeMap().put(colorKey, createTextAttribute);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider#init
- * (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument,
- * org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter)
- */
- @Override
- public void init(IStructuredDocument document, Highlighter highlighter) {
- commonInit(structuredDocument, highlighter);
-
- if (isInitialized())
- return;
-
- registerPreferenceManager();
-
- setInitialized(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider
- * #
- * init(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument
- * , org.eclipse.jface.text.source.ISourceViewer)
- */
- @Override
- public void init(IStructuredDocument structuredDocument,
- ISourceViewer sourceViewer) {
- init(structuredDocument, (Highlighter) null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider
- * #
- * init(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument
- * ,
- * org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter)
- */
- @Override
- public void init(IStructuredDocument structuredDocument,
- ReconcilerHighlighter highlighter) {
- this.structuredDocument = structuredDocument;
- recHighlighter = highlighter;
-
- if (isInitialized())
- return;
-
- registerPreferenceManager();
-
- setInitialized(true);
- }
-
- @Override
- public void release() {
- unRegisterPreferenceManager();
- setInitialized(false);
- }
-
- @Override
- protected void unRegisterPreferenceManager() {
- IPreferenceStore pref = getColorPreferences();
- if (pref != null) {
- pref.removePropertyChangeListener(preferenceListener);
- }
- }
-
- @Override
- protected void registerPreferenceManager() {
- IPreferenceStore pref = getColorPreferences();
- if (pref != null) {
- pref.addPropertyChangeListener(preferenceListener );
- }
- }
-
- /**
- * Returns the initialized.
- *
- * @return boolean
- */
- @Override
- public boolean isInitialized() {
- return initialized;
- }
-
- /**
- * Sets the initialized.
- *
- * @param initialized
- * The initialized to set
- */
- private void setInitialized(boolean initialized) {
- this.initialized = initialized;
- }
-
- @Override
- protected IStructuredDocument getDocument() {
- return structuredDocument;
- }
-
- /**
- */
- @Override
- protected Highlighter getHighlighter() {
- return highlighter;
- }
-
- @Override
- protected IPreferenceStore getColorPreferences() {
- if (xmlPreferenceStore == null) {
- xmlPreferenceStore = XMLUIPlugin.getDefault().getPreferenceStore();
- }
- if (xslPreferenceStore == null) {
- xslPreferenceStore = XSLUIPlugin.getDefault().getPreferenceStore();
- }
- combinedPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[] { xmlPreferenceStore, xslPreferenceStore });
- return combinedPreferenceStore;
- }
-
- @Override
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
- }
-
- @Override
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
- @Override
- protected TextAttribute getAttributeFor(ITextRegion region) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- protected void loadColors() {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLRegionMap.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLRegionMap.java
deleted file mode 100644
index 13b494e..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLRegionMap.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * The XMLRegionMap class handles mapping duties from an XML Region to
- * a Line Style Constant.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XMLRegionMap {
-
- private static HashMap<String,String> regionMap = new HashMap<String,String>();
- private static XMLRegionMap xmlRegionMap = new XMLRegionMap();
-
- private XMLRegionMap() {
-
- regionMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET, IStyleConstantsXML.XML_CONTENT);
- regionMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
- regionMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
- regionMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
- regionMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
- regionMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
- regionMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- regionMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- regionMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- regionMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
- regionMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
- regionMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- regionMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- regionMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
- regionMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
- regionMap.put(DOMRegionContext.XML_PI_CLOSE, IStyleConstantsXML.PI_BORDER);
- regionMap.put(DOMRegionContext.XML_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
- regionMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- regionMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- regionMap.put(DOMRegionContext.UNDEFINED, IStyleConstantsXML.CDATA_TEXT);
- regionMap.put(DOMRegionContext.WHITE_SPACE, IStyleConstantsXML.XML_CONTENT);
- }
-
- /**
- * Returns an instance of the XMLRegionMap Class
- * @return
- */
- public static XMLRegionMap getInstance() {
- return xmlRegionMap;
- }
-
- /**
- * Returns a mapping of XML Regions to Style Constants
- * @return
- */
- public Map<String,String> getRegionMap() {
- return regionMap;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLTextAttributeMap.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLTextAttributeMap.java
deleted file mode 100644
index c1179f2..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XMLTextAttributeMap.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 213775 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * XMlTextAttributeMap handles the mapping of XML Style Constants to TextAttributes.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XMLTextAttributeMap {
-
- private static HashMap<String,TextAttribute> textAttributeMap = new HashMap<String,TextAttribute>();
- private static XMLTextAttributeMap xmlTextAttributeMap = new XMLTextAttributeMap();
- private static IPreferenceStore xmlPreferenceStore;
-
- private static IPreferenceStore getXMLPreferenceStore() {
- return xmlPreferenceStore;
- }
- private XMLTextAttributeMap() {
- xmlPreferenceStore = XMLUIPlugin.getDefault().getPreferenceStore();
- addXMLTextAttribute(IStyleConstantsXML.TAG_NAME);
- addXMLTextAttribute(IStyleConstantsXML.TAG_BORDER);
- addXMLTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- addXMLTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- addXMLTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- addXMLTextAttribute(IStyleConstantsXML.COMMENT_BORDER);
- addXMLTextAttribute(IStyleConstantsXML.COMMENT_TEXT);
- addXMLTextAttribute(IStyleConstantsXML.CDATA_BORDER);
- addXMLTextAttribute(IStyleConstantsXML.CDATA_TEXT);
- addXMLTextAttribute(IStyleConstantsXML.DECL_BORDER);
- addXMLTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- addXMLTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- addXMLTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- addXMLTextAttribute(IStyleConstantsXML.DOCTYPE_NAME);
- addXMLTextAttribute(IStyleConstantsXML.PI_CONTENT);
- addXMLTextAttribute(IStyleConstantsXML.PI_BORDER);
- addXMLTextAttribute(IStyleConstantsXML.XML_CONTENT);
- addXMLTextAttribute(IStyleConstantsXML.ENTITY_REFERENCE);
- }
-
- /**
- * An instance of XMLTextAttributeMap.
- * @return
- */
- public static XMLTextAttributeMap getInstance() {
- return xmlTextAttributeMap;
- }
-
- /**
- * Returns a Map of Style Constants and the corresponding Text Attribute
- * @return
- */
- public Map<String,TextAttribute> getTextAttributeMap() {
- return textAttributeMap;
- }
-
- private void addXMLTextAttribute(String colorKey) {
- if (getXMLPreferenceStore() != null) {
- String prefString = getXMLPreferenceStore().getString(colorKey);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
- boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italic) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
- textAttributeMap.put(colorKey, createTextAttribute);
- }
- }
- }
-
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLRegionMap.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLRegionMap.java
deleted file mode 100644
index abc26a3..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLRegionMap.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 213775 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * XSLRegionMap handles the mapping of XML Regions to XSL Style Constants.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XSLRegionMap {
-
- private static HashMap<String,String> regionMap = new HashMap<String,String>();
- private static XSLRegionMap xslRegionMap = new XSLRegionMap();
-
- private XSLRegionMap() {
- regionMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXSL.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXSL.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXSL.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXSL.TAG_BORDER);
- regionMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXSL.TAG_ATTRIBUTE_NAME);
- regionMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXSL.TAG_NAME);
- regionMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE);
-
- }
-
- /**
- * Returns an instance of XSLRegionMap.
- * @return
- */
- public static XSLRegionMap getInstance() {
- return xslRegionMap;
- }
-
- /**
- * Returns a MAP of XSL Regions and Style Constants.
- * @return
- */
- public Map<String,String> getRegionMap() {
- return regionMap;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLTextAttributeMap.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLTextAttributeMap.java
deleted file mode 100644
index e827407..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/style/XSLTextAttributeMap.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- *Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- *All rights reserved. This program and the accompanying materials
- *are made available under the terms of the Eclipse Public License v1.0
- *which accompanies this distribution, and is available at
- *http://www.eclipse.org/legal/epl-v10.html
- *
- *Contributors:
- * David Carver (STAR) - bug 213775 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-/**
- * Handles the mapping of the Style Constants to Text Attributes for XSL.
- *
- * @author David Carver
- * @since 1.0
- */
-public class XSLTextAttributeMap {
-
- private static HashMap<String,TextAttribute> textAttributeMap = new HashMap<String,TextAttribute>();
- private static XSLTextAttributeMap xslTextAttributeMap = new XSLTextAttributeMap();
- private static IPreferenceStore xslPreferenceStore;
-
- private static IPreferenceStore getXslPreferenceStore() {
- return xslPreferenceStore;
- }
- private XSLTextAttributeMap() {
- xslPreferenceStore = XSLUIPlugin.getDefault().getPreferenceStore();
- addXSLTextAttribute(IStyleConstantsXSL.TAG_NAME);
- addXSLTextAttribute(IStyleConstantsXSL.TAG_BORDER);
- addXSLTextAttribute(IStyleConstantsXSL.TAG_ATTRIBUTE_NAME);
- addXSLTextAttribute(IStyleConstantsXSL.TAG_ATTRIBUTE_VALUE);
- }
-
- /**
- * Returns an instance of XSLTextAttributeMap
- * @return
- */
- public static XSLTextAttributeMap getInstance() {
- return xslTextAttributeMap;
- }
-
- /**
- * Get's a Map of XSL Style Constants to Text Attributes.
- * @return
- */
- public Map<String,TextAttribute> getTextAttributeMap() {
- return textAttributeMap;
- }
-
- protected void addXSLTextAttribute(String colorKey) {
- if (getXslPreferenceStore() != null) {
- String prefString = getXslPreferenceStore().getString(colorKey);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
- boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
- boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italic) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
- textAttributeMap.put(colorKey, createTextAttribute);
- }
- }
- }
-
- protected TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/TemplateContextTypeXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/TemplateContextTypeXSL.java
deleted file mode 100644
index 0b1d83f..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/TemplateContextTypeXSL.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.wst.xml.ui.internal.templates.EncodingTemplateVariableResolverXML;
-
-public class TemplateContextTypeXSL extends TemplateContextType
-{
- public TemplateContextTypeXSL()
- {
- super();
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new EncodingTemplateVariableResolverXML());
- addResolver(new VersionTemplateVariableResolverXSL());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/VersionTemplateVariableResolverXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/VersionTemplateVariableResolverXSL.java
deleted file mode 100644
index 1d58b2b..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/VersionTemplateVariableResolverXSL.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-
-public class VersionTemplateVariableResolverXSL extends SimpleTemplateVariableResolver
-{
- private static final String VERSION_TYPE = getVersionType();
-
- private static String getVersionType()
- {
- return "xsl_version"; //$NON-NLS-1$
- }
-
- public VersionTemplateVariableResolverXSL()
- {
- super(VERSION_TYPE, "XSLT Version preference");
- }
-
- @Override
- protected String resolve(TemplateContext context)
- {
- // TODO
- return "1.0";
- // return
- // XMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/XSLTemplatesPage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/XSLTemplatesPage.java
deleted file mode 100644
index 6d938b1..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/templates/XSLTemplatesPage.java
+++ /dev/null
@@ -1,249 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.templates;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.texteditor.templates.AbstractTemplatesPage;
-import org.eclipse.wst.xml.xpath.ui.internal.XPathUIPlugin;
-import org.eclipse.wst.xml.xpath.ui.internal.templates.TemplateContextTypeIdsXPath;
-import org.eclipse.wst.xsl.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xsl.ui.internal.editor.XSLEditor;
-
-/**
- * The XSL Templates Page is used by the TemplatesViewer to display available
- * XSL Templates for use within a XSL Structured Text Editor. It is provided as
- * an example on how other SSE editors can contribute their templates to the
- * page.
- *
- * @author dcarver
- *
- */
-
-public class XSLTemplatesPage extends AbstractTemplatesPage {
-
- private static final String PREFERENCE_PAGE_ID = "org.eclipse.wst.xsl.ui.XPath"; //$NON-NLS-1$
-
- private static final TemplateStore TEMPLATE_STORE = XPathUIPlugin
- .getDefault().getXPathTemplateStore();
-
- private static final IPreferenceStore PREFERENCE_STORE = XPathUIPlugin
- .getDefault().getPreferenceStore();
-
- private static final ContextTypeRegistry TEMPLATE_CONTEXT_REGISTRY = XPathUIPlugin
- .getDefault().getXPathTemplateContextRegistry();
-
- private XSLEditor fTextEditor;
-
- public XSLTemplatesPage(XSLEditor xslTextEditor) {
- super(xslTextEditor, xslTextEditor.getTextViewer());
- fTextEditor = xslTextEditor;
- }
-
- @Override
- protected String[] getContextTypeIds(IDocument document, int offset) {
- return new String[] { TemplateContextTypeIdsXPath.XPATH,
- TemplateContextTypeIdsXPath.AXIS,
- TemplateContextTypeIdsXPath.OPERATOR };
- }
-
- @Override
- protected ContextTypeRegistry getContextTypeRegistry() {
- return TEMPLATE_CONTEXT_REGISTRY;
- }
-
- @Override
- protected String getPreferencePageId() {
- return PREFERENCE_PAGE_ID;
- }
-
- @Override
- protected IPreferenceStore getTemplatePreferenceStore() {
- return PREFERENCE_STORE;
- }
-
- @Override
- protected TemplateStore getTemplateStore() {
- return TEMPLATE_STORE;
- }
-
- // This code based on the JavaTemplatesPage code. Modified to work with
- // SSE
-
- @Override
- protected void insertTemplate(Template template, IDocument document) {
- ISourceViewer contextViewer = fTextEditor.getTextViewer();
- ITextSelection textSelection = (ITextSelection) contextViewer
- .getSelectionProvider().getSelection();
-
- if (!isValidTemplate(document, template, textSelection.getOffset(),
- textSelection.getLength()))
- return;
-
- beginCompoundChange(contextViewer);
-
- /*
- * The Editor checks whether a completion for a word exists before it
- * allows for the template to be applied. We pickup the current text at
- * the selection position and replace it with the first char of the
- * template name for this to succeed. Another advantage by this method
- * is that the template replaces the selected text provided the
- * selection by itself is not used in the template pattern.
- */
-
- String savedText;
-
- try {
- savedText = document.get(textSelection.getOffset(), textSelection
- .getLength());
-
- if (savedText.length() == 0) {
- String prefix = getIdentifierPart(document, template,
- textSelection.getOffset(), textSelection.getLength());
-
- if (prefix.length() > 0
- && !template.getName().startsWith(prefix)) {
- return;
- }
-
- if (prefix.length() > 0) {
- contextViewer.setSelectedRange(textSelection.getOffset()
- - prefix.length(), prefix.length());
-
- textSelection = (ITextSelection) contextViewer
- .getSelectionProvider().getSelection();
- }
- }
-
- document.replace(textSelection.getOffset(), textSelection
- .getLength(), template.getName().substring(0, 1));
-
- } catch (BadLocationException e) {
- endCompoundChange(contextViewer);
- return;
- }
-
- Region region = new Region(textSelection.getOffset() + 1, 0);
-
- contextViewer.getSelectionProvider().setSelection(
- new TextSelection(textSelection.getOffset(), 1));
-
- DocumentTemplateContext context = getContext(document, template,
- textSelection.getOffset(), textSelection.getLength());
-
- context.setVariable("selection", savedText); //$NON-NLS-1$
-
- if (context.getKey().length() == 0) {
- try {
- document.replace(textSelection.getOffset(), 1, savedText);
- } catch (BadLocationException e) {
- endCompoundChange(contextViewer);
- return;
- }
- }
-
- ITextViewer viewer = fTextEditor.getTextViewer();
- int offset = viewer.getTextWidget().getCaretOffset();
- int startLength = offset - region.getOffset();
- String pattern = template.getPattern().replace("${cursor}", "");
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- pattern, offset, 0, startLength + pattern.length(),
- getImage(template), template.getName(), null, null, 0);
-
- fTextEditor.getSite().getPage().activate(fTextEditor);
- proposal.apply(fTextEditor.getTextViewer(), ' ', 0, offset);
- viewer.getTextWidget().setCaretOffset(offset + pattern.length() - 1);
- endCompoundChange(contextViewer);
- }
-
- @Override
- protected boolean isValidTemplate(IDocument document, Template template,
- int offset, int length) {
-
- String[] contextIds = getContextTypeIds(document, offset);
-
- for (int i = 0; i < contextIds.length; i++) {
- if (contextIds[i].equals(template.getContextTypeId())) {
- DocumentTemplateContext context = getContext(document,
- template, offset, length);
- return context.canEvaluate(template);
- }
- }
-
- return false;
- }
-
- /**
- * Undomanager - end compound change
- *
- * @param viewer
- */
-
- private void endCompoundChange(ISourceViewer viewer) {
-
- if (viewer instanceof ITextViewerExtension)
- ((ITextViewerExtension) viewer).getRewriteTarget()
- .endCompoundChange();
- }
-
- /**
- * Undomanager - begin a compound change
- *
- * @param viewer
- */
-
- private void beginCompoundChange(ISourceViewer viewer) {
-
- if (viewer instanceof ITextViewerExtension)
- ((ITextViewerExtension) viewer).getRewriteTarget()
- .beginCompoundChange();
- }
-
- /**
- * Get context
- *
- * @param document
- * @param template
- * @param offset
- * @param length
- * @return the context
- */
-
- private DocumentTemplateContext getContext(IDocument document,
- Template template, final int offset, int length) {
-
- TemplateContextType contextType = XPathUIPlugin.getDefault()
- .getXPathTemplateContextRegistry().getContextType(
- template.getContextTypeId());
-
- return new DocumentTemplateContext(contextType, document, offset,
- length);
- }
-
- /**
- * Get the xml identifier terminated at the given offset
- *
- * @param document
- * @param template
- * @param offset
- * @param length
- * @return the identifier part
- * @throws BadLocationException
- */
-
- private String getIdentifierPart(IDocument document, Template template,
- int offset, int length) throws BadLocationException {
- return getContext(document, template, offset, length).getKey();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImageHelper.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImageHelper.java
deleted file mode 100755
index a2fe67a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImageHelper.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.util;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author david carver based on work by amywu
- */
-public class XSLPluginImageHelper {
- private static XSLPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a XMLEditorPluginImageHelper
- */
- public synchronized static XSLPluginImageHelper getInstance() {
- if (instance == null) {
- instance = new XSLPluginImageHelper();
- }
- return instance;
- }
-
- // save a descriptor for each image
- @SuppressWarnings("unchecked")
- private HashMap fImageDescRegistry = null;
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
- getImageRegistry().put(resource, image);
- }
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- @SuppressWarnings("unchecked")
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(XSLUIPlugin.PLUGIN_ID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- @SuppressWarnings("unchecked")
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null) {
- fImageDescRegistry = new HashMap();
- }
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImages.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImages.java
deleted file mode 100755
index c0d068a..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/util/XSLPluginImages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - bug 213849 - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.util;
-
-/**
- * Bundle of most images used by the XSL Plugins
- */
-public class XSLPluginImages {
-
- /**
- * Path to the XPATH Images used for Content Assist
- */
- public static final String IMG_XPATH_FUNCTION = "icons/full/function.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XPATH Images used for Content Assist
- */
- public static final String IMG_XPATH_AXIS = "icons/full/directional.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XPATH Images used for Content Assist
- */
- public static final String IMG_VARIABLES = "icons/full/variable.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XPATH Images used for Content Assist
- */
- public static final String IMG_OPERATOR = "icons/full/operation.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XML Prefix Image used for Content Assist
- */
- public static final String IMG_PREFIX = "icons/full/package_obj.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XSL mode Image used for Content Assist
- */
- public static final String IMG_MODE = "icons/full/mode.gif"; //$NON-NLS-1$
-
- /**
- * Path to the XSL File image use for Content Assistance.
- */
- public static final String IMG_XSL_FILE = "icons/full/xslt_file.gif"; //$NON-NLS-1$
-
- /**
- * Path to the xsl template image use for Content Assistance.
- */
- public static final String IMG_TEMPLATE = "icons/full/template.gif"; //$NON-NLS-1$
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/DelegatingSourceValidatorForXSL.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/DelegatingSourceValidatorForXSL.java
deleted file mode 100644
index a192f01..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/DelegatingSourceValidatorForXSL.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-import org.eclipse.wst.xsl.ui.internal.editor.XSLEditor;
-
-/**
- * This performs the as-you-type validation for xsl files
- *
- */
-public class DelegatingSourceValidatorForXSL extends DelegatingSourceValidator
-{
- private final static String Id = "org.eclipse.wst.xsl.core.xsl"; //$NON-NLS-1$
-
- private Validator _validator;
-
- /**
- * Constructor
- */
- public DelegatingSourceValidatorForXSL()
- {
- }
-
- @Override
- public void validate(IValidationContext helper, IReporter reporter) throws ValidationException
- {
- super.validate(helper, reporter);
- // validating will refresh the model, so now calculate the overrides.
- // (we only calculate overrides for source validation as we only want to do it for files open in an editor)
- // There follows a very complicated way of creating the required annotations in an editor...
- String[] delta = helper.getURIs();
- if (delta.length > 0)
- {
- IFile file = getFile(delta[0]);
- // find any files with open editors...
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for (IWorkbenchWindow workbenchWindow : windows)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- if (page != null)
- {
- IEditorReference[] refs = page.findEditors(new FileEditorInput(file), "org.eclipse.wst.xsl.ui.XSLEditor", IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);
- // lets hope we only have one XSL editor open on the file, or else we don't know which one started this validation...
- if (refs.length == 1)
- {
- XSLEditor editor = (XSLEditor) refs[0].getEditor(false);
- if (editor != null)
- {// all this work just to get here...
- editor.getOverrideIndicatorManager().updateAnnotations();
- }
- }
- }
- }
- }
- }
-
- private Validator getValidator()
- {
- if (_validator == null)
- _validator = ValidationFramework.getDefault().getValidator(Id, null);
- return _validator;
- }
-
- @Override
- protected IValidator getDelegateValidator()
- {
- Validator v = getValidator();
- if (v == null)
- return null;
- return v.asIValidator();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLErrorListener.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLErrorListener.java
deleted file mode 100644
index 7a1456b..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLErrorListener.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsl.ui.internal.validation;
-
-import javax.xml.transform.*;
-import java.util.logging.*;
-
-/**
- * This class listens for Errors tossed by a XSL Processor.
- *
- * @author dcarver
- *
- */
-public class XSLErrorListener implements ErrorListener {
-
- private Logger logger;
-
- /**
- * TODO: Add Javadoc
- * @param logger
- */
- public XSLErrorListener(Logger logger) {
- this.logger = logger;
- }
-
- /**
- * (non-Javadoc)
- * @see javax.xml.transform.ErrorListener#warning(javax.xml.transform.TransformerException)
- */
- public void warning(TransformerException exception) {
-
- logger.log(Level.WARNING, exception.getMessage(), exception);
-
- // Don't throw an exception and stop the processor
- // just for a warning; but do log the problem
- }
-
- /**
- * (non-Javadoc)
- * @see javax.xml.transform.ErrorListener#error(javax.xml.transform.TransformerException)
- */
- public void error(TransformerException exception)
- throws TransformerException {
-
- logger.log(Level.SEVERE, exception.getMessage(), exception);
- // XSLT is not as draconian as XML. There are numerous errors
- // which the processor may but does not have to recover from;
- // e.g. multiple templates that match a node with the same
- // priority. I do not want to allow that so I throw this
- // exception here.
- throw exception;
-
- }
-
- /**
- * (non-Javadoc)
- * @see javax.xml.transform.ErrorListener#fatalError(javax.xml.transform.TransformerException)
- */
- public void fatalError(TransformerException exception)
- throws TransformerException {
-
- logger.log(Level.SEVERE, exception.getMessage(), exception);
-
- // This is an error which the processor cannot recover from;
- // e.g. a malformed stylesheet or input document
- // so I must throw this exception here.
- throw exception;
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLMarkupValidator.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLMarkupValidator.java
deleted file mode 100644
index b185b8e..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/validation/XSLMarkupValidator.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Carver - STAR - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsl.ui.internal.validation;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.MarkupValidator;
-
-/**
- * @author dcarver
- *
- */
-public class XSLMarkupValidator extends MarkupValidator implements IValidator, ISourceValidator {
-
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- @Override
- public void cleanup(IReporter reporter) {
- // TODO Auto-generated method stub
- super.cleanup(reporter);
-
- }
-
- /**
- *
- * @param helper
- * @param reporter
- * @throws ValidationException
- *
- */
- @Override
- public void validate(IValidationContext helper, IReporter reporter)
- throws ValidationException {
- // TODO Auto-generated method stub
- super.validate(helper, reporter);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.validation.MarkupValidator#connect(org.eclipse.jface.text.IDocument)
- */
- @Override
- public void connect(IDocument document) {
- super.connect(document);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.validation.MarkupValidator#disconnect(org.eclipse.jface.text.IDocument)
- */
- @Override
- public void disconnect(IDocument document) {
- super.disconnect(document);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.validation.MarkupValidator#validate(org.eclipse.jface.text.IRegion, org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- @Override
- public void validate(IRegion dirtyRegion, IValidationContext helper,
- IReporter reporter) {
- super.validate(dirtyRegion, helper, reporter);
- }
-
- /**
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.ui.internal.validation.MarkupValidator#validate(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion, org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- @Override
- public void validate(IStructuredDocumentRegion structuredDocumentRegion,
- IReporter reporter) {
- // TODO Auto-generated method stub
- super.validate(structuredDocumentRegion, reporter);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileTemplatesWizardPage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileTemplatesWizardPage.java
deleted file mode 100644
index c31ba66..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileTemplatesWizardPage.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.wizards;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-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.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Link;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL;
-import org.eclipse.wst.xsl.ui.internal.XSLUIConstants;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-public class NewXSLFileTemplatesWizardPage extends WizardPage
-{
- private String fLastSelectedTemplateName;
- private SourceViewer fPatternViewer;
- private TableViewer fTableViewer;
- private TemplateStore fTemplateStore;
- private Button fUseTemplateButton;
-
- public NewXSLFileTemplatesWizardPage()
- {
- super("NewStylesheetTemplatesWizardPage", "Select XSL Template", null); //$NON-NLS-1$
- setDescription("Select a template as initial content for the stylesheet");
- }
-
- private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2)
- {
- parent.addControlListener(new ControlAdapter()
- {
- @Override
- public void controlResized(ControlEvent e)
- {
- Rectangle area = parent.getClientArea();
- Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height)
- {
- // Subtract the scrollbar width from the total column
- // width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
-
- Point oldSize = table.getSize();
- if (oldSize.x > width)
- {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- table.setSize(width, area.height);
- }
- else
- {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(width, area.height);
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- }
- }
- });
- }
-
- public void createControl(Composite ancestor)
- {
- Composite parent = new Composite(ancestor, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout(layout);
-
- // create checkbox for user to use JSP Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText("Use template");
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- fUseTemplateButton.setLayoutData(data);
- fUseTemplateButton.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- enableTemplates();
- }
- });
-
- // create composite for Templates table
- Composite innerParent = new Composite(parent, SWT.NONE);
- GridLayout innerLayout = new GridLayout();
- innerLayout.numColumns = 2;
- innerLayout.marginHeight = 0;
- innerLayout.marginWidth = 0;
- innerParent.setLayout(innerLayout);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
- innerParent.setLayoutData(gd);
-
- // Create linked text to just to templates preference page
- Link link = new Link(innerParent, SWT.NONE);
- link.setText("Templates are 'New Stylesheet' templates found in the <a>XSL</a> preference page");
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- linkClicked();
- }
- });
-
- // create table that displays templates
- Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
-
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertWidthInCharsToPixels(2);
- data.heightHint = convertHeightInCharsToPixels(10);
- data.horizontalSpan = 2;
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText("Name");
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText("Description");
-
- fTableViewer = new TableViewer(table);
- fTableViewer.setLabelProvider(new TemplateLabelProvider());
- fTableViewer.setContentProvider(new TemplateContentProvider());
-
- fTableViewer.setSorter(new ViewerSorter()
- {
- @Override
- public int compare(Viewer viewer, Object object1, Object object2)
- {
- if ((object1 instanceof Template) && (object2 instanceof Template))
- {
- Template left = (Template) object1;
- Template right = (Template) object2;
- int result = left.getName().compareToIgnoreCase(right.getName());
- if (result != 0)
- return result;
- return left.getDescription().compareToIgnoreCase(right.getDescription());
- }
- return super.compare(viewer, object1, object2);
- }
-
- @Override
- public boolean isSorterProperty(Object element, String property)
- {
- return true;
- }
- });
-
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent e)
- {
- updateViewerInput();
- }
- });
-
- // create viewer that displays currently selected template's contents
- fPatternViewer = doCreateViewer(parent);
-
- fTemplateStore = XSLUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.JSP_NEWWIZARD_TEMPLATE_HELPID);
- Dialog.applyDialogFont(parent);
- setControl(parent);
- }
-
- private SourceViewer createViewer(Composite parent)
- {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationXSL();
-
- @Override
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- @Override
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
- };
- SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForXML.ContentTypeID_XML);
- IDocument document = scratchModel.getStructuredDocument();
- viewer.configure(sourceViewerConfiguration);
- viewer.setDocument(document);
- return viewer;
- }
-
- private SourceViewer doCreateViewer(Composite parent)
- {
- Label label = new Label(parent, SWT.NONE);
- label.setText("Preview");
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- SourceViewer viewer = createViewer(parent);
- viewer.setEditable(false);
-
- Control control = viewer.getControl();
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- data.heightHint = convertHeightInCharsToPixels(5);
- control.setLayoutData(data);
-
- return viewer;
- }
-
- void enableTemplates()
- {
- boolean enabled = fUseTemplateButton.getSelection();
-
- if (enabled)
- {
- setSelectedTemplate(fLastSelectedTemplateName);
- }
- else
- {
- // save last selected template
- Template template = getSelectedTemplate();
- if (template != null)
- fLastSelectedTemplateName = template.getName();
- else
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
-
- fTableViewer.setSelection(null);
- }
-
- fTableViewer.getControl().setEnabled(enabled);
- fPatternViewer.getControl().setEnabled(enabled);
- }
-
- private Template getSelectedTemplate()
- {
- Template template = null;
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
-
- if (selection.size() == 1)
- {
- template = (Template) selection.getFirstElement();
- }
- return template;
- }
-
- String getTemplateString()
- {
- String templateString = null;
-
- Template template = getSelectedTemplate();
- if (template != null)
- {
- TemplateContextType contextType = XSLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(XSLUIConstants.TEMPLATE_CONTEXT_XSL_NEW);
- IDocument document = new Document();
- TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
- try
- {
- TemplateBuffer buffer = context.evaluate(template);
- templateString = buffer.getString();
- }
- catch (Exception e)
- {
- XSLUIPlugin.log(e);
- }
- }
-
- return templateString;
- }
-
- void linkClicked()
- {
- String pageId = "org.eclipse.wst.xsl.ui.template.preferencePage";
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[] { pageId }, null);
- dialog.open();
- fTableViewer.refresh();
- }
-
- private void loadLastSavedPreferences()
- {
- String templateName = XSLUIPlugin.getDefault().getPreferenceStore().getString(XSLUIConstants.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0)
- {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- fUseTemplateButton.setSelection(false);
- }
- else
- {
- fLastSelectedTemplateName = templateName;
- fUseTemplateButton.setSelection(true);
- }
- enableTemplates();
- }
-
- void saveLastSavedPreferences()
- {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null)
- {
- templateName = template.getName();
- }
-
- XSLUIPlugin.getDefault().getPreferenceStore().setValue(XSLUIConstants.NEW_FILE_TEMPLATE_NAME, templateName);
- XSLUIPlugin.getDefault().savePluginPreferences();
- }
-
- private void setSelectedTemplate(String templateName)
- {
- Object template = null;
-
- if (templateName != null && templateName.length() > 0)
- {
- // pick the last used template
- template = fTemplateStore.findTemplate(templateName, XSLUIConstants.TEMPLATE_CONTEXT_XSL_NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null)
- {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null)
- {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- void updateViewerInput()
- {
- Template template = getSelectedTemplate();
- if (template != null)
- {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else
- {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizard.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizard.java
deleted file mode 100644
index 2261b88..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizard.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xsl.ui.internal.XSLUIPlugin;
-
-public class NewXSLFileWizard extends Wizard implements INewWizard
-{
- private NewXSLFileWizardPage fNewFilePage;
- private NewXSLFileTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- @Override
- public void addPages()
- {
- fNewFilePage = new NewXSLFileWizardPage("NewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle("XSL Stylesheet");
- fNewFilePage.setDescription("Create a new XSL Stylesheet.");
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewXSLFileTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
- {
- fSelection = aSelection;
- setWindowTitle("New XSL Stylesheet");
-
- // TODO image for wizard
- // ImageDescriptor descriptor =
- // JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWJSPFILE);
- // setDefaultPageImageDescriptor(descriptor);
- }
-
- @Override
- public boolean performFinish()
- {
- boolean performedOK = false;
-
- // save user options for next use
- fNewFileTemplatesPage.saveLastSavedPreferences();
-
- // no file extension specified so add default extension
- String fileName = fNewFilePage.getFileName();
- if (fileName.lastIndexOf('.') == -1)
- {
- String newFileName = fNewFilePage.addDefaultExtension(fileName);
- fNewFilePage.setFileName(newFileName);
- }
-
- // create a new empty file
- IFile file = fNewFilePage.createNewFile();
-
- // if there was problem with creating file, it will be null, so make
- // sure to check
- if (file != null)
- {
- // put template contents into file
- String templateString = fNewFileTemplatesPage.getTemplateString();
- if (templateString != null)
- {
- // determine the encoding for the new file
- Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- try
- {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- OutputStreamWriter outputStreamWriter = null;
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- // just use default encoding
- outputStreamWriter = new OutputStreamWriter(outputStream);
- }
- else
- {
- outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
- }
- outputStreamWriter.write(templateString);
- outputStreamWriter.flush();
- outputStreamWriter.close();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- file.setContents(inputStream, true, false, null);
- inputStream.close();
- }
- catch (Exception e)
- {
- XSLUIPlugin.log(e);
- }
- }
-
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-
- private void openEditor(final IFile file)
- {
- if (file != null)
- {
- getShell().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e)
- {
- XSLUIPlugin.log(e);
- }
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizardPage.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizardPage.java
deleted file mode 100644
index 9024ddf..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/NewXSLFileWizardPage.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xsl.core.XSLCore;
-
-class NewXSLFileWizardPage extends WizardNewFileCreationPage
-{
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewXSLFileWizardPage(String pageName, IStructuredSelection selection)
- {
- super(pageName, selection);
- setFileName("NewFile.xsl");
- }
-
- @Override
- protected boolean validatePage()
- {
- setMessage(null);
- setErrorMessage(null);
-
- if (!super.validatePage())
- {
- return false;
- }
-
- String fileName = getFileName();
- IPath fullPath = getContainerFullPath();
- if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null))
- {
- // check that filename does not contain invalid extension
- if (!extensionValidForContentType(fileName))
- {
- setErrorMessage(NLS.bind("The file name must end in one of the following extensions {0}.", getValidExtensions().toString()));
- return false;
- }
- // no file extension specified so check adding default
- // extension doesn't equal a file that already exists
- if (fileName.lastIndexOf('.') == -1)
- {
- String newFileName = addDefaultExtension(fileName);
- IPath resourcePath = fullPath.append(newFileName);
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
- if (!result.isOK())
- {
- // path invalid
- setErrorMessage(result.getMessage());
- return false;
- }
-
- if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists()))
- {
- setErrorMessage("The same name already exists.");
- return false;
- }
- }
- }
- return true;
- }
-
- String addDefaultExtension(String filename)
- {
- StringBuffer newFileName = new StringBuffer(filename);
-
- // Preferences preference =
- // XSLUIPlugin.getDefault().getPluginPreferences();
- // String ext =
- // preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);
-
- String ext = "xsl";
- newFileName.append(".");
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType()
- {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(XSLCore.XSL_CONTENT_TYPE);
- return fContentType;
- }
-
- private List getValidExtensions()
- {
- if (fValidExtensions == null)
- {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- private boolean extensionValidForContentType(String fileName)
- {
- boolean valid = false;
-
- IContentType type = getContentType();
- // there is currently an extension
- if (fileName.lastIndexOf('.') != -1)
- {
- // check what content types are associated with current extension
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
- int i = 0;
- while (i < types.length && !valid)
- {
- valid = types[i].isKindOf(type);
- ++i;
- }
- }
- else
- valid = true; // no extension so valid
- return valid;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateContentProvider.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateContentProvider.java
deleted file mode 100644
index 2fc45cb..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateContentProvider.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.wizards;
-
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsl.ui.internal.XSLUIConstants;
-
-class TemplateContentProvider implements IStructuredContentProvider
-{
- private TemplateStore fStore;
-
- public void dispose()
- {
- fStore = null;
- }
-
- public Object[] getElements(Object input)
- {
- return fStore.getTemplates(XSLUIConstants.TEMPLATE_CONTEXT_XSL_NEW);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- fStore = (TemplateStore) newInput;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateLabelProvider.java b/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateLabelProvider.java
deleted file mode 100644
index 4f3bf3f..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/src/org/eclipse/wst/xsl/ui/internal/wizards/TemplateLabelProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.wst.xsl.ui.internal.wizards;
-
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider
-{
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- Template template = (Template) element;
-
- switch (columnIndex)
- {
- case 0:
- return template.getName();
- case 1:
- return template.getDescription();
- default:
- return "";
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.ui/templates/file_templates.xml b/bundles/org.eclipse.wst.xsl.ui/templates/file_templates.xml
deleted file mode 100644
index b956560..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/templates/file_templates.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-<template id="org.eclipse.wst.xslt.templates.xsl_basic"
- name="Basic stylesheet"
- context="xsl_new"
- autoinsert="true"
- deleted="false"
- enabled="true"
- description="Matches the root of the input"><![CDATA[<?xml version="1.0" encoding="${encoding}"?>
-<xsl:stylesheet version="${xsl_version}" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <!-- TODO: Auto-generated template -->${cursor}
- </xsl:template>
-</xsl:stylesheet>]]></template>
-<template id="org.eclipse.wst.xslt.templates.xsl_copy"
- name="Copy stylesheet"
- context="xsl_new"
- autoinsert="true"
- deleted="false"
- enabled="true"
- description="Makes a copy of the input"><![CDATA[<?xml version="1.0" encoding="${encoding}"?>
-<xsl:stylesheet version="${xsl_version}" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="${cursor}">
- <!-- TODO: Auto-generated template -->
- </xsl:template>
- <!-- standard copy template -->
- <xsl:template match="@*|node()">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-</xsl:stylesheet>]]></template>
-</templates> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.ui/xslfiles/syntaxcoloring.xsl b/bundles/org.eclipse.wst.xsl.ui/xslfiles/syntaxcoloring.xsl
deleted file mode 100644
index 85c8b58..0000000
--- a/bundles/org.eclipse.wst.xsl.ui/xslfiles/syntaxcoloring.xsl
+++ /dev/null
@@ -1,8 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:variable name="somveValue">1234</xsl:variable>
- <xsl:template match="/">
- <xsl:if test="$someValue">
- <xsl:apply-templates />
- </xsl:if>
- </xsl:template>
-</xsl:stylesheet> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.classpath b/bundles/org.eclipse.wst.xsl.xalan/.classpath
deleted file mode 100644
index 8fdf8e9..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="src" path="src-debugger"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.cvsignore b/bundles/org.eclipse.wst.xsl.xalan/.cvsignore
deleted file mode 100644
index 50b76ba..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-javaCompiler.xalan-debugger.jar.args
-build.xml
-xalan-debugger.jar
-temp.folder
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.project b/bundles/org.eclipse.wst.xsl.xalan/.project
deleted file mode 100644
index 3c56bc2..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.xalan</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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8ba1309..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu Jan 03 22:24:50 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 50bc347..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Dec 16 08:48:52 GMT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index e1e68b9..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,24 +0,0 @@
-#Wed Jul 30 20:57:15 BST 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-bundle-classpath-entries=0
-compilers.p.missing-packages=2
-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-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xsl.xalan/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl.xalan/META-INF/MANIFEST.MF
deleted file mode 100644
index e7bf3ef..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl.xalan;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.eclipse.wst.xsl.xalan.debugger;
- uses:="org.eclipse.wst.xsl.debugger,
- org.apache.xpath,
- org.apache.xalan.trace,
- javax.xml.transform,
- org.apache.xalan.templates"
-Require-Bundle: org.apache.xalan;bundle-version="[2.7.0,2.8.0)",
- org.apache.xml.serializer;bundle-version="[2.7.0,2.8.0)",
- org.eclipse.wst.xsl.jaxp.debug;bundle-version="[1.0.0,2.0.0)";resolution:=optional
diff --git a/bundles/org.eclipse.wst.xsl.xalan/XalanAttributes.properties b/bundles/org.eclipse.wst.xsl.xalan/XalanAttributes.properties
deleted file mode 100644
index 151b5c7..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/XalanAttributes.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-###############################################################################
-OPTIMIZE=http://xml.apache.org/xalan/features/optimize
-OPTIMIZE.TYPE=boolean
-OPTIMIZE.DESC=Optimize stylesheet processing. By default, this attribute is set to true. You may need to set it to false for tooling applications.
-
-INCREMENTAL=http://xml.apache.org/xalan/features/incremental
-INCREMENTAL.TYPE=boolean
-INCREMENTAL.DESC=Produce output incrementally, rather than waiting to finish parsing the input before generating any output. By default this attribute is set to false. You can turn this attribute on to transform large documents where the stylesheet structure is optimized to execute individual templates without having to parse the entire document.
-
-SOURCE_LOCATION=http://xml.apache.org/xalan/features/source_location
-SOURCE_LOCATION.TYPE=boolean
-SOURCE_LOCATION.DESC=By default, this attribute is set to false. Setting this attribute to true involves a substantial increase in storage cost per source document node. If you want to use the NodeInfo extension functions (or some other mechanism) to provide this information during a transform, you must set the attribute to true before generating the Transformer and processing the stylesheet. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.xalan/XalanOutputProperties.properties b/bundles/org.eclipse.wst.xsl.xalan/XalanOutputProperties.properties
deleted file mode 100644
index ceeb071..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/XalanOutputProperties.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Doug Satchwell (Chase Technology Ltd) - initial API and implementation
-###############################################################################
-S_KEY_INDENT_AMOUNT={http://xml.apache.org/xalan}indent-amount
-S_KEY_INDENT_AMOUNT.DESC=The non-standard property key to use to set the\n\
- number of whitepaces to indent by, per indentation level,\n\
- if indent="yes"
-
-S_KEY_LINE_SEPARATOR={http://xml.apache.org/xalan}line-separator
-S_KEY_LINE_SEPARATOR.DESC=The non-standard property key to use to set the characters to write out as at the end of a line,\n\
- rather than the default ones from the runtime.
-
-S_KEY_CONTENT_HANDLER={http://xml.apache.org/xalan}content-handler
-S_KEY_CONTENT_HANDLER.DESC=This non-standard property key is used to set the name of the fully qualified\n\
- Java class that implements the ContentHandler interface.\n\
- Fully qualified name of class with a default constructor that\n\
- implements the ContentHandler interface, where the result tree events\n\
- will be sent to.
-
-S_KEY_ENTITIES={http://xml.apache.org/xalan}entities
-S_KEY_ENTITIES.DESC=This non-standard property key is used to specify the name of the property file\n\
- that specifies character to entity reference mappings.
-
-S_USE_URL_ESCAPING={http://xml.apache.org/xalan}use-url-escaping
-S_USE_URL_ESCAPING.DESC=This non-standard property key is used to set a value of "yes" if the href values for HTML serialization should\n\
- use %xx escaping.
-
-S_OMIT_META_TAG={http://xml.apache.org/xalan}omit-meta-tag
-S_OMIT_META_TAG.DESC=This non-standard property key is used to set a value of "yes" if the META tag should be omitted where it would\n\
- otherwise be supplied. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.xalan/about.html b/bundles/org.eclipse.wst.xsl.xalan/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl.xalan/build.properties b/bundles/org.eclipse.wst.xsl.xalan/build.properties
deleted file mode 100644
index db56c82..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.. = src-debugger/
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- .,\
- XalanOutputProperties.properties,\
- XalanAttributes.properties,\
- about.html,\
- plugin.properties
-
diff --git a/bundles/org.eclipse.wst.xsl.xalan/plugin.properties b/bundles/org.eclipse.wst.xsl.xalan/plugin.properties
deleted file mode 100644
index ab4cbe4..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/plugin.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-#Properties file for org.eclipse.wst.xsl.xalan
-Bundle-Name.0 = XSL Xalan Support (Incubating)
-processorType.label.0 = Xalan
-processor.label.0 = Xalan 2.5.1
-processor.label.1 = Xalan 2.7.1
-Bundle-Vendor.0 = Eclipse.org
-transformerFactoryNameXalan = Interpretive
-transformerFactoryNameXalanXSLTC = Compiling \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl.xalan/plugin.xml b/bundles/org.eclipse.wst.xsl.xalan/plugin.xml
deleted file mode 100644
index 6a60297..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/plugin.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.processorType">
- <processorType
- attributeProperties="XalanAttributes.properties"
- id="org.eclipse.wst.xsl.xalan.processorType"
- label="%processorType.label.0"
- outputProperties="XalanOutputProperties.properties">
- <transformerFactory
- factoryClass="org.apache.xalan.processor.TransformerFactoryImpl"
- name="%transformerFactoryNameXalan">
- </transformerFactory>
- <transformerFactory
- factoryClass="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"
- name="%transformerFactoryNameXalanXSLTC">
- </transformerFactory>
- </processorType>
- </extension>
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.debugger">
- <debugger
- className="org.eclipse.wst.xsl.xalan.debugger.XalanDebugger"
- classpath="${eclipse_orbit:org.eclipse.wst.xsl.xalan}"
- id="org.eclipse.wst.xsl.xalan.debugger"
- name="Xalan 2.5.1 or greater"
- processorTypeId="org.eclipse.wst.xsl.xalan.processorType"
- transformerFactoryClass="org.apache.xalan.processor.TransformerFactoryImpl">
- </debugger>
- </extension>
- <extension
- point="org.eclipse.wst.xsl.jaxp.launching.processor">
- <!-- An adopter can specify the ${eclipse_orbit: } variable to indicate which eclipse
- bundle should be added to the class path. -->
- <processor
- classpath="${eclipse_orbit:org.apache.xalan};${eclipse_orbit:org.apache.xml.serializer};${eclipse_orbit:org.apache.bcel};${eclipse_orbit:java_cup.runtime}"
- id="org.eclipse.wst.xsl.launching.xalan.processor"
- label="%processor.label.1"
- processorTypeId="org.eclipse.wst.xsl.xalan.processorType"
- debuggerId="org.eclipse.wst.xsl.xalan.debugger"
- supports="1.0">
- </processor>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanDebugger.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanDebugger.java
deleted file mode 100644
index ef2eab3..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanDebugger.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import java.util.TooManyListenersException;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xalan.processor.TransformerFactoryImpl;
-import org.apache.xalan.trace.TraceManager;
-import org.apache.xalan.transformer.TransformerImpl;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.AbstractDebugger;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.BreakPoint;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.Variable;
-import org.xml.sax.SAXException;
-
-public class XalanDebugger extends AbstractDebugger
-{
- private static final Log log = LogFactory.getLog(XalanDebugger.class);
- private XalanTraceListener currentTraceListener;
- private TransformerImpl lastTransformerInChain;
-
- public void setTransformerFactory(TransformerFactory factory)
- {
- TransformerFactoryImpl tfi = (TransformerFactoryImpl) factory;
- tfi.setAttribute(TransformerFactoryImpl.FEATURE_SOURCE_LOCATION, Boolean.TRUE);
- tfi.setAttribute(TransformerFactoryImpl.FEATURE_OPTIMIZE, Boolean.FALSE);
- }
-
- public synchronized void debuggerSuspended(BreakPoint breakpoint)
- {
- // flush the serializer (which is buffered by Xalan itself)
- try
- {
- lastTransformerInChain.getSerializationHandler().flushPending();
- }
- catch (SAXException e)
- {
- log.error("Error flushing serializer", e);
- }
- super.debuggerSuspended(breakpoint);
- }
-
- public void addTransformer(Transformer transformer)
- {
- TransformerImpl transformerImpl = (TransformerImpl) transformer;
-
- lastTransformerInChain = transformerImpl;
-
- TraceManager trMgr = transformerImpl.getTraceManager();
- try
- {
-// XalanPrintTraceListener printer = new XalanPrintTraceListener(new PrintWriter(System.err));
-// printer.m_traceElements = true;
-// printer.m_traceSelection = true;
-// printer.m_traceTemplates = true;
-// trMgr.addTraceListener(printer);
-
- XalanTraceListener traceListener = new XalanTraceListener(this);
- trMgr.addTraceListener(traceListener);
- }
- catch (TooManyListenersException e)
- {
- // ignore
- }
- }
-
- /**
- * Gets a variable by ID
- * @since 1.0
- */
- public Variable getVariable(int id)
- {
- return currentTraceListener.getVariable(id);
- }
-
- void setCurrentTraceListener(XalanTraceListener currentTraceListener)
- {
- log.debug("Setting new XalanTraceListener");
- this.currentTraceListener = currentTraceListener;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanPrintTraceListener.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanPrintTraceListener.java
deleted file mode 100644
index 3d6c07d..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanPrintTraceListener.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import java.io.PrintWriter;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTextLiteral;
-import org.apache.xalan.trace.EndSelectionEvent;
-import org.apache.xalan.trace.PrintTraceListener;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.trace.TracerEvent;
-
-public class XalanPrintTraceListener extends PrintTraceListener
-{
- private final PrintWriter writer;
-
- public XalanPrintTraceListener(PrintWriter pw)
- {
- super(pw);
- this.writer = pw;
- }
-
- public void _trace(TracerEvent ev)
- {
- switch (ev.m_styleNode.getXSLToken())
- {
- case Constants.ELEMNAME_TEXTLITERALRESULT:
- if (m_traceElements)
- {
- writer.print(ev.m_styleNode.getSystemId() + " Line #" + ev.m_styleNode.getLineNumber() + ", " + "Column #" + ev.m_styleNode.getColumnNumber() + " -- " + ev.m_styleNode.getNodeName()
- + ": ");
-
- ElemTextLiteral etl = (ElemTextLiteral) ev.m_styleNode;
- String chars = new String(etl.getChars(), 0, etl.getChars().length);
-
- writer.println(" " + chars.trim());
- }
- break;
- case Constants.ELEMNAME_TEMPLATE:
- if (m_traceTemplates || m_traceElements)
- {
- ElemTemplate et = (ElemTemplate) ev.m_styleNode;
-
- writer.print(et.getSystemId() + " Line #" + et.getLineNumber() + ", " + "Column #" + et.getColumnNumber() + ": " + et.getNodeName() + " ");
-
- if (null != et.getMatch())
- {
- writer.print("match='" + et.getMatch().getPatternString() + "' ");
- }
-
- if (null != et.getName())
- {
- writer.print("name='" + et.getName() + "' ");
- }
-
- writer.println();
- }
- break;
- default:
- if (m_traceElements)
- {
- writer
- .println(ev.m_styleNode.getSystemId() + " Line #" + ev.m_styleNode.getLineNumber() + ", " + "Column #" + ev.m_styleNode.getColumnNumber() + ": "
- + ev.m_styleNode.getNodeName());
- }
- }
- }
-
- public void selected(SelectionEvent ev) throws TransformerException
- {
- writer.print("selected: ");
- super.selected(ev);
- }
-
- public void selectEnd(EndSelectionEvent ev) throws TransformerException
- {
- writer.print("selectEnd: ");
- super.selectEnd(ev);
- }
-
- public void trace(TracerEvent ev)
- {
- writer.print("trace: ");
- super.trace(ev);
- }
-
- public void traceEnd(TracerEvent ev)
- {
- writer.print("traceEnd: ");
- _trace(ev);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanRootStyleFrame.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanRootStyleFrame.java
deleted file mode 100644
index c65b71a..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanRootStyleFrame.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xalan.templates.ElemVariable;
-import org.apache.xalan.templates.StylesheetRoot;
-import org.apache.xalan.trace.TracerEvent;
-import org.apache.xpath.VariableStack;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.Variable;
-
-public class XalanRootStyleFrame extends XalanStyleFrame
-{
- private static final Log log = LogFactory.getLog(XalanRootStyleFrame.class);
- private Map variables;
- private ArrayList globals;
-
- public XalanRootStyleFrame(TracerEvent event)
- {
- super(null, event);
- fillGlobals(event);
- }
-
- protected List getGlobals()
- {
- return globals;
- }
-
- private void fillGlobals(TracerEvent event)
- {
- VariableStack vs = event.m_processor.getXPathContext().getVarStack();
- StylesheetRoot sr = event.m_styleNode.getStylesheetRoot();
- Vector vars = sr.getVariablesAndParamsComposed();
- variables = new HashMap(vars.size());
- globals = new ArrayList(vars.size());
- int i = vars.size();
- while (--i >= 0)
- {
- ElemVariable variable = (ElemVariable) vars.elementAt(i);
- XalanVariable xvar = new XalanVariable(this,vs,Variable.GLOBAL_SCOPE,i,variable);
- addVariable(xvar);
- globals.add(xvar);
- }
- }
-
- /**
- * Gets a Variable by ID
- * @since 1.0
- */
- public Variable getVariable(int id)
- {
-// log.debug("Getting variable with id "+id+" from variables "+variables.size());
- return (Variable)variables.get(new Integer(id));
- }
-
- public void addVariable(XalanVariable xvar)
- {
-// log.debug("Adding variable index="+xvar.getSlotNumber()+" val="+xvar);
-// variables.add(xvar.getSlotNumber(),xvar);
- log.debug("Adding variable id="+xvar.getId());
- variables.put(new Integer(xvar.getId()),xvar);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanStyleFrame.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanStyleFrame.java
deleted file mode 100644
index f725de2..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanStyleFrame.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-import javax.xml.transform.SourceLocator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xalan.templates.ElemCallTemplate;
-import org.apache.xalan.templates.ElemTemplate;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemVariable;
-import org.apache.xalan.trace.TracerEvent;
-import org.apache.xml.dtm.ref.DTMNodeProxy;
-import org.apache.xml.utils.QName;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.XPath;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.StyleFrame;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.Variable;
-import org.w3c.dom.Node;
-
-public class XalanStyleFrame extends StyleFrame
-{
- private static final Log log = LogFactory.getLog(XalanStyleFrame.class);
-
- private final Map varNames;
- private final Stack eventStack = new Stack();
- final TracerEvent event;
- private int currentLine;
- private XalanRootStyleFrame rootStyleFrame;
-
- /**
- * @since 1.0
- */
- public XalanStyleFrame(StyleFrame parent, TracerEvent event)
- {
- super(parent);
- this.event = event;
- if (parent != null)
- this.varNames = new HashMap(((XalanStyleFrame) parent).varNames);
- else
- this.varNames = new HashMap();
- pushElement(event);
- findRootStyleFrame();
- }
-
- private void findRootStyleFrame()
- {
- XalanStyleFrame frame = this;
- do
- {
- if (frame instanceof XalanRootStyleFrame)
- rootStyleFrame = (XalanRootStyleFrame) frame;
- }
- while ((frame = (XalanStyleFrame) frame.getParent()) != null);
- }
-
- public String getFilename()
- {
- return event.m_styleNode.getStylesheet().getSystemId();
- }
-
- public String getName()
- {
- String name = event.m_styleNode.getNodeName();
- if (event.m_styleNode instanceof ElemTemplate)
- {
- ElemTemplate et = (ElemTemplate) event.m_styleNode;
- QName q = et.getName();
- if (q != null)
- {
- name += " name=\"" + q.getLocalName() + "\"";
- }
- XPath xp = et.getMatch();
- if (xp != null)
- {
- name += " match=\"" + xp.getPatternString() + "\"";
- }
- }
- else if (event.m_styleNode instanceof ElemCallTemplate)
- {
- ElemCallTemplate et = (ElemCallTemplate) event.m_styleNode;
- QName q = et.getName();
- if (q != null)
- {
- name += " name=\"" + q.getLocalName() + "\"";
- }
- }
- return name;
- }
-
- public List getVariableStack()
- {
- List vars = new ArrayList();
- vars.addAll(getLocals());
- vars.addAll(getGlobals());
- return vars;
- }
-
- public int getCurrentLine()
- {
- return currentLine;
- }
-
- public void pushElement(TracerEvent e)
- {
- currentLine = e.m_styleNode.getLineNumber();
- eventStack.push(e);
- if (log.isDebugEnabled())
- log.debug("Pushed element " + TracerEvent.printNode(e.m_styleNode) + " at line " + currentLine);
- }
-
- public TracerEvent popElement()
- {
- TracerEvent e = (TracerEvent) eventStack.pop();
- currentLine = e.m_styleNode.getEndLineNumber();
- if (log.isDebugEnabled())
- log.debug("Popped element " + TracerEvent.printNode(e.m_styleNode) + " at line " + currentLine);
-
- ElemTemplateElement element = e.m_styleNode;
- String name = element.getNodeName();
- log.debug(" name " + name);
- if (name.equals("param") || name.equals("variable"))
- addVariable((ElemVariable) e.m_styleNode);
-
- return e;
- }
-
- public TracerEvent peekElement()
- {
- if (eventStack.isEmpty())
- return null;
- return (TracerEvent) eventStack.peek();
- }
-
- private void addVariable(ElemVariable variable)
- {
- String scope = variable.getIsTopLevel() ? Variable.GLOBAL_SCOPE : Variable.LOCAL_SCOPE;
- VariableStack vs = event.m_processor.getXPathContext().getVarStack();
- XalanVariable xvar = new XalanVariable(this, vs, scope, variable.getIndex(), variable);
- rootStyleFrame.addVariable(xvar);
- varNames.put(variable.getName(), xvar);
- }
-
- private List getLocals()
- {
- List locals = new ArrayList(varNames.values());
- // sort by slotNumber
- Collections.sort(locals);
- return new ArrayList(varNames.values());
- }
-
- protected List getGlobals()
- {
- return rootStyleFrame.getGlobals();
- }
-
- public String getSourceFilename()
- {
- SourceLocator locator = getSourceLocator();
- if (locator != null)
- return locator.getSystemId();
- return "";
- }
-
- public int getSourceCurrentLine()
- {
- SourceLocator locator = getSourceLocator();
- if (locator != null)
- return locator.getLineNumber();
- return 0;
- }
-
- private SourceLocator getSourceLocator()
- {
- Node sourceNode = event.m_sourceNode;
- SourceLocator locator = null;
- if (sourceNode instanceof DTMNodeProxy)
- {
- int nodeHandler = ((DTMNodeProxy) sourceNode).getDTMNodeNumber();
- return ((DTMNodeProxy) sourceNode).getDTM().getSourceLocatorFor(nodeHandler);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java
deleted file mode 100644
index a89b321..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xalan.templates.Constants;
-import org.apache.xalan.trace.EndSelectionEvent;
-import org.apache.xalan.trace.ExtensionEvent;
-import org.apache.xalan.trace.GenerateEvent;
-import org.apache.xalan.trace.SelectionEvent;
-import org.apache.xalan.trace.TraceListenerEx2;
-import org.apache.xalan.trace.TracerEvent;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.BreakPoint;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.Variable;
-
-public class XalanTraceListener implements TraceListenerEx2 // TraceListenerEx3
-{
- private static final Log log = LogFactory.getLog(XalanTraceListener.class);
-
- private final XalanDebugger debugger;
- private XalanRootStyleFrame rootStyleFrame;
-
- public XalanTraceListener(XalanDebugger debugger)
- {
- this.debugger = debugger;
- }
-
- public void trace(TracerEvent ev)
- {
- XalanStyleFrame styleFrame = null;
- if (rootStyleFrame == null)
- {// this is the root of the stack
- debugger.debuggerTransformStarted();
- debugger.setCurrentTraceListener(this);
- rootStyleFrame = new XalanRootStyleFrame(ev);
- styleFrame = rootStyleFrame;
- debugger.pushStyleFrame(styleFrame);
- }
- else if (ev.m_styleNode.getOwnerXSLTemplate() == ev.m_styleNode)
- {// this is an xsl:template, so add to template stack
- styleFrame = new XalanStyleFrame(debugger.peekStyleFrame(), ev);
- debugger.pushStyleFrame(styleFrame);
- }
- else if (ev.m_styleNode.getXSLToken() != Constants.ELEMNAME_TEXTLITERALRESULT)
- {// add to current template element stack
- styleFrame = (XalanStyleFrame) debugger.peekStyleFrame();
- styleFrame.pushElement(ev);
- }
- else
- {
- log.debug("Skipped push for element " + ev.m_styleNode.getLocalName());
- }
- check(styleFrame);
- }
-
- public void traceEnd(TracerEvent ev)
- {
- XalanStyleFrame styleFrame = (XalanStyleFrame) debugger.peekStyleFrame();
- if (styleFrame != null)
- {
- if (ev.m_styleNode.getOwnerXSLTemplate() == ev.m_styleNode)
- {// remove from current template element stack
- styleFrame.popElement();
- }
- else if (ev.m_styleNode.getXSLToken() != Constants.ELEMNAME_TEXTLITERALRESULT)
- {// remove from current template element stack
- styleFrame.popElement();
- }
- else
- {
- log.debug("Skipped pop for element " + ev.m_styleNode.getLocalName());
- }
- check(styleFrame);
- if (ev.m_styleNode.getOwnerXSLTemplate() == ev.m_styleNode)
- {// end of template, so remove from stack
- debugger.popStyleFrame();
- }
- else
- {// because we don't get selectEnd events, we need to do this check
- TracerEvent tel = styleFrame.peekElement();
- // if the parent is a choose, move on to it
- switch (tel.m_styleNode.getXSLToken())
- {
- case Constants.ELEMNAME_CHOOSE:
- styleFrame.popElement();
- check(styleFrame);
- }
- }
- }
- }
-
- private void check(XalanStyleFrame styleFrame)
- {
- debugger.checkStopped();
- if (styleFrame != null)
- {
- // check breakpoint in stylesheet
- BreakPoint breakpoint = new BreakPoint(styleFrame.getFilename(), styleFrame.getCurrentLine());
- debugger.checkSuspended(styleFrame, breakpoint);
- // TODO check breakpoint in source
- /*
- * breakpoint = new BreakPoint(styleFrame.getSourceFilename(), styleFrame.getSourceCurrentLine()); System.out.println("---------------"+breakpoint); if (breakpoint.getFile() != null)
- * debugger.checkSuspended(styleFrame, breakpoint);
- */}
- }
-
- public void selected(SelectionEvent ev) throws TransformerException
- {
- }
-
- public void selectEnd(EndSelectionEvent ev) throws TransformerException
- {
- }
-
- public void generated(GenerateEvent ev)
- {
-// XSLGenerateEvent event = new XSLGenerateEvent();
-// event.m_characters = ev.m_characters;
-// event.m_data = ev.m_data;
-// event.m_eventtype = ev.m_eventtype;
-// event.m_length = ev.m_length;
-// event.m_name = ev.m_name;
-// event.m_start = ev.m_start;
-//
-// if (ev.m_atts != null)
-// {
-// event.m_atts = new ArrayList();
-// for (int i = 0; i < ev.m_atts.getLength(); i++)
-// {
-// String attName = ev.m_atts.getQName(i);
-// String attValue = ev.m_atts.getValue(i);
-// XSLElementAttribute xatt = new XSLElementAttribute(attName,attValue);
-// event.m_atts.add(xatt);
-// }
-// }
-//
-// debugger.generated(event);
- }
-
- public void extension(ExtensionEvent ee)
- {
- }
-
- public void extensionEnd(ExtensionEvent ee)
- {
- }
-
- /**
- * @since 1.0
- */
- public Variable getVariable(int id)
- {
- return rootStyleFrame.getVariable(id);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java
deleted file mode 100644
index 640a74c..0000000
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
- * David Carver (STAR) - bug 214235 - Allows nodes to be expanded.
- *******************************************************************************/
-package org.eclipse.wst.xsl.xalan.debugger;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xalan.templates.ElemVariable;
-import org.apache.xpath.VariableStack;
-import org.apache.xpath.objects.XNodeSet;
-import org.apache.xpath.objects.XObject;
-import org.eclipse.wst.xsl.jaxp.debug.debugger.Variable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-
-public class XalanVariable extends Variable implements Comparable {
- private final Log log = LogFactory.getLog(XalanVariable.class);
- private final ElemVariable elemVariable;
- private final VariableStack varStack;
- private int stackFrame;
- private XObject xobject;
-
- public XalanVariable(XalanStyleFrame xalanStyleFrame,
- VariableStack varStack, String scope, int slotNumber,
- ElemVariable elemVariable) {
- super(getName(elemVariable, scope, xalanStyleFrame), scope, slotNumber
- + varStack.getStackFrame());
- this.elemVariable = elemVariable;
- this.varStack = varStack;
- // get the stack frame at this current point in time
- this.stackFrame = varStack.getStackFrame();
- try {
- xobject = getXObject();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- private static String getName(ElemVariable elemVariable, String scope,
- XalanStyleFrame xalanStyleFrame) {
- String name = elemVariable.getName().getLocalName();
- String systemId = elemVariable.getStylesheet().getSystemId();
- if (GLOBAL_SCOPE.equals(scope) && systemId != null) {
- int index;
- if ((index = systemId.lastIndexOf('/')) > 0)
- name += " (" + systemId.substring(index + 1) + ")";
- else
- name += " (" + systemId + ")";
- }
- // else if (LOCAL_SCOPE.equals(scope))
- // {
- // name += " (" + xalanStyleFrame.getName() + ")";
- // }
- return name;
- }
-
- public String getType() {
- String value = UNKNOWN;
- // XObject xobject = getXObject();
- if (xobject != null) {
- int xalanType = xobject.getType();
- switch (xalanType) {
- case XObject.CLASS_UNRESOLVEDVARIABLE:
- value = UNRESOLVED;
- break;
- case XObject.CLASS_NODESET:
- value = NODESET;
- break;
- case XObject.CLASS_BOOLEAN:
- value = BOOLEAN;
- break;
- case XObject.CLASS_NUMBER:
- value = NUMBER;
- break;
- case XObject.CLASS_UNKNOWN:
- value = UNKNOWN;
- break;
- case XObject.CLASS_STRING:
- default:
- value = STRING;
- break;
- }
- }
- // catch (TransformerException e)
- // {
- // e.printStackTrace();
- // }
- return value;
- }
-
- public String getValue() {
- String value = "???";
- try {
- xobject = getXObject();
- if (xobject != null) {
- int xalanType = xobject.getType();
- switch (xalanType) {
- case XObject.CLASS_UNRESOLVEDVARIABLE:
- value = "";
- break;
- case XObject.CLASS_NODESET:
- XNodeSet xns = (XNodeSet) xobject;
- if (xns.nodelist().getLength() > 0) {
- value = convertNode(xns);
- }
- else
- value = "<EMPTY NODESET>";
- break;
- case XObject.CLASS_BOOLEAN:
- case XObject.CLASS_NUMBER:
- case XObject.CLASS_STRING:
- case XObject.CLASS_UNKNOWN:
- default:
- value = xobject.toString();
- break;
- }
- }
- } catch (TransformerException e) {
- e.printStackTrace();
- }
- // value = getScope()+"."+getSlotNumber()+")"+getName();
- // log.debug(getScope()+"."+getSlotNumber()+")"+getName() + "=" +
- // value);
- return value;
- }
-
- private String convertNode(XNodeSet xns) throws TransformerException {
- NodeList nodeList = xns.nodelist();
- String value = processNodeList(nodeList);
- return value;
- }
-
- private String processNodeList(NodeList nodeList) {
- String value = "";
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node node = nodeList.item(i);
- int nodeType = node.getNodeType();
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- value = createElement(value, node);
- }
- if (nodeType == Node.COMMENT_NODE ) {
- value = value + "<!-- " + node.getNodeValue() + " -->";
- }
- if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
- ProcessingInstruction pi = (ProcessingInstruction) node;
- value = value + "<?" + pi.getData() + " ?>";
- }
- }
- return value;
- }
-
- private String createElement(String value, Node node) {
- value = value + "<";
-// if (node.getPrefix() != null && node.getPrefix().length() > 0) {
-// value = value + node.getPrefix() + ":";
-// }
- if (node.getNodeName() != null) {
- value = value + node.getNodeName();
- if (node.hasAttributes()) {
- NamedNodeMap attr = node.getAttributes();
- value = value + buildAttributes(attr);
- }
- value = value + ">";
- if (node.getNodeValue() != null) {
- value = value + node.getNodeValue();
- }
- }
- if (node.hasChildNodes()) {
- value = value + processNodeList(node.getChildNodes());
- }
- value = value + "</" + node.getNodeName() + ">";
- return value;
- }
-
- private String buildAttributes(NamedNodeMap attributes) {
- String value = " ";
- for (int a = 0; a < attributes.getLength(); a++) {
- Attr attribute = (Attr)attributes.item(a);
-// if (attribute.getPrefix() != null) {
-// value = value + attribute.getPrefix() + ":";
-// }
- value = value + attribute.getName() + "=\"" + attribute.getValue() + "\" ";
- }
- value = value + " ";
- return value;
- }
-
- private XObject getXObject() throws TransformerException {
- XObject xvalue;
- if (elemVariable.getIsTopLevel())
- xvalue = varStack.elementAt(slotNumber);
- else
- xvalue = varStack.getLocalVariable(elemVariable.getIndex(),
- stackFrame);
- return xvalue;
- }
-
- public int compareTo(Object arg0) {
- XalanVariable xvar = (XalanVariable) arg0;
- int comp = xvar.stackFrame - stackFrame;
- if (comp == 0)
- comp = slotNumber - xvar.slotNumber;
- return comp;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsl/.project b/bundles/org.eclipse.wst.xsl/.project
deleted file mode 100644
index 525a3cd..0000000
--- a/bundles/org.eclipse.wst.xsl/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsl/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsl/META-INF/MANIFEST.MF
deleted file mode 100644
index 5ab4ae4..0000000
--- a/bundles/org.eclipse.wst.xsl/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.xsl
-Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsl/about.html b/bundles/org.eclipse.wst.xsl/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/bundles/org.eclipse.wst.xsl/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsl/about.ini b/bundles/org.eclipse.wst.xsl/about.ini
deleted file mode 100644
index fda5a40..0000000
--- a/bundles/org.eclipse.wst.xsl/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/bundles/org.eclipse.wst.xsl/about.mappings b/bundles/org.eclipse.wst.xsl/about.mappings
deleted file mode 100644
index a28390a..0000000
--- a/bundles/org.eclipse.wst.xsl/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/bundles/org.eclipse.wst.xsl/about.properties b/bundles/org.eclipse.wst.xsl/about.properties
deleted file mode 100644
index e460f94..0000000
--- a/bundles/org.eclipse.wst.xsl/about.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=WTP XSL Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright\n\
- Doug Satchwell (Chase Technology Ltd),\n\
- David Carver (Standards for Technology in Automotive Retail)\n\
- and others 2008. All rights reserved.\n\
-\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/bundles/org.eclipse.wst.xsl/build.properties b/bundles/org.eclipse.wst.xsl/build.properties
deleted file mode 100644
index e4aae79..0000000
--- a/bundles/org.eclipse.wst.xsl/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-bin.includes = META-INF/,\
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- plugin.properties,\
- wtp_prod32.gif,\
- wtp_prod32.png
diff --git a/bundles/org.eclipse.wst.xsl/plugin.properties b/bundles/org.eclipse.wst.xsl/plugin.properties
deleted file mode 100644
index 4ea43ba..0000000
--- a/bundles/org.eclipse.wst.xsl/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.wst.xsl
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = WTP XSL Tools (Incubating) \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsl/wtp_prod32.gif b/bundles/org.eclipse.wst.xsl/wtp_prod32.gif
deleted file mode 100644
index eefb44a..0000000
--- a/bundles/org.eclipse.wst.xsl/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsl/wtp_prod32.png b/bundles/org.eclipse.wst.xsl/wtp_prod32.png
deleted file mode 100644
index bfceab3..0000000
--- a/bundles/org.eclipse.wst.xsl/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/.cvsignore b/docs/org.eclipse.wst.xsl.doc/.cvsignore
deleted file mode 100644
index ae93dfd..0000000
--- a/docs/org.eclipse.wst.xsl.doc/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-xinclude
-test.xml
diff --git a/docs/org.eclipse.wst.xsl.doc/.project b/docs/org.eclipse.wst.xsl.doc/.project
deleted file mode 100644
index f266912..0000000
--- a/docs/org.eclipse.wst.xsl.doc/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsl.doc</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.jdt.core.prefs b/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f843f0f..0000000
--- a/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Mon Mar 10 19:41:50 GMT-05:00 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.wst.validation.prefs b/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.wst.validation.prefs
deleted file mode 100644
index a9a9a29..0000000
--- a/docs/org.eclipse.wst.xsl.doc/.settings/org.eclipse.wst.validation.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sat Sep 20 17:03:09 GMT 2008
-DELEGATES_PREFERENCE=delegateValidatorList
-USER_BUILD_PREFERENCE=enabledBuildValidatorList
-USER_MANUAL_PREFERENCE=enabledManualValidatorList
-USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.0.v200807211450
-eclipse.preferences.version=1
-override=true
-suspend=false
-vals/org.eclipse.jst.jsp.core.JSPBatchValidator/global=FF01
-vals/org.eclipse.jst.jsp.core.JSPContentValidator/global=FF01
-vals/org.eclipse.wst.html.ui.HTMLValidator/global=FF01
-vals/org.eclipse.wst.wsdl.validation.wsdl/global=FF02158org.eclipse.wst.wsdl.validation.internal.eclipse.Validator
-vals/org.eclipse.wst.xml.core.xml/groups=0107include07111contentType128org.eclipse.core.runtime.xmlT111contentType134org.eclipse.wst.xml.core.xmlsourceT111contentType134org.eclipse.wst.xml.core.xslsourceT111contentType134org.eclipse.jst.jsp.core.tldsourceT07fileext03xmlF07fileext03gphF07fileext115wdo-connectionsF0107exclude06113projectNature134org.eclipse.jst.j2ee.ejb.EJBNature113projectNature130org.eclipse.jst.j2ee.EARNature04file08.projectT0104file110.classpathT0104file110.settings/T0204file112concepts.xmlF01
-vals/org.eclipse.wst.xsd.core.xsd/global=FF02162org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator
-vf.version=3
diff --git a/docs/org.eclipse.wst.xsl.doc/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xsl.doc/META-INF/MANIFEST.MF
deleted file mode 100644
index 863cea2..0000000
--- a/docs/org.eclipse.wst.xsl.doc/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xsl.doc;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-Vendor: %vendorName
-Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.xsl.doc/about.html b/docs/org.eclipse.wst.xsl.doc/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/docs/org.eclipse.wst.xsl.doc/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/docs/org.eclipse.wst.xsl.doc/build.properties b/docs/org.eclipse.wst.xsl.doc/build.properties
deleted file mode 100644
index 6cd5053..0000000
--- a/docs/org.eclipse.wst.xsl.doc/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- html/,\
- *.xml,\
- about.html,\
- plugin.properties
-generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.xsl.doc/build.xml b/docs/org.eclipse.wst.xsl.doc/build.xml
deleted file mode 100644
index 3282fda..0000000
--- a/docs/org.eclipse.wst.xsl.doc/build.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<project default="create-doc" basedir=".">
-
- <property name="current-loc" location="." />
- <property name="workspace" location=".." />
- <property name="htmldir" value="${current-loc}/html" />
- <property name="docbookdir" value="${workspace}/CommonUtilities/docbook-xsl/eclipse" />
- <property name="docbooksource" value="${current-loc}/docbook"/>
- <property name="xalan" value="org.apache.xalan.processor.TransformerFactoryImpl" />
-
-
- <!-- XSLT Chunking Properties -->
- <property name="base.dir" value="${htmldir}"/>
-
- <target name="merge">
- <xsl.xinclude in="${docbooksource}/xslhelp.dbk"
- out="${docbooksource}/xslhelpcombined.dbk"/>
- </target>
-
- <target name="create-doc" depends="merge">
-
- <xslt force="true" style="${docbookdir}/eclipse33.xsl" in="${docbooksource}/xslhelpcombined.dbk" out="test.xml">
- <factory name="${xalan}" />
- <param name="manifest" expression="1"/>
- <param name="base.dir" expression="${htmldir}/"/>
- <param name="create.plugin.xml" expression="0"/>
- <param name="chunker.output.indent" expression="yes"/>
- <param name="navig.showtitles" expression="0"/>
- <param name="suppress.navigation" expression="1"/>
- <param name="generate.toc" expression="book toc,title
-chapter toc,title
-section title" />
- <param name="chapter.autolabel" expression="0"/>
- <param name="section.autolabel" expression="0"/>
- <param name="html.stylesheet" expression="book.css ../book.css"/>
- <param name="chunk.section.depth" expression="3"/>
- <param name="toc.section.depth" expression="5"/>
- <param name="toc.list.type" expression="ul"/>
- </xslt>
-
- <replace file="${current-loc}/toc.xml" token="${current-loc}/" value=""/>
- </target>
-
-</project>
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/.cvsignore b/docs/org.eclipse.wst.xsl.doc/docbook/.cvsignore
deleted file mode 100644
index c0958b3..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-xslhelpcombined.dbk
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/RescuingXSLTfromNicheStatus.xml b/docs/org.eclipse.wst.xsl.doc/docbook/concepts/RescuingXSLTfromNicheStatus.xml
deleted file mode 100644
index 6e19a82..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/RescuingXSLTfromNicheStatus.xml
+++ /dev/null
@@ -1,502 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<section id="ResucingXSLT">
- <title>Rescuing XSLT From Niche Status</title>
- <subtitle>A Gentle Introduction to XSLT through HTML Templates</subtitle>
- <note>
- <para>
- <emphasis>
- Editors Note: This originally appeared at
- <ulink url="http://www.xfront.com/rescuing-xslt.html">XFront.com</ulink>
- , and is republished here with permission. The article is written by David Jacobs.
- </emphasis>
- </para>
- </note>
- <abstract>
- <para>
- XSLT is one of the most exciting technologies to come out of the XML family. Unfortunately, its incredible
- power and associated complexity can be overwhelming to new users preventing many from experimenting with it or
- causing them to quickly give up in disgust. In fact, unless the method of teaching and the common style of use
- for XSLT is radically changed to make it more accessible, XSLT will be relegated to niche status like SGML and
- other powerful technologies.
- </para>
- </abstract>
- <section>
- <title>The Problem</title>
- <para>
- The 1990’s saw an incredible proliferation of new web related languages. Looking back we can see what
- features separated the winners and losers. The biggest key has been having a very low barrier to entry. Many
- languages accomplished this by following the following rules.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Leverage as much existing knowledge as possible.
- </para>
- </listitem>
- <listitem>
- <para>
- Make it easy to get started with "hello world" style example.
- </para>
- </listitem>
- <listitem>
- <para>
- The most common and useful language constructs should be easily conveyed with a few small examples.
- </para>
- </listitem>
- <listitem>
- <para>
- Complex programming constructs should only be required when what is trying to be accomplished is
- complex.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- From these rules we can see why embedded web scripting languages like Active Server Pages (ASPs), Cold
- Fusion, PHP and
- Java Server Pages (JSPs) are so popular. They all leverage a user’s knowledge of HTML. They also
- allow the
- minimum amount of scripting to be added to accomplish the dynamic feature a developer is looking for.
- This has
- allowed numerous web developers to start off with very small projects and then through continuos
- enhancement
- and learning, find themselves using the full power of a complex programming language. Furthermore,
- because of
- the very incremental nature of that learning the developer was never scared off.
- </para>
- <para>
- HTML has also fostered the technique of learning by example. When a web author sees another site with a
- feature they
- like, they immediately bring up the source to see how it was implemented. In this way many web
- authors were
- able to learn complex HTML tricks with no formal training. While server-side scripts are not as
- easy to come
- by, there are still numerous sites that house thousands of example scripts for a blossoming
- developer to
- examine.
- </para>
- <para>
- Traditionally XSLT has been presented as a programming language for translating XML documents into another
- format, often for presentation. This frames the problem, such that for each element, the programmer has the
- task of figuring out how that element needs to be translated. As long as there are one to one mappings or one
- to zero mappings this is straightforward. For example, if every occurrence of a <![CDATA[
- <name>]]>
- element is going to
- become an HTML header. It is a simple matter to write a matching template to accomplish
- this.
- </para>
- <programlisting id="pl_NameTemplate">
-<![CDATA[
-<xsl:template match="name">
- <h1><xsl:apply-templates/></h1>
-</xsl:template>
-]]>
- </programlisting>
- <para>
- However when adding one to many mappings (i.e. when an element’s contents will appear multiple times in the
- target document with different formatting), keeping track of all the relationships quickly grows in complexity
- and becomes confusing. For example, if, after writing the previous template, the programmer discovers that the
- name also needs to be placed in the title the programmer might add the template
- </para>
- <programlisting id="pl_valueOf">
-<![CDATA[
-<xsl:template match="/">
- <title><xsl:value-of select="name"/></title>
-</xsl:template>
-]]>
- </programlisting>
- <para>
- Notice the use of the <![CDATA[<xsl:value-of>]]>
- function in this template because using <![CDATA[<apply-templates select="name">]]>
- would have caused a triggering of the previous template adding undesired header tags to my content. This means
- before adding a translation to an element the programmer must first be aware of all the existing translations
- (ugh!). Of course if the programmer became aware of the
- <![CDATA[<title>]]>
- requirement first, the contents of these templates could have been reversed. One can quickly see how
- the
- arbitrary decisions of development and discovery of requirements can lead to a set of templates that are
- no
- longer intuitive.
- </para>
- <para>
- As a programmer with more than 20 years experience with over a dozen languages, XSLT templates and default
- rules were
- not obvious to me. Over the past year or two I had looked at numerous examples trying to discern how
- they
- worked. While I could understand the general gist of what was occurring, there was too much implied
- behavior
- that I did not pick up. It was not until going through formal XSLT training that I fully understood how
- XSLT
- worked. Clearly, if the barrier to entry is that high for an experienced programmer, the average web
- developer
- was not going to find this technology very useful.
- </para>
- </section>
- <section>
- <title>The Solution</title>
- <para>
- So how do we solve this problem and help deliver XSLT’s promise to the masses? For XSLT to be successful it
- must be
- presented and used in a way that adopts those attributes discussed earlier (reuse of knowledge, fast
- start, and
- gradualism). This tutorial will attempt to ease XSLT’s introduction by focusing on these attributes.
- First, it
- is only going to focus on the generation of HTML documents and users who are familiar with HTML. If
- your goal
- is to immediately start transforming one XML document into another XML document this tutorial is not
- for you.
- </para>
- <para>
- The second is to reframe the problem so the XSLT solutions programmers write are more naturally extensible
- and
- intuitive. Instead of trying to translate an XML source document into an HTML presentation document, the
- programmer should see the XML document as a complex data structure with XSLT providing powerful tools for
- extracting that information into their HTML documents. This allows us to leverage the experience most people
- have with using an HTML templating language (e.g. ASP, PHP, JSP, Cold Fusion, Web Macro, etc). These templating
- languages are all based on the basic premise that HTML comes first and all enhancements are then embedded in
- special tags.
- </para>
- <para>
- With some caveats, this tutorial will show how XSLT can be used in this same way. The benefit of this
- approach is it
- allows the quick use of many of XSLT’s powerful functions while letting you learn its more
- esoteric
- capabilities as the need arises. In addition the resulting XSLT files are more intuitive and
- maintainable.
- </para>
- <programlisting>
-<emphasis role="bold"><![CDATA[<xsl:value-of> and {}]]></emphasis>
- </programlisting>
- <para>
- On to an example. Here is a very simple welcome page.
- </para>
- <programlisting>
-<![CDATA[
-<html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- Welcome!
- </body>
-</html>
-]]>
- </programlisting>
- <para>
- And here is an XML document with information on member.
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- Welcome <xsl:value-of select="member/name"/>!
- </body>
- </html>
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <para>
- There are a couple of things that need to be pointed out right away. First this is a well-formed XML
- document. This mean all HTML used must conform to the XHTML specification (i.e. all tags must be closed and
- lowercase).
- </para>
- <para>
- The lines before the <![CDATA[<html>]]>
- tag and after the <![CDATA[</html>]]>
- tag will be seen in all the examples. For now, other than realizing that they are required in any style sheet
- created, just go ahead and forget they are there. You don’t NEED to understand them right now to get useful
- work out of XSLT.
- </para>
- <para>
- Notice the HTML is identical to the original except for the introduction of a new tag
- <![CDATA[<xsl:value-of>]]>.
- This tag is the key to extracting any piece of information out an XML document. It has a "select"
- attribute that
- provides the path through the XML document to the information we seek. In this case
- <![CDATA[<member>]]>
- is the outer most tag and
- <![CDATA[<name>]]>
- is the tag underneath it. Slash characters ("/") are used to designate parent/child relationships
- between tags.
- If you are used to navigating around a Unix file system this should feel familiar.
- </para>
- <para>
- Now let’s consider further customizing this page by making the welcome in the person’s favorite color using the
- <![CDATA[<font>]]>
- tag with the "bgcolor" attribute. Because
- <![CDATA[<xsl:value-of>]]>
- is an XML tag it is not valid to insert it in an HTML attribute value. So another mechanism
- is needed to insert
- information from our XML file there.
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- <font bgcolor="{member/favoriteColor}">
- Welcome <xsl:value-of select="member/name"/>!
- </font>
- </body>
- </html>
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <para>
- Notice the use of the curly brackets ("{}"). When used within an attribute assignment "{path}" has the exact
- same effect as
- <![CDATA[<xsl:value-of select="path" />]]>
- used outside of attribute assignments.
- </para>
- </section>
- <section>
- <title>Queries</title>
- <para>
- Not all paths lead to a single node. For example, what if we wanted to put a person’s home phone number on the
- page? Notice that the XML document contains two phone entries. If we simply used
- <![CDATA[<xsl:value-of select="member/phone" />]]>
- both entries would be returned. We obviously need a way to be more specific. Luckily, XSLT allows the full
- power of XPath to describe the value(s) of interest. XPath allows conditions on any attribute or tag to be
- placed in square brackets ("[]") which are then used to restrict the values returned.
- </para>
- <para>
- So to retrieve the home phone number we would use the path "member/phone[@type=’home’]". Notice the "@"
- symbol in front
- of "type". The "@" symbol signifies that we are referring to an attribute. So our new HTML
- template looks like:
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- <font bgcolor="{member/favoriteColor}">
- Welcome <xsl:value-of select="member/name"/>!
- <br/>
- Your home phone number is:
-]]> <emphasis role="bold"><![CDATA[<xsl:value-of select="member/phone[@type=’home’]"/>]]></emphasis>
-<![CDATA[ </font>
- </body
- </html
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <section>
- <title>xsl:for-each</title>
- <para>
- The previous example brings up another issue. What if this
- <![CDATA[<member>]]>
- entry had numerous phone numbers and we wanted to print them all on the web page. We could simply use
- <![CDATA[<xsl:value-of select="member/phone" />]]>
- but this would not enable us to format the phone number into a nice list that describes the type of each
- number.
- </para>
- <para>
- To accomplish this requires the introduction of the
- <![CDATA[<xsl:for-each>]]>
- tag which allows us to loop through each of the elements that match a given path. So to
- create a table that
- contains the phone number type in the first column and the phone number in the second
- column, the following
- stylesheet could be used.
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- <font bgcolor="{member/favoriteColor}">
- Welcome <xsl:value-of select="member/name"/>!
- </font>
- <table>
- <tr><th>Type</th><th>Number</th></tr>
- <xsl:for-each select="member/phone">
- <tr>
- <td><xsl:value-of select="@type"/></td>
- <td><xsl:value-of select="."/></td>
- </tr>
- </xsl:for-each>
- </table>
- </body>
- </html>
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <para>
- This example brings up a number of issues. First, while in the loop, all
- <![CDATA[<xsl:value-of />]]>
- accesses are relative to the current element being iterated over (in this case
- <![CDATA[<phone>)]]>.
- Notice the use of the period ("."), which like in a Unix file system means the current element.
- So in this
- case the period (".") refers to each phone element as the loop iterates. Also like in a file
- system you can
- address a parent element using a double period ("..") and can access any element in the
- document by starting
- over at the root element using a slash ("/").
- </para>
- </section>
- <section>
- <title>xsl:if</title>
- <para>
- As a last enhancement to our page let’s add a special offer to "platinum" level members. To do this requires
- the use of a new tag
- <![CDATA[<xsl:if>]]>
- which allows us to insert content based on a condition of the data in the XML document.
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- <font bgcolor="{member/favoriteColor}">
- Welcome <xsl:value-of select="member/name"/>!
- </font>
- <xsl:if test="member[@level='platinum']">
- Our special offer to platinum members today is something great
- </xsl:if>
- <table>
- <tr><th>Type</th><th>Number</th></tr>
- <xsl:for-each select="member/phone">
- <tr>
- <td><xsl:value-of select="@type"/></td>
- <td><xsl:value-of select="."/></td>
- </tr>
- </xsl:for-each>
- </table>
- </body>
- </html>
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <para>
- Within the "test" attribute the full array of Boolean and relative operators are available. The only caveat
- is that since this is an XML document less than and greater than (<![CDATA["<"]]>,
- ">") signs must be escaped as <![CDATA["&lt;" and "&gt;"]]>.
- </para>
- </section>
- <section>
- <title>xsl:choose</title>
- <para>
- One nuance of the
- <![CDATA[<xsl:if>]]>
- tag that is not always obvious at first glance is the lack of an "else" statement. This means to have an
- else statement requires two ifs. The first one saying "if condition" and the second one saying “if not
- condition”. This scheme quickly becomes unworkable with embedded if then else logic. Luckily XSLT
- supports an
- additional test operator called
- <![CDATA[<xsl:choose>]]>
- which works like a switch/case statement.
- </para>
- <programlisting>
-<![CDATA[
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Welcome</title>
- </head>
- <body>
- <font bgcolor="{member/favoriteColor}">
- Welcome <xsl:value-of select="member/name"/>!
- </font>
- <xsl:choose>
- <xsl:when test="member[@level='platinum']">
- Our special offer to platinum members today is something great
- </xsl:when>
- <xsl:otherwise>
- Become a platinum member today!
- </xsl:otherwise>
- </xsl:choose>
- <table>
- <tr><th>Type</th><th>Number</th></tr>
- <xsl:for-each select="member/phone">
- <tr>
- <td><xsl:value-of select="@type"/></td>
- <td><xsl:value-of select="."/></td>
- </tr>
- </xsl:for-each>
- </table>
- </body>
- </html>
- </xsl:template>
-</xsl:stylesheet>
-]]>
- </programlisting>
- <para>
- The “test” attribute has the same capabilities/ constraints as the “test” attribute in the
- <![CDATA[<xsl:if>]]>
- tag. Multiple
- <![CDATA[<xsl:when>]]>
- blocks are allowed. As soon as one “when test” is mached, it will not evaluate any further “xsl:when
- tests”
- in the
- <![CDATA[<xsl:choose>]]>
- block.
- </para>
- </section>
- </section>
- <section>
- <title>Conclusion</title>
- <para>
- With just these few commands (an admittedly small subset of XSLT) and a strong background in HTML (DHTML and
- JavaScript
- included), I believe web developers could meet the majority of their presentation needs. Obviously
- there will
- be cases where greater flexibility is required, but the advantage of this technique is that only
- then, does the
- developer need to learn those constructs.
- </para>
- <para>
- As a further benefit, this technique minimized the interdependence of one XLST construct on another. Local
- changes stay
- local thereby reducing the brittleness of solutions. The developer also no longer has to remember
- and account
- for XSLT’s default behaviors.
- </para>
- <para>
- I hope from these few examples, I have opened a few eyes to the power of XSLT and how a small change in how
- XSLT is framed can make a huge difference in its understandability and accessibility to web developers. If
- nothing else, I hope to encourage some good discussions.
- </para>
- </section>
-</section>
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/concepts.xml b/docs/org.eclipse.wst.xsl.doc/docbook/concepts/concepts.xml
deleted file mode 100644
index 602a67a..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/concepts.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="concepts/concepts.html" ?>
- <title>XSLT Concepts</title>
- <para>
-
- </para>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="RescuingXSLTfromNicheStatus.xml"/>
- <section id="concepts_Resources">
- <?dbhtml filename="concepts/resources.html" ?>
- <title>Resources</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="http://www.w3.org/TR/xslt">XSLT 1.0 Specification</ulink> - The official W3C XSLT 1.0 Specification.
- </para>
- </listitem>
- <listitem>
- <para>
- <ulink url="http://www.dpawson.co.uk/xsl/index.html">XSLT FAQ</ulink> - maintained by Dave Pawson.
- </para>
- </listitem>
- <listitem>
- <para><ulink url="http://www.xfront.com/rescuing-xslt.html">Rescuing XSLT from Niche Status</ulink> - by David Jacobs.</para>
- </listitem>
- <listitem>
- <para><ulink url="http://www.xml.com/pub/a/2003/11/26/learnXSLT.html">Five XSLT Basics</ulink> - by Michael Fitzgerald author of Learning XSLT.</para>
- </listitem>
- <listitem>
- <para><ulink url="http://www.xfront.com/files/tutorials.html">XFront Tutorials</ulink> - provides several tutorials include XSLT 1.0.</para>
- </listitem>
- <listitem>
- <para><ulink url="http://www.cafeconleche.org/books/bible2/chapters/ch17.html">XSL Transformations</ulink> - Chapter 17 of the XML Bible 2nd Edition.</para>
- </listitem>
- </itemizedlist>
- </section>
-
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/gettingstarted.xml b/docs/org.eclipse.wst.xsl.doc/docbook/concepts/gettingstarted.xml
deleted file mode 100644
index ea3f41d..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/concepts/gettingstarted.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="introduction/gettingstarted.html" ?>
- <title>Getting Started</title>
- <para>
- Still trying to think of original content for this section.
- </para>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/editor/editor.xml b/docs/org.eclipse.wst.xsl.doc/docbook/editor/editor.xml
deleted file mode 100644
index 0528abd..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/editor/editor.xml
+++ /dev/null
@@ -1,382 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="editor/xsleditor.html" ?>
- <title>XSL Editing</title>
- <para>The XSL Tools plugins extend the ability of the Web Standard Tools XML
- editor. This extension adds specific support and functionality for working with
- and debugging XSL files.</para>
- <section id="Validation">
- <?dbhtml filename="editor/xsleditor_validation.html" ?>
- <title>Validation</title>
- <para>The XSL extensions for the eclipse XML editor include as you type
- validation for XSL specific features. This includes not only the ability to
- syntax check the grammar, but to also to validate specific XSL specification
- rules. Grammar validation will be triggered based on the version attribute for
- the style sheet that is being edited. Valid version numbers are 1.0, and 2.0.
- </para>
- </section>
- <section id="ContentAssist">
-<?dbhtml filename="editor/xsleditor_contentassist.html" ?>
- <title>Content Assist</title>
- <para>
- XSL Tools extends the existing content assistance support of the XML Editor to
- provide content assistance for several XSL namespace attributes. The content
- assistance provided covers the available XPath statements as defined in the
- <emphasis>XPath Templates</emphasis>
- preference page.
- </para>
- <important>
- <title>XPath 2.0 Support</title>
- <para>Currently XPath 2.0 is not supported directly. However, a user
- can add this support if they need it by adding the missing XPath functions
- to the XPath Templates.</para>
- </important>
- <para>To initiate content assistance press CTRL + SPACE or CMD + SPACE. This
- will bring up a dialog that will contain any proposals that are available. If
- no proposals are available an message will be displayed in the status bar.
- </para>
- <section id="ed_XSLProposals">
-<?dbhtml filename="editor/xsleditor_contentassist_xsl.html" ?>
-
- <title>XSLT Element Proposals</title>
- <para>
- Since XSLT is a templating language, it's elements must be able to be
- added to the various markup it includes. The XSLT Editor will provide
- content assistance and proposals for XSLT elements that are available to
- be used within non-XSLT namespaced elements. This is depicted in
- <xref linkend="fig_XSLProposals"/>
- .
- </para>
- <figure id="fig_XSLProposals">
- <title>XSLT Proposals within Non-XSLT elements</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/xslproposals.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="SelectTest">
-<?dbhtml filename="editor/xsleditor_contentassist_selecttest.html" ?>
- <title>Select, Test, and Match Attributes</title>
- <para>
- Where ever an xsl element supports a
- <emphasis>select</emphasis>
- ,
- <emphasis>test</emphasis>
- , or
- <emphasis>match</emphasis>
- attribute, content assistance is available. This includes support for the
- following:
- </para>
- <itemizedlist>
- <title>Select, Match and Test Assistance</title>
- <listitem>
- <para>
- <emphasis>Variables</emphasis>
- - both local and global variables are supported within the current
- stylesheet. Any local or global variable will be added to the list
- and the name is prefixed with a dollar sign $ symbol.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>XPath 1.0</emphasis>
- - XPath 1.0 is supported through the use of templates. All of the
- XPath 1.0 and XSLT xpath extension functions are available, as
- well as
- <emphasis>axis</emphasis>
- operations. Currently XPath 2.0 is not supported directly, but
- will be added in the future.
- </para>
- </listitem>
- </itemizedlist>
- <para>Content assistance for the select and test attributes is
- intelligent enough to know that it is within an XPath expression, and will
- try to determine and provide content assistance based on the current
- cursor position. If a word has been partially typed it will filter the
- available assistance.</para>
- </section>
- <section id="ExcludeResultPrefixesContentAssist">
-<?dbhtml filename="editor/xsleditor_contentassist_exclude.html" ?>
-
- <title>Exclude-Result-Prefixes</title>
- <para>
- The
- <emphasis>exclude-result-prefixes</emphasis>
- attribute in both XSLT 1.0 and XSLT 2.0 allows for the exclusion of
- certain namespace declarations in the output document. The content
- assistance populates a list of available namespaces that have been defined
- in the stylseheet and provides them as proposals as shown in
- <xref linkend="fig_ExcludeResultPrefixesContentAssist1"/>
- .
- </para>
- <figure id="fig_ExcludeResultPrefixesContentAssist1">
- <title>Exclude-result-prefixes Content Assistance
- </title>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/editor/ExcludeContentAssist1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- If the attribute has no values defined, then the
- <emphasis>#all</emphasis>
- value will be available in the list. If #all is already in the attributes
- value, then no content assistance will be available.
- </para>
- <figure id="fig_ExcludeResultPrefixesContentAssist2">
- <title>Filtered exclude-result-prefixes proposals</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/editor/ExcludeContentAssist2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Content assistance is intelligent enough to know when a namespace
- prefix is already in the list of excluded namespaces. In this case it will
- not show the namespace in the proposal list.</para>
- <note>
- <title> Why isn't the XSL Namespace prefix in the proposals?</title>
- <para>Currently the xsl prefix or any prefix that uses the XSL
- namespace is excluded from the list. This may be changed at a future
- date. This will depend on user feedback.</para>
- </note>
- </section>
- <section id="ed_ModeAssist">
-<?dbhtml filename="editor/xsleditor_contentassist_modeassist.html" ?>
-
- <title>Mode attribute assistance</title>
- <para>
- Content assistance is available for those xsl elements that support the
- mode attribute. For XSLT 1.0 these elements are
- <emphasis>template</emphasis>
- ,
- <emphasis>apply-templates</emphasis>
- , and
- <emphasis>apply-imports</emphasis>
- .
- </para>
- <figure id="fig_ModeAssistance">
- <title>Mode attribute assistance</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/modeAssistance.png"
- format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- The proposal list is populated by those modes defined on templates in the
- current stylesheet, and any of the templates that are
- <emphasis>included</emphasis>
- or
- <emphasis>imported</emphasis>
- .
- </para>
- </section>
- <section id="ed_NamedTemplateAssist">
-<?dbhtml filename="editor/xsleditor_contentassist_namedtemplate.html" ?>
-
- <title>Named Template Assistance</title>
- <para>
- Call Named templates have content assistance available for their
- <emphasis>name</emphasis>
- attributes. This will provide a list of called-templates that have been
- used, but have not yet been defined or overridden within the current
- stylesheet.
- </para>
- <figure id="fig_NamedTemplates">
- <title>Named Template Assistance</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/namedTemplate.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="ed_CallTemplateAssist">
-<?dbhtml filename="editor/xsleditor_contentassist_calltemplate.html" ?>
-
- <title>Call-Template Assistance</title>
- <para>
- Any
- <emphasis>call-template</emphasis>
- xslt element has content assistance available for it's name attribute.
- This will provide a list of possible XSLT named templates that can be
- called from the current stylesheet. This takes into effect all included
- and imported stylesheets as well as those defined in the current
- stylesheet.
- </para>
- <figure id="fig_CallTemplateAssist">
- <title>Call-Template Assistance</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/calltemplate.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="ed_href">
-<?dbhtml filename="editor/xsleditor_contentassist_include.html" ?>
-
- <title>
- Include and Import
- <emphasis>href</emphasis>
- Assistance
- </title>
- <para>XSLT stylesheets have the ability to import and include other
- stylesheets. This allows for a modular structure for the templates to be
- created. It also allows for easier maintenance. However, if one is working
- with a large project like the DocBook Projects stylesheets it can be
- difficult to remember the names and locations of all the stylesheets.
- </para>
- <para>
- To this end, the XSLT editor provides content assistance for the
- <emphasis>href</emphasis>
- attribute. The scope of the assistance is restricted to the project that
- the current stylesheet that is being editted resides.
- </para>
- <figure id="fig_HREFAssistance">
- <title>Include/Import href Assistance</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/hrefAssistance.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="XSLEditorTemplates">
-<?dbhtml filename="editor/xsleditor_templates.html" ?>
- <title>Templates</title>
- <para>Specific XSL code completion templates can be added to the XML
- editor's Templates. This allows a user to define specific markup completion
- templates that are commonly used. In addition, the XPath Templates page can be
- enhanced to allow commonly used XPath templates to be included, in addition to
- those installed by default. This allows a user the ability to add custom
- extension functions for XSLT that may be processor specific. Adopters may also
- use the standard template extension point to add additional functionality.
- </para>
- <section>
- <title>XPath Templates</title>
- <para>The XSL XPath Templates preference page allows for a user or adopter
- to add specific xpath extensions so that they show up in the content
- assistance. See the XPath Templates documentation for more information.
- </para>
- </section>
- </section>
- <section id="xsltSyntaxColoring">
-<?dbhtml filename="editor/xsleditor_coloring.html" ?>
- <title>XSLT Syntax Coloring</title>
- <para>
- XSL Tools Editor can have syntax coloring that is specific just for the the
- XSLT Namespace as showing in
- <xref linkend="fig_editorSyntaxColoring"/>
- .
- </para>
- <figure id="fig_editorSyntaxColoring">
- <title>XSLT Specific Syntax Coloring</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/syntaxColoring.png"
- format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- The default coloring shown is to make all XSLT elements and attributes bold.
- The settings are controled in
- <xref linkend="XSLPreferences"/>
- .
- </para>
- </section>
- <section id="xsltMarkers">
-<?dbhtml filename="editor/xsleditor_markers.html" ?>
- <title>XSLT Markers and Annotations</title>
- <para>The XSL editor supports the ability to annotate or provide markers. These
- annotations provide additional information about the templates and XSLT
- elements in the stylesheet.</para>
- <section id="xsltOverRide">
-<?dbhtml filename="editor/xsleditor_contentassist_xsltOverride.html" ?>
-
- <title>Template Override</title>
- <para>The XSLT editor will mark templates that have overriden an imported
- template of the same name.</para>
- <figure id="fig_OverRide1">
- <title>Overriden Template</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/override1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- In
- <xref linkend="fig_OverRide1"/>
- , the template
- <emphasis>TempB</emphasis>
- overrides an imported template. By moving the mouse pointer over the
- triangle icon in the rule bar, information about which file the original
- template resides.
- </para>
- <figure id="fig_OverRide2">
- <title>Overriden Template Information</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/editor/override2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="XSLEditorDebugging">
-<?dbhtml filename="editor/xsleditor_debugging.html" ?>
- <title>XSL Debugging</title>
- <para>The XSL Editor supports the ability to specify break points within an XSL
- File. If the file is included or imported and the break point is encountered
- during a transformation scenario it will be respected. A break point may be
- set at any valid XSL element or other xml element within the XSLT stylesheet.
- See the Launching and Debugging section for more information on debugging XSLT
- stylesheets.</para>
- </section>
- <section>
-<?dbhtml filename="editor/xsleditor_debugging.html" ?>
- <title>Navigation</title>
- <para>
- Many of the variables, imports/includes, and templates can be navigated to
- using the
- <emphasis>Open Declaration (F3)</emphasis>
- popup menu option. They can also be navigated to directly by CTRL-Clicking on
- the name of the variable, import/include, or template. Items that currently
- have hyperlinking navigation are:
- </para>
- <itemizedlist>
- <listitem>
- <para>Called-Templates</para>
- </listitem>
- <listitem>
- <para>hrefs for Import and Includes</para>
- </listitem>
- <listitem>
- <para>With-Param variables</para>
- </listitem>
- </itemizedlist>
- <tip>
- <title>Navigation to a Named Template in an included/imported
- stylsheet</title>
- <para> The hyperlinking ability will navigate you to where ever the first
- definition of the template is defined. So if the template is defined
- within the current stylesheet it will navigate to that definition. However
- if it is defined in an imported or included stylesheet, or any of those
- imported or included stylesheets it will take you to that definition. Use
- the standard navigation errors to move back and forth during this
- hyperlinking.</para>
- </tip>
- </section>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/general/general.xml b/docs/org.eclipse.wst.xsl.doc/docbook/general/general.xml
deleted file mode 100644
index b72c45a..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/general/general.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="general/general.html" ?>
- <title>General</title>
- <para>This section covers topics that don't have any other particular place to go.</para>
- <section id="XInclude">
- <?dbhtml filename="general/xinclude.html" ?>
- <title>XInclude</title>
- <para>
- XInclude allows a user to import or include other XML files into one xml file.
- It is used primarily with documentation file formats like Docbook and DITA. It
- allows for separating out large xml documents into more manageable chunks of information.
- </para>
- <para>
- The XSL Tools project includes an ANT task that can be run with in eclipse, eclipse
- headless, and without eclipse at all. If running outside of eclipse, you will need
- to make sure that the jar file xinclude.jar in the org.eclipse.wst.xsl.core.jar file
- is made avaiable on your class path.
- </para>
- <mediaobject>
- <objectinfo id="Xinclude">
- <title>XInclude Task</title>
- </objectinfo>
- <imageobject>
- <imagedata align="center" fileref="../images/general/xinclude.png"
- format="PNG" />
- </imageobject>
- </mediaobject>
- <para>
- The following parameters are available on the xsl.xinclude ANT task:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">
- in
- </emphasis> - The full path to the input file that contains
- the file with the XIncludes. If the files that it includes have includes, then
- those will be brought in an expanded as well.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">out</emphasis> - The full path to the output file
- to be written with all includes expanded. This is typically used as the
- input to a stylesheet transformation process.
- </para>
- </listitem>
- </itemizedlist>
- <example>
- <title>XInclude Example</title>
- <programlisting xml:space="preserve">
-&lt;target name="merge">
- &lt;xsl.xinclude in="${docbooksource}/xslhelp.dbk"
- out="${docbooksource}/xslhelpcombined.dbk"/>
-&lt;/target>
- </programlisting>
- </example>
- </section>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist1.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist1.png
deleted file mode 100644
index 2f0f2cb..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist1.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist2.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist2.png
deleted file mode 100644
index 2e53677..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/ExcludeContentAssist2.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/calltemplate.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/calltemplate.png
deleted file mode 100644
index 3a13f07..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/calltemplate.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/hrefAssistance.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/hrefAssistance.png
deleted file mode 100644
index 5f44986..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/hrefAssistance.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/modeAssistance.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/modeAssistance.png
deleted file mode 100644
index f5a9875..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/modeAssistance.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/namedTemplate.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/namedTemplate.png
deleted file mode 100644
index b8bd926..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/namedTemplate.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override1.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override1.png
deleted file mode 100644
index 88b878b..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override1.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override2.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override2.png
deleted file mode 100644
index cfc415c..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/override2.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/syntaxColoring.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/syntaxColoring.png
deleted file mode 100644
index 85e0ebd..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/syntaxColoring.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/templatesView.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/templatesView.png
deleted file mode 100644
index a1e20d9..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/templatesView.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/xslproposals.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/xslproposals.png
deleted file mode 100644
index ffc127a..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/editor/xslproposals.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/launchShortct.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/launchShortct.png
deleted file mode 100644
index 881813a..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/launchShortct.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/nodesetVariable.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/nodesetVariable.png
deleted file mode 100644
index d3ca7ff..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/nodesetVariable.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/resultView.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/resultView.png
deleted file mode 100644
index d6d1b91..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/launching/resultView.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/XPathTemplates.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/XPathTemplates.png
deleted file mode 100644
index 0f89304..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/XPathTemplates.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/projectLevelValidation.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/projectLevelValidation.png
deleted file mode 100644
index 3ffe862..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/projectLevelValidation.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xm_template_xslnewfile.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xm_template_xslnewfile.png
deleted file mode 100644
index 7646a6d..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xm_template_xslnewfile.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslSyntaxColoring.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslSyntaxColoring.png
deleted file mode 100644
index 66ebef3..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslSyntaxColoring.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_InstalledProcessors.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_InstalledProcessors.png
deleted file mode 100644
index 3295079..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_InstalledProcessors.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_outputproperties.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_outputproperties.png
deleted file mode 100644
index 4e00a42..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xsl_outputproperties.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslfeatures.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslfeatures.png
deleted file mode 100644
index 29dbec8..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslfeatures.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslpreferences.png b/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslpreferences.png
deleted file mode 100644
index dcb7187..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/images/preferences/xslpreferences.png
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/launching/launching.xml b/docs/org.eclipse.wst.xsl.doc/docbook/launching/launching.xml
deleted file mode 100644
index 31c7c52..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/launching/launching.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="launching/launching.html" ?>
- <title>XSL Launching and Debugging</title>
- <para> XSL Tools adds support for XSL Launch and Debugging configurations. These allow you to setup XSL configurations
- for various jobs, and to also debug xsl stylsheet transformations.</para>
- <section id="XSLLaunch">
- <?dbhtml filename="launching/launching.html" ?>
- <title>XSL Launching</title>
- <para>
- In the Project Explorer, simply select the input XML file and the stylesheet(s) to transform it, and then right-click
- and select
- <emphasis>Run As > XSL Transformation</emphasis>
- .
- </para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" format="PNG" fileref="../images/launching/launchShortct.png" />
- </imageobject>
- </mediaobject>
- </section>
- <section id="XSLDebug">
- <?dbhtml filename="launching/debugging.html" ?>
- <title>XSLT Debugging</title>
- <para> XSL Tools provides a framework for XSLT processors to provide debugging support. The support provided is highly
- dependent on the processors. XSL Tools comes with built in support for the Xalan 2.7.1 processor. Debugging is only
- available for those processors that support the feature and plug into the extension point. The XSL Tools debugger
- leverages the existing eclipse platform Debug View</para>
- <para>
- How the debugger acts will depend on the processor being used. Not all XSLT processors pass the same type of
- information to the debugger. These differences will be noted in the
- <xref linkend="XSLDebugProcessorSpecific" />
- section.
- </para>
- <section id="DebugGettingStarted">
- <?dbhtml filename="launching/debugging_gettingStarted.html" ?>
- <title>Starting a Debug Session</title>
- <para> Debugging is started the same way as launching an XSL Tranformation is done. Except that the debug
- configuration is used instead of the normal launch configuration. If a debugging session is started on a processor
- that does not support debugging, a dialog will ask if you want to switch to one of the supported debuggers.</para>
- <note>
- <title>Default JRE</title>
- <para> The default JRE does not have built in support for debugging, even though it is based on Apache Xalan. It is
- recommended to use Xalan or another processor provided by an adopter to do your transformations. The default
- processor is known to have some issues that Xalan and other processors do not have.</para>
- </note>
- </section>
- <section id="XSLDebugCommon">
- <?dbhtml filename="launching/debugging_common.html" ?>
- <title>Common Debugging Operations</title>
- <para>
- XSLT debugging is handled by the eclipse platforms debugging framework support as outlined in the
- <ulink url="/help/topic/org.eclipse.platform.doc.isv/guide/debug_debug.htm">"Program Debug and Launch Support"</ulink>
- . Common operations like stepping into (F5), stepping over (F6), pausing, running to a breakpoint, and relaunching
- are supported. In addition to the standard Variable and Breakpoint views provided by the platform, there are some
- XSLT specific views and functionality as well. All of these are common regardless of the particular XSLT debugger
- being used.
- </para>
- <tip>
- <title>Introduction to Eclipse Debugging</title>
- <para>
- <ulink url="http://www.mcs.vuw.ac.nz/courses/COMP205/2007T1/tools/eclipse/debugging/basics.shtml">Basic Debugging in Eclipse</ulink>
- contains a good general introduction to the basic features provided by the Eclipse Debug view. XSL Tools leverages
- many of these features and the same concepts apply to the XSL Tools debugger.
- </para>
- </tip>
- <para> In addition to the standard features and functionality, the XSL Tools debugging support adds the following
- additional items:</para>
- <itemizedlist>
- <listitem>
- <para> Result View</para>
- </listitem>
- <listitem>
- <para>XSLT specific Variables</para>
- </listitem>
- <listitem>
- <para>XSLT Processor Specific Functionality</para>
- </listitem>
- </itemizedlist>
- <section id="XSLDebugResultView">
- <?dbhtml filename="launching/debugging_resultview.html" ?>
- <title>Result View</title>
- <para> The XSLT Debugger has a result view. This will show the output that the stylesheet has generated to the
- current break point or since the last step command was issued.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" format="PNG" fileref="../images/launching/resultView.png" />
- </imageobject>
- </mediaobject>
- <para> The result view is updated throughout the debugging process, and is useful to help see what output is
- generated at specific points during a transformation.</para>
- </section>
- <section id="XSLDebugVariables">
- <?dbhtml filename="launching/debugging_variablesview.html" ?>
- <title>Variables View</title>
- <para> The variables view will show all the local and global variables and params that are currently in scope. There
- are two types of variables that can be views.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" format="PNG" fileref="../images/launching/nodesetVariable.png" />
- </imageobject>
- </mediaobject>
- <itemizedlist>
- <title>Variable Types</title>
- <listitem>
- <para>
- <emphasis>String</emphasis>
- - These contain text values. This could be strings of text, numbers, or other characters.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Nodesets</emphasis>
- - Nodesets are represented in the variables view as expandable variables. They contain sequences of nodes. The
- type of nodes are represented by icons for elements, attributes, text, comments or processing instructions.
- </para>
- </listitem>
- </itemizedlist>
- <note>
- <title>Can I change the value of variables?</title>
- <para> Currently the XSLT Debugger does not support changing the values or contents of a variable. All XSLT
- variables are read only.</para>
- </note>
- </section>
- </section>
- <section id="XSLDebugProcessorSpecific">
- <?dbhtml filename="launching/debugging_processors.html" ?>
- <title>XSLT Processor Specific Support</title>
- <para> Various XSLT processors provide various levels of debugging support. Many do not provide support for debugging
- of stylesheets, and thus can't be used for debugging. XSL Tools provides basic support for Xalan, and can be used as
- a guide for adopters on how to implement their own specific debugging support for other processors.</para>
- <section id="XSLDebugXalan">
- <title>XSL Debugging with Xalan</title>
- <para> Xalan provides general stylesheet execution and evalation functionality. However there are a few things that
- Xalan does not suppor that other processors do.</para>
- <orderedlist>
- <title>Xalan Debugging Issues</title>
- <listitem>
- <para>
- <emphasis>Breakpoints</emphasis>
- - Xalan does not support stopping at Global Variables or Parameters when a debugging session is started. It will
- automatically start at the first template. Break points must be placed in templates to be honored. The reason for
- this is that Xalan lazily initializes the variables only when they are first used.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>XSLT Text elements</emphasis>
- - Xalan does not send notifications of xsl:text elements. These are skipped over when debugging.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>Built In Templates</emphasis>
- - Xalan does provide notification when the built in templates are called, but currently the debugger does not
- support or display stepping into these templates.
- </para>
- </listitem>
- </orderedlist>
- </section>
- </section>
- </section>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/legal.xml b/docs/org.eclipse.wst.xsl.doc/docbook/legal.xml
deleted file mode 100644
index 2fe8845..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/legal.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="legal.html" ?>
- <title>Notices</title>
- <para>
- The material in this guide is Copyright (c) Doug Satchwell (<ulink url="http://www.chasetechnology.co.uk">Chase Technology Ltd</ulink>),
- David Carver (<ulink url="http://www.starstandard.org">Standards for Technology in Automotive Retail</ulink>)
- and others 2008.
- </para>
- <para>
- This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies
- this distribution, and is available at
- <ulink url="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</ulink>.
- </para>
- <para>
- <ulink url="about.html">Terms and conditions regarding the use of this guide.</ulink>.
- </para>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/preferences/preferences.xml b/docs/org.eclipse.wst.xsl.doc/docbook/preferences/preferences.xml
deleted file mode 100644
index 2f09466..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/preferences/preferences.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="XSLPreferences">
- <?dbhtml filename="preferences/xslpreferences.html" ?>
- <title>XSL Tools Preferences</title>
- <para> The XSL Preference pages has several sub sections. Each of these allow for
- configuration of various aspects of the preferences. From the controlling of the
- default XSL processor to be used during transformations. To extending the content
- assist support of the XPath functions available in the XML editor.</para>
- <figure id="fig_XSLPreferences">
- <title>XSL Tools Preferences</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="../images/preferences/xslpreferences.png"
- format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section id="XSLFeatures">
- <?dbhtml filename="preferences/xslfeatures.html" ?>
- <title>Features</title>
- <para> The XSL Features preference page allows for the configuration of features
- for a particular processor. XSL Tools comes with Xalan 2.7.0 by default.
- Adopters can extend and include their own specific features for their own
- procesoors. An adopter could extend the tooling to support XSLT 2.0
- transformations, and features particular to that parser.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" format="PNG"
- fileref="../images/preferences/xslfeatures.png"/>
- </imageobject>
- </mediaobject>
- <para>
- The
- <emphasis role="bold">Processor Type</emphasis>
- allows you to set features for a specific processor. In this case this is for
- the processor that is being installed. XSL Tools comes with Xalan 2.7.0, and
- it is the only available processor type by default.
- </para>
- <para> The feature table lists the features that are specific to the processor
- that was selected. As you select each of the features, information regarding
- that feature and it's abilities is displayed in the description box. By
- clicking in the value column, next to the feature you want to set the value
- for, the user can set the feature.</para>
- </section>
- <section id="XSLProcessors">
- <?dbhtml filename="preferences/xslprocessors.html" ?>
- <title>Installed Processors</title>
- <para> The installed processors page lets you pick which of the installed XSLT
- processors will be used by default. The default is the System Default
- Procesoor, but you can select any of the available processors to be used as
- the default processor.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/preferences/xsl_InstalledProcessors.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </section>
- <section id="XSLOutputProperties">
- <?dbhtml filename="preferences/xsloutputproperties.html" ?>
- <title>Output Properties</title>
- <para> The various xsl processors support a wide variety of processor specific
- tweaks. However there are several Standard processor features that all XSLT
- processors support. These options can be set and will act as the defaults for
- all transformations unless they are specifically overriden by the stylesheet
- or the launch configuration.</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/preferences/xsl_outputproperties.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- <para> In addition to the Standard Output Properties, each XSLT processor can have
- processors specific features.</para>
- </section>
- <section id="XPathTemplates">
- <?dbhtml filename="preferences/xpathtemplates.html" ?>
- <title>XPath Templates</title>
- <para> XPath template proposal is supported by the XSL Tooling project through the
- built in template functionality of eclipse. Users and Adopters can add their
- own specific xpath extensions for processor specific extensions. An example
- would be to add the EXSLT extensions for proposal support.</para>
- <mediaobject>
- <imageobject>
- <objectinfo>
- <title>XPath Templates</title>
- </objectinfo>
- <imagedata align="center" fileref="../images/preferences/XPathTemplates.png"
- format="PNG"/>
- </imageobject>
- </mediaobject>
- <para> The following content types are available:</para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis role="bold">axis</emphasis>
- - an XPath navigation axis statement.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">exslt</emphasis>
- - An XPath statement that is defined by the
- <ulink url="http://www.exslt.org/">EXSLT</ulink>
- library. Xalan and most other processors have built in support for the
- EXSLT library.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">xpath</emphasis>
- - Represents an XPATH 1.0 function. These are functions as defined by
- the XPath 1.0 specification.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">xpath 2.0</emphasis>
- - Represents an XPath 2.0 function.
- <emphasis>Note: That currently XSL Tools only ships with
- templates defined for XPath 1.0 .</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">operator</emphasis>
- - An xpath logical operator like AND, OR, etc.
- </para>
- </listitem>
- </itemizedlist>
- <section id="XPathTemplateNew">
- <?dbhtml filename="preferences/xpathtemplatenew.html" ?>
- <title>Creating New Templates</title>
- <!-- TODO: Create Additional information on creating new templates-->
- <para> Add documentation about creating new templates.</para>
- </section>
- <section id="XPathImport">
- <?dbhtml filename="preferences/xpathimport.html" ?>
- <title>Import XPath Templates</title>
- <para> Add documentation about importing new templates.</para>
- </section>
- <section id="XPathExport">
- <?dbhtml filename="preferences/xpathexport.html" ?>
- <title>Import XPath Templates</title>
- <para> Add documentation about importing new templates.</para>
- </section>
- </section>
- <section id="pref_ProjectValidationPreferences">
- <?dbhtml filename="preferences/validation.html" ?>
- <title>Project Validation Preferences</title>
- <para>
- XSL Tools has the ability to set both workspace wide preferences for
- validation as well as project level preferences. These preferences, as shown
- in
- <xref linkend="fig_ProjectLevelPreferences"/>
- allow for the fine grain control of what the validator will consider to be an
- syntax error.
- </para>
- <figure id="fig_ProjectLevelPreferences">
- <title>Project Level Validation Preferences</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/preferences/projectLevelValidation.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para> These preferences are accessed via the Projects properties dialog.</para>
- </section>
- <section id="pref_SyntaxColoring">
- <?dbhtml filename="preferences/syntaxColoring.html" ?>
- <title>XSLT Syntax Coloring</title>
- <para>
- XSL Tools also has the ability to syntax color the XSLT namespace items a different
- color than the rest of the XML syntax included. The default is for all XSL syntax to be
- <emphasis role="bold">bold</emphasis>.
- </para>
- <figure id="fig_XSLSyntaxColoringPreference">
- <title>XSL Tools Syntax Coloring Preference</title>
- <mediaobject>
- <imageobject>
- <imagedata align="center"
- fileref="../images/preferences/xslSyntaxColoring.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <note>
- <title>XML Colors</title>
- <para>
- The color for standard XML is still handled by the XML Files syntax coloring
- preference page. Changes made there are reflected in the XSL editor as well.
- </para>
- </note>
- </section>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/samples/samples.xml b/docs/org.eclipse.wst.xsl.doc/docbook/samples/samples.xml
deleted file mode 100644
index 710cf1c..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/samples/samples.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter>
- <?dbhtml filename="samples/samples.html" ?>
- <title>XSL Tooling Samples</title>
- <para>This section contains several samples and references to sample projects.</para>
- <section id="EclipseHelp">
- <?dbhtml filename="samples/eclipsehelp.html" ?>
- <title>Eclipse Help</title>
- <para></para>
- <section id="DocbookEclipseHelp">
- <?dbhtml filename="samples/docbookhelp.html" ?>
- <title>Creating Eclipse Help with Docbook and XSL Tools</title>
- <para>
- This tutorial assumes that you have knowledge of Docbook, ANT, and the
- ability to setup ANT build scripts.
- </para>
- <para>
- To Do write up the rest of the tutorial.
- </para>
- </section>
- <section id="DITAEclipseHelp">
- <?dbhtml filename="samples/ditahelp.html" ?>
- <title>Creating Eclipse Help with DITA and XSL Tools</title>
- <para>
- This tutorial assumes that you have knowledge of DITA, ANT, and the
- ability to setup ANT build scripts.
- </para>
- <para>
- To Do write up the rest of the tutorial.
- </para>
- </section>
- </section>
-</chapter> \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/docbook/xslhelp.dbk b/docs/org.eclipse.wst.xsl.doc/docbook/xslhelp.dbk
deleted file mode 100644
index 0066ce9..0000000
--- a/docs/org.eclipse.wst.xsl.doc/docbook/xslhelp.dbk
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<book id="XSLUser" xmlns:xi="http://www.w3.org/2001/XInclude">
- <bookinfo>
- <title>XSL Tools User Documentation</title>
- <author>
- <firstname>David</firstname>
- <surname>Carver</surname>
- </author>
- <copyright>
- <year>2008</year>
- <holder>Eclipse Foundation and others</holder>
- </copyright>
- </bookinfo>
- <xi:include href="concepts/gettingstarted.xml"/>
- <xi:include href="concepts/concepts.xml"/>
- <xi:include href="editor/editor.xml"/>
- <xi:include href="launching/launching.xml"/>
- <xi:include href="preferences/preferences.xml"/>
- <xi:include href="general/general.xml"/>
- <xi:include href="samples/samples.xml"/>
- <xi:include href="legal.xml"/>
-</book>
-
diff --git a/docs/org.eclipse.wst.xsl.doc/html/about.html b/docs/org.eclipse.wst.xsl.doc/html/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/docs/org.eclipse.wst.xsl.doc/html/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</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 Redistributors 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/docs/org.eclipse.wst.xsl.doc/html/book.css b/docs/org.eclipse.wst.xsl.doc/html/book.css
deleted file mode 100644
index e30f5af..0000000
--- a/docs/org.eclipse.wst.xsl.doc/html/book.css
+++ /dev/null
@@ -1,214 +0,0 @@
-p.Code {
- display: block;
- text-align: left;
- text-indent: 0.00pt;
- margin-top: 0.000000pt;
- margin-bottom: 0.000000pt;
- margin-right: 0.000000pt;
- margin-left: 15pt;
- font-weight: normal;
- font-style: normal;
- color: #4444CC;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Courier New", Courier, monospace;
-}
-
-H6.CaptionFigColumn {
- display: block;
- text-align: left;
- text-indent: 0.000000pt;
- margin-top: 3.000000pt;
- margin-bottom: 11.000000pt;
- margin-right: 0.000000pt;
- margin-left: 0.000000pt;
- font-size: 75%;
- font-weight: bold;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
-}
-
-p.Note {
- display: block;
- text-align: left;
- text-indent: 0pt;
- margin-top: 19.500000pt;
- margin-bottom: 19.500000pt;
- margin-right: 0.000000pt;
- margin-left: 30pt;
- font-size: 110%;
- font-weight: normal;
- font-style: Italic;
- color: #000000;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
-}
-
-EM.UILabel {
- font-weight: Bold;
- font-style: normal;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
-}
-
-EM.CodeName {
- font-weight: Bold;
- font-style: normal;
- text-decoration: none;
- vertical-align: baseline;
- text-transform: none;
- font-family: "Courier New", Courier, monospace;
-}
-
-UL.NavList {
- margin-left: 1.5em;
- padding-left: 0px;
- list-style-type: none;
-}
-
-body,html {
- border: 0px
-}
-
-/* following font face declarations need to be removed for DBCS */
-body,h1,h2,h3,h4,h5,h6,p,table,td,caption,th,ul,ol,dl,li,dd,dt {
- font-family: Arial, Helvetica, sans-serif;
- color: #000000
-}
-
-pre,code {
- font-family: "Courier New", Courier, monospace;
-}
-
-/* end font face declarations */
-@media print {
- html {
- font-size: 12pt
- }
-}
-
-body {
- font-size: 83%;
- background: #FFFFFF;
- margin-bottom: 1em
-}
-
-h1 {
- font-size: 180%;
- margin-top: 5px;
- margin-bottom: 1px
-}
-
-h2 {
- font-size: 140%;
- margin-top: 25px;
- margin-bottom: 3px
-}
-
-h3 {
- font-size: 110%;
- margin-top: 20px;
- margin-bottom: 3px
-}
-
-h4 {
- font-size: 100%;
- margin-top: 20px;
- margin-bottom: 3px;
- font-style: italic
-}
-
-p {
- margin-top: 10px;
- margin-bottom: 10px
-}
-
-pre {
- font-size: 93%;
- margin-left: 6;
- color: #4444CC
-}
-
-code {
- font-size: 93%;
-}
-
-table {
- font-size: 100%
-} /* needed for quirks mode */
-a:link {
- color: #0000FF
-}
-
-a:hover {
- color: #000080
-}
-
-a:visited {
- text-decoration: underline
-}
-
-ul {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-li {
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-li p {
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-ol {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-dl {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-dt {
- margin-top: 5px;
- margin-bottom: 5px;
- font-weight: bold;
-}
-
-dd {
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-strong {
- font-weight: bold
-}
-
-em {
- font-style: italic
-}
-
-var {
- font-style: italic
-}
-
-div.revision {
- border-left-style: solid;
- border-left-width: thin;
- border-left-color: #7B68EE;
- padding-left: 5
-}
-
-th {
- font-weight: bold
-} \ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsl.doc/html/concepts/concepts.html b/docs/org.eclipse.wst.xsl.doc/html/concepts/concepts.html
deleted file mode 100644
index 36d2593..0000000
--- a/docs/org.eclipse.wst.xsl.doc/html/concepts/concepts.html
+++ /dev/null
@@ -1,418 +0,0 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>XSLT Concepts</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="../index.html" title="XSL Tools User Documentation"><link rel="up" href="../index.html" title="XSL Tools User Documentation"><link rel="prev" href="../introduction/gettingstarted.html" title="Getting Started"><link rel="next" href="resources.html" title="Resources"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="N10019"></a>XSLT Concepts</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><ul><li><span class="section"><a href="concepts.html#ResucingXSLT">Rescuing XSLT From Niche Status</a></span><ul><li><span class="section"><a href="concepts.html#N10034">The Problem</a></span></li><li><span class="section"><a href="concepts.html#N1005A">The Solution</a></span></li><li><span class="section"><a href="concepts.html#N10081">Queries</a></span><ul><li><span class="section"><a href="concepts.html#N1008F">xsl:for-each</a></span></li><li><span class="section"><a href="concepts.html#N1009B">xsl:if</a></span></li><li><span class="section"><a href="concepts.html#N100A5">xsl:choose</a></span></li></ul></li><li><span class="section"><a href="concepts.html#N100AF">Conclusion</a></span></li></ul></li><li><span class="section"><a href="resources.html">Resources</a></span></li></ul></div><p>
-
- </p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ResucingXSLT"></a>Rescuing XSLT From Niche Status</h2></div><div><h3 class="subtitle">A Gentle Introduction to XSLT through HTML Templates</h3></div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- <span class="emphasis"><em>
- Editors Note: This originally appeared at
- <a class="ulink" href="http://www.xfront.com/rescuing-xslt.html" target="_top">XFront.com</a>
- , and is republished here with permission. The article is written by David Jacobs.
- </em></span>
- </p></div><div class="abstract"><p class="title"><b>Abstract</b></p><p>
- XSLT is one of the most exciting technologies to come out of the XML family. Unfortunately, its incredible
- power and associated complexity can be overwhelming to new users preventing many from experimenting with it or
- causing them to quickly give up in disgust. In fact, unless the method of teaching and the common style of use
- for XSLT is radically changed to make it more accessible, XSLT will be relegated to niche status like SGML and
- other powerful technologies.
- </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="N10034"></a>The Problem</h3></div></div></div><p>
- The 1990&rsquo;s saw an incredible proliferation of new web related languages. Looking back we can see what
- features separated the winners and losers. The biggest key has been having a very low barrier to entry. Many
- languages accomplished this by following the following rules.
- </p><div class="itemizedlist"><ul type="disc"><li><p>
- Leverage as much existing knowledge as possible.
- </p></li><li><p>
- Make it easy to get started with "hello world" style example.
- </p></li><li><p>
- The most common and useful language constructs should be easily conveyed with a few small examples.
- </p></li><li><p>
- Complex programming constructs should only be required when what is trying to be accomplished is
- complex.
- </p></li></ul></div><p>
- From these rules we can see why embedded web scripting languages like Active Server Pages (ASPs), Cold
- Fusion, PHP and
- Java Server Pages (JSPs) are so popular. They all leverage a user&rsquo;s knowledge of HTML. They also
- allow the
- minimum amount of scripting to be added to accomplish the dynamic feature a developer is looking for.
- This has
- allowed numerous web developers to start off with very small projects and then through continuos
- enhancement
- and learning, find themselves using the full power of a complex programming language. Furthermore,
- because of
- the very incremental nature of that learning the developer was never scared off.
- </p><p>
- HTML has also fostered the technique of learning by example. When a web author sees another site with a
- feature they
- like, they immediately bring up the source to see how it was implemented. In this way many web
- authors were
- able to learn complex HTML tricks with no formal training. While server-side scripts are not as
- easy to come
- by, there are still numerous sites that house thousands of example scripts for a blossoming
- developer to
- examine.
- </p><p>
- Traditionally XSLT has been presented as a programming language for translating XML documents into another
- format, often for presentation. This frames the problem, such that for each element, the programmer has the
- task of figuring out how that element needs to be translated. As long as there are one to one mappings or one
- to zero mappings this is straightforward. For example, if every occurrence of a
- &lt;name&gt;
- element is going to
- become an HTML header. It is a simple matter to write a matching template to accomplish
- this.
- </p><a name="pl_NameTemplate"></a><pre class="programlisting">
-
-&lt;xsl:template match="name"&gt;
- &lt;h1&gt;&lt;xsl:apply-templates/&gt;&lt;/h1&gt;
-&lt;/xsl:template&gt;
-
- </pre><p>
- However when adding one to many mappings (i.e. when an element&rsquo;s contents will appear multiple times in the
- target document with different formatting), keeping track of all the relationships quickly grows in complexity
- and becomes confusing. For example, if, after writing the previous template, the programmer discovers that the
- name also needs to be placed in the title the programmer might add the template
- </p><a name="pl_valueOf"></a><pre class="programlisting">
-
-&lt;xsl:template match="/"&gt;
- &lt;title&gt;&lt;xsl:value-of select="name"/&gt;&lt;/title&gt;
-&lt;/xsl:template&gt;
-
- </pre><p>
- Notice the use of the &lt;xsl:value-of&gt;
- function in this template because using &lt;apply-templates select="name"&gt;
- would have caused a triggering of the previous template adding undesired header tags to my content. This means
- before adding a translation to an element the programmer must first be aware of all the existing translations
- (ugh!). Of course if the programmer became aware of the
- &lt;title&gt;
- requirement first, the contents of these templates could have been reversed. One can quickly see how
- the
- arbitrary decisions of development and discovery of requirements can lead to a set of templates that are
- no
- longer intuitive.
- </p><p>
- As a programmer with more than 20 years experience with over a dozen languages, XSLT templates and default
- rules were
- not obvious to me. Over the past year or two I had looked at numerous examples trying to discern how
- they
- worked. While I could understand the general gist of what was occurring, there was too much implied
- behavior
- that I did not pick up. It was not until going through formal XSLT training that I fully understood how
- XSLT
- worked. Clearly, if the barrier to entry is that high for an experienced programmer, the average web
- developer
- was not going to find this technology very useful.
- </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="N1005A"></a>The Solution</h3></div></div></div><p>
- So how do we solve this problem and help deliver XSLT&rsquo;s promise to the masses? For XSLT to be successful it
- must be
- presented and used in a way that adopts those attributes discussed earlier (reuse of knowledge, fast
- start, and
- gradualism). This tutorial will attempt to ease XSLT&rsquo;s introduction by focusing on these attributes.
- First, it
- is only going to focus on the generation of HTML documents and users who are familiar with HTML. If
- your goal
- is to immediately start transforming one XML document into another XML document this tutorial is not
- for you.
- </p><p>
- The second is to reframe the problem so the XSLT solutions programmers write are more naturally extensible
- and
- intuitive. Instead of trying to translate an XML source document into an HTML presentation document, the
- programmer should see the XML document as a complex data structure with XSLT providing powerful tools for
- extracting that information into their HTML documents. This allows us to leverage the experience most people
- have with using an HTML templating language (e.g. ASP, PHP, JSP, Cold Fusion, Web Macro, etc). These templating
- languages are all based on the basic premise that HTML comes first and all enhancements are then embedded in
- special tags.
- </p><p>
- With some caveats, this tutorial will show how XSLT can be used in this same way. The benefit of this
- approach is it
- allows the quick use of many of XSLT&rsquo;s powerful functions while letting you learn its more
- esoteric
- capabilities as the need arises. In addition the resulting XSLT files are more intuitive and
- maintainable.
- </p><pre class="programlisting">
-<span class="bold"><strong>&lt;xsl:value-of&gt; and {}</strong></span>
- </pre><p>
- On to an example. Here is a very simple welcome page.
- </p><pre class="programlisting">
-
-&lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;Welcome&lt;/title&gt;
- &lt;/head&gt;
- &lt;body&gt;
- Welcome!
- &lt;/body&gt;
-&lt;/html&gt;
-
- </pre><p>
- And here is an XML document with information on member.
- </p><pre class="programlisting">
-
-&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0"&gt;
- &lt;xsl:template match="/"&gt;
- &lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;Welcome&lt;/title&gt;
- &lt;/head&gt;
- &lt;body&gt;
- Welcome &lt;xsl:value-of select="member/name"/&gt;!
- &lt;/body&gt;
- &lt;/html&gt;
- &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;
-
- </pre><p>
- There are a couple of things that need to be pointed out right away. First this is a well-formed XML
- document. This mean all HTML used must conform to the XHTML specification (i.e. all tags must be closed and
- lowercase).
- </p><p>
- The lines before the &lt;html&gt;
- tag and after the &lt;/html&gt;
- tag will be seen in all the examples. For now, other than realizing that they are required in any style sheet
- created, just go ahead and forget they are there. You don&rsquo;t NEED to understand them right now to get useful
- work out of XSLT.
- </p><p>
- Notice the HTML is identical to the original except for the introduction of a new tag
- &lt;xsl:value-of&gt;.
- This tag is the key to extracting any piece of information out an XML document. It has a "select"
- attribute that
- provides the path through the XML document to the information we seek. In this case
- &lt;member&gt;
- is the outer most tag and
- &lt;name&gt;
- is the tag underneath it. Slash characters ("/") are used to designate parent/child relationships
- between tags.
- If you are used to navigating around a Unix file system this should feel familiar.
- </p><p>
- Now let&rsquo;s consider further customizing this page by making the welcome in the person&rsquo;s favorite color using the
- &lt;font&gt;
- tag with the "bgcolor" attribute. Because
- &lt;xsl:value-of&gt;
- is an XML tag it is not valid to insert it in an HTML attribute value. So another mechanism
- is needed to insert
- information from our XML file there.
- </p><pre class="programlisting">
-
-&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0"&gt;
- &lt;xsl:template match="/"&gt;
- &lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;Welcome&lt;/title&gt;
- &lt;/head&gt;
- &lt;body&gt;
- &lt;font bgcolor="{member/favoriteColor}"&gt;
- Welcome &lt;xsl:value-of select="member/name"/&gt;!
- &lt;/font&gt;
- &lt;/body&gt;
- &lt;/html&gt;
- &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;
-
- </pre><p>
- Notice the use of the curly brackets ("{}"). When used within an attribute assignment "{path}" has the exact
- same effect as
- &lt;xsl:value-of select="path" /&gt;
- used outside of attribute assignments.
- </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="N10081"></a>Queries</h3></div></div></div><p>
- Not all paths lead to a single node. For example, what if we wanted to put a person&rsquo;s home phone number on the
- page? Notice that the XML document contains two phone entries. If we simply used
- &lt;xsl:value-of select="member/phone" /&gt;
- both entries would be returned. We obviously need a way to be more specific. Luckily, XSLT allows the full
- power of XPath to describe the value(s) of interest. XPath allows conditions on any attribute or tag to be
- placed in square brackets ("[]") which are then used to restrict the values returned.
- </p><p>
- So to retrieve the home phone number we would use the path "member/phone[@type=&rsquo;home&rsquo;]". Notice the "@"
- symbol in front
- of "type". The "@" symbol signifies that we are referring to an attribute. So our new HTML
- template looks like:
- </p><pre class="programlisting">
-
-&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0"&gt;
- &lt;xsl:template match="/"&gt;
- &lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;Welcome&lt;/title&gt;
- &lt;/head&gt;
- &lt;body&gt;
- &lt;font bgcolor="{member/favoriteColor}"&gt;
- Welcome &lt;xsl:value-of select="member/name"/&gt;!
- &lt;br/&gt;
- Your home phone number is:
- <span class="bold"><strong>&lt;xsl:value-of select="member/phone[@type=&rsquo;home&rsquo;]"/&gt;</strong></span>
- &lt;/font&gt;
- &lt;/body
- &lt;/html
- &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;
-
- </pre><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="N1008F"></a>xsl:for-each</h4></div></div></div><p>
- The previous example brings up another issue. What if this
- &lt;member&gt;
- entry had numerous phone numbers and we wanted to print them all on the web page. We could simply use
- &lt;xsl:value-of select="member/phone" /&gt;
- but this would not enable us to format the phone number into a nice list that describes the type of each
- number.
- </p><p>
- To accomplish this requires the introduction of the
- &lt;xsl:for-each&gt;
- tag which allows us to loop through each of the elements that match a given path. So to
- create a table that
- contains the phone number type in the first column and the phone number in the second
- column, the following
- stylesheet could be used.
- </p><pre class="programlisting">
-
-&lt;?xml version="1.0"?&gt;
-&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0"&gt;
- &lt;xsl:template match="/"&gt;
- &lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;Welcome&lt;/title&gt;
- &lt;/head&gt;
- &lt;body&gt;
- &lt;font bgcolor="{member/favoriteColor}"&gt;
- Welcome &lt;xsl:value-of select="member/name"/&gt;!
- &lt;/font&gt;
- &lt;table&gt;
- &lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Number&lt;/th&gt;&lt;/tr&gt;
- &lt;xsl:for-each select="member/phone"&gt;
- &lt;tr&gt;
- &lt;td&gt;&lt;xsl:value-of select="@type"/&gt;&lt;/td&gt;
- &lt;td&gt;&lt;xsl:value-of select="."/&gt;&lt;/td&gt;
- &lt;/tr&gt;
- &lt;/xsl:for-each&gt;
- &lt;/table&gt;
- &lt;/body&gt;
- &lt;/html&gt;
- &lt;/xsl:template&gt;
-&lt;/xsl:stylesheet&gt;
-
- </pre><p>
- This example brings up a number of issues. First, while in the loop, all
- &lt;xsl:value-of /&gt;
- accesses are relative to the current element being iterated over (in this case
- &lt;phone&gt;).
- Notice the use of the period ("."), which like in a Unix file system means the current element.
- So in this
- case the period (".") refers to each phone element as the loop iterates. Also like in a file
- system you can
- address a parent element using a double period ("..") and can access any element in the
- document by starting
- over at the root element using a slash ("/").
- </p></div><div class="section" lang="en"><div class="titlepage">