JBoss Tools SVN: r6262 - in trunk/seam/plugins/org.jboss.tools.seam.core: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-12 10:26:24 -0500 (Tue, 12 Feb 2008)
New Revision: 6262
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
Log:
JBIDE-1758
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-02-12 14:58:42 UTC (rev 6261)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-02-12 15:26:24 UTC (rev 6262)
@@ -37,6 +37,8 @@
org.jboss.ide.eclipse.as.core,
org.eclipse.wst.server.core,
org.eclipse.core.filesystem,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.ltk.ui.refactoring,
org.eclipse.jst.j2ee.ejb,
org.eclipse.jst.jsf.ui,
org.jboss.tools.jst.web,
@@ -44,7 +46,8 @@
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
org.jboss.tools.seam.internal.core.scanner,
- org.jboss.tools.seam.internal.core.preferences
+ org.jboss.tools.seam.internal.core.preferences,
+ org.jboss.tools.seam.internal.core.refactoring
Bundle-Version: 2.0.0
Export-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.core.event,
@@ -56,4 +59,5 @@
org.jboss.tools.seam.internal.core.scanner.java,
org.jboss.tools.seam.internal.core.scanner.lib,
org.jboss.tools.seam.internal.core.scanner.xml,
- org.jboss.tools.seam.internal.core.validation
+ org.jboss.tools.seam.internal.core.validation,
+ org.jboss.tools.seam.internal.core.refactoring
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-02-12 14:58:42 UTC (rev 6261)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-02-12 15:26:24 UTC (rev 6262)
@@ -289,4 +289,22 @@
class="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"/>
</extension>
+ <extension
+ point="org.eclipse.ltk.core.refactoring.renameParticipants">
+
+ <renameParticipant
+ class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameProjectParticipant"
+ id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameProjectParticipant"
+ name="seam-RenameProjectParticipant">
+ <enablement>
+ <with variable="element">
+ <or>
+ <instanceof value="org.eclipse.core.resources.IProject"/>
+ </or>
+ </with>
+ </enablement>
+ </renameParticipant>
+
+ </extension>
+
</plugin>
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectChange.java 2008-02-12 15:26:24 UTC (rev 6262)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * 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.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamRenameProjectChange extends Change {
+ IProject project;
+ String newName;
+ String oldName;
+
+ static String[] PROPERTIES = {
+ "seam.parent.project",
+ "seam.ear.project",
+ "seam.ejb.project",
+ "seam.test.project"
+ };
+
+ List<String> relevantProperties = new ArrayList<String>();
+
+ public SeamRenameProjectChange(IProject project, String newName, String oldName) {
+ this.project = project;
+ this.newName = newName;
+ this.oldName = oldName;
+ IEclipsePreferences ps = getSeamPreferences();
+ for (int i = 0; i < PROPERTIES.length; i++) {
+ if(oldName.equals(ps.get(PROPERTIES[i], null))) {
+ relevantProperties.add(PROPERTIES[i]);
+ }
+ }
+ }
+
+ public boolean isRelevant() {
+ return relevantProperties.size() > 0;
+ }
+
+ @Override
+ public Object getModifiedElement() {
+ return project;
+ }
+
+ @Override
+ public String getName() {
+ return project.getName();
+ }
+
+ @Override
+ public void initializeValidationData(IProgressMonitor pm) {
+ }
+
+ @Override
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ if(!isRelevant()) return null;
+ try {
+ pm.beginTask(getName(), 1);
+
+ IEclipsePreferences ps = getSeamPreferences();
+ for (String property: relevantProperties) {
+ if(oldName.equals(ps.get(property, null))) {
+ ps.put(property, newName);
+ }
+ }
+ try {
+ ps.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return new SeamRenameProjectChange(project, oldName, newName);
+ } finally {
+ pm.done();
+ }
+ }
+
+ public IEclipsePreferences getSeamPreferences() {
+ IScopeContext projectScope = new ProjectScope(project);
+ return projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProjectParticipant.java 2008-02-12 15:26:24 UTC (rev 6262)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.refactoring;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamRenameProjectParticipant extends RenameParticipant {
+ public static final String PARTICIPANT_NAME="seam-RenameProjectParticipant";
+
+ IProject project;
+ String oldName;
+
+ public SeamRenameProjectParticipant() {}
+
+ @Override
+ public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
+ return null;
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ if (!pm.isCanceled()) {
+ String newName = getArguments().getNewName();
+ if(newName == null || newName.trim().length() == 0) return null;
+ CompositeChange change = new CompositeChange("Update Seam projects");
+ IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (int i = 0; i < ps.length; i++) {
+ SeamRenameProjectChange c = new SeamRenameProjectChange(ps[i], newName, oldName);
+ if(c.isRelevant()) change.add(c);
+ }
+ if(change.getChildren().length > 0) return change;
+ }
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return PARTICIPANT_NAME;
+ }
+
+ @Override
+ protected boolean initialize(Object element) {
+ if(!(element instanceof IProject)) {
+ return false;
+ }
+ project = (IProject)element;
+ oldName = project.getName();
+ return true;
+ }
+
+}
16 years, 4 months
JBoss Tools SVN: r6261 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: jspeditor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-12 09:58:42 -0500 (Tue, 12 Feb 2008)
New Revision: 6261
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualContext.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1769
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualContext.java 2008-02-12 14:49:44 UTC (rev 6260)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualContext.java 2008-02-12 14:58:42 UTC (rev 6261)
@@ -11,7 +11,6 @@
package org.jboss.tools.jst.jsp.editor;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
-import org.jboss.tools.jst.web.tld.VpeTaglibManager;
public interface IVisualContext {
public void refreshBundleValues();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-02-12 14:49:44 UTC (rev 6260)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-02-12 14:58:42 UTC (rev 6261)
@@ -184,9 +184,7 @@
if (pageContext==null) {
pageContext = new SourceEditorPageContext();
}
- // IDocument document = getTextViewer().getDocument();
- // pageContext.setDocument(document);
- IDOMDocument document = ((DOMModelImpl) getModel()).getDocument();
+ IDocument document = getTextViewer().getDocument();
pageContext.setDocument(document);
return pageContext;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-12 14:49:44 UTC (rev 6260)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-12 14:58:42 UTC (rev 6261)
@@ -14,6 +14,8 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
@@ -34,9 +36,17 @@
*/
public class SourceEditorPageContext implements IVisualContext,VpeTaglibManager {
- protected List<TaglibData> taglibs = null;
-
+ /**
+ * Contains information about taglibs on edited page
+ */
+ private List<TaglibData> taglibs = null;
+ /**
+ * Kb connector
+ */
private WtpKbConnector connector = null;
+ /**
+ * references node
+ */
private Node referenceNode = null;
public void clearAll() {
@@ -46,8 +56,8 @@
public void dispose() {
clearAll();
- connector = null;
- referenceNode = null;
+ setConnector(null);
+ setReferenceNode(null);
}
/**
@@ -56,19 +66,22 @@
*/
public void setReferenceNode(Node refNode) {
- if ((refNode==null)||(refNode.equals(referenceNode))) {
+ if ((refNode==null)||(refNode.equals(getReferenceNode()))) {
return;
}
- referenceNode = refNode;
+ setReferenceNode(refNode);
updateTagLibs();
}
-
- public void setDocument(Document doc) {
-
-// setReferenceNode(doc);
+ /**
+ * This method will be called if we work with jsp pages
+ * @param iDocument
+ */
+ public void setDocument(IDocument iDocument) {
+
+ setTaglibs(XmlUtil.getTaglibsForJSPDocument(iDocument));
try {
- connector = (WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, doc);
+ connector = (WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, iDocument);
} catch (InstantiationException e) {
JspEditorPlugin.getPluginLog().logError(e);
} catch (IllegalAccessException e) {
@@ -80,12 +93,12 @@
public void collectRefNodeTagLibs() {
- if(referenceNode==null) {
+ if(getReferenceNode()==null) {
return;
}
- if(referenceNode.getNodeType()==Node.DOCUMENT_NODE) {
- NodeList nodes =referenceNode.getChildNodes();
+ if(getReferenceNode().getNodeType()==Node.DOCUMENT_NODE) {
+ NodeList nodes =getReferenceNode().getChildNodes();
for(int i=0;i<nodes.getLength();i++) {
Node node =nodes.item(i);
@@ -97,7 +110,7 @@
}
} else {
- setTaglibs(XmlUtil.processNode(referenceNode));
+ setTaglibs(XmlUtil.processNode(getReferenceNode()));
}
}
@@ -159,4 +172,18 @@
this.taglibs = taglibs;
}
+ /**
+ * @return the referenceNode
+ */
+ public Node getReferenceNode() {
+ return referenceNode;
+ }
+
+ /**
+ * @param connector the connector to set
+ */
+ public void setConnector(WtpKbConnector connector) {
+ this.connector = connector;
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2008-02-12 14:49:44 UTC (rev 6260)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2008-02-12 14:58:42 UTC (rev 6261)
@@ -10,49 +10,54 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.outline;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
-import org.eclipse.core.resources.*;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.jspeditor.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.*;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.IModelProvider;
-import org.jboss.tools.jst.jsp.editor.IVisualContext;
-import org.jboss.tools.jst.jsp.editor.IVisualController;
-import org.jboss.tools.jst.jsp.editor.IVisualEditor;
-
-import org.jboss.tools.jst.jsp.contentassist.RedHatHtmlContentAssistProcessor;
-import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResource;
-import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResourceFactory;
-import org.jboss.tools.jst.jsp.drop.treeviewer.model.ModelElement;
-import org.jboss.tools.jst.jsp.drop.treeviewer.model.RootElement;
import org.jboss.tools.common.kb.AttributeDescriptor;
import org.jboss.tools.common.kb.AttributeValueDescriptor;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.KbException;
-import org.jboss.tools.common.kb.KbQuery;
import org.jboss.tools.common.kb.KbTldResource;
import org.jboss.tools.common.kb.TagDescriptor;
import org.jboss.tools.common.kb.wtp.JspWtpKbConnector;
import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.IPromptingProvider;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.contentassist.RedHatHtmlContentAssistProcessor;
+import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResource;
+import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResourceFactory;
+import org.jboss.tools.jst.jsp.drop.treeviewer.model.ModelElement;
+import org.jboss.tools.jst.jsp.drop.treeviewer.model.RootElement;
+import org.jboss.tools.jst.jsp.editor.IVisualContext;
+import org.jboss.tools.jst.jsp.editor.IVisualController;
+import org.jboss.tools.jst.jsp.editor.IVisualEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector;
import org.jboss.tools.jst.web.tld.TaglibData;
-import org.jboss.tools.jst.web.tld.TaglibMapping;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
@@ -73,8 +78,7 @@
}
}
-// VpePageContext
- IVisualContext pageContext = null;
+ IVisualContext iVisualContext = null;
WtpKbConnector pageConnector = null;
public ValueHelper() {
@@ -92,23 +96,23 @@
}
boolean init() {
- if(pageContext != null || pageConnector != null) return true;
+ if(iVisualContext != null || pageConnector != null) return true;
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof JSPMultiPageEditor)) return false;
JSPTextEditor jspEditor = ((JSPMultiPageEditor)editor).getJspEditor();
//Added By Max Areshkau
//Fix for JBIDE-788
- pageContext = jspEditor.getPageContext();
+ iVisualContext = jspEditor.getPageContext();
editorInput = jspEditor.getEditorInput();
wtpTextJspKbConnector = jspEditor.getWTPTextJspKbConnector();
- if(pageContext != null) {
+ if(iVisualContext != null) {
updateFacelets();
}
- return pageContext != null || pageConnector != null;
+ return iVisualContext != null || pageConnector != null;
}
public ModelElement getInitalInput(String query) {
@@ -185,9 +189,9 @@
public VpeTaglibManager getTaglibManager() {
init();
- if(pageContext!=null && pageContext instanceof VpeTaglibManager) {
+ if(iVisualContext!=null && iVisualContext instanceof VpeTaglibManager) {
- return (VpeTaglibManager)pageContext;
+ return (VpeTaglibManager)iVisualContext;
} else {
return null;
@@ -195,7 +199,7 @@
}
public WtpKbConnector getPageConnector() {
- if(pageContext != null) return pageContext.getConnector();
+ if(iVisualContext != null) return iVisualContext.getConnector();
return pageConnector;
}
@@ -214,7 +218,7 @@
//Support of StructuredTextEditor
boolean init2() {
- if(pageContext != null || pageConnector != null) return true;
+ if(iVisualContext != null || pageConnector != null) return true;
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof StructuredTextEditor)) return false;
StructuredTextEditor jspEditor = ((StructuredTextEditor)editor);
@@ -223,7 +227,7 @@
if(document == null) return false;
installActivePropmtSupport(jspEditor, document);
getConnector(document);
- return pageContext != null || pageConnector != null;
+ return iVisualContext != null || pageConnector != null;
}
private void installActivePropmtSupport(StructuredTextEditor jspEditor, IDocument document) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java 2008-02-12 14:49:44 UTC (rev 6260)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/XmlUtil.java 2008-02-12 14:58:42 UTC (rev 6261)
@@ -15,6 +15,11 @@
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.w3c.dom.Attr;
@@ -92,7 +97,25 @@
return taglibs;
}
+
/**
+ * Finds and returns taglibs for JSP documents
+ * @return
+ */
+ public static List<TaglibData> getTaglibsForJSPDocument(IDocument document) {
+
+ List<TaglibData> taglibData = new ArrayList<TaglibData>();
+
+ TLDCMDocumentManager tldcmDocumentManager= TaglibController.getTLDCMDocumentManager(document);
+ if(tldcmDocumentManager!=null) {
+ List<TaglibTracker> taglibs_JSP = tldcmDocumentManager.getTaglibTrackers();
+ for (TaglibTracker taglibTracker : taglibs_JSP) {
+ addTaglib(taglibData, taglibTracker.getURI(), taglibTracker.getPrefix(), true,false);
+ }
+ }
+ return taglibData;
+ }
+ /**
* Processes taglib attribute
* @param taglibs
* @param attr
16 years, 4 months
JBoss Tools SVN: r6260 - trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-12 09:49:44 -0500 (Tue, 12 Feb 2008)
New Revision: 6260
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java
Log:
JBIDE-1764 Test added
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java 2008-02-12 13:21:15 UTC (rev 6259)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java 2008-02-12 14:49:44 UTC (rev 6260)
@@ -82,5 +82,10 @@
public User testFactory() {
return new User();
}
+
+ @Factory
+ public User getMyFactory2() {
+ return new User();
+ }
}
16 years, 4 months
JBoss Tools SVN: r6259 - in trunk/seam: plugins/org.jboss.tools.seam.ui/icons and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-12 08:21:15 -0500 (Tue, 12 Feb 2008)
New Revision: 6259
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/OpenSeamComponentAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
Log:
http://jira.jboss.com/jira/browse/JBIDE-518
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-02-12 13:14:09 UTC (rev 6258)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-02-12 13:21:15 UTC (rev 6259)
@@ -418,4 +418,41 @@
name="Seam">
</perspective>
</extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="Seam Navigation"
+ description="Seam Navigation Action Set"
+ visible="true"
+ id="org.jboss.tools.seam.ui.SeamActionSet">
+ <action
+ class="org.jboss.tools.seam.ui.actions.OpenSeamComponentAction"
+ definitionId="org.jboss.tools.seam.ui.open.component"
+ helpContextId="org.eclipse.jdt.ui.open_type_action"
+ icon="icons/open_seam_project.gif"
+ id="openComponent"
+ label="Open Seam Component"
+ menubarPath="navigate/open.ext2"
+ toolbarPath="org.eclipse.search.searchActionSet/Search"
+ tooltip="Open Seam Component">
+ </action>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.ui.category.navigate"
+ description="Open Seam Component"
+ id="org.jboss.tools.seam.ui.open.component"
+ name="Open Seam Component">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.jboss.tools.seam.ui.open.component"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+Y">
+ </key>
+ </extension>
</plugin>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-02-12 13:14:09 UTC (rev 6258)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-02-12 13:21:15 UTC (rev 6259)
@@ -45,6 +45,18 @@
public static String GENERATE_SEAM_ENTITIES_WIZARD_REVERSE_ENGINEER_LABEL;
public static String GENERATE_SEAM_ENTITIES_WIZARD_EXISTING_ENTITIES_LABEL;
+ public static String OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME;
+
+ public static String OPEN_SEAM_COMPONENT_ACTION_DESCRIPTION;
+
+ public static String OPEN_SEAM_COMPONENT_ACTION_MESSAGE;
+
+ public static String OPEN_SEAM_COMPONENT_ACTION_TOOL_TIP;
+
+ public static String OPEN_SEAM_COMPONENT_DIALOG_LOADING;
+
+ public static String OPEN_SEAM_COMPONENT_DIALOG_NAME;
+
public static String SEAM_ACTION_WIZARD_ACTION_CREATING_OPERATION;
public static String SEAM_ACTION_WIZARD_NEW_SEAM_ACTION;
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/OpenSeamComponentAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/OpenSeamComponentAction.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/OpenSeamComponentAction.java 2008-02-12 13:21:15 UTC (rev 6259)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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.ui.actions;
+
+
+import java.util.Set;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SelectionDialog;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamComponentDeclaration;
+import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
+import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
+
+/**
+ * @author Daniel Azarov
+ *
+ */
+public class OpenSeamComponentAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
+
+ public OpenSeamComponentAction() {
+ super();
+ setText(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME);
+ setDescription(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_DESCRIPTION);
+ setToolTipText(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_TOOL_TIP);
+ }
+
+ public void run() {
+ runWithEvent(null);
+ }
+
+ public void runWithEvent(Event e) {
+ Shell parent= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ SelectionDialog dialog;
+
+ dialog= new OpenSeamComponentDialog(parent);
+
+ dialog.setTitle(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME);
+ dialog.setMessage(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_MESSAGE);
+
+ int result= dialog.open();
+ if (result != IDialogConstants.OK_ID)
+ return;
+
+ Object[] components= dialog.getResult();
+ if (components != null && components.length > 0) {
+ ISeamComponent component= null;
+ for (int i= 0; i < components.length; i++) {
+ component= (ISeamComponent) components[i];
+ SeamJavaComponentDeclaration javaDeclaration = (SeamJavaComponentDeclaration)component.getJavaDeclaration();
+ if(javaDeclaration != null){
+ javaDeclaration.open();
+ }else{
+ Set<ISeamComponentDeclaration> declarations = component.getAllDeclarations();
+ if(declarations.iterator().hasNext()){
+ ((SeamComponentDeclaration)declarations.iterator().next()).open();
+ }
+ }
+ }
+ }
+ }
+
+
+ // ---- IWorkbenchWindowActionDelegate
+ // ------------------------------------------------
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public void dispose() {
+ // do nothing.
+ }
+
+ public void init(IWorkbenchWindow window) {
+ // do nothing.
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ // do nothing. Action doesn't depend on selection.
+ }
+
+ // ---- IActionDelegate2
+ // ------------------------------------------------
+
+ public void runWithEvent(IAction action, Event event) {
+ runWithEvent(event);
+ }
+
+ public void init(IAction action) {
+ // do nothing.
+ }
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-02-12 13:14:09 UTC (rev 6258)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-02-12 13:21:15 UTC (rev 6259)
@@ -195,4 +195,10 @@
SEAM_TARGET_SERVER=Target Server
RUNTIME_DELETE_CONFIRM_TITLE=Confirm Runtime Delete
RUNTIME_DELETE_NOT_USED_CONFIRM=Are you sure you want to delete runtime ''{0}''?
-RUNTIME_DELETE_USED_CONFIRM=Runtime ''{0}'' is used by seam projects. Are you sure you want to delete it?
\ No newline at end of file
+RUNTIME_DELETE_USED_CONFIRM=Runtime ''{0}'' is used by seam projects. Are you sure you want to delete it?
+OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME=Open Seam Component
+OPEN_SEAM_COMPONENT_ACTION_DESCRIPTION=Open Seam Component
+OPEN_SEAM_COMPONENT_ACTION_TOOL_TIP=Open Seam Component
+OPEN_SEAM_COMPONENT_ACTION_MESSAGE=&Choose a name of the seam component (? = any character, * = any string):
+OPEN_SEAM_COMPONENT_DIALOG_LOADING=Seam components loading
+OPEN_SEAM_COMPONENT_DIALOG_NAME=OpenSeamComponentDialog
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-02-12 13:21:15 UTC (rev 6259)
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * 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.ui.wizard;
+
+import java.util.Comparator;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamComponent;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.SeamUiImages;
+import org.jboss.tools.seam.ui.views.SeamReferencedFilter;
+
+/**
+ * @author Daniel Azarov
+ *
+ */
+public class OpenSeamComponentDialog extends FilteredItemsSelectionDialog {
+
+ public OpenSeamComponentDialog(Shell shell) {
+ super(shell);
+ setListLabelProvider(new SeamComponentLabelProvider());
+ setDetailsLabelProvider(new SeamComponentLabelProvider());
+ setSelectionHistory(new SeamComponentSelectionHistory());
+ }
+
+ protected void computeResult() {
+ super.computeResult();
+ }
+
+ protected Control createExtendedContentArea(Composite parent) {
+ return null;
+ }
+
+ protected ItemsFilter createFilter() {
+ return new SeamComponentFilter();
+ }
+
+ protected void fillContentProvider(AbstractContentProvider contentProvider,
+ ItemsFilter itemsFilter, IProgressMonitor progressMonitor)
+ throws CoreException {
+
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+ progressMonitor.beginTask(SeamUIMessages.OPEN_SEAM_COMPONENT_DIALOG_LOADING, projects.length);
+
+ for(int i = 0; i < projects.length; i++){
+ IProject project = projects[i];
+ progressMonitor.subTask(project.getName());
+ progressMonitor.worked(1);
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if(seamProject != null){
+ Iterator<ISeamComponent> iter = seamProject.getComponents().iterator();
+ while(iter.hasNext()){
+ ISeamComponent component = iter.next();
+
+ if(SeamReferencedFilter.isComponentDeclaredInThisProject(component))
+ contentProvider.add(component, itemsFilter);
+ }
+ }
+ }
+ progressMonitor.done();
+ }
+
+ protected IDialogSettings getDialogSettings() {
+ return new DialogSettings(SeamUIMessages.OPEN_SEAM_COMPONENT_DIALOG_NAME);
+ }
+
+ public String getElementName(Object item) {
+ if(item instanceof ISeamComponent){
+ ISeamComponent component = (ISeamComponent)item;
+ return component.getName();
+ }
+ return null;
+ }
+
+ protected Comparator<SeamComponent> getItemsComparator() {
+ return new SeamComponentComparator();
+ }
+
+ protected IStatus validateItem(Object item) {
+ return new SeamComponentStatus();
+ }
+
+ public class SeamComponentComparator implements Comparator<SeamComponent>{
+ public int compare(SeamComponent left, SeamComponent right) {
+ return left.getName().compareTo(right.getName());
+ }
+
+ }
+
+ public class SeamComponentFilter extends ItemsFilter{
+ public boolean isConsistentItem(Object item) {
+ return true;
+ }
+
+ public boolean matchItem(Object item) {
+ if(item instanceof ISeamComponent){
+ ISeamComponent component = (ISeamComponent)item;
+ return patternMatcher.matches(component.getName());
+ }
+ return false;
+ }
+ }
+
+ public class SeamComponentStatus implements IStatus{
+ public IStatus[] getChildren() {
+ return null;
+ }
+
+ public int getCode() {
+ return 0;
+ }
+
+ public Throwable getException() {
+ return null;
+ }
+
+ public String getMessage() {
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getPlugin() {
+ return ""; //$NON-NLS-1$
+ }
+
+ public int getSeverity() {
+ return 0;
+ }
+
+ public boolean isMultiStatus() {
+ return false;
+ }
+
+ public boolean isOK() {
+ return true;
+ }
+
+ public boolean matches(int severityMask) {
+ return false;
+ }
+
+ }
+
+ public class SeamComponentSelectionHistory extends SelectionHistory{
+ protected Object restoreItemFromMemento(IMemento memento) {
+ return null;
+ }
+
+ @Override
+ protected void storeItemToMemento(Object item, IMemento memento) {
+ }
+
+ }
+
+ public class SeamComponentLabelProvider implements ILabelProvider{
+
+ public Image getImage(Object element) {
+ return SeamUiImages.COMPONENT_IMAGE;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof ISeamComponent){
+ ISeamComponent component = (ISeamComponent)element;
+ return component.getName()+" - "+component.getSeamProject().getProject().getName(); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-02-12 13:21:15 UTC (rev 6259)
@@ -0,0 +1,19 @@
+package org.jboss.tools.seam.ui.test.wizard;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
+
+/**
+ * @author Daniel Azarov
+ *
+ */
+public class OpenSeamComponentDialogTest extends TestCase{
+
+ public void testOpenSeamComponentDialogIsCreated() {
+ OpenSeamComponentDialog dialog = new OpenSeamComponentDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ dialog.open();
+ }
+}
16 years, 4 months
JBoss Tools SVN: r6258 - trunk/documentation/qa/reports.
by jbosstools-commits@lists.jboss.org
Author: anis
Date: 2008-02-12 08:14:09 -0500 (Tue, 12 Feb 2008)
New Revision: 6258
Added:
trunk/documentation/qa/reports/smoke-04.02.2008.zip
Log:
Added a file remotely
Added: trunk/documentation/qa/reports/smoke-04.02.2008.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/smoke-04.02.2008.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 4 months
JBoss Tools SVN: r6257 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-02-12 07:56:51 -0500 (Tue, 12 Feb 2008)
New Revision: 6257
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/calendar/calendar.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1682, style classes updated
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/calendar/calendar.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/calendar/calendar.css 2008-02-12 12:27:41 UTC (rev 6256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/calendar/calendar.css 2008-02-12 12:56:51 UTC (rev 6257)
@@ -1,5 +1,5 @@
.rich-calendar-input {
- cursor:pointer;
+ cursor: pointer;
vertical-align: middle;
text-align: right;
@@ -12,43 +12,28 @@
}
.rich-calendar-exterior {
- border: 1px solid #c0c0c0; /*panelBorderColor*/
+ border: 1px solid #c0c0c0;
}
.rich-calendar-header {
- border-bottom: 1px solid #c0c0c0; /*panelBorderColor*/
- background: #C7D7EC; /*additionalBackgroundColor*/
- font-size: 11px; /*generalSizeFont*/
- font-family: verdana; /*generalFamilyFont*/
+ border-bottom: 1px solid #c0c0c0;
+ background: #D4CFC7;
+ font-size: 11px;
+ font-family: Arial, Verdana, sans-serif;
+ font-weight: bold;
+ vertical-align: middle;
+ text-align: center;
padding: 7px;
height: 22px;
}
.rich-calendar-tool {
- border-bottom: 1px solid #c0c0c0; /*panelBorderColor*/
- background-color: #D4CFC7; /*headerBackgroundColor*/
- font-size: 11px; /*headerSizeFont*/
- font-family: Arial, Verdana, sans-serif;
- color: #000000; /*headerTextColor*/
- font-weight: bold;
- vertical-align: middle;
- text-align: center;
width: 25px;
height: 22px;
}
.rich-calendar-month {
- border-bottom: 1px solid #c0c0c0; /*panelBorderColor*/
- background-color: #D4CFC7; /*headerBackgroundColor*/
- border-bottom-color: #C4C0B9;
- font-size: 11px; /*headerSizeFont*/
- font-family: Arial, Verdana, sans-serif;
- color: #000000; /*headerTextColor*/
- font-weight: bold;
- vertical-align: middle;
- text-align: center;
- color: #000000;
- font-size: 11px
+
}
.rich-calendar-tool-close {
@@ -108,11 +93,11 @@
}
.rich-calendar-boundary-dates {
-color:#A0A0A0;
+ color: #A0A0A0;
}
.rich-calendar-btn {
-cursor:pointer;
+ cursor: pointer;
}
.rich-calendar-today {
@@ -140,17 +125,13 @@
.rich-calendar-footer {
border-top: 1px solid #c0c0c0; /*panelBorderColor*/
border-right: 0px solid #c0c0c0; /*panelBorderColor*/
- background: #C7D7EC; /*additionalBackgroundColor*/
+ background: #F1EEE9; /*additionalBackgroundColor*/
font-size: 11px; /*generalSizeFont*/
font-family: verdana; /*generalFamilyFont*/
padding: 7px;
height: 22px;
}
-.rich-calendar-other-month {
- color: #C7D7EC
-}
-
.rich-calendar-header-optional {
background: #D4CFC7;
text-align: center;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-02-12 12:27:41 UTC (rev 6256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-02-12 12:56:51 UTC (rev 6257)
@@ -46,6 +46,7 @@
public class RichFacesCalendarTemplate extends VpeAbstractTemplate implements VpeToggableTemplate {
static String[] HEADER_CONTENT = { "<<", "<", "", ">", ">>" };
+ static String[] HEADER_CONTENT_ON_POPUP = { "<<", "<", "", ">", ">>", "X" };
final static int MONTH_LENGTH[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31,
30, 31 };
final static int LEAP_MONTH_LENGTH[] = { 31, 29, 31, 30, 31, 30, 31, 31,
@@ -112,7 +113,6 @@
static final String CSS_R_C_SELECT = "rich-calendar-select";
static final String CSS_R_C_TOOLFOOTER = "rich-calendar-toolfooter";
static final String CSS_R_C_FOOTER = "rich-calendar-footer";
- static final String CSS_R_C_OTHER_MONTH = "rich-calendar-other-month";
static final String CSS_R_C_HEADER_OPTIONAL = "rich-calendar-header-optional";
static final String CSS_R_C_FOOTER_OPTIONAL = "rich-calendar-footer-optional";
@@ -139,8 +139,7 @@
private static final String STYLE_TOP_RIGHT = "vertical-align: bottom; text-align: left;";
private static final String STYLE_BOTTOM_LEFT = "vertical-align: top; text-align: right;";
private static final String STYLE_BOTTOM_RIGHT = "vertical-align: top; text-align: left;";
- private static final String CALENDAR_POSITION_STYLE = "position: absolute; z-index: 10;";
-
+
/*rich:calendar attributes*/
private String buttonLabel;
private String buttonIcon;
@@ -215,7 +214,7 @@
calendarWithPopup = createCalendarWithPopup(visualDocument, source);
calendar = createCalendar(visualDocument, creationData, source);
- calendar.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, CALENDAR_POSITION_STYLE);
+// calendar.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, calculateCalendarPositionStryle());
if (showPopupCalendar) {
if (attrPresents(direction) && directions.keySet().contains(direction)) {
@@ -270,7 +269,7 @@
} else {
// no direction. simple display.
- calendar.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, CALENDAR_POSITION_STYLE);
+ //calendar.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, calculateCalendarPositionStryle());
div.appendChild(calendarWithPopup);
div.appendChild(calendar);
}
@@ -531,8 +530,14 @@
.createElement(HtmlComponentUtil.HTML_TAG_TD);
td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, "" + COLUMN);
+ String[] array;
+ if ("false".equalsIgnoreCase(popup)) {
+ array = HEADER_CONTENT;
+ } else {
+ array = HEADER_CONTENT_ON_POPUP;
+ }
+
SimpleDateFormat sdf = new SimpleDateFormat();
-// Date date = Calendar.getInstance().getTime();
Date date = getCalendarWithLocale().getTime();
String dateStr = "";
if (attrPresents(datePattern)) {
@@ -547,7 +552,7 @@
sdf.applyPattern(DEFAULT_DATE_PATTERN);
dateStr = sdf.format(date);
}
- HEADER_CONTENT[2] = dateStr;
+ array[2] = dateStr;
nsIDOMElement table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
@@ -561,13 +566,22 @@
nsIDOMElement tr1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- for (int i = 0; i < HEADER_CONTENT.length; i++) {
+ tr1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_R_C_HEADER);
+
+ for (int i = 0; i < array.length; i++) {
nsIDOMElement td1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
i == 2 ? CSS_R_C_MONTH : CSS_R_C_TOOL);
+
+ // close tool
+ if (i == 5) {
+ td1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, "0");
+ td1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "cursor: pointer;");
+ }
- nsIDOMText text1 = visualDocument.createTextNode(HEADER_CONTENT[i]);
+ nsIDOMText text1 = visualDocument.createTextNode(array[i]);
td1.appendChild(text1);
tr1.appendChild(td1);
}
@@ -598,6 +612,8 @@
nsIDOMElement tr1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ tr1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_R_C_FOOTER);
nsIDOMElement td1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
@@ -615,8 +631,8 @@
nsIDOMElement td2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
td2.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, FILL_WIDTH);
- td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- CSS_R_C_TOOLFOOTER);
+// td2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+// CSS_R_C_TOOLFOOTER);
tr1.appendChild(td2);
nsIDOMElement td3 = visualDocument
@@ -666,7 +682,6 @@
nsIDOMElement bodyTR = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- //Calendar cal1 = Calendar.getInstance();
Calendar cal1 = getCalendarWithLocale();
SimpleDateFormat wdf = new SimpleDateFormat("EE");
@@ -704,7 +719,6 @@
} // showWeekDaysBar
// Calendar body
- //Calendar cal = Calendar.getInstance();
Calendar cal = getCalendarWithLocale();
int month = cal.get(Calendar.MONTH);
@@ -934,7 +948,13 @@
public void toggle(VpeVisualDomBuilder builder, Node sourceNode,
String toggleId) {
showPopupCalendar = !showPopupCalendar;
-// showPopupCalendar = (showPopupCalendar ? false : true);
}
+
+ private String calculateCalendarPositionStryle() {
+ String position = "position: absolute; z-index: 10;";
+ position += " top: " + verticalOffset + ";";
+ position += " left: " + horizontalOffset + ";";
+ return position;
+ }
}
16 years, 4 months
JBoss Tools SVN: r6256 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-02-12 07:27:41 -0500 (Tue, 12 Feb 2008)
New Revision: 6256
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1761
test for classpath refactoring added
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2008-02-12 12:25:50 UTC (rev 6255)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2008-02-12 12:27:41 UTC (rev 6256)
@@ -30,6 +30,11 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchDelegate;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.launching.DefaultProjectClasspathEntry;
+import org.eclipse.jdt.internal.launching.RuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.hibernate.eclipse.launch.core.refactoring.HibernateRefactoringUtil;
@@ -40,27 +45,31 @@
public class RefactoringTest extends TestCase {
private final String[] oldPathElements = new String[]{"oldPrj","oldSrc", "oldPack", "oldHibernate.cfg.xml"};
- private final String[] newPathElements = new String[]{"newPrj","newSrc", "newPack", "newHibernate.cfg.xml"};
+ private final String[] newPathElements = new String[]{"newPrj","newSrc", "newPack", "newHibernate.cfg.xml"};
+
+ SimpleTestProject project = null;
private TestLaunchConfig testStrConfig = null;
private TestLaunchConfig testStrListConfig = null;
private TestLaunchConfig testNotChangedConfig = null;
+
+
+ private IRuntimeClasspathEntry[] runtimeClasspathEntries = null;
+ private int[] affectSegmentsCount = null; // shows how much segments should affect path
+
private String oldPathStr = null;
- private Path oldPath = null;
-
@Override
protected void setUp() throws Exception {
- super.setUp();
oldPathStr = oldPathElements[0];
String notChangedPathStr = oldPathElements[0] + 1;
for (int i = 1; i < oldPathElements.length; i++) {
oldPathStr += "/" + oldPathElements[i];
notChangedPathStr += "/" + oldPathElements[i] + 1;
}
- Map testStrAttr = new HashMap();
- Map testStrListAttr = new HashMap();
- Map testNotChangedAttr = new HashMap();
+ Map<String, Object> testStrAttr = new HashMap<String, Object>();
+ Map<String, Object> testStrListAttr = new HashMap<String, Object>();
+ Map<String, Object> testNotChangedAttr = new HashMap<String, Object>();
testStrAttr.put(IConsoleConfigurationLaunchConstants.CFG_XML_FILE, oldPathStr);
@@ -72,23 +81,64 @@
testStrConfig = new TestLaunchConfig(testStrAttr);
testStrListConfig = new TestLaunchConfig(testStrListAttr);
testNotChangedConfig = new TestLaunchConfig(testNotChangedAttr);
- oldPath = new Path(oldPathStr);
+ project = new SimpleTestProject(oldPathElements[0]);
+ IJavaProject proj = project.getIJavaProject();
+
+ { //initialize IRuntimeClassPathEntry[] and affectSegmentsCount for it
+ runtimeClasspathEntries = new IRuntimeClasspathEntry[5];
+ affectSegmentsCount = new int[runtimeClasspathEntries.length];
+ affectSegmentsCount[0] = 0;
+ affectSegmentsCount[1] = 0;
+ affectSegmentsCount[2] = 1;
+ affectSegmentsCount[3] = 2;
+ affectSegmentsCount[4] = oldPathElements.length - 1; //all changes
+
+ runtimeClasspathEntries[0] = new DefaultProjectClasspathEntry(proj);//project
+ runtimeClasspathEntries[1] = new RuntimeClasspathEntry( JavaCore.newProjectEntry(generateOldPathForSegment(affectSegmentsCount[1]).makeAbsolute()));
+ runtimeClasspathEntries[2] = new RuntimeClasspathEntry( JavaCore.newVariableEntry(generateOldPathForSegment(affectSegmentsCount[2]).makeAbsolute(), null, null));
+ runtimeClasspathEntries[3] = new RuntimeClasspathEntry( JavaCore.newVariableEntry(generateOldPathForSegment(affectSegmentsCount[3]).makeAbsolute(), null, null));
+ runtimeClasspathEntries[4] = new RuntimeClasspathEntry( JavaCore.newLibraryEntry(generateOldPathForSegment(affectSegmentsCount[4]).makeAbsolute(), null, null));
+ }
}
public void testFindChanged(){
- try {
- assertTrue(HibernateRefactoringUtil.isConfigurationChanged(testStrConfig, oldPath));
- assertTrue(HibernateRefactoringUtil.isConfigurationChanged(testStrListConfig, oldPath));
- assertTrue(!HibernateRefactoringUtil.isConfigurationChanged(testNotChangedConfig, oldPath));
- } catch (CoreException e) {
- fail(e.getMessage());
+ for (int i = 0; i < oldPathElements.length - 1; i++) {
+ IPath oldPathPart = generateOldPathForSegment(i);
+ try {
+ assertTrue(HibernateRefactoringUtil.isConfigurationAffected(testStrConfig, oldPathPart));
+ assertTrue(HibernateRefactoringUtil.isConfigurationAffected(testStrListConfig, oldPathPart));
+ assertFalse(HibernateRefactoringUtil.isConfigurationAffected(testNotChangedConfig, oldPathPart));
+ } catch (CoreException e) {
+ fail("Exception while FindChanged launch configurations processing!" + e.getMessage());
+ }
}
}
+ public void testClassPathChanges(){
+ for (int i = 0; i < oldPathElements.length - 1; i++) {
+ IPath oldPathPart = generateOldPathForSegment(i);
+ for (int j = 0; j < runtimeClasspathEntries.length; j++) {
+ if (i <= affectSegmentsCount[j]){
+ assertTrue(HibernateRefactoringUtil.isRuntimeClassPathEntriesAffected(new IRuntimeClasspathEntry[]{runtimeClasspathEntries[j]}, oldPathPart));
+ try {
+ IPath newPath = generateNewPathForSegment(i);
+ String oldMemento = runtimeClasspathEntries[j].getMemento();
+ String newMemento = HibernateRefactoringUtil.getUpdatedMemento(oldMemento, newPath, oldPathPart);
+ checkMementoChanged(oldMemento, newMemento, oldPathPart, newPath);
+ } catch (CoreException e) {
+ fail("CoreException occured when try to work with memento." + e.getMessage());
+ }
+ } else {
+ assertFalse(HibernateRefactoringUtil.isRuntimeClassPathEntriesAffected(new IRuntimeClasspathEntry[]{runtimeClasspathEntries[j]}, oldPathPart));
+ }
+ }
+ }
+ }
+
public void testProjectNameChange(){
int segmentNum = 0;
try {
- updateConfigs(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
+ updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
fail("Exception while ProjectNameChange refactor processing!");
@@ -98,7 +148,7 @@
public void testSrcNameChange(){
int segmentNum = 1;
try {
- updateConfigs(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
+ updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
fail("Exception while SrcNameChange refactor processing!");
@@ -108,7 +158,7 @@
public void testPackNameChange(){
int segmentNum = 2;
try {
- updateConfigs(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
+ updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
fail("Exception while PackNameChange refactor processing!");
@@ -118,23 +168,66 @@
public void testFileNameChange(){
int segmentNum = 3;
try {
- updateConfigs(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
+ updatePaths(generateOldPathForSegment(segmentNum), generateNewPathForSegment(segmentNum));
checkPaths(generateTruePathForSegment(segmentNum));
} catch (CoreException e) {
fail("Exception while FileNameChange refactor processing!");
}
}
- private void updateConfigs(Path oldPath, Path newPath) throws CoreException{
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ project.deleteIProject();
+ }
+
+ private void updatePaths(Path oldPath, Path newPath) throws CoreException{
HibernateRefactoringUtil.updateLaunchConfig(testStrConfig, oldPath, newPath);
HibernateRefactoringUtil.updateLaunchConfig(testStrListConfig, oldPath, newPath);
}
+ private void checkMementoChanged(String oldMemento, String newMemento, IPath oldPathPart, IPath newPath){
+ /*
+ * /myProj/mySrc, \myProj\mySrc, myProj/mySrc, myProj\mySrc, myProj/mySrc/, myProj\mySrc\
+ * mean the same path and should be represented as myProj[\\\\,/]mySrc regular expression
+ */
+ String oldPathStr = oldPathPart.toOSString().replaceAll("\\\\", "/"); //replace all "\" on "/"
+ String newPathStr = newPath.toOSString().replaceAll("\\\\", "/");
+ if (oldPathStr.charAt(0) == '/') oldPathStr = oldPathStr.substring(1); //remove first slash
+ if (newPathStr.charAt(0) == '/') newPathStr = newPathStr.substring(1);
+ if (oldPathStr.charAt(oldPathStr.length() - 1) == '/') oldPathStr = oldPathStr.substring(0, oldPathStr.length() - 1); //remove last slash
+ if (newPathStr.charAt(newPathStr.length() - 1) == '/') newPathStr = newPathStr.substring(0 , newPathStr.length() - 1);
+ oldPathStr = oldPathStr.replaceAll("/", "[\\\\,/]?");
+ newPathStr = newPathStr.replaceAll("/", "[\\\\,/]?");
+
+ int count_old = 0;
+ int count_new = 0;
+ int last_index = 0;
+ while(last_index >= 0){
+ last_index = oldMemento.indexOf(oldPathStr, last_index);
+ if (last_index >= 0){
+ ++count_old;
+ ++last_index;
+ }
+ }
+ last_index = 0;
+ while(last_index >= 0){
+ last_index = newMemento.indexOf(newPathStr, last_index);
+ if (last_index >= 0){
+ ++count_new;
+ ++last_index;
+ }
+ }
+ assertTrue(count_new == count_old);
+ }
+
private void checkPaths(Path truePath) throws CoreException{
String newPath = (String) testStrConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE);
- assertEquals(truePath, new Path(newPath));
+ assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
newPath = (String) ((List) testStrListConfig.getNewAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS)).get(0);
- assertEquals(truePath, new Path(newPath));
+ assertEquals(truePath.makeAbsolute(), new Path(newPath).makeAbsolute());
}
private Path generateNewPathForSegment(int segmentNum){
@@ -168,15 +261,12 @@
return new Path(newPath);
}
-
-
-
-
+//====================================================================================
class TestWorkingCopy implements ILaunchConfigurationWorkingCopy{
private TestLaunchConfig parent;
- private Map attributes = new HashMap();
+ private Map<String, Object> attributes = new HashMap<String, Object>();
TestWorkingCopy(TestLaunchConfig parent){
this.parent = parent;
@@ -369,16 +459,16 @@
class TestLaunchConfig implements ILaunchConfiguration{
- private Map attributes = new HashMap();
+ private Map<String, Object> attributes = new HashMap<String, Object>();
- public Map updatedAttributes = new HashMap();
+ public Map<String, Object> updatedAttributes = new HashMap<String, Object>();
// returns updated attribute
public Object getNewAttribute(String attributeName){
return updatedAttributes.get(attributeName);
}
- TestLaunchConfig(Map attributes){
+ TestLaunchConfig(Map<String, Object> attributes){
if (attributes != null){
this.attributes = attributes;
}
16 years, 4 months
JBoss Tools SVN: r6255 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-02-12 07:25:50 -0500 (Tue, 12 Feb 2008)
New Revision: 6255
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1558
classpath changes updates
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2008-02-12 11:21:46 UTC (rev 6254)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2008-02-12 12:25:50 UTC (rev 6255)
@@ -10,21 +10,32 @@
******************************************************************************/
package org.hibernate.eclipse.launch.core.refactoring;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.launching.JavaMigrationDelegate;
-import org.eclipse.jdt.internal.launching.RuntimeClasspathEntry;
+import org.eclipse.jdt.internal.launching.LaunchingPlugin;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -32,7 +43,15 @@
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
* @author Dmitry Geraskov
@@ -42,7 +61,7 @@
private static final String ERROR_MESS = "Error during refactoring";
- private static String[] stringAttribs = new String[]{
+ private static String[] pathKeys = new String[]{
IConsoleConfigurationLaunchConstants.CFG_XML_FILE,
IConsoleConfigurationLaunchConstants.PROPERTY_FILE,
HibernateLaunchConstants.ATTR_TEMPLATE_DIR,
@@ -50,50 +69,62 @@
HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS,
};
- private static String[] strListAttribs = new String[]{
+ private static String[] pathListKeys = new String[]{
IConsoleConfigurationLaunchConstants.FILE_MAPPINGS,
};
- public static boolean isConfigurationChanged(ILaunchConfiguration config, IPath oldPath) throws CoreException{
+ public static boolean isConfigurationAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
+ return isAttributesAffected(config, oldPath) || isClassPathAffected(config, oldPath);
+ }
+
+ private static boolean isAttributesAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
String attrib = null;
- for (int i = 0; i < stringAttribs.length; i++) {
- attrib = config.getAttribute(stringAttribs[i], (String)null);
+ for (int i = 0; i < pathKeys.length; i++) {
+ attrib = config.getAttribute(pathKeys[i], (String)null);
if (isAttributeChanged(attrib, oldPath))
return true;
}
- for (int i = 0; i < strListAttribs.length; i++) {
- List list = config.getAttribute(strListAttribs[i], Collections.EMPTY_LIST);
- List newMappings = new ArrayList();
- Iterator iter = list.iterator();
+ for (int i = 0; i < pathListKeys.length; i++) {
+ List<String> list = config.getAttribute(pathListKeys[i], Collections.EMPTY_LIST);
+ List<String> newMappings = new ArrayList<String>();
+ Iterator<String> iter = list.iterator();
while ( iter.hasNext() ) {
- attrib = (String) iter.next();
+ attrib = iter.next();
if (isAttributeChanged(attrib, oldPath)){
return true;
}
newMappings.add(attrib);
}
}
-
- //classpath
+ return false;
+ }
+
+ private static boolean isClassPathAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
IRuntimeClasspathEntry[] entries;
try {
entries = JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- for (int i = 0; i < entries.length; i++) {
- IRuntimeClasspathEntry entry = entries[i];
- if(entry.getClasspathProperty()==IRuntimeClasspathEntry.USER_CLASSES) {
- attrib = entry.getPath() == null ? null
- : entry.getPath().toString();
- if(isAttributeChanged(attrib, oldPath)){
- return true;
- }
- }
- }
+ return isRuntimeClassPathEntriesAffected(entries, oldPath);
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
+ return false;
+ }
+ }
+
+ public static boolean isRuntimeClassPathEntriesAffected(IRuntimeClasspathEntry[] entries, IPath oldPath){
+ String attrib = null;
+ String projName = null;
+ for (int i = 0; i < entries.length; i++) {
+ IRuntimeClasspathEntry entry = entries[i];
+ attrib = entry.getPath() == null ? null
+ : entry.getPath().toString();
+ projName = entry.getJavaProject() == null ? null
+ : entry.getJavaProject().getElementName();
+ if(isAttributeChanged(attrib, oldPath) || isAttributeChanged(projName, oldPath)){
+ return true;
+ }
}
-
return false;
}
@@ -104,81 +135,181 @@
public static ILaunchConfiguration updateLaunchConfig(ILaunchConfiguration config, IPath oldPath, IPath newPath) throws CoreException{
final ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ updateAttributes(oldPath, newPath, wc);
+ //classpath
+ try {
+ updateClasspathEntries(config, oldPath, newPath, wc);
+ }
+ catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log( e );
+ }
+
+ //JavaMigrationDelegate.updateResourceMapping(wc);
+ if (wc.isDirty()) {
+ return wc.doSave();
+ } else {
+ return config;
+ }
+ }
+
+ private static void updateClasspathEntries(ILaunchConfiguration config,
+ IPath oldPath, IPath newPath,
+ final ILaunchConfigurationWorkingCopy wc)
+ throws CoreException {
+ boolean isChanged = false;
+ String attrib;
+ String projName;
+ IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedRuntimeClasspath(config);
+ List<String> oldMementos = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, Collections.EMPTY_LIST);
+ List<String> newMementos = new ArrayList<String>(entries.length);
+ for (int i = 0; i < entries.length; i++) {
+ IRuntimeClasspathEntry entry = entries[i];
+ attrib = entry.getPath() == null ? null
+ : entry.getPath().toString();
+ projName = entry.getJavaProject() == null ? null
+ : entry.getJavaProject().getElementName();
+ if(isAttributeChanged(attrib, oldPath)){
+ isChanged = true;
+ String memento = getUpdatedMemento(oldMementos.get(i), new Path(getUpdatedPath(attrib, oldPath, newPath)), oldPath);
+ newMementos.add(memento);
+ } else if(isAttributeChanged(projName, oldPath)){
+ isChanged = true;
+ String memento = getUpdatedMemento(oldMementos.get(i), newPath, oldPath);
+ newMementos.add(memento);
+ } else {
+ newMementos.add(entries[i].getMemento());
+ }
+ }
+ if (isChanged) wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, newMementos);
+ }
+
+ public static String getUpdatedMemento(String memento, IPath newPath, IPath oldPath) throws CoreException{
+ String error_mess = "Error occured while updating classpath.";
+ DocumentBuilder builder;
+ try {
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.parse(new InputSource(new StringReader(memento)));
+ DOMSource domSource = new DOMSource(doc);
+ StringWriter writer = new StringWriter();
+ StreamResult result = new StreamResult(writer);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer transformer = tf.newTransformer();
+ transformer.transform(domSource, result);
+
+ org.w3c.dom.NodeList nodeList = doc.getElementsByTagName("runtimeClasspathEntry");
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ org.w3c.dom.Node node = nodeList.item(i);
+ NamedNodeMap map = node.getAttributes();
+ Node changedNode = null;
+ //if (entry instanceof RuntimeClasspathEntry){
+ String[] attrNames = new String[]{"projectName", "externalArchive", "internalArchive",
+ "containerPath", "javaProject"};
+ for (int j = 0; j < attrNames.length; j++) {
+ changedNode = map.getNamedItem(attrNames[j]);
+ if (changedNode != null){
+ Path attrPath = new Path(changedNode.getNodeValue());
+ if (oldPath.isPrefixOf(attrPath)){
+ if (attrNames[j].equals("projectName") || attrNames[j].equals("javaProject")){
+ changedNode.setNodeValue(newPath.lastSegment());
+ } else {
+ changedNode.setNodeValue(getUpdatedPath(changedNode.getNodeValue(), oldPath, newPath).toString());
+ }
+ }
+ }
+ }
+ //} else if (entry instanceof DefaultProjectClasspathEntry){
+ if (node.getNodeType() == Node.ELEMENT_NODE)
+ {
+ Element element = (Element) node;
+ NodeList mementoList = element.getElementsByTagName("memento");
+ for(int j=0; j < mementoList.getLength(); j++)
+ {
+ map = mementoList.item(j).getAttributes();
+ changedNode = map.getNamedItem("project");
+ if (changedNode != null){
+ Path attrPath = new Path(changedNode.getNodeValue());
+ if (oldPath.isPrefixOf(attrPath)){
+ changedNode.setNodeValue(newPath.lastSegment());
+ }
+ }
+ }
+ }
+ }
+ //}
+ domSource = new DOMSource(doc);
+ /*writer = new StringWriter();
+ result = new StreamResult(writer);
+ tf = TransformerFactory.newInstance();
+ transformer = tf.newTransformer();
+ transformer.transform(domSource, result);
+ return writer.toString();*/
+ String newMemento = LaunchingPlugin.serializeDocument(doc);
+ return newMemento;
+ } catch (ParserConfigurationException e) {
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ throw new CoreException(status);
+ } catch (SAXException e) {
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ throw new CoreException(status);
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ throw new CoreException(status);
+ } catch (TransformerException e) {
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ throw new CoreException(status);
+ }
+ }
+
+ /*public static IRuntimeClasspathEntry getUpdatedEntry(IPath oldPath,
+ IPath newPath, IRuntimeClasspathEntry entry) {
+ String attrib = getUpdatedPath(entry.getPath().toString(), oldPath, newPath);
+ IPath p = new Path(attrib).makeAbsolute();
+
+ switch (entry.getClasspathEntry().getEntryKind()) {
+ case IClasspathEntry.CPE_PROJECT:
+ entry = new RuntimeClasspathEntry( JavaCore.newProjectEntry(p));
+ break;
+ default:
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(p);
+ break;
+ }
+ return entry;
+ }*/
+
+ private static void updateAttributes(IPath oldPath, IPath newPath,
+ final ILaunchConfigurationWorkingCopy wc) throws CoreException {
String attrib = null;
- for (int i = 0; i < stringAttribs.length; i++) {
- attrib = wc.getAttribute(stringAttribs[i], (String)null);
+ for (int i = 0; i < pathKeys.length; i++) {
+ attrib = wc.getAttribute(pathKeys[i], (String)null);
if (isAttributeChanged(attrib, oldPath)){
attrib = getUpdatedPath(attrib, oldPath, newPath);
- wc.setAttribute(stringAttribs[i], attrib);
+ wc.setAttribute(pathKeys[i], attrib);
}
}
boolean isChanged = false;
- for (int i = 0; i < strListAttribs.length; i++) {
- List list = wc.getAttribute(strListAttribs[i], Collections.EMPTY_LIST);
+ for (int i = 0; i < pathListKeys.length; i++) {
+ List<String> list = wc.getAttribute(pathListKeys[i], Collections.EMPTY_LIST);
isChanged = false;
- List newMappings = new ArrayList();
- Iterator iter = list.iterator();
+ List<String> newMappings = new ArrayList<String>();
+ Iterator<String> iter = list.iterator();
while ( iter.hasNext() ) {
- attrib = (String) iter.next();
+ attrib = iter.next();
if (isAttributeChanged(attrib, oldPath)){
attrib = getUpdatedPath(attrib, oldPath, newPath);
isChanged = true;
}
newMappings.add(attrib);
}
- if (isChanged) wc.setAttribute(strListAttribs[i], newMappings);
+ if (isChanged) wc.setAttribute(pathListKeys[i], newMappings);
}
-
- //classpath
- isChanged = false;
- IRuntimeClasspathEntry[] entries;
- try {
- entries = JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- List mementos = new ArrayList(entries.length);
- for (int i = 0; i < entries.length; i++) {
- IRuntimeClasspathEntry entry = entries[i];
- if(entry.getClasspathProperty()==IRuntimeClasspathEntry.USER_CLASSES) {
- attrib = entry.getPath() == null ? null
- : entry.getPath().toString();
- if(isAttributeChanged(attrib, oldPath)){
- attrib = getUpdatedPath(attrib, oldPath, newPath);
- IPath p = new Path(attrib).makeAbsolute();
-
- switch (entry.getClasspathEntry().getEntryKind()) {
- case IClasspathEntry.CPE_PROJECT:
- entry = new RuntimeClasspathEntry( JavaCore.newProjectEntry(p));
- break;
- default:
- entry = JavaRuntime.newArchiveRuntimeClasspathEntry(p);
- break;
- }
-
- entries[i] = entry;
- isChanged = true;
- }
- }
- mementos.add(entries[i].getMemento());
- }
- if (isChanged) wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos);
- }
- catch (CoreException e) {
- HibernateConsolePlugin.getDefault().log( e );
- }
-
- //JavaMigrationDelegate.updateResourceMapping(wc);
-
- if (wc.isDirty()) {
- return wc.doSave();
- } else {
- return config;
- }
}
private static String getUpdatedPath(String attrib, IPath oldPath, IPath newPath){
IPath attribPath = new Path(attrib);
- IPath newAttribPath = Path.EMPTY;
+ IPath newAttribPath = new Path("/");
for (int j = 0; j < attribPath.segmentCount(); j++){
if (!oldPath.isPrefixOf(attribPath.removeFirstSegments(j))){
//add prefix
@@ -190,19 +321,19 @@
break;
}
}
- return newAttribPath.toString();
+ return newAttribPath.toOSString();
}
- public static ILaunchConfiguration[] getChangedLaunchConfigurations(IPath path){
+ public static ILaunchConfiguration[] getAffectedLaunchConfigurations(IPath path){
ILaunchConfiguration[] configs = null;
try {
configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
- ArrayList list = new ArrayList();
- for(int i = 0; i < configs.length; i++) {
- //ILaunchConfigurationWorkingCopy wc = configs[i].getWorkingCopy();
- if (HibernateRefactoringUtil.isConfigurationChanged(configs[i], path)) list.add(configs[i]);
+ List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
+ for(int i = 0; i < configs.length; i++) {//refactor only hibernate launch configurations
+ if (!ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID.equals(configs[i].getType().getIdentifier())) continue;
+ if (HibernateRefactoringUtil.isConfigurationAffected(configs[i], path)) list.add(configs[i]);
}
- configs = (ILaunchConfiguration[])list.toArray(new ILaunchConfiguration[list.size()]);
+ configs = list.toArray(new ILaunchConfiguration[list.size()]);
}
catch(CoreException e) {
configs = new ILaunchConfiguration[0];
@@ -216,7 +347,7 @@
* @param changes - List of Change objects
* @return
*/
- public static Change createChangesFromList(List changes, String name) {
+ public static Change createChangesFromList(List<Change> changes, String name) {
if (changes.size() == 0) {
return null;
} else if (changes.size() == 1) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java 2008-02-12 11:21:46 UTC (rev 6254)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java 2008-02-12 12:25:50 UTC (rev 6255)
@@ -24,9 +24,9 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
- ILaunchConfiguration[] configs = HibernateRefactoringUtil.getChangedLaunchConfigurations(fResource.getFullPath());
+ ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedLaunchConfigurations(fResource.getFullPath());
- List changes = new ArrayList();
+ List<Change> changes = new ArrayList<Change>();
LaunchConfigurationResourceNameChange change = null;
for (int i= 0; i < configs.length; i++) {
change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(), ((IResource)getArguments().getDestination()).getFullPath().append(fResource.getName()));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java 2008-02-12 11:21:46 UTC (rev 6254)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java 2008-02-12 12:25:50 UTC (rev 6255)
@@ -44,9 +44,9 @@
*/
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
- ILaunchConfiguration[] configs = HibernateRefactoringUtil.getChangedLaunchConfigurations(fResource.getFullPath());
+ ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedLaunchConfigurations(fResource.getFullPath());
- List changes = new ArrayList();
+ List<Change> changes = new ArrayList<Change>();
LaunchConfigurationResourceNameChange change = null;
for (int i= 0; i < configs.length; i++) {
change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(),
16 years, 4 months
JBoss Tools SVN: r6254 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-12 06:21:46 -0500 (Tue, 12 Feb 2008)
New Revision: 6254
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
JBIDE-1764 Test added
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-02-12 11:15:50 UTC (rev 6253)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-02-12 11:21:46 UTC (rev 6254)
@@ -258,6 +258,12 @@
ISeamAnnotatedFactory af = (ISeamAnnotatedFactory)myFactory;
assertTrue("Scope of 'myFactory' must be 'session'", af.getScope() == ScopeType.SESSION);
+ // g) @Factory getMyFactory2 - no name is set in annotation
+ ISeamFactory myFactory2 = find(fs, "myFactory");
+ assertTrue("Declared factory 'myFactory2' is not found in 'myUser'", myFactory2 != null);
+ ISeamAnnotatedFactory af2 = (ISeamAnnotatedFactory)myFactory2;
+ assertTrue("Scope of 'myFactory' must be 'session'", af2.getScope() == ScopeType.SESSION);
+
}
private IBijectedAttribute findBijectedAttribute(Set<IBijectedAttribute> bijected, String name) {
16 years, 4 months
JBoss Tools SVN: r6253 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-12 06:15:50 -0500 (Tue, 12 Feb 2008)
New Revision: 6253
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
Log:
JBIDE-1764 Test added
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2008-02-12 11:13:48 UTC (rev 6252)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2008-02-12 11:15:50 UTC (rev 6253)
@@ -152,7 +152,7 @@
}
if(methodName.startsWith("get") && methodName.length() > 3) {
String root = methodName.substring(3);
- return root.substring(0, 1).toUpperCase() + root.substring(1);
+ return root.substring(0, 1).toLowerCase() + root.substring(1);
}
return methodName;
}
16 years, 4 months