<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension-point id="org.tizen.web.browser.preview" name="Tizen Web Browser Preview" schema="schema/org.tizen.web.browser.preview.exsd"/>
   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            id="org.tizen.web.browser.actionSet"
            label="%actionSet.label"
            visible="false">
         <action
               class="org.tizen.web.browser.actions.PreviewAction"
               icon="icons/preview.png"
               id="org.tizen.web.browser.HTMLPreviewAction"
               label="%action.label"
               style="push"
               tooltip="%action.tooltip">
         </action>
      </actionSet>
   </extension>

   <extension
         point="org.eclipse.ui.startup">
      <startup
            class="org.tizen.web.browser.Init">
      </startup>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <category
            id="org.tizen.web.browser.category"
            name="%category.name">
      </category>
      <command
            categoryId="org.tizen.web.browser.category"
            description="%command.description.htmlpreview"
            id="org.tizen.web.browser.commands.HTMLPreview"
            name="%command.name.htmlpreview">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.bindings">
      <key
            commandId="org.tizen.web.browser.commands.HTMLPreview"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+4">
      </key>
   </extension>
   <extension
         point="org.tizen.web.browser.preview">
      <preview
            class="org.tizen.web.browser.view.preview.css.CSSPreviewResourceProvider"
            extension="css">
      </preview>
      <preview
            class="org.tizen.web.browser.view.preview.html.HtmlPreviewResourceProvider"
            extension="html">
      </preview>
   </extension>
   <extension
         point="org.eclipse.ui.preferencePages">
         <page
               category="org.tizen.web.preferences.WebPreferencePage"
               class="org.tizen.web.browser.preference.LiveEditingPreferencePage"
               id="org.tizen.web.browser.preference.PreviewPreferencePage"
               name="%liveediting.preference.page.name">
         </page>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="popup:org.eclipse.ui.popup.any?before=additions">
         <command
               commandId="org.tizen.web.browser.commands.HTMLPreview"
               icon="icons/preview.png"
               label="%command.name.htmlpreview"
               style="push"
               tooltip="%action.tooltip">
            <visibleWhen>
               <or>
                  <with
                        variable="activePartId">
                     <or>
                        <equals
                              value="org.tizen.web.editor.css.CSSEditor">
                        </equals>
                        <equals
                              value="org.tizen.web.editor.html.HTMLEditor">
                        </equals>
                        <equals
                              value="org.eclipse.wst.css.core.csssource.source">
                        </equals>
                        <equals
                              value="org.eclipse.wst.html.core.htmlsource.source">
                        </equals>
                     </or>
                  </with>
                  <and>
                     <count
                           value="1">
                     </count>
                     <iterate>
                        <adapt
                              type="org.eclipse.core.resources.IResource">
                           <or>
                              <test
                                    property="org.eclipse.core.resources.name"
                                    value="*.html">
                              </test>
                              <test
                                    property="org.eclipse.core.resources.name"
                                    value="*.htm">
                              </test>
                              <test
                                    property="org.eclipse.core.resources.name"
                                    value="*.css">
                              </test>
                           </or>
                        </adapt>
                     </iterate>
                  </and>
               </or>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="org.tizen.web.browser.handler.HTMLPreviewHandler"
            commandId="org.tizen.web.browser.commands.HTMLPreview">
         <activeWhen>
            <and>
               <count
                     value="1">
               </count>
               <iterate>
                  <adapt
                        type="org.eclipse.core.resources.IResource">
                     <or>
                        <test
                              property="org.eclipse.core.resources.name"
                              value="*.html">
                        </test>
                        <test
                              property="org.eclipse.core.resources.name"
                              value="*.htm">
                        </test>
                        <test
                              property="org.eclipse.core.resources.name"
                              value="*.css">
                        </test>
                     </or>
                  </adapt>
               </iterate>
            </and>
         </activeWhen>
      </handler>
      <handler
            class="org.tizen.web.browser.handler.HTMLPreviewHandler"
            commandId="org.tizen.web.browser.commands.HTMLPreview">
         <activeWhen>
            <with
                  variable="activePartId">
               <or>
                  <equals
                        value="org.tizen.web.editor.css.CSSEditor">
                  </equals>
                  <equals
                        value="org.tizen.web.editor.html.HTMLEditor">
                  </equals>
                  <equals
                        value="org.eclipse.wst.css.core.csssource.source">
                  </equals>
                  <equals
                        value="org.eclipse.wst.html.core.htmlsource.source">
                  </equals>
               </or>
            </with></activeWhen>
      </handler>
   </extension>

</plugin>
