JBoss Tools SVN: r39951 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-03-30 23:33:13 -0400 (Fri, 30 Mar 2012)
New Revision: 39951
Added:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/EAPExampleTest.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SimpleEAPTest.java
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
Log:
Checking in (incomplete) test for - https://issues.jboss.org/browse/JBQA-6077
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/EAPExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/EAPExampleTest.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/EAPExampleTest.java 2012-03-31 03:33:13 UTC (rev 39951)
@@ -0,0 +1,212 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.ExampleTest;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+
+public class EAPExampleTest extends ExampleTest{
+
+
+ /**
+ * returns example project name (as it is imported to workspace)
+ * @return
+ */
+ public String getExampleProjectName() {
+ return getProjectNames()[0];
+ }
+ /**
+ * returns name of example client project (null if none)
+ * @return
+ */
+ public String getExampleClientProjectName() {
+ return getProjectNames()[1];
+ }
+ @Override
+ public String[] getProjectNames() {
+ return new String[2];
+ }
+
+ @Override
+ public String getExampleCategory() {
+ return getRunningSoaVersionTreeLabel();
+ }
+ /**
+ * called after example projects are imported, by default fixes both example project references and (if defined) client example references
+ */
+ @Override
+ protected void postImport() {
+ fixExampleLibs();
+ if (getExampleClientProjectName()!=null) {
+ fixExampleClientLibs();
+ }
+ //openESBConfig();
+
+ /* Temporary fix to workaround JBDS-2011 */
+ System.out.println ("DEBUG - name = " + getExampleProjectName() );
+ if (!getExampleProjectName().equals("transform_CSV2XML")) {
+ assertProblemsView();
+ }
+ }
+ /**
+ * opens up ESB config file contained in example project in ESB Editor
+ */
+ protected void openESBConfig() {
+ String[] config = {getExampleProjectName(),"esbcontent","META-INF","jboss-esb.xml"};
+ assertTrue("ESB config file does not exist",projectExplorer.existsResource(config));
+ SWTBotEditor editor = projectExplorer.openFile(getExampleProjectName(), "esbcontent","META-INF","jboss-esb.xml");
+ assertNotNull("No editor was opened", editor);
+ assertEquals("Wrong editor was opened", "jboss-esb.xml", editor.getTitle());
+ editor.close();
+ }
+ /**
+ * executes (deploys) example project
+ */
+ @Override
+ protected void executeExample() {
+ super.executeExample();
+ packageExplorer.runOnServer(getExampleProjectName());
+ util.waitForNonIgnoredJobs();
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param path clientClass as could be seen in package explorer (e.g src, org.jboss.tools.test.Class.java)
+ * @return string in server log console that was appended or null if nothing appended
+ */
+ protected String executeClientGetServerOutput(String... clientClass) {
+ String text = console.getConsoleText();
+ SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),clientClass);
+ eclipse.runTreeItemAsJavaApplication(jmsCall);
+ bot.sleep(Timing.time5S());
+ util.waitForNonIgnoredJobs();
+ console.switchConsole(configuredState.getServer().name);
+ //String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
+ String text2 = console.getConsoleText(TIME_5S, TIME_60S, false); /* https://issues.jboss.org/browse/JBQA-5838 - ldimaggi */
+ if (text.length()>=text2.length()) {
+ return null;
+ }
+ return text2.substring(text.length());
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param path clientClass as could be seen in package explorer (e.g src, org.jboss.tools.test.Class.java)
+ * @return string in log console that was appended
+ */
+ protected String executeClient(String... clientClass) {
+ SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),clientClass);
+ eclipse.runTreeItemAsJavaApplication(jmsCall);
+ bot.sleep(Timing.time5S());
+ String text = console.getConsoleText(TIME_5S, TIME_20S, false);
+ console.switchConsole(configuredState.getServer().name); // switch console back for sure
+ return text;
+ }
+ /**
+ * executes given class in given project (path must include project name)
+ * @param className full name of class to run
+ * @param arguments arguments that should be passed to classes main method (can be null)
+ * @return string in server log that was appended or null if nothing appended
+ */
+ protected String executeClientGetServerOutput(String className, String arguments) {
+ String text = console.getConsoleText();
+ eclipse.runJavaApplication(getExampleClientProjectName(), className, arguments);
+ bot.sleep(Timing.time5S());
+ console.switchConsole(configuredState.getServer().name);
+ String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
+ if (text.length()>=text2.length()) {
+ return null;
+ }
+ return text2.substring(text.length());
+ }
+ protected void fixJREToWorkspaceDefault(String project) {
+ SWTBotTree tree = projectExplorer.show().bot().tree();
+ SWTBotTreeItem proj = tree.select(project).getTreeItem(project);
+ for (SWTBotTreeItem item : proj.getItems()) {
+ if (item.getText().startsWith("JRE System")) {
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.PROPERTIES, false)).click();
+ SWTBotShell shell = bot.activeShell();
+ shell.bot().radio(2).click();
+ open.finish(shell.bot(),IDELabel.Button.OK);
+ break;
+ }
+ }
+
+ }
+ protected void fixExampleLibs() {
+ fixLibrary(getExampleProjectName(),"Server Library");
+ fixLibrary(getExampleProjectName(),"JBoss ESB Runtime");
+ util.waitForNonIgnoredJobs();
+ }
+ protected void fixExampleClientLibs() {
+ fixLibrary(getExampleClientProjectName(),"Server Library");
+ fixLibrary(getExampleClientProjectName(),"JBoss ESB Runtime");
+ fixJREToWorkspaceDefault(getExampleClientProjectName());
+ util.waitForNonIgnoredJobs();
+ }
+ protected void assertProblemsView() {
+ //bot.sleep(60000l);
+ SWTBotTreeItem errors = ProblemsView.getErrorsNode(bot);
+
+
+
+ assertNull("Project still contain problems :"+SWTEclipseExt.getFormattedTreeNode(errors),errors);
+ }
+ protected void fixLibrary(String project, String lib) {
+ SWTBotTree tree = projectExplorer.show().bot().tree();
+ SWTBotTreeItem proj = tree.select(project).getTreeItem(project);
+ proj.expand();
+ boolean fixed=false;
+ boolean found=false;
+ for (SWTBotTreeItem item : proj.getItems()) {
+ if (item.getText().startsWith(lib)) {
+ found = true;
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.PROPERTIES, false)).click();
+ SWTBotShell shell = bot.activeShell();
+ shell.bot().table().select(configuredState.getServer().name);
+ open.finish(shell.bot(),IDELabel.Button.OK);
+ fixed=true;
+ break;
+ }
+ }
+ if (!fixed && found) {
+ log.error("Libray starting with '"+lib+"' in project '"+project+"' was not fixed.");
+ bot.sleep(Long.MAX_VALUE);
+ }
+ if (!found) {
+ log.info("Libray starting with '"+lib+"' in project '"+project+"' was not found.");
+ }
+ }
+ /**
+ * gets label in project examples tree derived by version of soa we currently run
+ * @return
+ */
+ protected String getRunningSoaVersionTreeLabel() {
+ String ret = "ESB for SOA-P ";
+ if (!configuredState.getServer().isConfigured) {
+ throw new NullPointerException("No server was configured for test, but it is required");
+ }
+ if (configuredState.getServer().version.startsWith("5.")) {
+ ret+="5.0";
+ }
+ else if (configuredState.getServer().version.equals("4.3")) {
+ ret+="4.3";
+ }
+ else if (configuredState.getServer().version.equals("6.0")) {
+ ret="JBoss Quickstarts";
+ }
+ else {
+ assertNotNull("We are running on unexpected SOA-P version "+configuredState.getServer().version+" update test source code "+this.getClass().getName(), null);
+ return null;
+ }
+ return ret;
+ }
+}
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-03-31 01:41:48 UTC (rev 39950)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-03-31 03:33:13 UTC (rev 39951)
@@ -200,6 +200,9 @@
else if (configuredState.getServer().version.equals("4.3")) {
ret+="4.3";
}
+ else if (configuredState.getServer().version.equals("6.0")) {
+ ret="JBoss Quickstarts";
+ }
else {
assertNotNull("We are running on unexpected SOA-P version "+configuredState.getServer().version+" update test source code "+this.getClass().getName(), null);
return null;
Added: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SimpleEAPTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SimpleEAPTest.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/SimpleEAPTest.java 2012-03-31 03:33:13 UTC (rev 39951)
@@ -0,0 +1,138 @@
+package org.jboss.tools.esb.ui.bot.tests.examples;
+
+import org.jboss.tools.ui.bot.ext.ExampleTest;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+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.config.Annotations.ServerType;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.ESBESBFile;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.GeneralFolder;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.ServerServers;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+import org.jboss.tools.ui.bot.ext.view.ServersView;
+
+/*
+ *
+ * https://community.jboss.org/wiki/SmokeTestJBToolsServerSupport?prevContai...
+ *
+1) Open recent JBoss Tools
+2) open servers view (window -> show view -> other -> Servers)
+3) create new server
+ - type: JBoss Community -> JBoss AS 6.0
+ - use default configuration
+ - finish wizard
+4) double-click server in servers view to open the server editor
+5) in editor, verify all server ports are accurate (JNDI / Web / JMX RMI) (right side of editor)
+6) click "open launch configuration" in the editor, verify launch configuration arguments and vm args match with what is expected
+ a) *** If there are any new arguments that have changed since the previous AS version, MAKE SURE the launch configuration HAS them!
+7) In servers view, expand the server and look at XML Configuration/Ports, verify all labels have a number next to them
+9) Create a project (seam or dynamic web is fine, seam project is better)
+10) Deploy it to the server, Verify the deployment works
+11) remove deployment, verify console shows deployment removed
+12) Open MBean Viewer,
+ a) note that the server can now be expanded,
+ b) under it are mbeans. browse down to jboss.deployment -> URL ->DeploymentScanner,
+ c) double-click DeploymentScanner, go to "Operations" page, click "stop" in viewer, click "stop" button on the right,
+ d) verify operation completes successfully
+13) in eclipse, deploy seam application again, verify console shows NO OUTPUT, deployment does NOT deploy
+14) use mbean viewer / editor to execute start() operation on DeploymentScaner
+15) verify console now accepts deployment
+ */
+
+@Require(server=(a)Server(type=ServerType.EAP,state=ServerState.Running))
+public class SimpleEAPTest extends EAPExampleTest {
+
+ public static String baseDir = "/opt/local/EAP6_ER3";
+
+ @Override
+ public String getExampleName() {
+ return "Helloworld";
+ }
+ @Override
+ public String[] getProjectNames() {
+ return new String[] {"jboss-as-helloworld", "jboss-as-helloworld"};
+ }
+ @Override
+ protected void executeExample() {
+
+ // 1) Open recent JBoss Tools
+ // 2) open servers view (window -> show view -> other -> Servers)
+ // 3) create new server
+ // - type: JBoss Community -> JBoss AS 6.0
+ // - use default configuration
+ // - finish wizard
+ // 8) Start server, verify when server is up and running, the servers view says "Started" and not "Starting"
+
+ // 4) double-click server in servers view to open the server editor
+ SWTBotView theSWTBotView = open.viewOpen(ServerServers.LABEL);
+ SWTBotTree serverTree = bot.tree(0);
+ ServersView theServerView = new ServersView();
+ SWTBotTreeItem theServer = theServerView.findServerByName(serverTree, "EAP-6.0");
+ //System.out.println ("*** the server = " + theServer.getText());
+ assertTrue("Found the EAP 6.0 server - and the name is correct: ", theServer.getText().equals("EAP-6.0 [Started, Synchronized]"));
+
+ // 5) in editor, verify all server ports are accurate (JNDI / Web / JMX RMI) (right side of editor)
+ theServer.doubleClick();
+ assertTrue("The web port is 8080 ", bot.textWithLabel("Web").getText().equals("8080"));
+ assertTrue("The management port is 9999 ", bot.textWithLabel("Management").getText().equals("9999"));
+
+ //6) click "open launch configuration" in the editor, verify launch configuration arguments and vm args match with what is expected
+ // a) *** If there are any new arguments that have changed since the previous AS version, MAKE SURE the launch configuration HAS them!
+ bot.hyperlink("Open launch configuration").click();
+
+ bot.sleep(3000l);
+ //System.out.println (bot.textInGroup("Program &arguments:").getText() );
+ assertTrue ("The Program arguments match ",
+ bot.textInGroup("Program &arguments:").getText().equals("-mp \"" + baseDir + "/jboss-eap-6.0/modules\" -jaxpmodule javax.xml.jaxp-provider " +
+ "org.jboss.as.standalone -b localhost --server-config=standalone.xml "));
+
+ //System.out.println (bot.textInGroup("VM ar&guments:").getText() );
+ // Need to convert these to a hash
+ assertTrue ("The VM arguments match ",
+ bot.textInGroup("VM ar&guments:").getText().equals("-server -Xms64m -Xmx512m -XX:MaxPermSize=256m " +
+ "-Djava.net.preferIPv4Stack=true " +
+ "-Dorg.jboss.resolver.warning=true " +
+ "-Dsun.rmi.dgc.client.gcInterval=3600000 " +
+ "-Dsun.rmi.dgc.server.gcInterval=3600000 " +
+ "-Djboss.modules.system.pkgs=org.jboss.byteman " +
+ "-Djava.awt.headless=true " +
+ "\"-Dorg.jboss.boot.log.file=" + baseDir + "/jboss-eap-6.0/standalone/log/boot.log\" " +
+ "\"-Dlogging.configuration=file:" + baseDir + "/jboss-eap-6.0/standalone/configuration/logging.properties\" " +
+ "\"-Djboss.home.dir=" + baseDir + "/jboss-eap-6.0\" "));
+
+ //org.jboss.tools.ui.bot.ext.SWTUtilExt.displayAllBotWidgets(bot);
+
+// 7) In servers view, expand the server and look at XML Configuration/Ports, verify all labels have a number next to them
+// 9) Create a project (seam or dynamic web is fine, seam project is better)
+// 10) Deploy it to the server, Verify the deployment works
+// 11) remove deployment, verify console shows deployment removed
+// 12) Open MBean Viewer,
+// a) note that the server can now be expanded,
+// b) under it are mbeans. browse down to jboss.deployment -> URL ->DeploymentScanner,
+// c) double-click DeploymentScanner, go to "Operations" page, click "stop" in viewer, click "stop" button on the right,
+// d) verify operation completes successfully
+// 13) in eclipse, deploy seam application again, verify console shows NO OUTPUT, deployment does NOT deploy
+// 14) use mbean viewer / editor to execute start() operation on DeploymentScaner
+// 15) verify console now accepts deployment
+
+ bot.sleep(60000l);
+ System.out.println("***End");
+
+ SWTTestExt.servers.removeAllProjectsFromServer();
+ // 16) stop server, verify server shuts down properly without error.
+ }
+}
12 years, 8 months
JBoss Tools SVN: r39950 - in trunk/maven: features/org.jboss.tools.maven.gwt.feature and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-03-30 21:41:48 -0400 (Fri, 30 Mar 2012)
New Revision: 39950
Added:
trunk/maven/features/org.jboss.tools.maven.gwt.feature/
trunk/maven/features/org.jboss.tools.maven.gwt.feature/.project
trunk/maven/features/org.jboss.tools.maven.gwt.feature/build.properties
trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.properties
trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.gwt.feature/license.html
trunk/maven/features/org.jboss.tools.maven.gwt.feature/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.gwt/
trunk/maven/plugins/org.jboss.tools.maven.gwt/.classpath
trunk/maven/plugins/org.jboss.tools.maven.gwt/.project
trunk/maven/plugins/org.jboss.tools.maven.gwt/META-INF/
trunk/maven/plugins/org.jboss.tools.maven.gwt/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.gwt/about.html
trunk/maven/plugins/org.jboss.tools.maven.gwt/about.mappings
trunk/maven/plugins/org.jboss.tools.maven.gwt/about.properties
trunk/maven/plugins/org.jboss.tools.maven.gwt/build.properties
trunk/maven/plugins/org.jboss.tools.maven.gwt/lifecycle-mapping-metadata.xml
trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.gwt/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/MavenGWTPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-11244 Auto-discover all the modules and add them to the configuration on GWT project import
added feature and plugin for GWT configurator
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/.project
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/.project (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/.project 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.gwt.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/build.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/build.properties (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/build.properties 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.properties (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.properties 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,54 @@
+###############################################################################
+# Copyright (c) 2010-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are 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:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Maven GWT Configurator
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=JBoss Maven GWT Configurator
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2010-2012 Red Hat, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials \
+are 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\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.xml (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/feature.xml 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.maven.gwt.feature"
+ label="%featureName"
+ version="1.3.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.maven.gwt">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.m2e.feature" version="0.13.0" match="greaterOrEqual"/>
+ <import feature="org.maven.ide.eclipse.wtp.feature" version="0.13.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.maven.gwt"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/license.html
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/license.html (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/license.html 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/maven/features/org.jboss.tools.maven.gwt.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.gwt.feature/pom.xml (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.gwt.feature/pom.xml 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>features</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.features</groupId>
+ <artifactId>org.jboss.tools.maven.gwt.feature</artifactId>
+
+ <packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <version>${tychoExtrasVersion}</version>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/.classpath
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/.classpath (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/.classpath 2012-03-31 01:41:48 UTC (rev 39950)
@@ -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/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/.project
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/.project (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/.project 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.gwt</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/maven/plugins/org.jboss.tools.maven.gwt/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/META-INF/MANIFEST.MF (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/META-INF/MANIFEST.MF 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.gwt;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.gwt.MavenGWTPlugin
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.m2e.core;bundle-version="1.0.200",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ com.google.gwt.eclipse.core;bundle-version="2.5.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ com.google.gdt.eclipse.maven.e37;bundle-version="2.5.2",
+ org.slf4j.api;bundle-version="1.6.0",
+ org.eclipse.m2e.maven.runtime;bundle-version="[1.0.0,1.1.0)",
+ org.eclipse.jface;bundle-version="3.7.0",
+ org.jboss.tools.maven.ui;bundle-version="1.3.0",
+ org.eclipse.ui;bundle-version="3.7.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.tools.maven.gwt
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/about.html
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/about.html (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/about.html 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!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">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Maven GWT Configurator</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Maven GWT Configurator</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/about.mappings
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/about.mappings (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/about.mappings 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/about.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/about.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/about.properties 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,2 @@
+blurb=JBoss Maven CDI Configurator\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2012. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/build.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/build.properties 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ lifecycle-mapping-metadata.xml
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/lifecycle-mapping-metadata.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/lifecycle-mapping-metadata.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/lifecycle-mapping-metadata.xml 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <versionRange>[2.3.0,)</versionRange>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <configurator>
+ <id>org.jboss.tools.maven.gwt.configurator.entry.point.modules</id>
+ </configurator>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+</lifecycleMappingMetadata>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.properties 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,3 @@
+Bundle-Vendor = JBoss by Red Hat
+Bundle-Name = JBoss Maven GWT Configurator
+GWT-Configurator-Name = GWT Configurator
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/plugin.xml 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappingMetadataSource">
+ </extension>
+ <extension
+ point="org.eclipse.m2e.core.projectConfigurators">
+ <configurator
+ class="org.jboss.tools.maven.gwt.GWTProjectConfigurator"
+ id="org.jboss.tools.maven.gwt.configurator.entry.point.modules"
+ name="%GWT-Configurator-Name">
+ </configurator>
+ </extension>
+</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/pom.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/pom.xml 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.plugins</groupId>
+ <artifactId>org.jboss.tools.maven.gwt</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,58 @@
+package org.jboss.tools.maven.gwt;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.MojoExecution;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+import org.jboss.tools.maven.ui.Activator;
+import org.osgi.service.prefs.BackingStoreException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gwt.eclipse.core.modules.IModule;
+import com.google.gwt.eclipse.core.modules.ModuleUtils;
+import com.google.gwt.eclipse.core.properties.GWTProjectProperties;
+
+public class GWTProjectConfigurator extends AbstractProjectConfigurator {
+
+ private static final Logger log = LoggerFactory.getLogger(AbstractProjectConfigurator.class);
+
+ public static final String CODEHAUS_GROUP_ID = "org.codehaus.mojo";
+ public static final String GWT_MAVEN_PLUGIN_ARTIFACT_ID = "gwt-maven-plugin";
+
+ @Override
+ public void configure(ProjectConfigurationRequest arg0, IProgressMonitor arg1) throws CoreException {
+
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ boolean configureGWT = store.getBoolean(Activator.CONFIGURE_GWT);
+ log.debug("GWT Entry Point Modules configuration is {}",configureGWT ? "enabled" : "disabled");
+ if(configureGWT) {
+ List<Plugin> plugins = arg0.getMavenProjectFacade().getMavenProject().getBuildPlugins();
+ for (Plugin plugin : plugins) {
+ if(CODEHAUS_GROUP_ID.equals(plugin.getGroupId()) && GWT_MAVEN_PLUGIN_ARTIFACT_ID.equals(plugin.getArtifactId())) {
+ log.debug("Configure Entry Point Modules for GWT Project {}", arg0.getProject().getName());
+ IModule[] modules = ModuleUtils.findAllModules(JavaCore.create(arg0.getProject()),false);
+ List<String> modNames = new ArrayList<String>();
+ for (IModule iModule : modules) {
+ modNames.add(iModule.getQualifiedName());
+ log.debug("\t {}",iModule.getQualifiedName());
+ }
+ try {
+ GWTProjectProperties.setEntryPointModules(arg0.getProject(), modNames);
+ } catch (BackingStoreException e) {
+ log.error("Ecseption in Maven GWT Configurator", e);
+ }
+ break;
+ }
+ }
+ }
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/MavenGWTPlugin.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/MavenGWTPlugin.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/MavenGWTPlugin.java 2012-03-31 01:41:48 UTC (rev 39950)
@@ -0,0 +1,30 @@
+package org.jboss.tools.maven.gwt;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class MavenGWTPlugin 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 {
+ MavenGWTPlugin.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ MavenGWTPlugin.context = null;
+ }
+
+}
12 years, 8 months
JBoss Tools SVN: r39949 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-03-30 18:16:19 -0400 (Fri, 30 Mar 2012)
New Revision: 39949
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java
Log:
JBIDE-10702 Editor for JCR Compact Node Definition (CND) files. Work on path property validation. Also did some preparatory work on node type definition business objects that will allow keeping properties, child nodes, comments, and vendor blocks in the order they were parsed.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java 2012-03-30 18:35:02 UTC (rev 39948)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java 2012-03-30 22:16:19 UTC (rev 39949)
@@ -89,9 +89,14 @@
private final NodeTypeAttributes attributes;
/**
- * The collection of child node definitions (can be <code>null</code>).
+ * The collection of CND elements (can be <code>null</code>).
*/
- private List<ChildNodeDefinition> childNodesDefinitions;
+ private List<CndElement> cndElements;
+ //
+ // /**
+ // * The collection of child node definitions (can be <code>null</code>).
+ // */
+ // private List<ChildNodeDefinition> childNodesDefinitions;
/**
* The collection of property change listeners (never <code>null</code>).
@@ -102,13 +107,13 @@
* The node type name (never <code>null</code> but can have a <code>null</code> or empty value).
*/
private final QualifiedName name;
+ //
+ // /**
+ // * The collection of property definitions (can be <code>null</code>).
+ // */
+ // private List<PropertyDefinition> propertyDefinitions;
/**
- * The collection of property definitions (can be <code>null</code>).
- */
- private List<PropertyDefinition> propertyDefinitions;
-
- /**
* The super types (never <code>null</code>).
*/
private final SuperTypes superTypes;
@@ -132,11 +137,11 @@
public boolean addChildNodeDefinition( final ChildNodeDefinition childNodeDefinitionBeingAdded ) {
Utils.verifyIsNotNull(childNodeDefinitionBeingAdded, "childNodeDefinitionBeingAdded"); //$NON-NLS-1$
- if (this.childNodesDefinitions == null) {
- this.childNodesDefinitions = new ArrayList<ChildNodeDefinition>();
+ if (this.cndElements == null) {
+ this.cndElements = new ArrayList<CndElement>();
}
- if (this.childNodesDefinitions.add(childNodeDefinitionBeingAdded)) {
+ if (this.cndElements.add(childNodeDefinitionBeingAdded)) {
notifyChangeListeners(PropertyName.CHILD_NODES, null, childNodeDefinitionBeingAdded);
return true; // added
}
@@ -162,11 +167,11 @@
public boolean addPropertyDefinition( final PropertyDefinition properyDefinitionBeingAdded ) {
Utils.verifyIsNotNull(properyDefinitionBeingAdded, "properyDefinitionBeingAdded"); //$NON-NLS-1$
- if (this.propertyDefinitions == null) {
- this.propertyDefinitions = new ArrayList<PropertyDefinition>();
+ if (this.cndElements == null) {
+ this.cndElements = new ArrayList<CndElement>();
}
- if (this.propertyDefinitions.add(properyDefinitionBeingAdded)) {
+ if (this.cndElements.add(properyDefinitionBeingAdded)) {
notifyChangeListeners(PropertyName.PROPERTY_DEFINITIONS, null, properyDefinitionBeingAdded);
return true; // added
}
@@ -237,64 +242,6 @@
}
/**
- * If cleared, a property change event is broadcast to all registered listeners.
- *
- * @return <code>true</code> if there was at least one child node before clearing
- */
- public boolean clearChildNodeDefinitions() {
- if (this.childNodesDefinitions == null) {
- return false; // nothing to clear
- }
-
- final List<ChildNodeDefinition> childNodes = new ArrayList<ChildNodeDefinition>(getChildNodeDefinitions());
- final boolean cleared = !this.childNodesDefinitions.isEmpty();
- this.childNodesDefinitions = null;
-
- if (cleared) {
- notifyChangeListeners(PropertyName.CHILD_NODES, childNodes, null);
- }
-
- return cleared;
- }
-
- /**
- * If cleared, a property change event is broadcast to all registered listeners.
- *
- * @return <code>true</code> if there was at least one property definition before clearing
- */
- public boolean clearPropertyDefinitions() {
- if (this.propertyDefinitions == null) {
- return false; // nothing to clear
- }
-
- final List<PropertyDefinition> propDefns = new ArrayList<PropertyDefinition>(getPropertyDefinitions());
- final boolean cleared = !this.propertyDefinitions.isEmpty();
- this.propertyDefinitions = null;
-
- if (cleared) {
- notifyChangeListeners(PropertyName.PROPERTY_DEFINITIONS, propDefns, null);
- }
-
- return cleared;
- }
-
- /**
- * If cleared, a property change event is broadcast to all registered listeners.
- *
- * @return <code>true</code> if there was at least one super type before clearing
- */
- public boolean clearSuperTypes() {
- final List<QualifiedName> types = new ArrayList<QualifiedName>(this.superTypes.getSupportedItems());
-
- if (this.superTypes.clear()) {
- notifyChangeListeners(PropertyName.SUPERTYPES, types, null);
- return true;
- }
-
- return false;
- }
-
- /**
* {@inheritDoc}
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
@@ -379,19 +326,23 @@
return true;
}
- private String getChildNodeDefinitionDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.CHILD_NODE_DEFINITION_DELIMITER);
- }
-
/**
* @return the child node definitions (never <code>null</code>)
*/
public List<ChildNodeDefinition> getChildNodeDefinitions() {
- if (this.childNodesDefinitions == null) {
+ if (this.cndElements == null) {
return Collections.emptyList();
}
- return this.childNodesDefinitions;
+ final List<ChildNodeDefinition> childNodeDefinitions = new ArrayList<ChildNodeDefinition>();
+
+ for (final CndElement element : this.cndElements) {
+ if (element instanceof ChildNodeDefinition) {
+ childNodeDefinitions.add((ChildNodeDefinition)element);
+ }
+ }
+
+ return childNodeDefinitions;
}
/**
@@ -426,35 +377,32 @@
return this.superTypes.toArray();
}
- private String getEndAttributesDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER);
- }
+ private List<CndElement> getElements() {
+ if (this.cndElements == null) {
+ return Collections.emptyList();
+ }
- private String getEndChildNodeDefinitionsDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.CHILD_NODE_DEFINITION_SECTION_END_DELIMITER);
+ return this.cndElements;
}
- private String getEndNameDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER);
- }
-
- private String getEndPropertyDefinitionsDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.PROPERTY_DEFINITION_SECTION_END_DELIMITER);
- }
-
- private String getEndSuperTypesDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.SUPER_TYPES_END_DELIMITER);
- }
-
/**
* @return the child node definitions and property definitions contained in this node type definition (never <code>null</code>
* but can be empty)
*/
public List<ItemDefinition> getItemDefinitions() {
- // TODO this needs to be a field and getters for items need to filter this field appropriately
- final List<ItemDefinition> currentItems = new ArrayList<ItemDefinition>(getChildNodeDefinitions());
- currentItems.addAll(getPropertyDefinitions());
- return currentItems;
+ if (this.cndElements == null) {
+ return Collections.emptyList();
+ }
+
+ final List<ItemDefinition> itemDefinitions = new ArrayList<ItemDefinition>();
+
+ for (final CndElement element : this.cndElements) {
+ if (element instanceof ItemDefinition) {
+ itemDefinitions.add((ItemDefinition)element);
+ }
+ }
+
+ return itemDefinitions;
}
/**
@@ -501,23 +449,23 @@
return primaryItem;
}
- private String getPropertyDefinitionDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.PROPERTY_DEFINITION_DELIMITER);
- }
-
/**
* @return the property definitions (never <code>null</code>)
*/
public List<PropertyDefinition> getPropertyDefinitions() {
- if (this.propertyDefinitions == null) {
+ if (this.cndElements == null) {
return Collections.emptyList();
}
- return this.propertyDefinitions;
- }
+ final List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>();
- private String getPropertyDefinitionStartDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.PROPERTY_DEFINITION_START_DELIMITER);
+ for (final CndElement element : this.cndElements) {
+ if (element instanceof PropertyDefinition) {
+ propertyDefinitions.add((PropertyDefinition)element);
+ }
+ }
+
+ return propertyDefinitions;
}
/**
@@ -537,10 +485,6 @@
return this.name;
}
- private String getStartChildNodeDefinitionDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.CHILD_NODE_DEFINITION_START_DELIMITER);
- }
-
/**
* Can be used to find the attribute state of the abstract, mixin, orderable, primary item, queryable, and super types
* properties.
@@ -677,16 +621,17 @@
*/
public boolean removeChildNodeDefinition( final ChildNodeDefinition childNodeDefinitionBeingRemoved ) {
Utils.verifyIsNotNull(childNodeDefinitionBeingRemoved, "childNodeDefinitionBeingRemoved"); //$NON-NLS-1$
+ final List<ChildNodeDefinition> childNodeDefinitions = getChildNodeDefinitions();
- if (this.childNodesDefinitions == null) {
+ if (childNodeDefinitions.isEmpty()) {
return false;
}
- if (this.childNodesDefinitions.remove(childNodeDefinitionBeingRemoved)) {
+ if (this.cndElements.remove(childNodeDefinitionBeingRemoved)) {
notifyChangeListeners(PropertyName.CHILD_NODES, childNodeDefinitionBeingRemoved, null);
- if (this.childNodesDefinitions.isEmpty()) {
- this.childNodesDefinitions = null;
+ if (this.cndElements.isEmpty()) {
+ this.cndElements = null;
}
return true; // removed
@@ -712,16 +657,17 @@
*/
public boolean removePropertyDefinition( final PropertyDefinition propertyDefinitionBeingRemoved ) {
Utils.verifyIsNotNull(propertyDefinitionBeingRemoved, "propertyDefinitionBeingRemoved"); //$NON-NLS-1$
+ final List<PropertyDefinition> propertyDefinitions = getPropertyDefinitions();
- if (this.propertyDefinitions == null) {
+ if (propertyDefinitions.isEmpty()) {
return false;
}
- if (this.propertyDefinitions.remove(propertyDefinitionBeingRemoved)) {
+ if (this.cndElements.remove(propertyDefinitionBeingRemoved)) {
notifyChangeListeners(PropertyName.PROPERTY_DEFINITIONS, propertyDefinitionBeingRemoved, null);
- if (this.propertyDefinitions.isEmpty()) {
- this.propertyDefinitions = null;
+ if (this.cndElements.isEmpty()) {
+ this.cndElements = null;
}
return true; // removed
@@ -853,14 +799,15 @@
builder.append(NAME_NOTATION_PREFIX)
.append(this.name.toCndNotation(notationType))
.append(NAME_NOTATION_SUFFIX)
- .append(getEndNameDelimiter());
+ .append(CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER));
}
{ // super types
final String notation = this.superTypes.toCndNotation(notationType);
if (!Utils.isEmpty(notation)) {
- builder.append(notation).append(getEndSuperTypesDelimiter());
+ builder.append(notation)
+ .append(CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.SUPER_TYPES_END_DELIMITER));
}
}
@@ -871,30 +818,22 @@
builder.append(notation);
}
- builder.append(getEndAttributesDelimiter());
+ builder.append(CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER));
}
- { // property definitions
- if (!Utils.isEmpty(this.propertyDefinitions)) {
- for (final PropertyDefinition propDefn : this.propertyDefinitions) {
- builder.append(getPropertyDefinitionStartDelimiter());
- builder.append(propDefn.toCndNotation(notationType));
- builder.append(getPropertyDefinitionDelimiter());
- }
+ { // elements
+ final String elementStartDelimiter = CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ELEMENTS_START_DELIMITER);
+ final String elementDelimiter = CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ELEMENT_DELIMITER);
+ final List<CndElement> elements = getElements();
- builder.append(getEndPropertyDefinitionsDelimiter());
- }
- }
-
- { // child node definitions
- if (!Utils.isEmpty(this.childNodesDefinitions)) {
- for (final ChildNodeDefinition childNodeDefn : this.childNodesDefinitions) {
- builder.append(getStartChildNodeDefinitionDelimiter());
- builder.append(childNodeDefn.toCndNotation(notationType));
- builder.append(getChildNodeDefinitionDelimiter());
+ if (!Utils.isEmpty(elements)) {
+ for (final CndElement element : elements) {
+ builder.append(elementStartDelimiter);
+ builder.append(element.toCndNotation(notationType));
+ builder.append(elementDelimiter);
}
- builder.append(getEndChildNodeDefinitionsDelimiter());
+ builder.append(CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ELEMENTS_END_DELIMITER));
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java 2012-03-30 18:35:02 UTC (rev 39948)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java 2012-03-30 22:16:19 UTC (rev 39949)
@@ -70,16 +70,16 @@
map.put(Preference.ATTRIBUTE_LIST_ELEMENT_DELIMITER, ", "); //$NON-NLS-1$
map.put(Preference.ATTRIBUTE_LIST_ITEM_QUOTE_CHAR, Utils.EMPTY_STRING);
- map.put(Preference.CHILD_NODE_DEFINITION_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.CHILD_NODE_DEFINITION_END_PREFIX_DELIMITER, " "); //$NON-NLS-1$
map.put(Preference.CHILD_NODE_PROPERTY_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.DEFAULT_VALUES_END_PREFIX_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.DEFAULT_VALUES_QUOTE_CHARACTER, "'"); //$NON-NLS-1$
map.put(Preference.DEFAULT_TYPE_END_PREFIX_DELIMITER, Utils.SPACE_STRING);
- map.put(Preference.CHILD_NODE_DEFINITION_SECTION_END_DELIMITER, Utils.EMPTY_STRING);
- map.put(Preference.CHILD_NODE_DEFINITION_START_DELIMITER, "\t"); //$NON-NLS-1$
map.put(Preference.ATTRIBUTE_LIST_PREFIX_END_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.ATTRIBUTE_LIST_QUOTE_CHAR, Utils.EMPTY_STRING);
+ map.put(Preference.ELEMENT_DELIMITER, "\n"); //$NON-NLS-1$
+ map.put(Preference.ELEMENTS_END_DELIMITER, Utils.EMPTY_STRING);
+ map.put(Preference.ELEMENTS_START_DELIMITER, "\t"); //$NON-NLS-1$
map.put(Preference.NAMESPACE_MAPPING_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.NAMESPACE_MAPPING_SECTION_END_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.CHILD_NODE_ATTRIBUTES_DELIMITER, Utils.SPACE_STRING);
@@ -89,10 +89,7 @@
map.put(Preference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.NODE_TYPE_DEFINITION_SECTION_END_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.PROPERTY_DEFINITION_ATTRIBUTES_DELIMITER, Utils.SPACE_STRING);
- map.put(Preference.PROPERTY_DEFINITION_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.PROPERTY_DEFINITION_END_PREFIX_DELIMITER, Utils.SPACE_STRING);
- map.put(Preference.PROPERTY_DEFINITION_SECTION_END_DELIMITER, Utils.EMPTY_STRING);
- map.put(Preference.PROPERTY_DEFINITION_START_DELIMITER, "\t"); //$NON-NLS-1$
map.put(Preference.REQUIRED_TYPES_END_PREFIX_DELIMITER, Utils.EMPTY_STRING);
map.put(Preference.SUPER_TYPES_END_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.VALUE_CONSTRAINTS_ITEM_QUOTE_CHARACTER, "'"); //$NON-NLS-1$
@@ -130,26 +127,11 @@
CHILD_NODE_ATTRIBUTES_DELIMITER,
/**
- * The delimiter between child node definitions.
- */
- CHILD_NODE_DEFINITION_DELIMITER,
-
- /**
* The delimiter after the plus sign and before the child node definition name.
*/
CHILD_NODE_DEFINITION_END_PREFIX_DELIMITER,
/**
- * The delimiter after the last child node definition.
- */
- CHILD_NODE_DEFINITION_SECTION_END_DELIMITER,
-
- /**
- * The delimiter before a child node definition.
- */
- CHILD_NODE_DEFINITION_START_DELIMITER,
-
- /**
* The delimiter between child node properties.
*/
CHILD_NODE_PROPERTY_DELIMITER,
@@ -171,6 +153,21 @@
DEFAULT_VALUES_QUOTE_CHARACTER,
/**
+ * The delimiter between CND elements.
+ */
+ ELEMENT_DELIMITER,
+
+ /**
+ * The delimiter after the last CND element.
+ */
+ ELEMENTS_END_DELIMITER,
+
+ /**
+ * The delimiter before the first CND element.
+ */
+ ELEMENTS_START_DELIMITER,
+
+ /**
* The delimiter between namespace mappings.
*/
NAMESPACE_MAPPING_DELIMITER,
@@ -181,14 +178,14 @@
NAMESPACE_MAPPING_SECTION_END_DELIMITER,
/**
- * The delimiter after all the node type definition attributes.
+ * The delimiter between node type definition attributes.
*/
- NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER,
+ NODE_TYPE_DEFINITION_ATTRIBUTES_DELIMITER,
/**
- * The delimiter between node type definition attributes.
+ * The delimiter after all the node type definition attributes.
*/
- NODE_TYPE_DEFINITION_ATTRIBUTES_DELIMITER,
+ NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER,
/**
* The delimiter between node type definitions.
@@ -211,26 +208,11 @@
PROPERTY_DEFINITION_ATTRIBUTES_DELIMITER,
/**
- * The delimiter between property definitions.
- */
- PROPERTY_DEFINITION_DELIMITER,
-
- /**
* The delimiter after the dash and before the property definition name.
*/
PROPERTY_DEFINITION_END_PREFIX_DELIMITER,
/**
- * The delimiter after the last property definition.
- */
- PROPERTY_DEFINITION_SECTION_END_DELIMITER,
-
- /**
- * The delimiter before a property definition.
- */
- PROPERTY_DEFINITION_START_DELIMITER,
-
- /**
* The delimiter after the open paren and before the required types.
*/
REQUIRED_TYPES_END_PREFIX_DELIMITER,
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java 2012-03-30 18:35:02 UTC (rev 39948)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java 2012-03-30 22:16:19 UTC (rev 39949)
@@ -12,6 +12,7 @@
import java.sql.Date;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.StringTokenizer;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.jcr.ChildNodeDefinition;
@@ -33,6 +34,9 @@
*/
public final class CndValidator {
+ private static final String PARENT_PATH_SEGMENT = ".."; //$NON-NLS-1$
+ private static final String SELF_PATH_SEGMENT = "."; //$NON-NLS-1$
+
/**
* @param value the value being checked (can be <code>null</code> or empty)
* @param propertyType the property type of the property definition the value is for (cannot be <code>null</code>)
@@ -95,7 +99,7 @@
} else if (PropertyType.NAME == propertyType) {
return validateLocalName(value, propertyName);
} else if (PropertyType.PATH == propertyType) {
- // TODO implement PATH validation
+ return validatePath(value, propertyName);
} else if (PropertyType.REFERENCE == propertyType) {
return ValidationStatus.OK_STATUS; // always valid
} else if (PropertyType.UNDEFINED == propertyType) {
@@ -432,7 +436,7 @@
}
// ERROR Local name cannot be self or parent
- if (localName.equals(".") || localName.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (localName.equals(SELF_PATH_SEGMENT) || localName.equals(PARENT_PATH_SEGMENT)) {
return ValidationStatus.createErrorMessage(NLS.bind(Messages.localNameEqualToSelfOrParent, messagePrefix));
}
@@ -920,6 +924,105 @@
}
/**
+ * @param path the path value being validated (can be <code>null</code> or empty)
+ * @param propertyName the property name whose path value is being validated (cannot be <code>null</code> or empty)
+ * @return the validation status (never <code>null</code>)
+ */
+ public static ValidationStatus validatePath( String path,
+ String propertyName ) {
+ Utils.verifyIsNotNull(propertyName, "propertyName"); //$NON-NLS-1$
+
+ if (Utils.isEmpty(propertyName)) {
+ propertyName = Messages.missingName;
+ }
+
+ if (Utils.isEmpty(path)) {
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.emptyValue, propertyName));
+ }
+
+ StringTokenizer pathTokenizer = new StringTokenizer(path, "/"); //$NON-NLS-1$
+
+ if (pathTokenizer.hasMoreTokens()) {
+ while (pathTokenizer.hasMoreElements()) {
+ String segment = pathTokenizer.nextToken();
+
+ if (Utils.isEmpty(segment)) {
+ if (pathTokenizer.hasMoreTokens()) {
+ // found empty segment
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.invalidPropertyValueForType, path,
+ PropertyType.PATH));
+ }
+ } else {
+ StringTokenizer segmentTokenizer = new StringTokenizer(segment, "[]"); //$NON-NLS-1$
+
+ if (segmentTokenizer.countTokens() == 2) {
+ // has SNS index
+ String qualifiedName = segmentTokenizer.nextToken();
+
+ if (Utils.isEmpty(qualifiedName)) {
+ // found SNS but now qualified name
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.invalidPropertyValueForType, path,
+ PropertyType.PATH));
+ }
+
+ // OK if segment is self or parent
+ if (PARENT_PATH_SEGMENT.equals(qualifiedName) || SELF_PATH_SEGMENT.equals(qualifiedName)) {
+ continue;
+ }
+
+ // validate qualified name
+ QualifiedName qname = QualifiedName.parse(qualifiedName);
+ MultiValidationStatus status = validateQualifiedName(qname, propertyName, null, null);
+
+ // return if invalid qualified
+ if (status.isError()) {
+ return status;
+ }
+
+ // valid qualified name so check SNS index
+ if (segmentTokenizer.countTokens() == 1) {
+ String snsIndex = segmentTokenizer.nextToken();
+
+ // make sure SNS index is a number
+ for (char c : snsIndex.toCharArray()) {
+ if (!Character.isDigit(c)) {
+ // found invalid character
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.invalidPropertyValueForType, path,
+ PropertyType.PATH));
+ }
+ }
+ } else {
+ // no ending SNS bracket
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.invalidPropertyValueForType, path,
+ PropertyType.PATH));
+ }
+ } else {
+ // OK if segment is self or parent
+ if (PARENT_PATH_SEGMENT.equals(segment) || SELF_PATH_SEGMENT.equals(segment)) {
+ continue;
+ }
+
+ // no SNS index
+ QualifiedName qname = QualifiedName.parse(segment);
+ MultiValidationStatus status = validateQualifiedName(qname, propertyName, null, null);
+
+ // return if invalid segment
+ if (status.isError()) {
+ return status;
+ }
+ }
+ }
+ }
+ } else {
+ // only one segment
+ QualifiedName qname = QualifiedName.parse(path);
+ return validateQualifiedName(qname, propertyName, null, null);
+ }
+
+ return ValidationStatus.OK_STATUS;
+ }
+
+ /**
* @param propertyDefinition the property definition being validated (never <code>null</code>)
* @param validNamespacePrefixes the valid namespace prefixes (can be <code>null</code> or empty)
* @param existingPropertyNames the existing property names used to check for a duplicate (can be <code>null</code> or empty)
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java 2012-03-30 18:35:02 UTC (rev 39948)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java 2012-03-30 22:16:19 UTC (rev 39949)
@@ -7,6 +7,7 @@
*/
package org.jboss.tools.modeshape.jcr.cnd;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.jboss.tools.modeshape.jcr.ChildNodeDefinition;
@@ -393,4 +394,24 @@
this.nodeTypeDefinition.getState(NodeTypeDefinition.PropertyName.SUPERTYPES),
this.nodeTypeDefinition.getSupertypes()).isError());
}
+
+ @Test
+ public void shouldValidatePathsWithNoErrors() {
+ final String PROP_NAME = "testProperty"; //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/B/C[1]/D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/B/C[1]/../../D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/B/C[1]/././D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/B/C[1]/../D[2]/./E/..", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/../../../B", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("../../B", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("A/./../../B/.", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/.", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath(".", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/A", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/A/B/C[1]/D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/A/B/C[1]/../../D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/A/B/C[1]/././D[2]", PROP_NAME).isError()); //$NON-NLS-1$
+ assertFalse(CndValidator.validatePath("/A/B/C[1]/../D[2]/./E/..", PROP_NAME).isError()); //$NON-NLS-1$
+ }
}
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java 2012-03-30 18:35:02 UTC (rev 39948)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java 2012-03-30 22:16:19 UTC (rev 39949)
@@ -12,15 +12,11 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.util.Collection;
-import java.util.Collections;
-
import org.jboss.tools.modeshape.jcr.ChildNodeDefinition;
import org.jboss.tools.modeshape.jcr.Listener;
import org.jboss.tools.modeshape.jcr.NodeTypeDefinition;
import org.jboss.tools.modeshape.jcr.NodeTypeDefinition.PropertyName;
import org.jboss.tools.modeshape.jcr.PropertyDefinition;
-import org.jboss.tools.modeshape.jcr.QualifiedName;
import org.jboss.tools.modeshape.jcr.Utils;
import org.jboss.tools.modeshape.jcr.attributes.AttributeState.Value;
import org.junit.Before;
@@ -183,29 +179,6 @@
}
@Test
- public void shouldClearChildNodeDefinitions() {
- assertTrue(this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition));
- assertTrue(this.nodeTypeDefinition.clearChildNodeDefinitions());
- assertEquals(0, this.nodeTypeDefinition.getChildNodeDefinitions().size());
- assertEquals(0, this.nodeTypeDefinition.getDeclaredChildNodeDefinitions().length);
- }
-
- @Test
- public void shouldClearPropertyDefinitions() {
- assertTrue(this.nodeTypeDefinition.addPropertyDefinition(this.propertyDefinition));
- assertTrue(this.nodeTypeDefinition.clearPropertyDefinitions());
- assertEquals(0, this.nodeTypeDefinition.getPropertyDefinitions().size());
- assertEquals(0, this.nodeTypeDefinition.getDeclaredPropertyDefinitions().length);
- }
-
- @Test
- public void shouldClearSuperTypes() {
- assertTrue(this.nodeTypeDefinition.addSuperType("superType")); //$NON-NLS-1$
- assertTrue(this.nodeTypeDefinition.clearSuperTypes());
- assertEquals(0, this.nodeTypeDefinition.getDeclaredSupertypeNames().length);
- }
-
- @Test
public void shouldNotAllowDuplicateSuperType() {
final String SUPER_TYPE = "superType"; //$NON-NLS-1$
assertTrue(this.nodeTypeDefinition.addSuperType(SUPER_TYPE));
@@ -228,21 +201,6 @@
}
@Test
- public void shouldNotClearChildNodeDefinitionsWhenEmpty() {
- assertFalse(this.nodeTypeDefinition.clearChildNodeDefinitions());
- }
-
- @Test
- public void shouldNotClearPropertyDefinitionsWhenEmpty() {
- assertFalse(this.nodeTypeDefinition.clearPropertyDefinitions());
- }
-
- @Test
- public void shouldNotClearSuperTypesWhenEmpty() {
- assertFalse(this.nodeTypeDefinition.clearSuperTypes());
- }
-
- @Test
public void shouldNotHaveChildNodeDefinitionsAfterConstruction() {
assertEquals(0, this.nodeTypeDefinition.getChildNodeDefinitions().size());
}
@@ -357,52 +315,6 @@
}
@Test
- public void shouldReceiveEventAfterClearingChildNodeDefinitions() {
- assertTrue(this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition));
- final Collection<ChildNodeDefinition> oldValue = Collections.singletonList(this.childNodeDefinition);
-
- final Listener l = new Listener();
- assertTrue(this.nodeTypeDefinition.addListener(l));
-
- assertTrue(this.nodeTypeDefinition.clearChildNodeDefinitions());
- assertEquals(1, l.getCount());
- assertEquals(PropertyName.CHILD_NODES.toString(), l.getPropertyName());
- assertNull(l.getNewValue());
- assertEquals(oldValue, l.getOldValue());
- }
-
- @Test
- public void shouldReceiveEventAfterClearingPropertyDefinitions() {
- assertTrue(this.nodeTypeDefinition.addPropertyDefinition(this.propertyDefinition));
- final Collection<PropertyDefinition> oldValue = Collections.singletonList(this.propertyDefinition);
-
- final Listener l = new Listener();
- assertTrue(this.nodeTypeDefinition.addListener(l));
-
- assertTrue(this.nodeTypeDefinition.clearPropertyDefinitions());
- assertEquals(1, l.getCount());
- assertEquals(PropertyName.PROPERTY_DEFINITIONS.toString(), l.getPropertyName());
- assertNull(l.getNewValue());
- assertEquals(oldValue, l.getOldValue());
- }
-
- @Test
- public void shouldReceiveEventAfterClearingSuperTypes() {
- final String SUPER_TYPE = "superType"; //$NON-NLS-1$
- assertTrue(this.nodeTypeDefinition.addSuperType(SUPER_TYPE));
- final Collection<QualifiedName> oldValue = this.nodeTypeDefinition.getSupertypes();
-
- final Listener l = new Listener();
- assertTrue(this.nodeTypeDefinition.addListener(l));
-
- assertTrue(this.nodeTypeDefinition.clearSuperTypes());
- assertEquals(1, l.getCount());
- assertEquals(PropertyName.SUPERTYPES.toString(), l.getPropertyName());
- assertNull(l.getNewValue());
- assertEquals(oldValue, l.getOldValue());
- }
-
- @Test
public void shouldReceiveEventAfterRemovingChildNodeDefinition() {
assertTrue(this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition));
12 years, 8 months
JBoss Tools SVN: r39948 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-03-30 14:35:02 -0400 (Fri, 30 Mar 2012)
New Revision: 39948
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageLabelProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageSummaryDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageViewerSorter.java
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Abstract.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/AttributeState.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Autocreated.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultType.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultValues.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ListAttributeState.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mandatory.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mixin.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Multiple.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoFullText.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoQueryOrder.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeAttributes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeTypeAttributes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/OnParentVersion.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Orderable.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyType.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyValue.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Protected.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperators.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Queryable.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/RequiredTypes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SameNameSiblings.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SuperTypes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ValueConstraints.java
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndMessages.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/PropertyDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/QueryOperators.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/UiMessages.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/uiMessages.properties
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinitionTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributesTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperatorsTest.java
Log:
JBIDE-10702 Editor for JCR Compact Node Definition (CND) files. Work on query operators and a validation message dialog that is displayed when the editor header error message hyperlink is activated.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/PropertyDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/PropertyDefinition.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/PropertyDefinition.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -63,11 +63,8 @@
copy.attributes.getProtected().set(propertyBeingCopied.attributes.getProtected().get());
copy.attributes.setOnParentVersion(propertyBeingCopied.attributes.getOnParentVersion());
copy.attributes.getQueryOps().set(propertyBeingCopied.attributes.getQueryOps().get());
+ copy.setAvailableQueryOperators(propertyBeingCopied.getAvailableQueryOperators());
- for (final QueryOperator operator : propertyBeingCopied.attributes.getQueryOps().getSupportedItems()) {
- copy.attributes.getQueryOps().add(operator);
- }
-
// default values
copy.defaultValues.set(propertyBeingCopied.defaultValues.get());
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/QueryOperators.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/QueryOperators.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/QueryOperators.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -18,7 +18,7 @@
import org.jboss.tools.modeshape.jcr.cnd.CndElement;
/**
- * The primary item attribute used by property definitions.
+ * The query operators attribute used by property definitions. Initially a property supports all operators.
*/
public final class QueryOperators extends ListAttributeState<QueryOperator> {
@@ -28,6 +28,15 @@
public static final String[] NOTATION = new String[] { "queryops", "qop", "qop" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
/**
+ * Constructs a query operators attribute that supports all operators.
+ */
+ public QueryOperators() {
+ for (final QueryOperator operator : QueryOperator.values()) {
+ add(operator);
+ }
+ }
+
+ /**
* @param operator the operator notation (cannot be <code>null</code> or empty)
* @return <code>true</code> if added
* @throws IllegalArgumentException if an invalid operator notation
@@ -72,7 +81,27 @@
return super.hashCode();
}
+
+ /**
+ * @param operator the operator notation of the operator being removed (cannot be <code>null</code> or empty)
+ * @return <code>true</code> if removed
+ * @throws IllegalArgumentException if an invalid operator notation
+ */
+ public boolean remove( final String operator ) {
+ Utils.verifyIsNotEmpty(operator, "operator"); //$NON-NLS-1$
+ return remove(QueryOperator.find(operator));
+ }
+ private boolean supportsAll() {
+ for (QueryOperator operator : QueryOperator.values()) {
+ if (!supports(operator)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
/**
* @return a list of supported operator notations (never <code>null</code> but can be empty)
*/
@@ -94,6 +123,20 @@
}
/**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.jcr.attributes.ListAttributeState#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
+ */
+ @Override
+ public String toCndNotation( NotationType notationType ) {
+ if (supportsAll()) {
+ return Utils.EMPTY_STRING;
+ }
+
+ return super.toCndNotation(notationType);
+ }
+
+ /**
* The valid query operators.
*/
public enum QueryOperator implements CndElement {
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Abstract.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Abstract.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Abstract.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The abstract attribute used by node type definitions.
- */
-public class Abstract extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "abstract", "abs", "a" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/AttributeState.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/AttributeState.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/AttributeState.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,191 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * An attribute will have either a supported, unsupported, or variant state.
- */
-public abstract class AttributeState implements CndElement {
-
- /**
- * The character used in CND notation to indicate the attribute is a variant.
- */
- public static final char VARIANT_CHAR = '?';
-
- /**
- * The CND variant character as a string.
- *
- * @see #VARIANT_CHAR
- */
- public static final String VARIANT_STRING = Character.toString(VARIANT_CHAR);
-
- private Value state;
-
- /**
- * Constructs a not supported attribute state.
- *
- * @see Value#IS_NOT
- */
- public AttributeState() {
- this.state = Value.IS_NOT;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- final AttributeState that = (AttributeState)obj;
- return (this.state == that.state);
- }
-
- /**
- * @return the attribute state (never <code>null</code>)
- */
- public Value get() {
- return this.state;
- }
-
- /**
- * @return the attribute's compact CND notation (can be <code>null</code> or empty)
- */
- protected abstract String getCompactCndNotation();
-
- /**
- * @return the attribute's compressed CND notation (can be <code>null</code> or empty)
- */
- protected abstract String getCompressedCndNotation();
-
- /**
- * @return the attribute's long CND notation (can be <code>null</code> or empty)
- */
- protected abstract String getLongCndNotation();
-
- /**
- * @return <code>true</code> if the CND notation is not empty
- */
- protected boolean hasCndNotation() {
- return !isNot();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return this.state.hashCode();
- }
-
- /**
- * @return <code>true</code> if attribute state is {@link Value#IS}.
- */
- public boolean is() {
- return (this.state == Value.IS);
- }
-
- /**
- * @return <code>true</code> if attribute state is {@link Value#IS_NOT}.
- */
- public boolean isNot() {
- return (this.state == Value.IS_NOT);
- }
-
- /**
- * @return <code>true</code> if attribute state is {@link Value#VARIANT}.
- */
- public boolean isVariant() {
- return (this.state == Value.VARIANT);
- }
-
- /**
- * @param newState the proposed new state (cannot be <code>null</code>)
- * @return <code>true</code> if state was changed
- */
- public boolean set( final Value newState ) {
- Utils.verifyIsNotNull(newState, "newState"); //$NON-NLS-1$
-
- if (this.state != newState) {
- this.state = newState;
- return true;
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- if (hasCndNotation()) {
- String notation = Utils.EMPTY_STRING;
-
- if (NotationType.LONG == notationType) {
- notation = getLongCndNotation();
- } else if (NotationType.COMPRESSED == notationType) {
- notation = getCompressedCndNotation();
- } else if (NotationType.COMPACT == notationType) {
- notation = getCompactCndNotation();
- }
-
- if (isVariant()) {
- return toVariantCndNotation(notation);
- }
-
- return notation;
- }
-
- return Utils.EMPTY_STRING;
- }
-
- /**
- * @param cndNotation the CND notation without the variant indicator (can be <code>null</code> or empty)
- * @return the variant CND notation (never <code>null</code> or empty)
- */
- protected String toVariantCndNotation( final String cndNotation ) {
- if (Utils.isEmpty(cndNotation)) {
- return String.valueOf(AttributeState.VARIANT_CHAR);
- }
-
- return cndNotation + AttributeState.VARIANT_CHAR;
- }
-
- /**
- * The attribute state possible values.
- */
- public enum Value {
-
- /**
- * Indicates the attribute is supported.
- */
- IS,
-
- /**
- * Indicates the attribute is not supported.
- */
- IS_NOT,
-
- /**
- * Indicates the attribute is a variant.
- */
- VARIANT
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Autocreated.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Autocreated.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Autocreated.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The autocreated attribute used by property definitions and child node definitions. When set, the property is automatically
- * created when the parent node is created. It mandates that a default value is set.
- */
-public class Autocreated extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "autocreated", "aut", "a" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultType.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultType.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultType.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.QualifiedName;
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- * The child node definition's default type property.
- */
-public class DefaultType extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String NOTATION = "="; //$NON-NLS-1$
-
- private final QualifiedName defaultType = new QualifiedName();
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#get()
- */
- @Override
- public Value get() {
- final Value state = super.get();
-
- if (state == Value.VARIANT) {
- return Value.VARIANT;
- }
-
- if (Utils.isEmpty(this.defaultType.get())) {
- return Value.IS_NOT;
- }
-
- return Value.IS;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return getLongCndNotation();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return getLongCndNotation();
- }
-
- /**
- * @return the default type's qualified name (never <code>null</code>)
- */
- public QualifiedName getDefaultType() {
- return this.defaultType;
- }
-
- /**
- * @return the default type name (can be <code>null</code> or empty)
- */
- public String getDefaultTypeName() {
- String defaultTypeName = this.defaultType.get();
-
- // per API return null if it doesn't exist
- if (Utils.isEmpty(defaultTypeName)) {
- return null;
- }
-
- return defaultTypeName;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- if (isVariant()) {
- return getPrefix();
- }
-
- String defaultType = getDefaultTypeName();
-
- if (Utils.isEmpty(defaultType)) {
- return Utils.EMPTY_STRING;
- }
-
- return getPrefix() + defaultType;
- }
-
- private String getPrefix() {
- String delim = CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.DEFAULT_TYPE_END_PREFIX_DELIMITER);
-
- if (Utils.isEmpty(delim)) {
- return NOTATION;
- }
-
- return (NOTATION + delim);
- }
-
- /**
- * {@inheritDoc} <strong>Can only be used to change to a variant state. Use {@link DefaultType#setDefaultType(String)} to set to
- * other states</strong>
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#set(org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState.Value)
- */
- @Override
- public boolean set( final Value newState ) {
- if (newState == Value.VARIANT) {
- if (super.set(Value.VARIANT)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * @param newDefaultType the proposed new value for the default type (can be <code>null</code> or empty)
- * @return <code>true</code> if changed
- */
- public boolean setDefaultType( final String newDefaultType ) {
- if (this.defaultType.set(newDefaultType)) {
- if (Utils.isEmpty(newDefaultType) && !isVariant()) {
- super.set(Value.IS_NOT);
- } else {
- super.set(Value.IS);
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#toVariantCndNotation(java.lang.String)
- */
- @Override
- protected String toVariantCndNotation( final String cndNotation ) {
- return cndNotation + AttributeState.VARIANT_CHAR;
- }
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultValues.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultValues.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/DefaultValues.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.Collection;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- *
- */
-public final class DefaultValues extends ListAttributeState<String> {
-
- /**
- * The CND list prefix.
- */
- public static final String NOTATION_PREFIX = "="; //$NON-NLS-1$
-
- /**
- * @return the JCR value for each default value (never <code>null</code>)
- */
- public javax.jcr.Value[] asJcrValues() {
- final Collection<String> defaultValues = getSupportedItems();
-
- if (Utils.isEmpty(defaultValues)) {
- return new javax.jcr.Value[0];
- }
-
- final javax.jcr.Value[] jcrValues = new javax.jcr.Value[defaultValues.size()];
- int i = 0;
-
- for (final String defaultValue : defaultValues) {
- jcrValues[i++] = new PropertyValue(PropertyType.STRING.asJcrValue(), defaultValue);
- }
-
- return jcrValues;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationPrefix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationPrefix( final NotationType notationType ) {
- return NOTATION_PREFIX;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getQuoteCharacter()
- */
- @Override
- protected String getQuoteCharacter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.DEFAULT_VALUES_QUOTE_CHARACTER);
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ListAttributeState.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ListAttributeState.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ListAttributeState.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,338 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- * @param <E> the class of the list items
- */
-public abstract class ListAttributeState<E extends Comparable> extends AttributeState {
-
- /**
- * A list of supported items (can be <code>null</code>).
- */
- private List<E> supported;
-
- /**
- * @param item the item being added (cannot be <code>null</code>)
- * @return <code>true</code> if successfully added
- */
- public boolean add( final E item ) {
- Utils.verifyIsNotNull(item, "item"); //$NON-NLS-1$
-
- if (this.supported == null) {
- this.supported = new ArrayList<E>();
- }
-
- boolean added = false;
-
- if (!this.supported.contains(item)) {
- added = this.supported.add(item);
- }
-
- if (added && !is()) {
- super.set(Value.IS);
- }
-
- return added;
- }
-
- /**
- * @return <code>true</code> if at least one item was cleared
- */
- public boolean clear() {
- boolean cleared = false;
-
- if (this.supported != null) {
- cleared = !this.supported.isEmpty();
- this.supported = null;
- }
-
- if (!isNot()) {
- super.set(Value.IS_NOT);
- }
-
- return cleared;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- final ListAttributeState that = (ListAttributeState)obj;
- final List<E> thatSupportedItems = that.getSupportedItems();
- final List<E> thisSupportedItems = getSupportedItems();
-
- if (Utils.isEmpty(thisSupportedItems)) {
- return Utils.isEmpty(thatSupportedItems);
- }
-
- if (Utils.isEmpty(thatSupportedItems)) {
- return false;
- }
-
- if (thisSupportedItems.size() != thatSupportedItems.size()) {
- return false;
- }
-
- return thisSupportedItems.containsAll(thatSupportedItems);
- }
-
- /**
- * @param item the item being checked to see if it is already supported (cannot be <code>null</code>)
- * @return <code>true</code> if already exists
- */
- public boolean exists( E item ) {
- Utils.verifyIsNotNull(item, "item"); //$NON-NLS-1$
- return getSupportedItems().contains(item);
- }
-
- /**
- * @param notationType the notation type whose CND notation prefix is being requested (cannot be <code>null</code>)
- * @return the CND notation prefix (can be <code>null</code> or empty)
- */
- protected abstract String getCndNotationPrefix( NotationType notationType );
-
- /**
- * @param notationType the notation type whose CND notation suffix is being requested (cannot be <code>null</code>)
- * @return the CND notation suffix (can be <code>null</code> or empty)
- */
- protected String getCndNotationSuffix( final NotationType notationType ) {
- return Utils.EMPTY_STRING;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @return the quote character (empty, single, or double) surrounding each item of the list (cannot be <code>null</code>)
- */
- protected String getItemQuoteCharacter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ATTRIBUTE_LIST_ITEM_QUOTE_CHAR);
- }
-
- /**
- * @return the delimiter used after the list prefix (never <code>null</code> but can be empty)
- */
- protected String getListPrefixEndDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ATTRIBUTE_LIST_PREFIX_END_DELIMITER);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @return the quote character (empty, single, double) surrounding the elements of the list (cannot be <code>null</code>)
- */
- protected String getQuoteCharacter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ATTRIBUTE_LIST_QUOTE_CHAR);
- }
-
- /**
- * @return the collection of supported items (never <code>null</code>)
- */
- public List<E> getSupportedItems() {
- if (this.supported == null) {
- return Collections.emptyList();
- }
-
- return Collections.unmodifiableList(this.supported);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#hasCndNotation()
- */
- @Override
- protected boolean hasCndNotation() {
- return !isNot();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(getSupportedItems());
- }
-
- /**
- * @param item the item being removed (cannot be <code>null</code>)
- * @return <code>true</code> if successfully removed
- */
- public boolean remove( final E item ) {
- Utils.verifyIsNotNull(item, "item"); //$NON-NLS-1$
-
- if (this.supported == null) {
- return false;
- }
-
- final boolean removed = this.supported.remove(item);
-
- if (this.supported.isEmpty()) {
- this.supported = null;
-
- if (is()) {
- super.set(Value.IS_NOT);
- }
- }
-
- return removed;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#set(org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState.Value)
- */
- @Override
- public final boolean set( final Value newState ) {
- if (Value.VARIANT == newState) {
- clear();
- return super.set(Value.VARIANT);
- }
-
- return false; // other states set by adding and removing supported items
- }
-
- /**
- * @param notationType the CND notation type to use (cannot be <code>null</code>)
- * @return the CND notation (never <code>null</code> but can be empty)
- */
- protected String supportedItemsCndNotation( final NotationType notationType ) {
- final List<E> items = new ArrayList<E>(getSupportedItems());
- Collections.sort(items);
-
- if (items.isEmpty()) {
- return Utils.EMPTY_STRING;
- }
-
- final String itemQuote = getItemQuoteCharacter();
- final boolean useQuote = !Utils.isEmpty(itemQuote);
- final StringBuilder builder = new StringBuilder();
-
- for (final Iterator<E> itr = items.iterator(); itr.hasNext();) {
- final E item = itr.next();
-
- if (useQuote) {
- builder.append(itemQuote);
- }
-
- if (item instanceof CndElement) {
- builder.append(((CndElement)item).toCndNotation(notationType));
- } else {
- builder.append(item.toString());
- }
-
- if (useQuote) {
- builder.append(itemQuote);
- }
-
- if (itr.hasNext()) {
- builder.append(CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.ATTRIBUTE_LIST_ELEMENT_DELIMITER));
- }
- }
-
- return builder.toString();
- }
-
- /**
- * @param item the item being checked (cannot be <code>null</code>)
- * @return <code>true</code> if item is contained in list
- */
- public boolean supports( final E item ) {
- Utils.verifyIsNotNull(item, "item"); //$NON-NLS-1$
- return getSupportedItems().contains(item);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- if (hasCndNotation()) {
- final StringBuilder builder = new StringBuilder();
-
- if (!Utils.isEmpty(getCndNotationPrefix(notationType))) {
- builder.append(getCndNotationPrefix(notationType));
- }
-
- final String delim = getListPrefixEndDelimiter();
-
- if (!Utils.isEmpty(delim)) {
- builder.append(delim);
- }
-
- if (isVariant()) {
- builder.append(AttributeState.VARIANT_CHAR);
- } else {
- // add the delimited list
- builder.append(getQuoteCharacter());
- builder.append(supportedItemsCndNotation(notationType));
- builder.append(getQuoteCharacter());
- }
-
- if (!Utils.isEmpty(getCndNotationSuffix(notationType))) {
- builder.append(getCndNotationSuffix(notationType));
- }
-
- return builder.toString();
- }
-
- return Utils.EMPTY_STRING;
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mandatory.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mandatory.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mandatory.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The mandatory attribute used by property definitions and child node definitions. When set, the property is mandatory, meaning it
- * must be present in order to save the node.
- */
-public class Mandatory extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "mandatory", "man", "m" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mixin.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mixin.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Mixin.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The mixin attribute used by node type definitions.
- */
-public class Mixin extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "mixin", "mix", "m" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Multiple.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Multiple.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Multiple.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The multiple attribute used by property definitions. When set, the property is multi-valued, accepting a list of values.
- */
-public class Multiple extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "multiple", "mul", "*" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoFullText.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoFullText.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoFullText.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The no full text search attribute used by the property definitions.
- */
-public class NoFullText extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "nofulltext", "nof", "nof" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoQueryOrder.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoQueryOrder.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NoQueryOrder.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The no query order attribute used by property definitions.
- */
-public class NoQueryOrder extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "noqueryorder", "nqord", "nqord" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeAttributes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeAttributes.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeAttributes.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-import org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState.Value;
-
-/**
- * The child node definition attribute collection.
- */
-public class NodeAttributes implements CndElement {
-
- private final Autocreated autocreated;
-
- private final Mandatory mandatory;
-
- private final Protected notDeletable;
-
- private OnParentVersion opv;
-
- private final SameNameSiblings sns;
-
- /**
- * Constructs node attributes all set to default values.
- */
- public NodeAttributes() {
- this.autocreated = new Autocreated();
- this.mandatory = new Mandatory();
- this.notDeletable = new Protected();
- this.opv = OnParentVersion.DEFAULT_VALUE;
- this.sns = new SameNameSiblings();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- final NodeAttributes that = (NodeAttributes)obj;
-
- return (this.autocreated.equals(that.autocreated) && this.mandatory.equals(that.mandatory)
- && this.notDeletable.equals(that.notDeletable) && (this.opv == that.opv) && this.sns.equals(that.sns));
- }
-
- /**
- * @return the autocreated attribute (never <code>null</code>)
- */
- public Autocreated getAutocreated() {
- return this.autocreated;
- }
-
- private String getFormatDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.CHILD_NODE_ATTRIBUTES_DELIMITER);
- }
-
- /**
- * @return the mandatory attribute (never <code>null</code>)
- */
- public Mandatory getMandatory() {
- return this.mandatory;
- }
-
- /**
- * @return the on parent version attribute (never <code>null</code>)
- */
- public OnParentVersion getOnParentVersion() {
- return this.opv;
- }
-
- /**
- * @return the protected attribute (never <code>null</code>)
- */
- public Protected getProtected() {
- return this.notDeletable;
- }
-
- /**
- * @return the same named siblings attribute (never <code>null</code>)
- */
- public SameNameSiblings getSameNameSiblings() {
- return this.sns;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(this.autocreated, this.mandatory, this.notDeletable, this.opv, this.sns);
- }
-
- /**
- * @param newState the new value to set the autocreated attribute state to (cannot be <code>null</code>)
- * @return <code>true</code> if the state changed
- */
- public boolean setAutocreated( final Value newState ) {
- return this.autocreated.set(newState);
- }
-
- /**
- * @param newState the new value to set the mandatory attribute state to (cannot be <code>null</code>)
- * @return <code>true</code> if state changed
- */
- public boolean setMandatory( final Value newState ) {
- return this.mandatory.set(newState);
- }
-
- /**
- * @param newOpv the new value to set the on parent version attribute to (cannot be <code>null</code>)
- * @return <code>true</code> if changed
- */
- public boolean setOnParentVersion( final OnParentVersion newOpv ) {
- Utils.verifyIsNotNull(newOpv, "newOpv"); //$NON-NLS-1$
-
- if (this.opv != newOpv) {
- this.opv = newOpv;
- return true;
- }
-
- return false;
- }
-
- /**
- * @param newState the new value to set the protected attribute state to (cannot be <code>null</code>)
- * @return <code>true</code> if state changed
- */
- public boolean setProtected( final Value newState ) {
- return this.notDeletable.set(newState);
- }
-
- /**
- * @param newState the new value to set the same named siblings attribute state to (cannot be <code>null</code>)
- * @return <code>true</code> if state changed
- */
- public boolean setSameNameSibling( final Value newState ) {
- return this.sns.set(newState);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- final String DELIM = getFormatDelimiter();
- final StringBuilder builder = new StringBuilder();
-
- boolean addDelim = Utils.build(builder, false, DELIM, this.autocreated.toCndNotation(notationType));
-
- if (Utils.build(builder, addDelim, DELIM, this.mandatory.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.notDeletable.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.opv.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.sns.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- return builder.toString().trim();
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeTypeAttributes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeTypeAttributes.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/NodeTypeAttributes.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,223 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- * Property attributes of a node type definitions.
- */
-public class NodeTypeAttributes implements CndElement {
-
- private Mixin mixin;
-
- private Abstract notConcrete;
-
- private Orderable orderable;
-
- private PrimaryItem primaryItem;
-
- private Queryable queryable;
-
- /**
- * Constructs a node type definition's attribute collection all set to there default values.
- */
- public NodeTypeAttributes() {
- this.orderable = new Orderable();
- this.mixin = new Mixin();
- this.notConcrete = new Abstract();
- this.primaryItem = new PrimaryItem();
- this.queryable = new Queryable();
- }
-
- /**
- * @param initialOrderable the initial orderable value (can be <code>null</code>)
- * @param initialMixin the initial mixin value (can be <code>null</code>)
- * @param initialAbstract the initial abstract value (can be <code>null</code>)
- * @param initialQueryable the initial queryable value (can be <code>null</code>)
- * @param initialPrimaryItem the initial primary item value (can be <code>null</code>)
- */
- public NodeTypeAttributes( final Orderable initialOrderable,
- final Mixin initialMixin,
- final Abstract initialAbstract,
- final Queryable initialQueryable,
- final PrimaryItem initialPrimaryItem ) {
- this();
-
- if (!this.orderable.equals(initialOrderable)) {
- this.orderable = initialOrderable;
- }
-
- if (!this.mixin.equals(initialMixin)) {
- this.mixin = initialMixin;
- }
-
- if (!this.notConcrete.equals(initialOrderable)) {
- this.notConcrete = initialAbstract;
- }
-
- if (!this.queryable.equals(initialQueryable)) {
- this.queryable = initialQueryable;
- }
-
- if (!this.primaryItem.equals(initialPrimaryItem)) {
- this.primaryItem = initialPrimaryItem;
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- final NodeTypeAttributes that = (NodeTypeAttributes)obj;
-
- return (this.mixin.equals(that.mixin) && this.notConcrete.equals(that.notConcrete) && this.orderable.equals(that.orderable)
- && this.queryable.equals(that.queryable) && this.primaryItem.equals(that.primaryItem));
- }
-
- /**
- * @return the abstract attribute (never <code>null</code>)
- */
- public Abstract getAbstract() {
- return this.notConcrete;
- }
-
- /**
- * @return the mixin attribute (never <code>null</code>)
- */
- public Mixin getMixin() {
- return this.mixin;
- }
-
- /**
- * @return the orderable attribute (never <code>null</code>)
- */
- public Orderable getOrderable() {
- return this.orderable;
- }
-
- /**
- * @return the primary item attribute (never <code>null</code>)
- */
- public PrimaryItem getPrimaryItem() {
- return this.primaryItem;
- }
-
- /**
- * @return the queryable attribute (never <code>null</code>)
- */
- public Queryable getQueryable() {
- return this.queryable;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(this.mixin, this.notConcrete, this.orderable, this.queryable, this.primaryItem);
- }
-
- /**
- * @param newState the proposed new state of the abstract attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setAbstract( final AttributeState.Value newState ) {
- return this.notConcrete.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the mixin attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setMixin( final AttributeState.Value newState ) {
- return this.mixin.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the orderable attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setOrderable( final AttributeState.Value newState ) {
- return this.orderable.set(newState);
- }
-
- /**
- * <strong>Can only be used to set to variant state.</strong>
- *
- * @param newState the proposed new state of the primary item attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setPrimaryItem( final AttributeState.Value newState ) {
- return this.primaryItem.set(newState);
- }
-
- /**
- * @param newPrimaryItem the proposed new value for the primary item (can be <code>null</code> or empty)
- * @return <code>true</code> if primary item was changed
- */
- public boolean setPrimaryItem( final String newPrimaryItem ) {
- return this.primaryItem.setPrimaryItem(newPrimaryItem);
- }
-
- /**
- * @param newState the proposed new state of the queryable attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setQueryable( final AttributeState.Value newState ) {
- return this.queryable.set(newState);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- final String DELIM = CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.NODE_TYPE_DEFINITION_ATTRIBUTES_DELIMITER);
- final StringBuilder builder = new StringBuilder();
-
- boolean addDelim = Utils.build(builder, false, DELIM, this.orderable.toCndNotation(notationType));
-
- if (Utils.build(builder, addDelim, DELIM, this.mixin.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.notConcrete.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.queryable.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.primaryItem.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- return builder.toString().trim();
- }
-
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/OnParentVersion.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/OnParentVersion.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/OnParentVersion.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,151 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import javax.jcr.version.OnParentVersionAction;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.modeshape.jcr.Messages;
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The primary item attribute used by child node definitions and property definitions.
- */
-public enum OnParentVersion implements CndElement {
-
- /**
- * Upon check-in, a VersionException will be thrown as the creation of a version is prohibited.
- */
- ABORT(OnParentVersionAction.ABORT),
-
- /**
- * Upon check-in, the new version will contain this property. However, when the node is restored from a previous node, the value
- * of this property is NOT being restored.
- */
- COMPUTE(OnParentVersionAction.COMPUTE),
-
- /**
- * Upon check-in, the value of the property will be copied to the new version.
- */
- COPY(OnParentVersionAction.COPY),
-
- /**
- * Upon check-in, the version entry will not contain this property, i.e. it is not versioned.
- */
- IGNORE(OnParentVersionAction.IGNORE),
-
- /**
- * Upon check-in, a new property with the same name will be created and re-initialized with any default values specified or as
- * empty. Essentially, the property is re-set when a new version of the node is created.
- */
- INITIALIZE(OnParentVersionAction.INITIALIZE),
-
- /**
- * Indicates that OPV is a variant. Cannot be used with {@link #find(String)}.
- */
- VARIANT(-1),
-
- /**
- * Upon check-in, the value of the property will be copied to the new version.
- */
- VERSION(OnParentVersionAction.VERSION);
-
- /**
- * The default value. Value is {@value} .
- */
- public static OnParentVersion DEFAULT_VALUE = COPY;
-
- /**
- * @param notation the CND representation of the OPV (cannot be <code>null</code> or empty)
- * @return the OPV (never <code>null</code>)
- * @throws IllegalArgumentException if the <code>jcrValue</code> is not valid
- */
- public static OnParentVersion find( final String notation ) {
- for (final OnParentVersion opv : OnParentVersion.values()) {
- if (opv.toCndNotation(NotationType.LONG).equalsIgnoreCase(notation)
- || opv.toCndNotation(NotationType.COMPRESSED).equalsIgnoreCase(notation)
- || opv.toCndNotation(NotationType.COMPACT).equalsIgnoreCase(notation)) {
- return opv;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindRequest, notation));
- }
-
- /**
- * @param jcrValue the integer representation
- * @return the OPV (never <code>null</code>)
- * @throws IllegalArgumentException if the <code>jcrValue</code> is not valid
- */
- public static OnParentVersion findUsingJcrValue( final int jcrValue ) {
- for (final OnParentVersion opv : OnParentVersion.values()) {
- if (opv.asJcrValue() == jcrValue) {
- return opv;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindUsingJcrValueRequest, jcrValue));
- }
-
- /**
- * @return a collection of all valid CND notation values (never <code>null</code> or empty)
- */
- public static String[] toArray() {
- final OnParentVersion[] allOpv = OnParentVersion.values();
- final String[] notations = new String[allOpv.length];
- int i = 0;
-
- for (final OnParentVersion opv : allOpv) {
- notations[i++] = opv.toCndNotation(NotationType.LONG);
- }
-
- return notations;
- }
-
- private final int jcrValue;
-
- private OnParentVersion( final int jcrValue ) {
- this.jcrValue = jcrValue;
- }
-
- /**
- * @return the JCR integer representation
- */
- public int asJcrValue() {
- return this.jcrValue;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- if ((this == DEFAULT_VALUE) && (NotationType.LONG != notationType)) {
- return Utils.EMPTY_STRING;
- }
-
- if (this == VARIANT) {
- return "OPV?"; //$NON-NLS-1$
- }
-
- return super.toString();
- }
- //
- // /**
- // * {@inheritDoc}
- // *
- // * @see java.lang.Enum#toString()
- // */
- // @Override
- // public String toString() {
- // return OnParentVersionAction.nameFromValue(asJcrValue());
- // }
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Orderable.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Orderable.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Orderable.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The orderable attribute used by node type definitions.
- */
-public class Orderable extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "orderable", "ord", "o" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.QualifiedName;
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The primary item attribute used by node type definitions. This primary item may be a child node or a property.
- */
-public class PrimaryItem extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "primaryitem", "!", "!" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- private final QualifiedName primaryItem = new QualifiedName();
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#equals(java.lang.Object)
- */
- @Override
- public boolean equals( Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- PrimaryItem that = (PrimaryItem)obj;
- return (super.equals(obj) && getPrimaryItem().equals(that.getPrimaryItem()));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#get()
- */
- @Override
- public Value get() {
- final Value state = super.get();
-
- if (state == Value.VARIANT) {
- return Value.VARIANT;
- }
-
- if (Utils.isEmpty(this.primaryItem.get())) {
- return Value.IS_NOT;
- }
-
- return Value.IS;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
- /**
- * @return the primary item (never <code>null</code>)
- */
- public QualifiedName getPrimaryItem() {
- return this.primaryItem;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(super.hashCode(), this.primaryItem);
- }
-
- /**
- * {@inheritDoc} Only can be used to set to variant state.
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#set(org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState.Value)
- */
- @Override
- public boolean set( final Value newState ) {
- if (newState == Value.VARIANT) {
- if (super.set(Value.VARIANT)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * @param newPrimaryItem the proposed new primary item (can be <code>null</code> or empty)
- * @return <code>true</code> if the primary item was changed
- */
- public boolean setPrimaryItem( final String newPrimaryItem ) {
- if (this.primaryItem.set(newPrimaryItem)) {
- if (Utils.isEmpty(this.primaryItem.get()) && !isVariant()) {
- super.set(Value.IS_NOT);
- } else {
- super.set(Value.IS);
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- String notation = super.toCndNotation(notationType);
-
- if (!isVariant() && is()) {
- notation += ' ' + this.primaryItem.toCndNotation(notationType);
- }
-
- return notation;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#toVariantCndNotation(java.lang.String)
- */
- @Override
- protected String toVariantCndNotation( final String cndNotation ) {
- return cndNotation + ' ' + AttributeState.VARIANT_CHAR;
- }
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributes.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributes.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,300 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- * Property attributes of a property definitions.
- */
-public class PropertyAttributes implements CndElement {
-
- private Autocreated autocreated;
-
- private Mandatory mandatory;
-
- private Multiple multiple;
-
- private NoFullText noFullText;
-
- private NoQueryOrder noQueryOrder;
-
- private Protected notDeletable; // protected
-
- private OnParentVersion opv;
-
- private QueryOperators queryOps;
-
- /**
- * Constructs a property definition's attribute collecdtion all set to there default values.
- */
- public PropertyAttributes() {
- this.autocreated = new Autocreated();
- this.mandatory = new Mandatory();
- this.multiple = new Multiple();
- this.notDeletable = new Protected();
- this.opv = OnParentVersion.DEFAULT_VALUE;
- this.noFullText = new NoFullText();
- this.noQueryOrder = new NoQueryOrder();
- this.queryOps = new QueryOperators();
- }
-
- /**
- * @param initialAutocreated the initial autocreated value (can be <code>null</code>)
- * @param initialMandatory the initial mandatory value (can be <code>null</code>)
- * @param initialMultiple the initial multiple values value (can be <code>null</code>)
- * @param initialProtected the initial protected value (can be <code>null</code>)
- * @param initialOpv the initial on-parent-value value (can be <code>null</code>)
- * @param initialNoFullText the initial no full text search support value (can be <code>null</code>)
- * @param initialNoQueryOrder the initial no query order support value (can be <code>null</code>)
- * @param initialQueryOps the initial query operator support value (can be <code>null</code>)
- */
- public PropertyAttributes( Autocreated initialAutocreated,
- Mandatory initialMandatory,
- Multiple initialMultiple,
- Protected initialProtected,
- OnParentVersion initialOpv,
- NoFullText initialNoFullText,
- NoQueryOrder initialNoQueryOrder,
- QueryOperators initialQueryOps ) {
- this();
-
- if (!this.autocreated.equals(initialAutocreated)) {
- this.autocreated = initialAutocreated;
- }
-
- if (!this.mandatory.equals(initialMandatory)) {
- this.mandatory = initialMandatory;
- }
-
- if (!this.multiple.equals(initialMultiple)) {
- this.multiple = initialMultiple;
- }
-
- if (!this.notDeletable.equals(initialProtected)) {
- this.notDeletable = initialProtected;
- }
-
- if (initialOpv != this.opv) {
- this.opv = initialOpv;
- }
-
- if (!this.noFullText.equals(initialNoFullText)) {
- this.noFullText = initialNoFullText;
- }
-
- if (!this.noQueryOrder.equals(initialNoQueryOrder)) {
- this.noQueryOrder = initialNoQueryOrder;
- }
-
- if (!this.queryOps.equals(initialQueryOps)) {
- this.queryOps = initialQueryOps;
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- PropertyAttributes that = (PropertyAttributes)obj;
-
- return (this.autocreated.equals(that.autocreated) && this.mandatory.equals(that.mandatory)
- && this.multiple.equals(that.multiple) && this.noFullText.equals(that.noFullText)
- && this.noQueryOrder.equals(that.noQueryOrder) && this.notDeletable.equals(that.notDeletable)
- && (this.opv == that.opv) && this.queryOps.equals(that.queryOps));
- }
-
- /**
- * @return the autocreated attribute (never <code>null</code>)
- */
- public Autocreated getAutocreated() {
- return this.autocreated;
- }
-
- private String getFormatDelimiter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.PROPERTY_DEFINITION_ATTRIBUTES_DELIMITER);
- }
-
- /**
- * @return the mandatory attribute (never <code>null</code>)
- */
- public Mandatory getMandatory() {
- return this.mandatory;
- }
-
- /**
- * @return the multiple attribute (never <code>null</code>)
- */
- public Multiple getMultiple() {
- return this.multiple;
- }
-
- /**
- * @return the no full text search attribute (never <code>null</code>)
- */
- public NoFullText getNoFullText() {
- return this.noFullText;
- }
-
- /**
- * @return the no query order attribute (never <code>null</code>)
- */
- public NoQueryOrder getNoQueryOrder() {
- return this.noQueryOrder;
- }
-
- /**
- * @return the on parent version attribute (never <code>null</code>)
- */
- public OnParentVersion getOnParentVersion() {
- return this.opv;
- }
-
- /**
- * @return the protected attribute (never <code>null</code>)
- */
- public Protected getProtected() {
- return this.notDeletable;
- }
-
- /**
- * @return the query operators attribute (never <code>null</code>)
- */
- public QueryOperators getQueryOps() {
- return this.queryOps;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(0, this.autocreated, this.mandatory, this.multiple, this.noFullText, this.noQueryOrder,
- this.notDeletable, this.opv, this.queryOps);
- }
-
- /**
- * @param newState the proposed new state of the autocreated attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setAutocreated( AttributeState.Value newState ) {
- return this.autocreated.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the mandatory attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setMandatory( AttributeState.Value newState ) {
- return this.mandatory.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the multiple attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setMultiple( AttributeState.Value newState ) {
- return this.multiple.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the no full text search attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setNoFullText( AttributeState.Value newState ) {
- return this.noFullText.set(newState);
- }
-
- /**
- * @param newState the proposed new state of the no query order attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setNoQueryOrder( AttributeState.Value newState ) {
- return this.noQueryOrder.set(newState);
- }
-
- /**
- * @param newOpv the proposed new value of the on parent version attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the value was changed
- */
- public boolean setOnParentVersion( OnParentVersion newOpv ) {
- if (this.opv != newOpv) {
- this.opv = newOpv;
- return true;
- }
-
- return false;
- }
-
- /**
- * @param newState the proposed new state of the protected attribute (cannot be <code>null</code>)
- * @return <code>true</code> if the state was changed
- */
- public boolean setProtected( AttributeState.Value newState ) {
- return this.notDeletable.set(newState);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( NotationType notationType ) {
- final String DELIM = getFormatDelimiter();
- StringBuilder builder = new StringBuilder();
-
- boolean addDelim = Utils.build(builder, false, DELIM, this.autocreated.toCndNotation(notationType));
-
- if (Utils.build(builder, addDelim, DELIM, this.mandatory.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.notDeletable.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.multiple.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.opv.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.noFullText.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.noQueryOrder.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- if (Utils.build(builder, addDelim, DELIM, this.queryOps.toCndNotation(notationType))) {
- addDelim = true;
- }
-
- return builder.toString().trim();
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyType.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyType.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyType.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,206 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.modeshape.jcr.Messages;
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The type property of a property definition.
- */
-public enum PropertyType implements CndElement {
-
- /**
- * The property value is a UTF-8 encoded string.
- */
- BINARY(javax.jcr.PropertyType.BINARY),
-
- /**
- * The property value is any string that can be converted via {@link Boolean#valueOf(String)}, such as �true�, �false�, �0�,
- * �1�.
- */
- BOOLEAN(javax.jcr.PropertyType.BOOLEAN),
-
- /**
- * The property value is a valid date in ISO 8601:2000-compliant format: sYYYY-MM-DDThh:mm:ss.sssTZD.
- */
- DATE(javax.jcr.PropertyType.DATE),
-
- /**
- * The property value is a decimal number.
- */
- DECIMAL(javax.jcr.PropertyType.DECIMAL),
-
- /**
- * The property value is a double number.
- */
- DOUBLE(javax.jcr.PropertyType.DOUBLE),
-
- /**
- * The property value is a long number.
- */
- LONG(javax.jcr.PropertyType.LONG),
-
- /**
- * The property value is a valid JCR local name, fully qualified with namespace prefix.
- */
- NAME(javax.jcr.PropertyType.NAME),
-
- /**
- * The property value is a valid JCR path whose namespace prefixes are all registered correctly. The path does not have to point
- * to an existing node.
- */
- PATH(javax.jcr.PropertyType.PATH),
-
- /**
- * The property value is a valid JCR identifier.
- */
- REFERENCE(javax.jcr.PropertyType.REFERENCE),
-
- /**
- * The property value is a string.
- */
- STRING(javax.jcr.PropertyType.STRING),
-
- /**
- * The property value is any string. The value is automatically converted to the appropriate type of the property when created.
- */
- UNDEFINED(javax.jcr.PropertyType.UNDEFINED),
-
- /**
- * The property value is a URI string.
- */
- URI(javax.jcr.PropertyType.URI),
-
- /**
- * The property value is a UTF-8 encoded string.
- */
- VARIANT(-1),
-
- /**
- * The property value is a JCR identifier.
- */
- WEAKREFERENCE(javax.jcr.PropertyType.WEAKREFERENCE);
-
- /**
- * The default property type. Defaults to {@value PropertyType#STRING}.
- */
- public static final PropertyType DEFAULT_VALUE = PropertyType.STRING;
-
- /**
- * The value prefixing the CND notation of the type.
- */
- public static final String NOTATION_PREFIX = "("; //$NON-NLS-1$
-
- /**
- * The value suffixing the CND notation of the type.
- */
- public static final String NOTATION_SUFFIX = ")"; //$NON-NLS-1$
-
- /**
- * The shortened value for the {@link #UNDEFINED} type.
- */
- public static final String UNDEFINED_ADDITIONAL_NOTATION = "*"; //$NON-NLS-1$
-
- /**
- * @param cndNotation the CND notation of the property type being requested (cannot be <code>null</code> or empty)
- * @return the property type (never <code>null</code>)
- */
- public static PropertyType find( final String cndNotation ) {
- Utils.verifyIsNotEmpty(cndNotation, "cndNotation"); //$NON-NLS-1$
-
- if (UNDEFINED_ADDITIONAL_NOTATION.equals(cndNotation)) {
- return UNDEFINED;
- }
-
- for (final PropertyType type : PropertyType.values()) {
- if (PropertyType.VARIANT == type) {
- continue;
- }
-
- if (type.toString().equalsIgnoreCase(cndNotation)) {
- return type;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindRequest, cndNotation));
- }
-
- /**
- * @param propertyType the {@link javax.jcr.PropertyType} of the type being requested
- * @return the property type (never <code>null</code>
- * @throws IllegalArgumentException if an invalid input value
- */
- public static PropertyType findUsingJcrValue( final int propertyType ) {
- for (final PropertyType type : PropertyType.values()) {
- if (type.asJcrValue() == propertyType) {
- return type;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindUsingJcrValueRequest, propertyType));
- }
-
- /**
- * @return a collection of all the valid CND notations (never <code>null</code> or empty)
- */
- public static String[] validValues() {
- final PropertyType[] allTypes = PropertyType.values();
- // add one for additional undefined notation added later but subtract one for variant
- final String[] result = new String[allTypes.length];
- int i = 0;
-
- for (final PropertyType type : allTypes) {
- if (type != VARIANT) {
- result[i++] = type.toString();
- }
- }
-
- result[i] = UNDEFINED_ADDITIONAL_NOTATION;
- return result;
- }
-
- private final int jcrValue;
-
- private PropertyType( final int propertyType ) {
- this.jcrValue = propertyType;
- }
-
- /**
- * If variant, will return <code>-1</code> which is not a valid {@link javax.jcr.PropertyType}.
- *
- * @return the {@link javax.jcr.PropertyType} of the type
- */
- public int asJcrValue() {
- return this.jcrValue;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( final NotationType notationType ) {
- final StringBuilder builder = new StringBuilder(NOTATION_PREFIX);
-
- if (this == VARIANT) {
- builder.append(AttributeState.VARIANT_CHAR);
- } else {
- if ((this == UNDEFINED) && (NotationType.LONG != notationType)) {
- builder.append(UNDEFINED_ADDITIONAL_NOTATION);
- } else {
- builder.append(toString());
- }
- }
-
- return builder.append(NOTATION_SUFFIX).toString();
- }
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyValue.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyValue.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyValue.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,295 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.jcr.Binary;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.ValueFormatException;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.modeshape.web.jcr.rest.client.RestClientI18n;
-
-/**
- *
- */
-public class PropertyValue implements Value {
-
- private final int type;
- private String value;
-
- /**
- * @param jcrType the {@link PropertyType} used to create the value
- */
- public PropertyValue( final int jcrType ) {
- this.type = jcrType;
- }
-
- /**
- * @param jcrType the {@link PropertyType} used to create the value
- * @param initialValue the initial property value (can be <code>null</code> or empty)
- */
- public PropertyValue( final int jcrType,
- final String initialValue ) {
- this(jcrType);
- this.value = initialValue;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals( final Object obj ) {
- if ((obj == null) || !getClass().equals(obj.getClass())) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- final PropertyValue that = (PropertyValue)obj;
- return (Utils.equals(this.type, that.type) && Utils.equals(this.value, that.value));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getBinary()
- */
- @Override
- public Binary getBinary() {
- final byte[] bytes = this.value.getBytes();
- return new Binary() {
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Binary#dispose()
- */
- @Override
- public void dispose() {
- // do nothing
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Binary#getSize()
- */
- @Override
- public long getSize() {
- return bytes.length;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Binary#getStream()
- */
- @Override
- public InputStream getStream() {
- return new ByteArrayInputStream(bytes);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Binary#read(byte[], long)
- */
- @Override
- public int read( final byte[] b,
- final long position ) throws IOException {
- if (getSize() <= position) {
- return -1;
- }
-
- InputStream stream = null;
- IOException error = null;
-
- try {
- stream = getStream();
- // Read/skip the next 'position' bytes ...
- long skip = position;
-
- while (skip > 0) {
- final long skipped = stream.skip(skip);
-
- if (skipped <= 0) {
- return -1;
- }
-
- skip -= skipped;
- }
-
- return stream.read(b);
- } catch (final IOException e) {
- error = e;
- throw e;
- } finally {
- if (stream != null) {
- try {
- stream.close();
- } catch (final RuntimeException t) {
- // Only throw if we've not already thrown an exception ...
- if (error == null) {
- throw t;
- }
- } catch (final IOException t) {
- // Only throw if we've not already thrown an exception ...
- if (error == null) {
- throw t;
- }
- }
- }
- }
- }
- };
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getBoolean()
- */
- @Override
- public boolean getBoolean() throws ValueFormatException {
- if (!Utils.isEmpty(this.value)) {
- if (this.value.equals(Boolean.TRUE.toString())) {
- return true;
- }
-
- if (this.value.equals(Boolean.FALSE.toString())) {
- return false;
- }
- }
-
- throw new ValueFormatException();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getDate()
- */
- @Override
- public Calendar getDate() throws ValueFormatException {
- try {
- // TODO how do you determine the format here
- final SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss"); //$NON-NLS-1$
- final Calendar cal = Calendar.getInstance();
- final Date d1 = df.parse(this.value);
- cal.setTime(d1);
- return cal;
- } catch (final Exception e) {
- final String from = PropertyType.nameFromValue(getType());
- final String to = PropertyType.nameFromValue(PropertyType.LONG);
- throw new ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), e);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getDecimal()
- */
- @Override
- public BigDecimal getDecimal() throws ValueFormatException {
- try {
- return new BigDecimal(this.value);
- } catch (final NumberFormatException t) {
- final String from = PropertyType.nameFromValue(getType());
- final String to = PropertyType.nameFromValue(PropertyType.DECIMAL);
- throw new ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getDouble()
- */
- @Override
- public double getDouble() throws ValueFormatException {
- try {
- return Double.parseDouble(this.value);
- } catch (final NumberFormatException t) {
- final String from = PropertyType.nameFromValue(getType());
- final String to = PropertyType.nameFromValue(PropertyType.DOUBLE);
- throw new ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getLong()
- */
- @Override
- public long getLong() throws ValueFormatException {
- try {
- return Long.parseLong(this.value);
- } catch (final NumberFormatException t) {
- final String from = PropertyType.nameFromValue(getType());
- final String to = PropertyType.nameFromValue(PropertyType.LONG);
- throw new ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getStream()
- */
- @SuppressWarnings("deprecation")
- @Deprecated
- @Override
- public InputStream getStream() throws RepositoryException {
- return getBinary().getStream();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getString()
- */
- @Override
- public String getString() {
- return this.value;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see javax.jcr.Value#getType()
- */
- @Override
- public int getType() {
- return ((this.type == PropertyType.UNDEFINED) ? PropertyType.STRING : this.type);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Utils.hashCode(this.type, this.value);
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Protected.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Protected.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Protected.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The protected attribute used by property definitions and child node definitions. Protected properties cannot be removed from
- * their parent node unless the parent node is deleted.
- */
-public class Protected extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "protected", "pro", "p" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperators.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperators.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperators.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,202 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.List;
-
-import javax.jcr.query.qom.QueryObjectModelConstants;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.modeshape.jcr.Messages;
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.attributes.QueryOperators.QueryOperator;
-
-/**
- * The primary item attribute used by property definitions.
- */
-public final class QueryOperators extends ListAttributeState<QueryOperator> {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "queryops", "qop", "qop" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * The valid query operators.
- */
- public enum QueryOperator implements CndElement {
-
- /**
- * The equals sign.
- */
- EQUALS("=", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The greater than sign.
- */
- GREATER_THAN(">", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The greater than or equal to sign.
- */
- GREATER_THAN_EQUALS(">=", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The less than sign.
- */
- LESS_THAN("<", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The less than or equal to sign.
- */
- LESS_THAN_EQUALS("<=", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The LIKE sign.
- */
- LIKE("LIKE", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO), //$NON-NLS-1$
-
- /**
- * The not equals sign.
- */
- NOT_EQUALS("<>", QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO); //$NON-NLS-1$
-
- /**
- * @param notation the operator's CND notation (cannot be <code>null</code> or empty)
- * @return the query operator (never <code>null</code>)
- * @throws IllegalArgumentException if an invalid CND notation
- */
- public static QueryOperator find( String notation ) {
- for (QueryOperator operator : QueryOperator.values()) {
- if (operator.notation.equals(notation)) {
- return operator;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindRequest, notation));
- }
-
- /**
- * @param jcrValue the {@link QueryObjectModelConstants} value of the query operator (cannot be <code>null</code> or empty)
- * @return the query operator (never <code>null</code>)
- * @throws IllegalArgumentException if an invalid JCR value
- */
- public static QueryOperator findUsingJcrValue( String jcrValue ) {
- for (QueryOperator operator : QueryOperator.values()) {
- if (operator.asJcrValue().equals(jcrValue)) {
- return operator;
- }
- }
-
- throw new IllegalArgumentException(NLS.bind(Messages.invalidFindUsingJcrValueRequest, jcrValue));
- }
-
- private final String notation;
- private final String jcrValue;
-
- private QueryOperator( String notation,
- String jcrValue ) {
- this.notation = notation;
- this.jcrValue = jcrValue;
- }
-
- /**
- * @return the {@link QueryObjectModelConstants} value (never <code>null</code> or empty)
- */
- public String asJcrValue() {
- return this.jcrValue;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.CndElement#toCndNotation(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- public String toCndNotation( NotationType notationType ) {
- return toString();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return this.notation;
- }
- }
-
- /**
- * @param operator the operator notation (cannot be <code>null</code> or empty)
- * @return <code>true</code> if added
- * @throws IllegalArgumentException if an invalid operator notation
- */
- public boolean add( String operator ) {
- Utils.verifyIsNotEmpty(operator, "operator"); //$NON-NLS-1$
- return add(QueryOperator.find(operator));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- int result = 0;
-
- for (QueryOperator operator : QueryOperator.values()) {
- if (supports(operator)) {
- result = Utils.hashCode(result, operator);
- }
- }
-
- return super.hashCode();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationPrefix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationPrefix( NotationType notationType ) {
- if (NotationType.LONG == notationType) {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
- if (NotationType.COMPRESSED == notationType) {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * @return a list of supported operator notations (never <code>null</code> but can be empty)
- */
- public String[] toArray() {
- List<QueryOperator> operators = getSupportedItems();
-
- if (Utils.isEmpty(operators)) {
- return Utils.EMPTY_STRING_ARRAY;
- }
-
- String[] result = new String[operators.size()];
- int i = 0;
-
- for (QueryOperator operator : operators) {
- result[i++] = operator.toString();
- }
-
- return result;
- }
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Queryable.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Queryable.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/Queryable.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The queryable attribute used by child node definitions.
- */
-public class Queryable extends AttributeState {
-
- /**
- * The CND notation for each notation type for when queryable.
- */
- public static final String[] QUERY_NOTATION = new String[] { "query", "q", "q" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * The CND notation for each notation type for when not queryable..
- */
- public static final String[] NO_QUERY_NOTATION = new String[] { "noquery", "nq", "nq" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * Constructs a queryable attribute set to be a variant (the default).
- */
- public Queryable() {
- set(Value.VARIANT);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- if (is()) {
- return QUERY_NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- if (isNot()) {
- return NO_QUERY_NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- return Utils.EMPTY_STRING;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- if (is()) {
- return QUERY_NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- if (isNot()) {
- return NO_QUERY_NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- return Utils.EMPTY_STRING;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- if (is()) {
- return QUERY_NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
- if (isNot()) {
- return NO_QUERY_NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
- return Utils.EMPTY_STRING;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#hasCndNotation()
- */
- @Override
- protected boolean hasCndNotation() {
- return !isVariant();
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/RequiredTypes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/RequiredTypes.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/RequiredTypes.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.List;
-
-import org.jboss.tools.modeshape.jcr.QualifiedName;
-import org.jboss.tools.modeshape.jcr.Utils;
-
-/**
- * The required types of a child node definition.
- */
-public final class RequiredTypes extends ListAttributeState<QualifiedName> {
-
- /**
- * The CND list prefix.
- */
- public static final String NOTATION_PREFIX = "("; //$NON-NLS-1$;
-
- /**
- * The CND list suffix.
- */
- public static final String NOTATION_SUFFIX = ")"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationPrefix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationPrefix( final NotationType notationType ) {
- return NOTATION_PREFIX;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationSuffix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationSuffix( final NotationType notationType ) {
- return NOTATION_SUFFIX;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getListPrefixEndDelimiter()
- */
- @Override
- protected String getListPrefixEndDelimiter() {
- return Utils.EMPTY_STRING;
- }
-
- /**
- * @return the collection of required types (never <code>null</code>)
- */
- public String[] toArray() {
- final List<QualifiedName> typeNames = getSupportedItems();
-
- if (Utils.isEmpty(typeNames)) {
- return Utils.EMPTY_STRING_ARRAY;
- }
-
- final String[] result = new String[typeNames.size()];
- int i = 0;
-
- for (final QualifiedName typeName : typeNames) {
- result[i++] = typeName.get();
- }
-
- return result;
- }
-
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SameNameSiblings.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SameNameSiblings.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SameNameSiblings.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-
-/**
- * The same named siblings attribute used by child node definitions.
- */
-public class SameNameSiblings extends AttributeState {
-
- /**
- * The CND notation for each notation type.
- */
- public static final String[] NOTATION = new String[] { "sns", "*", "*" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompactCndNotation()
- */
- @Override
- protected String getCompactCndNotation() {
- return NOTATION[CndElement.NotationType.COMPACT_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getCompressedCndNotation()
- */
- @Override
- protected String getCompressedCndNotation() {
- return NOTATION[CndElement.NotationType.COMPRESSED_INDEX];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.AttributeState#getLongCndNotation()
- */
- @Override
- protected String getLongCndNotation() {
- return NOTATION[CndElement.NotationType.LONG_INDEX];
- }
-
-}
\ No newline at end of file
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SuperTypes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SuperTypes.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/SuperTypes.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.List;
-
-import org.jboss.tools.modeshape.jcr.QualifiedName;
-import org.jboss.tools.modeshape.jcr.Utils;
-
-/**
- *
- */
-public final class SuperTypes extends ListAttributeState<QualifiedName> {
-
- /**
- * The CND list suffix.
- */
- public static final String NOTATION_PREFIX = ">"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationPrefix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationPrefix( final NotationType notationType ) {
- return NOTATION_PREFIX;
- }
-
- /**
- * @return the collection of super types (never <code>null</code>)
- */
- public String[] toArray() {
- final List<QualifiedName> superTypes = getSupportedItems();
-
- if (Utils.isEmpty(superTypes)) {
- return Utils.EMPTY_STRING_ARRAY;
- }
-
- final String[] result = new String[superTypes.size()];
- int i = 0;
-
- for (final QualifiedName superType : superTypes) {
- result[i++] = superType.get();
- }
-
- return result;
- }
-
-}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ValueConstraints.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ValueConstraints.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/ValueConstraints.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.jcr.cnd.attributes;
-
-import java.util.List;
-
-import org.jboss.tools.modeshape.jcr.Utils;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences;
-import org.jboss.tools.modeshape.jcr.cnd.CndNotationPreferences.Preference;
-
-/**
- * The value constraints of a property definition.
- */
-public final class ValueConstraints extends ListAttributeState<String> {
-
- /**
- * The CND list suffix.
- */
- public static final String NOTATION_PREFIX = "<"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getCndNotationPrefix(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
- */
- @Override
- protected String getCndNotationPrefix( final NotationType notationType ) {
- return NOTATION_PREFIX;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.jcr.cnd.attributes.ListAttributeState#getItemQuoteCharacter()
- */
- @Override
- protected String getItemQuoteCharacter() {
- return CndNotationPreferences.DEFAULT_PREFERENCES.get(Preference.VALUE_CONSTRAINTS_ITEM_QUOTE_CHARACTER);
- }
-
- /**
- * @return the collection of value constraints (never <code>null</code>)
- */
- public String[] toArray() {
- final List<String> constraints = getSupportedItems();
-
- if (Utils.isEmpty(constraints)) {
- return Utils.EMPTY_STRING_ARRAY;
- }
-
- final String[] result = new String[constraints.size()];
- int i = 0;
-
- for (final String constraint : constraints) {
- result[i++] = constraint;
- }
-
- return result;
- }
-
-}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -30,6 +30,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.window.Window;
@@ -47,9 +48,13 @@
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.editors.text.FileDocumentProvider;
import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.forms.FormDialog;
import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
import org.eclipse.ui.forms.IMessageManager;
import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.part.FileEditorInput;
@@ -61,6 +66,7 @@
import org.jboss.tools.modeshape.jcr.ui.JcrUiConstants.Images;
import org.jboss.tools.modeshape.ui.UiMessages;
import org.jboss.tools.modeshape.ui.forms.MessageFormDialog;
+import org.jboss.tools.modeshape.ui.forms.MessageSummaryDialog;
/**
*
@@ -233,6 +239,19 @@
final Form form = this.scrolledForm.getForm();
getToolkit().decorateFormHeading(form);
+ form.addMessageHyperlinkListener(new HyperlinkAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.forms.events.HyperlinkAdapter#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent)
+ */
+ @Override
+ public void linkActivated( final HyperlinkEvent e ) {
+ handleDisplayMessageDialog((IMessage[])e.data);
+ }
+ });
+
//
// createActions();
// contributeToToolBar(form.getToolBarManager());
@@ -346,6 +365,48 @@
return getEditorSite().getShell();
}
+ void handleDisplayMessageDialog( final IMessage[] data ) {
+ // configure message and message type
+ int numErrors = 0;
+ int numWarnings = 0;
+ int numInfos = 0;
+ int messageType = IMessageProvider.ERROR;
+
+ for (final IMessage message : data) {
+ if (message.getMessageType() == IMessageProvider.ERROR) {
+ ++numErrors;
+ } else if (message.getMessageType() == IMessageProvider.WARNING) {
+ ++numWarnings;
+ } else if (message.getMessageType() == IMessageProvider.INFORMATION) {
+ ++numInfos;
+ }
+ }
+
+ if (numErrors == 0) {
+ if (numWarnings != 0) {
+ messageType = IMessageProvider.WARNING;
+ } else if (numInfos != 0) {
+ messageType = IMessageProvider.INFORMATION;
+ } else {
+ messageType = IMessageProvider.NONE;
+ }
+ }
+
+ final String message = NLS.bind(CndMessages.cndMessageDialogMessageAreaMessage, new Object[] { getFile().getName(),
+ numErrors, numWarnings, numInfos });
+
+ // show dialog
+ final FormDialog dialog = new MessageSummaryDialog(getShell(),
+ CndMessages.cndMessageDialogTitle,
+ CndMessages.cndMessageDialogMessageAreaTitle,
+ message,
+ messageType,
+ data);
+ dialog.create();
+ dialog.getShell().pack();
+ dialog.open();
+ }
+
/**
* Registers an editor activation listener.
*/
@@ -353,16 +414,6 @@
getContainer().addListener(SWT.Activate, this.refreshListener);
}
- //
- // /**
- // * Handler for page change listener.
- // */
- // void handlePageChanged() {
- // final FormPage page = (FormPage)getSelectedPage();
- // this.scrolledForm.setText(page.getTitle());
- // page.setFocus();
- // }
-
/**
* {@inheritDoc}
*
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -1912,6 +1912,8 @@
if (nodeTypeDefinition.addChildNodeDefinition(newChildNodeDefinition)) {
added = true;
}
+
+ UiUtils.pack(this.childNodeViewer);
}
if (!removed || !added) {
@@ -1947,6 +1949,8 @@
if (getCnd().addNamespaceMapping(modifiedNamespaceMapping)) {
added = true;
}
+
+ UiUtils.pack(this.namespaceViewer);
}
if (!removed || !added) {
@@ -1983,6 +1987,8 @@
if (nodeTypeDefinition.addPropertyDefinition(newPropertyDefinition)) {
added = true;
}
+
+ UiUtils.pack(this.propertyViewer);
}
if (!removed || !added) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndMessages.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndMessages.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndMessages.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -304,6 +304,22 @@
public static String cndEditorTitle;
/**
+ * The message area message of the CND validation message dialog. Four parameters, the name of the CND, the number of errors,
+ * the number of warnings, and the number of info messages, are required.
+ */
+ public static String cndMessageDialogMessageAreaMessage;
+
+ /**
+ * The message area title of the CND validation message dialog.
+ */
+ public static String cndMessageDialogMessageAreaTitle;
+
+ /**
+ * The title of the CND validation message dialog.
+ */
+ public static String cndMessageDialogTitle;
+
+ /**
* The column header text of the default type of a child node definition.
*/
public static String defaultTypeHeaderText;
@@ -1010,6 +1026,11 @@
public static String queryableAttributeToolTip;
/**
+ * A label for a query operators control.
+ */
+ public static String queryOperatorsLabel;
+
+ /**
* The column header text for the required types of a child node definition.
*/
public static String requiredTypesHeaderText;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -60,6 +60,7 @@
import org.jboss.tools.modeshape.jcr.ValidationStatus;
import org.jboss.tools.modeshape.jcr.attributes.OnParentVersion;
import org.jboss.tools.modeshape.jcr.attributes.PropertyType;
+import org.jboss.tools.modeshape.jcr.attributes.QueryOperators.QueryOperator;
import org.jboss.tools.modeshape.jcr.cnd.CndValidator;
import org.jboss.tools.modeshape.jcr.ui.Activator;
import org.jboss.tools.modeshape.jcr.ui.JcrUiConstants;
@@ -550,14 +551,17 @@
{ // opv
final Composite opvContainer = toolkit.createComposite(attributesContainer);
opvContainer.setLayout(new GridLayout(2, false));
- opvContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ ((GridLayout)opvContainer.getLayout()).marginHeight = 0;
+ ((GridLayout)opvContainer.getLayout()).marginWidth = 0;
+ opvContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ ((GridData)opvContainer.getLayoutData()).horizontalSpan = 2;
toolkit.paintBordersFor(opvContainer);
final Label lblOpv = toolkit.createLabel(opvContainer, CndMessages.onParentVersionLabel, SWT.NONE);
lblOpv.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
final CCombo cbxOpvs = new CCombo(opvContainer, Styles.COMBO_STYLE);
- cbxOpvs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ cbxOpvs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
((GridData)cbxOpvs.getLayoutData()).heightHint = cbxOpvs.getItemHeight() + 4;
cbxOpvs.setToolTipText(CndMessages.onParentVersionToolTip);
toolkit.adapt(cbxOpvs, true, false);
@@ -596,7 +600,163 @@
}
{ // queryOps
- // TODO implement queryOps controls
+ final Collection<String> supportedQueryOps = Arrays.asList(this.propertyBeingEdited.getAvailableQueryOperators());
+ final Composite queryOpsContainer = toolkit.createComposite(attributesContainer);
+ queryOpsContainer.setLayout(new GridLayout(7, false));
+ ((GridLayout)queryOpsContainer.getLayout()).marginHeight = 0;
+ ((GridLayout)queryOpsContainer.getLayout()).marginWidth = 0;
+ queryOpsContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.paintBordersFor(queryOpsContainer);
+ toolkit.createLabel(queryOpsContainer, CndMessages.queryOperatorsLabel);
+
+ { // equals query operator
+ final Button btnEquals = toolkit.createButton(queryOpsContainer, QueryOperator.EQUALS.toString(), SWT.CHECK);
+ btnEquals.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnEquals.getText())) {
+ btnEquals.setSelection(true);
+ }
+
+ btnEquals.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnEquals.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
+
+ { // not equals query operator
+ final Button btnNotEquals = toolkit.createButton(queryOpsContainer, QueryOperator.NOT_EQUALS.toString(),
+ SWT.CHECK);
+ btnNotEquals.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnNotEquals.getText())) {
+ btnNotEquals.setSelection(true);
+ }
+
+ btnNotEquals.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnNotEquals.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
+
+ { // greater than query operator
+ final Button btnGreaterThan = toolkit.createButton(queryOpsContainer, QueryOperator.GREATER_THAN.toString(),
+ SWT.CHECK);
+ btnGreaterThan.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnGreaterThan.getText())) {
+ btnGreaterThan.setSelection(true);
+ }
+
+ btnGreaterThan.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnGreater.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
+
+ { // less than query operator
+ final Button btnLessThan = toolkit.createButton(queryOpsContainer, QueryOperator.LESS_THAN.toString(),
+ SWT.CHECK);
+ btnLessThan.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnLessThan.getText())) {
+ btnLessThan.setSelection(true);
+ }
+
+ btnLessThan.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnLess.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
+
+ { // greater than or equal query operator
+ final Button btnGreaterThanEqual = toolkit.createButton(queryOpsContainer,
+ QueryOperator.GREATER_THAN_EQUALS.toString(), SWT.CHECK);
+ btnGreaterThanEqual.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnGreaterThanEqual.getText())) {
+ btnGreaterThanEqual.setSelection(true);
+ }
+
+ btnGreaterThanEqual.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnGreaterEqual.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
+
+ { // less than or equals query operator
+ final Button btnLessThanEqual = toolkit.createButton(queryOpsContainer,
+ QueryOperator.LESS_THAN_EQUALS.toString(), SWT.CHECK);
+ btnLessThanEqual.setBackground(attributesContainer.getBackground());
+
+ if (supportedQueryOps.contains(btnLessThanEqual.getText())) {
+ btnLessThanEqual.setSelection(true);
+ }
+
+ btnLessThanEqual.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( final SelectionEvent e ) {
+ Button btn = (Button)e.widget;
+ handleQueryOperatorChanged(btn.getText(), btn.getSelection());
+ }
+ });
+ // btnLessThanEqual.setToolTipText(CndMessages.multipleAttributeToolTip);
+ }
}
}
@@ -719,6 +879,19 @@
validateType();
}
+ /**
+ * @param text
+ * @param selection
+ */
+ protected void handleQueryOperatorChanged( String text,
+ boolean selection ) {
+ if (selection) {
+ this.propertyBeingEdited.addQueryOperator(QueryOperator.find(text));
+ } else {
+ this.propertyBeingEdited.removeQueryOperator(QueryOperator.find(text));
+ }
+ }
+
void createValueConstraintsActions() {
this.addValueConstraint = new Action(Utils.EMPTY_STRING) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties 2012-03-30 18:35:02 UTC (rev 39948)
@@ -64,6 +64,10 @@
cndEditorSaveError = Error saving the model extension definition editor.
cndEditorSourcePageTitle = Source
cndEditorTitle = JCR Compact Node Definition
+# 0 = name of CND, 1 = number of errors, 2 = number of warnings, 3 = number of info
+cndMessageDialogMessageAreaMessage = The {0} CND has {1} error(s), {2} warnings, and {3} information messages.
+cndMessageDialogMessageAreaTitle = Message Summary
+cndMessageDialogTitle = CND Validation Messages
defaultTypeHeaderText = Default Type
defaultValueDialogCreateMsg = Create Default Value
defaultValueDialogEditMsg = Edit Default Value
@@ -207,6 +211,7 @@
qualifierLabel = Namespace:
queryableAttribute = Queryable
queryableAttributeToolTip = Indicates if the child node definition supports siblings of the same name
+queryOperatorsLabel = Supported Query Operators:
requiredTypesHeaderText = Required Types
requiredTypesLabel = Required Types:
sameNamedSiblingsAttribute = Same Named Siblings
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/UiMessages.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/UiMessages.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/UiMessages.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -25,6 +25,11 @@
public static String infoDialogTitle;
/**
+ * The table column header title for a message.
+ */
+ public static String messageColumnHeader;
+
+ /**
* The title of a generic question message dialog.
*/
public static String questionDialogTitle;
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageLabelProvider.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageLabelProvider.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageLabelProvider.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.ui.forms;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.forms.IMessage;
+import org.jboss.tools.modeshape.ui.Activator;
+import org.jboss.tools.modeshape.ui.UiUtils;
+
+/**
+ * A label provider for {@link IMessage}s.
+ */
+public class MessageLabelProvider extends ColumnLabelProvider {
+
+ private final boolean messageTypeFlag;
+
+ /**
+ * @param messageTypeFlag a flag indicating if the {@link TableViewerColumn} is message type column or the the message column.
+ */
+ public MessageLabelProvider( final boolean messageTypeFlag ) {
+ this.messageTypeFlag = messageTypeFlag;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage( final Object element ) {
+ if (this.messageTypeFlag) {
+ final ISharedImages sharedImages = Activator.getSharedInstance().getWorkbench().getSharedImages();
+ final int messageType = ((IMessage)element).getMessageType();
+
+ if (messageType == IMessageProvider.ERROR) {
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ }
+
+ if (messageType == IMessageProvider.WARNING) {
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ }
+
+ if (messageType == IMessageProvider.INFORMATION) {
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText( final Object element ) {
+ if (this.messageTypeFlag) {
+ return UiUtils.EMPTY_STRING;
+ }
+
+ final IMessage message = (IMessage)element;
+ return message.getMessage();
+ }
+}
\ No newline at end of file
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageLabelProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageSummaryDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageSummaryDialog.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageSummaryDialog.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.ui.forms;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.forms.FormDialog;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.jboss.tools.modeshape.ui.UiMessages;
+import org.jboss.tools.modeshape.ui.UiUtils;
+
+/**
+ * A dialog that displays messages in a table.
+ */
+public class MessageSummaryDialog extends FormDialog {
+
+ private final String dialogTitle;
+ private final String messageAreaMessage;
+ private final String messageAreaTitle;
+ private final int messageType;
+ private final IMessage[] messages;
+
+ /**
+ * @param parent the parent (can be <code>null</code>)
+ * @param dialogTitle the dialog window title (cannot be <code>null</code> or empty)
+ * @param messageAreaTitle the message area title (cannot be <code>null</code> or empty)
+ * @param messageAreaMessage the message area message (cannot be <code>null</code> or empty)
+ * @param messageType the message type (see {@link IMessageProvider})
+ * @param messages the messages being displayed (cannot be <code>null</code>)
+ */
+ public MessageSummaryDialog( final Shell parent,
+ final String dialogTitle,
+ final String messageAreaTitle,
+ final String messageAreaMessage,
+ final int messageType,
+ final IMessage[] messages ) {
+ super(parent);
+ this.dialogTitle = dialogTitle;
+ this.messages = messages;
+ this.messageAreaTitle = messageAreaTitle;
+ this.messageAreaMessage = messageAreaMessage;
+ this.messageType = messageType;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( final Shell newShell ) {
+ super.configureShell(newShell);
+ newShell.setText(this.dialogTitle);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void createButtonsForButtonBar( Composite parent ) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.forms.FormDialog#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
+ protected void createFormContent( final IManagedForm managedForm ) {
+ final ScrolledForm scrolledForm = managedForm.getForm();
+ scrolledForm.setText(this.messageAreaTitle); // set header area title
+ scrolledForm.setMessage(this.messageAreaMessage, this.messageType, this.messages);
+ scrolledForm.getBody().setLayout(new GridLayout());
+ scrolledForm.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ final FormToolkit toolkit = managedForm.getToolkit();
+ final Composite container = toolkit.createComposite(managedForm.getForm().getBody());
+ container.setLayout(new GridLayout());
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.paintBordersFor(container);
+
+ int count = this.messages.length;
+
+ if (count > 20) {
+ count = 20;
+ } else {
+ count += 2;
+ }
+
+ final Table table = FormUtils.createTable(toolkit, container);
+ final GridData gd = (GridData)table.getLayoutData();
+ gd.heightHint = table.getItemHeight() * count;
+ gd.minimumHeight = gd.heightHint;
+
+ final TableViewer viewer = new TableViewer(table);
+ viewer.setLabelProvider(new LabelProvider());
+ viewer.setContentProvider(new IStructuredContentProvider() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements( final Object inputElement ) {
+ return getMessages();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public void inputChanged( final Viewer viewer,
+ final Object oldInput,
+ final Object newInput ) {
+ // nothing to do
+ }
+ });
+
+ { // create message type column
+ final TableViewerColumn messageTypeColumn = new TableViewerColumn(viewer, SWT.CENTER);
+ UiUtils.configureColumn(messageTypeColumn, new MessageLabelProvider(true), UiUtils.EMPTY_STRING, UiUtils.EMPTY_STRING,
+ false, false);
+ }
+
+ { // create message column
+ final TableViewerColumn messageColumn = new TableViewerColumn(viewer, SWT.LEFT);
+ UiUtils.configureColumn(messageColumn, new MessageLabelProvider(false), UiMessages.messageColumnHeader,
+ UiUtils.EMPTY_STRING, false, true);
+ }
+
+ // this will sort by child node name
+ viewer.setSorter(new MessageViewerSorter());
+
+ // populate table with data
+ viewer.setInput(this);
+
+ // size columns to the data
+ UiUtils.pack(viewer);
+ }
+
+ IMessage[] getMessages() {
+ return this.messages;
+ }
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageSummaryDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageViewerSorter.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageViewerSorter.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageViewerSorter.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.ui.forms;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.ui.forms.IMessage;
+
+/**
+ * A structured viewer sorter for {@link IMessage}s.
+ */
+public class MessageViewerSorter extends ViewerSorter {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare( Viewer viewer,
+ Object thisMessage,
+ Object thatMessage ) {
+ int thisMsgType = ((IMessage)thisMessage).getMessageType();
+ int thatMsgType = ((IMessage)thatMessage).getMessageType();
+
+ return Integer.valueOf(thisMsgType).compareTo(Integer.valueOf(thatMsgType));
+ }
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/MessageViewerSorter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/uiMessages.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/uiMessages.properties 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/uiMessages.properties 2012-03-30 18:35:02 UTC (rev 39948)
@@ -6,5 +6,6 @@
errorDialogTitle = Error
infoDialogTitle = Info
+messageColumnHeader = Message
questionDialogTitle = Question
warningDialogTitle = Warning
\ No newline at end of file
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinitionTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinitionTest.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinitionTest.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -195,11 +195,16 @@
}
@Test
- public void shouldAddQueryOperator() {
- final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
- assertTrue(this.propDefn.addQueryOperator(OP));
- assertEquals(1, this.propDefn.getAvailableQueryOperators().length);
- assertEquals(OP.toString(), this.propDefn.getAvailableQueryOperators()[0]);
+ public void shouldSupportAllQueryOperatorsInitially() {
+ // setup
+ String[] queryOps = this.propDefn.getAvailableQueryOperators();
+ QueryOperator[] allOperators = QueryOperator.values();
+
+ assertEquals(allOperators.length, queryOps.length);
+
+ for (String queryOp : queryOps) {
+ QueryOperator.find(queryOp); // throws exception if not found
+ }
}
@Test
@@ -378,9 +383,7 @@
@Test
public void shouldNotAddDuplicateQueryOperator() {
- final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
- assertTrue(this.propDefn.addQueryOperator(OP));
- assertFalse(this.propDefn.addQueryOperator(OP));
+ assertFalse(this.propDefn.addQueryOperator(QueryOperator.EQUALS));
}
@Test
@@ -460,6 +463,7 @@
@Test
public void shouldNotRemoveQueryOperatorThatDoesNotExist() {
+ assertTrue(this.propDefn.removeQueryOperator(QueryOperator.GREATER_THAN_EQUALS));
assertFalse(this.propDefn.removeQueryOperator(QueryOperator.GREATER_THAN_EQUALS));
}
@@ -621,12 +625,15 @@
@Test
public void shouldReceiveEventWhenQueryOperatorIsAdded() {
+ // setup
+ final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
+ assertTrue(this.propDefn.removeQueryOperator(OP));
+
final Listener l = new Listener();
assertTrue(this.propDefn.addListener(l));
- final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
+ // test
assertTrue(this.propDefn.addQueryOperator(OP));
-
assertEquals(1, l.getCount());
assertEquals(PropertyName.QUERY_OPS.toString(), l.getPropertyName());
assertEquals(OP, l.getNewValue());
@@ -636,8 +643,6 @@
@Test
public void shouldReceiveEventWhenQueryOperatorIsRemoved() {
final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
- assertTrue(this.propDefn.addQueryOperator(OP));
-
final Listener l = new Listener();
assertTrue(this.propDefn.addListener(l));
@@ -658,9 +663,7 @@
@Test
public void shouldRemoveQueryOperator() {
- final QueryOperator OP = QueryOperator.GREATER_THAN_EQUALS;
- assertTrue(this.propDefn.addQueryOperator(OP));
- assertTrue(this.propDefn.removeQueryOperator(OP));
+ assertTrue(this.propDefn.removeQueryOperator(QueryOperator.GREATER_THAN_EQUALS));
}
@Test
@@ -808,8 +811,6 @@
@Test
public void shouldSetQueryOperators() {
- assertTrue(this.propDefn.addQueryOperator(QueryOperator.GREATER_THAN_EQUALS));
-
final String OP1 = QueryOperator.EQUALS.toString();
final String OP2 = QueryOperator.LESS_THAN.toString();
final String OP3 = QueryOperator.GREATER_THAN.toString();
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributesTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributesTest.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PropertyAttributesTest.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -97,10 +97,10 @@
}
@Test
- public void shouldNotHaveQueryOpsAfterConstruction() {
+ public void shouldSupportQueryOpsAfterConstruction() {
final QueryOperators attribute = this.attributes.getQueryOps();
- assertTrue(attribute.isNot());
- assertFalse(attribute.is());
+ assertTrue(attribute.is());
+ assertFalse(attribute.isNot());
assertFalse(attribute.isVariant());
}
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperatorsTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperatorsTest.java 2012-03-30 17:13:09 UTC (rev 39947)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/QueryOperatorsTest.java 2012-03-30 18:35:02 UTC (rev 39948)
@@ -36,10 +36,17 @@
@Before
public void beforeEach() {
- this.attribute = new QueryOperators();
+ this.attribute = new QueryOperators(); // initially supports all operators
}
@Test
+ public void shouldSupportAllOperatorsAfterConstruction() {
+ for (final QueryOperator operator : QueryOperator.values()) {
+ assertTrue(this.attribute.supports(operator));
+ }
+ }
+
+ @Test
public void initialCndNotationShouldBeEmpty() {
assertTrue(Utils.isEmpty(this.attribute.toCndNotation(CndElement.NotationType.LONG)));
assertTrue(Utils.isEmpty(this.attribute.toCndNotation(CndElement.NotationType.COMPRESSED)));
@@ -53,28 +60,39 @@
}
@Test
+ public void shouldAddUsingOperatorNotation() {
+ // setup
+ remove(OPERATOR_ONE);
+ assertTrue(this.attribute.add(OPERATOR_ONE.toString()));
+
+ // test
+ assertTrue(this.attribute.supports(OPERATOR_ONE));
+ }
+
+ @Test
+ public void shouldRemoveUsingOperatorNotation() {
+ assertTrue(this.attribute.remove(OPERATOR_ONE.toString()));
+ }
+
+ @Test
public void verifyAddedItem() {
// setup
+ remove(OPERATOR_ONE);
add(OPERATOR_ONE);
// tests
- assertEquals(1, this.attribute.getSupportedItems().size());
- assertTrue(this.attribute.getSupportedItems().contains(OPERATOR_ONE));
+ assertTrue(this.attribute.supports(OPERATOR_ONE));
}
@Test
- public void verifyInitiallyNoSupportedItems() {
- assertEquals(0, this.attribute.getSupportedItems().size());
+ public void verifyInitialStateShouldBeIs() {
+ assertEquals(AttributeState.Value.IS, this.attribute.get());
}
@Test
- public void verifyInitialStateShouldBeIsNot() {
- assertEquals(AttributeState.Value.IS_NOT, this.attribute.get());
- }
-
- @Test
public void verifyMultipleElementsCndNotation() {
// setup
+ assertTrue(this.attribute.clear());
add(OPERATOR_ONE);
add(OPERATOR_TWO);
add(OPERATOR_THREE);
@@ -88,6 +106,7 @@
@Test
public void verifyOneElementCndNotation() {
// setup
+ assertTrue(this.attribute.clear());
add(OPERATOR_ONE);
// tests
@@ -99,44 +118,26 @@
@Test
public void verifyRemoveItem() {
// setup
- add(OPERATOR_ONE);
- add(OPERATOR_TWO);
remove(OPERATOR_ONE);
// tests
- assertFalse(this.attribute.getSupportedItems().contains(OPERATOR_ONE));
+ assertFalse(this.attribute.supports(OPERATOR_ONE));
}
@Test
public void verifySameElementIsNotAdded() {
- // setup
- add(OPERATOR_ONE);
-
// tests
if (this.attribute.add(OPERATOR_ONE)) {
fail();
}
-
- assertEquals(1, this.attribute.getSupportedItems().size());
}
@Test
- public void verifyStateShouldBeIsAfterAdd() {
+ public void verifyStateShouldBeIsNotAfterClear() {
// setup
- add(QueryOperator.EQUALS);
+ assertTrue(this.attribute.clear());
// tests
- assertEquals(AttributeState.Value.IS, this.attribute.get());
- }
-
- @Test
- public void verifyStateShouldBeIsNotWhenEmpty() {
- // setup
- add(OPERATOR_ONE);
- remove(OPERATOR_ONE);
-
- // tests
- assertEquals(0, this.attribute.getSupportedItems().size());
assertEquals(AttributeState.Value.IS_NOT, this.attribute.get());
}
@@ -150,5 +151,4 @@
assertEquals(QUERY_OPS_VARIANT_COMPRESSED_FORM, this.attribute.toCndNotation(CndElement.NotationType.COMPRESSED));
assertEquals(QUERY_OPS_VARIANT_LONG_FORM, this.attribute.toCndNotation(CndElement.NotationType.LONG));
}
-
}
12 years, 8 months
JBoss Tools SVN: r39947 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: console and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-03-30 13:13:09 -0400 (Fri, 30 Mar 2012)
New Revision: 39947
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
Log:
Some actions on OpenShift console view do not have sense for more applications JBIDE-11109
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -14,6 +14,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.navigator.CommonViewer;
@@ -27,10 +28,17 @@
protected ISelection selection = null;
protected StructuredViewer viewer;
+
+ private boolean enableForSingleElement = false;
public AbstractAction(String text) {
super(text);
}
+
+ public AbstractAction(String text, boolean enableForSingleElement) {
+ super(text);
+ this.enableForSingleElement = enableForSingleElement;
+ }
public AbstractAction(String text, ImageDescriptor image) {
super(text, image);
@@ -42,6 +50,13 @@
if (source instanceof CommonViewer) {
this.viewer = (CommonViewer) source;
this.selection = ((CommonViewer) source).getSelection();
+ if(enableForSingleElement){
+ if(selection instanceof ITreeSelection && ((ITreeSelection) selection).size() == 1){
+ setEnabled(true);
+ }else{
+ setEnabled(false);
+ }
+ }
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -44,7 +44,7 @@
public class CreateServerAdapterAction extends AbstractAction {
public CreateServerAdapterAction() {
- super(OpenShiftExpressUIMessages.CREATE_SERVER_ADAPTER_ACTION);
+ super(OpenShiftExpressUIMessages.CREATE_SERVER_ADAPTER_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("edit.gif"));
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteConnectionAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -21,7 +21,7 @@
public class DeleteConnectionAction extends AbstractAction {
public DeleteConnectionAction() {
- super(OpenShiftExpressUIMessages.DELETE_CONNECTION_ACTION);
+ super(OpenShiftExpressUIMessages.DELETE_CONNECTION_ACTION, true);
}
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -28,7 +28,7 @@
public class EditCartridgesAction extends AbstractAction {
public EditCartridgesAction() {
- super(OpenShiftExpressUIMessages.EDIT_CARTRIDGES_ACTION);
+ super(OpenShiftExpressUIMessages.EDIT_CARTRIDGES_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("task-repository-new.gif"));
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -30,7 +30,7 @@
public class ImportApplicationAction extends AbstractAction {
public ImportApplicationAction() {
- super(OpenShiftExpressUIMessages.IMPORT_APPLICATION_ACTION);
+ super(OpenShiftExpressUIMessages.IMPORT_APPLICATION_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("go-into.gif"));
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -25,7 +25,7 @@
public class OpenInWebBrowserAction extends AbstractAction {
public OpenInWebBrowserAction() {
- super(OpenShiftExpressUIMessages.SHOW_IN_BROWSER_ACTION);
+ super(OpenShiftExpressUIMessages.SHOW_IN_BROWSER_ACTION, true);
setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("open-browser.gif"));
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -21,7 +21,7 @@
public class ShowPropertiesAction extends AbstractAction {
public ShowPropertiesAction() {
- super(OpenShiftExpressUIMessages.SHOW_PROPERTIES_VIEW_ACTION);
+ super(OpenShiftExpressUIMessages.SHOW_PROPERTIES_VIEW_ACTION, true);
}
/*
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-03-30 17:13:09 UTC (rev 39947)
@@ -55,7 +55,7 @@
* Constructor
*/
public TailServerLogAction() {
- super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION);
+ super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION, true);
IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
setImageDescriptor(desc.getImageDescriptor());
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-03-30 16:37:30 UTC (rev 39946)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-03-30 17:13:09 UTC (rev 39947)
@@ -6,7 +6,7 @@
#
SHOW_IN_ACTION_GROUP=Show In
SHOW_IN_BROWSER_ACTION=Web Browser
-DELETE_APPLICATION_ACTION=Delete Application
+DELETE_APPLICATION_ACTION=Delete Application(s)
CREATE_APPLICATION_ACTION=New OpenShift Application
IMPORT_APPLICATION_ACTION=Import Application
CREATE_SERVER_ADAPTER_ACTION=Create a Server Adapter
12 years, 8 months
JBoss Tools SVN: r39946 - trunk/build/aggregate/soatests-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-30 12:37:30 -0400 (Fri, 30 Mar 2012)
New Revision: 39946
Modified:
trunk/build/aggregate/soatests-site/site.xml
Log:
add org.jboss.tools.runtime.soa.test.feature.source to soatests-site
Modified: trunk/build/aggregate/soatests-site/site.xml
===================================================================
--- trunk/build/aggregate/soatests-site/site.xml 2012-03-30 16:23:26 UTC (rev 39945)
+++ trunk/build/aggregate/soatests-site/site.xml 2012-03-30 16:37:30 UTC (rev 39946)
@@ -32,8 +32,8 @@
<feature url="features/org.jboss.tools.jbpm3.test.feature.source_0.0.0.jar" id="org.jboss.tools.jbpm3.test.feature.source" version="0.0.0"><category name="JBoss Tools - SOA Tooling Tests"/></feature>
<feature url="features/org.jboss.tools.jbpm4.test.feature.source_0.0.0.jar" id="org.jboss.tools.jbpm4.test.feature.source" version="0.0.0"><category name="JBoss Tools - SOA Tooling Tests"/></feature>
<feature url="features/org.jboss.tools.modeshape.rest.test.feature.source_0.0.0.jar" id="org.jboss.tools.modeshape.rest.test.feature.source" version="0.0.0"><category name="JBoss Tools - SOA Tooling Tests"/></feature>
+-->
<feature url="features/org.jboss.tools.runtime.soa.test.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature.source" version="0.0.0"><category name="JBoss Tools - SOA Tooling Tests"/></feature>
--->
<!-- disabled/deprecated/not included
<feature url="features/org.jboss.tools.smooks.test.feature_0.0.0.jar" id="org.jboss.tools.smooks.test.feature" version="0.0.0"><category name="JBoss Tools - SOA Tooling Tests"/></feature>
12 years, 8 months
JBoss Tools SVN: r39945 - in trunk/runtime-soa: features/org.jboss.tools.runtime.esb.detector.feature and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-30 12:23:26 -0400 (Fri, 30 Mar 2012)
New Revision: 39945
Modified:
trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml
trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml
trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml
trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml
trunk/runtime-soa/plugins/org.jboss.tools.runtime.drools.detector/build.properties
trunk/runtime-soa/plugins/org.jboss.tools.runtime.esb.detector/build.properties
trunk/runtime-soa/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties
trunk/runtime-soa/site/category.xml
Log:
add detector sources to runtime-soa site (JBIDE-8838, JBIDE-11077, JBIDE-11390)
Modified: trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/pom.xml 2012-03-30 16:23:26 UTC (rev 39945)
@@ -11,4 +11,37 @@
<artifactId>org.jboss.tools.runtime.drools.detector.feature</artifactId>
<packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <version>${tychoExtrasVersion}</version>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml 2012-03-30 16:23:26 UTC (rev 39945)
@@ -11,4 +11,37 @@
<artifactId>org.jboss.tools.runtime.esb.detector.feature</artifactId>
<packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <version>${tychoExtrasVersion}</version>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/pom.xml 2012-03-30 16:23:26 UTC (rev 39945)
@@ -11,4 +11,37 @@
<artifactId>org.jboss.tools.runtime.jbpm.detector.feature</artifactId>
<packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <version>${tychoExtrasVersion}</version>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml
===================================================================
--- trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/features/org.jboss.tools.runtime.soa.test.feature/pom.xml 2012-03-30 16:23:26 UTC (rev 39945)
@@ -11,4 +11,37 @@
<artifactId>org.jboss.tools.runtime.soa.test.feature</artifactId>
<packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <version>${tychoExtrasVersion}</version>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/runtime-soa/plugins/org.jboss.tools.runtime.drools.detector/build.properties
===================================================================
--- trunk/runtime-soa/plugins/org.jboss.tools.runtime.drools.detector/build.properties 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/plugins/org.jboss.tools.runtime.drools.detector/build.properties 2012-03-30 16:23:26 UTC (rev 39945)
@@ -1,5 +1,7 @@
source.. = src/
output.. = bin/
+src.includes = *
+src.excludes = src
bin.includes = META-INF/,\
.,\
plugin.xml,\
Modified: trunk/runtime-soa/plugins/org.jboss.tools.runtime.esb.detector/build.properties
===================================================================
--- trunk/runtime-soa/plugins/org.jboss.tools.runtime.esb.detector/build.properties 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/plugins/org.jboss.tools.runtime.esb.detector/build.properties 2012-03-30 16:23:26 UTC (rev 39945)
@@ -1,5 +1,7 @@
source.. = src/
output.. = bin/
+src.includes = *
+src.excludes = src
bin.includes = META-INF/,\
.,\
plugin.xml,\
Modified: trunk/runtime-soa/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties
===================================================================
--- trunk/runtime-soa/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/plugins/org.jboss.tools.runtime.jbpm.detector/build.properties 2012-03-30 16:23:26 UTC (rev 39945)
@@ -1,5 +1,7 @@
source.. = src/
output.. = bin/
+src.includes = *
+src.excludes = src
bin.includes = META-INF/,\
.,\
plugin.xml,\
Modified: trunk/runtime-soa/site/category.xml
===================================================================
--- trunk/runtime-soa/site/category.xml 2012-03-30 16:23:06 UTC (rev 39944)
+++ trunk/runtime-soa/site/category.xml 2012-03-30 16:23:26 UTC (rev 39945)
@@ -20,4 +20,18 @@
<feature url="features/org.jboss.tools.runtime.soa.test.feature_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature" version="0.0.0">
<category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
</feature>
+
+ <!-- TODO: add sources -->
+ <feature url="features/org.jboss.tools.runtime.drools.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.drools.detector.feature.source" version="0.0.0">
+ <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.esb.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.esb.detector.feature.source" version="0.0.0">
+ <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.jbpm.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature.source" version="0.0.0">
+ <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.soa.test.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.soa.test.feature.source" version="0.0.0">
+ <category name="JBoss Tools runtime-soa Nightly Build Update Site"/>
+ </feature>
</site>
12 years, 8 months
JBoss Tools SVN: r39944 - in trunk/runtime-soa/features: org.jboss.tools.runtime.drools.detector.feature/sourceTemplateFeature and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-30 12:23:06 -0400 (Fri, 30 Mar 2012)
New Revision: 39944
Added:
trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/sourceTemplateFeature/
trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/sourceTemplateFeature/.gitkeep
trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/sourceTemplateFeature/
trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/sourceTemplateFeature/.gitkeep
trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/sourceTemplateFeature/
trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/sourceTemplateFeature/.gitkeep
Log:
add missing sourceTemplateFeature/.gitkeep files
Added: trunk/runtime-soa/features/org.jboss.tools.runtime.drools.detector.feature/sourceTemplateFeature/.gitkeep
===================================================================
Added: trunk/runtime-soa/features/org.jboss.tools.runtime.esb.detector.feature/sourceTemplateFeature/.gitkeep
===================================================================
Added: trunk/runtime-soa/features/org.jboss.tools.runtime.jbpm.detector.feature/sourceTemplateFeature/.gitkeep
===================================================================
12 years, 8 months
JBoss Tools SVN: r39943 - trunk/build/aggregate/coretests-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-30 10:48:58 -0400 (Fri, 30 Mar 2012)
New Revision: 39943
Modified:
trunk/build/aggregate/coretests-site/index.html
Log:
update index
Modified: trunk/build/aggregate/coretests-site/index.html
===================================================================
--- trunk/build/aggregate/coretests-site/index.html 2012-03-30 14:48:50 UTC (rev 39942)
+++ trunk/build/aggregate/coretests-site/index.html 2012-03-30 14:48:58 UTC (rev 39943)
@@ -82,10 +82,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature_3.2.1.v20120327-1000-H781-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature_3.2.1.v20120330-1032-H793-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.2.1.v20120327-1000-H781-Beta3</span>
+<span style="font-size:x-small">3.2.1.v20120330-1032-H793-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -97,10 +97,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature.source_3.2.1.v20120327-1000-H781-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature.source_3.2.1.v20120330-1032-H793-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.2.1.v20120327-1000-H781-Beta3</span>
+<span style="font-size:x-small">3.2.1.v20120330-1032-H793-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -112,10 +112,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature_2.3.0.v20120327-1018-H1191-Beta3.jar">org.jboss.ide.eclipse.as.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature_2.3.0.v20120330-1057-H1203-Beta3.jar">org.jboss.ide.eclipse.as.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120327-1018-H1191-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120330-1057-H1203-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -127,10 +127,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature.source_2.3.0.v20120327-1018-H1191-Beta3.jar">org.jboss.ide.eclipse.as.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature.source_2.3.0.v20120330-1057-H1203-Beta3.jar">org.jboss.ide.eclipse.as.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120327-1018-H1191-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120330-1057-H1203-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -142,10 +142,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature_1.2.0.v20120327-1739-H778-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature_1.2.0.v20120330-1032-H790-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1739-H778-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1032-H790-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -157,10 +157,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature.source_1.2.0.v20120327-1739-H778-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature.source_1.2.0.v20120330-1032-H790-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1739-H778-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1032-H790-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -172,10 +172,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature_1.3.0.v20120327-1000-H801-Beta3.jar">org.jboss.tools.birt.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature_1.3.0.v20120330-1038-H812-Beta3.jar">org.jboss.tools.birt.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120327-1000-H801-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120330-1038-H812-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -187,10 +187,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature.source_1.3.0.v20120327-1000-H801-Beta3.jar">org.jboss.tools.birt.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature.source_1.3.0.v20120330-1038-H812-Beta3.jar">org.jboss.tools.birt.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120327-1000-H801-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120330-1038-H812-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -202,10 +202,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.seam.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature_1.2.0.v20120330-1157-H1000-Beta3.jar">org.jboss.tools.cdi.seam.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1157-H1000-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -217,10 +217,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature.source_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.seam.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature.source_1.2.0.v20120330-1157-H1000-Beta3.jar">org.jboss.tools.cdi.seam.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1157-H1000-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -232,10 +232,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature_1.2.0.v20120330-1157-H1000-Beta3.jar">org.jboss.tools.cdi.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1157-H1000-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -247,10 +247,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature.source_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature.source_1.2.0.v20120330-1157-H1000-Beta3.jar">org.jboss.tools.cdi.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1157-H1000-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -277,10 +277,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature_3.3.0.v20120327-0859-H801-Beta3.jar">org.jboss.tools.common.all.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature_3.3.0.v20120330-0940-H811-Beta3.jar">org.jboss.tools.common.all.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-0859-H801-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-0940-H811-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -292,10 +292,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature.source_3.3.0.v20120327-0859-H801-Beta3.jar">org.jboss.tools.common.all.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature.source_3.3.0.v20120330-0940-H811-Beta3.jar">org.jboss.tools.common.all.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-0859-H801-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-0940-H811-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -307,10 +307,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature_1.0.0.v20120327-0956-H612-Beta3.jar">org.jboss.tools.forge.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature_1.0.0.v20120329-0618-H619-Beta3.jar">org.jboss.tools.forge.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.0.0.v20120327-0956-H612-Beta3</span>
+<span style="font-size:x-small">1.0.0.v20120329-0618-H619-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -322,10 +322,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature.source_1.0.0.v20120327-0956-H612-Beta3.jar">org.jboss.tools.forge.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature.source_1.0.0.v20120329-0618-H619-Beta3.jar">org.jboss.tools.forge.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.0.0.v20120327-0956-H612-Beta3</span>
+<span style="font-size:x-small">1.0.0.v20120329-0618-H619-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -337,10 +337,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature_1.2.0.v20120327-0954-H725-Beta3.jar">org.jboss.tools.jmx.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature_1.2.0.v20120330-1036-H733-Beta3.jar">org.jboss.tools.jmx.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-0954-H725-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1036-H733-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -352,10 +352,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature.source_1.2.0.v20120327-0954-H725-Beta3.jar">org.jboss.tools.jmx.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature.source_1.2.0.v20120330-1036-H733-Beta3.jar">org.jboss.tools.jmx.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120327-0954-H725-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120330-1036-H733-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -367,10 +367,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature_3.3.0.v20120327-1148-H804-Beta3.jar">org.jboss.tools.jsf.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature_3.3.0.v20120330-1328-H815-Beta3.jar">org.jboss.tools.jsf.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1148-H804-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1328-H815-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -382,10 +382,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature.source_3.3.0.v20120327-1148-H804-Beta3.jar">org.jboss.tools.jsf.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature.source_3.3.0.v20120330-1328-H815-Beta3.jar">org.jboss.tools.jsf.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1148-H804-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1328-H815-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -397,10 +397,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature_3.3.0.v20120327-1023-H938-Beta3.jar">org.jboss.tools.jst.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature_3.3.0.v20120330-1039-H951-Beta3.jar">org.jboss.tools.jst.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1023-H938-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1039-H951-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -412,10 +412,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature.source_3.3.0.v20120327-1023-H938-Beta3.jar">org.jboss.tools.jst.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature.source_3.3.0.v20120330-1039-H951-Beta3.jar">org.jboss.tools.jst.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1023-H938-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1039-H951-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -457,10 +457,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature_2.3.0.v20120327-1112-H344-Beta3.jar">org.jboss.tools.openshift.express.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature_2.3.0.v20120330-1152-H354-Beta3.jar">org.jboss.tools.openshift.express.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120327-1112-H344-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120330-1152-H354-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -472,10 +472,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature.source_2.3.0.v20120327-1112-H344-Beta3.jar">org.jboss.tools.openshift.express.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature.source_2.3.0.v20120330-1152-H354-Beta3.jar">org.jboss.tools.openshift.express.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120327-1112-H344-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120330-1152-H354-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -547,10 +547,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.runtime.test.feature_1.3.0.v20120327-1524-H681-Beta3.jar">org.jboss.tools.runtime.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.test.feature_1.3.0.v20120329-2010-Beta3.jar">org.jboss.tools.runtime.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120327-1524-H681-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120329-2010-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -562,10 +562,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature_3.3.0.v20120327-1334-H894-Beta3.jar">org.jboss.tools.seam.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.test.feature.source_1.3.0.v20120329-2010-Beta3.jar">org.jboss.tools.runtime.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1334-H894-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120329-2010-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -577,10 +577,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature.source_3.3.0.v20120327-1334-H894-Beta3.jar">org.jboss.tools.seam.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature_3.3.0.v20120330-0711-H898-Beta3.jar">org.jboss.tools.seam.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1334-H894-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-0711-H898-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -592,10 +592,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature_3.3.0.v20120327-1150-H700-Beta3.jar">org.jboss.tools.struts.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature.source_3.3.0.v20120330-0711-H898-Beta3.jar">org.jboss.tools.seam.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1150-H700-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-0711-H898-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -607,10 +607,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature.source_3.3.0.v20120327-1150-H700-Beta3.jar">org.jboss.tools.struts.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature_3.3.0.v20120330-1256-H710-Beta3.jar">org.jboss.tools.struts.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1150-H700-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1256-H710-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -622,10 +622,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.test.feature_3.2.0.v20120327-0753-H630-Beta3.jar">org.jboss.tools.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature.source_3.3.0.v20120330-1256-H710-Beta3.jar">org.jboss.tools.struts.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.2.0.v20120327-0753-H630-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1256-H710-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -637,10 +637,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.test.feature.source_3.2.0.v20120327-0753-H630-Beta3.jar">org.jboss.tools.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.test.feature_3.2.0.v20120330-0857-H639-Beta3.jar">org.jboss.tools.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.2.0.v20120327-0753-H630-Beta3</span>
+<span style="font-size:x-small">3.2.0.v20120330-0857-H639-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -652,10 +652,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature_1.1.0.v20120327-0943-H639-Beta3.jar">org.jboss.tools.usage.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.test.feature.source_3.2.0.v20120330-0857-H639-Beta3.jar">org.jboss.tools.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.1.0.v20120327-0943-H639-Beta3</span>
+<span style="font-size:x-small">3.2.0.v20120330-0857-H639-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -667,10 +667,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature.source_1.1.0.v20120327-0943-H639-Beta3.jar">org.jboss.tools.usage.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature_1.1.0.v20120330-1025-H647-Beta3.jar">org.jboss.tools.usage.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.1.0.v20120327-0943-H639-Beta3</span>
+<span style="font-size:x-small">1.1.0.v20120330-1025-H647-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -682,10 +682,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.vpe.test.feature_3.3.0.v20120327-1055-H899-Beta3.jar">org.jboss.tools.vpe.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature.source_1.1.0.v20120330-1025-H647-Beta3.jar">org.jboss.tools.usage.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120327-1055-H899-Beta3</span>
+<span style="font-size:x-small">1.1.0.v20120330-1025-H647-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -697,10 +697,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature_1.2.2.v20120327-1115-H853-Beta3.jar">org.jboss.tools.ws.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.test.feature_3.3.0.v20120330-1144-H913-Beta3.jar">org.jboss.tools.vpe.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.2.v20120327-1115-H853-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1144-H913-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -712,10 +712,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature.source_1.2.2.v20120327-1115-H853-Beta3.jar">org.jboss.tools.ws.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.test.feature.source_3.3.0.v20120330-1144-H913-Beta3.jar">org.jboss.tools.vpe.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.2.v20120327-1115-H853-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120330-1144-H913-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -723,6 +723,36 @@
JBoss Tools - Core Tests</span>
</td>
</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature_1.2.2.v20120330-0503-H860-Beta3.jar">org.jboss.tools.ws.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120330-0503-H860-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature.source_1.2.2.v20120330-0503-H860-Beta3.jar">org.jboss.tools.ws.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120330-0503-H860-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
<tr style="background-color:#DDDDDD">
<th style="font-size:small">Feature</th>
<th style="font-size:small">Version</th>
@@ -734,10 +764,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature_3.4.0.v20120327-1246-H840-Beta3.jar">org.hibernate.eclipse.test.feature</a>
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature_3.4.0.v20120330-1203-H853-Beta3.jar">org.hibernate.eclipse.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.4.0.v20120327-1246-H840-Beta3</span>
+<span style="font-size:x-small">3.4.0.v20120330-1203-H853-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -749,10 +779,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature.source_3.4.0.v20120327-1246-H840-Beta3.jar">org.hibernate.eclipse.test.feature.source</a>
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature.source_3.4.0.v20120330-1203-H853-Beta3.jar">org.hibernate.eclipse.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.4.0.v20120327-1246-H840-Beta3</span>
+<span style="font-size:x-small">3.4.0.v20120330-1203-H853-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
12 years, 8 months
JBoss Tools SVN: r39942 - trunk/runtime-soa.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-30 10:48:50 -0400 (Fri, 30 Mar 2012)
New Revision: 39942
Modified:
trunk/runtime-soa/pom.xml
Log:
reorder root pom
Modified: trunk/runtime-soa/pom.xml
===================================================================
--- trunk/runtime-soa/pom.xml 2012-03-30 14:48:41 UTC (rev 39941)
+++ trunk/runtime-soa/pom.xml 2012-03-30 14:48:50 UTC (rev 39942)
@@ -15,9 +15,9 @@
<packaging>pom</packaging>
<modules>
<module>plugins</module>
+ <module>tests</module>
<module>features</module>
<module>site</module>
- <module>tests</module>
</modules>
<!-- to build, need to resolve TP and upstream components
mvn clean install -f ../build/pom-soa-tooling.xml -Pruntime-soa-bootstrap,local.site,jbosstools-nightly-staging-composite,jbosstools-nightly-staging-composite-soa-tooling
12 years, 8 months