Author: Grid.Qian
Date: 2011-08-02 03:29:54 -0400 (Tue, 02 Aug 2011)
New Revision: 33439
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/messages.properties
Log:
JBIDE-9044: display a warning when the selected element is not bpel content folder
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/Messages.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/Messages.java 2011-08-02
07:13:31 UTC (rev 33438)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/Messages.java 2011-08-02
07:29:54 UTC (rev 33439)
@@ -59,6 +59,8 @@
public static String NewFileWizardPage2_Name;
//
https://issues.jboss.org/browse/JBIDE-8591
public static String NewFileWizard_Not_A_Faceted_Project;
+
+ public static String NewFileWizard_Not_A_BPELContent_Folder;
public static String NewFileWizard_WSDLCustomPage_Name;
public static String NewFileWizard_WSDLCustomPage_Title;
public static String NewFileWizard_WSDLCustomPage_Description;
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java 2011-08-02
07:13:31 UTC (rev 33438)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java 2011-08-02
07:29:54 UTC (rev 33439)
@@ -17,13 +17,11 @@
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.Templates.Template;
-import org.eclipse.core.internal.resources.Folder;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Display;
@@ -33,7 +31,6 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
@@ -214,12 +211,10 @@
*/
IContainer getBPELContainer(Object obj) {
-
- IContainer bpelContent = null;
-
if (obj == null) {
return null;
}
+ IContainer bpelContainer = null;
IProject project = null;
if (obj instanceof IFile) {
IFile file = (IFile) obj;
@@ -229,6 +224,20 @@
IContainer container = (IContainer) obj;
project = container.getProject();
}
+ bpelContainer = getBPELContentFolder(project);
+ if (bpelContainer == null) {
+ //
https://issues.jboss.org/browse/JBIDE-8591
+ // use folder or project
+ if (obj instanceof IContainer)
+ bpelContainer = (IContainer)obj;
+ else
+ bpelContainer = project;
+ }
+ return bpelContainer;
+ }
+
+ public static IContainer getBPELContentFolder(IProject project) {
+ IContainer bpelContent = null;
if (project != null) {
//
https://issues.jboss.org/browse/JBIDE-8591
// if not a faceted project, still allow resources to be created
@@ -237,31 +246,24 @@
bpelContent = project.getFolder(rootPath);
}
}
- if (bpelContent == null) {
- //
https://issues.jboss.org/browse/JBIDE-8591
- // use folder or project
- if (obj instanceof IContainer)
- bpelContent = (IContainer)obj;
- else
- bpelContent = project;
- }
return bpelContent;
}
+
- static IPath getWebContentRootPath(IProject project) {
- if (project == null)
- return null;
-
- if (!ModuleCoreNature.isFlexibleProject(project))
- return null;
-
- IPath path = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null && component.exists()) {
- path = component.getRootFolder().getProjectRelativePath();
- }
- return path;
- }
+ public static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
+
+ if (!ModuleCoreNature.isFlexibleProject(project))
+ return null;
+
+ IPath path = null;
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null && component.exists()) {
+ path = component.getRootFolder().getProjectRelativePath();
+ }
+ return path;
+ }
//
https://issues.jboss.org/browse/JBIDE-8591
// added to allow first and last page access to resource container
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java 2011-08-02
07:13:31 UTC (rev 33438)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java 2011-08-02
07:29:54 UTC (rev 33439)
@@ -86,16 +86,23 @@
if (resource instanceof IContainer) {
IContainer container = (IContainer)resource;
//
https://issues.jboss.org/browse/JBIDE-8591
- setMessage(null);
- if (!ModuleCoreNature.isFlexibleProject(resource.getProject())) {
- setMessage(Messages.NewFileWizard_Not_A_Faceted_Project, WizardPage.WARNING);
-// return false;
- }
if ( container.findMember(processName +".bpel") != null ) { //$NON-NLS-1$
setMessage(Messages.NewFileWizardPage1_12, WizardPage.ERROR);
return false;
}
+
+ if (!ModuleCoreNature.isFlexibleProject(resource.getProject())) {
+ setMessage(Messages.NewFileWizard_Not_A_Faceted_Project, WizardPage.WARNING);
+ return true;
+ }
+
+ if (!container.equals(NewFileWizard.getBPELContentFolder(container.getProject()))) {
+ setMessage(Messages.NewFileWizard_Not_A_BPELContent_Folder, WizardPage.WARNING);
+ return true;
+ }
+
+ setMessage(null);
return true;
}
return false;
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/messages.properties
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/messages.properties 2011-08-02
07:13:31 UTC (rev 33438)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/messages.properties 2011-08-02
07:29:54 UTC (rev 33439)
@@ -25,6 +25,7 @@
NewFileWizard_WSDLCustomPage_AddressLabel=Service Address
NewFileWizard_WSDLCustomPage_BindingLabel=Binding Protocol
NewFileWizard_Not_A_Faceted_Project=The selected location is not a faceted project.
+NewFileWizard_Not_A_BPELContent_Folder=The selected location is not a BPEL Content
folder.
Error_NewFileWizard_WSDLCustomPage_Name_Empty=Specify a {0} for the BPEL process in the
WSDL file.
Error_NewFileWizard_WSDLCustomPage_Name_Space={0} must not include a space.
Error_NewFileWizard_WSDLCustomPage_Protocol=The Binding Protocol must be 'SOAP'
or 'HTTP'.