JBoss Tools SVN: r36295 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:32:40 -0500 (Thu, 10 Nov 2011)
New Revision: 36295
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10142 Seam 2 Tools: Extend JBoss Perspective
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:32:12 UTC (rev 36294)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:32:40 UTC (rev 36295)
@@ -92,7 +92,7 @@
ValidatorManager.addProjectBuildValidationSupport(project);
project.build(IncrementalProjectBuilder.FULL_BUILD,
new NullProgressMonitor());
-
+
JobUtils.waitForIdle();
}
} );
14 years, 5 months
JBoss Tools SVN: r36294 - in trunk/seam: tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:32:12 -0500 (Thu, 10 Nov 2011)
New Revision: 36294
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10142 Seam 2 Tools: Extend JBoss Perspective
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-11-11 01:18:51 UTC (rev 36293)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-11-11 01:32:12 UTC (rev 36294)
@@ -172,6 +172,16 @@
</perspectiveExtension>
</extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard">
+ </newWizardShortcut>
+ </perspectiveExtension>
+ </extension>
+
<extension point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding viewerId="org.jboss.tools.seam.ui.views.SeamComponentsNavigator">
<includes>
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java 2011-11-11 01:32:12 UTC (rev 36294)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.WorkbenchException;
+import org.jboss.tools.common.ui.JBossPerspectiveFactory;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JBossPerspectiveTest extends TestCase {
+
+ /**
+ * Tests JBoss perspective has Seam stuff
+ * See https://issues.jboss.org/browse/JBIDE-10142
+ * @throws WorkbenchException
+ */
+ public void testJBossPerspective() throws WorkbenchException {
+ IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
+ assertNotNull(page);
+ String[] shortcuts = page.getNewWizardShortcuts();
+ Set<String> shortcutSet = new HashSet<String>();
+ for (String shortcut : shortcuts) {
+ shortcutSet.add(shortcut);
+ }
+ assertTrue("Have not found org.jboss.tools.seam.ui.wizards.SeamProjectWizard in " + JBossPerspectiveFactory.PERSPECTIVE_ID, shortcutSet.contains("org.jboss.tools.seam.ui.wizards.SeamProjectWizard"));
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:18:51 UTC (rev 36293)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:32:12 UTC (rev 36294)
@@ -32,7 +32,6 @@
import org.jboss.tools.seam.ui.test.jbide.JBide3989Test;
import org.jboss.tools.seam.ui.test.marker.SeamMarkerResolutionTest;
import org.jboss.tools.seam.ui.test.preferences.SeamPreferencesPageTest;
-import org.jboss.tools.seam.ui.test.preferences.SeamSettingsPreferencesPageTest;
import org.jboss.tools.seam.ui.test.view.SeamComponentsViewAllTests;
import org.jboss.tools.seam.ui.test.wizard.OpenSeamComponentDialogTest;
import org.jboss.tools.seam.ui.test.wizard.PackageNamesTest;
@@ -54,7 +53,8 @@
public static Test suite() {
TestSuite suite = new TestSuite("Seam UI tests");
-
+
+ suite.addTestSuite(JBossPerspectiveTest.class);
suite.addTestSuite(ELExprPartitionerTest.class);
//suite.addTestSuite(ELReferencesQueryParticipantTest.class);
suite.addTest(new ProjectImportTestSetup(new TestSuite(ELReferencesQueryParticipantTest.class), "org.jboss.tools.seam.ui.test", new String[]{"projects/numberguess"}, new String[]{"numberguess"}));
14 years, 5 months
JBoss Tools SVN: r36293 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:18:51 -0500 (Thu, 10 Nov 2011)
New Revision: 36293
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 01:15:26 UTC (rev 36292)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 01:18:51 UTC (rev 36293)
@@ -37,10 +37,12 @@
assertNotNull(page);
IViewReference[] viewReferences = page.getViewReferences();
Set<String> viewIds = new HashSet<String>();
+ StringBuffer sb = new StringBuffer("[");
for (IViewReference viewReference : viewReferences) {
- System.out.println("View ID: " + viewReference.getId());
+ sb.append(viewReference.getId()).append(", ");
viewIds.add(viewReference.getId());
}
- assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ".", viewIds.contains(PaletteView.ID));
+ sb.append("]");
+ assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ". Found Views: " + sb.toString(), viewIds.contains(PaletteView.ID));
}
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r36292 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:15:26 -0500 (Thu, 10 Nov 2011)
New Revision: 36292
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 01:13:46 UTC (rev 36291)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 01:15:26 UTC (rev 36292)
@@ -39,6 +39,7 @@
org.jboss.tools.jst.jsp.base.test,
org.jboss.tools.common.el.ui,
org.eclipse.jdt.ui,
- org.jboss.tools.common.ui
+ org.jboss.tools.common.ui,
+ org.jboss.tools.common.gef
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
14 years, 5 months
JBoss Tools SVN: r36291 - trunk/jsf/plugins/org.jboss.tools.jsf.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:13:46 -0500 (Thu, 10 Nov 2011)
New Revision: 36291
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2011-11-11 00:58:59 UTC (rev 36290)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2011-11-11 01:13:46 UTC (rev 36291)
@@ -414,8 +414,19 @@
</newWizardShortcut>
</perspectiveExtension>
</extension>
-
- <extension
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <view relative="org.eclipse.ui.views.ContentOutline"
+ relationship="stack"
+ id="org.eclipse.gef.ui.palette_view">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+ <extension
point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant
class="org.jboss.tools.jsf.ui.el.refactoring.RenameMethodParticipant"
14 years, 5 months
JBoss Tools SVN: r36290 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 19:58:59 -0500 (Thu, 10 Nov 2011)
New Revision: 36290
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:20:52 UTC (rev 36289)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:58:59 UTC (rev 36290)
@@ -15,7 +15,7 @@
import junit.framework.TestCase;
-import org.eclipse.ui.IViewPart;
+import org.eclipse.gef.ui.views.palette.PaletteView;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.WorkbenchException;
@@ -35,14 +35,12 @@
public void testJBossPerspective() throws WorkbenchException {
IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
assertNotNull(page);
- IViewPart[] views = page.getViews();
- System.out.println("Views number: " + views.length);
IViewReference[] viewReferences = page.getViewReferences();
Set<String> viewIds = new HashSet<String>();
for (IViewReference viewReference : viewReferences) {
System.out.println("View ID: " + viewReference.getId());
viewIds.add(viewReference.getId());
}
- assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
+ assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ".", viewIds.contains(PaletteView.ID));
}
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r36289 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: src/org/jboss/tools/jsf/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 19:20:52 -0500 (Thu, 10 Nov 2011)
New Revision: 36289
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-10 23:57:53 UTC (rev 36288)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 00:20:52 UTC (rev 36289)
@@ -34,10 +34,11 @@
org.eclipse.gef,
org.eclipse.pde.ui,
org.eclipse.wst.validation,
- org.eclipse.wst.html.core;bundle-version="1.1.500",
- org.eclipse.wst.html.ui;bundle-version="1.0.600",
- org.jboss.tools.jst.jsp.base.test;bundle-version="3.3.0",
- org.jboss.tools.common.el.ui;bundle-version="3.3.0",
- org.eclipse.jdt.ui;bundle-version="3.7.0"
+ org.eclipse.wst.html.core,
+ org.eclipse.wst.html.ui,
+ org.jboss.tools.jst.jsp.base.test,
+ org.jboss.tools.common.el.ui,
+ org.eclipse.jdt.ui,
+ org.jboss.tools.common.ui
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:20:52 UTC (rev 36289)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.ui.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.WorkbenchException;
+import org.jboss.tools.common.ui.JBossPerspectiveFactory;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JBossPerspectiveTest extends TestCase {
+
+ /**
+ * Tests JBoss perspective has JSF stuff
+ * See https://issues.jboss.org/browse/JBIDE-10145
+ * @throws WorkbenchException
+ */
+ public void testJBossPerspective() throws WorkbenchException {
+ IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
+ assertNotNull(page);
+ IViewPart[] views = page.getViews();
+ System.out.println("Views number: " + views.length);
+ IViewReference[] viewReferences = page.getViewReferences();
+ Set<String> viewIds = new HashSet<String>();
+ for (IViewReference viewReference : viewReferences) {
+ System.out.println("View ID: " + viewReference.getId());
+ viewIds.add(viewReference.getId());
+ }
+ assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-11-10 23:57:53 UTC (rev 36288)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-11-11 00:20:52 UTC (rev 36289)
@@ -51,6 +51,7 @@
ValidationFramework.getDefault().suspendAllValidation(true);
+ suite.addTestSuite(JBossPerspectiveTest.class);
suite.addTestSuite(NewJSFProjectTest.class);
suite.addTestSuite(CAForUnclosedELTest.class);
suite.addTestSuite(CAForCompositeComponentTest.class);
14 years, 5 months
JBoss Tools SVN: r36288 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 18:57:53 -0500 (Thu, 10 Nov 2011)
New Revision: 36288
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java 2011-11-10 22:14:58 UTC (rev 36287)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java 2011-11-10 23:57:53 UTC (rev 36288)
@@ -49,7 +49,7 @@
layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
-
+
// views - search
layout.addShowViewShortcut(ID_SEARCH_VIEW);
// views - debugging
14 years, 5 months
JBoss Tools SVN: r36287 - trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-11-10 17:14:58 -0500 (Thu, 10 Nov 2011)
New Revision: 36287
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
Log:
JBIDE-9910 Proposal info for message bundles in code completion for EL
Fix CA filtering for resource bundle property proposals in Java files
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:23:19 UTC (rev 36286)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 22:14:58 UTC (rev 36287)
@@ -96,6 +96,7 @@
private final int fOffset;
private int fNewPosition;
private String fDisplayString;
+ private String fAlternateMatch;
private String fAdditionalProposalInfo;
private IJavaElement[] fJavaElements;
private MessagesELTextProposal fPropertySource;
@@ -107,18 +108,18 @@
}
public Proposal(String string, String prefix, int offset, int newPosition) {
- this(string, prefix, prefix, offset, offset + string.length(), null, null, null, null, null);
+ this(string, prefix, prefix, offset, offset + string.length(), null, null, null, null, null, null);
}
- public Proposal(String string, String prefix, int offset, int newPosition, Image image, String displayString, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
- this(string, prefix, prefix, offset, offset + string.length(), image, displayString, additionalProposalInfo, javaElements, propertySource);
+/**/ public Proposal(String string, String prefix, int offset, int newPosition, Image image, String displayString, String alternateMatch, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
+ this(string, prefix, prefix, offset, offset + string.length(), image, displayString, alternateMatch, additionalProposalInfo, javaElements, propertySource);
}
public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition) {
- this(string, prefix, newPrefix, offset, newPosition, null, null, null, null, null);
+ this(string, prefix, newPrefix, offset, newPosition, null, null, null, null, null, null);
}
- public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition, Image image, String displayString, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
+/**/ public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition, Image image, String displayString, String alternateMatch, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
fString = string;
fPrefix = prefix;
fNewPrefix = newPrefix;
@@ -126,6 +127,7 @@
fNewPosition = newPosition;
fImage = image;
fDisplayString = displayString;
+ fAlternateMatch = alternateMatch;
fAdditionalProposalInfo = additionalProposalInfo;
fJavaElements = javaElements;
if (fJavaElements != null && fJavaElements.length > 0)
@@ -405,7 +407,9 @@
public boolean validate(IDocument document, int offset, DocumentEvent event) {
try {
int prefixStart= fOffset - fPrefix.length();
- return offset >= fOffset && offset < fOffset + fString.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fString).substring(0, offset - prefixStart));
+ return offset >= fOffset &&
+ ((offset < fOffset + fString.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fString).substring(0, offset - prefixStart))) ||
+ (fAlternateMatch != null && offset < fOffset + fAlternateMatch.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fAlternateMatch).substring(0, offset - prefixStart))));
} catch (BadLocationException x) {
return false;
}
@@ -453,6 +457,14 @@
return TextProposal.R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE+10;
}
+ public String getfAlternateMatch() {
+ return fAlternateMatch;
+ }
+
+ public void setfAlternateMatch(String fAlternateMatch) {
+ this.fAlternateMatch = fAlternateMatch;
+ }
+
}
/**
@@ -612,7 +624,7 @@
string += proposalSufix;
resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - (prefix.length() - newPrefix.length()) + string.length() - proposalSufix.length(), image,
- kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
+ kbProposal.getLabel(), kbProposal.getAlternateMatch(), additionalProposalInfo, javaElements, source));
} else {
if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
string = string.substring(0, string.lastIndexOf('\''));
@@ -622,7 +634,7 @@
string += proposalSufix;
resultList.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length(), image,
- kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
+ kbProposal.getLabel(), kbProposal.getAlternateMatch(), additionalProposalInfo, javaElements, source));
}
}
}
14 years, 5 months
JBoss Tools SVN: r36286 - in trunk: common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-11-10 16:23:19 -0500 (Thu, 10 Nov 2011)
New Revision: 36286
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-9910 Proposal info for message bundles in code completion for EL
Fix CA for resource bundle properties in Java files and Validation Issues over resource bundle properties
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -424,21 +424,18 @@
}
}
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
-// Set<String> proposalsToFilter = new TreeSet<String>();
-// boolean isMessages = false;
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
for (Variable mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return;
}
-// isMessages = true;
-// filterSingularMember(mbr, proposalsToFilter);
Collection<String> keys = mbr.getKeys();
for (String key : keys) {
if(returnEqualedVariablesOnly) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -562,8 +562,18 @@
String proposalSufix = ""; //$NON-NLS-1$
String elStartChar = "#"; //$NON-NLS-1$
String documentContent = ref.getELModel().getSource();
- // Is '}'-bracket exists? If not - add the
- if(getELEndPosition(offset - ref.getStartPosition(), documentContent) == -1) {
+ // Is '#{', or '${', or '}'-bracket exists? If not - add the
+ int elEndPosition = documentContent.indexOf("#{", offset - ref.getStartPosition()); //$NON-NLS-1$
+ int limit = documentContent.indexOf("${", offset - ref.getStartPosition()); //$NON-NLS-1$
+ if (limit != -1 && elEndPosition != -1 && limit < elEndPosition) {
+ elEndPosition = limit;
+ }
+ limit = documentContent.indexOf('}', offset - ref.getStartPosition());
+ if (limit != -1 && elEndPosition != -1 && limit < elEndPosition) {
+ elEndPosition = limit+1;
+ }
+ String restOfEL = elEndPosition == -1 ? "" : documentContent.substring(offset - ref.getStartPosition(), elEndPosition); //$NON-NLS-1$
+ if(restOfEL.indexOf('}') == -1) {
proposalSufix = "}"; //$NON-NLS-1$
}
@@ -578,7 +588,7 @@
Image image = kbProposal.hasImage() ? kbProposal.getImage()
: getImage();
if (string.length() >= 0) {
- string = proposalPrefix + string + proposalSufix;
+ string = proposalPrefix + string;
if (string.length() > 0 && ('#' == string.charAt(0) || '$' == string.charAt(0)))
string = elStartChar + string.substring(1);
@@ -592,11 +602,25 @@
source = (MessagesELTextProposal)kbProposal;
}
- if (string.startsWith("['") && string.endsWith("']") && prefix != null && prefix.endsWith(".")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String newPrefix = prefix.substring(0, prefix.length() - 1);
- resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - 1 + string.length() - proposalSufix.length(), image,
+ if (string.startsWith("[") && prefix != null && prefix.indexOf('.') != -1) { //$NON-NLS-1$
+ String newPrefix = prefix.substring(0, prefix.lastIndexOf('.'));
+ if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
+ string = string.substring(0, string.lastIndexOf('\''));
+
+ if (string.indexOf(']') == -1 && restOfEL.indexOf(']') == -1) // Add closing square bracket if needed
+ string += ']';
+
+ string += proposalSufix;
+ resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - (prefix.length() - newPrefix.length()) + string.length() - proposalSufix.length(), image,
kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
} else {
+ if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
+ string = string.substring(0, string.lastIndexOf('\''));
+
+ if (string.indexOf(']') == -1 && restOfEL.indexOf(']') == -1) // Add closing square bracket if needed
+ string += ']';
+
+ string += proposalSufix;
resultList.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length(), image,
kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
}
@@ -622,13 +646,49 @@
}
/*
+ * @return non-paired quote char if exists, otherwise 0
+ */
+ private char getPreceedingQuoteChar(int initialOffset, String restOfCurrentValue) {
+ int offset = initialOffset;
+
+ char inQuotesChar = 0;
+ while (--offset >= 0) {
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset) &&
+ (inQuotesChar == 0 || inQuotesChar == restOfCurrentValue.charAt(offset))) {
+ if (initialOffset + offset > 0 && restOfCurrentValue.charAt(offset - 1) == '\\') {
+ int backslashCount = 1;
+ while ((offset - backslashCount) >= 0 &&
+ restOfCurrentValue.charAt(offset - backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (backslashCount % 2 == 1) {
+ inQuotesChar = inQuotesChar == 0 ? restOfCurrentValue.charAt(offset) : 0;
+ offset -= backslashCount;
+ }
+ } else {
+ inQuotesChar = inQuotesChar == 0 ? restOfCurrentValue.charAt(offset) : 0;
+ }
+ } else if ('{' == restOfCurrentValue.charAt(offset)) {
+ if (offset > 0 &&
+ ('#' == restOfCurrentValue.charAt(offset -1) ||
+ '$' == restOfCurrentValue.charAt(offset -1))) {
+ return inQuotesChar;
+ }
+ }
+ }
+ return inQuotesChar;
+ }
+
+ /*
* Checks if the EL operand ending character is present
* @return
*/
private int getELEndPosition(int initialOffset, String restOfCurrentValue) {
int offset = -1;
- char inQuotesChar = 0;
+ char inQuotesChar = getPreceedingQuoteChar(initialOffset, restOfCurrentValue);
while (++offset < restOfCurrentValue.length() - initialOffset) {
if (inQuotesChar == 0) {
if ('}' == restOfCurrentValue.charAt(initialOffset + offset))
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -454,10 +454,11 @@
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
-
+
for (Variable mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -273,10 +273,11 @@
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
for (TypeInfoCollector.MemberInfo mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return true;
@@ -302,7 +303,9 @@
replacement = '\'' + key + '\'';
label = "['" + key + "']";
}
- replacement = replacement.substring(existingString.length());
+ replacement = replacement.startsWith(existingString) ?
+ replacement.substring(existingString.length()) :
+ replacement;
kbProposal.setReplacementString(replacement);
kbProposal.setLabel(label);
14 years, 5 months