On 12/14/2012 09:48 AM, Philippe Nobili wrote:
Below, 3 short questions
Short but difficult.
related to XXE styling & customization (5.4.1);
many thanks for your advices.
Best regards.
Philippe.
1. We have designed a small XXE-addon to edit one of our XML dialects;
in our dialect, all elements are identified by their @Name attribute.
We want to provide our authors (software developers in this case) a fast
an convenient way to search for a given element by its name. We know
about the attribute search tools, but it too generic and not
straightforward to use (one has to "XML-aware", know about the attribute
name, etc etc. The tool is closed after each search).
So we plan to develop a *tailored search feature *easily accessible from
the GUI when editing files of this dialect; this feature would naturally
call the xpathSearch (e.g. //*[@Name = something) behind the scene.
Is is possible to add such a tool with a simple customization of the XXE
toolbar,
Yes. Add a <button> child to the <toolBar> element of your XXE
configuration file. See
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/toolBar.html
This button would invoke a macro. This macro would call:
* Command prompt:
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/prompt.html
Or command pick (supports auto-completion):
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/pick.html
* Then, command xpathSearch:
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathSearch.html
or do we have to write Java code and a XXE GUI customization ?
(we would like to avoid if at all possible).
Not necessarily. A well-written interactive macro should be able to do
the trick.
2. We have two different views for editing the content of our files,
depending on the presence of some elements within the file, it's better
to use one or another. Is there a way to automatic select the default
views depending on the file's content ?
Yes, but you'll have to write an OpenedDocumentHook in Java for that:
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHook.html
The OpenedDocumentHook is registered with XXE by the means of a
customize.xxe_gui file. See:
http://www.xmlmind.com/xmleditor/_distrib/doc/gui/openedDocumentHook.html
(something similar to the detect
mechanism for triggering the add-ons).
No because the feature you describe is rarely needed.
3. The last one is related to CSS-styling; in our graph-view, element
names are rendered using text fields in a hierarchical graph view; below
a short screen capture to help you visualize:
We would like to make those text-field thin and and discrete in this
view, at least avoiding having a different background color for them.
The following:
text-field(attribute,"Name",background-color,transparent)
Does not seem to work (specifying another background-color works OK, but
changes the color for all text fields in the view even those used in
different elements...).
This is clearly a bug.
Is there a way to assign a transparent
background color to text fields ?
"background-color,transparent" or at least, "background-color,inherit",
should work. That makes 2 bugs.
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support