diff options
author | jechoi | 2006-07-11 06:47:47 +0000 |
---|---|---|
committer | jechoi | 2006-07-11 06:47:47 +0000 |
commit | 4e77610a8bfcd819a4c4e5399b35d7898dce0e7e (patch) | |
tree | 02645a78e25f26b6cbfda95039713f6131152e8e | |
parent | f58762ed8febbc11d34e3cbe66a366914cf435f2 (diff) | |
download | webtools.jsf-4e77610a8bfcd819a4c4e5399b35d7898dce0e7e.tar.gz webtools.jsf-4e77610a8bfcd819a4c4e5399b35d7898dce0e7e.tar.xz webtools.jsf-4e77610a8bfcd819a4c4e5399b35d7898dce0e7e.zip |
bug fix 150120: Cannot open faces-config.xml within non-jsf project
3 files changed, 20 insertions, 8 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.java index 180b2f313..69698eee4 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.java +++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.java @@ -10,7 +10,6 @@ * Sybase, Inc. - initial API and implementation *******************************************************************************/ - package org.eclipse.jst.jsf.facesconfig.ui; import org.eclipse.osgi.util.NLS; @@ -673,4 +672,7 @@ public final class EditorMessages extends NLS { public static String MultiPageEditorOutlinePage_noOutline; + public static String FacesConfigEditor_Error_OpenModel_Title; + + public static String FacesConfigEditor_Error_OpenModel; } diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.properties b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.properties index cbc3432c0..2b51a88dc 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.properties +++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/EditorMessages.properties @@ -15,14 +15,14 @@ FindType = Find Type FindType_Filter = Choose a type (?=any character, *=any string): FindType_Error_CannotFindType = Can not find java class - - +FacesConfigEditor_Error_OpenModel_Title = Error +FacesConfigEditor_Error_OpenModel = Cannot open the faces-config file, this project is not a web project. #################################################### # Tab's name for multipageeditor of faces-config #################################################### FacesConfigEditor_Introduction_TabName = Introduction FacesConfigEditor_Overview_TabName = Overview -FacesConfigEditor_Pageflow_TabName = Navigation +FacesConfigEditor_Pageflow_TabName = Navigation Rule FacesConfigEditor_ManagedBeans_TabName = ManagedBean FacesConfigEditor_Components_TabName = Component FacesConfigEditor_Others_TabName = Others diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/FacesConfigEditor.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/FacesConfigEditor.java index 5ef1a01c7..bdbea6817 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/FacesConfigEditor.java +++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/FacesConfigEditor.java @@ -276,7 +276,8 @@ public class FacesConfigEditor extends FormEditor implements new Runnable() { public void run() { editorDirtyStateChanged(); - getActionBarContributor().updateActionBars(); + getActionBarContributor() + .updateActionBars(); } }); } @@ -293,7 +294,16 @@ public class FacesConfigEditor extends FormEditor implements */ public void init(IEditorSite site, IEditorInput input) throws PartInitException { - super.init(site, input); + try { + super.init(site, input); + } catch (Exception e) { + MessageDialog.openError(null, + EditorMessages.FacesConfigEditor_Error_OpenModel_Title, + EditorMessages.FacesConfigEditor_Error_OpenModel); + throw new PartInitException( + EditorMessages.FacesConfigEditor_Error_OpenModel); + } + setPartName(input.getName()); if (!isValidInput(input)) { PlatformUI.getWorkbench().getActiveWorkbenchWindow() @@ -386,7 +396,8 @@ public class FacesConfigEditor extends FormEditor implements protected void createAndAddPageflowPage() throws PartInitException { pageflowPage = new PageflowEditor(this); pageflowPageID = addPage(pageflowPage, getEditorInput()); - setPageText(pageflowPageID, "Navigation Rule"); + setPageText(pageflowPageID, + EditorMessages.FacesConfigEditor_Pageflow_TabName); addPageActionRegistry(pageflowPage); pageflowPage.getModelsTransform().setFacesConfig(getFacesConfig()); pageflowPage.getModelsTransform().setPageflow( @@ -693,7 +704,6 @@ public class FacesConfigEditor extends FormEditor implements } public boolean isSaveAsAllowed() { - // TODO Auto-generated method stub return true; } |