JBoss Tools SVN: r11690 - in trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt: META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-11 17:42:53 -0500 (Tue, 11 Nov 2008)
New Revision: 11690
Added:
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.classpath
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.project
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/META-INF/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/META-INF/MANIFEST.MF
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/build.properties
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_jbds.ini
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_pde.ini
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.csv
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.xslt
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/xslt/
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/xslt/Activator.java
Log:
Initial import.
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.classpath
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.classpath (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.classpath 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.project
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.project (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/.project 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.equinox.transforms.xslt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/META-INF/MANIFEST.MF
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/META-INF/MANIFEST.MF (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/META-INF/MANIFEST.MF 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss xslt transforms
+Bundle-SymbolicName: org.jboss.tools.equinox.transforms.xslt
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.equinox.transforms.xslt.Activator
+Import-Package: org.osgi.framework
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Export-Package: org.jboss.tools.equinox.transforms.xslt
+Bundle-Vendor: JBoss, a division of Red Hat
+
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/build.properties
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/build.properties (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/build.properties 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ jboss.xslt,\
+ jboss.csv,\
+ config_pde.ini,\
+ config_jbds.ini
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_jbds.ini
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_jbds.ini (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_jbds.ini 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,16 @@
+#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
+#Tue Nov 11 22:47:20 CET 2008
+osgi.launcherPath=.
+org.eclipse.update.reconcile=false
+eclipse.p2.profile=SDKProfile
+osgi.instance.area.default=(a)user.home/workspace
+osgi.framework=file\:plugins\\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
+eclipse.buildId=M20080911-1700
+osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar@1\:start,org.eclipse.equinox.transforms.xslt@1\:start,org.jboss.tools.equinox.transforms.xslt@1\:start
+org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator\\bundles.info
+eclipse.product=com.jboss.jbds.product.product
+osgi.splashPath=platform\:/base/plugins/com.jboss.jbds.product
+osgi.launcherIni=eclipse
+eclipse.p2.data.area=@config.dir/../p2
+osgi.bundles.defaultStartLevel=4
+osgi.framework.extensions=org.eclipse.equinox.transforms.hook
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_pde.ini
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_pde.ini (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/config_pde.ini 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,6 @@
+osgi.bundles=org.eclipse.equinox.common@2\:start,org.eclipse.update.configurator@3\:start,org.eclipse.core.runtime@start,org.eclipse.equinox.transforms.xslt@1:\start,org.jboss.tools.equinox.transforms.xslt@1:\start
+osgi.bundles.defaultStartLevel=4
+osgi.framework=org.eclipse.osgi
+osgi.configuration.cascaded=false
+osgi.splashPath=org.eclipse.platform
+osgi.framework.extensions=org.eclipse.equinox.transforms.hook
\ No newline at end of file
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.csv
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.csv (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.csv 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,2 @@
+#Bundle ID regex, Resource Path regex, resource path
+org\.eclipse\.jst\.server\.generic\.jboss,plugin\.xml,/jboss.xslt
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.xslt
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.xslt (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/jboss.xslt 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,6 @@
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="plugin">
+
+ </xsl:template>
+
+ </xsl:stylesheet>
\ No newline at end of file
Added: trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/xslt/Activator.java
===================================================================
--- trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/xslt/Activator.java (rev 0)
+++ trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/src/org/jboss/tools/equinox/transforms/xslt/Activator.java 2008-11-11 22:42:53 UTC (rev 11690)
@@ -0,0 +1,36 @@
+package org.jboss.tools.equinox.transforms.xslt;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator implements BundleActivator {
+
+ private ServiceRegistration registration;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ Properties properties = new Properties();
+ properties.put("equinox.transformerType", "xslt"); //$NON-NLS-1$ //$NON-NLS-2$
+ registration = context.registerService(URL.class.getName(), context.getBundle().getEntry("/jboss.csv"), properties); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ if (registration != null)
+ registration.unregister();
+ }
+
+}
17 years, 5 months
JBoss Tools SVN: r11689 - trunk/xslt/plugins.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-11 17:42:24 -0500 (Tue, 11 Nov 2008)
New Revision: 11689
Added:
trunk/xslt/plugins/org.jboss.tools.equinox.transforms.xslt/
Log:
Initial import.
17 years, 5 months
JBoss Tools SVN: r11688 - trunk/xslt.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-11 17:38:47 -0500 (Tue, 11 Nov 2008)
New Revision: 11688
Added:
trunk/xslt/plugins/
Log:
17 years, 5 months
JBoss Tools SVN: r11687 - trunk.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-11 17:38:08 -0500 (Tue, 11 Nov 2008)
New Revision: 11687
Added:
trunk/xslt/
Log:
17 years, 5 months
JBoss Tools SVN: r11686 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-11-11 15:30:42 -0500 (Tue, 11 Nov 2008)
New Revision: 11686
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3025 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -35,7 +35,8 @@
public static String ERROR_JBOSS_AS_TARGET_SERVER_INCOMPATIBLE;
public static String ERROR_JBOSS_AS_TARGET_RUNTIME_IS_EMPTY;
public static String ERROR_JBOSS_AS_TARGET_RUNTIME_UNKNOWN;
- public static String SEAM_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED = null;
+ public static String SEAM_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED;
public static String SEAM_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW;
public static String SEAM_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR;
+ public static String SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE;
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2008-11-11 20:30:42 UTC (rev 11686)
@@ -26,4 +26,5 @@
ERROR_JBOSS_AS_TARGET_SERVER_NO_SERVERS_DEFINED=There are no available Target Service for selected Target Runtime
ERROR_JBOSS_AS_TARGET_SERVER_INCOMPATIBLE=Target Server is incompatible with Target Runtime selected
ERROR_JBOSS_AS_TARGET_RUNTIME_IS_EMPTY=Target Runtime cannot be empty
-ERROR_JBOSS_AS_TARGET_RUNTIME_UNKNOWN=Unknown Target Runtime
\ No newline at end of file
+ERROR_JBOSS_AS_TARGET_RUNTIME_UNKNOWN=Unknown Target Runtime
+SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE=Project names which start with a capital letter may break Seam/JSF applications; use lower case.
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -162,6 +162,14 @@
return defaultRuntime.getName();
}
+ public boolean propertySet(String propertyName, Object propertyValue) {
+ if (IFacetDataModelProperties.FACET_PROJECT_NAME.equals(propertyName)) {
+ setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, propertyValue);
+ setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, propertyValue);
+ }
+ return super.propertySet(propertyName, propertyValue);
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#init()
@@ -169,6 +177,7 @@
@Override
public void init() {
super.init();
+
model.setProperty(ISeamFacetDataModelProperties.DB_TYPE, SeamProjectPreferences.getStringPreference(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE));
model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, SeamProjectPreferences.getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE));
model.setProperty(ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME, "");
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -68,6 +68,8 @@
setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, event.getProperty());
model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, IDataModel.DEFAULT_CHG);
model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, IDataModel.VALID_VALUES_CHG);
+ } else if (IFacetDataModelProperties.FACET_PROJECT_NAME.equals(event.getPropertyName())) {
+ setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, event.getProperty());
}
}
});
@@ -112,6 +114,8 @@
FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
IDataModel seamFacet = map.getFacetDataModel(ISeamFacetDataModelProperties.SEAM_FACET_ID);
seamFacet.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, propertyValue);
+ } else if (propertyName.equals(IFacetDataModelProperties.FACET_PROJECT_NAME)) {
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, propertyValue);
}
return super.propertySet(propertyName, propertyValue);
@@ -121,6 +125,7 @@
Set names = super.getPropertyNames();
names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ names.add(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);
return names;
}
@@ -200,9 +205,26 @@
if (!status.isOK())
return status;
}
+ if(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME.equals(propertyName)) {
+ String projectName = (String)model.getProperty(propertyName);
+ status = validateUpperCaseInProjectName(projectName);
+ if(!status.isOK()) {
+ return status;
+ }
+ }
return OK_STATUS;
}
+ public static IStatus validateUpperCaseInProjectName(String projectName) {
+ if(projectName!=null && projectName.length()>0) {
+ char firstLetter = projectName.charAt(0);
+ if(Character.isUpperCase(firstLetter)) {
+ return new Status(IStatus.WARNING, SeamCorePlugin.PLUGIN_ID, SeamCoreMessages.SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE);
+ }
+ }
+ return OK_STATUS;
+ }
+
private IStatus validateServer(Object serverObject) {
if (serverObject == null) {
return SeamCorePlugin.createErrorStatus(SeamCoreMessages.ERROR_JBOSS_AS_TARGET_SERVER_IS_EMPTY, null);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -113,8 +113,6 @@
public static String SEAM_FORM_WIZARD_PAGE1_JAVA_INTERFACE_SLSB_AND_KEY_SEAMEJB3_ANNOTATIONS_WILL_BE_CREATED;
- public static String SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE;
-
public static String SEAM_FORM_WIZARD_PAGE1_SEAM_FORM;
public static String SEAM_FORM_WIZARD_PAGE1_SELECT_THE_NAME_OF_THE_NEW_SEAM_FORM;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -64,12 +64,14 @@
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.widget.editor.CompositeEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
import org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor;
import org.jboss.tools.seam.ui.wizard.SeamFormWizard;
+import org.jboss.tools.seam.ui.wizard.SeamProjectWizard;
import org.jboss.tools.seam.ui.wizard.SeamWizardFactory;
import org.jboss.tools.seam.ui.wizard.SeamWizardUtils;
@@ -381,12 +383,10 @@
validatorDelegate.addValidatorForProperty(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
getDeploymentTypeValidator(getWizard()));
- validatorDelegate.addValidatorForProperty(
- IFacetDataModelProperties.FACET_PROJECT_NAME,
- new ProjectNamesDuplicationValidator(
- IFacetDataModelProperties.FACET_PROJECT_NAME));
- validatorDelegate.addValidatorForProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
+ if(!isNewSeamProjectWizard()) {
+ validatorDelegate.addValidatorForProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
new ProjectNameValidator(IFacetDataModelProperties.FACET_PROJECT_NAME));
+ }
}
jBossHibernateDbTypeEditor
@@ -402,6 +402,10 @@
initDefaultWizardProperties();
}
+ private boolean isNewSeamProjectWizard() {
+ return getWizard()==null || getWizard() instanceof SeamProjectWizard;
+ }
+
private boolean isNewProjectWizard() {
// ModifyFacetedProjectWizard or NewProjectDataModelFacetWizard
return getWizard()==null || getWizard() instanceof NewProjectDataModelFacetWizard;
@@ -445,6 +449,7 @@
* Fills Code Generation group with the default package names.
*/
private void setCodeGenerationProperties() {
+ String p = (String)model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);
sessionBeanPkgNameditor
.setValue("org.domain." //$NON-NLS-1$
+ model
@@ -553,14 +558,10 @@
return ValidatorFactory.NO_ERRORS;
}
final String projectName = (String)value;
- if(projectName.length()==0) {
- return ValidatorFactory.NO_ERRORS;
+ IStatus status = SeamFacetProjectCreationDataModelProvider.validateUpperCaseInProjectName(projectName);
+ if(!status.isOK()) {
+ return ValidatorFactory.createErrormessage(propertyName, status);
}
- char firstLetter = projectName.charAt(0);
- if(Character.isUpperCase(firstLetter)) {
- return ValidatorFactory.createErrormessage(propertyName,
- new Status(IStatus.WARNING, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE));
- }
return ValidatorFactory.NO_ERRORS;
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-11-11 20:30:42 UTC (rev 11686)
@@ -107,7 +107,6 @@
SEAM_WIZARD_FACTORY_METHOD_NAME=Method name:
SEAM_INSTALL_WIZARD_PAGE_NEW=New...
SEAM_INSTALL_WIZARD_PAGE_PACKAGE_NAME_FOR=Package name for
-SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE=Project names which start with a capital letter may break Seam/JSF applications; use lower case.
SEAM_INSTALL_WIZARD_PAGE_IS_NOT_VALID=\ is not valid
SEAM_BASE_WIZARD_PAGE_POJO_CLASS_NAME=POJO class name:
SEAM_BASE_WIZARD_PAGE_SEAM_COMPONENTS=Seam component
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2008-11-11 19:36:41 UTC (rev 11685)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2008-11-11 20:30:42 UTC (rev 11686)
@@ -274,6 +274,7 @@
arrayList.addAll( list );
arrayList.add( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
arrayList.add( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ arrayList.add( ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);
return (String[])arrayList.toArray( new String[0] );
}
17 years, 5 months
JBoss Tools SVN: r11685 - in trunk/archives: plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-11-11 14:36:41 -0500 (Tue, 11 Nov 2008)
New Revision: 11685
Added:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ui/
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ui/BuildActionTest.java
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.properties
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
Log:
JBIDE-3156 / JBDS-485 - Action was dumb, forgot to check for WrappedProject. Unit tests added
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.java 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.java 2008-11-11 19:36:41 UTC (rev 11685)
@@ -18,6 +18,7 @@
public static String RuntimeErrorDuringBuild;
public static String ProjectCannotBeBuilt;
+ public static String ErrorBuilding;
public static String ErrorLocatingRootNode;
public static String BuildingProject;
public static String BuildingArchive;
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.properties
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.properties 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreMessages.properties 2008-11-11 19:36:41 UTC (rev 11685)
@@ -12,6 +12,7 @@
RuntimeErrorDuringBuild=A runtime error has occurred during the build.
ProjectCannotBeBuilt=Project {0} does not exist or has no .packages file. Skipping.
+ErrorBuilding=An error occurred while building project archives
ErrorLocatingRootNode=An error occurred locating the root node for {0}
BuildingProject=Building project {0}
BuildingArchive=Building archive {0}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-11-11 19:36:41 UTC (rev 11685)
@@ -29,11 +29,13 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.ArchivesCoreMessages;
+import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.EventManager;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -67,7 +69,7 @@
* A full project build has been requested.
* @param project The project containing the archive model
*/
- public void fullProjectBuild(IPath project, IProgressMonitor monitor) {
+ public IStatus fullProjectBuild(IPath project, IProgressMonitor monitor) {
EventManager.cleanProjectBuild(project);
EventManager.startedBuild(project);
@@ -77,6 +79,7 @@
ArchivesCore.bind(ArchivesCoreMessages.ErrorLocatingRootNode, project.toOSString()), null);
EventManager.error(null, new IStatus[]{s});
monitor.done();
+ return s;
} else {
IArchiveNode[] nodes = root.getChildren(IArchiveNode.TYPE_ARCHIVE);
ArrayList<IStatus> errors = new ArrayList<IStatus>();
@@ -91,7 +94,11 @@
EventManager.finishedBuild(project);
EventManager.error(null, errors.toArray(new IStatus[errors.size()]));
+ MultiStatus ms = new MultiStatus(ArchivesCorePlugin.PLUGIN_ID, 0, ArchivesCoreMessages.ErrorBuilding, null);
+ for( int i = 0; i < errors.size(); i++ )
+ ms.add(errors.get(i));
monitor.done();
+ return ms;
}
}
@@ -99,17 +106,17 @@
* Builds an archive entirely, overwriting whatever was in the output destination.
* @param pkg The archive to build
*/
- public IStatus[] fullArchiveBuild(IArchive pkg, IProgressMonitor monitor) {
+ public IStatus fullArchiveBuild(IArchive pkg, IProgressMonitor monitor) {
return fullArchiveBuild(pkg, monitor, true);
}
- protected IStatus[] fullArchiveBuild(IArchive pkg, IProgressMonitor monitor, boolean log) {
+ protected IStatus fullArchiveBuild(IArchive pkg, IProgressMonitor monitor, boolean log) {
if( !pkg.canBuild() ) {
IStatus s = new Status(IStatus.ERROR, ArchivesCore.PLUGIN_ID,
ArchivesCore.bind(ArchivesCoreMessages.CannotBuildBadConfiguration, pkg.getName()), null);
if( log )
EventManager.error(pkg, new IStatus[]{s});
monitor.done();
- return new IStatus[]{s};
+ return s;
}
EventManager.cleanArchiveBuild(pkg);
@@ -125,7 +132,7 @@
if( log )
EventManager.error(pkg, new IStatus[]{s});
monitor.done();
- return new IStatus[]{s};
+ return s;
}
}
@@ -189,8 +196,11 @@
IStatus[] errors2 = errors.toArray(new IStatus[errors.size()]);
if( log )
EventManager.error(pkg, errors2 );
+ MultiStatus ms = new MultiStatus(ArchivesCorePlugin.PLUGIN_ID, 0, ArchivesCoreMessages.ErrorBuilding, null);
+ for( int i = 0; i < errors.size(); i++ )
+ ms.add(errors.get(i));
monitor.done();
- return errors2;
+ return ms;
}
/**
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-11-11 19:36:41 UTC (rev 11685)
@@ -1,84 +1,92 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
-
-/**
- * Fire off a build of the archives or project / resource selected
- * @author "Rob Stryker" <rob.stryker(a)redhat.com>
- *
- */
-public class BuildAction implements IWorkbenchWindowActionDelegate {
- private IProject selectedProject;
- public void dispose() {
- }
-
- public void init(IWorkbenchWindow window) {
- }
-
- public void run(IAction action) {
- if( selectedProject != null )
- buildSelectedNode(selectedProject);
- }
-
- public void run(Object node) {
- buildSelectedNode(node);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- if( !selection.isEmpty() && selection instanceof IStructuredSelection ) {
- Object o = ((IStructuredSelection)selection).getFirstElement();
- if( o instanceof IAdaptable ) {
- IResource res = (IResource) ((IAdaptable)o).getAdapter(IResource.class);
- if( res != null ) {
- selectedProject = res.getProject();
- return;
- }
- }
- }
- selectedProject = null;
- }
-
- private void buildSelectedNode(final Object selected) {
- new Job(ArchivesUIMessages.BuildArchivesNode) {
- // TODO actually get the status object
- protected IStatus run(IProgressMonitor monitor) {
- if( selected == null ) return Status.OK_STATUS;
- if (selected instanceof IArchiveNode &&
- ((IArchiveNode)selected).getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected, monitor);
- } else if( selected != null && selected instanceof IProject ){
- new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation(), monitor);
- } else {
- new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive(), monitor);
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
-}
\ No newline at end of file
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+
+/**
+ * Fire off a build of the archives or project / resource selected
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
+public class BuildAction implements IWorkbenchWindowActionDelegate {
+ private Object selected;
+ public void dispose() {
+ }
+
+ public void init(IWorkbenchWindow window) {
+ }
+
+ public void run(IAction action) {
+ if( selected != null )
+ buildSelectedNode(selected);
+ }
+
+ public Job run(Object node) {
+ return buildSelectedNode(node);
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if( !selection.isEmpty() && selection instanceof IStructuredSelection ) {
+ Object o = ((IStructuredSelection)selection).getFirstElement();
+ if(o instanceof WrappedProject )
+ o = ((WrappedProject)o).getElement();
+ if( o instanceof IAdaptable ) {
+ IResource res = (IResource) ((IAdaptable)o).getAdapter(IResource.class);
+ if( res != null ) {
+ selected = res.getProject();
+ }
+ }
+ if( o instanceof IArchiveNode )
+ selected = o;
+ return;
+ }
+ selected = null;
+ }
+
+ private Job buildSelectedNode(final Object selected) {
+ Job j = new Job(ArchivesUIMessages.BuildArchivesNode) {
+ // TODO actually get the status object
+ protected IStatus run(IProgressMonitor monitor) {
+ if( selected == null ) return Status.OK_STATUS;
+ if( selected instanceof IArchiveNode ) {
+ IArchiveNode archive = (IArchiveNode)selected;
+ if( archive.getNodeType() != IArchiveNode.TYPE_ARCHIVE)
+ archive = archive.getRootArchive();
+ return new ArchiveBuildDelegate().fullArchiveBuild((IArchive)archive, monitor);
+ } else if( selected instanceof IProject || selected instanceof WrappedProject ) {
+ IProject p = selected instanceof IProject ? (IProject)selected : ((WrappedProject)selected).getElement();
+ return new ArchiveBuildDelegate().fullProjectBuild(p.getLocation(), monitor);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ j.schedule();
+ return j;
+ }
+
+}
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2008-11-11 19:36:41 UTC (rev 11685)
@@ -14,7 +14,9 @@
org.eclipse.debug.core;bundle-version="3.4.0",
org.apache.ant;bundle-version="1.7.0",
org.eclipse.ant.ui;bundle-version="3.3.0",
- org.eclipse.jdt.launching;bundle-version="3.4.0"
+ org.eclipse.jdt.launching;bundle-version="3.4.0",
+ org.jboss.ide.eclipse.archives.ui;bundle-version="1.0.0",
+ org.eclipse.jface;bundle-version="3.4.0"
Eclipse-LazyStart: true
Bundle-ClassPath: archivestest.jar
Export-Package: org.jboss.ide.eclipse.archives.test,
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-11-11 19:21:14 UTC (rev 11684)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-11-11 19:36:41 UTC (rev 11685)
@@ -16,6 +16,7 @@
import org.jboss.ide.eclipse.archives.test.projects.JBIDE2311Test;
import org.jboss.ide.eclipse.archives.test.projects.JBIDE2315Test;
import org.jboss.ide.eclipse.archives.test.projects.JBIDE2439Test;
+import org.jboss.ide.eclipse.archives.test.ui.BuildActionTest;
import org.jboss.ide.eclipse.archives.test.util.TruezipUtilTest;
public class ArchivesTestSuite extends TestSuite {
@@ -38,6 +39,9 @@
suite.addTestSuite(JBIDE2315Test.class);
suite.addTestSuite(JBIDE2439Test.class);
+
+ // UI
+ suite.addTestSuite(BuildActionTest.class);
return suite;
}
Added: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ui/BuildActionTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ui/BuildActionTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ui/BuildActionTest.java 2008-11-11 19:36:41 UTC (rev 11685)
@@ -0,0 +1,116 @@
+package org.jboss.ide.eclipse.archives.test.ui;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelRootNode;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.jboss.ide.eclipse.archives.ui.actions.BuildAction;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class BuildActionTest extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+ private boolean waiting = true;
+ private boolean scheduled = false;
+ private JobChangeAdapter jobChangeAdapter;
+ private CoreException ce;
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider(ArchivesTest.PLUGIN_ID,
+ "inputs" + Path.SEPARATOR + "projects" + Path.SEPARATOR + "JBIDE2099",
+ null, true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ Job.getJobManager().addJobChangeListener(getJobChangeAdapter());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ Job.getJobManager().removeJobChangeListener(jobChangeAdapter);
+ }
+
+ protected JobChangeAdapter getJobChangeAdapter() {
+ jobChangeAdapter = new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ if( event.getJob().getClass().getName().startsWith("org.jboss.ide.eclipse.archives.ui.actions.BuildAction")) {
+ IStatus result = event.getResult();
+ System.out.println(result);
+ if( !result.isOK())
+ ce = new CoreException(result);
+ waiting = false;
+ }
+ }
+ public void scheduled(IJobChangeEvent event) {
+ if( event.getJob().getClass().getName().startsWith("org.jboss.ide.eclipse.archives.ui.actions.BuildAction")) {
+ scheduled = true;
+ }
+ }
+ };
+ return jobChangeAdapter;
+ }
+
+ public void testBuildAction() {
+ ArchivesModel.instance().registerProject(project.getLocation(), new NullProgressMonitor());
+ BuildAction action = new BuildAction();
+ waiting = true;
+
+ action.run(project);
+ waitForGo();
+
+ ISelection sel = new StructuredSelection(new Object[]{project});
+ action.selectionChanged(null, sel);
+ action.run(null);
+ waitForGo();
+
+
+
+ action.run(new WrappedProject(project, 0));
+ waitForGo();
+
+ sel = new StructuredSelection(new Object[] { new WrappedProject(project,0)});
+ action.selectionChanged(null, sel);
+ action.run(null);
+ waitForGo();
+
+
+
+ IArchiveModelRootNode root = ArchivesModel.instance().getRoot(project.getLocation());
+ IArchiveNode[] children = root.getAllChildren();
+ action.run(children[0]);
+ waitForGo();
+
+ sel = new StructuredSelection(children);
+ action.selectionChanged(null, sel);
+ action.run(null);
+ waitForGo();
+ }
+
+ protected void waitForGo() throws RuntimeException {
+ if( !scheduled )
+ fail("Job not scheduled");
+ while(waiting)
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
+
+ // finished, now start waiting again
+ waiting = true;
+ scheduled = false;
+
+ if( ce != null )
+ throw new RuntimeException(ce);
+ }
+}
17 years, 5 months
JBoss Tools SVN: r11684 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144 and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-11 14:21:14 -0500 (Tue, 11 Nov 2008)
New Revision: 11684
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/display.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/edit.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/menu.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/template.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/stylesheet/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/stylesheet/theme.css
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
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/jbide/JBIDE2624Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/TaglibReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
junit for JBIDE-3144, some junit adjustment, restored event procesing in time of update visual editor
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/home.xhtml 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,34 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="#{request.contextPath}/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel>
+ <f:facet name="header">Welcome!</f:facet>
+ <p>This empty shell application includes:</p>
+ <ul>
+ <li>Ant build script</li>
+ <li>Deployment to JBoss AS (EAR or WAR)</li>
+ <li>Development and production profiles</li>
+ <li>Integration testing using TestNG and Embedded JBoss</li>
+ <li>JavaBean or EJB 3.0 Seam components</li>
+ <li>JPA entity classes</li>
+ <li>A configurable DataSource and JPA EntityManager</li>
+ <li>Templated Facelets views</li>
+ <li>RichFaces panels and tables</li>
+ <li>Default CSS stylesheet</li>
+ <li>Internationalization support</li>
+ <li><h:outputText value="Test Test" /></li>
+ </ul>
+ </rich:panel>
+</ui:define>
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/display.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/display.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/display.xhtml 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,16 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="prop">
+ <span class="name">
+ <ui:insert name="label"/>
+ </span>
+ <span class="value">
+ <ui:insert/>
+ </span>
+ </div>
+
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/edit.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/edit.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/edit.xhtml 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,27 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="prop">
+
+ <s:label styleClass="name #{invalid?'errors':''}">
+ <ui:insert name="label"/>
+ <s:span styleClass="required" rendered="#{required}">*</s:span>
+ </s:label>
+
+ <span class="value #{invalid?'errors':''}">
+ <s:validateAll>
+ <ui:insert/>
+ </s:validateAll>
+ </span>
+
+ <span class="error">
+ <h:graphicImage value="/img/error.gif" rendered="#{invalid}" styleClass="errors"/>
+ <s:message styleClass="errors"/>
+ </span>
+
+ </div>
+
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/menu.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/menu.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/menu.xhtml 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,18 @@
+<rich:toolBar
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:toolBarGroup>
+ <h:outputText value="#{projectName}:"/>
+ <s:link view="/home.xhtml" value="Home"/>
+ </rich:toolBarGroup>
+ <!-- @newMenuItem@ -->
+ <rich:toolBarGroup location="right">
+ <h:outputText value="Welcome, #{identity.username}!" rendered="#{identity.loggedIn}"/>
+ <s:link view="/login.xhtml" value="Login" rendered="#{not identity.loggedIn}"/>
+ <s:link view="/home.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
+ </rich:toolBarGroup>
+</rich:toolBar>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/template.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/template.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/layout/template.xhtml 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,30 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>jbide3144</title>
+ <link href="./stylesheet/theme.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+ <ui:include src="menu.xhtml">
+ <ui:param name="projectName" value="jbide3144"/>
+ </ui:include>
+
+ <div class="body">
+ <ui:insert name="body"/>
+ </div>
+
+ <div class="footer">
+ Powered by <a href="http://jboss.com/products/seam">Seam</a>.
+ Generated by seam-gen.
+ </div>
+
+</body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/stylesheet/theme.css
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/stylesheet/theme.css (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/stylesheet/theme.css 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,117 @@
+body {
+ font-size: 12px;
+}
+
+a:active, a:link, a:visited {
+ color: #0D5798;
+}
+a:hover {
+ color: #8CAFCD;
+}
+
+input, textarea {
+ border: 1px solid #BBBBBB;
+ font-size: 10px;
+ background: #F0F8FF;
+ color: black;
+}
+
+input[type='submit'], input[type='button'] {
+ background: #4477AA;
+ color: white;
+ margin: 5px;
+ border-color: gray;
+}
+
+.tableControl, .actionButtons {
+ width: 100%;
+}
+
+.tableControl a {
+ padding-left: 10px;
+}
+
+.tableControl {
+ text-align: right;
+}
+
+.footer {
+ text-align: center;
+ font-size: 10px;
+}
+
+.rich-table {
+ width:100%;
+}
+
+h1 {
+ font-family: Arial,sans-serif;
+ color: #578BB8;
+ font-size: 1.6em;
+ margin-top: 0;
+}
+
+body {
+ margin: 0px;
+ font-family: Arial,sans-serif;
+ color: #616161;
+}
+
+.body {
+ padding: 30px;
+}
+
+.columnHeader:hover
+{
+ color: #FF6600;
+}
+
+.message {
+ border: 1px solid #FFCC00;
+ padding: 5px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #F0F8FF;
+ font-size: 12px;
+}
+
+.name {
+ vertical-align: top;
+ font-weight: bold;
+ width: 115px;
+ float: left;
+ padding: 5px;
+ margin-top: 3px;
+ clear: left;
+}
+.value {
+ float: left;
+ padding: 5px;
+}
+
+.error {
+ float: left;
+ padding: 5px;
+}
+.errors {
+ color: red;
+ vertical-align: middle;
+}
+img.errors {
+ padding-right: 5px;
+}
+.errors input {
+ border: 1px solid red;
+}
+.errors textarea {
+ border: 1px solid red;
+}
+
+.required {
+ color: red;
+ padding-left: 2px;
+}
+
+.rich-stglpanel-body {
+ overflow: auto;
+}
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 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -42,6 +42,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2979Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3030Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3127Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3144Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -109,6 +110,7 @@
suite.addTestSuite(JBIDE3030Test.class);
suite.addTestSuite(JBIDE2979Test.class);
suite.addTestSuite(JBIDE3127Test.class);
+ suite.addTestSuite(JBIDE3144Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624Test.java 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2624Test.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -88,7 +88,8 @@
TestUtil.findAllElementsByName(element, elements, HTML.TAG_TABLE);
assertTrue("Faceletes wasn't loaded from specified path", elements.size() >= 1); //$NON-NLS-1$
-
+ //clear all resources
+ RelativeFolderReferenceList.getInstance().setAllResources(file,new ResourceReference[0]);
}
}
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.common.el.core.ELReferenceList;
+import org.jboss.tools.common.resref.core.ResourceReference;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3144Test extends VpeTest{
+
+ /**
+ * Test Page
+ */
+ private IFile file;
+ private static Map<String, String> elValuesMap;
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.ui.test.VpeTest#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setException(null);
+ this.file = (IFile) TestUtil.getComponentPath("JBIDE/3144/home.xhtml", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ elValuesMap = new HashMap<String, String>();
+ elValuesMap.put("request.contextPath", "./"); //$NON-NLS-1$ //$NON-NLS-2$
+ ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
+ int i = 0;
+ for (Entry<String, String> string : elValuesMap.entrySet()) {
+ entries[i] = new ResourceReference(string.getKey(), ResourceReference.PROJECT_SCOPE);
+ entries[i].setProperties(string.getValue());
+ i++;
+ }
+ ELReferenceList.getInstance().setAllResources(this.file,entries);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.ui.test.VpeTest#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ ELReferenceList.getInstance().setAllResources(this.file, new ResourceReference[0]);
+ if(getException()!=null) {
+ throw new Exception(getException());
+ }
+ super.tearDown();
+ }
+
+ public JBIDE3144Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3144Selection() throws Exception {
+ IEditorInput input = new FileEditorInput(file);
+ JSPMultiPageEditor part = openEditor(input);
+ checkSourceSelection(part);
+ }
+
+ public void testJBIDE3144EditingOfSimpleTextNodes() {
+ fail("Implement test case");
+ }
+
+ public void testJBIDE3144EditingJSFElements() {
+ fail("Implement test case");
+ }
+}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -91,52 +91,8 @@
// open and get editor
JSPMultiPageEditor part = openEditor(input);
- // get controller
- VpeController controller = getVpeController(part);
- assertNotNull(controller);
+ checkSourceSelection(part);
- // get dommapping
- VpeDomMapping domMapping = controller.getDomMapping();
-
- assertNotNull(domMapping);
-
- // get source map
- Map<Node, VpeNodeMapping> sourceMap = domMapping.getSourceMap();
- assertNotNull(sourceMap);
-
- // get collection of VpeNodeMapping
- Collection<VpeNodeMapping> mappings = sourceMap.values();
- assertNotNull(mappings);
-
- // get editor control
- StyledText styledText = part.getSourceEditor().getTextViewer()
- .getTextWidget();
- assertNotNull(styledText);
-
- // get xulrunner editor
- XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
- assertNotNull(xulRunnerEditor);
-
- for (VpeNodeMapping nodeMapping : mappings) {
-
- /**
- * exclude out DomDocument ( it is added to mapping specially ) and
- * nodes without visual representation
- */
- if (!(nodeMapping.getSourceNode() instanceof IDOMDocument)
- && (nodeMapping.getVisualNode() != null)) {
-
- SelectionUtil.setSourceSelection(controller.getPageContext(),
- nodeMapping.getSourceNode(), 0, 0);
-
- TestUtil.delay(50);
-
- assertNotNull(xulRunnerEditor.getLastSelectedNode());
- assertEquals(nodeMapping.getVisualNode(), xulRunnerEditor
- .getLastSelectedNode());
- }
- }
-
// check exception
if (getException() != null) {
throw getException();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -414,6 +414,7 @@
boolean registerFlag = isCurrentMainDocument();
// reads and dispatch events
+ getPageContext().processDisplayEvents();
// JBIDE-675, checks if editor was disposed or not
if (getPageContext().getSourceBuilder() == null
|| includeDocuments == null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/TaglibReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/TaglibReferencesComposite.java 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/TaglibReferencesComposite.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -23,6 +23,7 @@
*/
public class TaglibReferencesComposite extends VpeResourceReferencesComposite {
+ @Override
protected String getEntity() {
return (file != null) ? "VPETLDReference" : "VPETLDReferenceExt"; //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-11-11 18:09:27 UTC (rev 11683)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-11-11 19:21:14 UTC (rev 11684)
@@ -13,24 +13,33 @@
package org.jboss.tools.vpe.ui.test;
+import java.util.Collection;
+import java.util.Map;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.custom.StyledText;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIDOMDocument;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
/**
@@ -76,7 +85,8 @@
*
* @see TestCase#setUp()
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
super.setUp();
Platform.addLogListener(this);
@@ -94,7 +104,8 @@
*
* @see TestCase#tearDown()
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
super.tearDown();
@@ -286,5 +297,55 @@
protected void setCheckWarning(boolean checkWarning) {
this.checkWarning = checkWarning;
}
+ /**
+ * Compares source nodes selection and visual selection
+ * @param VPE Editor part
+ */
+ protected void checkSourceSelection(JSPMultiPageEditor part) {
+ // get controller
+ VpeController controller = getVpeController(part);
+ assertNotNull(controller);
+ // get dommapping
+ VpeDomMapping domMapping = controller.getDomMapping();
+
+ assertNotNull(domMapping);
+
+ // get source map
+ Map<Node, VpeNodeMapping> sourceMap = domMapping.getSourceMap();
+ assertNotNull(sourceMap);
+
+ // get collection of VpeNodeMapping
+ Collection<VpeNodeMapping> mappings = sourceMap.values();
+ assertNotNull(mappings);
+
+ // get editor control
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+ assertNotNull(styledText);
+
+ // get xulrunner editor
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ assertNotNull(xulRunnerEditor);
+
+ for (VpeNodeMapping nodeMapping : mappings) {
+
+ /**
+ * exclude out DomDocument ( it is added to mapping specially ) and
+ * nodes without visual representation
+ */
+ if (!(nodeMapping.getSourceNode() instanceof IDOMDocument)
+ && (nodeMapping.getVisualNode() != null)) {
+
+ SelectionUtil.setSourceSelection(controller.getPageContext(),
+ nodeMapping.getSourceNode(), 0, 0);
+
+ TestUtil.delay(50);
+
+ assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertEquals(nodeMapping.getVisualNode(), xulRunnerEditor
+ .getLastSelectedNode());
+ }
+ }
+ }
}
17 years, 5 months
JBoss Tools SVN: r11683 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-11-11 13:09:27 -0500 (Tue, 11 Nov 2008)
New Revision: 11683
Modified:
trunk/seam/docs/reference/en/modules/creating_new_seam.xml
Log:
Project facet wizard - the end adjusted.
Modified: trunk/seam/docs/reference/en/modules/creating_new_seam.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-11-11 16:36:39 UTC (rev 11682)
+++ trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-11-11 18:09:27 UTC (rev 11683)
@@ -218,9 +218,9 @@
</figure>
<para><emphasis>
- <property>Next</property>
+ <property>Ok</property>
</emphasis> button will bring you to the <property>Web Module</property> wizard
- form.</para>
+ form again.</para>
</section>
<section id="configureWebModule">
17 years, 5 months
JBoss Tools SVN: r11682 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf: src/org/jboss/tools/jsf/vpe/jsf/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-11-11 11:36:39 -0500 (Tue, 11 Nov 2008)
New Revision: 11682
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2938, attributes were added, facet processing was added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-11-11 16:36:29 UTC (rev 11681)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-11-11 16:36:39 UTC (rev 11682)
@@ -18,4 +18,5 @@
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.jsf.vpe.jsf.template
Bundle-Localization: plugin
+Import-Package: org.jboss.tools.jst.web.tld
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java 2008-11-11 16:36:29 UTC (rev 11681)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java 2008-11-11 16:36:39 UTC (rev 11682)
@@ -10,11 +10,15 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
+import java.util.List;
+
+import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
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.XmlUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Node;
@@ -26,45 +30,53 @@
*/
public class JsfFacet extends VpeAbstractTemplate {
+ private static String JSF_CORE_URI = "http://java.sun.com/jsf/core"; //$NON-NLS-1$
+ private static String JSF_HTML_URI = "http://java.sun.com/jsf/html"; //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ VpeCreationData creationData = new VpeCreationData(div);
+ NodeList children = sourceNode.getChildNodes();
+ boolean jsfComponentFound = false;
/*
- * (non-Javadoc)
- *
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * Only one JSF component may be present inside a facet tag,
+ * if more are present only the first one is rendered and the
+ * other ones are ignored.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
-
- nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
-
- VpeCreationData creationData = new VpeCreationData(div);
-
- NodeList children = sourceNode.getChildNodes();
-
- /*
- * <f:facet .../> can contain only one element. so we find first visible
- * node and add to "div"
- */
-
- for (int i = 0; i < children.getLength(); i++) {
-
- Node child = children.item(i);
-
- // we add to "div" non-empty text node or tag
- if (((child.getNodeType() == Node.TEXT_NODE) && !(child
- .getNodeValue().trim().length() == 0))
- || child.getNodeType() == (Node.ELEMENT_NODE)) {
-
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
-
- childrenInfo.addSourceChild(children.item(i));
-
- creationData.addChildrenInfo(childrenInfo);
-
- break;
- }
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ String sourcePrefix = child.getPrefix();
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(sourceNode,pageContext);
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix, taglibs);
+ if (null != sourceNodeTaglib) {
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+ if ((child.getNodeType() == (Node.ELEMENT_NODE))
+ && (JSF_CORE_URI.equalsIgnoreCase(sourceNodeUri) || JSF_HTML_URI
+ .equalsIgnoreCase(sourceNodeUri))) {
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
+ childrenInfo.addSourceChild(children.item(i));
+ creationData.addChildrenInfo(childrenInfo);
+ jsfComponentFound = true;
+ break;
}
+ }
+
+ }
+
+ if (!jsfComponentFound) {
+ div.setAttribute(HTML.ATTR_STYLE, "display: none; "); //$NON-NLS-1$
+ creationData.addChildrenInfo(new VpeChildrenInfo(div));
+ }
- return creationData;
- }
+ return creationData;
+ }
}
17 years, 5 months
JBoss Tools SVN: r11681 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-11-11 11:36:29 -0500 (Tue, 11 Nov 2008)
New Revision: 11681
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2938, attributes were added, facet processing was added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-11-11 16:14:33 UTC (rev 11680)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-11-11 16:36:29 UTC (rev 11681)
@@ -145,6 +145,32 @@
public static Element getFacet(Element sourceElement, String facetName) {
return (Element) getFacet(sourceElement, facetName, false);
}
+
+ /**
+ * Gets the facet element.
+ *
+ * @param sourceElement the source element
+ * @param facetName the facet name
+ * @param returnTextNode the return text node
+ *
+ * @return the facet element
+ */
+ public static Element getFacetElement(Element sourceElement,
+ String facetName) {
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node instanceof Element && node.getNodeName() != null
+ && node.getNodeName().indexOf(":facet") > 0) { //$NON-NLS-1$
+ Element facetElement = (Element) node;
+ String name = facetElement.getAttribute("name"); //$NON-NLS-1$
+ if (facetName.equals(name)) {
+ return facetElement;
+ }
+ }
+ }
+ return null;
+ }
/**
* Returns true if "rendered" attribute of source element does not contain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-11-11 16:14:33 UTC (rev 11680)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-11-11 16:36:29 UTC (rev 11681)
@@ -14,7 +14,9 @@
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
@@ -22,6 +24,8 @@
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
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.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -44,27 +48,27 @@
/**
*
*/
- protected static final String CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE = "center";
+ protected static final String CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE = "center"; //$NON-NLS-1$
/**
*
*/
- private static final String CONTROLS_HORIZONTAL_POSITION_DEFAULT_VALUE = "right";
+ private static final String CONTROLS_HORIZONTAL_POSITION_DEFAULT_VALUE = "right"; //$NON-NLS-1$
/** The Constant APPLY_BUTTON_GIF. */
- protected static final String APPLY_BUTTON_GIF = "/applyButton.gif";
+ protected static final String APPLY_BUTTON_GIF = "/applyButton.gif"; //$NON-NLS-1$
/** The Constant CANCEL_BUTTON_GIF. */
- protected static final String CANCEL_BUTTON_GIF = "/cancelButton.gif";
+ protected static final String CANCEL_BUTTON_GIF = "/cancelButton.gif"; //$NON-NLS-1$
/** The Constant controlsVerticalPositions. */
protected final Map<String, String> controlsVerticalPositions = new HashMap<String, String>();
/** The Constant DEFAULT_INPUT_WIDTH_VALUE. */
- protected static final String DEFAULT_INPUT_WIDTH_VALUE = "66px";
+ protected static final String DEFAULT_INPUT_WIDTH_VALUE = "66px"; //$NON-NLS-1$
/** The Constant DEFAULT_NULL_VALUE. */
- protected static final String DEFAULT_NULL_VALUE = "null";
+ protected static final String DEFAULT_NULL_VALUE = " "; //$NON-NLS-1$
/** The Constant DEFAULT_VERTICAL_POSITION. */
protected static final String DEFAULT_VERTICAL_POSITION = null;
@@ -76,12 +80,12 @@
protected static final Map<String, String> defaultStyleClasses = new HashMap<String, String>();
/** The Constant RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS. */
- protected static final String RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS = "rich-inplace-view";
+ protected static final String RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS = "rich-inplace-view"; //$NON-NLS-1$
/** The Constant VPE_USER_TOGGLE_ID_ATTR. */
- public static final String VPE_USER_TOGGLE_ID_ATTR = "vpe-user-toggle-id";
+ public static final String VPE_USER_TOGGLE_ID_ATTR = "vpe-user-toggle-id"; //$NON-NLS-1$
- private static final String DEFAULT_LAYOUT = "inline";
+ private static final String DEFAULT_LAYOUT = "inline"; //$NON-NLS-1$
/** The button images. */
protected final Map<String, String> buttonImages = new HashMap<String, String>();
@@ -101,6 +105,12 @@
/** The edit class. */
protected String editClass;
+ /** The view class. */
+ protected String viewClass;
+
+ /** The control class. */
+ protected String controlClass;
+
/** The is show input. */
protected boolean isToggle = false;
@@ -111,13 +121,10 @@
protected String sourceValue;
/** The Constant SPACER_GIF. */
- protected final String SPACER_GIF = getCssExtension()+"/spacer.gif";
+ protected final String SPACER_GIF = getCssExtension()+"/spacer.gif"; //$NON-NLS-1$
/** The style class. */
protected String styleClass;
-
- /** The view class. */
- protected String viewClass;
protected String sourceCancelButtonIcon;
@@ -151,13 +158,13 @@
// if(!(this.showControls && this.isToggle)){
rootSpan.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(this.isToggle));
// }
- final String rootClass = MessageFormat.format(defaultStyleClasses.get("rootSpan"), getRootSpanClasses());
+ final String rootClass = MessageFormat.format(defaultStyleClasses.get("rootSpan"), getRootSpanClasses()); //$NON-NLS-1$
rootSpan.setAttribute(HTML.ATTR_CLASS, rootClass);
- String style = "";
+ String style = ""; //$NON-NLS-1$
if (this.isToggle) {
- style = "position: relative;";
+ style = "position: relative;"; //$NON-NLS-1$
}
- rootSpan.setAttribute(HTML.ATTR_STYLE, style + "; display:"+this.sourceLayout+"; ");
+ rootSpan.setAttribute(HTML.ATTR_STYLE, style + "; display:"+this.sourceLayout+"; "); //$NON-NLS-1$ //$NON-NLS-2$
return rootSpan;
}
@@ -197,7 +204,7 @@
* @return the value
*/
protected String getValue() {
- String rst = "";
+ String rst = ""; //$NON-NLS-1$
if (ComponentUtil.isNotBlank(this.defaultLabel)) {
rst = this.defaultLabel;
} else if (ComponentUtil.isBlank(this.defaultLabel) && ComponentUtil.isNotBlank(this.sourceValue)) {
@@ -213,8 +220,8 @@
*/
protected void initDefaultButtonImages() {
if (defaultButtonImages.isEmpty()) {
- defaultButtonImages.put("cancelControlIcon", getCssExtension() + CANCEL_BUTTON_GIF);
- defaultButtonImages.put("saveControlIcon", getCssExtension() + APPLY_BUTTON_GIF);
+ defaultButtonImages.put("cancelControlIcon", getCssExtension() + CANCEL_BUTTON_GIF); //$NON-NLS-1$
+ defaultButtonImages.put("saveControlIcon", getCssExtension() + APPLY_BUTTON_GIF); //$NON-NLS-1$
}
}
@@ -224,7 +231,7 @@
*/
protected void initDefaultStyleClasses() {
if (defaultStyleClasses.isEmpty()) {
- defaultStyleClasses.put("rootSpan", "rich-inplace" + getCssStylesSuffix() + " {0} {1}");
+ defaultStyleClasses.put("rootSpan", "rich-inplace" + getCssStylesSuffix() + " {0} {1} {2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
@@ -234,13 +241,13 @@
*/
protected void initPositions() {
if (controlsVerticalPositions.isEmpty()) {
- controlsVerticalPositions.put("bottom", "18px");
- controlsVerticalPositions.put("top", "-12px");
- controlsVerticalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "0px");
+ controlsVerticalPositions.put("bottom", "18px"); //$NON-NLS-1$ //$NON-NLS-2$
+ controlsVerticalPositions.put("top", "-12px"); //$NON-NLS-1$ //$NON-NLS-2$
+ controlsVerticalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "0px"); //$NON-NLS-1$
}
if (controlsHorizontalPositions.isEmpty()) {
- controlsHorizontalPositions.put("left", "0px");
- controlsHorizontalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "53px");
+ controlsHorizontalPositions.put("left", "0px"); //$NON-NLS-1$ //$NON-NLS-2$
+ controlsHorizontalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "53px"); //$NON-NLS-1$
}
}
@@ -292,15 +299,16 @@
*/
protected void prepareData(VpePageContext pageContext,Element source) {
this.styleClass = source.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- this.editClass = source.getAttribute("editClass");
- this.viewClass = source.getAttribute("viewClass");
+ this.editClass = source.getAttribute("editClass"); //$NON-NLS-1$
+ this.viewClass = source.getAttribute("viewClass"); //$NON-NLS-1$
+ this.controlClass = source.getAttribute("controlClass"); //$NON-NLS-1$
this.sourceValue = source.getAttribute(RichFaces.ATTR_VALUE);
- this.sourceLayout = ComponentUtil.getAttribute(source, "layout");
+ this.sourceLayout = ComponentUtil.getAttribute(source, "layout"); //$NON-NLS-1$
if(ComponentUtil.isBlank(this.sourceLayout) || (!this.sourceLayout.equalsIgnoreCase(DEFAULT_LAYOUT) &&
- !this.sourceLayout.equalsIgnoreCase("block")) ){
+ !this.sourceLayout.equalsIgnoreCase("block")) ){ //$NON-NLS-1$
this.sourceLayout = DEFAULT_LAYOUT;
}
- this.defaultLabel = source.getAttribute("defaultLabel");
+ this.defaultLabel = source.getAttribute("defaultLabel"); //$NON-NLS-1$
if (ComponentUtil.isBlank(this.sourceValue)) {
this.sourceValue = DEFAULT_NULL_VALUE;
}
@@ -314,12 +322,12 @@
// this.defaultLabel = ComponentUtil.getBundleValue(pageContext, source.getAttributeNode("defaultLabel"));
// }
- this.showControls = Boolean.parseBoolean(source.getAttribute("showControls"));
- this.controlsVerticalPosition = source.getAttribute("controlsVerticalPosition");
+ this.showControls = Boolean.parseBoolean(source.getAttribute("showControls")); //$NON-NLS-1$
+ this.controlsVerticalPosition = source.getAttribute("controlsVerticalPosition"); //$NON-NLS-1$
if (ComponentUtil.isBlank(this.controlsVerticalPosition) || !isInKeySet(controlsVerticalPositions, this.controlsVerticalPosition)) {
this.controlsVerticalPosition = CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE;
}
- this.controlsHorizontalPosition = source.getAttribute("controlsHorizontalPosition");
+ this.controlsHorizontalPosition = source.getAttribute("controlsHorizontalPosition"); //$NON-NLS-1$
if (ComponentUtil.isBlank(this.controlsHorizontalPosition)
|| !isInKeySet(controlsHorizontalPositions, this.controlsHorizontalPosition)) {
@@ -445,86 +453,130 @@
*
* @return the ns IDOM element
*/
- protected nsIDOMElement createControlsDiv(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- final nsIDOMElement element = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ protected nsIDOMElement createControlsDiv(VpePageContext pageContext,
+ Node sourceNode, nsIDOMDocument visualDocument,
+ VpeCreationData creationData) {
+ final nsIDOMElement element = visualDocument.createElement(HTML.TAG_DIV);
element.setAttribute(HTML.ATTR_CLASS, getMainControlsDivCssClass());
- element.setAttribute(HTML.ATTR_STYLE, "position: absolute; "+getControlPositionsSubStyles());
+ element.setAttribute(HTML.ATTR_STYLE, "position: absolute; "+getControlPositionsSubStyles()); //$NON-NLS-1$
- final nsIDOMElement divShadov = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement divShadov = visualDocument.createElement(HTML.TAG_DIV);
- divShadov.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow");
- final nsIDOMElement divShadovTable = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- divShadovTable.setAttribute(HTML.ATTR_CELLPADDING, "0");
- divShadovTable.setAttribute(HTML.ATTR_CELLSPACING, "0");
- divShadovTable.setAttribute(HTML.ATTR_BORDER, "0");
- final nsIDOMElement divShadovTBody = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- final nsIDOMElement divShadovTr1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- final nsIDOMElement divShadovTr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- final nsIDOMElement divShadovTd1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- final nsIDOMElement divShadovTd2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- final nsIDOMElement divShadovTd1Tr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- final nsIDOMElement divShadovTd2Tr2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ divShadov.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow"); //$NON-NLS-1$ //$NON-NLS-2$
+ final nsIDOMElement divShadovTable = visualDocument.createElement(HTML.TAG_TABLE);
+ divShadovTable.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ divShadovTable.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ divShadovTable.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ final nsIDOMElement divShadovTBody = visualDocument.createElement(HTML.TAG_TBODY);
+ final nsIDOMElement divShadovTr1 = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement divShadovTr2 = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement divShadovTd1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement divShadovTd2 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement divShadovTd1Tr2 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement divShadovTd2Tr2 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement td1Img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- final nsIDOMElement td2Img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- final nsIDOMElement td3Img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- final nsIDOMElement td4Img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement td1Img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement td2Img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement td3Img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement td4Img = visualDocument.createElement(HTML.TAG_IMG);
setUpImg(td1Img, 10, 1, 0, SPACER_GIF);
setUpImg(td2Img, 1, 10, 0, SPACER_GIF);
setUpImg(td3Img, 1, 10, 0, SPACER_GIF);
setUpImg(td4Img, 10, 1, 0, SPACER_GIF);
- divShadovTd1.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-tl");
- divShadovTd2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-tr");
+ divShadovTd1.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-tl"); //$NON-NLS-1$ //$NON-NLS-2$
+ divShadovTd2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-tr"); //$NON-NLS-1$ //$NON-NLS-2$
- divShadovTd1Tr2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-bl");
- divShadovTd2Tr2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-br");
+ divShadovTd1Tr2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-bl"); //$NON-NLS-1$ //$NON-NLS-2$
+ divShadovTd2Tr2.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow-br"); //$NON-NLS-1$ //$NON-NLS-2$
- final nsIDOMElement divButtons = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- divButtons.setAttribute(HTML.ATTR_STYLE, "position: relative; height: 18px;");
- final nsIDOMElement applyButtonImg = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ final nsIDOMElement divButtons = visualDocument.createElement(HTML.TAG_DIV);
+ divButtons.setAttribute(HTML.ATTR_STYLE, "position: relative; height: 18px;"); //$NON-NLS-1$
- applyButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
- applyButtonImg.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-control");
- final String saveControlIconImg = buttonImages.get("saveControlIcon");
- if(defaultButtonImages.containsValue(saveControlIconImg)){
- ComponentUtil.setImg(applyButtonImg, saveControlIconImg);
- }else{
- ComponentUtil.setImgFromResources(pageContext, applyButtonImg, saveControlIconImg,"");
- }
- applyButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ /*
+ * Encoding controls facet
+ */
+ Element facetElement = ComponentUtil.getFacetElement((Element) sourceNode, "controls");
+ if (null != facetElement) {
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(divButtons);
+ childrenInfo.addSourceChild(facetElement);
+ creationData.addChildrenInfo(childrenInfo);
+ } else {
+ /*
+ * Create "Apply" button
+ */
+ final nsIDOMElement applyButtonImg = visualDocument
+ .createElement(HTML.TAG_INPUT);
+ applyButtonImg.setAttribute(HTML.ATTR_TYPE, "image"); //$NON-NLS-1$
- final nsIDOMElement cancelButtonImg = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ String applyButtonClass = "rich-inplace" + getCssStylesSuffix() + "-control"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (ComponentUtil.isNotBlank(controlClass)) {
+ applyButtonClass += " " + controlClass; //$NON-NLS-1$
+ }
+ applyButtonImg.setAttribute(HTML.ATTR_CLASS, applyButtonClass);
- cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
- cancelButtonImg.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-control");
- cancelButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- final String cancelControlIconImg = buttonImages.get("cancelControlIcon");
+ final String saveControlIconImg = buttonImages
+ .get("saveControlIcon"); //$NON-NLS-1$
+ if (defaultButtonImages.containsValue(saveControlIconImg)) {
+ ComponentUtil.setImg(applyButtonImg, saveControlIconImg);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, applyButtonImg,
+ saveControlIconImg, ""); //$NON-NLS-1$
+ }
+ applyButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String
+ .valueOf(0));
- if(defaultButtonImages.containsValue(cancelControlIconImg)){
- ComponentUtil.setImg(cancelButtonImg,cancelControlIconImg);
- }else{
- ComponentUtil.setImgFromResources(pageContext, cancelButtonImg, cancelControlIconImg, "");
- }
- cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
+ /*
+ * Create "Cancel" button
+ */
+ final nsIDOMElement cancelButtonImg = visualDocument
+ .createElement(HTML.TAG_INPUT);
+ cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image"); //$NON-NLS-1$
- element.appendChild(divShadov);
+ String cancelButtonClass = "rich-inplace" + getCssStylesSuffix() + "-control"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (ComponentUtil.isNotBlank(controlClass)) {
+ cancelButtonClass += " " + controlClass; //$NON-NLS-1$
+ }
+ cancelButtonImg.setAttribute(HTML.ATTR_CLASS, cancelButtonClass);
+
+ final String cancelControlIconImg = buttonImages
+ .get("cancelControlIcon"); //$NON-NLS-1$
+ if (defaultButtonImages.containsValue(cancelControlIconImg)) {
+ ComponentUtil.setImg(cancelButtonImg, cancelControlIconImg);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, cancelButtonImg,
+ cancelControlIconImg, ""); //$NON-NLS-1$
+ }
+ cancelButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String
+ .valueOf(0));
+
+ divButtons.appendChild(applyButtonImg);
+ divButtons.appendChild(cancelButtonImg);
+
+ /*
+ * Adding shadow to controls
+ */
+ element.appendChild(divShadov);
+ divShadov.appendChild(divShadovTable);
+ divShadovTable.appendChild(divShadovTBody);
+ divShadovTBody.appendChild(divShadovTr1);
+ divShadovTr1.appendChild(divShadovTd1);
+ divShadovTd1.appendChild(td1Img);
+ divShadovTr1.appendChild(divShadovTd2);
+ divShadovTd2.appendChild(td2Img);
+
+ divShadovTBody.appendChild(divShadovTr2);
+ divShadovTr2.appendChild(divShadovTd1Tr2);
+ divShadovTd1Tr2.appendChild(td3Img);
+ divShadovTr2.appendChild(divShadovTd2Tr2);
+ divShadovTd2Tr2.appendChild(td4Img);
+ }
+
+ /*
+ * Adding controls
+ */
element.appendChild(divButtons);
- divButtons.appendChild(applyButtonImg);
- divButtons.appendChild(cancelButtonImg);
- divShadov.appendChild(divShadovTable);
- divShadovTable.appendChild(divShadovTBody);
- divShadovTBody.appendChild(divShadovTr1);
- divShadovTr1.appendChild(divShadovTd1);
- divShadovTd1.appendChild(td1Img);
- divShadovTr1.appendChild(divShadovTd2);
- divShadovTd2.appendChild(td2Img);
-
- divShadovTBody.appendChild(divShadovTr2);
- divShadovTr2.appendChild(divShadovTd1Tr2);
- divShadovTd1Tr2.appendChild(td3Img);
- divShadovTr2.appendChild(divShadovTd2Tr2);
- divShadovTd2Tr2.appendChild(td4Img);
+
return element;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-11-11 16:14:33 UTC (rev 11680)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-11-11 16:36:29 UTC (rev 11681)
@@ -14,8 +14,8 @@
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
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;
@@ -58,25 +58,31 @@
final Element source = (Element) sourceNode;
prepareData(pageContext,source);
final nsIDOMElement rootSpan = createRootSpanTemplateMethod(source, visualDocument);
- final nsIDOMElement innerInput1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ final nsIDOMElement innerInput1 = visualDocument.createElement(HTML.TAG_INPUT);
+ data = new VpeCreationData(rootSpan);
- String clazz = "";
+ String clazz = ""; //$NON-NLS-1$
if (this.isToggle) {
rootSpan.appendChild(innerInput1);
innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-field");
- innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 0px; width: " + this.inputWidth + ";");
- innerInput1.setAttribute(HTML.ATTR_TYPE, "text");
- innerInput1.setAttribute("autocomplete", "off");
+ innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-field"); //$NON-NLS-1$
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 0px; width: " + this.inputWidth + ";"); //$NON-NLS-1$ //$NON-NLS-2$
+ innerInput1.setAttribute(HTML.ATTR_TYPE, "text"); //$NON-NLS-1$
+ innerInput1.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
if (showControls) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument));
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data));
}
} else {
- innerInput1.setAttribute(HTML.ATTR_STYLE, "width: " + this.inputWidth + "; position: absolute; left: -32767px;");
- innerInput1.setAttribute(HTML.ATTR_TYPE, "button");
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "width: " + this.inputWidth + "; position: absolute; left: -32767px;"); //$NON-NLS-1$ //$NON-NLS-2$
+ innerInput1.setAttribute(HTML.ATTR_TYPE, "button"); //$NON-NLS-1$
+
+ /*
+ * Add empty children info to avoid children processing.
+ * Only available child is "controls" facet
+ */
+ data.addChildrenInfo(new VpeChildrenInfo(rootSpan));
}
- data = new VpeCreationData(rootSpan);
if (!isToggle) {
@@ -110,7 +116,7 @@
* @return the css extension
*/
protected String getCssExtension() {
- return "inplaceInput";
+ return "inplaceInput"; //$NON-NLS-1$
}
/**
@@ -119,7 +125,7 @@
* @return the css style
*/
protected String getCssStyle() {
- return "inplaceInput/inplaceInput.css";
+ return "inplaceInput/inplaceInput.css"; //$NON-NLS-1$
}
/**
@@ -132,7 +138,7 @@
*/
@Override
protected String getCssStylesSuffix() {
- return "";
+ return ""; //$NON-NLS-1$
}
/**
@@ -141,22 +147,24 @@
* @return the root span classes
*/
protected Object[] getRootSpanClasses() {
- String[] rst = new String[2];
- String clazz = "";
+ String[] rst = new String[3];
+ String clazz = ""; //$NON-NLS-1$
if (this.isToggle) {
- rst[0] = "rich-inplace-edit";
+ rst[0] = "rich-inplace-edit"; //$NON-NLS-1$
if (ComponentUtil.isNotBlank(this.editClass)) {
clazz = this.editClass;
}
} else {
- rst[0] = "rich-inplace-view";
- if (ComponentUtil.isNotBlank(this.styleClass)) {
- clazz = this.styleClass;
+ rst[0] = "rich-inplace-view"; //$NON-NLS-1$
+ if (ComponentUtil.isNotBlank(this.viewClass)) {
+ clazz = this.viewClass;
}
-
}
rst[1] = clazz;
+ if (ComponentUtil.isNotBlank(this.styleClass)) {
+ rst[2] = this.styleClass;
+ }
return rst;
}
@@ -167,12 +175,12 @@
*/
protected void prepareData(VpePageContext pageContext,Element source) {
try {
- this.inputWidth = String.valueOf(ComponentUtil.parseWidthHeightValue(source.getAttribute("inputWidth")));
+ this.inputWidth = String.valueOf(ComponentUtil.parseWidthHeightValue(source.getAttribute("inputWidth"))); //$NON-NLS-1$
} catch (NumberFormatException e) {
this.inputWidth = DEFAULT_INPUT_WIDTH_VALUE;
}
- this.controlsHorizontalPositions.put("right", this.inputWidth);
- this.controlsHorizontalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "18px");
+ this.controlsHorizontalPositions.put("right", this.inputWidth); //$NON-NLS-1$
+ this.controlsHorizontalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE, "18px"); //$NON-NLS-1$
super.prepareData(pageContext,source);
}
@@ -182,18 +190,18 @@
*/
@Override
public String getCssStylesControlSuffix() {
- return "-input";
+ return "-input"; //$NON-NLS-1$
}
@Override
protected String getControlPositionsSubStyles() {
- return "top: " + controlsVerticalPositions.get(this.controlsVerticalPosition)
- + ";left:" + " " + controlsHorizontalPositions.get(this.controlsHorizontalPosition) + ";";
+ return "top: " + controlsVerticalPositions.get(this.controlsVerticalPosition) //$NON-NLS-1$
+ + ";left:" + " " + controlsHorizontalPositions.get(this.controlsHorizontalPosition) + ";"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@Override
protected String getMainControlsDivCssClass() {
- return "rich-inplace"+getCssStylesControlSuffix()+"-controls-set";
+ return "rich-inplace"+getCssStylesControlSuffix()+"-controls-set"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-11-11 16:14:33 UTC (rev 11680)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-11-11 16:36:29 UTC (rev 11681)
@@ -68,6 +68,7 @@
final Element source = (Element) sourceNode;
prepareData(pageContext,source);
final nsIDOMElement rootSpan = createRootSpanTemplateMethod(source, visualDocument);
+ data = new VpeCreationData(rootSpan);
if (isToggle) {
final nsIDOMElement innerInput1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
@@ -93,13 +94,12 @@
rootSpan.appendChild(selectList);
}
if (this.showControls) {
- rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument));
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode, visualDocument, data));
}
} else {
rootSpan.appendChild(visualDocument.createTextNode(getValue()));
}
- data = new VpeCreationData(rootSpan);
// DOMTreeDumper d = new DOMTreeDumper();
// d.dumpToStream(System.err, rootSpan);
return data;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-11-11 16:14:33 UTC (rev 11680)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-11-11 16:36:29 UTC (rev 11681)
@@ -88,7 +88,7 @@
</vpe:template>
</vpe:tag>
<vpe:tag name="rich:inplaceInput" case-sensitive="yes">
- <vpe:template children="no" modify="no"
+ <vpe:template children="yes" modify="no"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesInplaceInputTemplate">
<vpe:dnd>
<vpe:drag start-enable="yes" />
17 years, 5 months