JBoss Tools SVN: r17855 - trunk/jst/plugins/org.jboss.tools.jst.css.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-10-01 13:38:45 -0400 (Thu, 01 Oct 2009)
New Revision: 17855
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4960
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/plugin.xml 2009-10-01 17:32:40 UTC (rev 17854)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/plugin.xml 2009-10-01 17:38:45 UTC (rev 17855)
@@ -114,4 +114,52 @@
name="%css.perspective_name">
</perspective>
</extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.jst.cssPerspective">
+ <viewShortcut
+ id="org.eclipse.pde.runtime.LogView">
+ </viewShortcut>
+ <viewShortcut
+ id="org.eclipse.ui.views.TaskList">
+ </viewShortcut>
+ <viewShortcut
+ id="org.jboss.tools.seam.ui.views.SeamComponentsNavigator">
+ </viewShortcut>
+ <viewShortcut
+ id="org.eclipse.ui.views.PropertySheet">
+ </viewShortcut>
+ <viewShortcut
+ id="org.jboss.tools.jst.web.ui.navigator.WebProjectsView">
+ </viewShortcut>
+ <viewShortcut
+ id="org.jboss.ide.eclipse.archives.ui.ProjectArchivesView">
+ </viewShortcut>
+ <perspectiveShortcut
+ id="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.jdt.ui.JavaPerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.jst.j2ee.J2EEPerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.jboss.tools.seam.ui.SeamPerspective">
+ </perspectiveShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.jst.web.ui.wizards.newfile.NewCSSClassWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.jst.web.ui.wizards.newfile.NewCSSFileWizard">
+ </newWizardShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.debug.ui.DebugPerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.jdt.ui.JavaBrowsingPerspective">
+ </perspectiveShortcut>
+ </perspectiveExtension>
+ </extension>
</plugin>
15 years, 2 months
JBoss Tools SVN: r17854 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-10-01 13:32:40 -0400 (Thu, 01 Oct 2009)
New Revision: 17854
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4852
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp 2009-10-01 17:32:40 UTC (rev 17854)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp 2009-10-01 17:32:40 UTC (rev 17854)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
+ <jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8" />
+ <![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]>
+ <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">]]>
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <jsp:include page="include.jsp" id="openOn"></jsp:include>
+ </body>
+ </html>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
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 2009-10-01 16:05:29 UTC (rev 17853)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-10-01 17:32:40 UTC (rev 17854)
@@ -76,6 +76,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2170Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnCssClassTest_JBIDE4775;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnInsideJspRoot_JBIDE4852;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectAllAndCut_JBIDE4853;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectWholeElement_JBIDE4713;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VPERefreshTest;
@@ -167,6 +168,7 @@
suite.addTestSuite(JBIDE2550Test.class);
suite.addTestSuite(OpenOnCssClassTest_JBIDE4775.class);
suite.addTestSuite(VPERefreshTest.class);
+ suite.addTestSuite(OpenOnInsideJspRoot_JBIDE4852.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/OpenOnInsideJspRoot_JBIDE4852.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java 2009-10-01 17:32:40 UTC (rev 17854)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+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.OpenOnUtil;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class OpenOnInsideJspRoot_JBIDE4852 extends VpeTest {
+
+ private static final String TEST_PAGE_NAME = "JBIDE/4852/openOnTest.jsp"; //$NON-NLS-1$
+
+ private static String INCLUDE_TAG_ID = "openOn"; //$NON-NLS-1$
+
+ private static String PAGE_ATTRIBUTE = "page"; //$NON-NLS-1$
+
+ private static String PAGE_ATTRIBUTE_VALUE = "include.jsp"; //$NON-NLS-1$
+
+ public OpenOnInsideJspRoot_JBIDE4852(String name) {
+ super(name);
+ }
+
+ public void testOpenOnLinkStyles() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ JsfAllTests.IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file. componentPage = "
+ + TEST_PAGE_NAME
+ + ";projectName = " + JsfAllTests.IMPORT_PROJECT_NAME, file);//$NON-NLS-1$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get controller
+ VpeController controller = TestUtil.getVpeController(part);
+ assertNotNull(controller);
+
+ // get source document
+ Document sourceDocument = getSourceDocument(controller);
+ assertNotNull(sourceDocument);
+
+ Element openOnTestedElement = sourceDocument
+ .getElementById(INCLUDE_TAG_ID);
+ Attr testedClassAttr = openOnTestedElement
+ .getAttributeNode(PAGE_ATTRIBUTE);
+
+ OpenOnUtil.performOpenOnAction(part.getSourceEditor(),
+ ((IDOMAttr) testedClassAttr).getValueRegionStartOffset() + 1);
+
+ IEditorPart editorPart = (IEditorPart) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getActivePart();
+
+ TestUtil.waitForJobs();
+
+ assertNotNull(editorPart);
+
+ assertTrue(editorPart.getEditorInput().getName().endsWith(
+ PAGE_ATTRIBUTE_VALUE));
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-10-01 16:05:29 UTC (rev 17853)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-10-01 17:32:40 UTC (rev 17854)
@@ -206,11 +206,17 @@
<partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
<axis path="*/a/href/" ignoreCase="true"/>
<axis path="*/jsp:directive.include/file/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:directive.include/file/" />
<axis path="*/jsp:directive.page/errorPage/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:directive.page/errorPage/" />
<axis path="*/jsp:include/page/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:include/page/" />
<axis path="*/jsp:forward/page/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:forward/page/" />
<axis path="*/jsp:plugin/iepluginurl/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:plugin/iepluginurl/" />
<axis path="*/jsp:plugin/nspluginurl/" />
+ <axis path="*/[http://java.sun.com/JSP/Page]:plugin/nspluginurl/" />
</partitionType>
</contentType>
<contentType id="org.eclipse.wst.html.core.htmlsource">
15 years, 2 months
JBoss Tools SVN: r17853 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 12:05:29 -0400 (Thu, 01 Oct 2009)
New Revision: 17853
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-10-01 16:04:58 UTC (rev 17852)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-10-01 16:05:29 UTC (rev 17853)
@@ -121,7 +121,7 @@
List<IContentProposal> list = new ArrayList<IContentProposal>();
for (TextProposal p: uniqueSuggestions) {
String label = prefix + p.getReplacementString();
- IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(p.getReplacementString(), label);
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(p.getReplacementString(), label, null);
list.add(cp);
}
return list.toArray(new IContentProposal[0]);
15 years, 2 months
JBoss Tools SVN: r17852 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 12:04:58 -0400 (Thu, 01 Oct 2009)
New Revision: 17852
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 16:04:21 UTC (rev 17851)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 16:04:58 UTC (rev 17852)
@@ -67,10 +67,7 @@
String[] ps = attributes.keySet().toArray(new String[0]);
for (int i = 0; i < ps.length; i++) {
if(context.hasProperty(ps[i])) continue;
- String description = WizardKeys.getString(ps[i] + ".description"); //$NON-NLS-1$
- if("@NULL_KEY@".equals(description) || description == null) {
- description = ps[i] + "<p>TODO - add description into keys-hibernate-config.properties";
- }
+ String description = getDescription(ps[i]);
if(ps[i].startsWith(namePrefix)) {
CompletionProposal proposal = new CompletionProposal(
ps[i],
@@ -120,13 +117,7 @@
IJavaProject jp = EclipseResourceUtil.getJavaProject(project);
if(ps != null) for (int i = 0; i < ps.length; i++) {
String value = ps[i].getContent();
- String descr = null;
- if(jp != null) try {
- IType type = EclipseJavaUtil.findType(jp, value);
- if(type != null) descr = JavadocContentAccess2.getHTMLContent(type, true);
- } catch (JavaModelException e) {
- //ignore
- }
+ String descr = getDescription(jp, value);
CompletionProposal proposal = new CompletionProposal(
value,
valueOffset,
@@ -170,4 +161,26 @@
}
+ public static String getDescription(String propertyName) {
+ String dot = "."; //$NON-NLS-1$
+ String key = propertyName;
+ if(!key.endsWith(dot)) key += dot;
+ key += "description"; //$NON-NLS-1$
+ String description = WizardKeys.getString(key);
+ if("@NULL_KEY@".equals(description) || description == null) {
+ description = propertyName + "<p>TODO - add description into keys-hibernate-config.properties";
+ }
+ return description;
+ }
+
+ public static String getDescription(IJavaProject jp, String value) {
+ String descr = null;
+ if(jp != null) try {
+ IType type = EclipseJavaUtil.findType(jp, value);
+ if(type != null) descr = JavadocContentAccess2.getHTMLContent(type, true);
+ } catch (JavaModelException e) {
+ //ignore
+ }
+ return descr;
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java 2009-10-01 16:04:21 UTC (rev 17851)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java 2009-10-01 16:04:58 UTC (rev 17852)
@@ -16,6 +16,8 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.jboss.tools.common.meta.XAttribute;
@@ -26,6 +28,7 @@
import org.jboss.tools.common.model.ui.attribute.AttributeContentProposalProviderFactory;
import org.jboss.tools.common.model.ui.attribute.adapter.JavaClassContentAssistProvider;
import org.jboss.tools.common.model.ui.attribute.adapter.PropertiesContentProposalProvider;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.hibernate.xml.model.impl.HibConfigComplexPropertyImpl;
/**
@@ -52,7 +55,7 @@
String prop = (dot < 0) ? ps[i] : ps[i].substring(0, dot + 1);
if(unique.contains(prop)) continue;
unique.add(prop);
- IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(prop, prop);
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(prop, prop, HibernatePropertiesContentAssistProcessor.getDescription(prop));
result.add(cp);
}
}
@@ -70,7 +73,7 @@
for (int i = 0; i < vs.length; i++) {
if(vs[i].length() == 0) continue;
if(vs[i].startsWith(valuePrefix)) {
- IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(vs[i], vs[i]);
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(vs[i], vs[i], null);
result.add(cp);
}
}
@@ -79,7 +82,18 @@
p.init(object, null, attr);
IContentProposalProvider pp = p.getContentProposalProvider();
IContentProposal[] ps = pp.getProposals(valuePrefix, valuePrefix.length());
- return ps;
+ IJavaProject jp = getJavaProject();
+ for (int i = 0; i < ps.length; i++) {
+ String descr = ps[i].getDescription();
+ if(descr == null || descr.length() == 0) {
+ String value = ps[i].getContent();
+ descr = HibernatePropertiesContentAssistProcessor.getDescription(jp, value);
+ IContentProposal p2 = AttributeContentProposalProviderFactory.makeContentProposal(value, ps[i].getLabel(), descr);
+ result.add(p2);
+ } else {
+ result.add(ps[i]);
+ }
+ }
} else {
//TODO
}
@@ -108,4 +122,8 @@
}
+ IJavaProject getJavaProject() {
+ IProject project = EclipseResourceUtil.getProject(object);
+ return EclipseResourceUtil.getJavaProject(project);
+ }
}
15 years, 2 months
JBoss Tools SVN: r17851 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute: adapter and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 12:04:21 -0400 (Thu, 01 Oct 2009)
New Revision: 17851
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionContentAssistProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2009-10-01 15:33:33 UTC (rev 17850)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2009-10-01 16:04:21 UTC (rev 17851)
@@ -180,14 +180,14 @@
return result;
}
- public static IContentProposal makeContentProposal(final String proposal, final String label) {
+ public static IContentProposal makeContentProposal(final String proposal, final String label, final String description) {
return new IContentProposal() {
public String getContent() {
return proposal;
}
public String getDescription() {
- return null;
+ return description;
}
public String getLabel() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionContentAssistProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionContentAssistProvider.java 2009-10-01 15:33:33 UTC (rev 17850)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultTreeSelectionContentAssistProvider.java 2009-10-01 16:04:21 UTC (rev 17851)
@@ -66,7 +66,7 @@
// replacementString = "";
}
- IContentProposal proposal = AttributeContentProposalProviderFactory.makeContentProposal(replacementString, replacementString);
+ IContentProposal proposal = AttributeContentProposalProviderFactory.makeContentProposal(replacementString, replacementString, null);
proposalsList.add(proposal);
}
15 years, 2 months
JBoss Tools SVN: r17849 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 11:29:31 -0400 (Thu, 01 Oct 2009)
New Revision: 17849
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 15:29:03 UTC (rev 17848)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 15:29:31 UTC (rev 17849)
@@ -36,6 +36,7 @@
import org.jboss.tools.common.model.ui.texteditors.propertyeditor.AbstractPropertiesContentAssistProcessor;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.hibernate.ui.xml.form.HibConfig3PropertyFormLayoutData;
import org.jboss.tools.hibernate.xml.model.impl.HibConfigComplexPropertyImpl;
/**
@@ -150,7 +151,7 @@
public static Map<String, XAttribute> getAttributes(XModelObject object) {
if(attributes == null) {
attributes = new TreeMap<String, XAttribute>();
- XModelEntity entity = object.getModel().getMetaData().getEntity("HibConfig3PropertiesFolder"); //$NON-NLS-1$
+ XModelEntity entity = object.getModel().getMetaData().getEntity(HibConfig3PropertyFormLayoutData.PROPERTY_FOLDER_ENTITY);
XChild[] cs = entity.getChildren();
for (int i = 0; i < cs.length; i++) {
if(cs[i].isRequired()) {
15 years, 2 months
JBoss Tools SVN: r17848 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 11:29:03 -0400 (Thu, 01 Oct 2009)
New Revision: 17848
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-10-01 15:15:51 UTC (rev 17847)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-10-01 15:29:03 UTC (rev 17848)
@@ -1662,7 +1662,6 @@
<XModelAttribute PROPERTIES="save=always;id=true;category=general"
name="name" xmlname="name">
<Constraint loader="ListString"/>
- <Editor name="HibernatePropertyList"/>
</XModelAttribute>
<XModelAttribute name="value" xmlname="#text"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
15 years, 2 months
JBoss Tools SVN: r17847 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 11:15:51 -0400 (Thu, 01 Oct 2009)
New Revision: 17847
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-10-01 15:15:06 UTC (rev 17846)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2009-10-01 15:15:51 UTC (rev 17847)
@@ -28,6 +28,7 @@
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.attribute.AttributeContentProposalProviderFactory;
import org.jboss.tools.common.model.ui.attribute.IAttributeContentProposalProvider;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.seam.core.ISeamProject;
@@ -120,7 +121,7 @@
List<IContentProposal> list = new ArrayList<IContentProposal>();
for (TextProposal p: uniqueSuggestions) {
String label = prefix + p.getReplacementString();
- IContentProposal cp = makeContentProposal(p.getReplacementString(), label);
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(p.getReplacementString(), label);
list.add(cp);
}
return list.toArray(new IContentProposal[0]);
@@ -128,26 +129,6 @@
}
- private IContentProposal makeContentProposal(final String proposal, final String label) {
- return new IContentProposal() {
- public String getContent() {
- return proposal;
- }
-
- public String getDescription() {
- return null;
- }
-
- public String getLabel() {
- return label;
- }
-
- public int getCursorPosition() {
- return proposal.length();
- }
- };
- }
-
public String getPrefix(String content, int offset, int start, int end) throws StringIndexOutOfBoundsException {
if (content == null || offset > content.length())
return null;
15 years, 2 months
JBoss Tools SVN: r17846 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 11:15:06 -0400 (Thu, 01 Oct 2009)
New Revision: 17846
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java 2009-10-01 15:14:35 UTC (rev 17845)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java 2009-10-01 15:15:06 UTC (rev 17846)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.attribute.adapter;
+import java.util.HashSet;
+import java.util.Set;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
@@ -38,7 +41,7 @@
public boolean isRelevant(XModelObject object, XAttribute attribute) {
if(object == null || attribute == null) return false;
if("Property".equals(attribute.getModelEntity().getName())) return true;
- if("HibConfig3Property".equals(attribute.getModelEntity().getName())) return true;
+ if(getContributedEntities().contains(attribute.getModelEntity().getName())) return true;
return false;
}
@@ -75,13 +78,32 @@
}
static String EXTENSION_POINT = "org.jboss.tools.common.model.ui.propertiesFileContentAssist";
+
+ static Set<String> entities = null;
+ public static Set<String> getContributedEntities() {
+ if(entities == null) {
+ entities = new HashSet<String>();
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
+ if(point != null) {
+ IConfigurationElement[] cs = point.getConfigurationElements();
+ for (IConfigurationElement c: cs) {
+ String entity = c.getAttribute("entity");
+ if(entity != null) {
+ entities.add(entity);
+ }
+ }
+ }
+ }
+ return entities;
+ }
+
private PropertiesContentProposalProvider createProcessorByFileName(String fileName, String entity) {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
if(point == null) return null;
IConfigurationElement[] cs = point.getConfigurationElements();
for (IConfigurationElement c: cs) {
- if(fileName.equals(c.getAttribute("fileName"))) {
+ if(fileName.equals(c.getAttribute("fileName")) || entity.equals(c.getAttribute("entity"))) {
try {
PropertiesContentProposalProvider p = (PropertiesContentProposalProvider)c.createExecutableExtension("attributeProcessor");
p.object = object;
15 years, 2 months
JBoss Tools SVN: r17845 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui: src/org/jboss/tools/hibernate/ui/xml/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-01 11:14:35 -0400 (Thu, 01 Oct 2009)
New Revision: 17845
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/plugin.xml 2009-10-01 15:11:15 UTC (rev 17844)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/plugin.xml 2009-10-01 15:14:35 UTC (rev 17845)
@@ -68,6 +68,7 @@
processor="org.jboss.tools.hibernate.ui.xml.editor.HibernatePropertiesContentAssistProcessor"
attributeProcessor="org.jboss.tools.hibernate.ui.xml.editor.HibernatePropertiesContentProposalProvider"
fileName="hibernate.properties"
+ entity="HibConfig3Property"
/>
</extension>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 15:11:15 UTC (rev 17844)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentAssistProcessor.java 2009-10-01 15:14:35 UTC (rev 17845)
@@ -31,6 +31,7 @@
import org.jboss.tools.common.meta.constraint.XAttributeConstraint;
import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintAList;
import org.jboss.tools.common.meta.key.WizardKeys;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.attribute.adapter.JavaClassContentAssistProvider;
import org.jboss.tools.common.model.ui.texteditors.propertyeditor.AbstractPropertiesContentAssistProcessor;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
@@ -54,7 +55,7 @@
List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
- Map<String, XAttribute> attributes = getAttributes();
+ Map<String, XAttribute> attributes = getAttributes(object);
if(context.isInComment()) {
return new ICompletionProposal[0];
@@ -146,7 +147,7 @@
static Map<String, XAttribute> attributes = null;
- public Map<String, XAttribute> getAttributes() {
+ public static Map<String, XAttribute> getAttributes(XModelObject object) {
if(attributes == null) {
attributes = new TreeMap<String, XAttribute>();
XModelEntity entity = object.getModel().getMetaData().getEntity("HibConfig3PropertiesFolder"); //$NON-NLS-1$
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java 2009-10-01 15:11:15 UTC (rev 17844)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/editor/HibernatePropertiesContentProposalProvider.java 2009-10-01 15:14:35 UTC (rev 17845)
@@ -10,8 +10,23 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.xml.editor;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.constraint.XAttributeConstraint;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintAList;
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.loaders.impl.PropertiesLoader;
+import org.jboss.tools.common.model.ui.attribute.AttributeContentProposalProviderFactory;
+import org.jboss.tools.common.model.ui.attribute.adapter.JavaClassContentAssistProvider;
import org.jboss.tools.common.model.ui.attribute.adapter.PropertiesContentProposalProvider;
+import org.jboss.tools.hibernate.xml.model.impl.HibConfigComplexPropertyImpl;
/**
*
@@ -20,8 +35,77 @@
*/
public class HibernatePropertiesContentProposalProvider extends PropertiesContentProposalProvider {
+ public HibernatePropertiesContentProposalProvider() {}
+
public IContentProposal[] getProposals(String contents, int position) {
- return null;
+ Map<String, XAttribute> attributes = HibernatePropertiesContentAssistProcessor.getAttributes(object);
+
+ List<IContentProposal> result = new ArrayList<IContentProposal>();
+
+ if(isNameAttribute()) {
+ String[] ps = attributes.keySet().toArray(new String[0]);
+ Set<String> unique = new HashSet<String>();
+ String prefix = contents.substring(0, position);
+ for (int i = 0; i < ps.length; i++) {
+ if(ps[i].startsWith(prefix)) {
+ int dot = ps[i].indexOf('.', prefix.length());
+ String prop = (dot < 0) ? ps[i] : ps[i].substring(0, dot + 1);
+ if(unique.contains(prop)) continue;
+ unique.add(prop);
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(prop, prop);
+ result.add(cp);
+ }
+ }
+ } else {
+ String valuePrefix = contents.substring(0, position);
+ String propertyName = getPropertyName();
+ if(attributes.containsKey(propertyName)) {
+ XAttribute attr = attributes.get(propertyName);
+ if(attr == null) {
+ return new IContentProposal[0];
+ }
+ XAttributeConstraint c = attr.getConstraint();
+ if(c instanceof XAttributeConstraintAList) {
+ String[] vs = ((XAttributeConstraintAList)c).getValues();
+ for (int i = 0; i < vs.length; i++) {
+ if(vs[i].length() == 0) continue;
+ if(vs[i].startsWith(valuePrefix)) {
+ IContentProposal cp = AttributeContentProposalProviderFactory.makeContentProposal(vs[i], vs[i]);
+ result.add(cp);
+ }
+ }
+ } else if("AccessibleJava".equals(attr.getEditor().getName())) { //$NON-NLS-1$
+ JavaClassContentAssistProvider p = new JavaClassContentAssistProvider();
+ p.init(object, null, attr);
+ IContentProposalProvider pp = p.getContentProposalProvider();
+ IContentProposal[] ps = pp.getProposals(valuePrefix, valuePrefix.length());
+ return ps;
+ } else {
+ //TODO
+ }
+ }
+ }
+
+ return result.toArray(new IContentProposal[0]);
}
+ boolean isNameAttribute() {
+ return attribute.getName().equals(XModelObjectConstants.ATTR_NAME);
+ }
+
+ String getPropertyName() {
+ String value = null;
+ if(data != null) {
+ value = data.getValue(XModelObjectConstants.ATTR_NAME);
+
+ } else if(object != null
+ && (object.getModelEntity().getName().equals(PropertiesLoader.ENT_PROPERTY)
+ || object.getModelEntity().getName().equals(HibConfigComplexPropertyImpl.ENT_PROPERTY))) {
+ value = object.getAttributeValue(XModelObjectConstants.ATTR_NAME);
+
+ }
+ return value;
+
+ }
+
}
15 years, 2 months