diff -r c7261870fdfd editor.lib/apichanges.xml --- a/editor.lib/apichanges.xml Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/apichanges.xml Tue Dec 15 12:23:10 2009 +0100 @@ -104,6 +104,21 @@ + + Add flag hideBottomPadding to GapDocumentView constructor to be able to control adding bottom padding. + + + + + +

+ Add flag hideBottomPadding to GapDocumentView constructor. Subclasses should override this constructor + to pass this flag to superclass constructor. +

+
+ +
+ Adding interface enabling initialization of lookups performed by SideBarFactory implementations. diff -r c7261870fdfd editor.lib/nbproject/project.properties --- a/editor.lib/nbproject/project.properties Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/nbproject/project.properties Tue Dec 15 12:23:10 2009 +0100 @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.45.0 +spec.version.base=1.46 is.autoload=true javadoc.arch=${basedir}/arch.xml diff -r c7261870fdfd editor.lib/src/org/netbeans/editor/CollapsedView.java --- a/editor.lib/src/org/netbeans/editor/CollapsedView.java Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/src/org/netbeans/editor/CollapsedView.java Tue Dec 15 12:23:10 2009 +0100 @@ -278,7 +278,7 @@ int eo = parentElem.getElement(eei).getEndOffset(); LockView fakeView = new LockView( - new DrawEngineFakeDocView(parentElem, so, eo, false) + new DrawEngineFakeDocView(parentElem, so, eo, false, true) ); RootView rootView = new RootView(); rootView.setView(fakeView); diff -r c7261870fdfd editor.lib/src/org/netbeans/editor/DrawEngineDocView.java --- a/editor.lib/src/org/netbeans/editor/DrawEngineDocView.java Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/src/org/netbeans/editor/DrawEngineDocView.java Tue Dec 15 12:23:10 2009 +0100 @@ -87,7 +87,11 @@ private boolean estimatedSpanResetInitiated; DrawEngineDocView(Element elem) { - super(elem); + this(elem, false); + } + + DrawEngineDocView(Element elem, boolean hideBottomPadding) { + super(elem, hideBottomPadding); setEstimatedSpan(true); } diff -r c7261870fdfd editor.lib/src/org/netbeans/editor/DrawEngineFakeDocView.java --- a/editor.lib/src/org/netbeans/editor/DrawEngineFakeDocView.java Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/src/org/netbeans/editor/DrawEngineFakeDocView.java Tue Dec 15 12:23:10 2009 +0100 @@ -57,15 +57,18 @@ private int fakeEndOffset; DrawEngineFakeDocView(Element elem, int startOffset, int endOffset, boolean useCollapsing){ - super(elem); - + this(elem, startOffset, endOffset, useCollapsing, false); + } + + DrawEngineFakeDocView(Element elem, int startOffset, int endOffset, boolean useCollapsing, boolean hideBottomPadding){ + super(elem, hideBottomPadding); + this.useCollapsing = useCollapsing; this.fakeStartOffset = startOffset; this.fakeEndOffset = endOffset; setEstimatedSpan(false); - } - + @Override public int getStartOffset(){ return fakeStartOffset; diff -r c7261870fdfd editor.lib/src/org/netbeans/lib/editor/view/GapDocumentView.java --- a/editor.lib/src/org/netbeans/lib/editor/view/GapDocumentView.java Wed Dec 09 12:27:09 2009 +0100 +++ b/editor.lib/src/org/netbeans/lib/editor/view/GapDocumentView.java Tue Dec 15 12:23:10 2009 +0100 @@ -155,6 +155,9 @@ private int damageRangeStartOffset; private int damageRangeEndOffset; + /** Set to true to avoid adding bottom padding */ + private boolean hideBottomPadding; + /** * Construct a view intended to cover the whole document. * @@ -165,13 +168,29 @@ * instead of default layout. */ public GapDocumentView(Element elem) { + this(elem, false); + } + + /** + * Construct a view intended to cover the whole document. + * + * @param elem the element of the model to represent. + * @param hideBottomPadding to avoid adding bottom padding to view + * @param majorAxis the axis to tile along. This can be + * either X_AXIS or Y_AXIS. + * @param baselineLayout whether baseline layout should be used + * instead of default layout. + */ + public GapDocumentView(Element elem, boolean hideBottomPadding) { super(elem, View.Y_AXIS); + this.hideBottomPadding = hideBottomPadding; clearDamageRangeBounds(); } - + + @Override public float getPreferredSpan(int axis) { float span = super.getPreferredSpan(axis); - if (axis == View.Y_AXIS) { + if (!hideBottomPadding && (axis == View.Y_AXIS)) { // Add an extra span to avoid typing at the bottom of the screen // by adding virtual height Container c = getContainer();