Author: scabanovich
Date: 2007-09-18 06:00:32 -0400 (Tue, 18 Sep 2007)
New Revision: 3677
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
JBIDE-905
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2007-09-18
09:44:30 UTC (rev 3676)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2007-09-18
10:00:32 UTC (rev 3677)
@@ -146,8 +146,8 @@
private void loadSelectedTab() {
IFile file = getFile();
try {
- String q = file.getPersistentProperty(persistentTabQualifiedName);
- if (q == null)
+ String q = (file == null) ? null :
file.getPersistentProperty(persistentTabQualifiedName);
+ if (q == null) {
if ("Source".equalsIgnoreCase(VpePreference.EDITOR_VIEW_OPTION
.getValue()))
selectedPageIndex = 2;
@@ -157,7 +157,7 @@
selectedPageIndex = 1;
else
selectedPageIndex = 0;
- else {
+ } else {
int qi = Integer.parseInt(q);
if (qi >= 0 && qi < getTabFolder().getItemCount())
@@ -175,6 +175,7 @@
private void saveSelectedTab() {
IFile file = getFile();
+ if(file == null) return;
String q = "" + selectedPageIndex;
try {
file.setPersistentProperty(persistentTabQualifiedName, q);
@@ -253,9 +254,9 @@
}
private void updateFile() {
+ IFile file = getFile();
+ if (file == null) return;
try {
- IFile file = getFile();
- if (file != null)
file.refreshLocal(0, null);
} catch (CoreException e) {
JspEditorPlugin.getPluginLog().logWarning(e);
Show replies by date