Excellent! I figured there had to be an easier way.

Thanks. 

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Friday, June 09, 2006 1:11 AM
To: Mark Fletcher
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] Is there a way to change the css stylesheet via a
command?

Mark Fletcher wrote:
> Perhaps there's a better way to do this... but I've created a css 
> stylesheet whose purpose is simply to collapse all the collapsible 
> elements that are normally defined collapsed: no. (Thankfully, XXE's 
> @property-value CSS command makes this a breeze!)  I've made this 
> stylesheet available via the View menu, but I'm wondering if I can 
> somehow attach a key binding to the action of selecting this 
> particular stylesheet?

No, this is not possible. If you really want to do that, you need to
write in Java[tm] a custom action which applies this particular
stylesheet and then, associate a shortcut to this custom action.

IMHO, a better way to do this is to forget about your CSS style sheet
and instead use command "toggleCollapsed" (possibly within a macro).
See
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/toggleCollapsed.h
tml

Here's an example of its use (excerpt of the sample customize.xxe
available as an add-on):

---
  <!-- ================================================================
      Commands related to collapsible views (styled or not)

      Esc / collapses nearest collapsible view if it is expanded and
            expands nearest collapsible view if it is collapsed.

      Esc + expands nearest collapsible view and then, recursively
            expands all its collapsible descendant views.

      Esc - collapses nearest collapsible view and then, recursively
            collapses all its collapsible descendant views.

      Esc 1 is equivalent to Esc - followed by Esc /.
            Very useful just after you open a large document
            to see its outline.

      The ``nearest collapsible view'' is searched like this:

      * Search starts at explicitly selected node if any;
        otherwise at node containing caret.

      * If this node is an element and has a collapsible view, search is
        completed: this view is the ``nearest collapsible view''.

      * Otherwise search continues with the parent of the node.
  ================================================================= -->

  <binding>
    <keyPressed code="ESCAPE" />
    <charTyped char="/" />
    <command name="toggleCollapsed" />
  </binding>

  <binding>
    <keyPressed code="ESCAPE" />
    <charTyped char="+" />
    <command name="toggleCollapsed" parameter="expandAll" />
  </binding>

  <binding>
    <keyPressed code="ESCAPE" />
    <charTyped char="-" />
    <command name="toggleCollapsed" parameter="collapseAll" />
  </binding>

  <binding>
    <keyPressed code="ESCAPE" />
    <charTyped char="1" />
    <command name="toggleCollapsed" parameter="collapseAll+expand" />
  </binding>
---




Reply via email to