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
Show replies by date