JBoss Tools SVN: r19010 - branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-12-02 17:27:59 -0500 (Wed, 02 Dec 2009)
New Revision: 19010
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5312
Smooks Run Configuration - needs unique name to avoid collisions
Updated to use ILaunchManager.generateUniqueLaunchConfigurationNameFrom
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-02 22:22:40 UTC (rev 19009)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-02 22:27:59 UTC (rev 19010)
@@ -58,6 +58,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -184,8 +185,9 @@
if(editorInput instanceof FileEditorInput) {
FileEditorInput fileEI = (FileEditorInput) editorInput;
IFile file = fileEI.getFile();
+ String configName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(editor.getTitle());
- launchConfigWC.rename("[" + file.getProject().getName() + "]" + editor.getTitle());
+ launchConfigWC.rename(configName);
launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName()); //$NON-NLS-1$
launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, file.getProjectRelativePath().toString()); //$NON-NLS-1$
}
15 years, 1 month
JBoss Tools SVN: r19009 - in branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-12-02 17:22:40 -0500 (Wed, 02 Dec 2009)
New Revision: 19009
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/commands/CreateJavaBeanModelCommand.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
Log:
More changes for https://jira.jboss.org/jira/browse/JBIDE-5311 - Need help from Dart!!!
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/commands/CreateJavaBeanModelCommand.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/commands/CreateJavaBeanModelCommand.java 2009-12-02 20:47:35 UTC (rev 19008)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/commands/CreateJavaBeanModelCommand.java 2009-12-02 22:22:40 UTC (rev 19009)
@@ -80,28 +80,23 @@
if (editorPart instanceof SmooksGraphicalEditorPart) {
resourceListType = ((SmooksGraphicalEditorPart) editorPart).getSmooksResourceListType();
}
-
- JavaBeanModel javaBeanModel = wizard.getJavaBeanModel();
- if(javaBeanModel != null) {
- List<Object> models = createJavaBeanModel(type, javaBeanModel, wizard.getBindings(),
- resourceListType, new ArrayList<String>());
- String figureID = null;
- int index = 0;
- List<Object> creationModels = new ArrayList<Object>();
-
- if (collections instanceof FeatureMap.Entry) {
- for (Iterator<?> iterator = models.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
- creationModels.add(FeatureMapUtil.createEntry(((FeatureMap.Entry) collections)
- .getEStructuralFeature(), object));
- }
+ List<Object> models = createJavaBeanModel(type, wizard.getJavaBeanModel(), wizard.getBindings(),
+ resourceListType, new ArrayList<String>());
+ String figureID = null;
+ int index = 0;
+
+ List<Object> creationModels = new ArrayList<Object>();
+
+ if (collections instanceof FeatureMap.Entry) {
+ for (Iterator<?> iterator = models.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ creationModels.add(FeatureMapUtil.createEntry(((FeatureMap.Entry) collections)
+ .getEStructuralFeature(), object));
}
- collections = creationModels;
-
- emfCommand = AddCommand.create(domain, owner, feature, creationModels);
- } else {
- // TODO: There is no "model" e.g. for a Collection type... what do we do??
}
+ collections = creationModels;
+
+ emfCommand = AddCommand.create(domain, owner, feature, creationModels);
} else {
throw new IgnoreException();
}
@@ -127,7 +122,7 @@
if (parent instanceof BeanType) {
((BeanType) parent).setBeanId(beanID);
((BeanType) parent).setClass(parentBeanModel.getBeanClassString());
- if (properties != null) {
+ if (properties != null && properties.length > 0) {
for (int i = 0; i < properties.length; i++) {
Object pro = properties[i];
if (pro instanceof JavaBeanModel && belongsToMe(parentBeanModel, (JavaBeanModel) pro)) {
@@ -151,6 +146,9 @@
}
}
}
+ } else if(parentBeanModel.isList()) {
+ WiringType value = Javabean12Factory.eINSTANCE.createWiringType();
+ ((BeanType) parent).getWiring().add(value);
}
}
if (parent instanceof BindingsType) {
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-12-02 20:47:35 UTC (rev 19008)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-12-02 22:22:40 UTC (rev 19009)
@@ -408,32 +408,17 @@
ProjectClassLoader loader = new ProjectClassLoader(project);
javaBeanModel = null;
isCollection = isCollectionClass(beanClass);
- if (isCollection) {
- if (collectionClass != null) {
- Class<?> clazz = loader.loadClass(beanClass);
- Class<?> cclazz = loader.loadClass(collectionClass);
- javaBeanModel = JavaBeanModelFactory
- .getJavaBeanModelWithLazyLoad(clazz);
- javaBeanModel.setComponentClass(cclazz);
- } else {
- viewer.setInput(""); //$NON-NLS-1$
- }
- } else {
- Class<?> clazz = loader.loadClass(beanClass);
- if (isArray) {
- Object arrayInstance = Array.newInstance(clazz, 0);
- clazz = arrayInstance.getClass();
- }
- javaBeanModel = JavaBeanModelFactory
- .getJavaBeanModelWithLazyLoad(clazz);
- }
+ Class<?> clazz = loader.loadClass(beanClass);
+
+ javaBeanModel = JavaBeanModelFactory.getJavaBeanModelWithLazyLoad(clazz);
if (javaBeanModel != null) {
if (beanID != null) {
javaBeanModel.setName(beanID);
}
- viewer.setInput(javaBeanModel.getChildren());
- viewer.setCheckedElements(javaBeanModel.getChildren()
- .toArray());
+ if(!isCollection) {
+ viewer.setInput(javaBeanModel.getChildren());
+ }
+ viewer.setCheckedElements(javaBeanModel.getChildren().toArray());
} else {
viewer.setInput(""); //$NON-NLS-1$
}
15 years, 1 month
JBoss Tools SVN: r19007 - trunk/cdi/plugins/org.jboss.tools.cdi.core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-02 15:09:07 -0500 (Wed, 02 Dec 2009)
New Revision: 19007
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5355
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-02 20:04:07 UTC (rev 19006)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-02 20:09:07 UTC (rev 19007)
@@ -32,7 +32,7 @@
<project-facet
id="jst.cdi">
<label>
- CDI
+ Contexts and Dependency Injection
</label>
<description>
Enables the project to work with CDI
15 years, 1 month
JBoss Tools SVN: r19006 - in trunk/cdi/plugins: org.jboss.tools.cdi.core/META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-02 15:04:07 -0500 (Wed, 02 Dec 2009)
New Revision: 19006
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDataModelProvider.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetUninstallDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/ICDIFacetDataModelProperties.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5355
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-12-02 18:09:08 UTC (rev 19005)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-12-02 20:04:07 UTC (rev 19006)
@@ -10,9 +10,16 @@
org.jboss.tools.common,
org.eclipse.jdt.core,
org.eclipse.core.resources,
- org.jboss.tools.common.model
+ org.jboss.tools.common.model,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.frameworks,
+ org.jboss.tools.jst.web.kb
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: JBoss by Red Hat
Export-Package: org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.internal.core.impl,
+ org.jboss.tools.cdi.internal.core.project.facet,
+ org.jboss.tools.cdi.internal.core.scanner,
org.jboss.tools.cdi.internal.core.scanner.lib
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-02 18:09:08 UTC (rev 19005)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-02 20:04:07 UTC (rev 19006)
@@ -27,4 +27,60 @@
</builder>
</extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <project-facet
+ id="jst.cdi">
+ <label>
+ CDI
+ </label>
+ <description>
+ Enables the project to work with CDI
+ </description>
+ </project-facet>
+ <project-facet-version
+ facet="jst.cdi"
+ version="1.0">
+ <constraint>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </constraint>
+ </project-facet-version>
+ <action
+ facet="jst.cdi"
+ id="jst.cdi.1.0.install"
+ type="install"
+ version="1.0">
+ <delegate
+ class="org.jboss.tools.cdi.internal.core.project.facet.CDIFacetInstallDelegate">
+ </delegate>
+ <config-factory
+ class="org.jboss.tools.cdi.internal.core.project.facet.CDIFacetInstallDataModelProvider">
+ </config-factory>
+ </action>
+ <action
+ facet="jst.cdi"
+ id="jst.cdi.1.0.uninstall"
+ type="uninstall"
+ version="1.0">
+ <delegate
+ class="org.jboss.tools.cdi.internal.core.project.facet.CDIFacetUninstallDelegate">
+ </delegate>
+ </action>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <runtime-component
+ any="true">
+ </runtime-component>
+ <facet
+ id="jst.cdi"
+ version="[1.0">
+ </facet>
+ </supported>
+ </extension>
</plugin>
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.cdi.core;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDICoreMessages {
+ private static final String BUNDLE_NAME = "org.jboss.tools.cdi.core.messages"; //$NON-NLS-1$
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, CDICoreMessages.class);
+ }
+
+ public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED;
+ public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW;
+ public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR;
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.cdi.core;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.kb.IKbProject;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIUtil {
+
+ /**
+ * Adds CDI and KB builders to the project.
+ *
+ * @param project
+ */
+ public static void enableCDI(IProject project) {
+ try {
+ EclipseUtil.addNatureToProject(project, CDICoreNature.NATURE_ID);
+ if (!project.hasNature(IKbProject.NATURE_ID)) {
+ EclipseResourceUtil.addNatureToProject(project,
+ IKbProject.NATURE_ID);
+ }
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+
+ /**
+ * Removes CDI builder from the project.
+ *
+ * @param project
+ */
+ public static void disableCDI(IProject project) {
+ try {
+ EclipseUtil.removeNatureFromProject(project,
+ CDICoreNature.NATURE_ID);
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,3 @@
+CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR=Error
+CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED=Error occured during installing CDI facet
+CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW=Check Errors View for details
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDataModelProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDataModelProvider.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDataModelProvider.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.cdi.internal.core.project.facet;
+
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+
+/**
+ * Data model provider for CDI facet wizard page
+ *
+ * @author Alexey Kazakov
+ *
+ */
+public class CDIFacetInstallDataModelProvider extends FacetInstallDataModelProvider implements ICDIFacetDataModelProperties {
+ /**
+ * Returns default value for a given property
+ *
+ * @param propertyName name of property which default value requested
+ * @return default value
+ */
+ public Object getDefaultProperty(String propertyName) {
+ if (propertyName.equals(FACET_ID)) {
+ return ICDIFacetDataModelProperties.CDI_FACET_ID;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDataModelProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDelegate.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDelegate.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.cdi.internal.core.project.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.cdi.core.CDICoreMessages;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.CDIUtil;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIFacetInstallDelegate implements ILogListener, IDelegate,
+ ICDIFacetDataModelProperties {
+
+ private boolean errorOccurs = false;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.ILogListener#logging(org.eclipse.core.runtime.IStatus, java.lang.String)
+ */
+ public void logging(IStatus status, String plugin) {
+ if(status.getPlugin().equals(CDICorePlugin.PLUGIN_ID)) {
+ errorOccurs = true;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ CDIUtil.enableCDI(project);
+ if(errorOccurs) {
+ errorOccurs = false;
+ Display.getDefault().syncExec(
+ new Runnable() {
+ public void run() {
+ ErrorDialog.openError(Display.getCurrent().getActiveShell(),
+ CDICoreMessages.CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR,
+ CDICoreMessages.CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW,
+ new Status(IStatus.ERROR,CDICorePlugin.PLUGIN_ID,
+ CDICoreMessages.CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED));
+ }
+ });
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.common.project.facet.core.IActionConfigFactory#create()
+ */
+ public Object create() throws CoreException {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetInstallDelegate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetUninstallDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetUninstallDelegate.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetUninstallDelegate.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.cdi.internal.core.project.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.cdi.core.CDIUtil;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIFacetUninstallDelegate implements IDelegate {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ CDIUtil.disableCDI(project);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/CDIFacetUninstallDelegate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/ICDIFacetDataModelProperties.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/ICDIFacetDataModelProperties.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/ICDIFacetDataModelProperties.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.cdi.internal.core.project.facet;
+
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+/**
+ * CDI facet properties.
+
+ * @author Alexey Kazakov
+ */
+public interface ICDIFacetDataModelProperties extends IActionConfigFactory {
+
+ /**
+ * CDI Facet ID constant
+ */
+ String CDI_FACET_ID = "jst.cdi"; //$NON-NLS-1$
+
+ /**
+ * CDI 1.0 Facet Version constant
+ */
+ String CDI_FACET_VERSION_1 = "1.0"; //$NON-NLS-1$
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/project/facet/ICDIFacetDataModelProperties.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2009-12-02 18:09:08 UTC (rev 19005)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2009-12-02 20:04:07 UTC (rev 19006)
@@ -14,4 +14,5 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.jboss.tools.cdi.ui
+Export-Package: org.jboss.tools.cdi.ui,
+ org.jboss.tools.cdi.ui.preferences
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java 2009-12-02 18:09:08 UTC (rev 19005)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDISettingsPreferencePage.java 2009-12-02 20:04:07 UTC (rev 19006)
@@ -14,17 +14,14 @@
import java.beans.PropertyChangeListener;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.ui.CommonUIPlugin;
+import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.common.ui.preferences.SettingsPage;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
@@ -119,19 +116,11 @@
if(project==null) {
return;
}
- try {
- EclipseUtil.addNatureToProject(project, CDICoreNature.NATURE_ID);
- } catch (CoreException e) {
- CommonUIPlugin.getDefault().logError(e);
- }
+ CDIUtil.enableCDI(project);
}
private void removeCDISupport(IProject project) {
- try {
- EclipseUtil.removeNatureFromProject(project, CDICoreNature.NATURE_ID);
- } catch (CoreException e) {
- CommonUIPlugin.getDefault().logError(e);
- }
+ CDIUtil.disableCDI(project);
}
private boolean isCDIEnabled(IProject project) {
15 years, 1 month
JBoss Tools SVN: r19005 - in trunk/jsf: tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-12-02 13:09:08 -0500 (Wed, 02 Dec 2009)
New Revision: 19005
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/compositionWithoutTaglibs.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
Log:
Fixes tests and classes connected to JBIDE-5352
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-02 17:41:29 UTC (rev 19004)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-02 18:09:08 UTC (rev 19005)
@@ -55,6 +55,9 @@
while (parentNode != null) {
String parentSourcePrefix = parentNode.getPrefix();
+ if(parentSourcePrefix==null) {
+ parentSourcePrefix=""; //$NON-NLS-1$
+ }
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
pageContext);
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
@@ -107,6 +110,9 @@
for (int i = 0; i < children.getLength(); i++) {
Node childNode = children.item(i);
String childSourcePrefix = childNode.getPrefix();
+ if(childSourcePrefix==null) {
+ childSourcePrefix=""; //$NON-NLS-1$
+ }
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(childNode,
pageContext);
@@ -142,7 +148,7 @@
public static String getStyleAttr(Node sourceFontNode) {
if (sourceFontNode == null
- || !sourceFontNode.getNodeName().endsWith(":font")) { //$NON-NLS-1$
+ || !sourceFontNode.getNodeName().endsWith("font")) { //$NON-NLS-1$
return null;
}
String styleAttrValue = getFontFamily(sourceFontNode)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/compositionWithoutTaglibs.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/compositionWithoutTaglibs.xhtml.xml 2009-12-02 17:41:29 UTC (rev 19004)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/compositionWithoutTaglibs.xhtml.xml 2009-12-02 18:09:08 UTC (rev 19005)
@@ -5,30 +5,52 @@
</SPAN>
</test>
<test id="id3">
-
- <DIV CLASS="__any__tag__caption" STYLE="border: 1px solid green; -moz-user-modify: read-only;">
- ui:composition
- <DIV CLASS="__any__tag__caption"
- STYLE="border: 1px solid green; -moz-user-modify: read-only;">
- ui:define
- <SPAN CLASS="vpe-text">
- Greeting to User
+<DIV STYLE="-moz-user-modify: read-only;">
+<DIV STYLE="-moz-user-modify: read-only;">
+<DIV STYLE="display: none; -moz-user-modify: read-only;">
+<H1 STYLE="-moz-user-modify: read-only;">
+</H1>
+</DIV>
+<DIV STYLE="-moz-user-modify: read-only;">
+<TABLE WIDTH="400" CELLSPACING="0" CELLPADDING="0" BORDER="0" ALIGN="center" STYLE="border: 1px solid rgb(202, 214, 224); -moz-user-modify: read-only;">
+<TBODY STYLE="-moz-user-modify: read-only;">
+<TR STYLE="-moz-user-modify: read-only;">
+<TD WIDTH="100%" VALIGN="middle" HEIGHT="42" BGCOLOR="#e4ebeb" ALIGN="center" CLASS="header" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text">
+Greeting Page
</SPAN>
- </DIV>
- <DIV CLASS="__any__tag__caption"
- STYLE="border: 1px solid green; -moz-user-modify: read-only;">
- ui:define
- <SPAN CLASS="vpe-text">
- Greeting Page
+</TD>
+</TR>
+<TR STYLE="-moz-user-modify: read-only;">
+<TD WIDTH="100%" HEIGHT="1" BGCOLOR="#cad6e0" ALIGN="center" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+#{user}
</SPAN>
- </DIV>
- <DIV CLASS="__any__tag__caption"
- STYLE="border: 1px solid green; -moz-user-modify: read-only;">
- ui:define
- <SPAN CLASS="vpe-text">
- Hello #{person.name}!
+</TD>
+</TR>
+<TR STYLE="-moz-user-modify: read-only;">
+<TD WIDTH="100%" COLSPAN="2" STYLE="-moz-user-modify: read-only;">
+<TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BORDER="0" ALIGN="left" STYLE="height: 150px; -moz-user-modify: read-only;">
+<TBODY STYLE="-moz-user-modify: read-only;">
+<TR STYLE="-moz-user-modify: read-only;">
+<TD WIDTH="100%" VALIGN="middle" ALIGN="center" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text">
+Hello #{person.name}!
</SPAN>
- </DIV>
- </DIV>
+</TD>
+</TR>
+</TBODY>
+</TABLE>
+</TD>
+</TR>
+<TR STYLE="-moz-user-modify: read-only;">
+<TD WIDTH="100%" VALIGN="bottom" HEIGHT="1" BGCOLOR="#cad6e0" COLSPAN="2" STYLE="-moz-user-modify: read-only;">
+</TD>
+</TR>
+</TBODY>
+</TABLE>
+</DIV>
+</DIV>
+</DIV>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2009-12-02 17:41:29 UTC (rev 19004)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2009-12-02 18:09:08 UTC (rev 19005)
@@ -1,7 +1,7 @@
<tests>
<test id="jbide5352Test">
<DIV STYLE="margin: 36px;">
-<SPAN STYLE="">
+<SPAN STYLE="font-family: unknown; font-size: 24pt;">
<DIV><BR/>
<SPAN CLASS="vpe-text">
@@ -10,10 +10,10 @@
</DIV>
</SPAN>
<DIV>
-<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
-</TABLE>
-<DIV STYLE="display: none;">
-</DIV>
+<TABLE WIDTH="100%" CELLSPACING="0px" ALIGN="center">
+<TR>
+<TD VALIGN="middle" ALIGN="center" STYLE="border: 2px solid black;">
+</TD>
<TD COLSPAN="2" STYLE="border: 2px solid black;">
<DIV><BR/>
@@ -30,6 +30,8 @@
</SPAN>
</DIV>
</TD>
+</TR>
+<TR>
<TD STYLE="border: 2px solid black;">
<DIV><BR/>
@@ -54,6 +56,8 @@
</SPAN>
</DIV>
</TD>
+</TR>
+<TR>
<TD STYLE="border: 2px solid black;">
<DIV><BR/>
@@ -86,6 +90,8 @@
</SPAN>
</DIV>
</TD>
+</TR>
+</TABLE>
</DIV>
<DIV><BR/>
@@ -94,10 +100,10 @@
</SPAN>
</DIV>
<DIV>
-<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
-</TABLE>
+<TABLE WIDTH="100%" CELLSPACING="0px" ALIGN="center">
+<TR>
<TD ALIGN="center" COLSPAN="2" STYLE="border: 2px solid black;">
-<SPAN STYLE="">
+<SPAN STYLE="font-family: unknown; font-size: 20pt;">
<DIV ALIGN="center"><BR/>
<SPAN CLASS="vpe-text">
@@ -106,8 +112,10 @@
</DIV>
</SPAN>
</TD>
-<TD ALIGN="center" VALIGN="middle" STYLE="border: 2px solid black;">
-<SPAN STYLE="">
+</TR>
+<TR>
+<TD VALIGN="middle" ALIGN="center" STYLE="border: 2px solid black;">
+<SPAN STYLE="font-family: unknown; font-size: 30pt;">
<DIV><BR/>
<SPAN CLASS="vpe-text">
@@ -118,8 +126,8 @@
</TD>
<TD STYLE="border: 2px solid black;">
<DIV>
-<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
-</TABLE>
+<TABLE WIDTH="100%" CELLSPACING="0px" ALIGN="center">
+<TR>
<TD STYLE="border: 2px solid black;">
<SPAN CLASS="vpe-text">
#{day}
@@ -130,8 +138,12 @@
Blah blah blah
</SPAN>
</TD>
+</TR>
+</TABLE>
</DIV>
</TD>
+</TR>
+</TABLE>
</DIV>
</DIV>
</test>
15 years, 1 month
JBoss Tools SVN: r19004 - in branches/jbosstools-3.1.0.RC1/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-12-02 12:41:29 -0500 (Wed, 02 Dec 2009)
New Revision: 19004
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
Log:
rolling back rev 18998
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 16:20:00 UTC (rev 19003)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 17:41:29 UTC (rev 19004)
@@ -109,217 +109,204 @@
public static EStructuralFeature ELEMENT_BINDING = ExtendedMetaData.INSTANCE.demandFeature(
"http://www.milyn.org/xsd/smooks-1.0.xsd", "binding", true);
- // public static AnyType addBindingTypeToParamType(ParamType param, String
- // property, String selector, String type,
- // String uri) {
- // AnyType binding = createBindingType(property, selector, type, uri);
- // param.getMixed().add(ELEMENT_BINDING, binding);
- // return binding;
- // }
- //
- // public static List<Object>
- // getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
- // List<ParamType> paramList = resourceConfig.getParam();
- // for (Iterator<ParamType> iterator = paramList.iterator();
- // iterator.hasNext();) {
- // ParamType param = iterator.next();
- // if ("bindings".equals(param.getName())) {
- // if (param.eContents().isEmpty())
- // continue;
- // List<Object> bindingList = (List<Object>)
- // param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
- // return bindingList;
- // }
- // }
- // return Collections.emptyList();
- // }
- //
- // public static boolean isBeanPopulatorResource(ResourceConfigType type) {
- // ResourceType resource = type.getResource();
- // if (resource == null)
- // return false;
- // String value = resource.getStringValue();
- // if (value != null)
- // value = value.trim();
- // if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
- // return true;
- // }
- // return false;
- // }
+// public static AnyType addBindingTypeToParamType(ParamType param, String property, String selector, String type,
+// String uri) {
+// AnyType binding = createBindingType(property, selector, type, uri);
+// param.getMixed().add(ELEMENT_BINDING, binding);
+// return binding;
+// }
+//
+// public static List<Object> getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
+// List<ParamType> paramList = resourceConfig.getParam();
+// for (Iterator<ParamType> iterator = paramList.iterator(); iterator.hasNext();) {
+// ParamType param = iterator.next();
+// if ("bindings".equals(param.getName())) {
+// if (param.eContents().isEmpty())
+// continue;
+// List<Object> bindingList = (List<Object>) param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
+// return bindingList;
+// }
+// }
+// return Collections.emptyList();
+// }
+//
+// public static boolean isBeanPopulatorResource(ResourceConfigType type) {
+// ResourceType resource = type.getResource();
+// if (resource == null)
+// return false;
+// String value = resource.getStringValue();
+// if (value != null)
+// value = value.trim();
+// if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
+// return true;
+// }
+// return false;
+// }
public static void setPropertyValueToAnyType(Object value, EStructuralFeature attribute, AnyType anyType) {
anyType.getAnyAttribute().set(attribute, value);
}
- // public static AnyType getBindingViaProperty(ResourceConfigType
- // resourceConfig, String property) {
- // List bindingList = getBindingListFromResourceConfigType(resourceConfig);
- // for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
- // AnyType binding = (AnyType) iterator.next();
- // String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
- // if (pro != null)
- // pro = pro.trim();
- // if (property.equals(pro)) {
- // return binding;
- // }
- // }
- // return null;
- // }
- //
- // public static boolean isInnerFileContents(ResourceConfigType
- // resourceConfig) {
- // ResourceType resource = resourceConfig.getResource();
- // if (resource == null)
- // return false;
- // String type = resource.getType();
- // if (type != null)
- // type = type.trim();
- // for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
- // String type1 = TEMPLATE_TYPES[i];
- // if (type1.equalsIgnoreCase(type))
- // return true;
- // }
- // return false;
- // }
- //
- // public static boolean isDateTypeSelector(ResourceConfigType type) {
- // ResourceType resource = type.getResource();
- // if (resource == null)
- // return false;
- // String value = resource.getStringValue();
- // if (value != null)
- // value = value.trim();
- // for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
- // String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
- // if (decoderClass.equals(value)) {
- // return true;
- // }
- // }
- // return false;
- // }
- //
- // public static String getTransformType(ResourceConfigType resourceConfig)
- // {
- // ParamType typeParam = null;
- // if (resourceConfig == null)
- // return "";
- // if (isTransformTypeResourceConfig(resourceConfig)) {
- // List paramList = resourceConfig.getParam();
- // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
- // ParamType param = (ParamType) iterator.next();
- // String name = param.getName();
- // if (name != null)
- // name = name.trim();
- // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
- // typeParam = param;
- // break;
- // }
- // }
- // if (typeParam != null) {
- // return SmooksModelUtils.getAnyTypeText(typeParam);
- // }
- // }
- // return "";
- // }
- //
- // public static void setTransformType(ResourceConfigType resourceConfig,
- // String type) {
- // if (type == null)
- // type = "";
- // if (isTransformTypeResourceConfig(resourceConfig)) {
- // List paramList = resourceConfig.getParam();
- // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
- // ParamType param = (ParamType) iterator.next();
- // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
- // cleanTextToSmooksType(param);
- // setTextToAnyType(param, type);
- // }
- // }
- // }
- // }
- //
- // public static boolean isFilePathResourceConfig(ResourceConfigType
- // resourceConfig) {
- // ResourceType resource = resourceConfig.getResource();
- // if (resource != null) {
- // String value = resource.getStringValue();
- // if (value != null) {
- // if (value.startsWith("\\")) {
- // return true;
- // }
- // if (value.startsWith("/")) {
- // return true;
- // }
- // }
- // }
- // return false;
- // }
- //
- // public static boolean isTransformTypeResourceConfig(ResourceConfigType
- // resourceConfig) {
- // String selector = resourceConfig.getSelector();
- // if (selector != null)
- // selector = selector.trim();
- // if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
- // return false;
- // }
- //
- // if (resourceConfig.getParam().isEmpty()) {
- // return false;
- // } else {
- // List paramList = resourceConfig.getParam();
- // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
- // ParamType p = (ParamType) iterator.next();
- // String paramName = p.getName();
- // if (paramName != null)
- // paramName = paramName.trim();
- // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
- // return true;
- // }
- // }
- // return false;
- // }
- // }
- //
- // public static void setParamText(String paramName, String value,
- // ResourceConfigType resourceConfigType) {
- // List<ParamType> list = resourceConfigType.getParam();
- // ParamType param = null;
- // for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();)
- // {
- // ParamType paramType = (ParamType) iterator.next();
- // String n = paramType.getName();
- // if (n == null)
- // continue;
- // n = n.trim();
- // if (n.equalsIgnoreCase(paramName)) {
- // param = paramType;
- // break;
- // }
- // }
- // if (param == null) {
- // param = SmooksFactory.eINSTANCE.createParamType();
- // param.setName(paramName);
- // resourceConfigType.getParam().add(param);
- // }
- // setTextToAnyType(param, value);
- // }
- //
- // public static String getParmaText(String paramName, ResourceConfigType
- // resourceConfigType) {
- // List plist = resourceConfigType.getParam();
- // for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
- // ParamType p = (ParamType) iterator.next();
- // String n = p.getName();
- // if (n == null)
- // continue;
- // n = n.trim();
- // if (paramName.equalsIgnoreCase(n)) {
- // return getAnyTypeText(p);
- // }
- // }
- // return null;
- // }
+// public static AnyType getBindingViaProperty(ResourceConfigType resourceConfig, String property) {
+// List bindingList = getBindingListFromResourceConfigType(resourceConfig);
+// for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
+// AnyType binding = (AnyType) iterator.next();
+// String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
+// if (pro != null)
+// pro = pro.trim();
+// if (property.equals(pro)) {
+// return binding;
+// }
+// }
+// return null;
+// }
+//
+// public static boolean isInnerFileContents(ResourceConfigType resourceConfig) {
+// ResourceType resource = resourceConfig.getResource();
+// if (resource == null)
+// return false;
+// String type = resource.getType();
+// if (type != null)
+// type = type.trim();
+// for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
+// String type1 = TEMPLATE_TYPES[i];
+// if (type1.equalsIgnoreCase(type))
+// return true;
+// }
+// return false;
+// }
+//
+// public static boolean isDateTypeSelector(ResourceConfigType type) {
+// ResourceType resource = type.getResource();
+// if (resource == null)
+// return false;
+// String value = resource.getStringValue();
+// if (value != null)
+// value = value.trim();
+// for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+// String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
+// if (decoderClass.equals(value)) {
+// return true;
+// }
+// }
+// return false;
+// }
+//
+// public static String getTransformType(ResourceConfigType resourceConfig) {
+// ParamType typeParam = null;
+// if (resourceConfig == null)
+// return "";
+// if (isTransformTypeResourceConfig(resourceConfig)) {
+// List paramList = resourceConfig.getParam();
+// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+// ParamType param = (ParamType) iterator.next();
+// String name = param.getName();
+// if (name != null)
+// name = name.trim();
+// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
+// typeParam = param;
+// break;
+// }
+// }
+// if (typeParam != null) {
+// return SmooksModelUtils.getAnyTypeText(typeParam);
+// }
+// }
+// return "";
+// }
+//
+// public static void setTransformType(ResourceConfigType resourceConfig, String type) {
+// if (type == null)
+// type = "";
+// if (isTransformTypeResourceConfig(resourceConfig)) {
+// List paramList = resourceConfig.getParam();
+// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+// ParamType param = (ParamType) iterator.next();
+// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
+// cleanTextToSmooksType(param);
+// setTextToAnyType(param, type);
+// }
+// }
+// }
+// }
+//
+// public static boolean isFilePathResourceConfig(ResourceConfigType resourceConfig) {
+// ResourceType resource = resourceConfig.getResource();
+// if (resource != null) {
+// String value = resource.getStringValue();
+// if (value != null) {
+// if (value.startsWith("\\")) {
+// return true;
+// }
+// if (value.startsWith("/")) {
+// return true;
+// }
+// }
+// }
+// return false;
+// }
+//
+// public static boolean isTransformTypeResourceConfig(ResourceConfigType resourceConfig) {
+// String selector = resourceConfig.getSelector();
+// if (selector != null)
+// selector = selector.trim();
+// if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
+// return false;
+// }
+//
+// if (resourceConfig.getParam().isEmpty()) {
+// return false;
+// } else {
+// List paramList = resourceConfig.getParam();
+// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+// ParamType p = (ParamType) iterator.next();
+// String paramName = p.getName();
+// if (paramName != null)
+// paramName = paramName.trim();
+// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
+// return true;
+// }
+// }
+// return false;
+// }
+// }
+//
+// public static void setParamText(String paramName, String value, ResourceConfigType resourceConfigType) {
+// List<ParamType> list = resourceConfigType.getParam();
+// ParamType param = null;
+// for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();) {
+// ParamType paramType = (ParamType) iterator.next();
+// String n = paramType.getName();
+// if (n == null)
+// continue;
+// n = n.trim();
+// if (n.equalsIgnoreCase(paramName)) {
+// param = paramType;
+// break;
+// }
+// }
+// if (param == null) {
+// param = SmooksFactory.eINSTANCE.createParamType();
+// param.setName(paramName);
+// resourceConfigType.getParam().add(param);
+// }
+// setTextToAnyType(param, value);
+// }
+//
+// public static String getParmaText(String paramName, ResourceConfigType resourceConfigType) {
+// List plist = resourceConfigType.getParam();
+// for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
+// ParamType p = (ParamType) iterator.next();
+// String n = p.getName();
+// if (n == null)
+// continue;
+// n = n.trim();
+// if (paramName.equalsIgnoreCase(n)) {
+// return getAnyTypeText(p);
+// }
+// }
+// return null;
+// }
public static String getAttributeValueFromAnyType(AnyType anyType, EStructuralFeature attribute) {
String value = (String) anyType.getAnyAttribute().get(attribute, false);
@@ -366,26 +353,24 @@
return null;
}
- // public static AnyType createBindingType(String property, String selector,
- // String type, String uri) {
- // if (uri == null) {
- // uri = SmooksPackage.eNS_URI;
- // }
- //
- // AnyType binding = (AnyType)
- // EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
- // if (property != null) {
- // binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
- // }
- //
- // if (selector != null) {
- // binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
- // }
- // if (type != null) {
- // binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
- // }
- // return binding;
- // }
+// public static AnyType createBindingType(String property, String selector, String type, String uri) {
+// if (uri == null) {
+// uri = SmooksPackage.eNS_URI;
+// }
+//
+// AnyType binding = (AnyType) EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
+// if (property != null) {
+// binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
+// }
+//
+// if (selector != null) {
+// binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
+// }
+// if (type != null) {
+// binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
+// }
+// return binding;
+// }
public static void appendTextToSmooksType(AnyType smooksModel, String text) {
smooksModel.getMixed().add(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT, text);
@@ -615,9 +600,7 @@
String value = typeParam.getStringValue();
if (value != null) {
value = value.trim();
- if (!"".equals(value)) {
- return value.split(",");
- }
+ return value.split(",");
}
}
return null;
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-02 16:20:00 UTC (rev 19003)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-02 17:41:29 UTC (rev 19004)
@@ -16,7 +16,6 @@
import java.util.Iterator;
import java.util.List;
-import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -32,6 +31,7 @@
import org.jboss.template.TemplateBuilder;
import org.jboss.template.csv.CSVFreeMarkerTemplateBuilder;
import org.jboss.template.csv.CSVModelBuilder;
+import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.actions.AbstractSmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
@@ -91,77 +91,6 @@
return factory;
}
- @Override
- public void validateEnd(List<Diagnostic> diagnosticResult) {
- cleanValidationMarker();
- // validate freemarker model.Because the freemarker csv node
- // model isn't EMF model so they need to validate separately
- if(root == null) return;
- List<AbstractSmooksGraphicalModel> children = root.getChildren();
- for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
- if (abstractSmooksGraphicalModel instanceof FreemarkerTemplateGraphicalModel) {
- Object data = abstractSmooksGraphicalModel.getData();
- data = AdapterFactoryEditingDomain.unwrap(data);
- if (data instanceof Freemarker) {
- String type = SmooksModelUtils.getTemplateType((Freemarker) data);
- if (SmooksModelUtils.FREEMARKER_TEMPLATE_TYPE_CSV.equals(type)) {
- validateCSVTemplate(abstractSmooksGraphicalModel);
- }
- }
- }
- }
- }
-
- protected void validateCSVTemplate(AbstractSmooksGraphicalModel templateGraphModel) {
- int s = AbstractSmooksGraphicalModel.NONE;
- Object data = templateGraphModel.getData();
- data = AdapterFactoryEditingDomain.unwrap(data);
-
- char seperator = SmooksModelUtils.getFreemarkerCSVSeperator((Freemarker) data);
-
- if (seperator == 0) {
- templateGraphModel.getMessage().add("Seperator character can't be empty");
- s = AbstractSmooksGraphicalModel.WARNING;
- }
-
- char quote = SmooksModelUtils.getFreemarkerCSVQuote((Freemarker) data);
- if (quote == 0) {
- templateGraphModel.getMessage().add("Quote character can't be empty");
- s = AbstractSmooksGraphicalModel.WARNING;
- }
-
- String[] fields = SmooksModelUtils.getFreemarkerCSVFileds((Freemarker) data);
- boolean missFields = false;
- if (fields == null) {
- missFields = true;
- }
-
- if (s != AbstractSmooksGraphicalModel.NONE) {
- templateGraphModel.setSeverity(s);
- }
-
- List<AbstractSmooksGraphicalModel> csvRecordNode = templateGraphModel.getChildren();
- for (Iterator<?> iterator = csvRecordNode.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel csvRecordGraphModel = (AbstractSmooksGraphicalModel) iterator.next();
- if (missFields) {
- csvRecordGraphModel.getMessage().add("CSV fields can't be empty");
- csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
- }
- List<TreeNodeConnection> collectionConnections = csvRecordGraphModel.getTargetConnections();
- if (collectionConnections.isEmpty()) {
- csvRecordGraphModel.addMessage("Must be linked with source node");
- csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
- List<AbstractSmooksGraphicalModel> csvFields = csvRecordGraphModel.getChildren();
- for (Iterator<?> iterator2 = csvFields.iterator(); iterator2.hasNext();) {
- AbstractSmooksGraphicalModel csvFieldsGModel = (AbstractSmooksGraphicalModel) iterator2.next();
- csvFieldsGModel.addMessage("Case CSV-Record isn't linked with source node , this node can't be linked.");
- csvFieldsGModel.setSeverity(AbstractSmooksGraphicalModel.ERROR);
- }
- }
- }
- }
-
/*
* (non-Javadoc)
*
@@ -448,7 +377,7 @@
char quote = SmooksModelUtils.getFreemarkerCSVQuote(freemarker);
String[] fields = SmooksModelUtils.getFreemarkerCSVFileds(freemarker);
try {
- if (contents != null) {
+ if(contents != null) {
CSVModelBuilder modelBuilder = new CSVModelBuilder(fields);
Document model = modelBuilder.buildModel();
TemplateBuilder builder = new CSVFreeMarkerTemplateBuilder(model, seprator, quote, contents);
@@ -457,7 +386,7 @@
}
} catch (Exception e) {
// ignore exception
- // e.printStackTrace();
+// e.printStackTrace();
}
}
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 16:20:00 UTC (rev 19003)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 17:41:29 UTC (rev 19004)
@@ -99,7 +99,7 @@
Freemarker freemarker = (Freemarker) parent.getData();
if (freemarker != null) {
ParamType param = SmooksModelUtils.getParam(freemarker.getParam(), SmooksModelUtils.KEY_CSV_FIELDS);
- if (param == null) {
+ if (param == null){
param = SmooksFactory.eINSTANCE.createParamType();
param.setName(SmooksModelUtils.KEY_CSV_FIELDS);
freemarker.getParam().add(param);
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 16:20:00 UTC (rev 19003)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 17:41:29 UTC (rev 19004)
@@ -11,7 +11,6 @@
package org.jboss.tools.smooks.graphical.editors.model.javamapping;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
@@ -30,7 +29,6 @@
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigChildNodeGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVLinkConnection;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVNodeModel;
-import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerCSVNodeGraphicalModel;
import org.jboss.tools.smooks.model.javabean.ValueType;
/**
@@ -117,24 +115,7 @@
obj = AdapterFactoryEditingDomain.unwrap(obj);
if (obj instanceof ValueType || obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
if (m instanceof CSVNodeModel) {
- if (!((CSVNodeModel) m).isRecord()) {
- List<TreeNodeConnection> exsitingConnection = gm.getTargetConnections();
- if (!exsitingConnection.isEmpty())
- return false;
- for (Iterator<?> iterator = exsitingConnection.iterator(); iterator.hasNext();) {
- TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
- if (treeNodeConnection.getSourceNode() == this) {
- return false;
- }
- }
- AbstractSmooksGraphicalModel parent = gm.getParent();
- if (parent instanceof FreemarkerCSVNodeGraphicalModel) {
- List<TreeNodeConnection> connections = parent.getTargetConnections();
- if (!connections.isEmpty()) {
- return true;
- }
- }
- }
+ return !((CSVNodeModel) m).isRecord();
}
}
if (!inJavaMapping())
15 years, 1 month
JBoss Tools SVN: r19003 - in trunk/jsf: plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-12-02 11:20:00 -0500 (Wed, 02 Dec 2009)
New Revision: 19003
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfHTMLTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
Log:
NPE with table fixed. pdf html template was added. BarCode template was fixed.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF 2009-12-02 16:15:08 UTC (rev 19002)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/META-INF/MANIFEST.MF 2009-12-02 16:20:00 UTC (rev 19003)
@@ -15,7 +15,8 @@
org.eclipse.ui.ide,
org.mozilla.xpcom;bundle-version="1.9.1",
org.jboss.tools.jsf.vpe.jsf;bundle-version="2.1.0",
- org.eclipse.jface.text;bundle-version="3.5.0"
+ org.eclipse.jface.text;bundle-version="3.5.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.401"
Bundle-Vendor: %Bundle-Vendor.0
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/antlr.jar,
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfHTMLTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfHTMLTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfHTMLTemplate.java 2009-12-02 16:20:00 UTC (rev 19003)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.jboss.tools.jsf.vpe.jsf.template.AbstractOutputJsfTemplate;
+import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.VpeElementProxyData;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.AttributeData;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+@SuppressWarnings("restriction")
+public class SeamPdfHTMLTemplate extends AbstractOutputJsfTemplate {
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element element = (Element) sourceNode;
+
+ // create container
+ final nsIDOMElement container;
+ container = VisualDomUtil.createBorderlessContainer(visualDocument);
+ nsIDOMNode divNode = visualDocument.createElement(HTML.TAG_DIV);
+ divNode.appendChild(container);
+ VpeCreationData creationData = new VpeCreationData(divNode);
+
+ processOutputAttribute(pageContext, visualDocument, element, container,
+ creationData);
+
+ return creationData;
+ }
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer"); //$NON-NLS-1$
+ if (footers != null && footers.length != 0) {
+ Node parentPdfDocumentNode = SeamUtil.getParentByName(pageContext,
+ sourceNode, "p:document"); //$NON-NLS-1$
+ if (parentPdfDocumentNode != null) {
+ return parentPdfDocumentNode;
+ }
+ }
+ return super
+ .getNodeForUpdate(pageContext, sourceNode, visualNode, data);
+ }
+
+ @Override
+ protected void processOutputAttribute(VpePageContext pageContext,
+ nsIDOMDocument visualDocument, Element sourceElement,
+ nsIDOMElement targetVisualElement, VpeCreationData creationData) {
+
+ VpeElementProxyData elementData = new VpeElementProxyData();
+
+ Attr outputAttr = getOutputAttributeNode(sourceElement);
+
+ if (outputAttr != null) {
+
+ String newValue = prepareAttrValue(pageContext, sourceElement, outputAttr);
+
+ // create info
+ VpeChildrenInfo targetVisualInfo = new VpeChildrenInfo(
+ targetVisualElement);
+
+ // get atribute's offset
+
+ //mareshkau because it's node can be a proxy, see JBIDE-3144
+ if(!(outputAttr instanceof IDOMAttr)) {
+ outputAttr = (Attr) ((((Attr)outputAttr).getOwnerElement()).getAttributes().getNamedItem(outputAttr.getLocalName()));
+ }
+
+ int offset = ((IDOMAttr) outputAttr)
+ .getValueRegionStartOffset();
+
+ // reparse attribute's value
+ NodeList list = NodeProxyUtil.reparseAttributeValue(
+ elementData, newValue, offset + 1);
+
+ // add children to info
+ for (int i = 0; i < list.getLength(); i++) {
+
+ Node child = list.item(i);
+
+ // add info to creation data
+ targetVisualInfo.addSourceChild(child);
+ }
+
+ elementData.addNodeData(new AttributeData(outputAttr,
+ targetVisualElement, true));
+
+ creationData.addChildrenInfo(targetVisualInfo);
+
+ }
+
+ creationData.setElementData(elementData);
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java 2009-12-02 16:15:08 UTC (rev 19002)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java 2009-12-02 16:20:00 UTC (rev 19003)
@@ -14,8 +14,11 @@
* @author yzhishko
*/
+import java.util.List;
+
import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -29,7 +32,6 @@
private nsIDOMElement visualElement;
private Element sourceElement;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
sourceElement = (Element) sourceNode;
@@ -43,7 +45,21 @@
visualTable.setAttribute(HTML.ATTR_WIDTH, getWidthPerc(sourceElement));
visualTable.setAttribute(HTML.ATTR_ALIGN, getAlignment(sourceElement));
visualTable.setAttribute(HTML.ATTR_CELLSPACING, "0px"); //$NON-NLS-1$
- return new VpeCreationData(visualElement);
+ VpeCreationData creationData = new VpeCreationData(visualElement);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualElement);
+ Node[] cells = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:cell"); //$NON-NLS-1$
+ if (cells != null) {
+ for (int i = 0; i < cells.length; i++) {
+ Node parentNode = SeamUtil.getParentByName(pageContext,
+ cells[i], "p:table"); //$NON-NLS-1$
+ if (parentNode != null && parentNode == sourceNode) {
+ childrenInfo.addSourceChild(cells[i]);
+ }
+ }
+ }
+ creationData.addChildrenInfo(childrenInfo);
+ return creationData;
}
@Override
@@ -74,8 +90,16 @@
private void setColumns(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
int numberOfColumns = getNumberOfColumns(sourceNode);
- Node[] cells = SeamUtil.getChildsByName(pageContext, sourceNode,
- "p:cell"); //$NON-NLS-1$
+ List<VpeChildrenInfo> cellsList = data.getChildrenInfoList();
+ if (cellsList == null) {
+ return;
+ }
+ VpeChildrenInfo childrenInfo = cellsList.get(0);
+ List<Node> children = childrenInfo.getSourceChildren();
+ if (children == null) {
+ return;
+ }
+ Node[] cells = children.toArray(new Element[0]);
int cellsLength = cells.length;
if (numberOfColumns > cellsLength) {
for (int i = 0; i < cells.length; i++) {
@@ -89,53 +113,49 @@
nsIDOMNode visualTable = ((nsIDOMElement) data.getNode()
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
.getElementsByTagName(HTML.TAG_TABLE).item(0);
- if (cellsLength != 0) {
- nsIDOMNode trVisualNode = visualDocument.createElement(HTML.TAG_TR);
- visualTable.appendChild(trVisualNode);
- int posCounter = 0;
- for (int i = 0; i < cellsLength; i++) {
- nsIDOMNode visualCell = pageContext.getDomMapping()
- .getVisualNode(cells[i]);
- nsIDOMNode parentNode = visualCell.getParentNode();
- if (parentNode != null) {
- parentNode.removeChild(visualCell);
- trVisualNode.appendChild(visualCell);
- int colspanValue = getColspanValue(visualCell);
- posCounter++;
- if (colspanValue > 1 && posCounter % numberOfColumns != 0) {
- int posInRow = posCounter - 1;
- int numEndCells = numberOfColumns - posInRow;
- if (numEndCells <= colspanValue) {
- colspanValue = numEndCells;
- trVisualNode = visualDocument
- .createElement(HTML.TAG_TR);
- visualTable.appendChild(trVisualNode);
- posCounter = 0;
- continue;
- } else {
- for (int j = 0; j < numberOfColumns
- - (colspanValue); j++) {
- i++;
- visualCell = pageContext.getDomMapping()
- .getVisualNode(cells[i]);
- trVisualNode.appendChild(visualCell);
- }
- i -= numberOfColumns - (colspanValue);
- posCounter += colspanValue - 1;
+ nsIDOMNode trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ int posCounter = 0;
+ for (int i = 0; i < cellsLength; i++) {
+ nsIDOMNode visualCell = pageContext.getDomMapping().getVisualNode(
+ cells[i]);
+ nsIDOMNode parentNode = visualCell.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualCell);
+ trVisualNode.appendChild(visualCell);
+ int colspanValue = getColspanValue(visualCell);
+ posCounter++;
+ if (colspanValue > 1 && posCounter % numberOfColumns != 0) {
+ int posInRow = posCounter - 1;
+ int numEndCells = numberOfColumns - posInRow;
+ if (numEndCells <= colspanValue) {
+ colspanValue = numEndCells;
+ trVisualNode = visualDocument
+ .createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
+ continue;
+ } else {
+ for (int j = 0; j < numberOfColumns - (colspanValue); j++) {
+ i++;
+ visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ trVisualNode.appendChild(visualCell);
}
+ i -= numberOfColumns - (colspanValue);
+ posCounter += colspanValue - 1;
}
}
- if ((posCounter % numberOfColumns == 0)
- && ((i + 1) != cellsLength)) {
- trVisualNode = visualDocument.createElement(HTML.TAG_TR);
- visualTable.appendChild(trVisualNode);
- posCounter = 0;
- }
}
- if (trVisualNode.getChildNodes().getLength() != numberOfColumns) {
- trVisualNode.getParentNode().removeChild(trVisualNode);
+ if ((posCounter % numberOfColumns == 0) && ((i + 1) != cellsLength)) {
+ trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
}
}
+ if (trVisualNode.getChildNodes().getLength() != numberOfColumns) {
+ trVisualNode.getParentNode().removeChild(trVisualNode);
+ }
}
private String getWidthPerc(Element sourceElement) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-12-02 16:15:08 UTC (rev 19002)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-12-02 16:20:00 UTC (rev 19003)
@@ -601,7 +601,7 @@
<vpe:template children="no" modify="no" />
</vpe:tag>
- <vpe:tag name="p:barcode" case-sensitive="yes">
+ <vpe:tag name="p:barCode" case-sensitive="yes">
<vpe:template children="no" modify="no" />
</vpe:tag>
@@ -613,4 +613,14 @@
<vpe:template children="no" modify="no" />
</vpe:tag>
+ <vpe:tag name="p:html" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfHTMLTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+
+
</vpe:templates>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml 2009-12-02 16:15:08 UTC (rev 19002)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml 2009-12-02 16:20:00 UTC (rev 19003)
@@ -2,5 +2,5 @@
author="author" type="html" creator="creator" pageSize="LETTER"
orientation="portrait" margins="50 60 70 80"
xmlns:p="http://jboss.com/products/seam/pdf">
- <p:barcode id="id1">Not rendered</p:barcode>
+ <p:barCode id="id1">Not rendered</p:barCode>
</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml 2009-12-02 16:20:00 UTC (rev 19003)
@@ -0,0 +1,26 @@
+<p:document subject="subject" title="title" author="author" type="pdf"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ margins="50 50 50 50" xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ The document goes here.
+ <p:html id="htmlID1" value="This is HTML that is just plain text." />
+ <p:html id="htmlID2" value="This is HTML with <b>some markup</b>." />
+
+ <p:html id="htmlID3">
+ This is HTML with text with text in the <b>body</b>.
+ </p:html>
+
+
+ <p:html id="htmlID4">
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+ </p:html>
+
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/html.xhtml.xml 2009-12-02 16:20:00 UTC (rev 19003)
@@ -0,0 +1,73 @@
+<tests>
+ <test id="htmlID1">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ This is HTML that is just plain text.
+</SPAN>
+ </SPAN>
+ </DIV>
+ </test>
+ <test id="htmlID2">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ This is HTML with
+</SPAN>
+ <B STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ some markup
+</SPAN>
+ </B>
+ <SPAN CLASS="vpe-text">
+ .
+</SPAN>
+ </SPAN>
+ </DIV>
+ </test>
+ <test id="htmlID3">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ This is HTML with text with text in the
+</SPAN>
+ <B STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ body
+</SPAN>
+ </B>
+ <SPAN CLASS="vpe-text">
+ .
+</SPAN>
+ </DIV>
+ </test>
+ <test id="htmlID4">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ </SPAN>
+ <H1 STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ This is more complex HTML
+</SPAN>
+ </H1>
+ <UL STYLE="-moz-user-modify: read-write;">
+ <LI STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ one
+</SPAN>
+ </LI>
+ <LI STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ two
+</SPAN>
+ </LI>
+ <LI STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ three
+</SPAN>
+ </LI>
+ </UL>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-12-02 16:15:08 UTC (rev 19002)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-12-02 16:20:00 UTC (rev 19003)
@@ -23,7 +23,7 @@
}
public void testConversationId() throws Throwable {
- performContentTest("components/conversationId.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ performContentTest("components/conversationId.xhtml"); //$NON-NLS-1$
}
public void testConvertDateTime() throws Throwable {
@@ -115,7 +115,7 @@
}
public void testValidateAll() throws Throwable {
- performContentTest("components/validateAll.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ performContentTest("components/validateAll.xhtml"); //$NON-NLS-1$
}
public void testValidateFormattedText() throws Throwable {
@@ -129,141 +129,145 @@
// mail components
public void testMailMessage() throws Throwable {
- performContentTest("components/mail/message.xhtml");
+ performContentTest("components/mail/message.xhtml"); //$NON-NLS-1$
}
public void testMailBody() throws Throwable {
- performContentTest("components/mail/body.xhtml");
+ performContentTest("components/mail/body.xhtml"); //$NON-NLS-1$
}
public void testMailFrom() throws Throwable {
- performInvisibleTagTest("components/mail/from.xhtml", "id1");
+ performInvisibleTagTest("components/mail/from.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailTo() throws Throwable {
- performInvisibleTagTest("components/mail/to.xhtml", "id1");
+ performInvisibleTagTest("components/mail/to.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailSubject() throws Throwable {
- performInvisibleTagTest("components/mail/subject.xhtml", "id1");
+ performInvisibleTagTest("components/mail/subject.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailAttachment() throws Throwable {
- performInvisibleTagTest("components/mail/attachment.xhtml", "id1");
+ performInvisibleTagTest("components/mail/attachment.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailBcc() throws Throwable {
- performInvisibleTagTest("components/mail/bcc.xhtml", "id1");
+ performInvisibleTagTest("components/mail/bcc.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailCc() throws Throwable {
- performInvisibleTagTest("components/mail/cc.xhtml", "id1");
+ performInvisibleTagTest("components/mail/cc.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailHeader() throws Throwable {
- performInvisibleTagTest("components/mail/header.xhtml", "id1");
+ performInvisibleTagTest("components/mail/header.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testMailReplyTo() throws Throwable {
- performInvisibleTagTest("components/mail/replyTo.xhtml", "id1");
+ performInvisibleTagTest("components/mail/replyTo.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
// pdf components
public void testPdfDocument() throws Throwable {
- performContentTest("components/pdf/document.xhtml");
+ performContentTest("components/pdf/document.xhtml"); //$NON-NLS-1$
}
public void testPdfParagraph() throws Throwable {
- performContentTest("components/pdf/paragraph.xhtml");
+ performContentTest("components/pdf/paragraph.xhtml"); //$NON-NLS-1$
}
public void testPdfText() throws Throwable {
- performContentTest("components/pdf/text.xhtml");
+ performContentTest("components/pdf/text.xhtml"); //$NON-NLS-1$
}
public void testPdfFont() throws Throwable {
- performContentTest("components/pdf/font.xhtml");
+ performContentTest("components/pdf/font.xhtml"); //$NON-NLS-1$
}
public void testPdfNewPage() throws Throwable {
- performContentTest("components/pdf/newPage.xhtml");
+ performContentTest("components/pdf/newPage.xhtml"); //$NON-NLS-1$
}
public void testPdfImage() throws Throwable {
- performInvisibleTagTest("components/pdf/image.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/image.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfAnchor() throws Throwable {
- performContentTest("components/pdf/anchor.xhtml");
+ performContentTest("components/pdf/anchor.xhtml"); //$NON-NLS-1$
}
public void testPdfHeader() throws Throwable {
- performInvisibleTagTest("components/pdf/header.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/header.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfFooter() throws Throwable {
- performContentTest("components/pdf/footer.xhtml");
+ performContentTest("components/pdf/footer.xhtml"); //$NON-NLS-1$
}
public void testPdfPageNumber() throws Throwable {
- performContentTest("components/pdf/pageNumber.xhtml");
+ performContentTest("components/pdf/pageNumber.xhtml"); //$NON-NLS-1$
}
public void testPdfChapter() throws Throwable {
- performContentTest("components/pdf/chapter.xhtml");
+ performContentTest("components/pdf/chapter.xhtml"); //$NON-NLS-1$
}
public void testPdfSection() throws Throwable {
- performContentTest("components/pdf/section.xhtml");
+ performContentTest("components/pdf/section.xhtml"); //$NON-NLS-1$
}
public void testPdfList() throws Throwable {
- performContentTest("components/pdf/list.xhtml");
+ performContentTest("components/pdf/list.xhtml"); //$NON-NLS-1$
}
public void testPdfListItem() throws Throwable {
- performContentTest("components/pdf/listItem.xhtml");
+ performContentTest("components/pdf/listItem.xhtml"); //$NON-NLS-1$
}
public void testPdfTable() throws Throwable {
- performContentTest("components/pdf/table.xhtml");
+ performContentTest("components/pdf/table.xhtml"); //$NON-NLS-1$
}
public void testPdfCell() throws Throwable {
- performContentTest("components/pdf/cell.xhtml");
+ performContentTest("components/pdf/cell.xhtml"); //$NON-NLS-1$
}
public void testPdfBarChart() throws Throwable {
- performContentTest("components/pdf/barChart.xhtml");
+ performContentTest("components/pdf/barChart.xhtml"); //$NON-NLS-1$
}
public void testPdfLineChart() throws Throwable {
- performContentTest("components/pdf/lineChart.xhtml");
+ performContentTest("components/pdf/lineChart.xhtml"); //$NON-NLS-1$
}
public void testPdfPieChart() throws Throwable {
- performContentTest("components/pdf/pieChart.xhtml");
+ performContentTest("components/pdf/pieChart.xhtml"); //$NON-NLS-1$
}
public void testPdfSeries() throws Throwable {
- performInvisibleTagTest("components/pdf/series.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/series.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfData() throws Throwable {
- performInvisibleTagTest("components/pdf/data.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/data.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfColor() throws Throwable {
- performInvisibleTagTest("components/pdf/color.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/color.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfStroke() throws Throwable {
- performInvisibleTagTest("components/pdf/stroke.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/stroke.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPdfBarCode() throws Throwable {
- performInvisibleTagTest("components/pdf/barCode.xhtml", "id1");
+ performInvisibleTagTest("components/pdf/barCode.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ public void testPdfHTML() throws Throwable {
+ performContentTest("components/pdf/html.xhtml"); //$NON-NLS-1$
+ }
}
15 years, 1 month
JBoss Tools SVN: r19002 - branches/jbosstools-3.1.0.RC1/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 11:15:08 -0500 (Wed, 02 Dec 2009)
New Revision: 19002
Modified:
branches/jbosstools-3.1.0.RC1/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5353
Modified: branches/jbosstools-3.1.0.RC1/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.1.0.RC1/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-12-02 16:00:10 UTC (rev 19001)
+++ branches/jbosstools-3.1.0.RC1/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-12-02 16:15:08 UTC (rev 19002)
@@ -239,7 +239,7 @@
<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="RedHatEclipse4Web_IProject" objectClass="org.eclipse.core.resources.IProject">
- <menu id="RedHat4Web" label="JBoss Tools Developer Studio" path="additions">
+ <menu id="RedHat4Web" label="JBoss Tools" path="additions">
<separator name="a">
</separator>
<separator name="b">
@@ -257,7 +257,7 @@
</action>
</objectContribution>
<objectContribution id="RedHatEclipse4Web_IJavaProject" objectClass="org.eclipse.jdt.core.IJavaProject">
- <menu id="RedHat4Web" label="JBoss Tools Developer Studio" path="additions">
+ <menu id="RedHat4Web" label="JBoss Tools" path="additions">
<separator name="a">
</separator>
<separator name="b">
15 years, 1 month
JBoss Tools SVN: r19001 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-12-02 11:00:10 -0500 (Wed, 02 Dec 2009)
New Revision: 19001
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5352
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2009-12-02 15:41:47 UTC (rev 19000)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2009-12-02 16:00:10 UTC (rev 19001)
@@ -10,5 +10,6 @@
<a href="jsf2test/pages/components/outputScript.xhtml">h:outputScript</a><br>
<a href="jsf2test/pages/components/outputStylesheet.xhtml">h:outputStylesheet</a><br>
<a href="jsf2test/pages/JBIDE/5135/jbide5135.xhtml">Resource Test Page</a><br>
+ <a href="jsf2test/pages/JBIDE/5352/jbide5352.xhtml">Test Page with template name resolving for default tags</a><br>
</body>
</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml 2009-12-02 16:00:10 UTC (rev 19001)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core">
+<body xmlns="http://java.sun.com/jsf/html" id="jbide5353Test">
+ <f:view>
+ <outputText value="Default namespace detection test page" />
+ <h1></h1>
+ <inputText value="Test" />
+ </f:view>
+</body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/jbide5352.xhtml.xml 2009-12-02 16:00:10 UTC (rev 19001)
@@ -0,0 +1,23 @@
+<tests>
+ <test id="jbide5353Test">
+<DIV ID="jbide5353Test">
+<TABLE STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+<TR>
+<TD>
+<DIV>
+<SPAN CLASS="vpe-text">
+Default namespace detection test page
+</SPAN>
+<DIV CLASS="__any__tag__caption" STYLE="border: 1px solid green; -moz-user-modify: read-only;">
+h1<BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
+
+</DIV>
+<INPUT VALUE="Test"/>
+
+</DIV>
+</TD>
+</TR>
+</TABLE>
+</DIV>
+ </test>
+</tests>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml 2009-12-02 16:00:10 UTC (rev 19001)
@@ -0,0 +1,46 @@
+<document xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns="http://jboss.com/products/seam/pdf" id="jbide5352Test">
+
+ <image alignment="right" wrap="true" value="/jboss.jpg" />
+ <font size="24"><paragraph spacingAfter="50">Table Test</paragraph></font>
+
+ <table columns="4">
+ <f:facet name="defaultCell">
+ <cell horizontalAlignment="center" verticalAlignment="middle" />
+ </f:facet>
+ <cell backgroundColor="yellow" colspan="2"><paragraph>cell 1</paragraph></cell>
+ <cell><paragraph>cell 2</paragraph></cell>
+ <cell><paragraph>cell 3</paragraph></cell>
+ <cell><paragraph>cell 4</paragraph></cell>
+ <cell backgroundColor="red" colspan="2"><paragraph>cell 5</paragraph></cell>
+ <cell><paragraph>cell 6</paragraph></cell>
+ <cell><paragraph>cell 7</paragraph></cell>
+ <cell><paragraph>cell 8</paragraph></cell>
+ <cell backgroundColor="green" colspan="2"><paragraph>cell 9</paragraph></cell>
+ </table>
+
+ <paragraph spacingBefore="10" spacingAfter="10">This is another table. It should be large enough to span multiple pages with the headers repeated on other page</paragraph>
+
+
+ <table widths="1 4" columns="2" headerRows="1">
+ <cell grayFill=".3" paddingBottom="10" horizontalAlignment="center" colspan="2">
+ <font size="20"><paragraph alignment="center">This is a header</paragraph></font>
+ </cell>
+
+
+ <ui:repeat value="#{lists.numbers}" var="week">
+ <cell rotation="90" horizontalAlignment="center" verticalAlignment="middle" grayFill=".7">
+ <font size="30"><paragraph>Week #{week}</paragraph></font>
+ </cell>
+ <cell paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0">
+ <table widths="1.25 4" columns="2" widthPercentage="100">
+ <ui:repeat value="#{lists.daysOfWeek}" var="day">
+ <cell paddingBottom="6">#{day}</cell>
+ <cell paddingBottom="6">Blah blah blah</cell>
+ </ui:repeat>
+ </table>
+ </cell>
+ </ui:repeat>
+ </table>
+</document>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5352/table.xhtml.xml 2009-12-02 16:00:10 UTC (rev 19001)
@@ -0,0 +1,138 @@
+<tests>
+ <test id="jbide5352Test">
+ <DIV STYLE="margin: 36px;">
+<SPAN STYLE="">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+Table Test
+</SPAN>
+</DIV>
+</SPAN>
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
+</TABLE>
+<DIV STYLE="display: none;">
+</DIV>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 1
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 2
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 3
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 4
+</SPAN>
+</DIV>
+</TD>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 5
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 6
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 7
+</SPAN>
+</DIV>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 8
+</SPAN>
+</DIV>
+</TD>
+<TD COLSPAN="2" STYLE="border: 2px solid black;">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+cell 9
+</SPAN>
+</DIV>
+</TD>
+</DIV>
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+This is another table. It should be large enough to span multiple pages with the headers repeated on other page
+</SPAN>
+</DIV>
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
+</TABLE>
+<TD ALIGN="center" COLSPAN="2" STYLE="border: 2px solid black;">
+<SPAN STYLE="">
+<DIV ALIGN="center"><BR/>
+
+<SPAN CLASS="vpe-text">
+This is a header
+</SPAN>
+</DIV>
+</SPAN>
+</TD>
+<TD ALIGN="center" VALIGN="middle" STYLE="border: 2px solid black;">
+<SPAN STYLE="">
+<DIV><BR/>
+
+<SPAN CLASS="vpe-text">
+Week #{week}
+</SPAN>
+</DIV>
+</SPAN>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<DIV>
+<TABLE CELLSPACING="0px" ALIGN="center" WIDTH="100%">
+</TABLE>
+<TD STYLE="border: 2px solid black;">
+<SPAN CLASS="vpe-text">
+#{day}
+</SPAN>
+</TD>
+<TD STYLE="border: 2px solid black;">
+<SPAN CLASS="vpe-text">
+Blah blah blah
+</SPAN>
+</TD>
+</DIV>
+</TD>
+</DIV>
+</DIV>
+ </test>
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-02 15:41:47 UTC (rev 19000)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-12-02 16:00:10 UTC (rev 19001)
@@ -72,6 +72,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.MozDirtyTest_JBIDE5105;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.NullPointerWithStyleProperty_JBIDE5193;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestForUsingComponentsLibrariesWithDefaultNamespace;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VpeI18nTest_JBIDE4887;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
@@ -106,6 +107,7 @@
TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //$NON-NLS-1$
// $JUnit-BEGIN$
+ suite.addTestSuite(TestForUsingComponentsLibrariesWithDefaultNamespace.class);
suite.addTestSuite(EditingSPecialSymbolsVPE_JBIDE3810.class);
suite.addTestSuite(MozDirtyTest_JBIDE5105.class);
suite.addTestSuite(VpeI18nTest_JBIDE4887.class);
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestForUsingComponentsLibrariesWithDefaultNamespace.java 2009-12-02 16:00:10 UTC (rev 19001)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
+
+/**
+ * @author mareshkau
+ * Test for JBIDE-5352
+ */
+public class TestForUsingComponentsLibrariesWithDefaultNamespace extends ComponentContentTest{
+
+ public TestForUsingComponentsLibrariesWithDefaultNamespace(String name) {
+ super(name);
+ }
+
+ public void testCheckContetnForDefaultNamespace() throws Throwable{
+ performContentTest("JBIDE/5352/table.xhtml"); //$NON-NLS-1$
+ performContentTest("JBIDE/5352/jbide5352.xhtml"); //$NON-NLS-1$
+
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-02 15:41:47 UTC (rev 19000)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-02 16:00:10 UTC (rev 19001)
@@ -371,9 +371,12 @@
return ATTRIBUTE_TEMPLATE_NAME;
case Node.ELEMENT_NODE:
String sourcePrefix = sourceNode.getPrefix();
-
- if (sourcePrefix == null
- || ((IDOMElement)sourceNode).isJSPTag()
+ //added by Maksim Areshkau as fix for JBIDE-5352
+ if(sourcePrefix==null) {
+ sourcePrefix=""; //$NON-NLS-1$
+ }
+
+ if (((IDOMElement)sourceNode).isJSPTag()
|| "jsp".equals(sourcePrefix)) { //$NON-NLS-1$
return sourceNode.getNodeName();
}
@@ -383,7 +386,7 @@
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix, taglibs);
if(sourceNodeTaglib == null) {
- return null;
+ return sourceNode.getNodeName();
}
String sourceNodeUri = sourceNodeTaglib.getUri();
@@ -403,7 +406,7 @@
&&CustomTLDReference.isExistInJsf2CustomComponenets(pageContext,sourceNodeUri,sourceNode.getLocalName()) ) {
return VpeTemplateManager.JSF2_CUSTOM_TEMPLATE;
}
- return null;
+ return sourceNode.getNodeName();
default :
return null;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java 2009-12-02 15:41:47 UTC (rev 19000)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHasInParents.java 2009-12-02 16:00:10 UTC (rev 19001)
@@ -27,6 +27,11 @@
while (parentNode != null) {
String parentSourcePrefix = parentNode.getPrefix();
+ //added by Maksim Areshkau, as fix for JBIDE-5352
+ //
+ if(parentSourcePrefix==null) {
+ parentSourcePrefix=""; //$NON-NLS-1$
+ }
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
pageContext);
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2009-12-02 15:41:47 UTC (rev 19000)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2009-12-02 16:00:10 UTC (rev 19001)
@@ -177,12 +177,15 @@
*/
private static void processAttribute(List<TaglibData> taglibs, Attr attr) {
- String startStr = "xmlns:"; //$NON-NLS-1$
+ String startStr = "xmlns"; //$NON-NLS-1$
String name = attr.getName();
if (!name.startsWith(startStr)) {
return;
}
name = name.substring(startStr.length());
+ if(name.startsWith(":")){ //$NON-NLS-1$
+ name = name.substring(1);//remove : in start of name
+ }
addTaglib(taglibs , attr.getValue(), name, true);
return;
}
15 years, 1 month
JBoss Tools SVN: r19000 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-02 10:41:47 -0500 (Wed, 02 Dec 2009)
New Revision: 19000
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.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/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
Log:
JBIDE-5354
DONE
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 15:40:22 UTC (rev 18999)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 15:41:47 UTC (rev 19000)
@@ -109,204 +109,217 @@
public static EStructuralFeature ELEMENT_BINDING = ExtendedMetaData.INSTANCE.demandFeature(
"http://www.milyn.org/xsd/smooks-1.0.xsd", "binding", true);
-// public static AnyType addBindingTypeToParamType(ParamType param, String property, String selector, String type,
-// String uri) {
-// AnyType binding = createBindingType(property, selector, type, uri);
-// param.getMixed().add(ELEMENT_BINDING, binding);
-// return binding;
-// }
-//
-// public static List<Object> getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
-// List<ParamType> paramList = resourceConfig.getParam();
-// for (Iterator<ParamType> iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = iterator.next();
-// if ("bindings".equals(param.getName())) {
-// if (param.eContents().isEmpty())
-// continue;
-// List<Object> bindingList = (List<Object>) param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
-// return bindingList;
-// }
-// }
-// return Collections.emptyList();
-// }
-//
-// public static boolean isBeanPopulatorResource(ResourceConfigType type) {
-// ResourceType resource = type.getResource();
-// if (resource == null)
-// return false;
-// String value = resource.getStringValue();
-// if (value != null)
-// value = value.trim();
-// if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
-// return true;
-// }
-// return false;
-// }
+ // public static AnyType addBindingTypeToParamType(ParamType param, String
+ // property, String selector, String type,
+ // String uri) {
+ // AnyType binding = createBindingType(property, selector, type, uri);
+ // param.getMixed().add(ELEMENT_BINDING, binding);
+ // return binding;
+ // }
+ //
+ // public static List<Object>
+ // getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
+ // List<ParamType> paramList = resourceConfig.getParam();
+ // for (Iterator<ParamType> iterator = paramList.iterator();
+ // iterator.hasNext();) {
+ // ParamType param = iterator.next();
+ // if ("bindings".equals(param.getName())) {
+ // if (param.eContents().isEmpty())
+ // continue;
+ // List<Object> bindingList = (List<Object>)
+ // param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
+ // return bindingList;
+ // }
+ // }
+ // return Collections.emptyList();
+ // }
+ //
+ // public static boolean isBeanPopulatorResource(ResourceConfigType type) {
+ // ResourceType resource = type.getResource();
+ // if (resource == null)
+ // return false;
+ // String value = resource.getStringValue();
+ // if (value != null)
+ // value = value.trim();
+ // if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
+ // return true;
+ // }
+ // return false;
+ // }
public static void setPropertyValueToAnyType(Object value, EStructuralFeature attribute, AnyType anyType) {
anyType.getAnyAttribute().set(attribute, value);
}
-// public static AnyType getBindingViaProperty(ResourceConfigType resourceConfig, String property) {
-// List bindingList = getBindingListFromResourceConfigType(resourceConfig);
-// for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
-// AnyType binding = (AnyType) iterator.next();
-// String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
-// if (pro != null)
-// pro = pro.trim();
-// if (property.equals(pro)) {
-// return binding;
-// }
-// }
-// return null;
-// }
-//
-// public static boolean isInnerFileContents(ResourceConfigType resourceConfig) {
-// ResourceType resource = resourceConfig.getResource();
-// if (resource == null)
-// return false;
-// String type = resource.getType();
-// if (type != null)
-// type = type.trim();
-// for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
-// String type1 = TEMPLATE_TYPES[i];
-// if (type1.equalsIgnoreCase(type))
-// return true;
-// }
-// return false;
-// }
-//
-// public static boolean isDateTypeSelector(ResourceConfigType type) {
-// ResourceType resource = type.getResource();
-// if (resource == null)
-// return false;
-// String value = resource.getStringValue();
-// if (value != null)
-// value = value.trim();
-// for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
-// String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
-// if (decoderClass.equals(value)) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// public static String getTransformType(ResourceConfigType resourceConfig) {
-// ParamType typeParam = null;
-// if (resourceConfig == null)
-// return "";
-// if (isTransformTypeResourceConfig(resourceConfig)) {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = (ParamType) iterator.next();
-// String name = param.getName();
-// if (name != null)
-// name = name.trim();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
-// typeParam = param;
-// break;
-// }
-// }
-// if (typeParam != null) {
-// return SmooksModelUtils.getAnyTypeText(typeParam);
-// }
-// }
-// return "";
-// }
-//
-// public static void setTransformType(ResourceConfigType resourceConfig, String type) {
-// if (type == null)
-// type = "";
-// if (isTransformTypeResourceConfig(resourceConfig)) {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = (ParamType) iterator.next();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
-// cleanTextToSmooksType(param);
-// setTextToAnyType(param, type);
-// }
-// }
-// }
-// }
-//
-// public static boolean isFilePathResourceConfig(ResourceConfigType resourceConfig) {
-// ResourceType resource = resourceConfig.getResource();
-// if (resource != null) {
-// String value = resource.getStringValue();
-// if (value != null) {
-// if (value.startsWith("\\")) {
-// return true;
-// }
-// if (value.startsWith("/")) {
-// return true;
-// }
-// }
-// }
-// return false;
-// }
-//
-// public static boolean isTransformTypeResourceConfig(ResourceConfigType resourceConfig) {
-// String selector = resourceConfig.getSelector();
-// if (selector != null)
-// selector = selector.trim();
-// if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
-// return false;
-// }
-//
-// if (resourceConfig.getParam().isEmpty()) {
-// return false;
-// } else {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType p = (ParamType) iterator.next();
-// String paramName = p.getName();
-// if (paramName != null)
-// paramName = paramName.trim();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
-// return true;
-// }
-// }
-// return false;
-// }
-// }
-//
-// public static void setParamText(String paramName, String value, ResourceConfigType resourceConfigType) {
-// List<ParamType> list = resourceConfigType.getParam();
-// ParamType param = null;
-// for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// String n = paramType.getName();
-// if (n == null)
-// continue;
-// n = n.trim();
-// if (n.equalsIgnoreCase(paramName)) {
-// param = paramType;
-// break;
-// }
-// }
-// if (param == null) {
-// param = SmooksFactory.eINSTANCE.createParamType();
-// param.setName(paramName);
-// resourceConfigType.getParam().add(param);
-// }
-// setTextToAnyType(param, value);
-// }
-//
-// public static String getParmaText(String paramName, ResourceConfigType resourceConfigType) {
-// List plist = resourceConfigType.getParam();
-// for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
-// ParamType p = (ParamType) iterator.next();
-// String n = p.getName();
-// if (n == null)
-// continue;
-// n = n.trim();
-// if (paramName.equalsIgnoreCase(n)) {
-// return getAnyTypeText(p);
-// }
-// }
-// return null;
-// }
+ // public static AnyType getBindingViaProperty(ResourceConfigType
+ // resourceConfig, String property) {
+ // List bindingList = getBindingListFromResourceConfigType(resourceConfig);
+ // for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
+ // AnyType binding = (AnyType) iterator.next();
+ // String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
+ // if (pro != null)
+ // pro = pro.trim();
+ // if (property.equals(pro)) {
+ // return binding;
+ // }
+ // }
+ // return null;
+ // }
+ //
+ // public static boolean isInnerFileContents(ResourceConfigType
+ // resourceConfig) {
+ // ResourceType resource = resourceConfig.getResource();
+ // if (resource == null)
+ // return false;
+ // String type = resource.getType();
+ // if (type != null)
+ // type = type.trim();
+ // for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
+ // String type1 = TEMPLATE_TYPES[i];
+ // if (type1.equalsIgnoreCase(type))
+ // return true;
+ // }
+ // return false;
+ // }
+ //
+ // public static boolean isDateTypeSelector(ResourceConfigType type) {
+ // ResourceType resource = type.getResource();
+ // if (resource == null)
+ // return false;
+ // String value = resource.getStringValue();
+ // if (value != null)
+ // value = value.trim();
+ // for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ // String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
+ // if (decoderClass.equals(value)) {
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ //
+ // public static String getTransformType(ResourceConfigType resourceConfig)
+ // {
+ // ParamType typeParam = null;
+ // if (resourceConfig == null)
+ // return "";
+ // if (isTransformTypeResourceConfig(resourceConfig)) {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType param = (ParamType) iterator.next();
+ // String name = param.getName();
+ // if (name != null)
+ // name = name.trim();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
+ // typeParam = param;
+ // break;
+ // }
+ // }
+ // if (typeParam != null) {
+ // return SmooksModelUtils.getAnyTypeText(typeParam);
+ // }
+ // }
+ // return "";
+ // }
+ //
+ // public static void setTransformType(ResourceConfigType resourceConfig,
+ // String type) {
+ // if (type == null)
+ // type = "";
+ // if (isTransformTypeResourceConfig(resourceConfig)) {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType param = (ParamType) iterator.next();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
+ // cleanTextToSmooksType(param);
+ // setTextToAnyType(param, type);
+ // }
+ // }
+ // }
+ // }
+ //
+ // public static boolean isFilePathResourceConfig(ResourceConfigType
+ // resourceConfig) {
+ // ResourceType resource = resourceConfig.getResource();
+ // if (resource != null) {
+ // String value = resource.getStringValue();
+ // if (value != null) {
+ // if (value.startsWith("\\")) {
+ // return true;
+ // }
+ // if (value.startsWith("/")) {
+ // return true;
+ // }
+ // }
+ // }
+ // return false;
+ // }
+ //
+ // public static boolean isTransformTypeResourceConfig(ResourceConfigType
+ // resourceConfig) {
+ // String selector = resourceConfig.getSelector();
+ // if (selector != null)
+ // selector = selector.trim();
+ // if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
+ // return false;
+ // }
+ //
+ // if (resourceConfig.getParam().isEmpty()) {
+ // return false;
+ // } else {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType p = (ParamType) iterator.next();
+ // String paramName = p.getName();
+ // if (paramName != null)
+ // paramName = paramName.trim();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ // }
+ //
+ // public static void setParamText(String paramName, String value,
+ // ResourceConfigType resourceConfigType) {
+ // List<ParamType> list = resourceConfigType.getParam();
+ // ParamType param = null;
+ // for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();)
+ // {
+ // ParamType paramType = (ParamType) iterator.next();
+ // String n = paramType.getName();
+ // if (n == null)
+ // continue;
+ // n = n.trim();
+ // if (n.equalsIgnoreCase(paramName)) {
+ // param = paramType;
+ // break;
+ // }
+ // }
+ // if (param == null) {
+ // param = SmooksFactory.eINSTANCE.createParamType();
+ // param.setName(paramName);
+ // resourceConfigType.getParam().add(param);
+ // }
+ // setTextToAnyType(param, value);
+ // }
+ //
+ // public static String getParmaText(String paramName, ResourceConfigType
+ // resourceConfigType) {
+ // List plist = resourceConfigType.getParam();
+ // for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
+ // ParamType p = (ParamType) iterator.next();
+ // String n = p.getName();
+ // if (n == null)
+ // continue;
+ // n = n.trim();
+ // if (paramName.equalsIgnoreCase(n)) {
+ // return getAnyTypeText(p);
+ // }
+ // }
+ // return null;
+ // }
public static String getAttributeValueFromAnyType(AnyType anyType, EStructuralFeature attribute) {
String value = (String) anyType.getAnyAttribute().get(attribute, false);
@@ -353,24 +366,26 @@
return null;
}
-// public static AnyType createBindingType(String property, String selector, String type, String uri) {
-// if (uri == null) {
-// uri = SmooksPackage.eNS_URI;
-// }
-//
-// AnyType binding = (AnyType) EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
-// if (property != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
-// }
-//
-// if (selector != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
-// }
-// if (type != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
-// }
-// return binding;
-// }
+ // public static AnyType createBindingType(String property, String selector,
+ // String type, String uri) {
+ // if (uri == null) {
+ // uri = SmooksPackage.eNS_URI;
+ // }
+ //
+ // AnyType binding = (AnyType)
+ // EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
+ // if (property != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
+ // }
+ //
+ // if (selector != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
+ // }
+ // if (type != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
+ // }
+ // return binding;
+ // }
public static void appendTextToSmooksType(AnyType smooksModel, String text) {
smooksModel.getMixed().add(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT, text);
@@ -600,7 +615,9 @@
String value = typeParam.getStringValue();
if (value != null) {
value = value.trim();
- return value.split(",");
+ if (!"".equals(value)) {
+ return value.split(",");
+ }
}
}
return null;
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-12-02 15:40:22 UTC (rev 18999)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-02 15:41:47 UTC (rev 19000)
@@ -16,6 +16,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -31,7 +32,6 @@
import org.jboss.template.TemplateBuilder;
import org.jboss.template.csv.CSVFreeMarkerTemplateBuilder;
import org.jboss.template.csv.CSVModelBuilder;
-import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.actions.AbstractSmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
@@ -91,6 +91,77 @@
return factory;
}
+ @Override
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
+ cleanValidationMarker();
+ // validate freemarker model.Because the freemarker csv node
+ // model isn't EMF model so they need to validate separately
+ if(root == null) return;
+ List<AbstractSmooksGraphicalModel> children = root.getChildren();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ if (abstractSmooksGraphicalModel instanceof FreemarkerTemplateGraphicalModel) {
+ Object data = abstractSmooksGraphicalModel.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+ if (data instanceof Freemarker) {
+ String type = SmooksModelUtils.getTemplateType((Freemarker) data);
+ if (SmooksModelUtils.FREEMARKER_TEMPLATE_TYPE_CSV.equals(type)) {
+ validateCSVTemplate(abstractSmooksGraphicalModel);
+ }
+ }
+ }
+ }
+ }
+
+ protected void validateCSVTemplate(AbstractSmooksGraphicalModel templateGraphModel) {
+ int s = AbstractSmooksGraphicalModel.NONE;
+ Object data = templateGraphModel.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+
+ char seperator = SmooksModelUtils.getFreemarkerCSVSeperator((Freemarker) data);
+
+ if (seperator == 0) {
+ templateGraphModel.getMessage().add("Seperator character can't be empty");
+ s = AbstractSmooksGraphicalModel.WARNING;
+ }
+
+ char quote = SmooksModelUtils.getFreemarkerCSVQuote((Freemarker) data);
+ if (quote == 0) {
+ templateGraphModel.getMessage().add("Quote character can't be empty");
+ s = AbstractSmooksGraphicalModel.WARNING;
+ }
+
+ String[] fields = SmooksModelUtils.getFreemarkerCSVFileds((Freemarker) data);
+ boolean missFields = false;
+ if (fields == null) {
+ missFields = true;
+ }
+
+ if (s != AbstractSmooksGraphicalModel.NONE) {
+ templateGraphModel.setSeverity(s);
+ }
+
+ List<AbstractSmooksGraphicalModel> csvRecordNode = templateGraphModel.getChildren();
+ for (Iterator<?> iterator = csvRecordNode.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel csvRecordGraphModel = (AbstractSmooksGraphicalModel) iterator.next();
+ if (missFields) {
+ csvRecordGraphModel.getMessage().add("CSV fields can't be empty");
+ csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
+ }
+ List<TreeNodeConnection> collectionConnections = csvRecordGraphModel.getTargetConnections();
+ if (collectionConnections.isEmpty()) {
+ csvRecordGraphModel.addMessage("Must be linked with source node");
+ csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
+ List<AbstractSmooksGraphicalModel> csvFields = csvRecordGraphModel.getChildren();
+ for (Iterator<?> iterator2 = csvFields.iterator(); iterator2.hasNext();) {
+ AbstractSmooksGraphicalModel csvFieldsGModel = (AbstractSmooksGraphicalModel) iterator2.next();
+ csvFieldsGModel.addMessage("Case CSV-Record isn't linked with source node , this node can't be linked.");
+ csvFieldsGModel.setSeverity(AbstractSmooksGraphicalModel.ERROR);
+ }
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -377,7 +448,7 @@
char quote = SmooksModelUtils.getFreemarkerCSVQuote(freemarker);
String[] fields = SmooksModelUtils.getFreemarkerCSVFileds(freemarker);
try {
- if(contents != null) {
+ if (contents != null) {
CSVModelBuilder modelBuilder = new CSVModelBuilder(fields);
Document model = modelBuilder.buildModel();
TemplateBuilder builder = new CSVFreeMarkerTemplateBuilder(model, seprator, quote, contents);
@@ -386,7 +457,7 @@
}
} catch (Exception e) {
// ignore exception
-// e.printStackTrace();
+ // e.printStackTrace();
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 15:40:22 UTC (rev 18999)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 15:41:47 UTC (rev 19000)
@@ -99,7 +99,7 @@
Freemarker freemarker = (Freemarker) parent.getData();
if (freemarker != null) {
ParamType param = SmooksModelUtils.getParam(freemarker.getParam(), SmooksModelUtils.KEY_CSV_FIELDS);
- if (param == null){
+ if (param == null) {
param = SmooksFactory.eINSTANCE.createParamType();
param.setName(SmooksModelUtils.KEY_CSV_FIELDS);
freemarker.getParam().add(param);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 15:40:22 UTC (rev 18999)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 15:41:47 UTC (rev 19000)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.graphical.editors.model.javamapping;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
@@ -29,6 +30,7 @@
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigChildNodeGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVLinkConnection;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerCSVNodeGraphicalModel;
import org.jboss.tools.smooks.model.javabean.ValueType;
/**
@@ -115,7 +117,24 @@
obj = AdapterFactoryEditingDomain.unwrap(obj);
if (obj instanceof ValueType || obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
if (m instanceof CSVNodeModel) {
- return !((CSVNodeModel) m).isRecord();
+ if (!((CSVNodeModel) m).isRecord()) {
+ List<TreeNodeConnection> exsitingConnection = gm.getTargetConnections();
+ if (!exsitingConnection.isEmpty())
+ return false;
+ for (Iterator<?> iterator = exsitingConnection.iterator(); iterator.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
+ if (treeNodeConnection.getSourceNode() == this) {
+ return false;
+ }
+ }
+ AbstractSmooksGraphicalModel parent = gm.getParent();
+ if (parent instanceof FreemarkerCSVNodeGraphicalModel) {
+ List<TreeNodeConnection> connections = parent.getTargetConnections();
+ if (!connections.isEmpty()) {
+ return true;
+ }
+ }
+ }
}
}
if (!inJavaMapping())
15 years, 1 month