<?xml version="1.0" ?>

<?xml-stylesheet href="chrome://browser/skin/places/places.css" type="text/css"?>

<!DOCTYPE overlay SYSTEM "chrome://scrapbook/locale/tree.dtd">

<overlay id="sbTreeOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

	<script type="application/x-javascript" src="chrome://scrapbook/content/common.js" />
	<script type="application/x-javascript" src="chrome://scrapbook/content/scrapbook.js" />
	<script type="application/x-javascript" src="chrome://scrapbook/content/tree.js" />
	<script type="application/x-javascript" src="chrome://scrapbook/content/mbService.js" />

	<popupset id="sbPopupSet">
		<menupopup id="sbPopup" onpopupshowing="sbController.onPopupShowing(event);"
		           onmouseover="if (event.originalTarget.getAttribute('nodelay')) document.getElementById('sbPopupToolsMenu').hidePopup();">
			<menuitem id="sbPopupOpen"       label="&sb.open;"        nodelay="true" oncommand="sbController.open(null,false);" default="true" />
			<menuitem id="sbPopupOpenTab"    label="&sb.open.tab;"    nodelay="true" oncommand="sbController.open(null,true);" hidden="true" />
			<menuitem id="sbPopupOpenNewTab" label="&sb.open.newtab;" nodelay="true" oncommand="sbController.open(null,true);" />
			<menuitem id="sbPopupOpenSource" label="&sb.open.source;" nodelay="true" oncommand="sbController.forward(null,'S');"
			          onclick="if (event.button != 1) return; this.parentNode.hidePopup(); sbController.forward(null,'S',true);" />
			<menuitem id="sbPopupCombinedView" label="&sb.folder.combine;" oncommand="sbController.forward(null,'C');"   hidden="true" />
			<menuitem id="sbPopupOpenAllItems" label="&sb.folder.openall;" oncommand="sbController.openAllInTabs(null);" hidden="true" />
			<menuseparator hidden="true" />
			<menu id="sbPopupTools" label="&sb.tools;" onmouseover="event.stopPropagation();">
				<menupopup id="sbPopupToolsMenu">
					<menuitem id="sbPopupShowFiles" label="&sb.show.files;" oncommand="sbController.forward(null,'L');" />
					<menuitem id="sbPopupSend"      label="&sb.move;..."    oncommand="sbTreeUI.send()" />
					<menuseparator />
					<menuitem id="sbPopupRenew" class="menuitem-iconic" label="&sb.renew;..." oncommand="sbController.renew(null, true);" onclick="if (event.button == 1) sbController.renew(null, false);" />
					<menuseparator />
					<menuitem id="sbPopupExport" label="&sb.export;" oncommand="sbController.forward(null,'E');" />
				</menupopup>
			</menu>
			<menuitem id="sbPopupManage" label="&sb.folder.manage;..." oncommand="sbController.forward(null,'M');" hidden="true" />
			<menuitem id="sbPopupSort"   label="&sb.sort.folder;..."   oncommand="sbController.forward(null,'Z');" hidden="true" />
			<menuseparator />
			<menuitem id="sbPopupNewFolder"    class="menuitem-iconic sb-create" label="&sb.new.folder;..." oncommand="sbMainUI.createFolder();" />
			<menuitem id="sbPopupNewSeparator" class="menuitem-iconic sb-create" label="&sb.new.separator;" oncommand="sbMainUI.createSeparator();" />
			<menuitem id="sbPopupNewNote"      class="menuitem-iconic sb-create" label="&sb.new.note;"      oncommand="sbMainUI.createNote();" />
			<menuseparator />
			<menuitem id="sbPopupRemove"    class="menuitem-iconic" label="&sb.remove;"   oncommand="sbTreeUI.remove();" />
			<menuseparator />
			<menuitem id="sbPopupProperty"  class="menuitem-iconic" label="&sb.property;" oncommand="sbController.forward(null,'P');" />
		</menupopup>
		<menupopup id="sbSearchPopup" onpopupshowing="sbSearchUI.onPopupShowing(event);" position="after_start">
			<menuitem label="&sb.search.fulltext;" type="radio" searchtype="fulltext" oncommand="sbSearchUI.changeType('fulltext');" />
			<menuseparator />
			<menuitem label="&sb.prop.title;"   type="radio" searchtype="title"   oncommand="sbSearchUI.changeType('title');" />
			<menuitem label="&sb.prop.comment;" type="radio" searchtype="comment" oncommand="sbSearchUI.changeType('comment');" />
			<menuitem label="&sb.prop.url;"     type="radio" searchtype="source"  oncommand="sbSearchUI.changeType('source');" />
			<menuitem label="&sb.prop.id.date;" type="radio" searchtype="id"      oncommand="sbSearchUI.changeType('id');" />
			<menuitem label="&sb.search.all;"   type="radio" searchtype="all"     oncommand="sbSearchUI.changeType('all');" />
			<menuseparator />
			<menuitem id="sbSearchPopupOptionRE" label="&sb.search.re;" type="checkbox" persist="checked" />
			<menuitem id="sbSearchPopupOptionCS" label="&sb.search.cs;" type="checkbox" persist="checked" />
			<menuseparator />
			<menu label="&sb.tools;">
				<menupopup>
					<menuitem label="&sb.search.days;..." oncommand="sbSearchUI.promptForDaysFilter();" />
					<menuitem label="&sb.search.cache;"   oncommand="sbSearchUI.updateCache();" />
				</menupopup>
			</menu>
		</menupopup>
	</popupset>

	<toolbar id="sbSearchToolbar" align="center">
		<textbox id="sbSearchTextbox"
		         type="search"
		         onkeypress="sbSearchUI.onKeyPress(event);"
		         oncommand="sbSearchUI.onCommand(this.value);"
		         accesskey="S"
		         flex="1">
			<image id="sbSearchImage"
			       persist="searchtype"
			       popup="sbSearchPopup"
			       onclick="if (event.button == 1) sbSearchUI.onCommand(this.parentNode.value);" />
		</textbox>
	</toolbar>

	<tree id="sbTree"
	      datasources="rdf:null"
	      ref="urn:scrapbook:root"
	      flags="dont-build-content">
		<treecols id="sbTreeCols">
			<treecol id="sbTreeColTitle" hideheader="true" primary="true" flex="1" />
		</treecols>
		<template>
			<rule id="sbTreeRule">
				<treechildren flex="1">
					<treeitem uri="rdf:*">
						<treerow>
							<treecell id="sbTreeItem"
							          label="rdf:http://amb.vis.ne.jp/mozilla/scrapbook-rdf#title"
							          src="rdf:http://amb.vis.ne.jp/mozilla/scrapbook-rdf#icon"
							          properties="Name title rdf:http://amb.vis.ne.jp/mozilla/scrapbook-rdf#type" />
						</treerow>
					</treeitem>
				</treechildren>
			</rule>
		</template>
	</tree>

	<toolbarbutton id="mbToolbarButton" type="menu" tooltiptext="Multi-ScrapBook" onpopupshowing="sbMultiBookUI.initMenu();" hidden="true">
		<menupopup id="mbMenuPopup" oncommand="sbMultiBookUI.change(event.originalTarget);">
			<menuitem id="mbMenuItem" type="radio" autocheck="false" hidden="true" />
			<menuitem id="mbMenuItemDefault" label="&mb.profileFolder;" type="radio" autocheck="false" />
			<menuseparator />
			<menuitem label="&mb.manage;..." oncommand="sbMultiBookUI.config(); event.stopPropagation();" />
		</menupopup>
	</toolbarbutton>

</overlay>
