introduce getDefaultPackageLayout() method
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/scriptview/ScriptExplorerPart.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/scriptview/ScriptExplorerPart.java
index d793535..d7df0f2 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/scriptview/ScriptExplorerPart.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/scriptview/ScriptExplorerPart.java
@@ -147,8 +147,8 @@
 	private static final String PERF_CREATE_PART_CONTROL = "org.eclipse.dltk.ui/perf/explorer/createPartControl"; //$NON-NLS-1$
 	private static final String PERF_MAKE_ACTIONS = "org.eclipse.dltk.ui/perf/explorer/makeActions"; //$NON-NLS-1$
 
-	private static final int HIERARCHICAL_LAYOUT = 0x1;
-	private static final int FLAT_LAYOUT = 0x2;
+	protected static final int HIERARCHICAL_LAYOUT = 0x1;
+	protected static final int FLAT_LAYOUT = 0x2;
 
 	public static final int PROJECTS_AS_ROOTS = 1;
 	public static final int WORKING_SETS_AS_ROOTS = 2;
@@ -473,7 +473,7 @@
 			fIsCurrentLayoutFlat = fDialogSettings
 					.getInt(ScriptExplorerPart.TAG_LAYOUT) == ScriptExplorerPart.FLAT_LAYOUT;
 		} catch (NumberFormatException e) {
-			fIsCurrentLayoutFlat = false;
+			fIsCurrentLayoutFlat = getDefaultPackageLayout() == FLAT_LAYOUT;
 		}
 
 		try {
@@ -485,6 +485,10 @@
 
 	}
 
+	protected int getDefaultPackageLayout() {
+		return HIERARCHICAL_LAYOUT;
+	}
+
 	public void init(IViewSite site, IMemento memento) throws PartInitException {
 		super.init(site, memento);
 		if (memento == null) {
@@ -522,8 +526,9 @@
 
 	private void restoreLayoutState(IMemento memento) {
 		Integer layoutState = memento.getInteger(ScriptExplorerPart.TAG_LAYOUT);
-		fIsCurrentLayoutFlat = layoutState != null
-				&& layoutState.intValue() == ScriptExplorerPart.FLAT_LAYOUT;
+		if (layoutState != null) {
+			fIsCurrentLayoutFlat = layoutState.intValue() == ScriptExplorerPart.FLAT_LAYOUT;
+		}
 
 		// on by default
 		Integer groupLibraries = memento