Jirka,
I didn't see anything wrong with the code the you included. We've been able to
successfully include more than one custom menu in XXE 3.6 using the approach
specified here:
http://xmlmind.com/xmleditor/_distrib/doc/configure/multiple_menus.html
Here is the relevant code that has been working for us:
customize.xxe_gui -------------------------------------------------
<menuItems name="configSpecificMenuItems1">
<class>com.xmlmind.xmleditapp.kit.part.ConfigSpecificMenuItems</class>
<property name="specificationName" type="String" value="insertMenu" />
</menuItems>
<menuItems name="configSpecificMenuItems2">
<class>com.xmlmind.xmleditapp.kit.part.ConfigSpecificMenuItems</class>
<property name="specificationName" type="String" value="tableMenu" />
</menuItems>
<menu name="configSpecificInsertMenu" label="Insert"
helpId="configSpecificMenu1">
<menuItems name="configSpecificMenuItems1" />
</menu>
<menu name="configSpecificTableMenu" label="Table"
helpId="configSpecificMenu2">
<menuItems name="configSpecificMenuItems2" />
</menu>
<menuBar name="menuBar" helpId="menuBar">
<menu name="fileMenu" />
<menu name="editMenu" />
<menu name="configSpecificInsertMenu"/>
<menu name="toolsMenu" />
<menu name="configSpecificTableMenu"/>
<menu name="helpMenu" />
</menuBar>
config.xxe
--------------------------------------------------------------------------
<menu name="tableMenu" label="T_able">
...
</menu>
<menu name="insertMenu" label="_Insert">
...
</menu>
Cheers,
Mike
-----Original Message-----
From: xmleditor-support-bounces at xmlmind.com on behalf of
[email protected]
Sent: Thu 6/7/2007 5:00 AM
To: xmleditor-support at xmlmind.com
Subject: XMLeditor-Support Digest, Vol 40, Issue 8
Send XMLeditor-Support mailing list submissions to
xmleditor-support at xmlmind.com
To subscribe or unsubscribe via the World Wide Web, visit
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
or, via email, send a message with subject or body 'help' to
xmleditor-support-request at xmlmind.com
You can reach the person managing the list at
xmleditor-support-owner at xmlmind.com
When replying, please edit your Subject line so it is more specific
than "Re: Contents of XMLeditor-Support digest..."
Today's Topics:
1. RE: mouse listener on css extension (Santy, Michael)
2. Eclipse Plug-in (Reed Elliott)
3. Two custom menus in XXE 3.6 (Jirka Kosek)
----------------------------------------------------------------------
Message: 1
Date: Wed, 6 Jun 2007 09:53:34 -0500
From: "Santy, Michael" <[email protected]>
Subject: RE: [XXE] mouse listener on css extension
To: <xmleditor-support at xmlmind.com>
Message-ID:
<6703815B292B664DBAEC55EE3192386A11654F at poseidon.in.dynetics.com>
Content-Type: text/plain; charset="iso-8859-1"
Hussein,
The Gadget approach is *exactly* what I'm needing.
I was able to implement a subclass of TextLabelVP, return it from a
implementation of GadgetFactory, and setup a CSS rule to include it in the
editor. It behaved visually like I would expect, however I could not get it to
respond to any events. I implemented the grabsMouseButton and handleMouseEvent
as the documentation specified, but neither of these methods were ever being
called. I even overrode the focusGained and focusLost method to see if this
gadget was responding to any editor events, and neither of these methods are
ever being called as well.
Below is a listing of the relevant code. The print statement in the MyGadget
constructor is being called and the gadget is included in the document. When I
double-click on the "My Gadget" label in the document, nothing happens.
Can anyone please shed some light on what I might be doing wrong?
Cheers,
Mike
public class MyGadgetFactory implements GadgetFactory {
public Gadget createGadget(StyledElementView view, int role, Style style,
StyleValue[] parameters, StyledViewFactory viewFactory) {
return new MyGadget(style, "My Gadget", view, role);
}
}
public class MyGadget extends TextLabelVP {
public MyGadget(Style style, String text,
StyledElementView view, int role) {
super(style, text, view, role);
Node node = view.getModel();
System.err.println("MyGadget::MyGadget() node: "+node);
}
public boolean grabsMouseButton(MouseEvent e) {
System.err.println("My::grabsMouseButton()");
boolean rv = false;
if(MouseEvent.BUTTON1==e.getButton() && 2==e.getClickCount()) {
rv = true; //double left-click
}
return rv;
}
public void handleMouseEvent(MouseEvent e) {
System.err.println("MyGadget::handleMouseEvent()");
}
}
-----Original Message-----
From: Hussein Shafie [mailto:[email protected]]
Sent: Wed 6/6/2007 3:01 AM
To: Santy, Michael
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] mouse listener on css extension
Santy, Michael wrote:
>
> In my application, I have written a CSS extension to render a set of
> attributes on a single node in a very specialized way that cannot be
> done in pure CSS. The CSS extension returns the desired textual
> representation as intended.
>
> These attributes will be edited when a user double clicks on content
> returned from the CSS extension. I'm having trouble figuring out how to
> bind mouse clicks to the StyleValue returned by a CSS extension.
You cannot do that: style sheet extensions and user input such as
double-clicks are totally unrelated concepts.
> The only way that I've seen as a possibility is to replace the CSS
> extension with a ComponentFactory. This ComponentFactory would have to
> return a JLabel that has a mouse listener registered that opens the
> custom dialog on a double click.
>
> Is there a more straightforward approach that I'm overlooking?
Using a standard Java[tm] AWT/Swing Component created using a
ComponentFactory (rather an style extension) is certainly a clean and
simple way to achieve what you want.
http://www.xmlmind.com/xmleditor/_distrib/doc/dev/styleext.html#solution4
http://www.xmlmind.com/xmleditor/_distrib/doc/dev/styleext.html#solution1
(You could create a Gadget using a GadgetFactory, which is much more
efficient than creating a Component, but doing so is not documented and
is not officially supported:
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/gadget/Gadget.html
Use the grabsMouseButton and handleMouseEvent methods to do something
when the Gadget is double-clicked.
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/styledview/GadgetFactory.html
Gadgets returned by GadgetFactory must implement the
StyledElementViewPart interface.
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/styledgadget/TextLabel.html
TextLabel is a simple styled Gadget
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/styledview/TextLabelVP.html
TextLabelVP is a TextLabel which implements the StyledElementViewPart
interface.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070606/f6a3f099/attachment-0001.html
------------------------------
Message: 2
Date: Wed, 6 Jun 2007 15:48:43 -0500
From: "Reed Elliott" <[email protected]>
Subject: [XXE] Eclipse Plug-in
To: <xmleditor-support at xmlmind.com>
Message-ID:
<8B84B230AC656E4A890AF90FF9DA8F7B11001A at madison.ElliottLogic.office>
Content-Type: text/plain; charset="iso-8859-1"
My company is currently using Altova's XMLSpy to create custom XML Schemas for
our documents. We then use Altova's StlyeVision to create an sps file so that
users can create validated XML documents using Altova's Authentic. We like the
end results of our current system (clean XML files) but do not like the API to
Altova's tools or the fact that the Altova tools only run on Windows. We are
in the process of standardizing on Eclipse for Java and C development and would
like to have an XML Editor similar to Authentic or XMLMind run in Eclipse. The
following are my questions:
* Do you have plans to migrate XMLMind's XML Editor to Eclipse?
* Can we create custom Schema's and CSS and then use XMLMind to create,
validate and edit the documents in a word processor type environment?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070606/314848a9/attachment-0001.html
------------------------------
Message: 3
Date: Thu, 07 Jun 2007 10:23:22 +0200
From: Jirka Kosek <[email protected]>
Subject: [XXE] Two custom menus in XXE 3.6
To: "xmleditor-support at xmlmind.com" <xmleditor-support at xmlmind.com>
Message-ID: <4667C07A.8030405 at kosek.cz>
Content-Type: text/plain; charset="iso-8859-2"
Hi,
I'm now porting XXE customization from XXE-std 3.3 to XXE-pro 3.6. My
customization uses two custom menus. In 3.3 I had file custom.xxe_gui
which defined place for new menu as:
<menuItems name="configSpecificMenuItems2">
<class>com.xmlmind.xmleditapp.kit.part.ConfigSpecificMenuItems</class>
<property name="specificationName" type="String" value="menu2" />
</menuItems>
<menu name="configSpecificMenu2" label="XML2">
<menuItems name="configSpecificMenuItems2" />
</menu>
<menuBar name="menuBar" helpId="menuBar">
<menu name="fileMenu" />
<menu name="selectMenu" />
<menu name="editMenu" />
<menu name="searchMenu" />
<menu name="viewMenu" />
<menu name="toolsMenu" />
<menu name="configSpecificMenu" />
<menu name="configSpecificMenu2" />
<menu name="windowMenu" />
<menu name="optionsMenu" />
<menu name="helpMenu" />
</menuBar>
and then *.xxe file I simply attached menu to this new
configSpecificMenu2 placeholder by using:
<menu label="_Table" name="menu2">
...
But this doesn't work anymore in 3.6, menu2 is never displayed. I
studied documentation and it seems that ability to customize GUI was
improved and changed since 3.3. What is the easiest way to simulate 3.3
behaviour in new 3.6 version? I haven't been successful yet.
Thanks,
Jirka
--
------------------------------------------------------------------
Jirka Kosek e-mail: jirka at kosek.cz http://xmlguru.cz
------------------------------------------------------------------
Professional XML consulting and training services
DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------
Be in, register for XML Prague 2007 today! http://www.xmlprague.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070607/78c6e39b/signature-0001.pgp
------------------------------
--
XMLmind XML Editor Support List
xmleditor-support at xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
End of XMLeditor-Support Digest, Vol 40, Issue 8
************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070607/9c0b11be/attachment.htm