JBoss Tools SVN: r6112 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-05 08:59:38 -0500 (Tue, 05 Feb 2008)
New Revision: 6112
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java
Log:
JBIDE-1731
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java 2008-02-05 13:45:49 UTC (rev 6111)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRenameSupport.java 2008-02-05 13:59:38 UTC (rev 6112)
@@ -54,6 +54,14 @@
return "Rename " + PasteEnterNewNameSupport.getCapitalizedName(getTarget());
}
+ public String getSubtitle() {
+ XModelObject o = getTarget();
+ if(o == null) return "";
+ String element = o.getAttributeValue("element type");
+ if(element == null) return "";
+ return WizardKeys.toDisplayName(element);
+ }
+
public String getMessage(int stepId) {
String displayName = WizardKeys.getAttributeDisplayName(getEntityData()[0].getAttributeData()[0].getAttribute(), true);
return "Please enter new " + displayName + ".";
16 years, 3 months
JBoss Tools SVN: r6111 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-05 08:45:49 -0500 (Tue, 05 Feb 2008)
New Revision: 6111
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
Log:
http://jira.jboss.com/jira/browse/JBIDE-1729
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2008-02-05 13:17:50 UTC (rev 6110)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2008-02-05 13:45:49 UTC (rev 6111)
@@ -11,6 +11,27 @@
FileHibConfig3_Properties.WindowTitle=Edit Properties
FileHibConfig3_Properties.Title=Hibernate Configuration File 3.0
+HibConfig3PropertiesFolder_AddProperty.WindowTitle=Add Property
+HibConfig3PropertiesFolder_AddProperty.Title=Property
+
+HibConfig3MappingsFolder_AddMapping.WindowTitle=Add Mapping
+HibConfig3MappingsFolder_AddMapping.Title=Mapping
+
+HibConfig3CachesFolder_AddClassCache.WindowTitle=Add Class Cashe
+HibConfig3CachesFolder_AddClassCache.Title=Class Cashe
+
+HibConfig3CachesFolder_AddCollectionCache.WindowTitle=Add Collection Cashe
+HibConfig3CachesFolder_AddCollectionCache.Title=Collection Cashe
+
+HibConfig3EventsFolder_AddEvent.WindowTitle=Add Event
+HibConfig3EventsFolder_AddEvent.Title=Event
+
+HibConfig3ListenersFolder_AddListener.WindowTitle=Add Listener
+HibConfig3ListenersFolder_AddListener.Title=Listener
+
+HibConfig3Security_AddGrant.WindowTitle=Add Grant
+HibConfig3Security_AddGrant.Title=Grant
+
### File Hibernate
FileHibernate3=/model/noHelpYet.html
16 years, 3 months
JBoss Tools SVN: r6110 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-05 08:17:50 -0500 (Tue, 05 Feb 2008)
New Revision: 6110
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
Log:
http://jira.jboss.com/jira/browse/JBIDE-1727
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2008-02-05 12:46:35 UTC (rev 6109)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2008-02-05 13:17:50 UTC (rev 6110)
@@ -8,6 +8,8 @@
FileFolder_CreateFileHibConfig3_0.WindowTitle=New File Hibernate Config 3.0
FileFolder_CreateFileHibConfig3_0.Title=File Hibernate Config 3.0
+FileHibConfig3_Properties.WindowTitle=Edit Properties
+FileHibConfig3_Properties.Title=Hibernate Configuration File 3.0
### File Hibernate
FileHibernate3=/model/noHelpYet.html
16 years, 3 months
JBoss Tools SVN: r6109 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-02-05 07:46:35 -0500 (Tue, 05 Feb 2008)
New Revision: 6109
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java
Log:
missed RHDS leftover.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java 2008-02-05 12:03:16 UTC (rev 6108)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java 2008-02-05 12:46:35 UTC (rev 6109)
@@ -23,7 +23,7 @@
Shell shell;
public StrutsContributionManager(Shell shell) {
- super("Red Hat Developer Studio");
+ super("JBoss Tools Struts");
this.shell = shell;
}
16 years, 3 months
JBoss Tools SVN: r6108 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/help.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-05 07:03:16 -0500 (Tue, 05 Feb 2008)
New Revision: 6108
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
Log:
http://jira.jboss.com/jira/browse/JBIDE-1728
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-02-04 17:19:43 UTC (rev 6107)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-02-05 12:03:16 UTC (rev 6108)
@@ -316,6 +316,8 @@
FileWebApp24_Properties.Title=File Web Descriptor
FileWebApp24.editorTitle=Web XML Editor
FileWebApp25.editorTitle=Web XML Editor
+FileWebApp25_Properties.WindowTitle=Edit Properties
+FileWebApp25_Properties.Title=File Web Descriptor
WebAppFolderContextParams_CreateContextParam.WindowTitle=Add Context Param
16 years, 3 months
JBoss Tools SVN: r6107 - in trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test: ca and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-02-04 12:19:43 -0500 (Mon, 04 Feb 2008)
New Revision: 6107
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1717 Empty CA if EL used in atributes for JSF tags.
JUnit TestCase is added for the issue
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-02-04 17:08:09 UTC (rev 6106)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-02-04 17:19:43 UTC (rev 6107)
@@ -1,6 +1,7 @@
package org.jboss.tools.jst.jsp.test;
import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1704Test;
+import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1717Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
import org.jboss.tools.jst.jsp.test.ca.StrutsJspJbide1648Test;
@@ -16,6 +17,7 @@
suite.addTestSuite(StrutsJspJbide1648Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
suite.addTestSuite(JsfJspJbide1704Test.class);
+ suite.addTestSuite(JsfJspJbide1717Test.class);
return suite;
}
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-02-04 17:19:43 UTC (rev 6107)
@@ -0,0 +1,204 @@
+package org.jboss.tools.jst.jsp.test.ca;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jst.jsp.contentassist.RedHatCustomCompletionProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+
+public class JsfJspJbide1717Test extends TestCase {
+ TestProjectProvider provider = null;
+ IProject project = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJbide1704Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
+ private static final String INSERT_BEFORE_STRING = "<h:outputText";
+ private static final String INSERTION_BEGIN_STRING = "<h:outputText value=\"";
+ private static final String INSERTION_END_STRING = "\" />";
+ private static final String JSF_EXPR_STRING = "#{msg.greeting}";
+
+ public static Test suite() {
+ return new TestSuite(JsfJspJbide1717Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ Throwable exception = null;
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (Exception x) {
+ exception = x;
+ x.printStackTrace();
+ }
+ assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJstJspJbide1641() {
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+
+ IFile jspFile = project.getFile(PAGE_NAME);
+
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
+
+ FileEditorInput editorInput = new FileEditorInput(jspFile);
+ Throwable exception = null;
+ IEditorPart editorPart = null;
+ try {
+ editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
+ } catch (PartInitException ex) {
+ exception = ex;
+ ex.printStackTrace();
+ assertTrue("The JSP Visual Editor couldn't be initialized.", false);
+ }
+
+ JSPMultiPageEditor jspEditor = null;
+
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor)editorPart;
+
+ // Delay for 3 seconds so that
+ // the Favorites view can be seen.
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+ TestUtil.delay(3000);
+
+ JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
+ StructuredTextViewer viewer = jspTextEditor.getTextViewer();
+ IDocument document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
+ IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
+
+ assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
+
+ // Find start of <h:outputText> tag
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
+
+ assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1));
+
+ // First of all perform the test on a region placed in one space behind empty-valued attribute -
+ // this is to return normal list of attribute names proposal list
+
+ String documentContentModified = documentContent.substring(0, start) +
+ INSERTION_BEGIN_STRING + INSERTION_END_STRING + documentContent.substring(start);
+
+ int offsetToTest = start + INSERTION_BEGIN_STRING.length() + 2;
+
+ jspTextEditor.setText(documentContentModified);
+
+ ICompletionProposal[] result= null;
+ String errorMessage = null;
+
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offsetToTest);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
+ }
+
+// if (errorMessage != null && errorMessage.trim().length() > 0) {
+// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
+// }
+
+ List<String> customCompletionProposals = new ArrayList<String>();
+ for (int i = 0; i < result.length; i++) {
+ // There should be at least one proposal of type CustomCompletionProposal in the result
+ if (result[i] instanceof CustomCompletionProposal) {
+ customCompletionProposals.add(((CustomCompletionProposal)result[i]).getReplacementString());
+ }
+ }
+ assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
+
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ // Next perform the test on a region placed in one space behind an attribute those value is a container
+ // (contains JSF expression) - this has to return the same normal list of attribute names proposal list as
+ // we got at the first step (because the tag is the same, but only the attribute value is changed)
+
+ documentContentModified = documentContent.substring(0, start) +
+ INSERTION_BEGIN_STRING + JSF_EXPR_STRING + INSERTION_END_STRING + documentContent.substring(start);
+
+ offsetToTest = start + INSERTION_BEGIN_STRING.length() + JSF_EXPR_STRING.length() + 2;
+
+ String visualizeCursorPosition = documentContentModified.substring(0, offsetToTest) +
+ "|" + documentContentModified.substring(offsetToTest);
+
+ jspTextEditor.setText(documentContentModified);
+
+ p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offsetToTest);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
+ }
+
+// if (errorMessage != null && errorMessage.trim().length() > 0) {
+// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
+// }
+
+ for (int i = 0; i < result.length; i++) {
+ // There should be the same proposals as in the saved result
+ if (result[i] instanceof CustomCompletionProposal) {
+ assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
+ customCompletionProposals.contains(((CustomCompletionProposal)result[i]).getReplacementString()));
+ customCompletionProposals.remove(((CustomCompletionProposal)result[i]).getReplacementString());
+ }
+ }
+ assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .closeEditor(editorPart, false);
+ }
+
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 3 months
JBoss Tools SVN: r6106 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-02-04 12:08:09 -0500 (Mon, 04 Feb 2008)
New Revision: 6106
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
Log:
Code adjustment
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsAllTests.java 2008-02-04 17:07:20 UTC (rev 6105)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsAllTests.java 2008-02-04 17:08:09 UTC (rev 6106)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.test;
import java.util.ArrayList;
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2008-02-04 17:07:20 UTC (rev 6105)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2008-02-04 17:08:09 UTC (rev 6106)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.test;
import java.net.URL;
16 years, 3 months
JBoss Tools SVN: r6105 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-02-04 12:07:20 -0500 (Mon, 04 Feb 2008)
New Revision: 6105
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1684
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java 2008-02-04 16:21:16 UTC (rev 6104)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java 2008-02-04 17:07:20 UTC (rev 6105)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+import java.util.HashMap;
+
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -79,18 +82,19 @@
protected static String[] markers = { "passedMarker", "errorMarker",
"fatalMarker", "infoMarker", "warnMarker" };
- protected static String FACET_TAG_NAME = "f:facet";
+ protected static String FACET_TAG_NAME = "facet";
protected static String NAME_ATTRIBUTE_NAME = "name";
- private nsIDOMElement td1; // passed marker
- private nsIDOMElement td2; // passed label
private final static String MESSAGE_STYLE = "padding-left: 1px;padding-right: 1px;padding-top: 1px;padding-bottom: 1px";
- protected VpeCreationData creationData;
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+
+ VpeCreationData creationData;
+
passedLabelValue = ((Element) sourceNode)
.getAttribute(PASSED_LABEL_ATTRIBUTE_NAME);
labelClassValue = ((Element) sourceNode)
@@ -133,92 +137,34 @@
styleClassValue = ((Element) sourceNode)
.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
- createRichMessage(visualDocument, sourceNode);
+ HashMap<String, Node> facets = getFacelets(sourceElement);
- return creationData;
- }
+ if (facets.size() != 0) {
+ creationData = createVisualFacets(visualDocument, sourceElement,
+ facets);
+ } else {
+ nsIDOMElement span = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
- protected void createRichMessage(nsIDOMDocument visualDocument,
- Node sourceNode) {
+ if (styleValue != null && !styleValue.trim().equals(""))
+ span
+ .setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ styleValue);
+ if (styleClassValue != null && !styleClassValue.trim().equals(""))
+ span.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClassValue);
+ if (labelClassValue != null && !labelClassValue.trim().equals(""))
+ span.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ labelClassValue);
- NodeList nodeList = sourceNode.getChildNodes();
+ creationData = new VpeCreationData(span);
- for (int i = 0; i < nodeList.getLength(); i++) {
-
- if (!(nodeList.item(i) instanceof Element))
- continue;
-
- Element elemFacet = (Element) nodeList.item(i);
- if (elemFacet.getNodeName().equalsIgnoreCase(FACET_TAG_NAME)
- && searchInMarker(elemFacet
- .getAttribute(NAME_ATTRIBUTE_NAME))) {
-
- // if f:facet not empty
- if (elemFacet.getChildNodes().getLength() != 0) {
- nsIDOMElement tableHeader = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- tableHeader.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- MESSAGE_STYLE);
-
- creationData = new VpeCreationData(tableHeader);
-
- nsIDOMElement tbody = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- tbody.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN,
- "top");
- tableHeader.appendChild(tbody);
-
- nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
-
- if (styleValue != null && !styleValue.trim().equals(""))
- tableHeader.setAttribute(
- HtmlComponentUtil.HTML_STYLE_ATTR, styleValue);
- if (styleClassValue != null
- && !styleClassValue.trim().equals(""))
- tableHeader.setAttribute(
- HtmlComponentUtil.HTML_CLASS_ATTR,
- styleClassValue);
-
- td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
-
- td2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
-
- // set labelClass
- if (labelClassValue != null
- && !labelClassValue.trim().equals(""))
- td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- labelClassValue);
-
- nsIDOMText passedText = visualDocument
- .createTextNode(VALIDATION_MESSAGE);
- createVisualFacet(td1, elemFacet);
- tbody.appendChild(tr);
- tr.appendChild(td1);
- tr.appendChild(td2);
- td2.appendChild(passedText);
- return;
- }
- }
+ nsIDOMText passedText = visualDocument
+ .createTextNode(VALIDATION_MESSAGE);
+ span.appendChild(passedText);
}
- nsIDOMElement span = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- if (styleValue != null && !styleValue.trim().equals(""))
- span.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, styleValue);
- if (styleClassValue != null && !styleClassValue.trim().equals(""))
- span.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- styleClassValue);
-
- creationData = new VpeCreationData(span);
-
- nsIDOMText passedText = visualDocument
- .createTextNode(VALIDATION_MESSAGE);
- span.appendChild(passedText);
-
+ return creationData;
}
/**
@@ -250,23 +196,6 @@
/**
*
- * @param td01
- */
- protected void addNotFacetComponent(nsIDOMElement td01, Node sourceNode) {
-
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td01);
- creationData.addChildrenInfo(childrenInfo);
-
- NodeList nodeList = sourceNode.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- if (!FACET_TAG_NAME.equalsIgnoreCase(nodeList.item(i).getNodeName()
- .trim()))
- childrenInfo.addSourceChild(nodeList.item(i));
-
- }
-
- /**
- *
* @param markerName
* Marker name
* @return True if marker name correct or false
@@ -283,22 +212,169 @@
}
/**
+ * Method for creating rich:message template if rich:message has facets
*
- * @param td
- * @param elemFacet
+ * @param visualDocument
+ * @param sourceElement
+ * @param facets
+ * @return
*/
- protected void createVisualFacet(nsIDOMElement td, Element elemFacet) {
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td);
- creationData.addChildrenInfo(childrenInfo);
+ private VpeCreationData createVisualFacets(nsIDOMDocument visualDocument,
+ Element sourceElement, HashMap<String, Node> facets) {
- NodeList nodeList = elemFacet.getChildNodes();
+ nsIDOMElement tableHeader = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ tableHeader.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ MESSAGE_STYLE);
- for (int i = 0; i < nodeList.getLength(); i++)
+ VpeCreationData creationData = new VpeCreationData(tableHeader);
+
+ nsIDOMElement tbody = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ tbody.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN, "top");
+ tableHeader.appendChild(tbody);
+
+ nsIDOMElement tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+
+ tbody.appendChild(tr);
+
+ if (styleValue != null && !styleValue.trim().equals(""))
+ tableHeader.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ styleValue);
+ if (styleClassValue != null && !styleClassValue.trim().equals(""))
+ tableHeader.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClassValue);
+
+ for (int i = 0; i < markers.length; i++) {
+
+ if (facets.containsKey(markers[i])) {
+
+ nsIDOMElement td = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ switch (i) {
+ case 0: // passed
+
+ if (markerClassValue != null
+ && !markerClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ markerClassValue);
+ if (markerStyleValue != null
+ && !markerStyleValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ markerStyleValue);
+ break;
+ case 1: // error
+ if (errorClassValue != null
+ && !errorClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorClassValue);
+ if (errorMarkerClassValue != null
+ && !errorMarkerClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorMarkerClassValue);
+
+ break;
+ case 2: // fatal
+ if (fatalClassValue != null
+ && !fatalClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalClassValue);
+
+ if (fatalMarkerClassValue != null
+ && !fatalMarkerClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalMarkerClassValue);
+
+ break;
+ case 3: // info
+ if (infoClassValue != null
+ && !infoClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoClassValue);
+ if (infoMarkerClassValue != null
+ && !infoMarkerClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoMarkerClassValue);
+ break;
+ case 4: // warn
+ if (warnClassValue != null
+ && !warnClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnClassValue);
+ if (warnMarkerClassValue != null
+ && !warnMarkerClassValue.trim().equals(""))
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnMarkerClassValue);
+
+ break;
+ default:
+ break;
+ }
+
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td);
+ creationData.addChildrenInfo(childrenInfo);
+
+ if (!(facets.get(markers[i]) instanceof Element))
+ continue;
+ else {
+ childrenInfo.addSourceChild(facets.get(markers[i]));
+ }
+ tr.appendChild(td);
+ }
+ }
+
+ nsIDOMElement td1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ if (labelClassValue != null && !labelClassValue.trim().equals(""))
+ td1
+ .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ labelClassValue);
+
+ nsIDOMText passedText = visualDocument
+ .createTextNode(VALIDATION_MESSAGE);
+ tr.appendChild(td1);
+ td1.appendChild(passedText);
+
+ return creationData;
+ }
+
+ @Override
+ public void setSourceAttributeSelection(VpePageContext pageContext,
+ Element sourceElement, int offset, int length, Object data) {
+ VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
+ sourceBuilder.setSelection(sourceElement, 0, 0);
+ }
+
+ /**
+ * Method for getting message facets
+ *
+ * @param sourceElement
+ * @return List of facets
+ */
+ protected HashMap<String, Node> getFacelets(Element sourceElement) {
+
+ NodeList nodeList = sourceElement.getChildNodes();
+ HashMap<String, Node> facets = new HashMap<String, Node>();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+
if (!(nodeList.item(i) instanceof Element))
continue;
- else {
- childrenInfo.addSourceChild(nodeList.item(i));
- return;
+
+ String facetName = nodeList.item(i).getPrefix() + ":"
+ + FACET_TAG_NAME;
+
+ if (nodeList.item(i).getNodeName().equalsIgnoreCase(facetName)
+ && searchInMarker(((Element) nodeList.item(i))
+ .getAttribute(NAME_ATTRIBUTE_NAME))) {
+ facets.put(((Element) nodeList.item(i))
+ .getAttribute(NAME_ATTRIBUTE_NAME), nodeList.item(i));
}
+ }
+
+ return facets;
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java 2008-02-04 16:21:16 UTC (rev 6104)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java 2008-02-04 17:07:20 UTC (rev 6105)
@@ -1,320 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+import java.util.HashMap;
+
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
public class RichFacesMessagesTemplate extends RichFacesMessageTemplate {
- private static String LAYOUT_ATTRIBUTE_NAME = "layout";
- private static String LAYOUT_ATTRIBUTE_VALUE_TABLE = "table";
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
- private String layoutValue;
+ VpeCreationData creationData;
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
+ passedLabelValue = ((Element) sourceNode)
+ .getAttribute(PASSED_LABEL_ATTRIBUTE_NAME);
+ labelClassValue = ((Element) sourceNode)
+ .getAttribute(LABEL_CLASS_ATTRIBUTE_NAME);
+ markerClassValue = ((Element) sourceNode)
+ .getAttribute(MARKER_CLASS_ATTRIBUTE_NAME);
+ markerStyleValue = ((Element) sourceNode)
+ .getAttribute(MARKER_STYLE_ATTRIBUTE_NAME);
- passedLabelValue = ((Element) sourceNode)
- .getAttribute(PASSED_LABEL_ATTRIBUTE_NAME);
- labelClassValue = ((Element) sourceNode)
- .getAttribute(LABEL_CLASS_ATTRIBUTE_NAME);
- markerClassValue = ((Element) sourceNode)
- .getAttribute(MARKER_CLASS_ATTRIBUTE_NAME);
- markerStyleValue = ((Element) sourceNode)
- .getAttribute(MARKER_STYLE_ATTRIBUTE_NAME);
+ errorMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_MARKER_CLASS_ATTRIBUTE_NAME);
+ errorLabelClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_LABEL_CLASS_ATTRIBUTE_NAME);
+ errorClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_CLASS_ATTRIBUTE_NAME);
- errorMarkerClassValue = ((Element) sourceNode)
- .getAttribute(ERROR_MARKER_CLASS_ATTRIBUTE_NAME);
- errorLabelClassValue = ((Element) sourceNode)
- .getAttribute(ERROR_LABEL_CLASS_ATTRIBUTE_NAME);
- errorClassValue = ((Element) sourceNode)
- .getAttribute(ERROR_CLASS_ATTRIBUTE_NAME);
+ fatalMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_MARKER_CLASS_ATTRIBUTE_NAME);
+ fatalLabelClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_LABEL_CLASS_ATTRIBUTE_NAME);
+ fatalClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_CLASS_ATTRIBUTE_NAME);
- fatalMarkerClassValue = ((Element) sourceNode)
- .getAttribute(FATAL_MARKER_CLASS_ATTRIBUTE_NAME);
- fatalLabelClassValue = ((Element) sourceNode)
- .getAttribute(FATAL_LABEL_CLASS_ATTRIBUTE_NAME);
- fatalClassValue = ((Element) sourceNode)
- .getAttribute(FATAL_CLASS_ATTRIBUTE_NAME);
+ infoMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_MARKER_CLASS_ATTRIBUTE_NAME);
+ infoLabelClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_LABEL_CLASS_ATTRIBUTE_NAME);
+ infoClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_CLASS_ATTRIBUTE_NAME);
- infoMarkerClassValue = ((Element) sourceNode)
- .getAttribute(INFO_MARKER_CLASS_ATTRIBUTE_NAME);
- infoLabelClassValue = ((Element) sourceNode)
- .getAttribute(INFO_LABEL_CLASS_ATTRIBUTE_NAME);
- infoClassValue = ((Element) sourceNode)
- .getAttribute(INFO_CLASS_ATTRIBUTE_NAME);
+ warnMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_MARKER_CLASS_ATTRIBUTE_NAME);
+ warnLabelClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_LABEL_CLASS_ATTRIBUTE_NAME);
+ warnClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_CLASS_ATTRIBUTE_NAME);
- warnMarkerClassValue = ((Element) sourceNode)
- .getAttribute(WARN_MARKER_CLASS_ATTRIBUTE_NAME);
- warnLabelClassValue = ((Element) sourceNode)
- .getAttribute(WARN_LABEL_CLASS_ATTRIBUTE_NAME);
- warnClassValue = ((Element) sourceNode)
- .getAttribute(WARN_CLASS_ATTRIBUTE_NAME);
+ styleValue = ((Element) sourceNode)
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ styleClassValue = ((Element) sourceNode)
+ .getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
- styleValue = ((Element) sourceNode)
- .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- styleClassValue = ((Element) sourceNode)
- .getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ nsIDOMElement table = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- layoutValue = ((Element) sourceNode)
- .getAttribute(LAYOUT_ATTRIBUTE_NAME);
+ if (styleValue != null && !styleValue.trim().equals(""))
+ table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, styleValue);
+ if (styleClassValue != null && !styleClassValue.trim().equals(""))
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClassValue);
- if (layoutValue != null
- && LAYOUT_ATTRIBUTE_VALUE_TABLE.equalsIgnoreCase(layoutValue
- .trim()))
- createTableLayout(visualDocument, sourceNode);
- else
- createListLayout(visualDocument, sourceNode);
+ creationData = new VpeCreationData(table);
- return creationData;
- }
+ HashMap<String, Node> facets = getFacelets((Element) sourceNode);
- /**
- * Create <rich:messages> with layout="table"
- */
- public void createTableLayout(nsIDOMDocument visualDocument, Node sourceNode) {
-
- createRichMessage(visualDocument, sourceNode);
-
+ for (int i = 0; i < markers.length; i++) {
+ if (facets.containsKey(markers[i])) {
+ table.appendChild(createVisualMessage(creationData,
+ visualDocument, i, (Element) facets.get(markers[i])));
+ } else {
+ table.appendChild(createVisualMessage(creationData,
+ visualDocument, i, null));
+ }
}
- /**
- * Create <rich:messages> with layout="list"
- */
- public void createListLayout(nsIDOMDocument visualDocument, Node sourceNode) {
+ return creationData;
+ }
- nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ /**
+ * Method for creating rich:message template if rich:message has facets
+ *
+ * @param visualDocument
+ * @param sourceElement
+ * @param facets
+ * @return
+ */
+ private nsIDOMElement createVisualMessage(VpeCreationData creationData,
+ nsIDOMDocument visualDocument, int markerNum, Element facet) {
- if (styleValue != null && !styleValue.trim().equals(""))
- table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, styleValue);
- if (styleClassValue != null && !styleClassValue.trim().equals(""))
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- styleClassValue);
+ String labelMessage = "";
- creationData = new VpeCreationData(table);
+ nsIDOMElement tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
- nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement td1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
- nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement td2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ if (facet != null) {
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td1);
+ creationData.addChildrenInfo(childrenInfo);
+ childrenInfo.addSourceChild(facet);
+ }
+ // apply styles and classes
+ switch (markerNum) {
+ case 0: // passed
+ labelMessage = (passedLabelValue == null) ? "" : passedLabelValue;
+ if (labelClassValue != null && !labelClassValue.trim().equals(""))
+ td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ labelClassValue);
+ if (markerClassValue != null && !markerClassValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ markerClassValue);
+ if (markerStyleValue != null && !markerStyleValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ markerStyleValue);
+ break;
+ case 1: // error
+ if (errorClassValue != null && !errorClassValue.trim().equals(""))
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorClassValue);
+ if (errorMarkerClassValue != null
+ && !errorMarkerClassValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorMarkerClassValue);
+ if (errorLabelClassValue != null
+ && !errorLabelClassValue.trim().equals(""))
+ td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorLabelClassValue);
- // create first td for PASSED
- nsIDOMElement td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ labelMessage = ERROR_MESSAGE;
+ break;
+ case 2: // fatal
+ labelMessage = FATAL_MESSAGE;
+ if (fatalClassValue != null && !fatalClassValue.trim().equals(""))
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalClassValue);
+ if (fatalMarkerClassValue != null
+ && !fatalMarkerClassValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalMarkerClassValue);
+ if (fatalLabelClassValue != null
+ && !fatalLabelClassValue.trim().equals(""))
+ td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalLabelClassValue);
+ break;
+ case 3: // info
+ labelMessage = INFO_MESSAGE;
+ if (infoClassValue != null && !infoClassValue.trim().equals(""))
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoClassValue);
+ if (infoMarkerClassValue != null
+ && !infoMarkerClassValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoMarkerClassValue);
+ if (infoLabelClassValue != null
+ && !infoLabelClassValue.trim().equals(""))
+ td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoLabelClassValue);
+ break;
+ case 4: // warn
+ labelMessage = WARNING_MESSAGE;
+ if (warnClassValue != null && !warnClassValue.trim().equals(""))
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnClassValue);
+ if (warnMarkerClassValue != null
+ && !warnMarkerClassValue.trim().equals(""))
+ td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnMarkerClassValue);
+ if (warnLabelClassValue != null
+ && !warnLabelClassValue.trim().equals(""))
+ td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnLabelClassValue);
+ break;
+ default:
+ break;
+ }
- nsIDOMElement span1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+ if (labelClassValue != null && !labelClassValue.trim().equals(""))
+ td2
+ .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ labelClassValue);
+ nsIDOMText text = visualDocument.createTextNode(labelMessage);
+ tr.appendChild(td1);
+ tr.appendChild(td2);
+ td2.appendChild(text);
+ return tr;
+ }
- // set markerClass
- if (markerClassValue != null && !markerClassValue.trim().equals(""))
- span1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- markerClassValue);
-
- // set markerStyle
- if (markerStyleValue != null && !markerStyleValue.trim().equals(""))
- span1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- markerStyleValue);
-
- nsIDOMElement span2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- if (labelClassValue != null && !labelClassValue.trim().equals(""))
- span2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- labelClassValue);
-
- nsIDOMText passedText = visualDocument
- .createTextNode(passedLabelValue == null ? ""
- : passedLabelValue);
- // -----------------------------------------------------------
-
- // Create second td for ERROR
- nsIDOMElement td2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- // set errorClass
- if (errorClassValue != null && !errorClassValue.trim().equals(""))
- td2
- .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- errorClassValue);
-
- nsIDOMElement span3 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set errorMarkerClass
- if (errorMarkerClassValue != null
- && !errorMarkerClassValue.trim().equals(""))
- span3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- errorMarkerClassValue);
-
- nsIDOMElement span4 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set errorLabelClass
- if (errorLabelClassValue != null
- && !errorLabelClassValue.trim().equals(""))
- span4.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- errorLabelClassValue);
-
- nsIDOMText errorText = visualDocument.createTextNode(ERROR_MESSAGE);
- // -------------------------------------------------------------
-
- // Create third td for FATAL
- nsIDOMElement td3 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
-
- // set fatalClass
- if (fatalClassValue != null && !fatalClassValue.trim().equals(""))
- td3
- .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- fatalClassValue);
-
- nsIDOMElement span5 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set fatalMarkerClass
- if (fatalMarkerClassValue != null
- && !fatalMarkerClassValue.trim().equals(""))
- span5.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- fatalMarkerClassValue);
-
- nsIDOMElement span6 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set fatalLabelClass
- if (fatalLabelClassValue != null
- && !fatalLabelClassValue.trim().equals(""))
- span6.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- fatalLabelClassValue);
-
- nsIDOMText fatalText = visualDocument.createTextNode(FATAL_MESSAGE);
- // ---------------------------------------------------------------------------
-
- // Create four td for INFO
-
- nsIDOMElement td4 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
-
- // set infoClass
- if (infoClassValue != null && !infoClassValue.trim().equals(""))
- td4.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, infoClassValue);
-
- nsIDOMElement span7 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set infoMarkerClass
- if (infoMarkerClassValue != null
- && !infoMarkerClassValue.trim().equals(""))
- span7.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- infoMarkerClassValue);
-
- nsIDOMElement span8 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set infoLabelClass
- if (infoLabelClassValue != null
- && !infoLabelClassValue.trim().equals(""))
- span8.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- infoLabelClassValue);
-
- nsIDOMText infoText = visualDocument.createTextNode(INFO_MESSAGE);
- // --------------------------------------------------------------------
-
- // Create fifth for WARN
-
- nsIDOMElement td5 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
-
- // set warnClass
- if (warnClassValue != null && !warnClassValue.trim().equals(""))
- td5.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, warnClassValue);
-
- nsIDOMElement span9 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set warnMarkerClass
- if (warnMarkerClassValue != null
- && !warnMarkerClassValue.trim().equals(""))
- span9.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- warnMarkerClassValue);
-
- nsIDOMElement span10 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
-
- // set warnLabelClass
- if (warnLabelClassValue != null
- && !warnLabelClassValue.trim().equals(""))
- span10.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- warnLabelClassValue);
-
- nsIDOMText warnText = visualDocument.createTextNode(WARNING_MESSAGE);
- // ---------------------------------------------------------------------
-
- NodeList nodeList = sourceNode.getChildNodes();
-
- for (int i = 0; i < nodeList.getLength(); i++) {
-
- if (!(nodeList.item(i) instanceof Element))
- continue;
-
- Element elemFacet = (Element) nodeList.item(i);
-
- if (elemFacet.getNodeName().equalsIgnoreCase(FACET_TAG_NAME)
- && searchInMarker(elemFacet
- .getAttribute(NAME_ATTRIBUTE_NAME))) {
-
- String markerName = elemFacet.getAttribute(NAME_ATTRIBUTE_NAME)
- .trim();
-
- if (elemFacet.getChildNodes().getLength() != 0)
- if (markers[0].equalsIgnoreCase(markerName)) {
- createVisualFacet(span1, elemFacet);
- } else if (markers[1].equalsIgnoreCase(markerName)) {
- createVisualFacet(span3, elemFacet);
- } else if (markers[2].equalsIgnoreCase(markerName)) {
- createVisualFacet(span5, elemFacet);
- } else if (markers[3].equalsIgnoreCase(markerName)) {
- createVisualFacet(span7, elemFacet);
- } else if (markers[4].equalsIgnoreCase(markerName)) {
- createVisualFacet(span9, elemFacet);
- }
- }
- }
-
- addNotFacetComponent(td, sourceNode);
-
- table.appendChild(tr);
- tr.appendChild(td);
-
- tr.appendChild(td1);
- td1.appendChild(span1);
- td1.appendChild(span2);
- span2.appendChild(passedText);
-
- tr.appendChild(td2);
- td2.appendChild(span3);
- td2.appendChild(span4);
- span4.appendChild(errorText);
-
- tr.appendChild(td3);
- td3.appendChild(span5);
- td3.appendChild(span6);
- span6.appendChild(fatalText);
-
- tr.appendChild(td4);
- td4.appendChild(span7);
- td4.appendChild(span8);
- span8.appendChild(infoText);
-
- tr.appendChild(td5);
- td5.appendChild(span9);
- td5.appendChild(span10);
- span10.appendChild(warnText);
- }
}
\ No newline at end of file
16 years, 3 months
JBoss Tools SVN: r6104 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-04 11:21:16 -0500 (Mon, 04 Feb 2008)
New Revision: 6104
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
Log:
JBIDE-1726
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-02-04 15:55:55 UTC (rev 6103)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-02-04 16:21:16 UTC (rev 6104)
@@ -42,7 +42,11 @@
<XModelAttribute default="ejbql" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general;id=true" name="value" xmlname="#text"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="ejbql" name="name">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="value" xmlname="#text"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -368,7 +372,11 @@
<XModelAttribute default="order" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general;id=true" name="value" xmlname="#text"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="order" name="name">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="value" xmlname="#text"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
16 years, 3 months
JBoss Tools SVN: r6103 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-04 10:55:55 -0500 (Mon, 04 Feb 2008)
New Revision: 6103
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
JBIDE-1726
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2008-02-04 01:21:52 UTC (rev 6102)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2008-02-04 15:55:55 UTC (rev 6103)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueList;
@@ -199,6 +200,10 @@
p.setId(properties[j]);
p.setName(new XMLValueInfo(properties[j], "name")); //$NON-NLS-1$
String name = properties[j].getAttributeValue("name"); //$NON-NLS-1$
+ if(name == null) {
+ SeamCorePlugin.getPluginLog().logWarning("Entity " + entity.getName() + " has no 'name' attribute");
+ continue;
+ }
String cname = toCamelCase(name, false);
if(!cname.equals(name)) p.setName(cname);
16 years, 3 months