That is exactly what I ended up doing.  I realized very quickly that my
DummyOpenAction wasn't going to work out the first time I tried to launch
the editor.

Thanks for the followup!

Cheers,
Mike


On 5/30/07 2:56 AM, "Hussein Shafie" <hussein at xmlmind.com> wrote:

> In fact, a few hours after sending my answer, I wondered if my answer
> was really correct.
> 
> An action called "openAction" implementing the OpenDocumentAction
> interface is really needed if you want to be able to open documents in XXE.
> 
> This action is used not only in the "File|Open" menu item (that you have
> removed) but also when the document to be opened is specified as a
> command line argument (may be you did that in Java Web Start's .jnlp file).
> 
> Therefore a wiser answer would be:
> 
> [1] Keep:
> 
>   <action name="openAction" label="_Open..."
>           icon="icons/openAction.gif"
>           accelerator="mod O">
>     <class
>       implementsCommand="XXE.open"
>> com.xmlmind.xmleditapp.kit.part.OpenAction</class>
>   </action>
> 
> That is, do not define a *dummy* "openAction". Keep the original
> com.xmlmind.xmleditapp.kit.part.OpenAction even if you don't use it in
> "File|Open".
> 
> [2] Remove:
> 
>     <action name="openAction" />
> 
> from:
> 
>   <menu name="fileMenu" label="_File"
>         helpId="fileMenu">
> 
> 
> [3] Declare:
> 
>       <action name="openAction" />
> 
> in the <hidden> element.
> 
> That is:
> ---
>    ...
>    <!-- Layout ================================================== -->
> 
>    <layout>
>    ...
>      <hidden>
>        ...
>        <action name="openAction" />
>      </hidden>
>    </layout>
>  </gui>
> ---
> 
> 
> 
> Mike Santy wrote:
>> Works great.  Thanks Hussein!
>> 
>> 
>> On 5/29/07 8:46 AM, "Hussein Shafie" <hussein at xmlmind.com> wrote:
>> 
>>> Santy, Michael wrote:
>>>> 
>>>> I'm building a customized XXE that will be packaged as a webstart app.
>>>> When XXE is launched via Webstart, the JNLP descriptor specifies which
>>>> file to open.  Because of this, I want to remove the "Open" menu item
>>>> from the file menu.  When I do so, I get the error:
>>>> 
>>>> 'command triggered by "drop" is unknown'
>>>> 
>>>> This appears me to be that dragging and dropping a file into XXE
>>>> attempts to open the file with "openAction".  Is there any way to
>>>> disable both methods ("File | Open" & DnD) of opening a file?
>>>> 
>>> --> The simplest is to add this to your .xxe_gui file:
>>> 
>>> <action name="openAction">
>>>  <class>com.dynetics.xxe.DummyOpenAction</class>
>>> </action>
>>> 
>>> where com.dynetics.xxe.DummyOpenAction is an action which does nothing
>>> at all. Something like:
>>> 
>>> public class DummyOpenAction extends AppAction
>>>                             implements OpenDocumentAction {
>>>    public void doIt() {}
>>>    public void updateEnabled() {}
>>> 
>>>    public boolean openDocument(URL url) {
>>> return false;
>>>    }
>>> }
>>> 
>>> See
>>> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit
>>> /A
>>> ppAction.html
>>> 
>>> Note that this action implements the OpenDocumentAction interface.
>>> See
>>> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit
>>> /O
>>> penDocumentAction.html
>>> 
>>> 
>>> 
>>> --> At the end of your .xxe_gui file, in the <hidden> element, do not
>>> forget to add a reference to the dummy action aclled "openAction":
>>> 
>>> ---
>>>  ...
>>>  <!-- Layout ================================================== -->
>>> 
>>>  <layout>
>>>  ...
>>>    <hidden>
>>>      ...
>>>      <action name="openAction" />
>>>    </hidden>
>>>  </layout>
>>> </gui>
>>> ---
>>> 
>>> See http://www.xmlmind.com/xmleditor/_distrib/doc/gui/hidden.html
> 


Reply via email to