<?xml version="1.0"?>

<!DOCTYPE page [
  <!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
  <!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
  <!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/styleRules.dtd"> %dtd3;
]>

<?xul-overlay href="chrome://inspector/content/editingOverlay.xul"?>

<?xml-stylesheet href="chrome://inspector/skin/viewers/styleRules/styleRules.css"?>

<page id="winStyleRules"
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  
  <!--============================= SCRIPTS ============================= -->

  <script type="application/x-javascript" src="chrome://inspector/content/utils.js"/>
  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/inBaseTreeView.js"/>
  <script type="application/x-javascript" src="chrome://inspector/content/viewers/styleRules/styleRules.js"/>
  <script type="application/x-javascript" src="chrome://global/content/XPCNativeWrapper.js"/>
  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/rdf/RDFU.js"/>
  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>

  <!--============================ COMMANDS ============================= -->

  <commandset id="cmdsEditing"/>
  <commandset id="cmdsProps">
    <command id="cmdTogglePriority"
             oncommand="viewer.pane.panelset.execCommand('cmdTogglePriority')"/>
  </commandset>

  <!--============================= POPUPS ============================== -->

  <popupset id="psPopups">
    <popup id="ppStyleRuleContext" onpopupshowing="return viewer.onpopupshowingRulePopup()">
      <menuitem label="&newRules.label;" oncommand="viewer.cmdNewRule()"/>
      <menuitem label="&deleteSelectedRules.label;" oncommand="viewer.cmdDeleteSelectedRule()"/>
      <menuitem label="&disableSelectedRules.label;" oncommand="viewer.cmdToggleSelectedRule()"/>
      <menuseparator/>
      <menuitem label="&openSelectedFileInEditor.label;" oncommand="viewer.cmdOpenSelectedFileInEditor()"/>
    </popup>

    <popup id="ppStylePropsContext"
           onpopupshowing="viewer.propOnPopupShowing(this)">
      <menuitem id="mnEditCopy"/>
      <menuseparator/>
      <menuitem id="mnEditInsert"/>
      <menuitem id="mnEditEdit"/>
      <menuitem id="mnEditDelete"/>
      <menuseparator/>
      <menuitem label="&toggleSelectedImportant.label;"
                command="cmdTogglePriority"/>
    </popup>
  </popupset>

  <!--============================= CONTENT ============================== -->

  <tree id="olStyleRules" class="plain" flex="1" persist="height"
        seltype="single" onselect="viewer.onRuleSelect()">
    <treecols>
      <treecol id="olcRule" label="&styleRule.label;" flex="1"/>
      <splitter class="tree-splitter"/>
      <treecol id="olcFileURL" label="&styleRuleURI.label;" flex="1"/>
      <splitter class="tree-splitter"/>
      <treecol id="olcLine" label="&styleRuleLineNumber.label;"/>
    </treecols>
    <treechildren id="olbStyleRules"
                  alternatingbackground="true"/>
  </tree>
  
  <splitter id="splTrees" collapse="after" persist="state">
    <grippy/>
  </splitter>

  <tree id="olStyleProps"
        class="plain"
        flex="1"
        persist="height"
        contextmenu="ppStylePropsContext"
        onselect="viewer.onPropSelect()">
    <treecols>
      <treecol id="olcPropPriority" label="&styleRulePropPriority.label;" class="treecol-image"/>
      <splitter class="tree-splitter"/>
      <treecol id="olcPropName" label="&styleRulePropName.label;" flex="1"/>
      <splitter class="tree-splitter"/>
      <treecol id="olcPropValue" label="&styleRulePropValue.label;" flex="1"/>
    </treecols>
    <treechildren id="olbStyleProps"
                  alternatingbackground="true"
                  ondblclick="viewer.pane.panelset.execCommand('cmdEditEdit')"/>
  </tree>

</page>
