JBoss Tools SVN: r23498 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 09:41:48 -0400 (Fri, 16 Jul 2010)
New Revision: 23498
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
Log:
https://jira.jboss.org/browse/JBIDE-6555
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2010-07-16 13:38:46 UTC (rev 23497)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2010-07-16 13:41:48 UTC (rev 23498)
@@ -100,9 +100,13 @@
}
valueStart++;
}
+ try {
String key = loadConvert(lr.lineBuf, 0, keyLen, convtBuf);
String value = loadConvert(lr.lineBuf, valueStart, limit - valueStart, convtBuf);
put(key, value);
+ } catch (IllegalArgumentException e) {
+ //TODO create object for error marker
+ }
}
}
@@ -272,6 +276,7 @@
value = (value << 4) + 10 + aChar - 'A';
break;
default:
+ //TODO create object for error marker
throw new IllegalArgumentException(
"Malformed \\uxxxx encoding."); //$NON-NLS-1$
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-07-16 13:38:46 UTC (rev 23497)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-07-16 13:41:48 UTC (rev 23498)
@@ -269,6 +269,8 @@
p.load(sr);
} catch (IOException e) {
//ignore
+ } catch (IllegalArgumentException e1) {
+ return null;
}
return p.getProperty("a");
}
15 years, 9 months
JBoss Tools SVN: r23497 - trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 09:38:46 -0400 (Fri, 16 Jul 2010)
New Revision: 23497
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6555
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java 2010-07-16 13:37:29 UTC (rev 23496)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java 2010-07-16 13:38:46 UTC (rev 23497)
@@ -45,10 +45,6 @@
assertNotNull(a);
assertEquals(a.getAttributeValue("value"), "valueA");
XModelObject b = p.getChildByPath("b");
- System.out.println(b);
- if(b != null) {
- System.out.println(b.getAttributeValue("value"));
- }
assertNull(b);
XModelObject c = p.getChildByPath("c");
assertNotNull(c);
15 years, 9 months
JBoss Tools SVN: r23496 - in trunk/common/tests/org.jboss.tools.common.model.test: src/org/jboss/tools/common/model/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 09:37:29 -0400 (Fri, 16 Jul 2010)
New Revision: 23496
Added:
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/src/x.properties
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
Log:
https://jira.jboss.org/browse/JBIDE-6555
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/src/x.properties
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/src/x.properties (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/src/x.properties 2010-07-16 13:37:29 UTC (rev 23496)
@@ -0,0 +1,3 @@
+a=valueA
+b=\u301\u5656
+c=valueC
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/src/x.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2010-07-16 12:57:08 UTC (rev 23495)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2010-07-16 13:37:29 UTC (rev 23496)
@@ -30,6 +30,7 @@
suite.addTestSuite(AntParserTest.class);
suite.addTestSuite(DeveloperExceptionTest.class);
suite.addTestSuite(XModelTransferBufferTest.class);
+ suite.addTestSuite(PropertiesLoaderTest.class);
return suite;
}
}
Added: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java 2010-07-16 13:37:29 UTC (rev 23496)
@@ -0,0 +1,58 @@
+package org.jboss.tools.common.model.test;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class PropertiesLoaderTest extends TestCase {
+ static String BUNDLE_NAME = "org.jboss.tools.common.model.test";
+ TestProjectProvider provider = null;
+ IProject project = null;
+
+ public PropertiesLoaderTest() {}
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider(BUNDLE_NAME, null, "Test1", true);
+ project = provider.getProject();
+
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ JobUtils.waitForIdle();
+ }
+
+ public void testMalformedPropertiesFile() throws CoreException, IOException {
+ IFile f = project.getFile(new Path("src/x.properties"));
+ assertNotNull(f);
+ XModelObject p = EclipseResourceUtil.createObjectForResource(f);
+ assertNotNull(p);
+ XModelObject a = p.getChildByPath("a");
+ assertNotNull(a);
+ assertEquals(a.getAttributeValue("value"), "valueA");
+ XModelObject b = p.getChildByPath("b");
+ System.out.println(b);
+ if(b != null) {
+ System.out.println(b.getAttributeValue("value"));
+ }
+ assertNull(b);
+ XModelObject c = p.getChildByPath("c");
+ assertNotNull(c);
+ assertEquals(c.getAttributeValue("value"), "valueC");
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/PropertiesLoaderTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23495 - in trunk/cdi/tests: org.jboss.tools.cdi.bot.test and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: jlukas(a)redhat.com
Date: 2010-07-16 08:57:08 -0400 (Fri, 16 Jul 2010)
New Revision: 23495
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.project
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/META-INF/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/Activator.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/Action.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewCDIFileWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewFileWizardAction.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardType.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/DynamicWebProjectWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
Log:
adding basic bot tests for cdi wizards
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.classpath (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.classpath 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.project (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.project 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.cdi.bot.test</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/cdi/tests/org.jboss.tools.cdi.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/.settings/org.eclipse.jdt.core.prefs 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,8 @@
+#Wed Jul 14 12:01:07 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/META-INF/MANIFEST.MF 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CDI SWTBot Test
+Bundle-SymbolicName: org.jboss.tools.cdi.bot.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.cdi.bot.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.8.1",
+ org.apache.log4j;bundle-version="1.2.15",
+ org.eclipse.ui;bundle-version="3.6.0",
+ org.jboss.tools.ui.bot.ext;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/build.properties (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/build.properties 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,16 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.cdi.tests</groupId>
+ <artifactId>org.jboss.tools.cdi.bot.test</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+</project>
+
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/Activator.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/Activator.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/Activator.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/Action.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/Action.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/Action.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.actions;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+
+public abstract class Action<T> {
+
+ private final SWTBotExt bot = new SWTBotExt();
+ private final String[] path;
+
+ public Action(String... path) {
+ this.path = path;
+ }
+
+ public abstract T run();
+
+ protected SWTBot performMenu() {
+ assert path.length > 0;
+ SWTBotMenu m = bot.menu(path[0]);
+ for (int i = 1; i < path.length; i++) {
+ m = m.menu(path[i]);
+ }
+ m.click();
+ return new SWTBot();
+ }
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewCDIFileWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewCDIFileWizard.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewCDIFileWizard.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.actions;
+
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizard;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.Wizard;
+
+public class NewCDIFileWizard extends NewFileWizardAction {
+
+ private final CDIWizardType type;
+
+ public NewCDIFileWizard(CDIWizardType type) {
+ super();
+ this.type = type;
+ }
+
+ @Override
+ public CDIWizard run() {
+ Wizard w = super.run();
+ w.selectTemplate("CDI", type.getAnnotationType());
+ w.next();
+ return new CDIWizard(type);
+ }
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewFileWizardAction.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewFileWizardAction.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/NewFileWizardAction.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.actions;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.Wizard;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+public class NewFileWizardAction extends Action<Wizard> {
+
+ public NewFileWizardAction() {
+ super(IDELabel.Menu.FILE, IDELabel.Menu.NEW, IDELabel.Menu.OTHER);
+ }
+
+ @Override
+ public Wizard run() {
+ SWTBot b = performMenu();
+ return new Wizard(b.activeShell().widget);
+ }
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.wizards;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
+
+public class CDIWizard extends Wizard {
+
+ private final CDIWizardType type;
+
+ public CDIWizard(CDIWizardType type) {
+ super(new SWTBot().activeShell().widget);
+ assert ("New " + type).equals(getText());
+ this.type = type;
+ }
+
+ public CDIWizard setName(String name) {
+ setText("Name:", name);
+ return this;
+ }
+
+ public CDIWizard setPackage(String pkg) {
+ setText("Package:", pkg);
+ return this;
+ }
+
+ public CDIWizard setInherited(boolean set) {
+ setCheckbox("Add @Inherited", set);
+ return this;
+ }
+
+ public boolean isInherited() {
+ return isCheckboxSet("Add @Inherited");
+ }
+
+ public CDIWizard setGenerateComments(boolean set) {
+ setCheckbox("Generate comments", set);
+ return this;
+ }
+
+ public boolean isGenerateComments() {
+ return isCheckboxSet("Generate comments");
+ }
+
+ public CDIWizard setNormalScope(boolean set) {
+ switch (type) {
+ case SCOPE:
+ setCheckbox("is normal scope", set);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public boolean isNormalScope() {
+ switch (type) {
+ case SCOPE:
+ return isCheckboxSet("is normal scope");
+ default:
+ return true;
+ }
+ }
+
+ public CDIWizard setPassivating(boolean set) {
+ switch (type) {
+ case SCOPE:
+ setCheckbox("is passivating", set);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public boolean isPassivating() {
+ switch (type) {
+ case SCOPE:
+ return isCheckboxSet("is passivating");
+ default:
+ return false;
+ }
+ }
+
+ public CDIWizard setAlternative(boolean set) {
+ switch (type) {
+ case STEREOTYPE:
+ setCheckbox("Add @Alternative", set);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public boolean isAlternative() {
+ switch (type) {
+ case STEREOTYPE:
+ return isCheckboxSet("Add @Alternative");
+ default:
+ return false;
+ }
+ }
+
+ public CDIWizard setNamed(boolean set) {
+ switch (type) {
+ case STEREOTYPE:
+ setCheckbox("Add @Named", set);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public boolean isNamed() {
+ switch (type) {
+ case STEREOTYPE:
+ return isCheckboxSet("Add @Named");
+ default:
+ return false;
+ }
+ }
+
+ public CDIWizard setTarget(String target) {
+ switch (type) {
+ case STEREOTYPE:
+ case INTERCEPTOR_BINDING:
+ setCombo("Target:", target);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public List<String> getTargets() {
+ return Arrays.asList(bot().comboBoxWithLabel("Target:").items());
+ }
+
+ public CDIWizard setScope(String scope) {
+ switch (type) {
+ case STEREOTYPE:
+ setCombo("Scope:", scope);
+ break;
+ default:
+ throw new UnsupportedOperationException();
+ }
+ return this;
+ }
+
+ public List<String> getScopes() {
+ return Arrays.asList(bot().comboBoxWithLabel("Scope:").items());
+ }
+
+ private void setCheckbox(String label, boolean set) {
+ SWTBotCheckBox c = bot().checkBox(label);
+ if (c.isChecked() != set) {
+ if (set) {
+ c.select();
+ } else {
+ c.deselect();
+ }
+ }
+ }
+
+ private boolean isCheckboxSet(String label) {
+ SWTBotCheckBox c = bot().checkBox(label);
+ return c.isChecked();
+ }
+
+ private void setCombo(String label, String value) {
+ SWTBotCombo c = bot().comboBoxWithLabel(label);
+ c.setSelection(value);
+ }
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardType.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardType.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardType.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.wizards;
+
+public enum CDIWizardType {
+ INTERCEPTOR_BINDING, QUALIFIER, SCOPE, STEREOTYPE;
+
+ String getName() {
+ switch (this) {
+ case INTERCEPTOR_BINDING:
+ return "Interceptor Binding";
+ case QUALIFIER:
+ return "Qualifier";
+ case SCOPE:
+ return "Scope";
+ case STEREOTYPE:
+ return "Stereotype";
+ default:
+ throw new AssertionError("Unknown type");
+ }
+ }
+
+ public String getAnnotationType() {
+ return getName() + " Annotation Type";
+ }
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/DynamicWebProjectWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/DynamicWebProjectWizard.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/DynamicWebProjectWizard.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.wizards;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+public class DynamicWebProjectWizard extends Wizard {
+
+ public DynamicWebProjectWizard() {
+ super(new SWTBot().activeShell().widget);
+ assert "New Dynamic Web Project".equals(getText());
+ }
+
+ public DynamicWebProjectWizard setProjectName(String name) {
+ setText("Project name:", name);
+ return this;
+ }
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.uiutils.wizards;
+
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+
+public class Wizard extends SWTBotShell {
+
+ public Wizard(Shell shell) {
+ super(shell);
+ assert getText().contains("New ");
+ }
+
+ public Wizard selectTemplate(String... item) {
+ assert item.length > 0;
+ SWTBotTree tree = bot().tree();
+ SWTBotTreeItem ti = null;
+ for (int i = 0; i < item.length - 1; i++) {
+ ti = ti != null ? ti.expandNode(item[i]).select() : tree.expandNode(item[i]).select();
+ }
+ if (ti != null) {
+ ti.select(item[item.length - 1]);
+ } else {
+ tree.select(item[item.length - 1]);
+ }
+ return this;
+ }
+
+ public Wizard back() {
+ clickButton("< Back");
+ return this;
+ }
+
+ public Wizard next() {
+ clickButton("Next >");
+ return this;
+ }
+
+ public void cancel() {
+ clickButton("Cancel");
+ }
+
+ public void finish() {
+ clickButton("Finish");
+ }
+
+ protected void clickButton(String text) {
+ bot().button(text).click();
+ }
+
+ protected void setText(String label, String text) {
+ SWTBotText t = bot().textWithLabel(label);
+ t.setText(text);
+ }
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2010-07-16 12:57:08 UTC (rev 23495)
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.wizard;
+
+import java.util.logging.Logger;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.NewCDIFileWizard;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.NewFileWizardAction;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizard;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.DynamicWebProjectWizard;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+@SWTBotTestRequires(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = "<="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ CdiATWizardTest.class })
+public class CdiATWizardTest extends SWTTestExt {
+
+ private static final String PROJECT_NAME = "CDIProject";
+ private static final Logger L = Logger.getLogger(CdiATWizardTest.class
+ .getName());
+
+ @After
+ public void waitForJobs() {
+ util.waitForNonIgnoredJobs();
+ }
+
+ @Test
+ public void createProject() {
+ new NewFileWizardAction().run()
+ .selectTemplate("Web", "Dynamic Web Project").next();
+ new DynamicWebProjectWizard().setProjectName(PROJECT_NAME).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBot v = eclipse.showView(ViewType.PROJECT_EXPLORER);
+ SWTBotTree tree = v.tree();
+ tree.setFocus();
+ assertTrue("Project " + PROJECT_NAME + " was not created properly.",
+ SWTEclipseExt.treeContainsItemWithLabel(tree, PROJECT_NAME));
+ SWTBotTreeItem t = tree.getTreeItem(PROJECT_NAME);
+ t.expand();
+
+ // Configure Add CDI Support...
+ nodeContextMenu(tree, t, "Configure", "Add CDI support...").click();
+ bot.activeShell().bot().button("OK").click();
+ util.waitForNonIgnoredJobs();
+ }
+
+ @Test
+ public void testQualifier() {
+ qualifier("cdi", "Q1", false, false).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("Q1.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@Qualifier"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, PARAMETER, FIELD })"));
+ assertFalse(code.contains("@Inherited"));
+ assertFalse(code.startsWith("/**"));
+
+ qualifier("cdi", "Q2", true, true).finish();
+ util.waitForNonIgnoredJobs();
+ ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("Q2.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@Qualifier"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, PARAMETER, FIELD })"));
+ assertTrue(code.contains("@Inherited"));
+ assertTrue(code.startsWith("/**"));
+ }
+
+ @Test
+ public void testScope() {
+ scope("cdi", "Scope1", true, false, true, false).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("Scope1.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@NormalScope"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, FIELD })"));
+ assertTrue(code.contains("@Inherited"));
+ assertFalse(code.startsWith("/**"));
+
+ scope("cdi", "Scope2", false, true, true, false).finish();
+ util.waitForNonIgnoredJobs();
+ ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("Scope2.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@NormalScope"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, FIELD })"));
+ assertFalse(code.contains("@Inherited"));
+ assertTrue(code.startsWith("/**"));
+
+ scope("cdi", "Scope3", false, true, false, false).finish();
+ util.waitForNonIgnoredJobs();
+ ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("Scope3.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@Scope"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, FIELD })"));
+ assertFalse(code.contains("@Inherited"));
+ assertTrue(code.startsWith("/**"));
+ }
+
+ @Test
+ public void testIBinding() {
+ CDIWizard w = binding("cdi", "B1", null, true, false);
+ assertEquals(2, w.getTargets().size());
+ w.finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("B1.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@InterceptorBinding"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD })"));
+ assertTrue(code.contains("@Inherited"));
+ assertFalse(code.startsWith("/**"));
+
+ binding("cdi", "B2", "TYPE", false, true).finish();
+ util.waitForNonIgnoredJobs();
+ ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("B2.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@InterceptorBinding"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE })"));
+ assertFalse(code.contains("@Inherited"));
+ assertTrue(code.startsWith("/**"));
+ }
+
+ @Test
+ public void testStereotype() {
+ CDIWizard w = stereotype("cdi", "S1", null, null, false, false, false,
+ false);
+ assertEquals(9, w.getScopes().size());
+ assertEquals(5, w.getTargets().size());
+ w.finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("S1.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@Stereotype"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ TYPE, METHOD, FIELD })"));
+ assertFalse(code.contains("@Inherited"));
+ assertFalse(code.startsWith("/**"));
+
+ stereotype("cdi", "S2", "@Scope3", "FIELD", true, true, true, true)
+ .finish();
+ util.waitForNonIgnoredJobs();
+ ed = new SWTWorkbenchBot().activeEditor();
+ assertTrue(("S2.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ L.fine(code);
+ assertTrue(code.contains("@Stereotype"));
+ assertTrue(code.contains("@Retention(RUNTIME)"));
+ assertTrue(code.contains("@Target({ FIELD })"));
+ assertTrue(code.contains("@Inherited"));
+ assertTrue(code.startsWith("/**"));
+ }
+
+ private static SWTBotMenu nodeContextMenu(final SWTBotTree tree,
+ SWTBotTreeItem item, final String... menu) {
+ assert menu.length > 0;
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ return UIThreadRunnable.syncExec(new Result<SWTBotMenu>() {
+
+ public SWTBotMenu run() {
+ SWTBotMenu m = new SWTBotMenu(ContextMenuHelper.getContextMenu(
+ tree, menu[0], false));
+ for (int i = 1; i < menu.length; i++) {
+ m = m.menu(menu[i]);
+ }
+ return m;
+ }
+ });
+ }
+
+ private CDIWizard qualifier(String pkg, String name, boolean inherited,
+ boolean comments) {
+ return create(CDIWizardType.QUALIFIER, pkg, name, inherited, comments);
+ }
+
+ private CDIWizard scope(String pkg, String name, boolean inherited,
+ boolean comments, boolean normalScope, boolean passivating) {
+ CDIWizard w = create(CDIWizardType.SCOPE, pkg, name, inherited,
+ comments);
+ w = w.setNormalScope(normalScope);
+ return normalScope ? w.setPassivating(passivating) : w;
+ }
+
+ private CDIWizard binding(String pkg, String name, String target,
+ boolean inherited, boolean comments) {
+ CDIWizard w = create(CDIWizardType.INTERCEPTOR_BINDING, pkg, name,
+ inherited, comments);
+ return target != null ? w.setTarget(target) : w;
+ }
+
+ private CDIWizard stereotype(String pkg, String name, String scope,
+ String target, boolean inherited, boolean named,
+ boolean alternative, boolean comments) {
+ CDIWizard w = create(CDIWizardType.STEREOTYPE, pkg, name, inherited,
+ comments).setAlternative(alternative).setNamed(named);
+ if (scope != null) {
+ w = w.setScope(scope);
+ }
+ return target != null ? w.setTarget(target) : w;
+ }
+
+ private CDIWizard create(CDIWizardType type, String pkg, String name,
+ boolean inherited, boolean comments) {
+ CDIWizard p = new NewCDIFileWizard(type).run();
+ return p.setPackage(pkg).setName(name).setInherited(inherited)
+ .setGenerateComments(comments);
+ }
+
+}
15 years, 9 months
JBoss Tools SVN: r23494 - in trunk/esb/tests/org.jboss.tools.esb.core.test: src/org/jboss/tools/esb/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 06:31:27 -0400 (Fri, 16 Jul 2010)
New Revision: 23494
Added:
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-bpel.xml
Modified:
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6609
Added: trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-bpel.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-bpel.xml (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-bpel.xml 2010-07-16 10:31:27 UTC (rev 23494)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..."
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml... http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schem...">
+ <services>
+ <service category="c" description="d" name="s">
+ <actions>
+ <action class="org.jboss.soa.esb.actions.bpel.BPELInvoke" name="action2">
+ <property name="service" value="{http://www.jboss.org/bpel/examples/wsdl}HelloService"/>
+ <property name="operation" value="hello"/>
+ <property name="port" value="HelloPort"/>
+ <property name="requestPartName" value="TestPart"/>
+ <property name="responsePartName" value="TestPart"/>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Property changes on: trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-bpel.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-07-16 10:30:41 UTC (rev 23493)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-07-16 10:31:27 UTC (rev 23494)
@@ -315,6 +315,26 @@
}
+ public void testRiftsawBPELExample() {
+ XModelObject object = getFileObject("esb-1.2", "jboss-esb-bpel.xml", ESBConstants.ENT_ESB_FILE_120);
+
+ StringBuffer errorList = new StringBuffer();
+
+ String bpelActionPath = "Services/s/Actions/action2";
+ String[][] bpelActionAttrValues = {
+ {"name", "action2"},
+ {"class", "org.jboss.soa.esb.actions.bpel.BPELInvoke"},
+ {"service", "{http://www.jboss.org/bpel/examples/wsdl}HelloService"},
+ {"operation", "hello"},
+ {"port", "HelloPort"},
+ {"request part name", "TestPart"},
+ {"response part name", "TestPart"}
+ };
+ checkAttributes(object, bpelActionPath, bpelActionAttrValues, errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
XModelObject getFileObject(String parentPath, String xmlname) {
return getFileObject(parentPath, xmlname, ESBConstants.ENT_ESB_FILE_101);
}
15 years, 9 months
JBoss Tools SVN: r23493 - in trunk/esb/plugins/org.jboss.tools.esb.core: .settings and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 06:30:41 -0400 (Fri, 16 Jul 2010)
New Revision: 23493
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/.settings/
trunk/esb/plugins/org.jboss.tools.esb.core/.settings/org.eclipse.jdt.core.prefs
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-riftsaw-actions.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddBPELInvokeHandler.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-menu.properties
trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
Log:
https://jira.jboss.org/browse/JBIDE-6609
Added: trunk/esb/plugins/org.jboss.tools.esb.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/.settings/org.eclipse.jdt.core.prefs 2010-07-16 10:30:41 UTC (rev 23493)
@@ -0,0 +1,8 @@
+#Fri Jun 11 14:44:27 MSD 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-07-16 09:33:37 UTC (rev 23492)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-07-16 10:30:41 UTC (rev 23493)
@@ -7,6 +7,7 @@
<meta path="meta/esb-actions.meta"/>
<meta path="meta/esb-notifiers.meta"/>
<meta path="meta/esb12.meta"/>
+ <meta path="meta/esb-riftsaw-actions.meta"/>
</extension>
<extension point="org.jboss.tools.common.model.keys">
@@ -55,6 +56,8 @@
class="org.jboss.tools.esb.core.model.handlers.AddJBRListerer12Handler"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddRouteToForCBRHandler"
class="org.jboss.tools.esb.core.model.handlers.AddRouteToForCBRHandler"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"
+ class="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.ESBDefaultVersionResolver"
class="org.jboss.tools.esb.core.model.handlers.ESBDefaultVersionResolver"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-menu.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-menu.properties 2010-07-16 09:33:37 UTC (rev 23492)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-menu.properties 2010-07-16 10:30:41 UTC (rev 23493)
@@ -41,6 +41,7 @@
ESB.AddCommandInterpreter.menu=Command Interpreter...
ESB.AddGroovyProcessor.menu=Groovy Action Processor...
ESB.AddAggregator.menu=Aggregator...
+ESB.AddBPELInvoke.menu=BPEL Invoke Action...
ESB.AddContentBasedRouter.menu=Content Based Router (Generic)...
ESB.AddContentBasedRouterDrools.menu=Content Based Router (Drools)...
ESB.AddContentBasedRouterRegex.menu=Content Based Router (Regex)...
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2010-07-16 09:33:37 UTC (rev 23492)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2010-07-16 10:30:41 UTC (rev 23493)
@@ -566,6 +566,9 @@
ESB.AddAggregator.WindowTitle=Add Aggregator
ESB.AddAggregator.Title=ESB Aggregator
+ESB.AddBPELInvoke.WindowTitle=Add BPEL Invoke Action
+ESB.AddBPELInvoke.Title=ESB BPEL Invoke Action
+
ESB.AddContentBasedRouter.WindowTitle=Add Content Based Router
ESB.AddContentBasedRouter.Title=ESB Content Based Router
@@ -670,6 +673,7 @@
ESBPreActionAggregator101_Properties.Title=Aggregator
ESBPreActionAggregator120_Properties.Title=Aggregator
+ESBPreActionBPELInvoke120_Properties.Title=BPEL Invoke Action
ESBPreActionBpmProcessor120_Properties.Title=BPM Processor
ESBPreActionByteArrayToString101_Properties.Title=Byte Array to String
ESBPreActionCommandInterpreter101_Properties.Title=Command Interpreter
Added: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-riftsaw-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-riftsaw-actions.meta (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-riftsaw-actions.meta 2010-07-16 10:30:41 UTC (rev 23493)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
+<XModelEntityGroup>
+ <VERSION DEPENDS="Model:1.0" MODULE="ESB" VERSION="1.0"/>
+ <MAPPINGS>
+ <MAPPING name="ESBSpecificActions">
+ <PAIR name="org.jboss.soa.esb.actions.bpel.BPELInvoke" value="ESBPreActionBPELInvoke"/>
+ </MAPPING>
+ <MAPPING name="Handlers"/>
+ </MAPPINGS>
+ <ICONS/>
+ <GlobalActions kind="list"/>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ XMLSUBPATH="action" name="ESBPreActionBPELInvoke120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="BPEL invoke action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.bpel.BPELInvoke" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="service" xmlname="service"/>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="operation" xmlname="operation"/>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced" name="port" xmlname="port"/>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="request part name" xmlname="requestPartName"/>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="response part name" xmlname="responsePartName"/>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ default="default(true)" name="abort on fault" xmlname="abortOnFault">
+ <Constraint loader="ListString">
+ <value name="default(true)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XEntityExtension name="ESBActions120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBPreActionBPELInvoke120"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem displayName="Add Pre-Packed Action" kind="list" name="PrePackedAction">
+ <XActionItem displayName="BPEL" group="1" kind="list" name="BPEL">
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"
+ ICON="action.empty" PROPERTIES="validator.add=true"
+ WizardClassName="%Default%" displayName="BPEL Invoke Action..."
+ kind="action" name="AddBPELInvoke">
+ <EntityData EntityName="ESBPreActionBPELInvoke120">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="service"/>
+ <AttributeData AttributeName="operation"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+</XModelEntityGroup>
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddBPELInvokeHandler.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddBPELInvokeHandler.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddBPELInvokeHandler.java 2010-07-16 10:30:41 UTC (rev 23493)
@@ -0,0 +1,34 @@
+package org.jboss.tools.esb.core.model.handlers;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+
+public class AddBPELInvokeHandler extends DefaultCreateHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ if(super.isEnabled(object)) {
+ IResource resource = EclipseResourceUtil.getResource(object);
+ if(resource != null) {
+ IProject project = resource.getProject();
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(project);
+ if(jp != null) {
+ try {
+ IType t = EclipseJavaUtil.findType(jp, "org.jboss.soa.esb.actions.bpel.BPELInvoke");
+ return t != null;
+ } catch (JavaModelException e) {
+ //ignore
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddBPELInvokeHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23492 - trunk/vpe/plugins/org.jboss.tools.vpe/ve.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-07-16 05:33:37 -0400 (Fri, 16 Jul 2010)
New Revision: 23492
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/ve/EditorOverride.css
Log:
https://jira.jboss.org/browse/JBIDE-6619 :
VPE Resizer is not shown on XULRunner 1.9.2
- VPE file EditorOverride.css is merged with EditorOverride.css from XULRunner 1.9.2 ('-moz-outline' style is replaced by 'outline').
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/ve/EditorOverride.css
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/ve/EditorOverride.css 2010-07-16 08:55:25 UTC (rev 23491)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/ve/EditorOverride.css 2010-07-16 09:33:37 UTC (rev 23492)
@@ -1,25 +1,44 @@
-/*
- * The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape
- * Communications Corporation. Portions created by Netscape are
- * Copyright (C) 1998-1999 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- */
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+*|* {
+ -moz-user-modify: read-write;
+}
+
/* Styles to alter look of things in the Editor content window
* that should NOT be removed when we display in completely WYSIWYG
* "Browser Preview" mode.
@@ -29,7 +48,7 @@
/* Primary cursor is text I-beam */
-a:link {
+::-moz-canvas, a:link {
cursor: text;
}
@@ -42,33 +61,39 @@
object, object[usemap],
applet, hr, button, input, isindex, textarea, select,
a:link img, a:visited img, a:active img,
-a[name]:empty {
+a[name]:-moz-only-whitespace {
cursor: default;
}
a:visited, a:active {
cursor: text;
- // color : inherit;
}
+/* Prevent clicking on links from going to link */
a:link img, a:visited img {
-moz-user-input: none;
}
-
+
+/* We suppress user/author's prefs for link underline,
+ so we must set explicitly. This isn't good!
+*/
a/*:link*/ {
text-decoration: underline -moz-anchor-decoration;
color: -moz-hyperlinktext;
}
-button, textarea {
+/* Allow double-clicks on these widgets to open properties dialogs
+ XXX except when the widget has disabled attribute */
+input, button, textarea {
-moz-user-select: all !important;
-moz-user-input: auto !important;
-moz-user-focus: none !important;
}
+/* XXX Still need a better way of blocking other events to these widgets */
select, input[disabled], input[type="checkbox"], input[type="radio"], input[type="file"] {
-moz-user-select: all !important;
- -moz-user-input: auto !important;
+ -moz-user-input: auto !important;
-moz-user-focus: none !important;
}
@@ -93,12 +118,7 @@
::-moz-display-comboboxcontrol-frame {
-moz-user-select: text !important;
}
-
-.def-link {
- text-decoration: underline -moz-anchor-decoration;
- color: -moz-hyperlinktext;
-}
-
+
option {
-moz-user-select: text !important;
}
@@ -108,6 +128,8 @@
-moz-user-input: none !important;
}
+/* the following rules are for Image Resizing */
+
span[\_moz_anonclass="mozResizer"] {
width: 5px;
height: 5px;
@@ -115,9 +137,10 @@
border: 1px black solid;
background-color: white;
-moz-user-select: none;
- z-index: 2147483646;
+ z-index: 2147483646; /* max value -1 for this property */
}
+/* we can't use :active below */
span[\_moz_anonclass="mozResizer"][\_moz_activated],
span[\_moz_anonclass="mozResizer"]:hover {
background-color: black;
@@ -160,11 +183,11 @@
span[\_moz_anonclass="mozResizingShadow"],
img[\_moz_anonclass="mozResizingShadow"] {
- -moz-outline: thin dashed black;
+ outline: thin dashed black;
-moz-user-select: none;
- -moz-opacity: 0.5;
+ opacity: 0.5;
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
}
span[\_moz_anonclass="mozResizingInfo"] {
@@ -175,12 +198,16 @@
border: ridge 2px #d0d0d0;
padding: 2px;
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
}
+img[\_moz_resizing] {
+ outline: thin solid black;
+}
+
*[\_moz_abspos] {
- -moz-outline: silver ridge 2px;
- z-index: 2147483645 !important;
+ outline: silver ridge 2px;
+ z-index: 2147483645 !important; /* max value -2 for this property */
}
*[\_moz_abspos="white"] {
background-color: white !important;
@@ -190,26 +217,29 @@
}
span[\_moz_anonclass="mozGrabber"] {
- -moz-outline: ridge 2px silver;
+ outline: ridge 2px silver;
padding: 2px;
position: absolute;
width: 12px;
height: 12px;
- background-image: url("resource:/res/grabber.gif");
+ background-image: url("resource://gre/res/grabber.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none;
cursor: move;
+ z-index: 2147483647; /* max value for this property */
}
+/* INLINE TABLE EDITING */
+
a[\_moz_anonclass="mozTableAddColumnBefore"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 4px;
height: 8px;
- background-image: url("resource:/res/table-add-column-before.gif");
+ background-image: url("resource://gre/res/table-add-column-before.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -217,21 +247,21 @@
}
a[\_moz_anonclass="mozTableAddColumnBefore"]:hover {
- background-image: url("resource:/res/table-add-column-before-hover.gif");
+ background-image: url("resource://gre/res/table-add-column-before-hover.gif");
}
a[\_moz_anonclass="mozTableAddColumnBefore"]:active {
- background-image: url("resource:/res/table-add-column-before-active.gif");
+ background-image: url("resource://gre/res/table-add-column-before-active.gif");
}
a[\_moz_anonclass="mozTableAddColumnAfter"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 4px;
height: 8px;
- background-image: url("resource:/res/table-add-column-after.gif");
+ background-image: url("resource://gre/res/table-add-column-after.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -239,21 +269,21 @@
}
a[\_moz_anonclass="mozTableAddColumnAfter"]:hover {
- background-image: url("resource:/res/table-add-column-after-hover.gif");
+ background-image: url("resource://gre/res/table-add-column-after-hover.gif");
}
a[\_moz_anonclass="mozTableAddColumnAfter"]:active {
- background-image: url("resource:/res/table-add-column-after-active.gif");
+ background-image: url("resource://gre/res/table-add-column-after-active.gif");
}
a[\_moz_anonclass="mozTableRemoveColumn"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 8px;
height: 8px;
- background-image: url("resource:/res/table-remove-column.gif");
+ background-image: url("resource://gre/res/table-remove-column.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -261,21 +291,21 @@
}
a[\_moz_anonclass="mozTableRemoveColumn"]:hover {
- background-image: url("resource:/res/table-remove-column-hover.gif");
+ background-image: url("resource://gre/res/table-remove-column-hover.gif");
}
a[\_moz_anonclass="mozTableRemoveColumn"]:active {
- background-image: url("resource:/res/table-remove-column-active.gif");
+ background-image: url("resource://gre/res/table-remove-column-active.gif");
}
a[\_moz_anonclass="mozTableAddRowBefore"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 8px;
height: 4px;
- background-image: url("resource:/res/table-add-row-before.gif");
+ background-image: url("resource://gre/res/table-add-row-before.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -283,21 +313,21 @@
}
a[\_moz_anonclass="mozTableAddRowBefore"]:hover {
- background-image: url("resource:/res/table-add-row-before-hover.gif");
+ background-image: url("resource://gre/res/table-add-row-before-hover.gif");
}
a[\_moz_anonclass="mozTableAddRowBefore"]:active {
- background-image: url("resource:/res/table-add-row-before-active.gif");
+ background-image: url("resource://gre/res/table-add-row-before-active.gif");
}
a[\_moz_anonclass="mozTableAddRowAfter"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 8px;
height: 4px;
- background-image: url("resource:/res/table-add-row-after.gif");
+ background-image: url("resource://gre/res/table-add-row-after.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -305,21 +335,21 @@
}
a[\_moz_anonclass="mozTableAddRowAfter"]:hover {
- background-image: url("resource:/res/table-add-row-after-hover.gif");
+ background-image: url("resource://gre/res/table-add-row-after-hover.gif");
}
a[\_moz_anonclass="mozTableAddRowAfter"]:active {
- background-image: url("resource:/res/table-add-row-after-active.gif");
+ background-image: url("resource://gre/res/table-add-row-after-active.gif");
}
a[\_moz_anonclass="mozTableRemoveRow"] {
position: absolute;
- z-index: 2147483647;
+ z-index: 2147483647; /* max value for this property */
text-decoration: none !important;
border: none 0px !important;
width: 8px;
height: 8px;
- background-image: url("resource:/res/table-remove-row.gif");
+ background-image: url("resource://gre/res/table-remove-row.gif");
background-repeat: no-repeat;
background-position: center center;
-moz-user-select: none !important;
@@ -327,12 +357,12 @@
}
a[\_moz_anonclass="mozTableRemoveRow"]:hover {
- background-image: url("resource:/res/table-remove-row-hover.gif");
+ background-image: url("resource://gre/res/table-remove-row-hover.gif");
}
a[\_moz_anonclass="mozTableRemoveRow"]:active {
- background-image: url("resource:/res/table-remove-row-active.gif");
-}
+ background-image: url("resource://gre/res/table-remove-row-active.gif");
+}
/*JBIDE-3995 #1*/
select div {
@@ -404,4 +434,4 @@
z-index :inherit !important;
font-size-adjust :inherit !important;
opacity :inherit !important;
-}
\ No newline at end of file
+}
15 years, 9 months
JBoss Tools SVN: r23491 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-07-16 04:55:25 -0400 (Fri, 16 Jul 2010)
New Revision: 23491
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
Log:
https://jira.jboss.org/browse/JBIDE-6621
Added new Ingres dialects
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2010-07-16 08:47:31 UTC (rev 23490)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2010-07-16 08:55:25 UTC (rev 23491)
@@ -101,7 +101,23 @@
"jdbc:ingres://localhost:II7/demodb", //$NON-NLS-1$
"jdbc:ingres://<server>:<port>/<databaseName>", //$NON-NLS-1$
}
+ );
+
+ addDriverAndURLS("org.hibernate.dialect.Ingres9Dialect", //$NON-NLS-1$
+ "com.ingres.jdbc.IngresDriver", //$NON-NLS-1$
+ new String[] {
+ "jdbc:ingres://localhost:II7/demodb", //$NON-NLS-1$
+ "jdbc:ingres://<server>:<port>/<databaseName>", //$NON-NLS-1$
+ }
);
+
+ addDriverAndURLS("org.hibernate.dialect.Ingres10Dialect", //$NON-NLS-1$
+ "com.ingres.jdbc.IngresDriver", //$NON-NLS-1$
+ new String[] {
+ "jdbc:ingres://localhost:II7/demodb", //$NON-NLS-1$
+ "jdbc:ingres://<server>:<port>/<databaseName>", //$NON-NLS-1$
+ }
+ );
addDriverAndURLS("org.hibernate.dialect.OracleDialect", //$NON-NLS-1$
"oracle.jdbc.driver.OracleDriver", //$NON-NLS-1$
15 years, 9 months
JBoss Tools SVN: r23490 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-07-16 04:47:31 -0400 (Fri, 16 Jul 2010)
New Revision: 23490
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
Log:
https://jira.jboss.org/browse/JBIDE-6598 , Update all related tags if the URI was changed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2010-07-16 08:24:00 UTC (rev 23489)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2010-07-16 08:47:31 UTC (rev 23490)
@@ -276,6 +276,16 @@
editDialog.open();
if(data.isChanged()) {
tagListWasChanged = true;
+ /*
+ * Update all related tags if the URI was changed
+ */
+ for (VpeAnyData tag : tagsList) {
+ if (!tag.equals(data)
+ && tag.getName().split(":")[0] //$NON-NLS-1$
+ .equalsIgnoreCase(data.getName().split(":")[0])) { //$NON-NLS-1$
+ tag.setUri(data.getUri());
+ }
+ }
}
}
} else if (source == removeButton) {
15 years, 9 months
JBoss Tools SVN: r23488 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor/menu/action and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-07-16 04:15:10 -0400 (Fri, 16 Jul 2010)
New Revision: 23488
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6598 , validation was updated, error messages were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -379,7 +379,8 @@
private VpeAnyData editAnyData(StructuredTextEditor sourceEditor, boolean isCorrectNS, VpeAnyData data) {
Shell shell = sourceEditor.getEditorPart().getSite().getShell();
if (isCorrectNS) {
- VpeEditAnyDialog editDialog = new VpeEditAnyDialog(shell, data);
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(shell, data,
+ VpeTemplateManager.getInstance().getAnyTemplates());
editDialog.open();
} else {
MessageBox message = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -78,7 +78,8 @@
.getWorkbench().getActiveWorkbenchWindow().getShell();
if (isCorrectNS) {
- VpeEditAnyDialog editDialog = new VpeEditAnyDialog(shell, data);
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(shell, data,
+ VpeTemplateManager.getInstance().getAnyTemplates());
editDialog.open();
} else {
MessageBox message = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -10,7 +10,15 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.preferences;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ColumnLayoutData;
@@ -132,11 +140,14 @@
return composite;
}
+ /**
+ * Updates tags table according to the current <code>tagList</code>.
+ */
private void updateTagsTable() {
/*
* If widget is null or disposed - exit.
*/
- if(tagsTable == null || tagsTable.isDisposed()) {
+ if(tagsTable == null || tagsTable.isDisposed() || tagsList == null) {
return;
}
/*
@@ -153,6 +164,14 @@
* Recreate table items
*/
TableItem tableItem = null;
+ /*
+ * Sort the templates
+ */
+ Collections.sort(tagsList, new Comparator<VpeAnyData>() {
+ public int compare(VpeAnyData o1, VpeAnyData o2) {
+ return o1.getName().compareToIgnoreCase(o2.getName());
+ }
+ });
for (int i = 0; i < tagsList.size(); i++) {
if(tagsTable.getItemCount() > i) {
/*
@@ -238,7 +257,7 @@
* Handle add event
*/
VpeAnyData data = new VpeAnyData(Constants.EMPTY, Constants.EMPTY, Constants.EMPTY);
- VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data);
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data, tagsList);
editDialog.open();
if(data.isChanged()) {
/*
@@ -253,7 +272,7 @@
*/
if (selectIndex > -1) {
VpeAnyData data = (VpeAnyData) tagsList.get(selectIndex);
- VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data);
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data, tagsList);
editDialog.open();
if(data.isChanged()) {
tagListWasChanged = true;
@@ -283,7 +302,10 @@
public boolean performOk() {
if(tagListWasChanged) {
/*
- * Commit changes to the file
+ * Commit changes to the file.
+ * While saving the templates' file will be rewritten from scratch.
+ * Only the first URI will be used for templates with the same prefix,
+ * other URI will be ignored.
*/
VpeTemplateManager.getInstance().setAnyTemplates(tagsList);
}
@@ -293,6 +315,12 @@
@Override
protected void performApply() {
performOk();
+ /*
+ * After "Apply" button templates list should be updated
+ * due to URI changes
+ */
+ tagsList = VpeTemplateManager.getInstance().getAnyTemplates();
+ updateTagsTable();
}
@Override
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -13,12 +13,19 @@
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
@@ -61,18 +68,33 @@
*/
public class VpeEditAnyDialog extends TitleAreaDialog {
+ /*
+ * Current template
+ */
private VpeAnyData data;
+ /*
+ * List of already created templates
+ */
+ List<VpeAnyData> tagsList;
+ Map<String, VpeAnyData> tagsNamesSet = new HashMap<String, VpeAnyData>();
Text tagName;
Text tagUri;
+ private String previousUri = Constants.EMPTY;
private Button childrenCheckbox;
private Text txtTagForDisplay;
private Text txtValue;
private Text txtStyle;
private VpeEditAnyDialogValidator templateVerifier;
- public VpeEditAnyDialog(Shell shell, VpeAnyData data) {
+ public VpeEditAnyDialog(Shell shell, VpeAnyData data, List<VpeAnyData> tagsList) {
super(shell);
this.data = data;
+ this.tagsList = tagsList;
+ if (null != tagsList) {
+ for (VpeAnyData tag : tagsList) {
+ tagsNamesSet.put(tag.getName(), tag);
+ }
+ }
setHelpAvailable(false);
}
@@ -337,23 +359,74 @@
*/
private IMessageProvider validateTagName() {
Message message = null;
- String[] parts = tagName.getText().split(":"); //$NON-NLS-1$
- if (parts.length != 2 || tagName.getText().startsWith(":") //$NON-NLS-1$
- || tagName.getText().endsWith(":")) { //$NON-NLS-1$
+ String name = tagName.getText().trim();
+ String[] parts = name.split(":"); //$NON-NLS-1$
+ Pattern p = Pattern.compile("([a-zA-Z]+\\d*)+"); //$NON-NLS-1$
+ /*
+ * Reset editable property for template URI
+ * after it has been disabled.
+ */
+ if (!tagUri.getEditable()) {
+ tagUri.removeModifyListener(templateVerifier);
+ if ((null != data) && (null != data.getName()) &&
+ data.getName().split(":")[0].equalsIgnoreCase(parts[0])) { //$NON-NLS-1$
+ /*
+ * Restore initial URI
+ */
+ previousUri = data.getUri();
+ }
+ tagUri.setText(previousUri);
+ tagUri.setEditable(true);
+ tagUri.addModifyListener(templateVerifier);
+ }
+ /*
+ * Check if tag's name is correct
+ */
+ if (parts.length != 2 || name.startsWith(":") //$NON-NLS-1$
+ || name.endsWith(":")) { //$NON-NLS-1$
message = new Message(
MessageFormat.format(VpeUIMessages.TAG_NAME_IS_NOT_VALID,
- tagName.getText().trim()), IMessageProvider.ERROR);
- } else {
- /*
- * Matcher will accept only word characters with optional numbers.
- */
- Pattern p = Pattern.compile("([a-zA-Z]+\\d*)+"); //$NON-NLS-1$
- if ((parts[0].length() == 0) || (parts[1].length() == 0)
+ name), IMessageProvider.ERROR);
+ } else if ((parts[0].length() == 0) || (parts[1].length() == 0)
|| (!p.matcher(parts[0]).matches())
|| (!p.matcher(parts[1]).matches())) {
+ /*
+ * Matcher will accept only word characters with optional numbers.
+ */
message = new Message(
MessageFormat.format(VpeUIMessages.TAG_NAME_IS_NOT_VALID,
- tagName.getText().trim()), IMessageProvider.ERROR);
+ name), IMessageProvider.ERROR);
+ } else if (tagsNamesSet.keySet().contains(name)
+ && (!tagsList.contains(data)
+ || (tagsList.contains(data) && !data.getName().equalsIgnoreCase(name)))) {
+ /*
+ * Find duplicate tag names.
+ */
+ message = new Message(
+ MessageFormat.format(VpeUIMessages.TAG_NAME_ALREADY_EXISTS,
+ name), IMessageProvider.ERROR);
+ } else {
+ /*
+ * Inform that URI for the specified taglib namespace
+ * is already defined in another templates.
+ */
+ for (String templateName : tagsNamesSet.keySet()) {
+ if (parts[0].equalsIgnoreCase(templateName.split(":")[0]) //$NON-NLS-1$
+ && (!tagsList.contains(data) || (tagsList.contains(data) && !data.getName().split(":")[0].equalsIgnoreCase(parts[0])))) { //$NON-NLS-1$
+ message = new Message(
+ MessageFormat.format(VpeUIMessages.URI_TAGLIB_NAMESPACE_ALREADY_DEFINED,
+ parts[0], tagsNamesSet.get(templateName).getUri()), IMessageProvider.WARNING);
+ /*
+ * Set the URI and disable this field.
+ * Remove the listener to avoid dead lock
+ */
+ tagUri.removeModifyListener(templateVerifier);
+ previousUri = tagUri.getText();
+ tagUri.setText(tagsNamesSet.get(templateName).getUri());
+ tagUri.setEditable(false);
+ tagUri.addModifyListener(templateVerifier);
+ break;
+ }
}
}
return message;
@@ -411,27 +484,58 @@
* @param updateMessage if it is {@code true}, the dialog's message will be updated.
*/
void validateAll(boolean updateMessage) {
- IMessageProvider message = null;
+ /*
+ * Initialize the message with the description
+ */
+ IMessageProvider message = new Message(VpeUIMessages.UNKNOWN_TAGS_DIALOG_DESCRIPTION,
+ IMessageProvider.NONE);
+ List<IMessageProvider> statuses = new ArrayList<IMessageProvider>();
+ /*
+ * Get messages from all validators
+ */
+ statuses.add(validateTagForDisplay());
+ statuses.add(validateValue());
+ statuses.add(validateTagName());
+ /*
+ * Find the message with the most severe status
+ */
+ for (IMessageProvider status : statuses) {
+ if (null != status) {
+ message = message.getMessageType() >= status.getMessageType()
+ ? message : status;
+ }
+ }
+ String messageText = message.getMessage();
+ switch (message.getMessageType()) {
+ case IMessageProvider.NONE:
+ setMessage(messageText, IMessageProvider.NONE);
+ setErrorMessage(null);
+ break;
- IMessageProvider tagForDisplayMessage = validateTagForDisplay();
- IMessageProvider valueMessage = validateValue();
- IMessageProvider tagNameMessage = validateTagName();
+ case IMessageProvider.WARNING:
+ setMessage(messageText, IMessageProvider.WARNING);
+ setErrorMessage(null);
+ break;
- if (tagNameMessage != null) {
- message = tagNameMessage;
- } else if (tagForDisplayMessage != null) {
- message = tagForDisplayMessage;
- } else if (valueMessage != null) {
- message = valueMessage;
- } else {
+ case IMessageProvider.INFORMATION:
+ setMessage(messageText, IMessageProvider.INFORMATION);
+ setErrorMessage(null);
+ break;
+
+ default:
/*
- * If everything is OK - set default message
+ * Set ERROR message
*/
- setMessage(VpeUIMessages.UNKNOWN_TAGS_DIALOG_DESCRIPTION);
- }
-
+ if (messageText.length() == 0) {
+ messageText = null;
+ }
+ setMessage(null, IMessageProvider.NONE);
+ setErrorMessage(messageText);
+ break;
+ } // end switch
+
Button okButton = getButton(IDialogConstants.OK_ID);
- if ((message == null) || (message.getMessageType() <= IMessageProvider.INFORMATION)) {
+ if ((message == null) || (message.getMessageType() <= IMessageProvider.WARNING)) {
okButton.setEnabled(true);
} else {
okButton.setEnabled(false);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -743,7 +743,9 @@
}
}
}
-
+ /*
+ * URI is set separately from the taglib section.
+ */
for (Iterator<VpeAnyData> iter = anyTemplateList.iterator(); iter.hasNext();) {
VpeAnyData element = iter.next();
String prefix = element.getPrefix();
@@ -754,7 +756,6 @@
element.setUri(uri);
}
}
-
return anyTemplateList;
}
@@ -788,6 +789,10 @@
VpeAnyData data = iter.next();
root.appendChild(createNewTagElement(document, data));
String prefix = data.getPrefix();
+ /*
+ * While saving other URIs for the same prefixes will be ignored
+ * only the first URI will be used for this prefix.
+ */
if ((prefix != null) && (prefix.length() > 0) && !prefixSet.contains(prefix)) {
root = appendTaglib(prefixSet, document, root, data);
prefixSet.add(prefix);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-07-16 08:15:10 UTC (rev 23488)
@@ -48,6 +48,8 @@
public static String TAG_NAME_IS_NOT_VALID;
public static String TAG_FOR_DISPLAY_IS_NOT_VALID;
public static String VALUE_IS_NOT_VALID;
+ public static String TAG_NAME_ALREADY_EXISTS;
+ public static String URI_TAGLIB_NAMESPACE_ALREADY_DEFINED;
public static String BACKGROUND_COLOR;
public static String ERROR_OF_TYPE_CONVERSION;
public static String INCORRECT_PARAMETER_ERROR;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-07-16 07:50:43 UTC (rev 23487)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-07-16 08:15:10 UTC (rev 23488)
@@ -27,8 +27,10 @@
CHILDREN=Allow tag children:
VALUE=Value:
TAG_NAME_IS_NOT_VALID=Tag name ({0}) is not valid. The pattern is "taglib:tag"
-TAG_FOR_DISPLAY_IS_NOT_VALID=Incorrect tag with name ({0}).
+TAG_FOR_DISPLAY_IS_NOT_VALID=Incorrect "Tag for display" with name ({0}).
VALUE_IS_NOT_VALID=Value is not valid ({0}).
+TAG_NAME_ALREADY_EXISTS=Tag name ({0}) already exists. Please specify another one.
+URI_TAGLIB_NAMESPACE_ALREADY_DEFINED=URI for taglib namespace ({0}) is already defined.\n"{1}" URI will be used.
BACKGROUND_COLOR=Background Color
ERROR_OF_TYPE_CONVERSION=Error of type conversion
15 years, 9 months