JBoss Tools SVN: r42278 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-06-28 08:44:08 -0400 (Thu, 28 Jun 2012)
New Revision: 42278
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
Log:
https://issues.jboss.org/browse/JBIDE-10531 - Getting the bundle value should not succeed if the EL is missing any required token.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2012-06-28 12:24:23 UTC (rev 42277)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2012-06-28 12:44:08 UTC (rev 42278)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -453,22 +453,29 @@
}
public String getBundleValue(String name) {
-// System.out.println("\n1 BM -> getBundleValue -> " + name);
-// System.out.println("2 BM -> showBundleUsageAsEL = "
-// + showBundleUsageAsEL);
String bundleValue = name;
if (!showBundleUsageAsEL) {
List<ELInstance> is = parseJSFExpression(name);
if (is != null) {
StringBuffer sb = new StringBuffer();
int index = 0;
+ boolean parsingErrors = false;
for (ELInstance i : is) {
+ /*
+ * https://issues.jboss.org/browse/JBIDE-10531
+ * Getting the bundle value should not succeed
+ * if the EL is missing any required token.
+ */
+ if (!i.getErrors().isEmpty()) {
+ parsingErrors = true;
+ break;
+ }
int start = i.getStartPosition();
sb.append(name.substring(index, start));
index = start;
if (i.getExpression() instanceof ELInvocationExpression) {
- ELInvocationExpression expr = (ELInvocationExpression) i
- .getExpression();
+ ELInvocationExpression expr =
+ (ELInvocationExpression) i.getExpression();
String[] values = getCall(expr);
if (values != null) {
String value = getBundleValue(values[0], values[1]);
@@ -476,12 +483,13 @@
sb.append(value);
index = i.getEndPosition();
}
-
}
}
if (index < i.getEndPosition()) {
- // fix has been added by Maksim Areshkau
- // https://jira.jboss.org/jira/browse/JBIDE-6064
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-6064
+ * CA out of range error occurs sometimes
+ */
if (name.length() > i.getEndPosition()) {
sb.append(name.substring(index, i.getEndPosition()));
index = i.getEndPosition();
@@ -491,10 +499,11 @@
}
}
}
- bundleValue = sb.append(name.substring(index)).toString();
+ if (!parsingErrors) {
+ bundleValue = sb.append(name.substring(index)).toString();
+ }
}
}
-// System.out.println("3 BM -> getBundleValue -> " + bundleValue);
return bundleValue;
}
13 years, 3 months
JBoss Tools SVN: r42277 - /.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-28 08:24:23 -0400 (Thu, 28 Jun 2012)
New Revision: 42277
Added:
org.jboss.tools.usage.test/
Log:
13 years, 3 months
JBoss Tools SVN: r42276 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-06-28 08:18:20 -0400 (Thu, 28 Jun 2012)
New Revision: 42276
Modified:
trunk/build/parent/pom.xml
Log:
JBIDE-11714:
* Clean parent pom
* Increased timeout
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-06-28 12:00:50 UTC (rev 42275)
+++ trunk/build/parent/pom.xml 2012-06-28 12:18:20 UTC (rev 42276)
@@ -25,7 +25,7 @@
<platformSystemProperties></platformSystemProperties>
<maven.antrun.plugin.version>1.3</maven.antrun.plugin.version>
<swtbot.test.skip>true</swtbot.test.skip>
- <!-- Requirements => JBIDE-11714 -->
+ <!-- Used to install 3rd-party runtimes for testing -->
<skipRequirements>${skipTests}</skipRequirements>
<requirementsDirectory>${project.build.directory}/requirements</requirementsDirectory>
@@ -77,8 +77,6 @@
<!-- Default coverage filter, to be overriden when necessary -->
<coverage.filter>org.jboss.tools.*</coverage.filter>
- <requirements.root>${basedir}/../../../requirements</requirements.root>
- <requirement.build.root>${requirements.root}/target</requirement.build.root>
<!-- JBIDE-11700, JBIDE-11865: latest stable build of m2e-apt for use with JBDS product builds -->
<m2e-apt>http://download.jboss.org/jbosstools/updates/requirements/m2eclipse/m2e-a...</m2e-apt>
@@ -178,7 +176,7 @@
<version>${tychoVersion}</version>
<configuration>
<!-- timeout in seconds -->
- <surefire.timeout>1800</surefire.timeout>
+ <surefire.timeout>2400</surefire.timeout>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
@@ -187,7 +185,7 @@
<argLine>${tycho.testArgLine} ${memoryOptions1} ${memoryOptions2} ${platformSystemProperties} ${systemProperties} -Dusage_reporting_enabled=false</argLine>
<!-- https://docs.sonatype.org/display/TYCHO/How+to+run+SWTBot+tests+with+Tycho -->
<!-- set useUIThread=true for regular ui tests -->
- <!-- set useUIThread=false for swtbot tests (?) -->
+ <!-- set useUIThread=false for swtbot tests -->
<!-- TODO: add new profile to permit running against JBDS product/application
for JBDS tests, against Eclipse SDK for JBT -->
@@ -226,12 +224,6 @@
<version>${tychoVersion}</version>
<configuration>
<encoding>UTF-8</encoding>
- <!-- not strictly needed but this suppresses warnings when compiling
- that the default value (1.5) is being overwritten by the value in the MANIFEST.MF.
- You can use this in your plugins or their aggregator pom.xml files to set
- this for your plugins -->
- <!-- <source>1.6</source> -->
- <!-- <target>1.6</target> -->
</configuration>
</plugin>
<!-- source for bundles -->
@@ -278,68 +270,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <dependencies>
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b3</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-optional</artifactId>
- <version>1.5.3-1</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${maven.antrun.plugin.version}</version>
- <executions>
- <execution>
- <id>download-plugin-requirements</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <!-- JBIDE-11714: remove this execution -->
- <fail message="requirements.properties not supported any more. If you read this, please comment JBIDE-11714"/>
- <!-- taskdef resource="net/sf/antcontrib/antcontrib.properties" />
- <if>
- <and>
- <available file="${requirements.root}" type="dir" />
- <available file="requirements.properties" type="file" />
- </and>
- <then>
- <property file="requirements.properties" />
- <echo>Requirements build</echo>
- <ant dir="${requirements.root}" inheritAll="true">
- <property name="requirements" value="${requirements}" />
- <property name="settings.offline" value="${settings.offline}" />
- <property name="skipDownload" value="${skipDownload}" />
- </ant>
- </then>
- <else>
- <echo>No requrements.properties file</echo>
- </else>
- </if-->
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
<pluginManagement>
@@ -376,7 +306,6 @@
</configuration>
</plugin>
<plugin>
- <!-- JBIDE-11714 -->
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>maven-download-plugin</artifactId>
<version>0.2-SNAPSHOT</version>
@@ -728,24 +657,7 @@
</properties>
<build>
<plugins>
- <!-- plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId>
- <executions> <execution> <id>attach-artifacts</id> <phase>package</phase>
- <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts>
- <artifact> <file>${emma.session.out.file}</file> <type>es</type> </artifact>
- </artifacts> </configuration> </execution> </executions> </plugin -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.3.1</version>
- <configuration>
- <file></file>
- <groupId></groupId>
- <artifactId></artifactId>
- <version></version>
- <packaging></packaging>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tychoVersion}</version>
13 years, 3 months
JBoss Tools SVN: r42275 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-06-28 08:00:50 -0400 (Thu, 28 Jun 2012)
New Revision: 42275
Modified:
trunk/build/parent/pom.xml
Log:
JBIDE-11714:
Temporary error message when relying on requirements.properties
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-06-28 09:40:08 UTC (rev 42274)
+++ trunk/build/parent/pom.xml 2012-06-28 12:00:50 UTC (rev 42275)
@@ -314,7 +314,9 @@
</goals>
<configuration>
<tasks>
- <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
+ <!-- JBIDE-11714: remove this execution -->
+ <fail message="requirements.properties not supported any more. If you read this, please comment JBIDE-11714"/>
+ <!-- taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<if>
<and>
<available file="${requirements.root}" type="dir" />
@@ -332,7 +334,7 @@
<else>
<echo>No requrements.properties file</echo>
</else>
- </if>
+ </if-->
</tasks>
</configuration>
</execution>
13 years, 3 months
JBoss Tools SVN: r42274 - trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-06-28 05:40:08 -0400 (Thu, 28 Jun 2012)
New Revision: 42274
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
Log:
Fix for Spring MVC project readme & closing Problems view.
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java 2012-06-28 00:11:53 UTC (rev 42273)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java 2012-06-28 09:40:08 UTC (rev 42274)
@@ -139,7 +139,7 @@
checkExample(null, IDELabel.JBossCentralEditor.JAVA_EE_PROJECT, true);
checkExample(null, IDELabel.JBossCentralEditor.HTML5_PROJECT, true);
checkExample(null, IDELabel.JBossCentralEditor.RICHFACES_PROJECT, true);
- checkExample(null, IDELabel.JBossCentralEditor.SPRING_MVC_PROJECT, false);
+ checkExample(null, IDELabel.JBossCentralEditor.SPRING_MVC_PROJECT, true);
bot.toolbarDropDownButtonWithTooltip("New").click();
bot.waitForShell("New");
@@ -177,8 +177,13 @@
bot.viewByTitle("Project Explorer").close();
}catch (WidgetNotFoundException ex){
//do nothing
- log.info("Project Explorer is already closed");
+ log.info("Project Explorer is already closed");
}
+ try {
+ bot.viewByTitle("Problems").close();
+ }catch (WidgetNotFoundException ex){
+ //let be...
+ }
String serverName = bot.tree().getAllItems()[0].getText().substring(0, bot.tree().getAllItems()[0].getText().indexOf(' '));
servers.findServerByName(servers.bot().tree(), serverName).contextMenu("Add and Remove...").click();
bot.shell("Add and Remove...").activate();
@@ -277,7 +282,7 @@
bot.activeView().close();
}else if (readmeText.toLowerCase().contains("readme.md") || readmeText.toLowerCase().contains("readme.txt")){
bot.clickButton("Finish");
- //assertTrue("Readme should have opened in Text Editor", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.editors.text.TextEditor")); //because readmes are opening in browser now.. It's a bug. Jira is created.
+ assertTrue("Readme should have opened in Text Editor", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.editors.text.TextEditor")); //because readmes are opening in browser now.. It's a bug. Jira is created.
bot.activeEditor().close();
}else if (readmeText.toLowerCase().contains("readme.htm")){
bot.clickButton("Finish");
13 years, 3 months
JBoss Tools SVN: r42273 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-27 20:11:53 -0400 (Wed, 27 Jun 2012)
New Revision: 42273
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
JBIDE-12269
https://issues.jboss.org/browse/JBIDE-12269
Three tests that must go in strict order, are merged into one method.
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2012-06-27 23:55:46 UTC (rev 42272)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2012-06-28 00:11:53 UTC (rev 42273)
@@ -101,7 +101,9 @@
assertEquals(1, itemCount);
}
- public void testAddComponentInXmlFile() throws CoreException{
+ public void testAddRenameDeleteComponentInXmlFile() throws CoreException{
+
+// public void testAddComponentInXmlFile() throws CoreException{
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
@@ -150,27 +152,31 @@
assertTrue("Expected component 'myPackage.myStringComponent' was not" +
" found",component!=null);
- }
-
- public void testRenameComponentInXmlFile() throws CoreException{
+// }
+//
+// public void testRenameComponentInXmlFile() throws CoreException{
- CommonNavigator navigator = getSeamComponentsView();
+// CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
- Tree tree = navigator.getCommonViewer().getTree();
+// Tree
+ tree = navigator.getCommonViewer().getTree();
- ISeamPackage seamPackage = findSeamPackage(tree, "myPackage");
+// ISeamPackage
+ seamPackage = findSeamPackage(tree, "myPackage");
assertTrue("Expected package 'myPackage' was not found it tree",
seamPackage!=null);
- ISeamComponent component = findSeamComponent(seamPackage,
+// ISeamComponent
+ component = findSeamComponent(seamPackage,
"myPackage.myStringComponent");
assertTrue("Expected component 'myPackage.myStringComponent' was not" +
" found",component!=null);
- IFile file1 = project.getFile("WebContent/WEB-INF/components.2");
+// IFile
+ file1 = project.getFile("WebContent/WEB-INF/components.2");
if(file1 == null || !file1.exists()) {
fail("Cannot find test data file 'WebContent/WEB-INF/components.2'");
}
@@ -219,25 +225,29 @@
component = findSeamComponent(seamPackage, "myNewPackage.myTextComponent");
assertTrue("Expected component 'myNewPackage.myTextComponent' not found " +
"after renaming",component!=null);
- }
-
- public void testDeleteComponentInXmlFile() throws CoreException{
+// }
+//
+// public void testDeleteComponentInXmlFile() throws CoreException{
- CommonNavigator navigator = getSeamComponentsView();
+// CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
JobUtils.waitForIdle();
- Tree tree = navigator.getCommonViewer().getTree();
+// Tree
+ tree = navigator.getCommonViewer().getTree();
- ISeamPackage seamPackage = findSeamPackage(tree, "myNewPackage");
+// ISeamPackage
+ seamPackage = findSeamPackage(tree, "myNewPackage");
assertTrue("Package \"myNewPackage\" not found!",seamPackage!=null);
- ISeamComponent component = findSeamComponent(seamPackage, "myNewPackage.myTextComponent");
+// ISeamComponent
+ component = findSeamComponent(seamPackage, "myNewPackage.myTextComponent");
assertTrue("Component \"myNewPackage.myTextComponent\" not found!",component!=null);
- IFile file1 = project.getFile("WebContent/WEB-INF/components.4");
+// IFile
+ file1 = project.getFile("WebContent/WEB-INF/components.4");
assertTrue("Cannot find components.2 in test project", file1 != null && file1.exists());
- InputStream is = null;
+// InputStream is = null;
try {
is = file1.getContents();
componentsFile.setContents(is,
13 years, 3 months
JBoss Tools SVN: r42272 - in branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui: internal/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-06-27 19:55:46 -0400 (Wed, 27 Jun 2012)
New Revision: 42272
Modified:
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/Messages.java
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/messages.properties
Log:
JBIDE-12126 - Inform user that the selected project does not contain portlet.xml file
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/Messages.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/Messages.java 2012-06-27 23:50:34 UTC (rev 42271)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/Messages.java 2012-06-27 23:55:46 UTC (rev 42272)
@@ -19,6 +19,8 @@
public static String NewPortletClassDataModelProvider_The_portlet_already_exists;
public static String NewPortletClassWizardPage_Choose_a_portlet_class;
public static String NewPortletClassWizardPage_New_Portlet;
+ public static String NewPortletClassWizardPage_The_portlet_xml_file_doesn_t_exist;
+ public static String NewPortletClassWizardPage_Updating_web_xml_portlet_xml_is_not_possible_on_non_portlet_web_projects;
public static String NewPortletClassWizardPage_Use_an_existing_Portlet_class;
public static String NewPortletWizard_Specify_modifiers_interfaces_to_implement_and_method_stubs_to_generate;
public static String No_portlets_exist_to_add;
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2012-06-27 23:50:34 UTC (rev 42271)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2012-06-27 23:55:46 UTC (rev 42272)
@@ -201,4 +201,28 @@
superLabel.setEnabled(!enable);
}
+ @Override
+ protected void validatePage(boolean showMessage) {
+ super.validatePage(showMessage);
+ if (showMessage && getMessage() == null && getErrorMessage() == null) {
+ IProject project = getTargetProject();
+ boolean isFacetedProject = false;
+ try {
+ isFacetedProject = FacetedProjectFramework.isFacetedProject(project);
+ } catch (CoreException e) {
+ // ignore
+ }
+ if (!isFacetedProject) {
+ setMessage(Messages.NewPortletClassWizardPage_Updating_web_xml_portlet_xml_is_not_possible_on_non_portlet_web_projects, IMessageProvider.WARNING);
+ } else if (PortletUIActivator.getPortletXmlFile(project) == null) {
+ setMessage(Messages.NewPortletClassWizardPage_The_portlet_xml_file_doesn_t_exist, IMessageProvider.WARNING);
+ }
+ }
+ }
+
+ public IProject getTargetProject() {
+ String projectName = model.getStringProperty(PROJECT_NAME);
+ return ProjectUtilities.getProject(projectName);
+ }
+
}
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/messages.properties
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/messages.properties 2012-06-27 23:50:34 UTC (rev 42271)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/messages.properties 2012-06-27 23:55:46 UTC (rev 42272)
@@ -43,6 +43,8 @@
NewPortletClassDataModelProvider_The_portlet_already_exists=The ''{0}'' portlet already exists.
NewPortletClassWizardPage_Choose_a_portlet_class=Choose a portlet class:
NewPortletClassWizardPage_New_Portlet=New Portlet
+NewPortletClassWizardPage_The_portlet_xml_file_doesn_t_exist=The portlet.xml file doesn't exist
+NewPortletClassWizardPage_Updating_web_xml_portlet_xml_is_not_possible_on_non_portlet_web_projects=Updating web.xml/portlet.xml is not possible on non-portlet/web projects
NewPortletClassWizardPage_Use_an_existing_Portlet_class=Use an existing Portlet class
NewPortletWizard_Specify_modifiers_interfaces_to_implement_and_method_stubs_to_generate=Specify modifiers, interfaces to implement and method stubs to generate.
No_portlets_exist_to_add=No portlets exist to add
13 years, 3 months
JBoss Tools SVN: r42271 - in branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard: action/xpl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-06-27 19:50:34 -0400 (Wed, 27 Jun 2012)
New Revision: 42271
Modified:
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/action/xpl/AddJavaEEArtifactOperationEx.java
branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java
Log:
JBIDE-12174 - Portlet wizards should not be restricted to portlet enabled projects (regression)
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2012-06-27 23:35:35 UTC (rev 42270)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2012-06-27 23:50:34 UTC (rev 42271)
@@ -299,7 +299,7 @@
if (!result)
return result;
try {
- result = FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
+ result = project.isAccessible() && FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
if (!result) {
return result;
}
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2012-06-27 23:35:35 UTC (rev 42270)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2012-06-27 23:50:34 UTC (rev 42271)
@@ -16,6 +16,7 @@
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.BROWSE_BUTTON_LABEL;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CLASS_NAME_LABEL;
+import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
@@ -24,8 +25,8 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.jst.j2ee.internal.war.ui.util.WebServletGroupItemProvider;
import org.eclipse.jst.j2ee.internal.wizard.AnnotationsStandaloneGroup;
import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage;
@@ -43,14 +44,13 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
import org.jboss.tools.portlet.core.IPortletConstants;
import org.jboss.tools.portlet.ui.Messages;
import org.jboss.tools.portlet.ui.MultiSelectFilteredFileSelectionDialog;
+import org.jboss.tools.portlet.ui.PortletUIActivator;
import org.jboss.tools.portlet.ui.internal.wizard.xpl.NewJavaClassWizardPageEx;
public class NewPortletClassWizardPage extends NewJavaClassWizardPageEx {
@@ -86,7 +86,12 @@
protected boolean isProjectValid(IProject project) {
boolean result;
try {
- return FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.PORTLET_FACET_ID);
+ result = project.isAccessible() &&
+ project.hasNature(JavaCore.NATURE_ID);
+ if ("External Plug-in Libraries".equals(project.getName()) || //$NON-NLS-1$
+ ".JETEmitters".equals(project.getName()) ) { //$NON-NLS-1$
+ result = false;
+ }
} catch (CoreException ce) {
result = false;
}
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/action/xpl/AddJavaEEArtifactOperationEx.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/action/xpl/AddJavaEEArtifactOperationEx.java 2012-06-27 23:35:35 UTC (rev 42270)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/action/xpl/AddJavaEEArtifactOperationEx.java 2012-06-27 23:50:34 UTC (rev 42271)
@@ -6,6 +6,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -17,6 +18,7 @@
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.jboss.tools.portlet.ui.PortletUIActivator;
public abstract class AddJavaEEArtifactOperationEx extends AbstractDataModelOperation {
@@ -53,6 +55,14 @@
}
private IModelProvider getModelProvider() {
+ IProject project = getTargetProject();
+ try {
+ if (!FacetedProjectFramework.isFacetedProject(project)) {
+ return null;
+ }
+ } catch (CoreException e1) {
+ return null;
+ }
IModelProvider modelProvider = null;
try {
modelProvider = ModelProviderManager.getModelProvider(getTargetProject());
Modified: branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java 2012-06-27 23:35:35 UTC (rev 42270)
+++ branches/jbosstools-3.3.x/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/xpl/NewJavaClassWizardPageEx.java 2012-06-27 23:50:34 UTC (rev 42271)
@@ -80,8 +80,6 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.jboss.tools.portlet.core.IPortletConstants;
import org.jboss.tools.portlet.ui.PortletUIActivator;
/**
@@ -241,7 +239,9 @@
protected boolean isProjectValid(IProject project) {
boolean result;
try {
- return FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
+ result = project.isAccessible() &&
+ project.hasNature(IModuleConstants.MODULE_NATURE_ID) &&
+ J2EEProjectUtilities.getJ2EEProjectType(project).equals(projectType);
} catch (CoreException ce) {
result = false;
}
13 years, 3 months
JBoss Tools SVN: r42270 - in trunk/seam: tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-06-27 19:35:35 -0400 (Wed, 27 Jun 2012)
New Revision: 42270
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
Log:
https://issues.jboss.org/browse/JBIDE-12268 org.jboss.tools.seam.core.test failure
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2012-06-27 22:34:06 UTC (rev 42269)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2012-06-27 23:35:35 UTC (rev 42270)
@@ -183,7 +183,7 @@
* @param defaultRt
* boolean - default flag
*/
- public void addRuntime(String name, String path, SeamVersion version,
+ public SeamRuntime addRuntime(String name, String path, SeamVersion version,
boolean defaultRt) {
SeamRuntime seamRt = new SeamRuntime();
seamRt.setVersion(version);
@@ -191,6 +191,7 @@
seamRt.setName(name);
seamRt.setDefault(defaultRt);
addRuntime(seamRt);
+ return seamRt;
}
/**
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java 2012-06-27 22:34:06 UTC (rev 42269)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java 2012-06-27 23:35:35 UTC (rev 42270)
@@ -35,13 +35,8 @@
@Override
protected void setUp() throws Exception {
super.setUp();
- Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
- URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
- File folder = new File(seamUrl.getPath());
manager = SeamRuntimeManager.getInstance();
assertNotNull("Cannot obtainSeamRuntimeManager instance", manager);
- if(manager.findRuntimeByName("Seam 1.2.0")!=null) return;
- manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
}
/**
@@ -49,18 +44,38 @@
* @throws IOException
*/
public void testGetRuntimes() throws IOException {
- SeamRuntime[] rtms = manager.getRuntimes();
- assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms.length==1);
- assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms[0].getName().equals("Seam 1.2.0"));
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
+ File folder = new File(seamUrl.getPath());
+ SeamRuntime runtime = null;
+ try {
+ runtime = manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ SeamRuntime[] rts = manager.getRuntimes();
+ assertTrue("Seam runtime 'Seam 1.2.0' is not created", rts.length>0);
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
}
/**
* Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getRuntimes(org.jboss.tools.seam.core.project.facet.SeamVersion)}.
*/
- public void testGetRuntimesSeamVersion() {
- SeamRuntimeManager manager = SeamRuntimeManager.getInstance();
- SeamRuntime[] rtms = manager.getRuntimes(SeamVersion.SEAM_1_2);
- assertTrue("Error in obtaining seam runtimes list for Seam 1.2", rtms.length==1);
+ public void testGetRuntimesSeamVersion() throws IOException {
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
+ File folder = new File(seamUrl.getPath());
+ SeamRuntime runtime = null;
+ try {
+ runtime = manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ SeamRuntime[] rtms = manager.getRuntimes(SeamVersion.SEAM_1_2);
+ assertEquals("Error in obtaining seam runtimes list for Seam 1.2", 1, rtms.length);
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
}
/**
@@ -71,17 +86,46 @@
Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.1"));
File folder = new File(seamUrl.getPath());
- manager.addRuntime("Seam 1.2.1", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ SeamRuntime runtime = null;
+ try {
+ runtime = manager.addRuntime("Seam 1.2.1", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ assertNotNull(runtime);
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
}
/**
* Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#findRuntimeByName(java.lang.String)}.
*/
- public void testFindRuntimeByName() {
- SeamRuntime srt = manager.findRuntimeByName("Seam 1.2.1");
- assertNotNull("Cannot find runtime 'Seam 1.2.1'",srt);
- srt = manager.findRuntimeByName("Seam 1.2.0");
- assertNotNull("Cannot find runtime 'Seam 1.2.0'",srt);
+ public void testFindRuntimeByName() throws IOException {
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
+ File folder = new File(seamUrl.getPath());
+ SeamRuntime runtime = null;
+ try {
+ manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ runtime = manager.findRuntimeByName("Seam 1.2.0");
+ assertNotNull("Can't find runtime 'Seam 1.2.0' is not created", runtime);
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
+ seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.1"));
+ folder = new File(seamUrl.getPath());
+ runtime = null;
+ try {
+ manager.addRuntime("Seam 1.2.1", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ runtime = manager.findRuntimeByName("Seam 1.2.1");
+ assertNotNull("Can't find runtime 'Seam 1.2.1' is not created", runtime);
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
}
public void testMatchedRuntimes() {
@@ -98,8 +142,18 @@
/**
* Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getDefaultRuntime()}.
*/
- public void testGetDefaultRuntime() {
- assertNotNull("Cannot obtain default runtime 'Seam 1.2.0'",manager.getDefaultRuntime(SeamVersion.SEAM_1_2));
- assertNotNull("Cannot obtain default runtime 'Seam 1.2.0'",manager.getDefaultRuntime(SeamVersion.SEAM_1_2).getName().equals("Seam 1.2.0"));
+ public void testGetDefaultRuntime() throws IOException {
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
+ File folder = new File(seamUrl.getPath());
+ SeamRuntime runtime = null;
+ try {
+ runtime = manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ assertNotNull("Cannot obtain default runtime 'Seam 1.2.0'", manager.getDefaultRuntime(SeamVersion.SEAM_1_2));
+ } finally {
+ if(runtime!=null) {
+ manager.removeRuntime(runtime);
+ }
+ }
}
}
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r42269 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-27 18:34:06 -0400 (Wed, 27 Jun 2012)
New Revision: 42269
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewDSXMLWizard.java
Log:
JBIDE-11394
https://issues.jboss.org/browse/JBIDE-11394
Getting current project in findPersistenceXMLHandle() is fixed.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewDSXMLWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewDSXMLWizard.java 2012-06-27 21:45:01 UTC (rev 42268)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewDSXMLWizard.java 2012-06-27 22:34:06 UTC (rev 42269)
@@ -584,17 +584,19 @@
}
return newFile;
}
+
+ static final String PERSISTENCE_XML_PATH = "META-INF/persistence.xml"; //$NON-NLS-1$
private IFile findPersistenceXMLHandle() {
IPath containerPath = getContainerFullPath();
- IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(containerPath);
- Set<IFolder> srcs = EclipseResourceUtil.getSourceFolders(folder.getProject());
- IFolder src = (IFolder)EclipseResourceUtil.getJavaSourceRoot(folder.getProject());
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(containerPath.segment(0));
+ Set<IFolder> srcs = EclipseResourceUtil.getSourceFolders(project);
+ IFolder src = (IFolder)EclipseResourceUtil.getJavaSourceRoot(project);
if(src != null) {
- IFile result = src.getFile("META-INF/persistence.xml"); //$NON-NLS-1$
+ IFile result = src.getFile(PERSISTENCE_XML_PATH);
if(!result.exists()) {
for (IFolder f: srcs) {
- IFile r = f.getFile("META-INF/persistence.xml"); //$NON-NLS-1$
+ IFile r = f.getFile(PERSISTENCE_XML_PATH);
if(r.exists()) {
return r;
}
13 years, 3 months