From: bananeweizen Date: Sun, 29 Jan 2006 14:44:02 +0000 (+0000) Subject: reenabled folding preference for inner types X-Git-Url: http://git.phpeclipse.com?hp=8d485fb1333973264f49ca5dce465f691c5477a6 reenabled folding preference for inner types --- 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: