Author: scabanovich
Date: 2008-02-29 09:30:05 -0500 (Fri, 29 Feb 2008)
New Revision: 6651
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
Log:
JBIDE-1828
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2008-02-29
14:29:27 UTC (rev 6650)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2008-02-29
14:30:05 UTC (rev 6651)
@@ -22,6 +22,9 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaUI;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.BeanType;
@@ -442,6 +445,11 @@
public void open() {
if(type == null) return;
+ if(!type.exists()) {
+ ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
+ d.showDialog("Warning", "Type " + type.getElementName() + "
does not exist.", new String[]{SpecialWizardSupport.OK}, null,
ServiceDialog.WARNING);
+ return;
+ }
try {
JavaUI.openInEditor(type);
} catch (Exception e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2008-02-29
14:29:27 UTC (rev 6650)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2008-02-29
14:30:05 UTC (rev 6651)
@@ -24,7 +24,10 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
@@ -114,6 +117,12 @@
FindObjectHelper.findModelObject(o, FindObjectHelper.IN_EDITOR_ONLY);
} else if(getResource() instanceof IFile) {
IFile f = (IFile)getResource();
+ if(f == null || !f.exists()) {
+ ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
+ d.showDialog("Warning", "File " + getSourcePath() + " does
not exist.", new String[]{SpecialWizardSupport.OK}, null, ServiceDialog.WARNING);
+ return;
+ }
+
try {
IWorkbench workbench = SeamCorePlugin.getDefault().getWorkbench();
if(workbench == null) return;
Show replies by date