From 8126c0a2b6481ced5df7beddd3d058fbae5fa8ad Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Sun, 29 Jan 2006 14:44:02 +0000 Subject: [PATCH] reenabled folding preference for inner types --- .../folding/DefaultJavaFoldingPreferenceBlock.java | 12 ++++++------ .../DefaultJavaFoldingStructureProvider.java | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java index 2ed9f83..1fea426 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingPreferenceBlock.java @@ -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, diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java index 48be71c..c06a287 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java @@ -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: -- 1.7.1