Bug 424866 - Readonly file browser widget. -- Allow the caller to pass the max height of the editor. Removed the annotation ruler on the left of the editor. Remains the line number ruler, overview ruler and projection ruler.
diff --git a/bundles/org.eclipse.orion.client.ui/web/browse/browse.js b/bundles/org.eclipse.orion.client.ui/web/browse/browse.js
index f203c7e..0066332 100644
--- a/bundles/org.eclipse.orion.client.ui/web/browse/browse.js
+++ b/bundles/org.eclipse.orion.client.ui/web/browse/browse.js
@@ -24,6 +24,7 @@
 		//var cTypeService = new mContentTypes.ContentTypeRegistry(mStaticDataSource.ContentTypes);
 		var fBrowser = new mFileBrowser.FileBrowser({
 			parent: "fileBrowser",//Required 
+			//maxEditorHeight: 800,
 			fileClient: new mFileClient.FileClient(core.serviceRegistry), //Required. But will be different implementation that does not require service registration
 			//syntaxHighlighter: new mStaticDataSource.SyntaxHighlighter(), //Optional. If not defined the deafult one is used.
 			//syntaxHighlighter: new Highlight.SyntaxHighlighter(core.serviceRegistry, cTypeService), //Required. But will be different implementation that does not require service registration
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/folderView.js b/bundles/org.eclipse.orion.client.ui/web/orion/folderView.js
index 427db7b..5c004b8 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/folderView.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/folderView.js
@@ -32,7 +32,6 @@
 	var FileExplorer = mExplorerTable.FileExplorer;
 	var KeyBinding = mKeyBinding.KeyBinding;
 	var NavigatorRenderer = mNavigatorRenderer.NavigatorRenderer;
-	//var MAX_EDITOR_HEIGHT = 700;
 	
 	var uriTemplate = new URITemplate("#{,resource,params*}"); //$NON-NLS-0$
 	function FolderNavRenderer() {
@@ -208,6 +207,7 @@
 		this.showFolderNav = true;
 		this.readmeHeaderClass = options.readmeHeaderClass;
 		this.editorView = options.editorView;
+		this._maxEditorHeight = options.maxEditorHeight;
 		this.imageView = options.imageView;
 		this.breadCrumbMaker = options.breadCrumbMaker;
 		this._init();
@@ -310,6 +310,9 @@
 								var textView = this.editorView. editor.getTextView();
 								textView.getModel().addEventListener("Changed", this._editorViewModelChangedListener = function(e){ //$NON-NLS-0$
 									var textViewheight = textView.getLineHeight() * textView.getModel().getLineCount() + 20;
+									if(this._maxEditorHeight && this._maxEditorHeight > 0 && textViewheight >this._maxEditorHeight) {
+										textViewheight = this._maxEditorHeight;
+									}
 									this.editorView.getParent().style.height = textViewheight + "px"; //$NON-NLS-0$
 								}.bind(this));
 								this.editor = this.editorView.editor;
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/fileBrowser.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/fileBrowser.js
index fdbca92..8aaa1ea 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/fileBrowser.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/fileBrowser.js
@@ -40,6 +40,7 @@
 	 * @name orion.browse.FileBrowserOptions
 	 *
 	 * @property {String|DOMElement} parent the parent element for the file browser, it can be either a DOM element or an ID for a DOM element.
+	 * @property {Number} maxEditorHeight the max height of the editor when displaying a file, if not defined 0 is used to represent that editor will use the full contents height.
 	 * @property {orion.fileClient.FileClient} fileClient the file client implementation that has all the interfaces from orion.fileClient.FileClient.
 	 * @property {orion.highlight.SyntaxHighlighter} optional syntaxHighlighter the syntax highlighter that hihglights  a supported language file. If not defined a static default one is used.
 	 * @property {orion.core.ContentType} contentTypeService optional the content type service that knows a file's content type. If not defined a static default one is used.
@@ -70,6 +71,7 @@
 	objects.mixin(FileBrowser.prototype, {
 		_init: function(options){
 			this._commandRegistry = new mCommandRegistry.CommandRegistry({});
+			this._maxEditorHeight = options.maxEditorHeight;
 			this._inputManager = new mInputManager.InputManager({
 				fileClient: this._fileClient,
 				statusReporter: this._statusReport,
@@ -170,6 +172,7 @@
 					parent: this._parentDomNode,
 					readonly: true,
 					showProjectView: false,
+					maxEditorHeight: this._maxEditorHeight,
 					readmeHeaderClass: "readmeHeader",
 					metadata: metadata,
 					commandRegistry: this._commandRegistry,
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/readonlyEditorView.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/readonlyEditorView.js
index 2386be1..8f6de1a 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/readonlyEditorView.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/readonlyEditorView.js
@@ -150,6 +150,8 @@
 			}.bind(this));

 			if(this.editorPreferences) {

 				this.editorPreferences.getPrefs(this.updateSettings.bind(this));

+			} else {

+				editor.setAnnotationRulerVisible(false);

 			}

 		},

 		create: function() {