Thanks very much Hussein.

Cheers
Darryl

----- Original Message -----
From: Hussein Shafie <huss...@xmlmind.com>
Reply-To: <xmleditor-support@xmlmind.com>
To: Darryl Young <darr...@bluestream.com>
Cc: 'xmleditor-support@xmlmind.com' <xmleditor-support@xmlmind.com>
Sent: 07/20/2019 12:28:06 AM
Subject: Re: [XXE] Name displayed on the file tabs in XXE
________________________________________________________________________________

=================================================================================
The answer below applies to XXE v9. From your screenshot, we see that 
you are using a quite old version of XXE.

Excerpts from "Support policy", 
https://www.xmlmind.com/xmleditor/support_policy.html
---
We support only the last major version of the software.
---

As a proof of our good will, we'll answer your question, but unless you 
upgrade, this will be the last time we do so.
=================================================================================



On 07/19/2019 03:44 PM, Darryl Young wrote:
> Please take a look at the names on the 2 file tabs in the attached
> screen shot.
>
> This shot was taken using connected XXE, where the following situation
> applies:
> - The first tab on the left is for a file that was launched from XDocs
> Explorer, and you will note that the name displayed has our internal
> resource
>    lineage-branch-language ID form "oil_xi456_1_1.xml".
> - The second tab is for a file that was opened by browsing the CMS
> repository from within XXE (where the branch and language have already
> been set at login time),
>    and the name displayed is simply "paint.xml".
>
> When launching from Explorer, it is currently necessary to pass an ID
> that contains the branch and language of the file being launched into
> XXE because it may be an initial launch when XXE is closed,
> and I need a way to set the branch and language (using the current design).
>
> *Here is my question...*
> *Is there any way for me to programmatically affect the name that is
> displayed on the file tab after the file URI is passed to the
> doConnect(URI uri, int timeoutMillis) method of my "Drive" class,*
> *or does XXE simply remember this URI and take the name from there, with
> no way of altering the name? *
>

A document tab displays: 
com.xmlmind.xmleditapp.kit.OpenedDocument.getName(). See 
https://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#getName--

The default name indeed comes from the URI passed to 
com.xmlmind.xmleditapp.kit.OpenedDocument.open() and newFromTemplate().

Therefore you must use 
com.xmlmind.xmleditapp.kit.OpenedDocument.setName(String) to specify an 
alternate name. See 
https://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#setName-java.lang.String-

While at it, you'll also want to use:

- OpenedDocument.setShortLabel(String). See 
https://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#setShortLabel-java.lang.String-

- OpenedDocument.setLabel(String). See 
https://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#setLabel-java.lang.String-

But when and where this can be done? The answer is: in 
ancom.xmlmind.xmleditapp.kit.OpenedDocumentHook you have registered with 
XXE. See 
https://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHook.html

Sample customize.xxe_gui registering "com.bluestream.xxe.MyHook" with XXE:
---
<gui xmlns="http://www.xmlmind.com/xmleditor/schema/gui";
      xmlns:gui="http://www.xmlmind.com/xmleditor/schema/gui";>

   <openedDocumentHook name="myHook">
     <class>com.bluestream.xxe.MyHook</class>
   </openedDocumentHook>

   <layout>
     <hidden>
       <insert />
       <openedDocumentHook name="myHook" />
     </hidden>
   </layout>

</gui>
---

More info in "XMLmind XML Editor - Customizing the User Interface", 
https://www.xmlmind.com/xmleditor/_distrib/doc/gui/index.html

--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
https://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to