Author: DartPeng
Date: 2008-10-21 05:15:01 -0400 (Tue, 21 Oct 2008)
New Revision: 11033
Added:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/esb16.png
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/NewResourceConfigWizardPage.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizardPage.java
Log:
JBIDE-2846
Thanks John for helping me modify that :)
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-21
09:15:01 UTC (rev 11033)
@@ -20,8 +20,9 @@
org.eclipse.emf,
org.eclipse.emf.edit,
org.eclipse.emf.edit.ui,
- org.eclipse.xsd.edit;bundle-version="2.4.0",
- org.jboss.tools.smooks.core
+ org.eclipse.xsd.edit,
+ org.jboss.tools.smooks.core,
+ org.jboss.tools.common.model.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .,
Added:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/esb16.png
===================================================================
(Binary files differ)
Property changes on:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/esb16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license
(rev 0)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license 2008-10-21
09:15:01 UTC (rev 11033)
@@ -0,0 +1,13 @@
+BSD style license
+
+Redistribution and use of this software and associated documentation
("Software"), with or without modification, are permitted provided that the
following conditions are met:
+
+ 1. Redistributions of source code must retain copyright statements and notices.
Redistributions must also contain a copy of this document.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
+ 3. The name "DOM4J" must not be used to endorse or promote products derived
from this Software without prior written permission of MetaStuff, Ltd. For written
permission, please contact dom4j-info(a)metastuff.com.
+ 4. Products derived from this Software may not be called "DOM4J" nor may
"DOM4J" appear in their names without prior written permission of MetaStuff,
Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
+ 5. Due credit should be given to the DOM4J Project -
http://www.dom4j.org
+
+THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
\ No newline at end of file
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-21
09:15:01 UTC (rev 11033)
@@ -1,161 +1,161 @@
-<?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="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.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">
- </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>
- </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>
- </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 Data Type"
- 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="JavaBean Data Type"
- 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="JavaBean Analyzer"
- 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="JavaBean SourceModel Analyzer"
- typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
- </sourceModelAnalyzer>
- <targetModelAnalyzer
- class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
- level="0"
- name="JavaBean TargetModel Analyzer"
- 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 Bean"
- 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>
- </extension>
-</plugin>
+<?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="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.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">
+ </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>
+ </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>
+ </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/full/obj16/esb16.png"
+ 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 Data Type"
+ 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="JavaBean Data Type"
+ 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="JavaBean Analyzer"
+ 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="JavaBean SourceModel Analyzer"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ </sourceModelAnalyzer>
+ <targetModelAnalyzer
+ class="org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer"
+ level="0"
+ name="JavaBean TargetModel Analyzer"
+ 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 Bean"
+ 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>
+ </extension>
+</plugin>
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-21
09:15:01 UTC (rev 11033)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
@@ -31,6 +32,7 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -103,11 +105,13 @@
public TypeIDSelectionWizardPage(String pageName, boolean showDataSelectPage) {
super(pageName);
this.showDataSelectPage = showDataSelectPage;
+ setTitle("Select Source/Target Data Type");
+ setDescription("Select the data type for source/target data");
}
@Override
public boolean canFlipToNextPage() {
- if (this.getSourceID() != null || getTargetID() != null) {
+ if (this.getSourceID() != null && getTargetID() != null) {
return true;
}
return false;
@@ -207,12 +211,26 @@
Label tl = new Label(mainComposite, SWT.NONE);
tl.setText("Target Data Type ID List : ");
-
- source = createTableViewer(mainComposite);
+
+ Composite sourceBorder = new Composite(mainComposite,SWT.NONE);
+ sourceBorder.setBackground(ColorConstants.black);
+ FillLayout sbLayout = new FillLayout();
+ sbLayout.marginHeight = 1;
+ sbLayout.marginWidth = 1;
+ sourceBorder.setLayout(sbLayout);
+ source = createTableViewer(sourceBorder);
GridData gd = new GridData(GridData.FILL_BOTH);
- source.getTable().setLayoutData(gd);
- target = createTableViewer(mainComposite);
- target.getTable().setLayoutData(gd);
+ sourceBorder.setLayoutData(gd);
+
+
+ Composite targetBorder = new Composite(mainComposite,SWT.NONE);
+ targetBorder.setBackground(ColorConstants.black);
+ FillLayout tbLayout = new FillLayout();
+ tbLayout.marginHeight = 1;
+ tbLayout.marginWidth = 1;
+ targetBorder.setLayout(tbLayout);
+ target = createTableViewer(targetBorder);
+ targetBorder.setLayoutData(gd);
source.setInput(sourceList);
target.setInput(sourceList);
@@ -299,17 +317,19 @@
protected void openSourceWizard() {
sourceTreeViewerInputContents = getReturnObjectFromWizard(getSourceID());
- resetLinkText();
+// resetLinkText();
}
-
+/**
+ * @deprecated
+ */
private void resetLinkText() {
- if (sourceTreeViewerInputContents != null) {
- sourceDataLink.setText("Source Model Select");
- }
-
- if (targetTreeViewerInputContents != null) {
- targetDataLink.setText("Target Model Select");
- }
+ // if (sourceTreeViewerInputContents != null) {
+ // sourceDataLink.setText("Source Model Select");
+ // }
+ //
+ // if (targetTreeViewerInputContents != null) {
+ // targetDataLink.setText("Target Model Select");
+ // }
}
protected String getDataTypeID(CheckboxTableViewer viewer) {
@@ -407,7 +427,7 @@
});
TableColumn nameColumn = new TableColumn(viewer.getTable(), SWT.NONE);
- nameColumn.setWidth(100);
+ nameColumn.setWidth(250);
nameColumn.setText("Name");
viewer.setContentProvider(new TypeIDContentProvider());
viewer.setLabelProvider(new TypeIDLabelProvider());
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/NewResourceConfigWizardPage.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/NewResourceConfigWizardPage.java 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/NewResourceConfigWizardPage.java 2008-10-21
09:15:01 UTC (rev 11033)
@@ -34,14 +34,17 @@
private NewResourceConfigKey selectedKey = null;
+
public NewResourceConfigWizardPage(String pageName, String title,
ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- // TODO Auto-generated constructor stub
+ super(pageName, "Select New ResourceConfig Type", titleImage);
+ setDescription("Select the ResourceConfig type to add into the config
file");
}
public NewResourceConfigWizardPage(String pageName) {
super(pageName);
+ setTitle("Select New ResourceConfig Type");
+ setDescription("Select the ResourceConfig type to add into the config
file");
}
/* (non-Javadoc)
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-21
09:15:01 UTC (rev 11033)
@@ -1,301 +1,304 @@
-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 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.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 {
- 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);
- }
-
- /**
- * Adding the page to the wizard.
- */
- public void addPages() {
- page = new SmooksConfigFileNewWizardPage("newSmooksFile1",
- getSelection());
- addPage(page);
- // TODO don't use the WizardSelectionPage
- typeIDPage = new TypeIDSelectionWizardPage("", false);
- 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(), "Error", realException
- .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
- String sourceTypeID = typeIDPage.getSourceID();
- String targetTypeID = typeIDPage.getTargetID();
-
- try {
- InputStream stream = openContentStream();
- if (file.exists()) {
- file.setContents(stream, true, true, monitor);
- } else {
- file.create(stream, true, monitor);
- }
- stream.close();
- GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
- file);
- ginforSave.doSave(monitor, sourceTypeID, targetTypeID);
- } catch (IOException e) {
- }
- monitor.worked(1);
- monitor.setTaskName("Opening file for editing...");
- 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();
-// if (sourceObj instanceof List) {
-// if (!((List) sourceObj).isEmpty()) {
-// sourceObj = ((List) sourceObj).get(0);
-// }
-// }
- input.setSourceTreeViewerInputContents(sourceObj);
- }
-
- if (targetWizard instanceof IStructuredDataCreationWizard) {
- Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
- .getTreeViewerInputContents();
-// if (targetObj instanceof List) {
-// if (!((List) targetObj).isEmpty()) {
-// targetObj = ((List) targetObj).get(0);
-// }
-// }
- input.setTargetTreeViewerInputContents(targetObj);
-
- }
-
- 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"
- + " <smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.0.xsd\"/>";
- return new ByteArrayInputStream(contents.getBytes());
- }
-
- private void throwCoreException(String message) throws CoreException {
- IStatus status = new Status(IStatus.ERROR, "org.jboss.tools.smooks.ui",
- 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("Source Data Selection Page");
- }
-
- public void addTargetWizardPage(IWizardPage page) {
- targetCreationPages.add(page);
- page.setTitle("Target Data Selection Page");
- }
-
- 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 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 {
+ 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("New Smooks Configuration File");
+ setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+ public void addPages() {
+ page = new SmooksConfigFileNewWizardPage("newSmooksFile1",
+ getSelection());
+ addPage(page);
+ // TODO don't use the WizardSelectionPage
+ typeIDPage = new TypeIDSelectionWizardPage("", false);
+ 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(), "Error", realException
+ .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
+ String sourceTypeID = typeIDPage.getSourceID();
+ String targetTypeID = typeIDPage.getTargetID();
+
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ } else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
+ file);
+ ginforSave.doSave(monitor, sourceTypeID, targetTypeID);
+ } catch (IOException e) {
+ }
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing...");
+ 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();
+// if (sourceObj instanceof List) {
+// if (!((List) sourceObj).isEmpty()) {
+// sourceObj = ((List) sourceObj).get(0);
+// }
+// }
+ input.setSourceTreeViewerInputContents(sourceObj);
+ }
+
+ if (targetWizard instanceof IStructuredDataCreationWizard) {
+ Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
+ .getTreeViewerInputContents();
+// if (targetObj instanceof List) {
+// if (!((List) targetObj).isEmpty()) {
+// targetObj = ((List) targetObj).get(0);
+// }
+// }
+ input.setTargetTreeViewerInputContents(targetObj);
+
+ }
+
+ 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"
+ + " <smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.0.xsd\"/>";
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status = new Status(IStatus.ERROR, "org.jboss.tools.smooks.ui",
+ 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("Source Data Selection");
+ }
+
+ public void addTargetWizardPage(IWizardPage page) {
+ targetCreationPages.add(page);
+ page.setTitle("Target Data Selection");
+ }
+
+ 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
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizardPage.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizardPage.java 2008-10-21
08:50:25 UTC (rev 11032)
+++
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizardPage.java 2008-10-21
09:15:01 UTC (rev 11033)
@@ -1,37 +1,40 @@
-package org.jboss.tools.smooks.ui.wizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- *
- * @author dart
- *
- */
-public class SmooksConfigFileNewWizardPage extends WizardNewFileCreationPage {
- public SmooksConfigFileNewWizardPage(String pageName,
- IStructuredSelection selection) {
- super(pageName, selection);
- setFileExtension("smooks");
- }
-
- @Override
- protected boolean validatePage() {
- boolean flag = super.validatePage();
- String name = this.getFileName();
- if (name.indexOf(".") == -1)
- return flag;
- String extensionName = name.substring(name.indexOf(".") + 1, name
- .length());
- String error = null;
- if (extensionName.equalsIgnoreCase(this.getFileExtension())) {
-
- } else {
- error = "file extension must be \"smooks\"";
- }
- if (error != null) {
- this.setErrorMessage(error);
- }
- return (error == null);
- }
+package org.jboss.tools.smooks.ui.wizards;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+/**
+ *
+ * @author dart
+ *
+ */
+public class SmooksConfigFileNewWizardPage extends WizardNewFileCreationPage {
+ public SmooksConfigFileNewWizardPage(String pageName,
+ IStructuredSelection selection) {
+ super(pageName, selection);
+ setFileExtension("smooks");
+ super.setTitle("Smooks Configuration");
+ super.setDescription("Create a new Smooks configuration file");
+ this.setFileName("newConfig.smooks");
+ }
+
+ @Override
+ protected boolean validatePage() {
+ boolean flag = super.validatePage();
+ String name = this.getFileName();
+ if (name.indexOf(".") == -1)
+ return flag;
+ String extensionName = name.substring(name.indexOf(".") + 1, name
+ .length());
+ String error = null;
+ if (extensionName.equalsIgnoreCase(this.getFileExtension())) {
+
+ } else {
+ error = "file extension must be \"smooks\"";
+ }
+ if (error != null) {
+ this.setErrorMessage(error);
+ }
+ return (error == null);
+ }
}
\ No newline at end of file