diff --git a/layout/inspector/src/inDOMView.cpp b/layout/inspector/src/inDOMView.cpp index 0a05dbfdbb8f..489ab4effe61 100644 --- a/layout/inspector/src/inDOMView.cpp +++ b/layout/inspector/src/inDOMView.cpp @@ -142,7 +142,7 @@ inDOMView::~inDOMView() NS_IMPL_ISUPPORTS3(inDOMView, inIDOMView, - nsIOutlinerView, + nsITreeView, nsIDocumentObserver); //////////////////////////////////////////////////////////////////////// @@ -286,12 +286,12 @@ inDOMView::Rebuild() nsCOMPtr root; GetRootNode(getter_AddRefs(root)); SetRootNode(root); - mOutliner->Invalidate(); + mTree->Invalidate(); return NS_OK; } //////////////////////////////////////////////////////////////////////// -// nsIOutlinerView +// nsITreeView NS_IMETHODIMP inDOMView::GetRowCount(PRInt32 *aRowCount) @@ -370,6 +370,24 @@ inDOMView::GetColumnProperties(const PRUnichar *colID, nsIDOMElement *colElt, ns return NS_OK; } +NS_IMETHODIMP +inDOMView::GetImageSrc(PRInt32 row, const PRUnichar *colID, nsAString& _retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +inDOMView::GetProgressMode(PRInt32 row, const PRUnichar *colID, PRInt32* _retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +inDOMView::GetCellValue(PRInt32 row, const PRUnichar *colID, nsAString& _retval) +{ + return NS_OK; +} + NS_IMETHODIMP inDOMView::GetCellText(PRInt32 row, const PRUnichar *colID, nsAString& _retval) { @@ -461,7 +479,7 @@ inDOMView::GetParentIndex(PRInt32 rowIndex, PRInt32 *_retval) RowToNode(rowIndex, &node); if (!node) return NS_ERROR_FAILURE; - inDOMViewNode* checkNode; + inDOMViewNode* checkNode = nsnull; PRUint32 i = rowIndex - 1; do { RowToNode(i, &checkNode); @@ -501,29 +519,29 @@ inDOMView::ToggleOpenState(PRInt32 index) ExpandNode(index); // Update the twisty. - mOutliner->InvalidateRow(index); + mTree->InvalidateRow(index); - mOutliner->RowCountChanged(index+1, GetRowCount() - oldCount); + mTree->RowCountChanged(index+1, GetRowCount() - oldCount); return NS_OK; } NS_IMETHODIMP -inDOMView::SetOutliner(nsIOutlinerBoxObject *outliner) +inDOMView::SetTree(nsITreeBoxObject *tree) { - mOutliner = outliner; + mTree = tree; return NS_OK; } NS_IMETHODIMP -inDOMView::GetSelection(nsIOutlinerSelection * *aSelection) +inDOMView::GetSelection(nsITreeSelection * *aSelection) { *aSelection = mSelection; NS_IF_ADDREF(*aSelection); return NS_OK; } -NS_IMETHODIMP inDOMView::SetSelection(nsIOutlinerSelection * aSelection) +NS_IMETHODIMP inDOMView::SetSelection(nsITreeSelection * aSelection) { mSelection = aSelection; return NS_OK; @@ -614,7 +632,7 @@ NS_IMETHODIMP inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint) { - if (!mOutliner) + if (!mTree) return NS_ERROR_FAILURE; PRBool filtered; @@ -634,7 +652,7 @@ inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt3 // No fancy stuff here, just invalidate the changed row PRInt32 row = 0; NodeToRow(domAttr, &row); - mOutliner->InvalidateRange(row, row); + mTree->InvalidateRange(row, row); } else if (aModType == nsIDOMMutationEvent::ADDITION) { // get the number of attributes on this content node nsCOMPtr attrs; @@ -673,7 +691,7 @@ inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt3 InsertLinkBefore(newNode, insertNode); } InsertNode(newNode, attrRow); - mOutliner->RowCountChanged(attrRow, 1); + mTree->RowCountChanged(attrRow, 1); } else if (aModType == nsIDOMMutationEvent::REMOVAL) { // At this point, the attribute is already gone from the DOM, but is still represented // in our mRows array. Search through the content node's children for the corresponding @@ -709,7 +727,7 @@ inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt3 // we have found the row for the attribute that was removed RemoveLink(checkNode); RemoveNode(row); - mOutliner->RowCountChanged(row, -1); + mTree->RowCountChanged(row, -1); break; } } @@ -725,7 +743,7 @@ inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt3 NS_IMETHODIMP inDOMView::ContentAppended(nsIDocument *aDocument, nsIContent* aContainer, PRInt32 aNewIndexInContainer) { - if (!mOutliner) + if (!mTree) return NS_ERROR_FAILURE; nsCOMPtr child; @@ -736,7 +754,7 @@ inDOMView::ContentAppended(nsIDocument *aDocument, nsIContent* aContainer, PRInt NS_IMETHODIMP inDOMView::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent* aChild, PRInt32 aIndexInContainer) { - if (!mOutliner) + if (!mTree) return NS_ERROR_FAILURE; nsresult rv; @@ -791,7 +809,7 @@ inDOMView::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsICo // insert new node InsertNode(newNode, row); - mOutliner->RowCountChanged(row, 1); + mTree->RowCountChanged(row, 1); return NS_OK; } @@ -799,7 +817,7 @@ inDOMView::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsICo NS_IMETHODIMP inDOMView::ContentReplaced(nsIDocument *aDocument, nsIContent* aContainer, nsIContent* aOldChild, nsIContent* aNewChild, PRInt32 aIndexInContainer) { - if (!mOutliner) + if (!mTree) return NS_ERROR_FAILURE; nsresult rv; @@ -824,7 +842,7 @@ inDOMView::ContentReplaced(nsIDocument *aDocument, nsIContent* aContainer, nsICo ReplaceNode(newNode, row); // XXX can this go into ReplaceNode? - mOutliner->InvalidateRange(row, oldRowCount-1); + mTree->InvalidateRange(row, oldRowCount-1); return NS_OK; } @@ -832,7 +850,7 @@ inDOMView::ContentReplaced(nsIDocument *aDocument, nsIContent* aContainer, nsICo NS_IMETHODIMP inDOMView::ContentRemoved(nsIDocument *aDocument, nsIContent* aContainer, nsIContent* aChild, PRInt32 aIndexInContainer) { - if (!mOutliner) + if (!mTree) return NS_ERROR_FAILURE; nsresult rv; @@ -852,7 +870,7 @@ inDOMView::ContentRemoved(nsIDocument *aDocument, nsIContent* aContainer, nsICon RemoveLink(oldNode); RemoveNode(row); - mOutliner->RowCountChanged(row, -1); + mTree->RowCountChanged(row, -1); return NS_OK; } diff --git a/layout/inspector/src/inDOMView.h b/layout/inspector/src/inDOMView.h index 559685739506..3072e916953d 100644 --- a/layout/inspector/src/inDOMView.h +++ b/layout/inspector/src/inDOMView.h @@ -41,8 +41,8 @@ #include "inIDOMView.h" -#include "nsIOutlinerView.h" -#include "nsIOutlinerSelection.h" +#include "nsITreeView.h" +#include "nsITreeSelection.h" #include "nsIDocumentObserver.h" #include "nsIDOMNode.h" #include "nsIDOMDocument.h" @@ -51,13 +51,13 @@ class inDOMViewNode; class inDOMView : public inIDOMView, - public nsIOutlinerView, + public nsITreeView, public nsIDocumentObserver { public: NS_DECL_ISUPPORTS NS_DECL_INIDOMVIEW - NS_DECL_NSIOUTLINERVIEW + NS_DECL_NSITREEVIEW inDOMView(); virtual ~inDOMView(); @@ -131,8 +131,8 @@ protected: static nsIAtom* kDocumentFragmentNodeAtom; static nsIAtom* kNotationNodeAtom; - nsCOMPtr mOutliner; - nsCOMPtr mSelection; + nsCOMPtr mTree; + nsCOMPtr mSelection; PRBool mShowAnonymous; PRBool mShowSubDocuments; diff --git a/suite/common/pref/nsPrefWindow.js b/suite/common/pref/nsPrefWindow.js index fec164441b67..db9955d76a45 100644 --- a/suite/common/pref/nsPrefWindow.js +++ b/suite/common/pref/nsPrefWindow.js @@ -379,7 +379,7 @@ nsPrefWindow.prototype = var index = panelTree.contentView.getIndexOfItem( selectItem ); if ( !panelTree.view.isContainerOpen( index ) ) panelTree.view.toggleOpenState(index); - panelTree.outlinerBoxObject.selection.select( index ); + panelTree.treeBoxObject.selection.select( index ); } }; diff --git a/suite/common/pref/permissionsPrefsOverlay.xul b/suite/common/pref/permissionsPrefsOverlay.xul index c6501b7c6c17..9be52ccc828f 100644 --- a/suite/common/pref/permissionsPrefsOverlay.xul +++ b/suite/common/pref/permissionsPrefsOverlay.xul @@ -26,20 +26,20 @@ - - - - + + + - - - - - + + + + - - - + + + diff --git a/suite/common/pref/pref-applications.js b/suite/common/pref/pref-applications.js index 3c0d4e6389a5..e0d38ed12783 100644 --- a/suite/common/pref/pref-applications.js +++ b/suite/common/pref/pref-applications.js @@ -20,7 +20,7 @@ var gNewTypeRV = null; var gUpdateTypeRV = null; -var gTree = null; +var gList = null; var gDS = null; var gPrefApplicationsBundle = null; @@ -35,8 +35,8 @@ function newType() { window.openDialog("chrome://communicator/content/pref/pref-applications-new.xul", "appEdit", "chrome,modal=yes,resizable=no"); if (gNewTypeRV) { - //gTree.builder.rebuild(); - gTree.setAttribute("ref", "urn:mimetypes"); + //gList.builder.rebuild(); + gList.setAttribute("ref", "urn:mimetypes"); gNewTypeRV = null; } } @@ -49,17 +49,17 @@ function removeType() var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var remove = promptService.confirm(window, titleMsg, dialogMsg); if (remove) { - var uri = gTree.selectedItems[0].id; + var uri = gList.selectedItems[0].id; var handlerOverride = new HandlerOverride(uri); removeOverride(handlerOverride.mimeType); - gTree.setAttribute("ref", "urn:mimetypes"); + gList.setAttribute("ref", "urn:mimetypes"); } } function editType() { - if (gTree.selectedItems && gTree.selectedItems[0]) { - var uri = gTree.selectedItems[0].id; + if (gList.selectedItems && gList.selectedItems[0]) { + var uri = gList.selectedItems[0].id; var handlerOverride = new HandlerOverride(uri); window.openDialog("chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", handlerOverride); selectApplication(); @@ -72,7 +72,7 @@ function Startup() gPrefApplicationsBundle = document.getElementById("bundle_prefApplications"); // set up the elements - gTree = document.getElementById("appTree"); + gList = document.getElementById("appList"); gExtensionField = document.getElementById("extension"); gMIMETypeField = document.getElementById("mimeType"); gHandlerField = document.getElementById("handler"); @@ -92,15 +92,15 @@ function Startup() dump("spec is " + ioService.getURLSpecFromFile(file)); gDS = gRDF.GetDataSource(ioService.getURLSpecFromFile(file)); - // intialise the tree - gTree.database.AddDataSource(gDS); - gTree.setAttribute("ref", "urn:mimetypes"); + // intialize the listbox + gList.database.AddDataSource(gDS); + gList.setAttribute("ref", "urn:mimetypes"); } function selectApplication() { - if (gTree.selectedItems && gTree.selectedItems.length && gTree.selectedItems[0]) { - var uri = gTree.selectedItems[0].id; + if (gList.selectedItems && gList.selectedItems.length && gList.selectedItems[0]) { + var uri = gList.selectedItems[0].id; var handlerOverride = new HandlerOverride(uri); gExtensionField.setAttribute("value", handlerOverride.extensions); gMIMETypeField.setAttribute("value", handlerOverride.mimeType); diff --git a/suite/common/pref/pref-applications.xul b/suite/common/pref/pref-applications.xul index cedd403a58f6..4b97d949456e 100644 --- a/suite/common/pref/pref-applications.xul +++ b/suite/common/pref/pref-applications.xul @@ -41,12 +41,9 @@