reenabled folding preference for inner types
authorbananeweizen <bananeweizen>
Sun, 29 Jan 2006 14:44:02 +0000 (14:44 +0000)
committerbananeweizen <bananeweizen>
Sun, 29 Jan 2006 14:44:02 +0000 (14:44 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java

index 2ed9f83..1fea426 100644 (file)
@@ -70,9 +70,9 @@ public class DefaultJavaFoldingPreferenceBlock implements IJavaFoldingPreference
                                PreferenceConstants.EDITOR_FOLDING_JAVADOC));
                overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
                                PreferenceConstants.EDITOR_FOLDING_HEADERS));
-               // overlayKeys.add(new
-               // OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
-               // PreferenceConstants.EDITOR_FOLDING_INNERTYPES));
+                overlayKeys.add(new
+                OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+                PreferenceConstants.EDITOR_FOLDING_INNERTYPES));
                overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
                                PreferenceConstants.EDITOR_FOLDING_METHODS));
                // overlayKeys.add(new
@@ -102,9 +102,9 @@ public class DefaultJavaFoldingPreferenceBlock implements IJavaFoldingPreference
                                FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.comments"), PreferenceConstants.EDITOR_FOLDING_JAVADOC, 0); //$NON-NLS-1$
                addCheckBox(inner,
                                FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.headers"), PreferenceConstants.EDITOR_FOLDING_HEADERS, 0);//$NON-NLS-1$
-               // addCheckBox(inner,
-               // FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.innerTypes"),
-               // PreferenceConstants.EDITOR_FOLDING_INNERTYPES, 0); //$NON-NLS-1$
+                addCheckBox(inner,
+                FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.innerTypes"),
+                PreferenceConstants.EDITOR_FOLDING_INNERTYPES, 0); //$NON-NLS-1$
                addCheckBox(inner,
                                FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.methods"), PreferenceConstants.EDITOR_FOLDING_METHODS, 0); //$NON-NLS-1$
                // addCheckBox(inner,
index 48be71c..c06a287 100644 (file)
@@ -560,7 +560,13 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener,
                // createProjection = true;
                // break;
                case IJavaElement.TYPE:
-                       collapse = fAllowCollapsing && fCollapseInnerTypes && isInnerType((IType) element);
+                       collapse = fAllowCollapsing;
+                       if (isInnerType((IType) element)) {
+                               collapse = collapse && fCollapseInnerTypes;
+                       }
+                       else {
+                               collapse = false; //don't allow the most outer type to be folded, may be changed in future versions
+                       }
                        createProjection = true;
                        break;
                case IJavaElement.METHOD: