JBoss Tools SVN: r12134 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-11-28 12:11:00 -0500 (Fri, 28 Nov 2008)
New Revision: 12134
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-1975 OpenOn for #{messages.***} in Seam EL.
The getScope() and resolveVariables() methods are made public
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-11-28 17:06:49 UTC (rev 12133)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-11-28 17:11:00 UTC (rev 12134)
@@ -570,7 +570,7 @@
* @param resource
* @return
*/
- private ScopeType getScope(ISeamProject project, IResource resource) {
+ public static ScopeType getScope(ISeamProject project, IResource resource) {
if (project == null || resource == null)
return null;
@@ -586,7 +586,7 @@
return null;
}
- private List<ISeamContextVariable> resolveVariables(ScopeType scope, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
+ public List<ISeamContextVariable> resolveVariables(ScopeType scope, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
List<ISeamContextVariable>resolvedVars = new ArrayList<ISeamContextVariable>();
String varName = expr.toString();
if (varName != null) {
16 years, 5 months
JBoss Tools SVN: r12133 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-11-28 12:06:49 -0500 (Fri, 28 Nov 2008)
New Revision: 12133
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
Log:
JBIDE-1975 OpenOn for #{messages.***} in Seam EL.
The resource map is shared thru public getters
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2008-11-28 17:02:18 UTC (rev 12132)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2008-11-28 17:06:49 UTC (rev 12133)
@@ -12,8 +12,10 @@
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
+import org.eclipse.core.resources.IResource;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.event.Change;
@@ -49,5 +51,9 @@
messagesLoader.keys = null;
return changes;
}
+
+ public Map<String, IResource> getResourcesMap() {
+ return messagesLoader.getResources();
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2008-11-28 17:02:18 UTC (rev 12132)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2008-11-28 17:06:49 UTC (rev 12133)
@@ -43,7 +43,7 @@
*/
public class SeamMessagesLoader {
static Map<String, IResource> EMPTY = new HashMap<String, IResource>();
- Map<String, IResource> resources = EMPTY;
+ Map<String, IResource> resources = EMPTY; // Maps the bundleName to the IResource
Map<String, Long> timestamps = null;
Set<String> keys = null;
@@ -89,7 +89,7 @@
return false;
}
- private Map<String, IResource> getResources() {
+ public Map<String, IResource> getResources() {
ISeamProject p = object.getSeamProject();
if(p == null) return EMPTY;
IResource[] srcs = EclipseResourceUtil.getJavaSourceRoots(p.getProject());
16 years, 5 months
JBoss Tools SVN: r12132 - in documentation/trunk/movies: seam_demo and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2008-11-28 12:02:18 -0500 (Fri, 28 Nov 2008)
New Revision: 12132
Added:
documentation/trunk/movies/seam_demo/
documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
Log:
New demo movie
Added: documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
16 years, 5 months
JBoss Tools SVN: r12131 - trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-11-28 11:33:45 -0500 (Fri, 28 Nov 2008)
New Revision: 12131
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
Log:
Fixed dependency list
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2008-11-28 15:33:27 UTC (rev 12130)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2008-11-28 16:33:45 UTC (rev 12131)
@@ -20,7 +20,7 @@
org.jboss.tools.jsf.ui,
org.jboss.tools.jst.web.ui,
org.jboss.tools.common.model.ui,
- org.eclipse.ui.ide;bundle-version="3.4.1"
+ org.eclipse.ui.ide
Bundle-Activator: org.jboss.tools.jsf.plugin.JsfTestPlugin
Bundle-ActivationPolicy: lazy
16 years, 5 months
JBoss Tools SVN: r12130 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-28 10:33:27 -0500 (Fri, 28 Nov 2008)
New Revision: 12130
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
Log:
fix broken junit tests, JBIDE-883
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java 2008-11-28 15:32:42 UTC (rev 12129)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java 2008-11-28 15:33:27 UTC (rev 12130)
@@ -102,8 +102,11 @@
nsIDOMNode domNode = vpeController.getXulRunnerEditor().getLastSelectedNode();
assertNotNull(domNode);
+
+ //we process selections only with reasons, but when we select programticly,
+ //we get exception with selection no reason
vpeController.getVisualSelectionController().getSelection(nsISelectionController.SELECTION_NORMAL).collapse(domNode, i);
- vpeController.visualRefresh();
+// vpeController.visualRefresh();
assertEquals("Cursor position doesn't equals",offset+i,styledText.getCaretOffset()); //$NON-NLS-1$
}
16 years, 5 months
JBoss Tools SVN: r12129 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-11-28 10:32:42 -0500 (Fri, 28 Nov 2008)
New Revision: 12129
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNaviagtor.java
Log:
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNaviagtor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNaviagtor.java 2008-11-28 15:26:00 UTC (rev 12128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNaviagtor.java 2008-11-28 15:32:42 UTC (rev 12129)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.eclipse.console.views.navigator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.hibernate.console.KnownConfigurations;
-
-public class KnownConfigurationsNaviagtor extends CommonNavigator {
-
- protected IAdaptable getInitialInput() {
- return new AdaptableWrapper(new String());
- }
-
- public void createPartControl(Composite aParent) {
- super.createPartControl( aParent );
- getCommonViewer().setInput(KnownConfigurations.getInstance());
- }
-}
16 years, 5 months
JBoss Tools SVN: r12128 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-28 10:26:00 -0500 (Fri, 28 Nov 2008)
New Revision: 12128
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
Log:
fix broken junit tests, JBIDE-883
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java 2008-11-28 15:20:04 UTC (rev 12127)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java 2008-11-28 15:26:00 UTC (rev 12128)
@@ -168,11 +168,11 @@
String style = select.getAttribute(HTML.ATTR_STYLE);
assertNotNull("Attribute style is not exist.", style);
assertEquals("font-size: large;", style);
+//mareshkau, fix for jbide-3209
+// String dir = select.getAttribute(HTML.ATTR_DIR);
+// assertNotNull("Attribute dir is not exist.", dir);
+// assertEquals("rtl", dir);
- String dir = select.getAttribute(HTML.ATTR_DIR);
- assertNotNull("Attribute dir is not exist.", dir);
- assertEquals("rtl", dir);
-
elements.clear();
// find "option" elements
16 years, 5 months
JBoss Tools SVN: r12127 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/2354 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-11-28 10:20:04 -0500 (Fri, 28 Nov 2008)
New Revision: 12127
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2354/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2354/jbide2354.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2354Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2354, JUnit test was added.
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2354/jbide2354.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2354/jbide2354.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-28 15:12:36 UTC (rev 12126)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-28 15:20:04 UTC (rev 12127)
@@ -29,6 +29,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2119Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2219Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2297Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2354Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2434Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2505Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2526Test;
@@ -109,6 +110,8 @@
suite.addTestSuite(JBIDE2979Test.class);
suite.addTestSuite(JBIDE3127Test.class);
suite.addTestSuite(JBIDE3144Test.class);
+ suite.addTestSuite(JBIDE2354Test.class);
+
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2354Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2354Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2354Test.java 2008-11-28 15:20:04 UTC (rev 12127)
@@ -0,0 +1,66 @@
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+
+public class JBIDE2354Test extends ComponentContentTest {
+
+ public JBIDE2354Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE2354UndoOperation() throws Exception {
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/2354/jbide2354.xhtml", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ IEditorInput input = new FileEditorInput(file);
+ JSPMultiPageEditor part = openEditor(input);
+ VpeController controller = getVpeController(part);
+
+ Event keyEvent = new Event();
+ keyEvent.widget = controller.getXulRunnerEditor().getBrowser();
+ keyEvent.x = 0;
+ keyEvent.y = 0;
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.stateMask = 0;
+ /*
+ * send letter 'a' key code
+ */
+ keyEvent.keyCode = 97;
+
+ controller.getXulRunnerEditor().getBrowser().notifyListeners(SWT.KeyDown, keyEvent);
+// Display.getCurrent().post(keyEvent);
+
+ checkSourceSelection(part);
+
+ keyEvent = new Event();
+ keyEvent.widget = controller.getXulRunnerEditor().getBrowser();
+ keyEvent.x = 0;
+ keyEvent.y = 0;
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.stateMask = SWT.CTRL;
+ /*
+ * send letter 'z' key code
+ */
+ keyEvent.keyCode = 122;
+
+ controller.getXulRunnerEditor().getBrowser().notifyListeners(SWT.KeyDown, keyEvent);
+// Display.getCurrent().post(keyEvent);
+
+ checkSourceSelection(part);
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_PROJECT_NAME;
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2354Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 5 months
JBoss Tools SVN: r12126 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-28 10:12:36 -0500 (Fri, 28 Nov 2008)
New Revision: 12126
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
JBIDE-2957
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2008-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -99,7 +99,7 @@
*
* @return
*/
- public Map<String, ISeamNamespace> getNamespaces();
+ public Map<String, Set<ISeamNamespace>> getNamespaces();
/**
* Returns seam component. Project can have only one ISeamComponent with
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -312,7 +312,7 @@
usedBy.add(p);
}
- public Map<String, ISeamNamespace> getNamespaces() {
+ public Map<String, Set<ISeamNamespace>> getNamespaces() {
return namespaces.namespacesByURI;
}
@@ -486,8 +486,11 @@
private void storeNamespaces(Element root) {
Element namespacesElement = XMLUtilities.createElement(root, "namespaces"); //$NON-NLS-1$
- for (ISeamNamespace n : namespaces.namespacesByURI.values()) {
- ((SeamNamespace)n).toXML(namespacesElement);
+ for (String uri : namespaces.namespacesByURI.keySet()) {
+ Set<ISeamNamespace> s = namespaces.namespacesByURI.get(uri);
+ for (ISeamNamespace n: s) {
+ ((SeamNamespace)n).toXML(namespacesElement);
+ }
}
}
@@ -1562,15 +1565,18 @@
ds.getComponents().add(d.clone());
}
}
- for (ISeamNamespace n : namespaces.namespacesByURI.values()) {
- IPath p = n.getSourcePath();
- if(p == null || p.toString().endsWith(".jar")) continue; //$NON-NLS-1$
- LoadedDeclarations ds = map.get(p);
- if(ds == null) {
- ds = new LoadedDeclarations();
- map.put(p, ds);
+ for (String uri : namespaces.namespacesByURI.keySet()) {
+ Set<ISeamNamespace> s = namespaces.namespacesByURI.get(uri);
+ for (ISeamNamespace n : s) {
+ IPath p = n.getSourcePath();
+ if(p == null || p.toString().endsWith(".jar")) continue; //$NON-NLS-1$
+ LoadedDeclarations ds = map.get(p);
+ if(ds == null) {
+ ds = new LoadedDeclarations();
+ map.put(p, ds);
+ }
+ ds.getNamespaces().add(n);
}
- ds.getNamespaces().add(n);
}
for (ISeamFactory f : factories.allFactories) {
IPath p = f.getSourcePath();
@@ -1670,10 +1676,9 @@
p.getComponents().add(c);
}
-
class NamespaceStorage {
Map<IPath, Set<ISeamNamespace>> namespacesBySource = new HashMap<IPath, Set<ISeamNamespace>>();
- Map<String, ISeamNamespace> namespacesByURI = new HashMap<String, ISeamNamespace>();
+ Map<String, Set<ISeamNamespace>> namespacesByURI = new HashMap<String, Set<ISeamNamespace>>();
public void clear() {
namespacesBySource.clear();
@@ -1690,22 +1695,24 @@
if(ns.length == 0) {
removePath(source);
} else {
- if(sd != null) {
- sd.clear();
- } else {
- sd = new HashSet<ISeamNamespace>();
- namespacesBySource.put(source, sd);
- }
+ //TODO replace this with merge!
+ removePath(source);
for (int i = 0; i < ns.length; i++) {
- sd.add(ns[i]);
- //TODO that will not remove old objects
- namespacesByURI.put(ns[i].getURI(), ns[i]);
+ addNamespace(ns[i]);
}
}
}
public void addNamespace(ISeamNamespace n) {
- namespacesByURI.put(n.getURI(), n);
+ String uri = n.getURI();
+ if(uri != null) {
+ Set<ISeamNamespace> s = namespacesByURI.get(uri);
+ if(s == null) {
+ s = new HashSet<ISeamNamespace>();
+ namespacesByURI.put(n.getURI(), s);
+ }
+ s.add(n);
+ }
IPath path = n.getSourcePath();
if(path != null) {
Set<ISeamNamespace> fs = namespacesBySource.get(path);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2008-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -131,7 +131,7 @@
static long timeUsed = 0;
void componentsLoaded(LoadedDeclarations c, IFile resource) {
- if(c == null || c.getComponents().size() + c.getFactories().size() == 0) return;
+ if(c == null || c.getComponents().size() + c.getFactories().size() + c.getNamespaces().size() == 0) return;
p.registerComponents(c, resource.getFullPath());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2008-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -220,7 +220,7 @@
while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
NamespaceMapping nm = NamespaceMapping.load(f);
SeamProject sp = (SeamProject)context.get("seamProject");
- className = XMLScanner.getDefaultClassName(c, nm, sp == null ? null : sp.getNamespaces());
+ className = XMLScanner.getDefaultClassName(c, nm, sp);
isClassNameGuessed = true;
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2008-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -19,6 +19,7 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -91,11 +92,16 @@
NLS.bind(SeamCoreMessages.JAVA_SCANNER_CANNOT_GET_COMPILATION_UNIT_FOR,f), e);
}
if(u == null) return null;
- ASTRequestorImpl requestor = new ASTRequestorImpl(f);
ICompilationUnit[] us = new ICompilationUnit[]{u};
ASTParser p = ASTParser.newParser(AST.JLS3);
p.setSource(u);
p.setResolveBindings(true);
+ if("package-info.java".equals(f.getFullPath().lastSegment())) {
+ PackageInfoRequestor requestor = new PackageInfoRequestor(f);
+ p.createASTs(us, new String[0], requestor, null);
+ return requestor.getDeclarations();
+ }
+ ASTRequestorImpl requestor = new ASTRequestorImpl(f);
p.createASTs(us, new String[0], requestor, null);
return requestor.getDeclarations();
}
@@ -108,6 +114,13 @@
if(rs[i].getFullPath().isPrefixOf(f.getFullPath())) {
IPath path = f.getFullPath().removeFirstSegments(rs[i].getFullPath().segmentCount());
IJavaElement e = javaProject.findElement(path);
+ if(e == null && path.lastSegment().equals("package-info.java")) {
+ //strange but sometimes only this works
+ IJavaElement ep = javaProject.findElement(path.removeLastSegments(1));
+ if(ep instanceof IPackageFragment) {
+ e = ((IPackageFragment)ep).getCompilationUnit("package-info.java");
+ }
+ }
if(e instanceof ICompilationUnit) {
return (ICompilationUnit)e;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.scanner.java;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.ASTRequestor;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IAnnotationBinding;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.jboss.tools.seam.internal.core.SeamNamespace;
+import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
+
+/**
+ * This object collects annotations from package-info.java.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public class PackageInfoRequestor extends ASTRequestor {
+ PackageInfoVisitor visitor = new PackageInfoVisitor();
+ LoadedDeclarations ds = new LoadedDeclarations();
+ IResource resource;
+ IPath sourcePath;
+
+ public PackageInfoRequestor(IResource resource) {
+ this.resource = resource;
+ this.sourcePath = resource.getFullPath();
+ }
+
+ public LoadedDeclarations getDeclarations() {
+ return ds;
+ }
+
+ public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
+ ast.accept(visitor);
+ for (SeamNamespace n: visitor.namespaces) {
+ n.setSourcePath(resource.getFullPath());
+ n.setPackage(visitor.javaPackage);
+ }
+ ds.getNamespaces().addAll(visitor.namespaces);
+ }
+
+}
+
+class PackageInfoVisitor extends ASTVisitor implements SeamAnnotations {
+ List<SeamNamespace> namespaces = new ArrayList<SeamNamespace>();
+ String javaPackage = null;
+
+ public PackageInfoVisitor() {}
+
+ public boolean visit(PackageDeclaration node) {
+ if(node.getName() != null) {
+ javaPackage = node.getName().getFullyQualifiedName();
+ }
+ return true;
+ }
+
+ public boolean visit(NormalAnnotation node) {
+ IAnnotationBinding b = node.resolveAnnotationBinding();
+ if(b != null) {
+ String type = b.getAnnotationType().getQualifiedName();
+ if(NAMESPACE_ANNOTATION_TYPE.equals(type)) {
+ System.out.println("!!!\n" + node);
+ ValueInfo value = ValueInfo.getValueInfo(node, "value");
+ ValueInfo prefix = ValueInfo.getValueInfo(node, "prefix");
+ SeamNamespace ns = new SeamNamespace();
+ if(value != null) {
+ ns.setURI(value.getValue());
+ }
+ if(prefix != null) {
+ //
+ }
+ namespaces.add(ns);
+ }
+ }
+ return true;
+ }
+
+}
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-11-28 15:01:26 UTC (rev 12125)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2008-11-28 15:12:36 UTC (rev 12126)
@@ -19,6 +19,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.ModelUpdater;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.model.XModel;
@@ -26,6 +30,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.NamespaceMapping;
import org.jboss.tools.seam.core.ISeamNamespace;
@@ -176,7 +181,7 @@
} else if(c.getModelEntity().getName().equals("FileSeamComponent12")) { //$NON-NLS-1$
component.setClassName(getImpliedClassName(c, source));
} else {
- String className = getDefaultClassName(c, nm, sp.getNamespaces());
+ String className = getDefaultClassName(c, nm, sp);
if(className != null) {
component.setClassName(className);
component.setClassNameGuessed(true);
@@ -341,25 +346,43 @@
* @param c
* @return
*/
- public static String getDefaultClassName(XModelObject c, NamespaceMapping nm, Map<String, ISeamNamespace> ns) {
+ public static String getDefaultClassName(XModelObject c, NamespaceMapping nm, ISeamProject sp) {
String s = c.getModelEntity().getXMLSubPath();
int d = s.indexOf(':');
if(d < 0) return null;
+
+ Map<String, Set<ISeamNamespace>> ns = sp == null ? null : sp.getNamespaces();
+
String namespace = s.substring(0, d);
String tag = s.substring(d + 1);
String packageName = "org.jboss.seam." + namespace;
+ String name = toCamelCase(tag, true);
if(nm != null) {
String uri = nm.getURIForDefaultNamespace(namespace);
- if(uri != null && ns != null) {
- ISeamNamespace n = ns.get(uri);
- if(n != null) {
+ if(uri != null && ns != null && !ns.isEmpty()) {
+ Set<ISeamNamespace> set = ns.get(uri);
+
+ if(set != null && !set.isEmpty()) for (ISeamNamespace n: set) {
String pn = n.getPackage();
- if(pn != null && pn.length() > 0) packageName = pn;
+ if(pn == null || pn.length() == 0) continue;
+ String cn = pn + "." + name;
+ packageName = pn;
+ if(set.size() == 1) break;
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(sp.getProject());
+ IType type = null;
+ try {
+ type = EclipseJavaUtil.findType(jp, cn);
+ } catch (JavaModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ if(type != null) {
+ break;
+ }
}
}
}
- String className = packageName + "." + toCamelCase(tag, true); //$NON-NLS-1$ //$NON-NLS-2$
+ String className = packageName + "." + name; //$NON-NLS-1$
return className;
}
16 years, 5 months
JBoss Tools SVN: r12125 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console: src/org/hibernate/eclipse/console/views/navigator and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-11-28 10:01:26 -0500 (Fri, 28 Nov 2008)
New Revision: 12125
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
Log:
adjust class name
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2008-11-28 14:58:58 UTC (rev 12124)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2008-11-28 15:01:26 UTC (rev 12125)
@@ -769,7 +769,7 @@
<view
allowMultiple="false"
category="hibernatecategory"
- class="org.hibernate.eclipse.console.views.navigator.KnownConfigurationsNaviagtor"
+ class="org.hibernate.eclipse.console.views.navigator.KnownConfigurationsNavigator"
id="org.hibernate.eclipse.navigator.KnownConfigurationsViewer"
name="Hibernate Configurations"/>
</extension>
Copied: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java (from rev 10769, trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNaviagtor.java)
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java 2008-11-28 15:01:26 UTC (rev 12125)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.eclipse.console.views.navigator;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.hibernate.console.KnownConfigurations;
+
+public class KnownConfigurationsNavigator extends CommonNavigator {
+
+ protected IAdaptable getInitialInput() {
+ return new AdaptableWrapper(new String());
+ }
+
+ public void createPartControl(Composite aParent) {
+ super.createPartControl( aParent );
+ getCommonViewer().setInput(KnownConfigurations.getInstance());
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
16 years, 5 months