Author: DartPeng
Date: 2008-11-19 22:23:32 -0500 (Wed, 19 Nov 2008)
New Revision: 11895
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/smooks-sm.gif
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
Log:
JBIDE-3112
Add new icons and remove the jboss.common.ui dependecy
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/smooks-sm.gif
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/smooks-sm.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-11-20 02:03:22 UTC (rev
11894)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-11-20 03:23:32 UTC (rev
11895)
@@ -1,293 +1,293 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension-point id="viewerInitor" name="viewerInitor"
schema="schema/viewerInitor.exsd"/>
- <extension-point id="analyzer" name="analyzer"
schema="schema/analyzer.exsd"/>
- <extension-point id="commandProcessor" name="commandProcessor"
schema="schema/commandProcessor.exsd"/>
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri = "http://www.jboss.org/tools/smooks/graphicalInformation"
- class = "org.jboss.tools.smooks.graphical.GraphicalPackage"
- genModel = "model/graphical.genmodel" />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.xml.ui.internal.registry.AdapterFactoryProviderForXML">
- <contentType id="org.eclipse.core.runtime.xml" />
- <contentType id="org.jboss.tools.smooks.ui.smooks.contentType" />
- </adapterFactoryDescription>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <contentOutlineConfiguration
- class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <propertySheetConfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <documentationTextHover
-
class="org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor"
- target="org.eclipse.wst.xml.XML_DEFAULT">
- </documentationTextHover>
- <doubleClickStrategy
-
class="org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy"
- target="org.eclipse.wst.xml.XML_DEFAULT">
- </doubleClickStrategy>
- <provisionalConfiguration
- type="sourceeditingtexttools"
- class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <provisionalConfiguration
- type="structuredtextfoldingprovider"
- class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <provisionalConfiguration
- type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
- class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
- target="org.eclipse.wst.xml.XML_DEFAULT" />
- <provisionalConfiguration
- type="autoeditstrategy"
- class="org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML"
- target="org.eclipse.wst.xml.XML_DEFAULT" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.xml.ui.preferences.xml.xml,
org.eclipse.wst.sse.ui.preferences.xml.source,
org.eclipse.wst.sse.ui.preferences.xml.templates,
org.eclipse.wst.sse.ui.preferences.xml.colors"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <provisionalDefinition
- type="spellingregions"
- value="XML_COMMENT_TEXT, XML_CONTENT, XML_DEFAULT"
- target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
- <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" />
- </extension>
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="Smooks Form Editor"
- extensions="smooks"
- icon="icons/sample.gif"
- class="org.jboss.tools.smooks.ui.editors.SmooksFormEditor"
- id="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
- <contentTypeBinding
- contentTypeId="org.eclipse.core.runtime.xml" />
- <contentTypeBinding
- contentTypeId="org.jboss.tools.smooks.ui.smooks.contentType" />
- </editor>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections
-
contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
- <propertySection
- class="org.jboss.tools.smooks.ui.ConnectionPropertySection"
- id="org.jboss.tools.smooks.ui.connection.propertyTab.Section"
- tab="org.jboss.tools.smooks.ui.connection.propertyTab">
- <input
-
type="org.jboss.tools.smooks.ui.gef.model.LineConnectionModel">
- </input>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="viewerInitor" name="viewerInitor"
schema="schema/viewerInitor.exsd"/>
+ <extension-point id="analyzer" name="analyzer"
schema="schema/analyzer.exsd"/>
+ <extension-point id="commandProcessor" name="commandProcessor"
schema="schema/commandProcessor.exsd"/>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri = "http://www.jboss.org/tools/smooks/graphicalInformation"
+ class = "org.jboss.tools.smooks.graphical.GraphicalPackage"
+ genModel = "model/graphical.genmodel" />
+ </extension>
+ <extension
+ point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
+ <adapterFactoryDescription
+ class="org.eclipse.wst.xml.ui.internal.registry.AdapterFactoryProviderForXML">
+ <contentType id="org.eclipse.core.runtime.xml" />
+ <contentType id="org.jboss.tools.smooks.ui.smooks.contentType" />
+ </adapterFactoryDescription>
+ </extension>
+ <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+ <sourceViewerConfiguration
+ class="org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <contentOutlineConfiguration
+ class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <propertySheetConfiguration
+ class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <documentationTextHover
+
class="org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor"
+ target="org.eclipse.wst.xml.XML_DEFAULT">
+ </documentationTextHover>
+ <doubleClickStrategy
+
class="org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy"
+ target="org.eclipse.wst.xml.XML_DEFAULT">
+ </doubleClickStrategy>
+ <provisionalConfiguration
+ type="sourceeditingtexttools"
+ class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <provisionalConfiguration
+ type="characterpairmatcher"
+ class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <provisionalConfiguration
+ type="structuredtextfoldingprovider"
+ class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <provisionalConfiguration
+ type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
+ class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
+ target="org.eclipse.wst.xml.XML_DEFAULT" />
+ <provisionalConfiguration
+ type="autoeditstrategy"
+ class="org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML"
+ target="org.eclipse.wst.xml.XML_DEFAULT" />
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.xml.ui.preferences.xml.xml,
org.eclipse.wst.sse.ui.preferences.xml.source,
org.eclipse.wst.sse.ui.preferences.xml.templates,
org.eclipse.wst.sse.ui.preferences.xml.colors"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <provisionalDefinition
+ type="spellingregions"
+ value="XML_COMMENT_TEXT, XML_CONTENT, XML_DEFAULT"
+ target="org.eclipse.core.runtime.xml,
org.jboss.tools.smooks.ui.smooks.contentType" />
+ <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" />
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ name="Smooks Form Editor"
+ extensions="smooks"
+ icon="icons/smooks-sm.gif"
+ class="org.jboss.tools.smooks.ui.editors.SmooksFormEditor"
+ id="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
+ <contentTypeBinding
+ contentTypeId="org.eclipse.core.runtime.xml" />
+ <contentTypeBinding
+ contentTypeId="org.jboss.tools.smooks.ui.smooks.contentType" />
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views.properties.tabbed.propertySections">
+ <propertySections
+
contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
+ <propertySection
+ class="org.jboss.tools.smooks.ui.ConnectionPropertySection"
+ id="org.jboss.tools.smooks.ui.connection.propertyTab.Section"
+ tab="org.jboss.tools.smooks.ui.connection.propertyTab">
+ <input
+
type="org.jboss.tools.smooks.ui.gef.model.LineConnectionModel">
+ </input>
</propertySection>
- <propertySection
-
class="org.jboss.tools.smooks.javabean.ui.JavaBeanPropertiesSection"
-
filter="org.jboss.tools.smooks.javabean.ui.JavaBeanPropertiesSectonFilter"
- id="org.jboss.tools.smooks.ui.javabean.propertyTab.Section"
+ <propertySection
+
class="org.jboss.tools.smooks.javabean.ui.JavaBeanPropertiesSection"
+
filter="org.jboss.tools.smooks.javabean.ui.JavaBeanPropertiesSectonFilter"
+ id="org.jboss.tools.smooks.ui.javabean.propertyTab.Section"
tab="org.jboss.tools.smooks.ui.javabean.propertyTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.xml.ui.XMLPropertiesSection"
-
filter="org.jboss.tools.smooks.xml.ui.XMLPropertiesSectionFilter"
- id="org.jboss.tools.smooks.ui.xml.propertySection"
- tab="org.jboss.tools.smooks.ui.xml.propertyTab">
- </propertySection>
- </propertySections>
- </extension>
- <extension
-
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor"
-
typeMapper="org.jboss.tools.smooks.ui.SmooksGraphPropertyTypeMapper">
- <propertyCategory
- category="connection"></propertyCategory>
- </propertyContributor>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
-
contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
- <propertyTab
- category="connection"
- id="org.jboss.tools.smooks.ui.connection.propertyTab"
- label="Mapping Properties">
+ </propertySection>
+ <propertySection
+ class="org.jboss.tools.smooks.xml.ui.XMLPropertiesSection"
+
filter="org.jboss.tools.smooks.xml.ui.XMLPropertiesSectionFilter"
+ id="org.jboss.tools.smooks.ui.xml.propertySection"
+ tab="org.jboss.tools.smooks.ui.xml.propertyTab">
+ </propertySection>
+ </propertySections>
+ </extension>
+ <extension
+
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
+ <propertyContributor
+ contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor"
+
typeMapper="org.jboss.tools.smooks.ui.SmooksGraphPropertyTypeMapper">
+ <propertyCategory
+ category="connection"></propertyCategory>
+ </propertyContributor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
+ <propertyTabs
+
contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
+ <propertyTab
+ category="connection"
+ id="org.jboss.tools.smooks.ui.connection.propertyTab"
+ label="Mapping Properties">
</propertyTab>
<propertyTab
category="connection"
id="org.jboss.tools.smooks.ui.javabean.propertyTab"
label="JavaBean Properties">
- </propertyTab>
- <propertyTab
- category="connection"
- id="org.jboss.tools.smooks.ui.xml.propertyTab"
- label="XML Properties">
- </propertyTab>
- </propertyTabs>
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- id="org.jboss.tools.smooks.ui.wizards"
- name="Smooks">
- </category>
- <wizard
- category="org.jboss.tools.smooks.ui.wizards"
-
class="org.jboss.tools.smooks.ui.wizards.SmooksConfigFileNewWizard"
- icon="icons/sample.gif"
- id="org.jboss.tools.smooks.ui.wizards.SmooksConfigFileNewWizard"
- name="Smooks Configuration File">
- </wizard>
- </extension>
-
- <extension
- point="org.jboss.tools.smooks.ui.viewerInitor">
- <viewerInitor
-
contentProvider="org.jboss.tools.smooks.xml.ui.XMLStructuredDataContentProvider"
-
creationWizard="org.jboss.tools.smooks.xml.ui.XMLStructuredDataWizard"
- description="XML data type comes from any .xml file."
-
labelProvider="org.jboss.tools.smooks.xml.ui.XMLStructuredDataLabelProvider"
- name="XML"
- typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
- </viewerInitor>
- </extension>
- <extension
- point="org.jboss.tools.smooks.ui.analyzer">
- <mappingAnalyzer
- class="org.jboss.tools.smooks.xml2xml.XML2XMLAnalyzer"
- name="XML2XML Analyzer"
- typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
- <targetSourceType
- id="org.jboss.tools.smooks.xml.viewerInitor.xml"
- name="XML">
- </targetSourceType>
- </mappingAnalyzer>
- </extension>
- <extension
- point="org.jboss.tools.smooks.ui.viewerInitor">
- <viewerInitor
-
contentProvider="org.jboss.tools.smooks.javabean.model.BeanContentProvider"
-
creationWizard="org.jboss.tools.smooks.javabean.ui.NewJavaBeanStrucutredDataWizard"
- description="This data type can get from any Java .class."
-
labelProvider="org.jboss.tools.smooks.javabean.model.BeanlabelProvider"
- name="Java"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </viewerInitor>
- </extension>
- <extension
- point="org.jboss.tools.smooks.ui.analyzer">
- <mappingAnalyzer
- class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
- name="Java"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- <targetSourceType
- id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
- name="java2java">
- </targetSourceType>
- </mappingAnalyzer>
- <sourceModelAnalyzer
- class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
- level="0"
- name="Java"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </sourceModelAnalyzer>
- <targetModelAnalyzer
- class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
- level="0"
- name="Java"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </targetModelAnalyzer>
- </extension>
-
- <extension
- point="org.jboss.tools.smooks.ui.analyzer">
- <mappingAnalyzer
- class="org.jboss.tools.smooks.java2xml.analyzer.Java2XMLAnalyzer"
- name="Java"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- <targetSourceType
- id="org.jboss.tools.smooks.xml.viewerInitor.xml"
- name="XML">
- </targetSourceType>
- </mappingAnalyzer>
- </extension>
-
- <extension
- point="org.jboss.tools.smooks.ui.analyzer">
- <mappingAnalyzer
- class="org.jboss.tools.smooks.xml2java.analyzer.XML2JavaAnalyzer"
- name="XML2Java"
- typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
- <targetSourceType
- id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
- name="JavaBean">
- </targetSourceType>
- </mappingAnalyzer>
- <sourceModelAnalyzer
-
class="org.jboss.tools.smooks.xml2java.analyzer.XMLSourceModelAnalyzer"
- name="XML"
- typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
- </sourceModelAnalyzer>
- <targetModelAnalyzer
-
class="org.jboss.tools.smooks.xml2java.analyzer.XMLTargetModelAnalyzer"
- name="XML"
- typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
- </targetModelAnalyzer>
- </extension>
- <extension
- point="org.jboss.tools.smooks.ui.commandProcessor">
- <commandProcessor
-
class="org.jboss.tools.smooks.javabean.commandprocessor.JavaBeanModelCommandProcessor"
- sourceId="org.jboss.tools.smooks.ui.viewerInitor.javabean"
- targetId="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </commandProcessor>
- <commandProcessor
-
class="org.jboss.tools.smooks.javabean.commandprocessor.JavaBeanModelCommandProcessor"
- sourceId="org.jboss.tools.smooks.xml.viewerInitor.xml"
- targetId="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </commandProcessor>
- </extension>
-
- <extension
- point="org.eclipse.ui.startup">
- <startup
- class="org.jboss.tools.smooks.ui.SmooksListenerRegister">
- </startup>
- </extension>
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- base-type="org.eclipse.core.runtime.xml"
- file-extensions="smooks"
- id="org.jboss.tools.smooks.ui.smooks.contentType"
- name="Smooks Configuration File"
- priority="normal">
- </content-type>
- </extension>
- <extension
- point="org.eclipse.ui.decorators">
- <decorator
- adaptable="false"
-
class="org.jboss.tools.smooks.xml.ui.XMLStructuredDataLabelDecorator"
- id="org.jboss.tools.smooks.ui.xml.decorator"
- label="Smooks XML Data Viewer Decorator"
- lightweight="false"
- objectClass="org.jboss.tools.smooks.xml.model.TagObject"
- state="true">
- </decorator>
- </extension>
-</plugin>
+ </propertyTab>
+ <propertyTab
+ category="connection"
+ id="org.jboss.tools.smooks.ui.xml.propertyTab"
+ label="XML Properties">
+ </propertyTab>
+ </propertyTabs>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.jboss.tools.smooks.ui.wizards"
+ name="Smooks">
+ </category>
+ <wizard
+ category="org.jboss.tools.smooks.ui.wizards"
+
class="org.jboss.tools.smooks.ui.wizards.SmooksConfigFileNewWizard"
+ icon="icons/smooks-sm.gif"
+ id="org.jboss.tools.smooks.ui.wizards.SmooksConfigFileNewWizard"
+ name="Smooks Configuration File">
+ </wizard>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.viewerInitor">
+ <viewerInitor
+
contentProvider="org.jboss.tools.smooks.xml.ui.XMLStructuredDataContentProvider"
+
creationWizard="org.jboss.tools.smooks.xml.ui.XMLStructuredDataWizard"
+ description="XML data type comes from any .xml file."
+
labelProvider="org.jboss.tools.smooks.xml.ui.XMLStructuredDataLabelProvider"
+ name="XML"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </viewerInitor>
+ </extension>
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.xml2xml.XML2XMLAnalyzer"
+ name="XML2XML Analyzer"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
+ </extension>
+ <extension
+ point="org.jboss.tools.smooks.ui.viewerInitor">
+ <viewerInitor
+
contentProvider="org.jboss.tools.smooks.javabean.model.BeanContentProvider"
+
creationWizard="org.jboss.tools.smooks.javabean.ui.NewJavaBeanStrucutredDataWizard"
+ description="This data type can get from any Java .class."
+
labelProvider="org.jboss.tools.smooks.javabean.model.BeanlabelProvider"
+ name="Java"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </viewerInitor>
+ </extension>
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
+ name="Java"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ <targetSourceType
+ id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
+ name="java2java">
+ </targetSourceType>
+ </mappingAnalyzer>
+ <sourceModelAnalyzer
+ class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
+ level="0"
+ name="Java"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </sourceModelAnalyzer>
+ <targetModelAnalyzer
+ class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
+ level="0"
+ name="Java"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </targetModelAnalyzer>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.java2xml.analyzer.Java2XMLAnalyzer"
+ name="Java"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XML2JavaAnalyzer"
+ name="XML2Java"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ <targetSourceType
+ id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
+ name="JavaBean">
+ </targetSourceType>
+ </mappingAnalyzer>
+ <sourceModelAnalyzer
+
class="org.jboss.tools.smooks.xml2java.analyzer.XMLSourceModelAnalyzer"
+ name="XML"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </sourceModelAnalyzer>
+ <targetModelAnalyzer
+
class="org.jboss.tools.smooks.xml2java.analyzer.XMLTargetModelAnalyzer"
+ name="XML"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </targetModelAnalyzer>
+ </extension>
+ <extension
+ point="org.jboss.tools.smooks.ui.commandProcessor">
+ <commandProcessor
+
class="org.jboss.tools.smooks.javabean.commandprocessor.JavaBeanModelCommandProcessor"
+ sourceId="org.jboss.tools.smooks.ui.viewerInitor.javabean"
+ targetId="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </commandProcessor>
+ <commandProcessor
+
class="org.jboss.tools.smooks.javabean.commandprocessor.JavaBeanModelCommandProcessor"
+ sourceId="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ targetId="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </commandProcessor>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.jboss.tools.smooks.ui.SmooksListenerRegister">
+ </startup>
+ </extension>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ base-type="org.eclipse.core.runtime.xml"
+ file-extensions="smooks"
+ id="org.jboss.tools.smooks.ui.smooks.contentType"
+ name="Smooks Configuration File"
+ priority="normal">
+ </content-type>
+ </extension>
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ adaptable="false"
+
class="org.jboss.tools.smooks.xml.ui.XMLStructuredDataLabelDecorator"
+ id="org.jboss.tools.smooks.ui.xml.decorator"
+ label="Smooks XML Data Viewer Decorator"
+ lightweight="false"
+ objectClass="org.jboss.tools.smooks.xml.model.TagObject"
+ state="true">
+ </decorator>
+ </extension>
+</plugin>
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-11-20
02:03:22 UTC (rev 11894)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-11-20
03:23:32 UTC (rev 11895)
@@ -1,321 +1,320 @@
-package org.jboss.tools.smooks.ui.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-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.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-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.jboss.tools.common.model.ui.ModelUIImages;
-import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
-import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
-import org.jboss.tools.smooks.ui.editors.SmooksFileEditorInput;
-import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
-import org.jboss.tools.smooks.ui.editors.TypeIDSelectionWizardPage;
-
-/**
- * This is a sample new wizard. Its role is to create a new file resource in the
- * provided container. If the container resource (a folder or a project) is
- * selected in the workspace when the wizard is opened, it will accept it as the
- * target container. The wizard creates one file with the extension "smooks".
If
- * a sample multi-page editor (also available as a template) is registered for
- * the same extension, it will be able to open it.
- */
-
-public class SmooksConfigFileNewWizard extends Wizard implements INewWizard,
- ISmooksDataCreationAddtionWizard {
- public static final String PRO_SOURCE_DATA_PATH = "sourceDataPath";
//$NON-NLS-1$
-
- public static final String PRO_TARGET_DATA_PATH = "targetDataPath";
//$NON-NLS-1$
-
- private SmooksConfigFileNewWizardPage page;
- private TypeIDSelectionWizardPage typeIDPage;
-
- private List<IWizardPage> sourceCreationPages = new
ArrayList<IWizardPage>();
-
- private List<IWizardPage> targetCreationPages = new
ArrayList<IWizardPage>();
-
- private IStructuredSelection selection;
-
- private IWorkbench workbench;
-
- /**
- * Constructor for SmooksConfigFileNewWizard.
- */
- public SmooksConfigFileNewWizard() {
- super();
- setNeedsProgressMonitor(true);
- super.setWindowTitle(Messages.getString("SmooksConfigFileNewWizard.NewConfigFileWizardTitle"));
//$NON-NLS-1$
- setDefaultPageImageDescriptor(ModelUIImages
- .getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
- }
-
- /**
- * Adding the page to the wizard.
- */
- public void addPages() {
- page = new SmooksConfigFileNewWizardPage("newSmooksFile1", //$NON-NLS-1$
- getSelection());
- addPage(page);
- // TODO don't use the WizardSelectionPage
- typeIDPage = new TypeIDSelectionWizardPage("", false); //$NON-NLS-1$
- typeIDPage.setSelection(selection);
- addPage(typeIDPage);
- }
-
- /**
- * This method is called when 'Finish' button is pressed in the wizard. We
- * will create an operation and run it using wizard as execution context.
- */
- public boolean performFinish() {
- // final String containerName = page.getContainerName();
- // final String fileName = page.getFileName();
- final IFile file = page.createNewFile();
- IRunnableWithProgress op = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException {
- try {
- doFinish(file, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- };
- try {
- getContainer().run(true, false, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- Throwable realException = e.getTargetException();
- MessageDialog.openError(getShell(),
Messages.getString("SmooksConfigFileNewWizard.ErrorTitle"), realException
//$NON-NLS-1$
- .getMessage());
- return false;
- }
- return true;
- }
-
- /**
- * The worker method. It will find the container, create the file if missing
- * or just replace its contents, and open the editor on the newly created
- * file.
- */
-
- private void doFinish(final IFile file, IProgressMonitor monitor)
- throws CoreException {
- // create a sample file
- final String sourceTypeID = typeIDPage.getSourceID();
- final String targetTypeID = typeIDPage.getTargetID();
- final String[] sourceDataPath = new String[] { null };
- final String[] targetDataPath = new String[] { null };
- try {
- InputStream stream = openContentStream();
- if (file.exists()) {
- file.setContents(stream, true, true, monitor);
- } else {
- file.create(stream, true, monitor);
- }
- stream.close();
- } catch (IOException e) {
- // ignore
- }
- final GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
- file);
-
- monitor.worked(1);
- monitor.setTaskName("Opening file for editing..."); //$NON-NLS-1$
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchPage page = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- try {
- SmooksFileEditorInput input = new SmooksFileEditorInput(
- file);
- IWizard sourceWizard = typeIDPage
- .getSourceDataCreationWizard();
- IWizard targetWizard = typeIDPage
- .getTargetDataCreationWizard();
- if (sourceWizard != null) {
- sourceWizard.performFinish();
- }
- if (targetWizard != null) {
- targetWizard.performFinish();
- }
- if (sourceWizard instanceof IStructuredDataCreationWizard) {
- Object sourceObj = ((IStructuredDataCreationWizard) sourceWizard)
- .getTreeViewerInputContents();
- sourceDataPath[0] = ((IStructuredDataCreationWizard) sourceWizard)
- .getStructuredDataSourcePath();
- input.setSourceTreeViewerInputContents(sourceObj);
- }
-
- if (targetWizard instanceof IStructuredDataCreationWizard) {
- Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
- .getTreeViewerInputContents();
- targetDataPath[0] = ((IStructuredDataCreationWizard) targetWizard)
- .getStructuredDataSourcePath();
- input.setTargetTreeViewerInputContents(targetObj);
-
- }
- Properties properties = null;
- if (sourceDataPath[0] != null || targetDataPath[0] != null) {
- properties = new Properties();
- if (sourceDataPath[0] != null) {
- properties.setProperty(PRO_SOURCE_DATA_PATH, sourceDataPath[0]);
- }
- if (targetDataPath[0] != null) {
- properties.setProperty(PRO_TARGET_DATA_PATH, targetDataPath[0]);
- }
- }
- try {
- ginforSave.doSave(null, sourceTypeID, targetTypeID, properties);
- } catch (IOException e) {
- } catch (CoreException e) {
- }
- IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
- true);// openEditor(page, file, true);
- } catch (PartInitException e) {
- }
- }
- });
-
- monitor.worked(1);
- }
-
- /**
- * We will initialize file contents with a sample text.
- */
-
- private InputStream openContentStream() {
- String contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
- + " <smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.0.xsd\"/>"; //$NON-NLS-1$
- return new ByteArrayInputStream(contents.getBytes());
- }
-
- private void throwCoreException(String message) throws CoreException {
- IStatus status = new Status(IStatus.ERROR, "org.jboss.tools.smooks.ui",
//$NON-NLS-1$
- IStatus.OK, message, null);
- throw new CoreException(status);
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- }
-
- public IStructuredSelection getSelection() {
- return selection;
- }
-
- public void setSelection(IStructuredSelection selection) {
- this.selection = selection;
- }
-
- public void addSourceWizardPage(IWizardPage page) {
- sourceCreationPages.add(page);
- page.setTitle(Messages.getString("SmooksConfigFileNewWizard.SourceDataTypeSelectionTitle"));
//$NON-NLS-1$
- }
-
- public void addTargetWizardPage(IWizardPage page) {
- targetCreationPages.add(page);
- page.setTitle(Messages.getString("SmooksConfigFileNewWizard.TargetDataTypeSelectionTitle"));
//$NON-NLS-1$
- }
-
- public void clearSourceWizardPages() {
- // for (Iterator iterator = sourceCreationPages.iterator();
- // iterator.hasNext();) {
- // IWizardPage page = (IWizardPage) iterator.next();
- // if(page != null){
- // page.dispose();
- // }
- // }
- sourceCreationPages.clear();
- }
-
- private IWizardPage getSourceCreationPage(IWizardPage page) {
- if (page == typeIDPage) {
- if (sourceCreationPages.isEmpty())
- return null;
- return (IWizardPage) sourceCreationPages.get(0);
- }
- if (sourceCreationPages.contains(page)) {
- int i = sourceCreationPages.indexOf(page);
- if ((i + 1) >= sourceCreationPages.size()) {
- return null;
- }
- return (IWizardPage) sourceCreationPages.get(i + 1);
- }
- return null;
- }
-
- private IWizardPage getTargetCreationPage(IWizardPage page) {
- if (page == typeIDPage) {
- if (targetCreationPages.isEmpty())
- return null;
- return (IWizardPage) targetCreationPages.get(0);
- }
- if (targetCreationPages.contains(page)) {
- int i = targetCreationPages.indexOf(page);
- if ((i + 1) >= targetCreationPages.size()) {
- return null;
- }
- return (IWizardPage) targetCreationPages.get(i + 1);
- }
- if (sourceCreationPages.contains(page)) {
- if (sourceCreationPages.get(sourceCreationPages.size() - 1) == page) {
- return (IWizardPage) targetCreationPages.get(0);
- }
- }
- return null;
- }
-
- @Override
- public IWizardPage getNextPage(IWizardPage page) {
- IWizardPage p = getSourceCreationPage(page);
- if (p != null)
- return p;
- p = getTargetCreationPage(page);
- if (p != null)
- return p;
- return super.getNextPage(page);
- }
-
- public void clearTargetWizardPages() {
- // for (Iterator iterator = sourceCreationPages.iterator();
- // iterator.hasNext();) {
- // IWizardPage page = (IWizardPage) iterator.next();
- // if(page != null){
- // page.dispose();
- // }
- // }
- targetCreationPages.clear();
- }
-
- public void removeSourceWIzardPage(IWizardPage page) {
- sourceCreationPages.remove(page);
- }
-
- public void removeTargetWIzardPage(IWizardPage page) {
- targetCreationPages.remove(page);
- }
+package org.jboss.tools.smooks.ui.wizards;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+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.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+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.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
+import org.jboss.tools.smooks.ui.SmooksUIActivator;
+import org.jboss.tools.smooks.ui.editors.SmooksFileEditorInput;
+import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
+import org.jboss.tools.smooks.ui.editors.TypeIDSelectionWizardPage;
+
+/**
+ * This is a sample new wizard. Its role is to create a new file resource in the
+ * provided container. If the container resource (a folder or a project) is
+ * selected in the workspace when the wizard is opened, it will accept it as the
+ * target container. The wizard creates one file with the extension "smooks".
If
+ * a sample multi-page editor (also available as a template) is registered for
+ * the same extension, it will be able to open it.
+ */
+
+public class SmooksConfigFileNewWizard extends Wizard implements INewWizard,
+ ISmooksDataCreationAddtionWizard {
+ public static final String PRO_SOURCE_DATA_PATH = "sourceDataPath";
//$NON-NLS-1$
+
+ public static final String PRO_TARGET_DATA_PATH = "targetDataPath";
//$NON-NLS-1$
+
+ private SmooksConfigFileNewWizardPage page;
+ private TypeIDSelectionWizardPage typeIDPage;
+
+ private List<IWizardPage> sourceCreationPages = new
ArrayList<IWizardPage>();
+
+ private List<IWizardPage> targetCreationPages = new
ArrayList<IWizardPage>();
+
+ private IStructuredSelection selection;
+
+ private IWorkbench workbench;
+
+ /**
+ * Constructor for SmooksConfigFileNewWizard.
+ */
+ public SmooksConfigFileNewWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ super.setWindowTitle(Messages.getString("SmooksConfigFileNewWizard.NewConfigFileWizardTitle"));
//$NON-NLS-1$
+ setDefaultPageImageDescriptor(SmooksUIActivator.getImageDescriptor("icons/smooks-wiz.gif"));
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+ public void addPages() {
+ page = new SmooksConfigFileNewWizardPage("newSmooksFile1", //$NON-NLS-1$
+ getSelection());
+ addPage(page);
+ // TODO don't use the WizardSelectionPage
+ typeIDPage = new TypeIDSelectionWizardPage("", false); //$NON-NLS-1$
+ typeIDPage.setSelection(selection);
+ addPage(typeIDPage);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We
+ * will create an operation and run it using wizard as execution context.
+ */
+ public boolean performFinish() {
+ // final String containerName = page.getContainerName();
+ // final String fileName = page.getFileName();
+ final IFile file = page.createNewFile();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ try {
+ doFinish(file, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(),
Messages.getString("SmooksConfigFileNewWizard.ErrorTitle"), realException
//$NON-NLS-1$
+ .getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the file if missing
+ * or just replace its contents, and open the editor on the newly created
+ * file.
+ */
+
+ private void doFinish(final IFile file, IProgressMonitor monitor)
+ throws CoreException {
+ // create a sample file
+ final String sourceTypeID = typeIDPage.getSourceID();
+ final String targetTypeID = typeIDPage.getTargetID();
+ final String[] sourceDataPath = new String[] { null };
+ final String[] targetDataPath = new String[] { null };
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ } else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ final GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
+ file);
+
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing..."); //$NON-NLS-1$
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ try {
+ SmooksFileEditorInput input = new SmooksFileEditorInput(
+ file);
+ IWizard sourceWizard = typeIDPage
+ .getSourceDataCreationWizard();
+ IWizard targetWizard = typeIDPage
+ .getTargetDataCreationWizard();
+ if (sourceWizard != null) {
+ sourceWizard.performFinish();
+ }
+ if (targetWizard != null) {
+ targetWizard.performFinish();
+ }
+ if (sourceWizard instanceof IStructuredDataCreationWizard) {
+ Object sourceObj = ((IStructuredDataCreationWizard) sourceWizard)
+ .getTreeViewerInputContents();
+ sourceDataPath[0] = ((IStructuredDataCreationWizard) sourceWizard)
+ .getStructuredDataSourcePath();
+ input.setSourceTreeViewerInputContents(sourceObj);
+ }
+
+ if (targetWizard instanceof IStructuredDataCreationWizard) {
+ Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
+ .getTreeViewerInputContents();
+ targetDataPath[0] = ((IStructuredDataCreationWizard) targetWizard)
+ .getStructuredDataSourcePath();
+ input.setTargetTreeViewerInputContents(targetObj);
+
+ }
+ Properties properties = null;
+ if (sourceDataPath[0] != null || targetDataPath[0] != null) {
+ properties = new Properties();
+ if (sourceDataPath[0] != null) {
+ properties.setProperty(PRO_SOURCE_DATA_PATH, sourceDataPath[0]);
+ }
+ if (targetDataPath[0] != null) {
+ properties.setProperty(PRO_TARGET_DATA_PATH, targetDataPath[0]);
+ }
+ }
+ try {
+ ginforSave.doSave(null, sourceTypeID, targetTypeID, properties);
+ } catch (IOException e) {
+ } catch (CoreException e) {
+ }
+ IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
+ true);// openEditor(page, file, true);
+ } catch (PartInitException e) {
+ }
+ }
+ });
+
+ monitor.worked(1);
+ }
+
+ /**
+ * We will initialize file contents with a sample text.
+ */
+
+ private InputStream openContentStream() {
+ String contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
+ + " <smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.0.xsd\"/>"; //$NON-NLS-1$
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status = new Status(IStatus.ERROR, "org.jboss.tools.smooks.ui",
//$NON-NLS-1$
+ IStatus.OK, message, null);
+ throw new CoreException(status);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ }
+
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ public void addSourceWizardPage(IWizardPage page) {
+ sourceCreationPages.add(page);
+ page.setTitle(Messages.getString("SmooksConfigFileNewWizard.SourceDataTypeSelectionTitle"));
//$NON-NLS-1$
+ }
+
+ public void addTargetWizardPage(IWizardPage page) {
+ targetCreationPages.add(page);
+ page.setTitle(Messages.getString("SmooksConfigFileNewWizard.TargetDataTypeSelectionTitle"));
//$NON-NLS-1$
+ }
+
+ public void clearSourceWizardPages() {
+ // for (Iterator iterator = sourceCreationPages.iterator();
+ // iterator.hasNext();) {
+ // IWizardPage page = (IWizardPage) iterator.next();
+ // if(page != null){
+ // page.dispose();
+ // }
+ // }
+ sourceCreationPages.clear();
+ }
+
+ private IWizardPage getSourceCreationPage(IWizardPage page) {
+ if (page == typeIDPage) {
+ if (sourceCreationPages.isEmpty())
+ return null;
+ return (IWizardPage) sourceCreationPages.get(0);
+ }
+ if (sourceCreationPages.contains(page)) {
+ int i = sourceCreationPages.indexOf(page);
+ if ((i + 1) >= sourceCreationPages.size()) {
+ return null;
+ }
+ return (IWizardPage) sourceCreationPages.get(i + 1);
+ }
+ return null;
+ }
+
+ private IWizardPage getTargetCreationPage(IWizardPage page) {
+ if (page == typeIDPage) {
+ if (targetCreationPages.isEmpty())
+ return null;
+ return (IWizardPage) targetCreationPages.get(0);
+ }
+ if (targetCreationPages.contains(page)) {
+ int i = targetCreationPages.indexOf(page);
+ if ((i + 1) >= targetCreationPages.size()) {
+ return null;
+ }
+ return (IWizardPage) targetCreationPages.get(i + 1);
+ }
+ if (sourceCreationPages.contains(page)) {
+ if (sourceCreationPages.get(sourceCreationPages.size() - 1) == page) {
+ return (IWizardPage) targetCreationPages.get(0);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ IWizardPage p = getSourceCreationPage(page);
+ if (p != null)
+ return p;
+ p = getTargetCreationPage(page);
+ if (p != null)
+ return p;
+ return super.getNextPage(page);
+ }
+
+ public void clearTargetWizardPages() {
+ // for (Iterator iterator = sourceCreationPages.iterator();
+ // iterator.hasNext();) {
+ // IWizardPage page = (IWizardPage) iterator.next();
+ // if(page != null){
+ // page.dispose();
+ // }
+ // }
+ targetCreationPages.clear();
+ }
+
+ public void removeSourceWIzardPage(IWizardPage page) {
+ sourceCreationPages.remove(page);
+ }
+
+ public void removeTargetWIzardPage(IWizardPage page) {
+ targetCreationPages.remove(page);
+ }
}
\ No newline at end of file