Author: DartPeng
Date: 2009-11-28 04:12:26 -0500 (Sat, 28 Nov 2009)
New Revision: 18899
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigFileHandle.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigfileContentDescriber.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationOverviewPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationResourceConfigPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10MultiFormEditor.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessType.java
Log:
JBIDE-5157
Record comment string for EObject , when save EObject , insert the comment string into the
result contents.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-11-28 08:59:12 UTC (rev
18898)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-11-28 09:12:26 UTC (rev
18899)
@@ -23,16 +23,7 @@
contentTypeId="org.jboss.tools.smooks.ui.edimap.contentType">
</contentTypeBinding>
</editor>
- <editor
-
class="org.jboss.tools.smooks.configuration.editors_10.Smooks10MultiFormEditor"
-
contributorClass="org.jboss.tools.smooks.configuration.editors.SmooksActionBarContributor"
- icon="icons/smooks-sm.gif"
-
id="org.jboss.tools.smooks.configuration.editors.MultiPageEditor_1_0"
- name="Smooks Configuration Editor">
- <contentTypeBinding
-
contentTypeId="org.jboss.tools.smooks.ui.smooks1_0.contentType">
- </contentTypeBinding>
- </editor>
+
</extension>
<extension
point="org.eclipse.ui.newWizards">
@@ -74,14 +65,7 @@
name="EDI Map File"
priority="low">
</content-type>
- <content-type
- base-type="org.eclipse.core.runtime.xml"
-
describer="org.jboss.tools.smooks.configuration.editors_10.Smooks10ConfigfileContentDescriber"
- file-extensions="xml"
- id="org.jboss.tools.smooks.ui.smooks1_0.contentType"
- name="Smooks Configuration File"
- priority="low">
- </content-type>
+
</extension>
<extension
point="org.eclipse.ui.startup">
@@ -113,9 +97,6 @@
name="org.eclipse.emf.ecore.util.FeatureMap$Entry">
</objectClass>
<objectClass
-
name="org.jboss.tools.smooks10.model.smooks.AbstractType">
- </objectClass>
- <objectClass
name="org.eclipse.emf.ecore.EObject">
</objectClass>
</or>
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -22,13 +22,10 @@
public static final String SMOOKS_EXTENTION_NAME_WITHDOT = "." +
SMOOKS_EXTENTION_NAME;
public static final String SMOOKS_GRAPHICSEXT_EXTENTION_NAME_WITHDOT = "." +
SMOOKS_GRAPHICSEXT_EXTENTION_NAME;
-
- public static final String VERSION_1_0 = "1.0";
-
public static final String VERSION_1_1 = "1.1";
public static final String VERSION_1_2 = "1.2";
- public static final String[] SMOOKS_VERSIONS = new
String[]{VERSION_1_0,VERSION_1_1,VERSION_1_2};
+ public static final String[] SMOOKS_VERSIONS = new String[]{VERSION_1_1,VERSION_1_2};
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -86,7 +86,7 @@
/**
* This is the action bar contributor for the Smooks model editor. <!--
* begin-user-doc --> <!-- end-user-doc -->
- *
+ * @deprecated
* @generated
*/
public class SmooksActionBarContributor extends EditingDomainActionBarContributor
implements ISelectionChangedListener {
@@ -138,7 +138,7 @@
@Override
public void run() {
- addSmooks10ResourceList();
+// addSmooks10ResourceList();
}
};
@@ -240,18 +240,18 @@
}
}
- protected void addSmooks10ResourceList() {
- ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
- EObject model = formEditor.getSmooksModel();
- if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
- .createSmooksResourceListType();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
- org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
- resourceList);
- formEditor.getEditingDomain().getCommandStack().execute(command);
- }
- }
+// protected void addSmooks10ResourceList() {
+// ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
+// EObject model = formEditor.getSmooksModel();
+// if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
+// .createSmooksResourceListType();
+// Command command = AddCommand.create(formEditor.getEditingDomain(), model,
+// org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
+// resourceList);
+// formEditor.getEditingDomain().getCommandStack().execute(command);
+// }
+// }
protected void addSmooks11ResourceList() {
ISmooksModelProvider formEditor = (ISmooksModelProvider) this.getActiveEditor();
@@ -770,14 +770,14 @@
MEdiPackage.eINSTANCE.getEdiMap(), mappingNode);
addMap10ResourceListAction.setEnabled(command.canExecute());
}
- if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
- .createSmooksResourceListType();
- Command command = AddCommand.create(formEditor.getEditingDomain(), model,
- org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
- resourceList);
- addSmooks10ResourceListAction.setEnabled(command.canExecute());
- }
+// if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
+// .createSmooksResourceListType();
+// Command command = AddCommand.create(formEditor.getEditingDomain(), model,
+// org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
+// resourceList);
+// addSmooks10ResourceListAction.setEnabled(command.canExecute());
+// }
}
/**
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -315,7 +315,7 @@
EObject resource = getSmooksResourceList();
if (resource == null)
return;
- if (getSmooksVersion() == null ||
getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ if (getSmooksVersion() == null) {
return;
}
ParamsType parent = getParamsType();
@@ -584,9 +584,6 @@
if (smooksModelProvider != null) {
EObject m = null;
EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
if (smooksModel instanceof DocumentRoot) {
m = ((DocumentRoot) smooksModel).getSmooksResourceList();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -62,11 +62,6 @@
&& eObject instanceof AbstractResourceConfig) {
return eObject;
}
-
- if (smooksTreeViewerInput instanceof
org.jboss.tools.smooks10.model.smooks.SmooksResourceListType
- && eObject instanceof
org.jboss.tools.smooks10.model.smooks.AbstractResourceConfig) {
- return eObject;
- }
}
return super.getEmptyDefaultSelection(smooksTreeViewerInput);
}
@@ -94,9 +89,6 @@
if (obj instanceof ProfilesType) {
return false;
}
- if (obj instanceof org.jboss.tools.smooks10.model.smooks.ProfilesType) {
- return false;
- }
ISmooksModelProvider provider = (ISmooksModelProvider)
getAdapter(ISmooksModelProvider.class);
if (provider != null) {
if (SmooksUIUtils.isUnSupportElement(provider.getPlatformVersion(), (EObject) obj))
{
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -311,11 +311,11 @@
private void setTreeViewerModel(Object smooksModel) {
boolean seted = false;
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- smooksTreeViewer.setInput(((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel)
- .getSmooksResourceList());
- seted = true;
- }
+// if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// smooksTreeViewer.setInput(((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel)
+// .getSmooksResourceList());
+// seted = true;
+// }
if (smooksModel instanceof DocumentRoot) {
SmooksResourceListType list = ((DocumentRoot) smooksModel).getSmooksResourceList();
try {
@@ -332,9 +332,9 @@
private EObject getTreeViewerInput() {
EObject smooksModel = ((ISmooksModelProvider) this.formEditor).getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- return ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
+// if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// return ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
+// }
if (smooksModel instanceof DocumentRoot) {
return (((DocumentRoot) smooksModel).getSmooksResourceList());
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -669,6 +669,7 @@
}
AdapterFactoryEditingDomain editDomain = getEditingDomain();
+ Object obj = editDomain.getAdapterFactory().adapt(resourceList,
IEditingDomainItemProvider.class);
IEditingDomainItemProvider provider = (IEditingDomainItemProvider)
editDomain.getAdapterFactory().adapt(
resourceList, IEditingDomainItemProvider.class);
Collection<?> collections = provider.getNewChildDescriptors(resourceList,
editDomain, null);
@@ -859,7 +860,7 @@
}
getEditingDomain().getCommandStack().execute(compoundCommand);
-// inputTypeChanged();
+ // inputTypeChanged();
refreshInputModelView();
}
@@ -970,8 +971,8 @@
InputType input = (InputType) iterator.next();
SmooksUIUtils.removeInputType(input, smooksModelProvider);
}
- if(!inputs.isEmpty()){
- List<?> viewerInput = (List<?>)inputDataViewer.getInput();
+ if (!inputs.isEmpty()) {
+ List<?> viewerInput = (List<?>) inputDataViewer.getInput();
viewerInput.removeAll(inputs);
inputTypeChanged();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -195,7 +195,6 @@
import org.jboss.tools.smooks.model.validation10.Validation10Package;
import org.jboss.tools.smooks.model.xsl.Xsl;
import org.jboss.tools.smooks.model.xsl.XslPackage;
-import org.jboss.tools.smooks10.model.smooks.DocumentRoot;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
@@ -2998,9 +2997,6 @@
}
public static String judgeSmooksPlatformVersion(EObject smooksModel) {
- if (smooksModel instanceof DocumentRoot) {
- return SmooksConstants.VERSION_1_0;
- }
if (smooksModel instanceof org.jboss.tools.smooks.model.smooks.DocumentRoot) {
EMap<String, String> nsMap = ((org.jboss.tools.smooks.model.smooks.DocumentRoot)
smooksModel)
@@ -3018,10 +3014,6 @@
public static String judgeInputType(EObject smooksModel) {
String inputType = null;
- if (smooksModel instanceof DocumentRoot) {
- return null;
- }
-
if (smooksModel instanceof org.jboss.tools.smooks.model.smooks.DocumentRoot) {
SmooksResourceListType rlist = ((org.jboss.tools.smooks.model.smooks.DocumentRoot)
smooksModel)
.getSmooksResourceList();
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigFileHandle.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigFileHandle.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigFileHandle.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.tools.smooks10.model.smooks.SmooksPackage;
-import org.xml.sax.Attributes;
-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;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * @author Dart dpeng(a)redhat.com
- *
- */
-public class Smooks10ConfigFileHandle extends DefaultHandler {
- private boolean correctContentFile = false;
-
- // private static final String SMOOKS_RESOURCE_LIST = "smooks-resource-list";
//$NON-NLS-1$
-
- private String[] smooksSpportURI = null;
-
- private SAXParserFactory fFactory;
-
- public Smooks10ConfigFileHandle(){
- super();
- smooksSpportURI = createSupportURI();
- }
-
- protected String[] createSupportURI(){
- return new String[]{
- SmooksPackage.eNS_URI,
- };
- }
-
- private final SAXParser createParser(SAXParserFactory parserFactory) throws
ParserConfigurationException,
- SAXException, SAXNotRecognizedException, SAXNotSupportedException {
- // Initialize the parser.
- final SAXParser parser = parserFactory.newSAXParser();
- final XMLReader reader = parser.getXMLReader();
- // disable DTD validation
- try {
-
reader.setFeature("http://xml.org/sax/features/validation", false);
//$NON-NLS-1$
-
reader.setFeature("http://apache.org/xml/features/nonvalidating/load...;,
false); //$NON-NLS-1$
- } catch (SAXNotRecognizedException e) {
- } catch (SAXNotSupportedException e) {
- }
- return parser;
- }
-
- private SAXParserFactory getFactory() {
- synchronized (this) {
- if (fFactory != null) {
- return fFactory;
- }
- fFactory = SAXParserFactory.newInstance();
- fFactory.setNamespaceAware(true);
- }
- return fFactory;
- }
-
- public boolean parseContents(InputSource contents) throws ParserConfigurationException,
IOException {
- try {
- fFactory = getFactory();
- if (fFactory == null) {
- return false;
- }
- final SAXParser parser = createParser(fFactory);
- contents.setSystemId("/"); //$NON-NLS-1$
- parser.parse(contents, this);
- } catch (SAXException e) {
- // stop parsing
- }
- return true;
- }
-
- /*
- * Resolve external entity definitions to an empty string. This is to
- * speed up processing of files with external DTDs. Not resolving the
- * contents of the DTD is ok, as only the System ID of the DTD
- * declaration is used.
- *
- * @see
- * org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
- * java.lang.String)
- */
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{
- return new InputSource(new StringReader("")); //$NON-NLS-1$
- }
-
- @Override
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
- super.startPrefixMapping(prefix, uri);
- if (containtSmooksURI(uri)) {
- setCorrectContentFile(true);
- throw new SAXException("Stop parsing");
- }
- }
-
- private boolean containtSmooksURI(String uri) {
- for (int i = 0; i < smooksSpportURI.length; i++) {
- if (uri != null) {
- if (uri.trim().equalsIgnoreCase(smooksSpportURI[i])) {
- return true;
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
- * java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public final void startElement(final String uri, final String elementName, final String
qualifiedName,
- final Attributes attributes) throws SAXException {
- if (isCorrectContentFile()) {
- throw new SAXException("Stop parsing");
- }
- if (containtSmooksURI(uri)) {
- setCorrectContentFile(true);
- throw new SAXException("Stop parsing");
- }
- }
-
- public boolean isCorrectContentFile() {
- return correctContentFile;
- }
-
- public void setCorrectContentFile(boolean correctContentFile) {
- this.correctContentFile = correctContentFile;
- }
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigfileContentDescriber.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigfileContentDescriber.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigfileContentDescriber.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.xml.sax.InputSource;
-
-/**
- * @author Dart (dpeng(a)redhat.com) note : Many codes comes from
- * org.eclipse.core.internal.content.XMLConentDescriber
- */
-public class Smooks10ConfigfileContentDescriber implements ITextContentDescriber,
IExecutableExtension {
-
- private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] {
IContentDescription.CHARSET,
- IContentDescription.BYTE_ORDER_MARK };
-
- private static final String ENCODING = "encoding="; //$NON-NLS-1$
-
- private static final String XML_PREFIX = "<?xml "; //$NON-NLS-1$
-
- /**
- *
- */
- public Smooks10ConfigfileContentDescriber() {
- // TODO Auto-generated constructor stub
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName,
Object data)
- throws CoreException {
-
- }
-
- public int describeXMLFile(InputStream input, IContentDescription description) throws
IOException {
- byte[] bom = getByteOrderMark(input);
- String xmlDeclEncoding = "UTF-8"; //$NON-NLS-1$
- input.reset();
- if (bom != null) {
- if (bom == IContentDescription.BOM_UTF_16BE)
- xmlDeclEncoding = "UTF-16BE"; //$NON-NLS-1$
- else if (bom == IContentDescription.BOM_UTF_16LE)
- xmlDeclEncoding = "UTF-16LE"; //$NON-NLS-1$
- // skip BOM to make comparison simpler
- input.skip(bom.length);
- // set the BOM in the description if requested
- if (description != null &&
description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, bom);
- }
- byte[] xmlPrefixBytes = XML_PREFIX.getBytes(xmlDeclEncoding);
- byte[] prefix = new byte[xmlPrefixBytes.length];
- if (input.read(prefix) < prefix.length)
- // there is not enough info to say anything
- return INDETERMINATE;
- for (int i = 0; i < prefix.length; i++)
- if (prefix[i] != xmlPrefixBytes[i])
- // we don't have a XMLDecl... there is not enough info to say
- // anything
- return INDETERMINATE;
- if (description == null)
- return VALID;
- // describe charset if requested
- if (description.isRequested(IContentDescription.CHARSET)) {
- String fullXMLDecl = readFullXMLDecl(input, xmlDeclEncoding);
- if (fullXMLDecl != null) {
- String charset = getCharset(fullXMLDecl);
- if (charset != null && !"UTF-8".equalsIgnoreCase(charset))
//$NON-NLS-1$
- // only set property if value is not default (avoid using a
- // non-default content description)
- description.setProperty(IContentDescription.CHARSET, getCharset(fullXMLDecl));
- }
- }
- return VALID;
- }
-
- public int describeXMLType(Reader input, IContentDescription description) throws
IOException {
- BufferedReader reader = new BufferedReader(input);
- String line = reader.readLine();
- // end of stream
- if (line == null)
- return INDETERMINATE;
- // XMLDecl should be the first string (no blanks allowed)
- if (!line.startsWith(XML_PREFIX))
- return INDETERMINATE;
- if (description == null)
- return VALID;
- // describe charset if requested
- if ((description.isRequested(IContentDescription.CHARSET)))
- description.setProperty(IContentDescription.CHARSET, getCharset(line));
- return VALID;
- }
-
- public int describe(InputStream input, IContentDescription description) throws
IOException {
- if (this.describeXMLFile(input, description) == INVALID) {
- return INVALID;
- }
- input.reset();
- return checkCriteria(new InputSource(input));
- }
-
- private String readFullXMLDecl(InputStream input, String unicodeEncoding) throws
IOException {
- byte[] xmlDecl = new byte[100];
- int c = 0;
- // looks for XMLDecl ending char (?)
- int read = 0;
- while (read < xmlDecl.length && (c = input.read()) != -1 && c !=
'?')
- xmlDecl[read++] = (byte) c;
- return c == '?' ? new String(xmlDecl, 0, read, unicodeEncoding) : null;
- }
-
- public int describe(Reader input, IContentDescription description) throws IOException {
- if (this.describeXMLType(input, description) == INVALID) {
- return INVALID;
- }
- input.reset();
- return checkCriteria(new InputSource(input));
- }
-
- protected Smooks10ConfigFileHandle createHandle(){
- return new Smooks10ConfigFileHandle();
- }
-
- /**
- * To check the namespaces of the file
- *
- * @param contents
- * @return
- * @throws IOException
- */
- private int checkCriteria(InputSource contents) throws IOException {
- Smooks10ConfigFileHandle handle = createHandle();
- try {
- if (!handle.parseContents(contents)) {
- return INDETERMINATE;
- }
- } catch (ParserConfigurationException e) {
- return INDETERMINATE;
- }
- if (handle.isCorrectContentFile()) {
- return VALID;
- }
- return INDETERMINATE;
- }
-
- private String getCharset(String firstLine) {
- int encodingPos = firstLine.indexOf(ENCODING);
- if (encodingPos == -1)
- return null;
- char quoteChar = '"';
- int firstQuote = firstLine.indexOf(quoteChar, encodingPos);
- if (firstQuote == -1) {
- quoteChar = '\'';
- firstQuote = firstLine.indexOf(quoteChar, encodingPos);
- }
- if (firstQuote == -1 || firstLine.length() == firstQuote - 1)
- return null;
- int secondQuote = firstLine.indexOf(quoteChar, firstQuote + 1);
- if (secondQuote == -1)
- return null;
- return firstLine.substring(firstQuote + 1, secondQuote);
- }
-
- public QualifiedName[] getSupportedOptions() {
- return SUPPORTED_OPTIONS;
- }
-
- byte[] getByteOrderMark(InputStream input) throws IOException {
- int first = input.read();
- if (first == 0xEF) {
- // look for the UTF-8 Byte Order Mark (BOM)
- int second = input.read();
- int third = input.read();
- if (second == 0xBB && third == 0xBF)
- return IContentDescription.BOM_UTF_8;
- } else if (first == 0xFE) {
- // look for the UTF-16 BOM
- if (input.read() == 0xFF)
- return IContentDescription.BOM_UTF_16BE;
- } else if (first == 0xFF) {
- if (input.read() == 0xFE)
- return IContentDescription.BOM_UTF_16LE;
- }
- return null;
- }
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationOverviewPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationOverviewPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationOverviewPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,821 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.command.MoveCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-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.TableViewer;
-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.FillLayout;
-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.Text;
-import org.eclipse.ui.forms.IFormColors;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.ScrolledPageBook;
-import org.eclipse.ui.forms.widgets.Section;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-import org.jboss.tools.smooks.configuration.SmooksConstants;
-import org.jboss.tools.smooks.configuration.editors.ModelPanelCreator;
-import org.jboss.tools.smooks.configuration.editors.NewOrModifySmooksElementDialog;
-import org.jboss.tools.smooks.configuration.editors.SelectorCreationDialog;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
-import org.jboss.tools.smooks10.model.smooks.DocumentRoot;
-import org.jboss.tools.smooks10.model.smooks.SmooksFactory;
-import org.jboss.tools.smooks10.model.smooks.SmooksPackage;
-
-/**
- * @author Dart
- *
- */
-public class Smooks10ConfigurationOverviewPage extends FormPage implements
ISmooksModelValidateListener,
- ISourceSynchronizeListener {
-
- private ISmooksModelProvider smooksModelProvider;
- private boolean lockEventFire = false;
- // private Button newParamButton;
- // private Button removeParamButton;
- // private Button upParamButton;
- // private Button downParamButton;
- // private Button paramPropertiesButton;
- // private TableViewer paramViewer;
- // private TableViewer conditionViewer;
- // private Button newConditionButton;
- // private Button removeConditionButton;
- // private Button upConditionButton;
- // private Button downConditionButton;
- // private Button conditionPropertiesButton;
- private Composite defaultSettingComposite;
- private Button newProfileButton;
- private Button removeProfileButton;
- private Button upProfileButton;
- private Button downProfileButton;
- private Button profilePropertiesButton;
- private TableViewer profileViewer;
- private ModelPanelCreator defaultSettingPanelCreator;
- private Section generalSettingSection;
- private Section globalParamSection;
- private Section conditionSection;
- private Section profilesSection;
- private Section settingSection;
- private Text smooksNameText;
- private Text smooksAuthorText;
-
- public Smooks10ConfigurationOverviewPage(FormEditor editor, String id, String title,
ISmooksModelProvider provider) {
- super(editor, id, title);
- this.smooksModelProvider = provider;
- }
-
- public Smooks10ConfigurationOverviewPage(String id, String title, ISmooksModelProvider
provider) {
- super(id, title);
- this.smooksModelProvider = provider;
- }
-
- protected void createFormContent(IManagedForm managedForm) {
- final ScrolledForm form = managedForm.getForm();
- FormToolkit toolkit = managedForm.getToolkit();
- toolkit.decorateFormHeading(form.getForm());
- String title = getTitle();
- form.setText(title);
- GridLayout gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- form.getBody().setLayout(gl);
-
- ScrolledPageBook pageBook = new ScrolledPageBook(form.getBody());
- pageBook.setBackground(toolkit.getColors().getBackground());
- Composite mainComposite = pageBook.createPage(pageBook);
- pageBook.showPage(pageBook);
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- pageBook.setLayoutData(gd);
-
- GridLayout mgl = new GridLayout();
- mgl.numColumns = 2;
- mgl.marginHeight = 13;
- mgl.horizontalSpacing = 20;
- mainComposite.setLayout(mgl);
-
- settingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION |
Section.TITLE_BAR);
- settingSection.setLayout(new FillLayout());
- settingSection.setText("Smooks configuration");
- settingSection.setDescription("Set the description for this Smooks configuration
file.");
- Composite settingComposite = toolkit.createComposite(settingSection);
- settingSection.setClient(settingComposite);
- gd = new GridData();
- gd.widthHint = 500;
- settingSection.setLayoutData(gd);
-
- GridLayout sgl = new GridLayout();
- settingComposite.setLayout(sgl);
- sgl.numColumns = 2;
- // sgl.verticalSpacing = 8;
-
- createSettingSection(settingComposite, toolkit);
-
- createSmooksEditorNavigator(mainComposite, toolkit);
-
- generalSettingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION |
Section.TITLE_BAR
- | Section.TWISTIE | Section.EXPANDED);
- generalSettingSection.setLayout(new FillLayout());
- generalSettingSection.setText("Smooks Default Setting");
- generalSettingSection.setDescription("Define the Smooks configuration file default
setting");
- defaultSettingComposite = toolkit.createComposite(generalSettingSection);
- generalSettingSection.setClient(defaultSettingComposite);
- gd = new GridData();
- gd.widthHint = 500;
- generalSettingSection.setLayoutData(gd);
-
- GridLayout ggl = new GridLayout();
- defaultSettingComposite.setLayout(ggl);
- ggl.numColumns = 2;
- ggl.verticalSpacing = 0;
-
- createDefaultSection(defaultSettingComposite, toolkit);
-
- profilesSection = toolkit.createSection(mainComposite, Section.DESCRIPTION |
Section.TITLE_BAR
- | Section.TWISTIE);
- profilesSection.setDescription("Define the profiles");
- profilesSection.setText("Profiles");
- profilesSection.setLayout(new FillLayout());
- Composite profilesComposite = toolkit.createComposite(profilesSection);
- profilesSection.setClient(profilesComposite);
- gd = new GridData();
- gd.verticalAlignment = GridData.BEGINNING;
- gd.widthHint = 500;
- profilesSection.setLayoutData(gd);
-
- GridLayout pgl = new GridLayout();
- profilesComposite.setLayout(pgl);
- pgl.numColumns = 2;
-
- createProfilesSection(profilesComposite, toolkit);
-
- }
-
- private void createSettingSection(Composite settingComposite, FormToolkit toolkit) {
- toolkit.createLabel(settingComposite, "Smooks Platform Version :
").setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
- int type = SWT.BORDER;
- if (SmooksUIUtils.isLinuxOS()) {
- type = SWT.BORDER;
- }
- final Combo combo = new Combo(settingComposite, type | SWT.READ_ONLY);
- combo.setEnabled(false);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- combo.setLayoutData(gd);
- for (int i = 0; i < SmooksConstants.SMOOKS_VERSIONS.length; i++) {
- String version = SmooksConstants.SMOOKS_VERSIONS[i];
- combo.add(version);
- }
-
- String version = getSmooksVersion();
- if (version != null)
- combo.setText(version);
- combo.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- if (lockEventFire)
- return;
- String v = combo.getText();
- if (smooksModelProvider != null) {
-// smooksModelProvider.setPlatformVersion(v);
- }
- }
- });
-
- toolkit.createLabel(settingComposite, "Name :
").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- smooksNameText = toolkit.createText(settingComposite, "", SWT.NONE);
- smooksNameText.setLayoutData(gd);
- String name = null;// smooksModelProvider.getSmooksGraphicsExt().getName();
- if (name != null)
- smooksNameText.setText(name);
- smooksNameText.setEnabled(false);
- smooksNameText.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- if (lockEventFire)
- return;
- if (smooksModelProvider != null) {
-// Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(),
smooksModelProvider
-// .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__NAME,
-// smooksNameText.getText());
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
- }
- }
- });
-
- toolkit.paintBordersFor(settingComposite);
-
- toolkit.createLabel(settingComposite, "Author : ").setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
- smooksAuthorText = toolkit.createText(settingComposite, "", SWT.NONE);
- smooksAuthorText.setLayoutData(gd);
-
- String author = null;//smooksModelProvider.getSmooksGraphicsExt().getAuthor();
- if (author != null)
- smooksAuthorText.setText(author);
- smooksAuthorText.setEnabled(false);
-
- toolkit.createLabel(settingComposite, "");
-
- toolkit.paintBordersFor(settingComposite);
- }
-
- protected void createProfilesSection(Composite profilesComposite, FormToolkit toolkit)
{
- if (smooksModelProvider != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
smooksModelProvider
- .getEditingDomain();
- EObject profiles = getProfilesType();
- // if (m == null)
- // return;
-
- profileViewer = new TableViewer(profilesComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- profileViewer.getControl().setLayoutData(gd);
- toolkit.paintBordersFor(profilesComposite);
- Composite buttonArea = toolkit.createComposite(profilesComposite);
- gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 30;
- GridLayout bgl = new GridLayout();
- buttonArea.setLayout(bgl);
-
- newProfileButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- newProfileButton.setLayoutData(gd);
-
- removeProfileButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- removeProfileButton.setLayoutData(gd);
-
- upProfileButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- upProfileButton.setLayoutData(gd);
-
- downProfileButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- downProfileButton.setLayoutData(gd);
-
- profilePropertiesButton = toolkit.createButton(buttonArea, "Properties..",
SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- profilePropertiesButton.setLayoutData(gd);
-
- profileViewer.setContentProvider(new
AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-
- @Override
- public boolean hasChildren(Object object) {
- return false;
- }
-
- });
-
- profileViewer.setLabelProvider(new DecoratingLabelProvider(new
AdapterFactoryLabelProvider(editingDomain
- .getAdapterFactory()) {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
- * # getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- Object obj = AdapterFactoryEditingDomain.unwrap(object);
- if (obj instanceof EObject) {
- return super.getText(obj);
- }
- return super.getText(object);
- }
-
- },
SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-
- if (profiles != null) {
- profileViewer.setInput(profiles);
- }
-
- profileViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
- openProfilePropertiesModifyDialog();
- }
- });
-
- profileViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- updateProfilesButtons();
- }
- });
-
- hookProfilesButtons();
- updateProfilesButtons();
- }
- }
-
- protected void openProfilePropertiesModifyDialog() {
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profile = (EObject) obj;
- EObject parent = getProfilesType();
- EStructuralFeature profileFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profileFeature =
org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
-
- NewOrModifySmooksElementDialog dialog = new
NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- profileFeature, profile, parent, getManagedForm().getToolkit(),
smooksModelProvider,
- Smooks10ConfigurationOverviewPage.this, true);
- dialog.open();
- }
- }
-
- protected void updateProfilesButtons() {
- if (getSmooksVersion() == null) {
- profilePropertiesButton.setEnabled(false);
- newProfileButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- return;
- }
- profilePropertiesButton.setEnabled(true);
- removeProfileButton.setEnabled(true);
- IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
- if (selection == null) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- } else {
- if (selection.getFirstElement() == null) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- upProfileButton.setEnabled(false);
- downProfileButton.setEnabled(false);
- return;
- }
-
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent,
null, obj,
- index - 1);
- upProfileButton.setEnabled(command.canExecute());
-
- Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent,
null, obj,
- index + 1);
- downProfileButton.setEnabled(command1.canExecute());
- }
-
- if (selection.size() > 1) {
- profilePropertiesButton.setEnabled(false);
- removeProfileButton.setEnabled(false);
- }
- }
-
- }
-
- protected void hookProfilesButtons() {
- newProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (getSmooksVersion() == null) {
- return;
- }
- EObject model = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- model =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfileType();
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- model = SmooksFactory.eINSTANCE.createProfileType();
- }
- EObject parent = getProfilesType();
- boolean newParent = false;
- if (parent == null) {
- newParent = true;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- parent =
org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfilesType();
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- parent = SmooksFactory.eINSTANCE.createProfilesType();
- }
- }
- EStructuralFeature profileFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profileFeature =
org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
- }
- NewOrModifySmooksElementDialog dialog = new
NewOrModifySmooksElementDialog(getEditorSite().getShell(),
- profileFeature, model, parent, getManagedForm().getToolkit(), smooksModelProvider,
- Smooks10ConfigurationOverviewPage.this, false);
-
- EStructuralFeature profilesFeature = null;
- if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
- profilesFeature =
org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
- }
- if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
- profilesFeature = SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
- }
- if (dialog.open() == Dialog.OK && newParent) {
- EObject resource = getSmooksResourceList();
- if (resource == null)
- return;
- Command command = SetCommand.create(smooksModelProvider.getEditingDomain(),
resource,
- profilesFeature, parent);
- if (command.canExecute()) {
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- profileViewer.setInput(parent);
- }
- }
- super.widgetSelected(e);
- }
-
- });
- removeProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection)
profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profile = (EObject) obj;
- EObject parent = getProfilesType();
- if (parent == null)
- return;
- CompoundCommand compoundCommand = new CompoundCommand();
- Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(),
profile);
- compoundCommand.append(command);
- if (parent.eContents().size() == 1) {
- // remove parent;
- Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(),
parent);
- compoundCommand.append(command1);
- }
- smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
- }
- }
-
- });
- upProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection)
profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent,
null, obj,
- index - 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- downProfileButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection)
profileViewer.getSelection();
- if (selection == null)
- return;
- Object obj = selection.getFirstElement();
- if (obj instanceof EObject) {
- EObject profilesType = getProfilesType();
- if (profilesType == null)
- return;
- EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
- EObject parent = v.eContainer();
- int index = parent.eContents().indexOf(v);
- Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent,
null, obj,
- index + 1);
- smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
- }
- }
-
- });
- profilePropertiesButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- openProfilePropertiesModifyDialog();
- super.widgetSelected(e);
- }
-
- });
-
- }
-
- private EObject getProfilesType() {
- if (smooksModelProvider != null) {
- EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof DocumentRoot) {
- EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getProfiles();
- return m;
- }
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- EObject m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList()
- .getProfiles();
- return m;
- }
- }
- return null;
- }
-
- private String getSmooksVersion() {
- if (smooksModelProvider != null) {
- return smooksModelProvider.getPlatformVersion();
- }
- return null;
- }
-
- private void createNavigatorSection(Composite mainNavigatorComposite, FormToolkit
toolkit, String title,
- String navigatorFilePath) {
- Section navigator = toolkit.createSection(mainNavigatorComposite, Section.TITLE_BAR);
- navigator.setText(title);
- navigator.setLayout(new FillLayout());
- Composite navigatorComposite = toolkit.createComposite(navigator);
- navigator.setClient(navigatorComposite);
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.verticalAlignment = GridData.BEGINNING;
- navigator.setLayoutData(gd);
-
- FormText formText = toolkit.createFormText(navigatorComposite, true);
- StringBuffer buf = new StringBuffer();
- InputStream inputStream = this.getClass().getResourceAsStream(navigatorFilePath);
- BufferedReader reader = null;
- if (inputStream != null) {
- try {
- reader = new BufferedReader(new InputStreamReader(inputStream));
- String line = reader.readLine();
- while (line != null) {
- buf.append(line);
- line = reader.readLine();
- }
- } catch (IOException e) {
-
- } finally {
- try {
- if (reader != null) {
- reader.close();
- }
- if (inputStream != null) {
- inputStream.close();
- }
- } catch (Throwable t) {
-
- }
- }
- }
- formText.setWhitespaceNormalized(true);
- String content = buf.toString();
- if (content != null) {
- try {
- formText.setText(content, true, false);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- formText.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- Object href = e.getHref();
- if (href == null)
- return;
- activeNavigatorLink(href.toString());
- }
- });
- navigatorComposite.setLayout(new GridLayout());
- gd = new GridData(GridData.FILL_BOTH);
- formText.setLayoutData(gd);
-
- toolkit.createLabel(navigatorComposite, "");
- }
-
- private void createSmooksEditorNavigator(Composite mainComposite, FormToolkit toolkit)
{
- Composite mainNavigatorComposite = toolkit.createComposite(mainComposite);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.verticalSpan = 5;
- mainNavigatorComposite.setLayoutData(gd);
-
- GridLayout gl = new GridLayout();
- // gl.numColumns = 2;
- gl.marginWidth = 0;
- gl.marginHeight = 0;
- mainNavigatorComposite.setLayout(gl);
-
- createNavigatorSection(mainNavigatorComposite, toolkit, "Configuring Smooks
Input",
- "/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm");
- createNavigatorSection(mainNavigatorComposite, toolkit, "Configuring Message
Filter(s)",
- "/org/jboss/tools/smooks/configuration/navigator/MessageFilterNavigator.htm");
- }
-
- protected void activeNavigatorLink(String href) {
- if (href == null)
- return;
- if (href.equals("reader_page")) {
- this.getEditor().setActivePage("reader_page");
- }
- if (href.equals("message_filter_page")) {
- this.getEditor().setActivePage("message_filter_page");
- }
- if (href.equals("source_page")) {
- this.getEditor().setActiveEditor(((AbstractSmooksFormEditor)
getEditor()).getTextEditor());
- }
- if (href.equals("overview_default_setting")) {
- generalSettingSection.setFocus();
- }
- if (href.equals("overview_global_param")) {
- globalParamSection.setFocus();
- globalParamSection.setExpanded(true);
- }
- if (href.equals("overview_condition")) {
- conditionSection.setFocus();
- conditionSection.setExpanded(true);
- }
- if (href.equals("overview_profile")) {
- profilesSection.setFocus();
- profilesSection.setExpanded(true);
- }
- if (href.equals("selector_dialog")) {
- SelectorCreationDialog dialog = new SelectorCreationDialog(getEditorSite().getShell(),
this.getEditor());
- try {
- dialog.open();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- private EObject getSmooksResourceList() {
- if (smooksModelProvider != null) {
- EObject m = null;
- EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
- if (smooksModel instanceof DocumentRoot) {
- m = ((DocumentRoot) smooksModel).getSmooksResourceList();
- }
- return m;
- }
- return null;
- }
-
- private void createDefaultSection(Composite parent, FormToolkit toolkit) {
- ModelPanelCreator defaultSettingPanelCreator = getDefaultSettingPanelCreator();
- EObject model = getSmooksResourceList();
- if (model != null) {
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
smooksModelProvider
- .getEditingDomain();
- IItemPropertySource itemPropertySource = (IItemPropertySource)
editingDomain.getAdapterFactory().adapt(
- model, IItemPropertySource.class);
- if (model != null) {
- defaultSettingPanelCreator.createModelPanel(model, toolkit, parent,
itemPropertySource,
- smooksModelProvider, getEditor());
- }
- }
-
- }
-
- public ModelPanelCreator getDefaultSettingPanelCreator() {
- if (defaultSettingPanelCreator == null) {
- defaultSettingPanelCreator = new ModelPanelCreator();
- }
- return defaultSettingPanelCreator;
- }
-
-// public void inputTypeChanged(SmooksGraphicsExtType extType) {
-//
-// }
-
- public void validateEnd(List<Diagnostic> diagnosticResult) {
- ModelPanelCreator creator = getDefaultSettingPanelCreator();
- creator.markPropertyUI(diagnosticResult, getSmooksResourceList());
- }
-
- public void validateStart() {
- }
-
- public void sourceChange(Object model) {
- lockEventFire = true;
-
-// String name = smooksModelProvider.getSmooksGraphicsExt().getName();
-// if (name != null)
-// smooksNameText.setText(name);
-//
-// String author = smooksModelProvider.getSmooksGraphicsExt().getAuthor();
-// if (author != null)
-// smooksAuthorText.setText(author);
-
- lockEventFire = false;
-
- disposeDefaultSettingCompositeControls();
- createDefaultSection(defaultSettingComposite, this.getManagedForm().getToolkit());
- defaultSettingComposite.getParent().layout();
- profileViewer.setInput(getProfilesType());
- }
-
- protected void disposeCompositeControls(Composite composite, Control[] ignoreControl) {
- if (composite != null) {
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- Control child = children[i];
- if (ignoreControl != null) {
- for (int j = 0; j < ignoreControl.length; j++) {
- if (child == ignoreControl[j]) {
- continue;
- }
- }
- }
- child.dispose();
- child = null;
- }
- }
- }
-
- private void disposeDefaultSettingCompositeControls() {
- disposeCompositeControls(defaultSettingComposite, null);
- }
-
-// public void graphChanged(SmooksGraphicsExtType extType) {
-//
-// }
-
- public void graphPropertyChange(EStructuralFeature featre, Object value) {
-
- }
-
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationResourceConfigPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationResourceConfigPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10ConfigurationResourceConfigPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.jboss.tools.smooks.configuration.SmooksConstants;
-import org.jboss.tools.smooks.configuration.editors.SmooksConfigurationFormPage;
-import org.jboss.tools.smooks.configuration.editors.SmooksMasterDetailBlock;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.model.smooks.AbstractReader;
-import org.jboss.tools.smooks.model.smooks.ConditionsType;
-import org.jboss.tools.smooks.model.smooks.ParamsType;
-import org.jboss.tools.smooks10.model.smooks.AbstractResourceConfig;
-import org.jboss.tools.smooks10.model.smooks.ProfilesType;
-import org.jboss.tools.smooks10.model.smooks.SmooksResourceListType;
-
-/**
- * @author Dart
- *
- */
-public class Smooks10ConfigurationResourceConfigPage extends SmooksConfigurationFormPage
{
-
- public Smooks10ConfigurationResourceConfigPage(FormEditor editor, String id, String
title) {
- super(editor, id, title);
- }
-
- public Smooks10ConfigurationResourceConfigPage(String id, String title) {
- super(id, title);
- }
-
- @Override
- protected void createMasterDetailBlock(IManagedForm managedForm) {
- // TODO Auto-generated method stub
- super.createMasterDetailBlock(managedForm);
- }
-
- @Override
- protected SmooksMasterDetailBlock createSmooksMasterDetailsBlock() {
- return new SmooksMasterDetailBlock(getEditor(),
- (AdapterFactoryEditingDomain) ((Smooks10MultiFormEditor)
getEditor()).getEditingDomain()) {
- @Override
- protected Object getEmptyDefaultSelection(EObject smooksTreeViewerInput) {
- List<EObject> contents = smooksTreeViewerInput.eContents();
- for (Iterator<?> iterator = contents.iterator(); iterator.hasNext();) {
- EObject eObject = (EObject) iterator.next();
-
- if (smooksTreeViewerInput instanceof SmooksResourceListType
- && eObject instanceof AbstractResourceConfig) {
- return eObject;
- }
- }
- return super.getEmptyDefaultSelection(smooksTreeViewerInput);
- }
- };
- }
-
- @Override
- protected ViewerFilter[] createViewerFilters() {
- ViewerFilter filter = new ViewerFilter() {
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- Object obj = element;
- obj = AdapterFactoryEditingDomain.unwrap(obj);
- if (obj instanceof EObject) {
- if (obj instanceof ParamsType) {
- return false;
- }
- if (obj instanceof ConditionsType) {
- return false;
- }
- if (obj instanceof AbstractReader) {
- return false;
- }
- if (obj instanceof ProfilesType) {
- return false;
- }
- if (obj instanceof org.jboss.tools.smooks10.model.smooks.ProfilesType) {
- return false;
- }
- // SmooksGraphicsExtType extType =
- // getSmooksGraphicsExtType();
- String version = SmooksConstants.VERSION_1_0;
- if (SmooksUIUtils.isUnSupportElement(version, (EObject) obj)) {
- return false;
- }
- }
- return true;
- }
- };
-
- ViewerFilter[] filters = super.createViewerFilters();
- ViewerFilter[] newFilters = new ViewerFilter[filters.length + 1];
- newFilters[0] = filter;
- System.arraycopy(filters, 0, newFilters, 1, filters.length);
- return newFilters;
- }
-
- @Override
- protected void setPageTitle(ScrolledForm form) {
- // EObject smooksModel = ((ISmooksModelProvider)
- // getEditor()).getSmooksModel();
- // if (smooksModel != null) {
- // EObject parent = smooksModel;
- // while (parent != null) {
- // EObject old = parent;
- // parent = parent.eContainer();
- // if (parent == null) {
- // parent = old;
- // break;
- // }
- // }
- // if (parent instanceof DocumentRoot) {
- // title = "Smooks 1.1 - " + title;
- // }
- // if (parent instanceof
- // org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- // title = "Smooks 1.0 - " + title;
- // }
- // }
- form.setText("Message Filter");
- }
-
- @Override
- protected String getNewSmooksElementDescription() {
- return super.getNewSmooksElementDescription();
- }
-
- @Override
- protected String getNewSmooksElementTitle() {
- return super.getNewSmooksElementTitle();
- }
-
- @Override
- protected String getMainSectionDescription() {
- return super.getMainSectionDescription();
- }
-
- @Override
- protected String getMainSectionTitle() {
- return "Message Filtering Resources";
- }
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,882 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.util.List;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
-import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
-
-/**
- * @author Dart
- *
- */
-public class Smooks10InputFormPage extends FormPage implements
ISmooksModelValidateListener, ISourceSynchronizeListener {
-
-
-
- public Smooks10InputFormPage(FormEditor editor, String id, String title) {
- super(editor, id, title);
- // TODO Auto-generated constructor stub
- }
-
- public Smooks10InputFormPage(String id, String title) {
- super(id, title);
- // TODO Auto-generated constructor stub
- }
-
- public void validateEnd(List<Diagnostic> diagnosticResult) {
- // TODO Auto-generated method stub
-
- }
-
- public void validateStart() {
- // TODO Auto-generated method stub
-
- }
-
- public void sourceChange(Object model) {
- // TODO Auto-generated method stub
-
- }
-
-// private CheckboxTableViewer inputDataViewer;
-// private TreeViewer inputModelViewer;
-// private Combo readerCombo;
-// private List<Object> readerTypeList = new ArrayList<Object>();
-// private Composite readerConfigComposite;
-// private ModelPanelCreator modelPanelCreator;
-// protected boolean lockCheck = false;
-//
-// public Smooks10InputFormPage(FormEditor editor, String id, String title) {
-// super(editor, id, title);
-// }
-//
-// public Smooks10InputFormPage(String id, String title) {
-// super(id, title);
-// }
-//
-// @Override
-// protected void createFormContent(IManagedForm managedForm) {
-// final ScrolledForm form = managedForm.getForm();
-// FormToolkit toolkit = managedForm.getToolkit();
-// toolkit.decorateFormHeading(form.getForm());
-// form.setText("Input");
-// // // create master details UI
-// // createMasterDetailBlock(managedForm);
-// Composite leftComposite = toolkit.createComposite(form.getBody());
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// gd.widthHint = 700;
-// leftComposite.setLayoutData(gd);
-//
-// Composite rightComposite = toolkit.createComposite(form.getBody());
-// gd = new GridData(GridData.FILL_BOTH);
-// rightComposite.setLayoutData(gd);
-//
-// GridLayout lgl = new GridLayout();
-// lgl.marginWidth = 0;
-// lgl.marginHeight = 0;
-// leftComposite.setLayout(lgl);
-//
-// GridLayout rgl = new GridLayout();
-// rgl.marginWidth = 0;
-// rgl.marginHeight = 0;
-// rightComposite.setLayout(rgl);
-//
-// createReaderSection(toolkit, leftComposite);
-// createInputDataSection(toolkit, rightComposite);
-// createReaderConfigSection(toolkit, leftComposite);
-// createInputModelViewerSection(toolkit, rightComposite);
-//
-// handleReaderCombo(readerCombo);
-//
-// GridLayout gridLayout = new GridLayout();
-// gridLayout.marginHeight = 13;
-// gridLayout.numColumns = 2;
-// gridLayout.horizontalSpacing = 20;
-// gridLayout.makeColumnsEqualWidth = true;
-// form.getBody().setLayout(gridLayout);
-// }
-//
-// private void createInputModelViewerSection(FormToolkit toolkit, Composite parent) {
-// Section section = toolkit.createSection(parent, Section.TITLE_BAR |
Section.DESCRIPTION);
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// // gd.verticalAlignment = GridData.BEGINNING;
-// section.setLayoutData(gd);
-// section.setText("Input Model View");
-// section.setDescription("View the XML structure model of the input data");
-// FillLayout flayout = new FillLayout();
-// section.setLayout(flayout);
-//
-// Composite mainContainer = toolkit.createComposite(section);
-// GridLayout gl = new GridLayout();
-// mainContainer.setLayout(gl);
-// section.setClient(mainContainer);
-//
-// Hyperlink refreshLink = toolkit.createHyperlink(mainContainer, "Refresh Input
Model Viewer", SWT.NONE);
-// refreshLink.addHyperlinkListener(new IHyperlinkListener() {
-//
-// public void linkExited(HyperlinkEvent e) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// public void linkEntered(HyperlinkEvent e) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// public void linkActivated(HyperlinkEvent e) {
-// refreshInputModelView();
-// }
-// });
-//
-// Composite viewerContainer = toolkit.createComposite(mainContainer);
-// gd = new GridData(GridData.FILL_BOTH);
-// viewerContainer.setLayoutData(gd);
-//
-// FillLayout fillLayout = new FillLayout();
-// fillLayout.marginHeight = 1;
-// fillLayout.marginWidth = 1;
-// viewerContainer.setBackground(GraphicsConstants.BORDER_CORLOR);
-// viewerContainer.setLayout(fillLayout);
-// inputModelViewer = new TreeViewer(viewerContainer, SWT.NONE);
-// inputModelViewer.setContentProvider(new CompoundStructuredDataContentProvider());
-// inputModelViewer.setLabelProvider(new CompoundStructuredDataLabelProvider());
-// List<Object> inputList = generateInputData();
-// inputModelViewer.setInput(inputList);
-// inputModelViewer.addDoubleClickListener(new IDoubleClickListener() {
-// public void doubleClick(DoubleClickEvent event) {
-// }
-// });
-// inputModelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-// public void selectionChanged(SelectionChangedEvent event) {
-// // currentSelection = ((IStructuredSelection)
-// // event.getSelection()).getFirstElement();
-// }
-// });
-// SmooksUIUtils.expandSelectorViewer(inputList, inputModelViewer);
-//
-// }
-//
-// protected List<Object> generateInputData() {
-// return SelectorCreationDialog.generateInputDataForSmooks10();
-// }
-//
-// private void createReaderConfigSection(FormToolkit toolkit, Composite parent) {
-// Section section = toolkit.createSection(parent, Section.TITLE_BAR);
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// section.setLayoutData(gd);
-// section.setText("Input Configuration");
-// section.setDescription("Configurate the input data");
-// FillLayout flayout = new FillLayout();
-// section.setLayout(flayout);
-//
-// ScrolledPageBook pageBook = new ScrolledPageBook(section);
-// pageBook.setBackground(toolkit.getColors().getBackground());
-// section.setClient(pageBook);
-//
-// readerConfigComposite = pageBook.createPage(pageBook);
-// pageBook.showPage(pageBook);
-//
-// GridLayout gl = new GridLayout();
-// gl.numColumns = 2;
-// readerConfigComposite.setLayout(gl);
-//
-// initReaderConfigSection();
-// }
-//
-// private void createReaderSection(FormToolkit toolkit, Composite parent) {
-// Section section = toolkit.createSection(parent, Section.TITLE_BAR |
Section.DESCRIPTION);
-// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-// gd.verticalAlignment = GridData.BEGINNING;
-// section.setLayoutData(gd);
-// section.setText("Input Type");
-// section.setDescription("Select the input type");
-// FillLayout flayout = new FillLayout();
-// section.setLayout(flayout);
-//
-// Composite mainComposite = toolkit.createComposite(section);
-// section.setClient(mainComposite);
-// GridLayout gl = new GridLayout();
-// gl.numColumns = 2;
-// mainComposite.setLayout(gl);
-//
-// toolkit.createLabel(mainComposite, "Input Type : ");
-//
-// readerCombo = new Combo(mainComposite, SWT.NONE | SWT.READ_ONLY);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// readerCombo.setLayoutData(gd);
-//
-// toolkit.createLabel(mainComposite, " ");
-//
-// bindingReaderCombo();
-//
-// initReaderCombo();
-//
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// readerCombo.setLayoutData(gd);
-//
-// toolkit.paintBordersFor(mainComposite);
-// }
-//
-// private void initReaderConfigSection() {
-// Object reader = getCurrentReaderModel();
-// String type = getSmooksGraphicsExtType().getInputType();
-// if (reader instanceof EObject && type != null) {
-// // createReaderPanel((EObject) list.getAbstractReader().get(0));
-// } else {
-// disposeCompositeControls(readerConfigComposite, null);
-// }
-// }
-//
-// private String getCurrentReaderType() {
-// Object reader = getCurrentReaderModel();
-// return getReaderType(reader);
-// }
-//
-// private void initReaderCombo() {
-// if (readerCombo == null)
-// return;
-// SmooksResourceListType rlist = getSmooksConfigResourceList();
-// if (rlist == null) {
-// readerCombo.select(-1);
-// return;
-// }
-// SmooksGraphicsExtType ext = getSmooksGraphicsExtType();
-// String inputType = ext.getInputType();
-//
-// if (inputType == null) {
-// readerCombo.select(0);
-// return;
-// }
-// if (SmooksModelUtils.INPUT_TYPE_XML.equals(inputType)) {
-// readerCombo.select(1);
-// }
-// if (SmooksModelUtils.INPUT_TYPE_JAVA.equals(inputType)) {
-// readerCombo.select(2);
-// }
-// if (SmooksModelUtils.INPUT_TYPE_XSD.equals(inputType)) {
-// readerCombo.select(3);
-// }
-// return;
-// }
-//
-// private void handleReaderCombo(final Combo combo) {
-// combo.addSelectionListener(new SelectionListener() {
-//
-// public void widgetSelected(SelectionEvent e) {
-// Object newreader = getCurrentReaderModel();
-// if (newreader == null)
-// return;
-// // String type = getCurrentReaderType();
-// // if (type == null) {
-// //
getSmooksGraphicsExtType().eUnset(GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__INPUT_TYPE);
-// // } else {
-// // getSmooksGraphicsExtType().setInputType(type);
-// // }
-// readerChanged(newreader);
-// }
-//
-// public void widgetDefaultSelected(SelectionEvent e) {
-// // TODO Auto-generated method stub
-//
-// }
-// });
-// }
-//
-// // private Command createRemoveReaderCommand() {
-// // SmooksResourceListType rlist = getSmooksConfigResourceList();
-// // List<AbstractReader> readerList = rlist.getAbstractReader();
-// // CompoundCommand compoundCommand = new CompoundCommand();
-// // for (Iterator<?> iterator = readerList.iterator(); iterator.hasNext();) {
-// // AbstractReader abstractReader = (AbstractReader) iterator.next();
-// // Object readerEntry = createReaderEntry(abstractReader, false);
-// // if (readerEntry == null)
-// // continue;
-// // Command removeCommand = RemoveCommand.create(getEditingDomain(), rlist,
-// // SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__ABSTRACT_READER_GROUP,
-// // readerEntry);
-// // if (removeCommand.canExecute()) {
-// // compoundCommand.append(removeCommand);
-// // }
-// // }
-// // if (compoundCommand.isEmpty()) {
-// // return null;
-// // }
-// // return compoundCommand;
-// // }
-//
-// private String getReaderType(Object reader) {
-// if (reader instanceof XMLReader) {
-// return SmooksModelUtils.INPUT_TYPE_XML;
-// }
-// if (reader instanceof JavaReader) {
-// return SmooksModelUtils.INPUT_TYPE_JAVA;
-// }
-// if (reader instanceof XSDReader) {
-// return SmooksModelUtils.INPUT_TYPE_XSD;
-// }
-// return null;
-// }
-//
-// private void readerChanged(Object reader) {
-// String type = getCurrentReaderType();
-// String oldType = this.getSmooksGraphicsExtType().getInputType();
-//
-// if (type == null && oldType == null) {
-// return;
-// }
-// if (type != null && type.equals(oldType)) {
-// return;
-// }
-// if (oldType != null && oldType.equals(type)) {
-// return;
-// }
-//
-// Command setTypeCommand = SetCommand.create(getEditingDomain(),
getSmooksGraphicsExtType(),
-// GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__INPUT_TYPE, type);
-// CompoundCommand compoundCommand = new CompoundCommand();
-// compoundCommand.append(setTypeCommand);
-// if (readerConfigComposite != null) {
-// disposeCompositeControls(readerConfigComposite, null);
-// }
-// deactiveAllInputFile(compoundCommand);
-// if (!compoundCommand.isEmpty()) {
-// getEditingDomain().getCommandStack().execute(compoundCommand);
-// // createReaderPanel(((EObject) reader));
-// }
-//
-// if (inputDataViewer != null) {
-// inputDataViewer.refresh();
-// }
-// refreshInputModelView();
-// }
-//
-// private void deactiveAllInputFile(CompoundCommand command) {
-// SmooksGraphicsExtType ext = getSmooksGraphicsExtType();
-// List<InputType> inputList = ext.getInput();
-// for (Iterator<?> iterator = inputList.iterator(); iterator.hasNext();) {
-// InputType inputType = (InputType) iterator.next();
-// setInputDataActiveStatus(false, inputType, command);
-// }
-// }
-//
-// private void createReaderPanel(EObject reader) {
-// // disposeCompositeControls(readerConfigComposite, null);
-// // try {
-// // ModelPanelCreator modelPanelCreator = getModelPanelCreator();
-// // IItemPropertySource ps = (IItemPropertySource)
-// // getEditingDomain().getAdapterFactory().adapt(reader,
-// // IItemPropertySource.class);
-// // modelPanelCreator.createModelPanel(reader,
-// // getManagedForm().getToolkit(), readerConfigComposite, ps,
-// // (ISmooksModelProvider) getEditor(), getEditor());
-// // readerConfigComposite.getParent().layout();
-// // } catch (Exception e) {
-// // e.printStackTrace();
-// // }
-// }
-//
-// private ModelPanelCreator getModelPanelCreator() {
-// if (modelPanelCreator == null) {
-// modelPanelCreator = new ModelPanelCreator();
-// }
-// return modelPanelCreator;
-// }
-//
-// private void bindingReaderCombo() {
-// if (readerCombo == null)
-// return;
-//
-// readerCombo.removeAll();
-// readerTypeList.clear();
-//
-// readerCombo.add("No Input");
-// readerTypeList.add(new NullReader());
-// readerCombo.add("XML");
-// readerTypeList.add(new XMLReader());
-// readerCombo.add("Java");
-// readerTypeList.add(new JavaReader());
-// readerCombo.add("XSD/WSDL");
-// readerTypeList.add(new XSDReader());
-//
-// SmooksResourceListType resourceList = getSmooksConfigResourceList();
-//
-// if (resourceList == null) {
-// return;
-// }
-//
-// AdapterFactoryEditingDomain editDomain = getEditingDomain();
-// IEditingDomainItemProvider provider = (IEditingDomainItemProvider)
editDomain.getAdapterFactory().adapt(
-// resourceList, IEditingDomainItemProvider.class);
-// Collection<?> collections = provider.getNewChildDescriptors(resourceList,
editDomain, null);
-//
-// SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
-// String version = extType.getPlatformVersion();
-// OnlyReaderViewerFilter filter = new OnlyReaderViewerFilter();
-// for (Iterator<?> iterator = collections.iterator(); iterator.hasNext();) {
-// Object object = (Object) iterator.next();
-// if (object instanceof CommandParameter) {
-// Object value = ((CommandParameter) object).getValue();
-//
-// value = AdapterFactoryEditingDomain.unwrap(value);
-//
-// if (filter.select(null, null, value)) {
-// if (SmooksUIUtils.isUnSupportElement(version, (EObject) value)) {
-// continue;
-// }
-//
-// IItemLabelProvider lp = (IItemLabelProvider)
editDomain.getAdapterFactory().adapt(value,
-// IItemLabelProvider.class);
-// String text = lp.getText(value);
-// readerCombo.add(text);
-// readerTypeList.add(value);
-// }
-// }
-// }
-// }
-//
-// private void setInputDataActiveStatus(boolean active, InputType inputType, final
CompoundCommand command) {
-// List<ParamType> params = inputType.getParam();
-// boolean newOne = true;
-// for (Iterator<?> iterator = params.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// if (SmooksModelUtils.PARAM_NAME_ACTIVED.equals(paramType.getName())) {
-// Command setCommand = SetCommand.create(getEditingDomain(), paramType,
-// GraphPackage.Literals.PARAM_TYPE__VALUE, String.valueOf(active));
-// if (command != null) {
-// try {
-// command.append(setCommand);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// } else {
-// getEditingDomain().getCommandStack().execute(setCommand);
-// }
-// newOne = false;
-// break;
-// }
-// }
-// if (newOne) {
-// ParamType p = GraphFactory.eINSTANCE.createParamType();
-// p.setName(SmooksModelUtils.PARAM_NAME_ACTIVED);
-// p.setValue(String.valueOf(active));
-// inputType.getParam().add(p);
-// Command addCommand = AddCommand.create(getEditingDomain(), inputType,
-// GraphPackage.Literals.INPUT_TYPE__PARAM, p);
-// if (command != null) {
-// command.append(addCommand);
-// } else {
-// getEditingDomain().getCommandStack().execute(addCommand);
-// }
-// }
-// SmooksGraphicsExtType ext = getSmooksGraphicsExtType();
-// if (ext != null) {
-// List<ISmooksGraphChangeListener> listeners = ((SmooksGraphicsExtType)
ext).getChangeListeners();
-// for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
-// ISmooksGraphChangeListener smooksGraphChangeListener = (ISmooksGraphChangeListener)
iterator.next();
-// smooksGraphChangeListener.inputTypeChanged((SmooksGraphicsExtType) ext);
-// }
-// }
-// }
-//
-// protected void createInputDataSection(FormToolkit toolkit, Composite parent) {
-// Section section = toolkit.createSection(parent, Section.TITLE_BAR |
Section.DESCRIPTION);
-// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-// section.setLayoutData(gd);
-// section.setText("Input Data");
-// section.setDescription("Add a file to be the input data");
-// FillLayout flayout = new FillLayout();
-// section.setLayout(flayout);
-//
-// Composite mainComposite = toolkit.createComposite(section, SWT.NONE);
-// GridLayout gl = new GridLayout();
-// gl.numColumns = 2;
-// mainComposite.setLayout(gl);
-// section.setClient(mainComposite);
-//
-// Composite tableComposite = toolkit.createComposite(mainComposite, SWT.NONE);
-// FillLayout fillLayout = new FillLayout();
-// fillLayout.marginHeight = 1;
-// fillLayout.marginWidth = 1;
-// gd = new GridData(GridData.FILL_BOTH);
-// gd.heightHint = 200;
-// tableComposite.setLayoutData(gd);
-// tableComposite.setBackground(GraphicsConstants.BORDER_CORLOR);
-// tableComposite.setLayout(fillLayout);
-//
-// inputDataViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.MULTI |
SWT.FULL_SELECTION);
-// // inputDataViewer.set
-// inputDataViewer.setCheckStateProvider(new ICheckStateProvider() {
-//
-// public boolean isGrayed(Object element) {
-// return isIncorrectInputType((InputType) element);
-// }
-//
-// public boolean isChecked(Object element) {
-// if (element instanceof InputType) {
-// List<ParamType> params = ((InputType) element).getParam();
-// for (Iterator<?> iterator = params.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// if (SmooksModelUtils.PARAM_NAME_ACTIVED.equals(paramType.getName())) {
-// String value = paramType.getValue();
-// if (value == null)
-// return false;
-// value = value.trim();
-// return "true".equalsIgnoreCase(value);
-// }
-// }
-// }
-// return false;
-// }
-// });
-//
-// // inputDataViewer.addDoubleClickListener(new IDoubleClickListener() {
-// // public void doubleClick(DoubleClickEvent event) {
-// // InputType inputType =(InputType)
-// // ((IStructuredSelection)inputDataViewer.getSelection()).getFirstElement();
-// // String path = SmooksModelUtils.getInputPath(inputType);
-// // }
-// // });
-//
-// // IFile file = File
-//
-// inputDataViewer.addCheckStateListener(new ICheckStateListener() {
-//
-// public void checkStateChanged(CheckStateChangedEvent event) {
-// if (lockCheck)
-// return;
-// boolean checked = event.getChecked();
-// InputType inputType = (InputType) event.getElement();
-// if (isIncorrectInputType(inputType)) {
-// lockCheck = true;
-// inputDataViewer.setChecked(inputType, false);
-// lockCheck = false;
-// return;
-// }
-// List<ParamType> params = inputType.getParam();
-//
-// if (checked) {
-// boolean newOne = true;
-// for (Iterator<?> iterator = params.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// if (SmooksModelUtils.PARAM_NAME_ACTIVED.equals(paramType.getName())) {
-// Command setCommand = SetCommand.create(getEditingDomain(), paramType,
-// GraphPackage.Literals.PARAM_TYPE__VALUE, String.valueOf(checked));
-// getEditingDomain().getCommandStack().execute(setCommand);
-// newOne = false;
-// break;
-// }
-// }
-// if (newOne) {
-// ParamType p = GraphFactory.eINSTANCE.createParamType();
-// p.setName(SmooksModelUtils.PARAM_NAME_ACTIVED);
-// p.setValue(String.valueOf(checked));
-// Command addCommand = AddCommand.create(getEditingDomain(), inputType,
-// GraphPackage.Literals.INPUT_TYPE__PARAM, p);
-// getEditingDomain().getCommandStack().execute(addCommand);
-// inputType.getParam().add(p);
-// }
-//
-// Object[] checkedObjects = inputDataViewer.getCheckedElements();
-// for (int i = 0; i < checkedObjects.length; i++) {
-// InputType type = (InputType) checkedObjects[i];
-// if (type == event.getElement())
-// continue;
-// List<ParamType> params1 = type.getParam();
-// for (Iterator<?> iterator = params1.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// if (SmooksModelUtils.PARAM_NAME_ACTIVED.equals(paramType.getName())) {
-// Command setCommand = SetCommand.create(getEditingDomain(), paramType,
-// GraphPackage.Literals.PARAM_TYPE__VALUE, String.valueOf(!checked));
-// getEditingDomain().getCommandStack().execute(setCommand);
-// break;
-// }
-// }
-// lockCheck = true;
-// inputDataViewer.setChecked(type, false);
-// lockCheck = false;
-// }
-//
-// } else {
-// for (Iterator<?> iterator = params.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// if (SmooksModelUtils.PARAM_NAME_ACTIVED.equals(paramType.getName())) {
-// Command setCommand = SetCommand.create(getEditingDomain(), paramType,
-// GraphPackage.Literals.PARAM_TYPE__VALUE, String.valueOf(checked));
-// getEditingDomain().getCommandStack().execute(setCommand);
-//
-// break;
-// }
-// }
-// }
-//
-// SmooksGraphicsExtType ext = getSmooksGraphicsExtType();
-// if (ext != null) {
-// List<ISmooksGraphChangeListener> listeners = ((SmooksGraphicsExtType)
ext).getChangeListeners();
-// for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
-// ISmooksGraphChangeListener smooksGraphChangeListener =
(ISmooksGraphChangeListener) iterator
-// .next();
-// smooksGraphChangeListener.inputTypeChanged((SmooksGraphicsExtType) ext);
-// }
-// }
-//
-// }
-// });
-// TableColumn header = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
-// header.setText("Type");
-// header.setWidth(100);
-// TableColumn pathColumn = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
-// pathColumn.setText("Path");
-// pathColumn.setWidth(300);
-//
-// // TableColumn extColumn = new TableColumn(inputDataViewer.getTable(),
-// // SWT.NONE);
-// // extColumn.setText("Extension Paramers");
-// // extColumn.setWidth(400);
-// inputDataViewer.setContentProvider(new ExtentionInputContentProvider());
-// inputDataViewer.setLabelProvider(new InputDataViewerLabelProvider());
-// inputDataViewer.getTable().setHeaderVisible(true);
-// inputDataViewer.getTable().setLinesVisible(true);
-// SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
-// if (extType != null) {
-// inputDataViewer.setInput(extType);
-// }
-// Composite buttonComposite = toolkit.createComposite(mainComposite, SWT.NONE);
-// gd = new GridData(GridData.FILL_VERTICAL);
-// buttonComposite.setLayoutData(gd);
-// GridLayout l = new GridLayout();
-// buttonComposite.setLayout(l);
-//
-// Button addButton = toolkit.createButton(buttonComposite, "Add", SWT.FLAT);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// addButton.setLayoutData(gd);
-// addButton.addSelectionListener(new SelectionAdapter() {
-//
-// public void widgetSelected(SelectionEvent e) {
-// showInputDataWizard();
-// }
-//
-// });
-//
-// Button removeButton = toolkit.createButton(buttonComposite, "Delete",
SWT.FLAT);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// removeButton.setLayoutData(gd);
-// removeButton.addSelectionListener(new SelectionAdapter() {
-//
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection)
inputDataViewer.getSelection();
-// if (selection != null) {
-// SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
-// if (extType != null) {
-// boolean canFireEvent = false;
-// Command rc = RemoveCommand.create(getEditingDomain(), selection.toList());
-// if (rc.canExecute()) {
-// getEditingDomain().getCommandStack().execute(rc);
-// canFireEvent = true;
-// }
-//
-// if (!canFireEvent)
-// return;
-//
-// List<ISmooksGraphChangeListener> listeners = extType.getChangeListeners();
-// for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
-// ISmooksGraphChangeListener smooksGraphChangeListener =
(ISmooksGraphChangeListener) iterator
-// .next();
-// smooksGraphChangeListener.inputTypeChanged(extType);
-// }
-// }
-// }
-// }
-// });
-// }
-//
-// protected SmooksGraphicsExtType getSmooksGraphicsExtType() {
-// SmooksGraphicsExtType extType = ((Smooks10MultiFormEditor)
getEditor()).getSmooksGraphicsExt();
-// return extType;
-// }
-//
-// protected AdapterFactoryEditingDomain getEditingDomain() {
-// AdapterFactoryEditingDomain editDomain = (AdapterFactoryEditingDomain)
((Smooks10MultiFormEditor) this
-// .getEditor()).getEditingDomain();
-// return editDomain;
-// }
-//
-// protected SmooksResourceListType getSmooksConfigResourceList() {
-// EObject doc = ((Smooks10MultiFormEditor) this.getEditor()).getSmooksModel();
-// if (doc instanceof DocumentRoot) {
-// return ((DocumentRoot) doc).getSmooksResourceList();
-// }
-// return null;
-// }
-//
-// protected void showInputDataWizard() {
-// StructuredDataSelectionWizard wizard = new StructuredDataSelectionWizard();
-// wizard.setInput(getEditorInput());
-// wizard.setSite(getEditorSite());
-// wizard.setForcePreviousAndNextButtons(true);
-// StructuredDataSelectionWizardDailog dialog = new
StructuredDataSelectionWizardDailog(
-// getEditorSite().getShell(), wizard, getSmooksGraphicsExtType());
-// if (dialog.show() == Dialog.OK) {
-// SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
-// String type = dialog.getType();
-// String path = dialog.getPath();
-// Properties pros = dialog.getProperties();
-// SmooksUIUtils.recordInputDataInfomation(getEditingDomain(), null, extType, type,
path, pros);
-// }
-// }
-//
-// private void refreshInputModelView() {
-// if (inputModelViewer != null) {
-// List<Object> input = generateInputData();
-// inputModelViewer.setInput(input);
-// SmooksUIUtils.expandSelectorViewer(input, inputModelViewer);
-// }
-// }
-//
-// public void inputTypeChanged(SmooksGraphicsExtType extType) {
-// if (inputDataViewer != null)
-// inputDataViewer.refresh();
-// refreshInputModelView();
-// }
-//
-// protected void disposeCompositeControls(Composite composite, Control[] ignoreControl)
{
-// if (composite != null) {
-// Control[] children = composite.getChildren();
-// for (int i = 0; i < children.length; i++) {
-// Control child = children[i];
-// if (ignoreControl != null) {
-// for (int j = 0; j < ignoreControl.length; j++) {
-// if (child == ignoreControl[j]) {
-// continue;
-// }
-// }
-// }
-// child.dispose();
-// child = null;
-// }
-// }
-// }
-//
-// private Object getCurrentReaderModel() {
-// if (readerCombo == null || readerCombo.isDisposed())
-// return null;
-// int index = readerCombo.getSelectionIndex();
-// if (index < 0)
-// return null;
-// return readerTypeList.get(index);
-// }
-//
-// public void sourceChange(Object model) {
-// bindingReaderCombo();
-// initReaderCombo();
-// initReaderConfigSection();
-// if (inputDataViewer != null) {
-// inputDataViewer.setInput(getSmooksGraphicsExtType());
-// inputDataViewer.refresh();
-// }
-// refreshInputModelView();
-// }
-//
-// public void graphChanged(SmooksGraphicsExtType extType) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// public void graphPropertyChange(EStructuralFeature featre, Object value) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// public void validateEnd(List<Diagnostic> diagnosticResult) {
-// Object model = getCurrentReaderModel();
-// if (model == null)
-// return;
-// if (model instanceof EObject) {
-// this.getModelPanelCreator().markPropertyUI(diagnosticResult, (EObject) model);
-// }
-// }
-//
-// public void validateStart() {
-//
-// }
-//
-// protected boolean isIncorrectInputType(InputType element) {
-// if (element == null)
-// return false;
-// if (element instanceof InputType) {
-// String type = ((InputType) element).getType();
-// int index = readerCombo.getSelectionIndex();
-// if (index == -1)
-// return true;
-//
-// Object reader = readerTypeList.get(index);
-// if (reader instanceof NullReader) {
-// return true;
-// }
-//
-// if (reader instanceof XMLReader) {
-// if (!SmooksModelUtils.INPUT_TYPE_XML.equals(type)) {
-// return true;
-// }
-// }
-// if (reader instanceof XSDReader) {
-// if (!SmooksModelUtils.INPUT_TYPE_XSD.equals(type)) {
-// return true;
-// }
-// }
-// if (reader instanceof JavaReader) {
-// if (!SmooksModelUtils.INPUT_TYPE_JAVA.equals(type)) {
-// return true;
-// }
-// }
-//
-// }
-// return false;
-// }
-//
-// private class NullReader {
-//
-// }
-//
-// private class XMLReader {
-//
-// }
-//
-// private class XSDReader {
-//
-// }
-//
-// private class JavaReader {
-//
-// }
-//
-// private class InputDataViewerLabelProvider extends ExtentionInputLabelProvider
implements ITableColorProvider {
-//
-// public Color getBackground(Object element, int columnIndex) {
-// if (isIncorrectInputType((InputType) element)) {
-// // return ColorConstants.darkGray;
-// }
-// return null;
-// }
-//
-// public Color getForeground(Object element, int columnIndex) {
-// if (isIncorrectInputType((InputType) element)) {
-// return ColorConstants.lightGray;
-// }
-// return null;
-// }
-// }
-}
Deleted:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10MultiFormEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10MultiFormEditor.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10MultiFormEditor.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration.editors_10;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.PartInitException;
-import org.jboss.tools.smooks.configuration.editors.SmooksConfigurationFormPage;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-
-/**
- *
- * @author Dart Peng (dpeng(a)redhat.com) Date Apr 1, 2009
- */
-public class Smooks10MultiFormEditor extends AbstractSmooksFormEditor implements
ISelectionProvider {
-
- public static final String EDITOR_ID =
"org.jboss.tools.smooks.configuration.editors.MultiPageEditor_1_0";
-
- private SmooksConfigurationFormPage configurationPage;
-
- private Smooks10ConfigurationOverviewPage overViewPage;
-
- private Smooks10InputFormPage readerPage;
-
- private ISelection selection;
-
- private Collection<ISelectionChangedListener> selectionChangeListener = new
ArrayList<ISelectionChangedListener>();
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.tools.smooks.editor.AbstractSmooksFormEditor#addPages()
- */
- @Override
- protected void addPages() {
- overViewPage = createSmooksConfigurationOverviewPage();
- addValidateListener(overViewPage);
- addSourceSynchronizeListener(overViewPage);
- // addSmooksGraphExtetionListener(overViewPage);
- try {
- int index = this.addPage(overViewPage);
- setPageText(index, "Overview");
- } catch (PartInitException e) {
- e.printStackTrace();
- }
-
- // readerPage = new Smooks10InputFormPage(this, "reader_page",
"Input");
- // addValidateListener(readerPage);
- // addSourceSynchronizeListener(readerPage);
- // // addSmooksGraphExtetionListener(readerPage);
- // try {
- // int index = this.addPage(readerPage);
- // setPageText(index, "Input");
- // } catch (PartInitException e) {
- // e.printStackTrace();
- // }
-
- configurationPage = createSmooksConfigurationFormPage();
- addValidateListener(configurationPage);
- addSourceSynchronizeListener(configurationPage);
- // addSmooksGraphExtetionListener(configurationPage);
- try {
- int index = this.addPage(configurationPage);
- setPageText(index, "Message Filter");
- } catch (PartInitException e) {
- e.printStackTrace();
- }
-
- super.addPages();
- }
-
- // @Override
- // protected SmooksGraphicsExtType createSmooksGraphcsExtType(Object
- // smooksModel) {
- // SmooksResourceListType resourceList = null;
- // if (smooksModel instanceof DocumentRoot) {
- // resourceList = ((DocumentRoot) smooksModel).getSmooksResourceList();
- // }
- //
- // if (resourceList == null) {
- // return null;
- // }
- //
- // FeatureMap map = resourceList.getMixed();
- // Object obj =
- //
map.get(GraphPackage.Literals.SMOOKS_GRAPH_EXTENSION_DOCUMENT_ROOT__SMOOKS_GRAPHICS_EXT,
- // true);
- // if(obj instanceof List<?>){
- // if(((List<?>)obj).isEmpty()){
- // ((List<Object>)obj).add(GraphFactory.eINSTANCE.createSmooksGraphicsExtType());
- // }
- // Object oooo = ((List<?>)obj).get(0);
- // if(oooo instanceof SmooksGraphicsExtType){
- // return ((SmooksGraphicsExtType)oooo);
- // }
- // }
- // return null;
- // }
- //
- // @Override
- // protected void generateSmooksGraphExtWithSave() {
- // super.generateSmooksGraphExtWithSave();
- // }
-
- private Smooks10ConfigurationOverviewPage createSmooksConfigurationOverviewPage() {
- return new Smooks10ConfigurationOverviewPage(this, "overview_page",
"Overview", this);
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- super.doSave(monitor);
- }
-
- protected SmooksConfigurationFormPage createSmooksConfigurationFormPage() {
- return new Smooks10ConfigurationResourceConfigPage(this,
"message_filter_page", "Design Page");
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.editor.AbstractSmooksFormEditor#
- * activeRecentAffectedModel(java.util.Collection)
- */
- @Override
- public void activeRecentAffectedModel(Collection<?> collection) {
- final Collection<?> theSelection = collection;
- if (theSelection != null && !theSelection.isEmpty() &&
configurationPage != null) {
- List<Object> newList = new ArrayList<Object>();
- for (Iterator<?> iterator = theSelection.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
- // if (object instanceof IWrapperItemProvider) {
- // newList.add(((IWrapperItemProvider) object).getValue());
- // }
- newList.add(object);
- }
- configurationPage.setSelectionToViewer(newList);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.editor.AbstractSmooksFormEditor#
- * createNewModelViaTextPage()
- */
- @Override
- protected void createNewModelViaTextPage() {
- super.createNewModelViaTextPage();
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangeListener.add(listener);
- }
-
- public ISelection getSelection() {
- return this.selection;
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangeListener.remove(listener);
- }
-
- public void setSelection(ISelection selection) {
- if (selection != null) {
- if (selection.equals(this.selection)) {
- return;
- }
- }
- this.selection = selection;
-
- for (Iterator<?> iterator = this.selectionChangeListener.iterator();
iterator.hasNext();) {
- ISelectionChangedListener l = (ISelectionChangedListener) iterator.next();
- l.selectionChanged(new SelectionChangedEvent(this, getSelection()));
- }
- }
-
- // public void addSmooksGraphExtetionListener(ISmooksGraphChangeListener
- // listener) {
- // SmooksGraphicsExtType ex = getSmooksGraphicsExt();
- // if (ex != null) {
- // ex.addSmooksGraphChangeListener(listener);
- // }
- // }
- //
- // public void removeSmooksGraphExtetionListener(ISmooksGraphChangeListener
- // listener) {
- // SmooksGraphicsExtType ex = getSmooksGraphicsExt();
- // if (ex != null) {
- // ex.removeSmooksGraphChangeListener(listener);
- // }
- // }
-}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -92,6 +92,9 @@
sperator = " ";
}
if (feature != null && path != null) {
+ if("#document".equals(path)){
+ return null;
+ }
Object node = null;
for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
Object obj = (Object) iterator.next();
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -61,8 +61,8 @@
import org.jboss.tools.smooks.model.json.provider.JsonItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.medi.provider.MEdiItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
+import org.jboss.tools.smooks.model.smooks.util.SmooksResourceFactoryImpl;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
-import org.jboss.tools.smooks10.model.smooks.util.SmooksResourceFactoryImpl;
/**
* @author Dart (dpeng(a)redhat.com)
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -32,7 +32,6 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
-import org.jboss.tools.smooks.configuration.editors_10.Smooks10MultiFormEditor;
/**
*
@@ -139,9 +138,6 @@
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
FileEditorInput editorInput = new FileEditorInput(configFile);
try {
- if (fversion.equals(SmooksConstants.VERSION_1_0)) {
- page.openEditor(editorInput, Smooks10MultiFormEditor.EDITOR_ID, true);
- }
if (fversion.equals(SmooksConstants.VERSION_1_1) ||
fversion.equals(SmooksConstants.VERSION_1_2)) {
page.openEditor(editorInput, SmooksMultiFormEditor.EDITOR_ID, true);
}
@@ -191,15 +187,6 @@
private InputStream openContentStream(String version) {
String contents = "";
- if (SmooksConstants.VERSION_1_0.equals(version)) {
- 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\" xmlns:graph =
\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\">\n"//$NON-NLS-1$
- + " <resource-config
selector=\"global-parameters\">\n"//$NON-NLS-1$
- + " <param
name=\"stream.filter.type\">SAX</param>\n"//$NON-NLS-1$
- + " </resource-config>\n"//$NON-NLS-1$
- + " <graph:smooks-graphics-ext platformVersion =
\"1.0\"/>\n"//$NON-NLS-1$
- + "</smooks-resource-list>"; //$NON-NLS-1$
- }
if (SmooksConstants.VERSION_1_1.equals(version)) {
contents = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
+ "<smooks-resource-list
xmlns=\"http://www.milyn.org/xsd/smooks-1.1.xsd\" xmlns:graph =
\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\">\n"//$NON-NLS-1$
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -92,9 +92,9 @@
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.ParamType;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
+import org.jboss.tools.smooks.model.smooks.util.SmooksResourceFactoryImpl;
import
org.jboss.tools.smooks.model.validation10.provider.Validation10ItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
-import org.jboss.tools.smooks10.model.smooks.util.SmooksResourceFactoryImpl;
public class AbstractSmooksFormEditor extends FormEditor implements
IEditingDomainProvider,
ISmooksModelValidateListener, ISmooksModelProvider {
@@ -239,14 +239,18 @@
}
protected void fillComments(Document document, EObject rootModel) {
- if (rootModel instanceof DocumentRoot) {
- EObject rootElementModel = ((DocumentRoot) rootModel).getSmooksResourceList();
- Element rootElement = document.getRootElement();
- try {
- fillComments(rootElementModel, rootElement);
- } catch (Exception e) {
- e.printStackTrace();
+ try {
+ if (rootModel instanceof DocumentRoot) {
+ EObject rootElementModel = ((DocumentRoot) rootModel).getSmooksResourceList();
+ Element rootElement = document.getRootElement();
+ try {
+ fillComments(rootElementModel, rootElement);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
+ } catch (Throwable t) {
+ // ignore exception;
}
}
@@ -362,10 +366,6 @@
protected void initEditingDomain() {
adapterFactory = new
ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- // add smooks 1.0 item provider model
- adapterFactory
- .addAdapterFactory(new
org.jboss.tools.smooks10.model.smooks.provider.SmooksItemProviderAdapterFactory());
-
// add smooks 1.1.2 EMF item provider model
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new XslItemProviderAdapterFactory());
@@ -662,9 +662,6 @@
public EObject getSmooksResourceList() {
EObject m = null;
EObject smooksModel = getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
if (smooksModel instanceof DocumentRoot) {
m = ((DocumentRoot) smooksModel).getSmooksResourceList();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -385,7 +385,8 @@
mappingList.addAll(mappings);
}
} catch (Exception e) {
- e.printStackTrace();
+ // ignore exception
+// e.printStackTrace();
}
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -891,9 +891,6 @@
if (smooksModelProvider != null) {
EObject m = null;
EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
if (smooksModel instanceof DocumentRoot) {
m = ((DocumentRoot) smooksModel).getSmooksResourceList();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -94,8 +94,8 @@
*
*/
public class SmooksProcessGraphicalEditor extends FormPage implements
ISelectionChangedListener,
- ISourceSynchronizeListener, IPropertyListener, ISmooksModelValidateListener,
- IProcessProvider, PropertyChangeListener {
+ ISourceSynchronizeListener, IPropertyListener, ISmooksModelValidateListener,
IProcessProvider,
+ PropertyChangeListener {
private List<IAction> processPanelActions = new ArrayList<IAction>();
@@ -705,12 +705,12 @@
});
}
-// public SmooksGraphicsExtType getSmooksGraphicsExtType() {
-// if (smooksModelProvider != null) {
-// return smooksModelProvider.getSmooksGraphicsExt();
-// }
-// return null;
-// }
+ // public SmooksGraphicsExtType getSmooksGraphicsExtType() {
+ // if (smooksModelProvider != null) {
+ // return smooksModelProvider.getSmooksGraphicsExt();
+ // }
+ // return null;
+ // }
/**
* @return the smooksModelProvider
@@ -731,9 +731,6 @@
if (smooksModelProvider != null) {
EObject m = null;
EObject smooksModel = smooksModelProvider.getSmooksModel();
- if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
smooksModel).getSmooksResourceList();
- }
if (smooksModel instanceof DocumentRoot) {
m = ((DocumentRoot) smooksModel).getSmooksResourceList();
}
@@ -915,7 +912,7 @@
if (!isSingltonEditor(id)) {
String idref = generateTaskSpecailID((TaskType) model);
if (idref != null) {
-// idref = id + "_" + idref;
+ // idref = id + "_" + idref;
if (getRegisteTaskPage(idref) == null) {
IEditorPart editor = createEditorPart(id);
this.registeTaskDetailsPage(editor, idref);
@@ -1039,35 +1036,36 @@
// }
}
-// public void graphChanged(SmooksGraphicsExtType extType) {
-// Collection<Object> editors = registedTaskPages.values();
-// for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
-// Object object = (Object) iterator.next();
-// if (object instanceof ISmooksGraphChangeListener) {
-// ((ISmooksGraphChangeListener) object).graphChanged(extType);
-// }
-// }
-// }
+ // public void graphChanged(SmooksGraphicsExtType extType) {
+ // Collection<Object> editors = registedTaskPages.values();
+ // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
+ // Object object = (Object) iterator.next();
+ // if (object instanceof ISmooksGraphChangeListener) {
+ // ((ISmooksGraphChangeListener) object).graphChanged(extType);
+ // }
+ // }
+ // }
-// public void graphPropertyChange(EStructuralFeature featre, Object value) {
-// Collection<Object> editors = registedTaskPages.values();
-// for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
-// Object object = (Object) iterator.next();
-// if (object instanceof ISmooksGraphChangeListener) {
-// ((ISmooksGraphChangeListener) object).graphPropertyChange(featre, value);
-// }
-// }
-// }
+ // public void graphPropertyChange(EStructuralFeature featre, Object value)
+ // {
+ // Collection<Object> editors = registedTaskPages.values();
+ // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
+ // Object object = (Object) iterator.next();
+ // if (object instanceof ISmooksGraphChangeListener) {
+ // ((ISmooksGraphChangeListener) object).graphPropertyChange(featre, value);
+ // }
+ // }
+ // }
-// public void inputTypeChanged(SmooksGraphicsExtType extType) {
-// Collection<Object> editors = registedTaskPages.values();
-// for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
-// Object object = (Object) iterator.next();
-// if (object instanceof ISmooksGraphChangeListener) {
-// ((ISmooksGraphChangeListener) object).inputTypeChanged(extType);
-// }
-// }
-// }
+ // public void inputTypeChanged(SmooksGraphicsExtType extType) {
+ // Collection<Object> editors = registedTaskPages.values();
+ // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
+ // Object object = (Object) iterator.next();
+ // if (object instanceof ISmooksGraphChangeListener) {
+ // ((ISmooksGraphChangeListener) object).inputTypeChanged(extType);
+ // }
+ // }
+ // }
public void propertyChanged(Object source, int propId) {
this.firePropertyChange(propId);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessType.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessType.java 2009-11-28
08:59:12 UTC (rev 18898)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessType.java 2009-11-28
09:12:26 UTC (rev 18899)
@@ -36,7 +36,7 @@
public static final String PRO_ADD_CHILD = "pro_add_child";
- public static final String PRO_REMOVE_CHILD = "pro_add_child";
+ public static final String PRO_REMOVE_CHILD = "pro_remove_child";
public void addPropertyChangeListener(PropertyChangeListener listener);