Change tabs title when Oxygen starts with opened files
Post here questions and problems related to oXygen frameworks/document types.
Change tabs title when Oxygen starts with opened files
Hi team, currently I'm developing a plugin for Oxygen Desktop 24.1.
I'm implementing the tab title change from Dita Maps Manager when you open a Root Map.
I'm using the setEditorTabText() method from WSEditor class.
It works very well, but if I close and open Oxygen with opened files, the titles of the tabs don't change until I click on them.
I tried to access each file when the editor triggers the editorOpened event using the next code, but it only brings one file.
Do you have any idea how to change the tabs title when Oxygen starts with opened files?
Thanks a lot!
I'm implementing the tab title change from Dita Maps Manager when you open a Root Map.
I'm using the setEditorTabText() method from WSEditor class.
Code: Select all
WSEditor editorPage = oxygenStandalonePluginWorkspace.getEditorAccess(url, DITA_MAPS_EDITING_AREA);
String openedFileTitle = myOwnFunctionToGetTheFileTitle(url);
editorPage.setEditorTabText(openedFileTitle);
I tried to access each file when the editor triggers the editorOpened event using the next code, but it only brings one file.
Code: Select all
URL[] openedFilesUrl = oxygenStandalonePluginWorkspace.getAllEditorLocations(DITA_MAPS_EDITING_AREA);
Thanks a lot!
-
- Posts: 78
- Joined: Wed Jun 22, 2016 2:48 pm
Re: Change tabs title when Oxygen starts with opened files
Post by adrian_sorop »
Hi,
At first glance, this might be listeners issue.
I'm assuming you're installing a ro.sync.exml.workspace.api.listeners.WSEditorChangeListener that handles the changes.
I don't know what methods you implemented, but you could try with editorAboutToBeOpened, editorOpened, editorActivated, editorSelected : https://www.oxygenxml.com/InstData/Edit ... tener.html
Regards,
Adrian S.
At first glance, this might be listeners issue.
I'm assuming you're installing a ro.sync.exml.workspace.api.listeners.WSEditorChangeListener that handles the changes.
I don't know what methods you implemented, but you could try with editorAboutToBeOpened, editorOpened, editorActivated, editorSelected : https://www.oxygenxml.com/InstData/Edit ... tener.html
Code: Select all
oxygenStandalonePluginWorkspace.addEditorChangeListener(new WSEditorChangeListener() {
@Override
public void editorAboutToBeOpened(URL editorLocation) {
}
@Override
public void editorActivated(URL editorLocation) {
}
@Override
public void editorOpened(URL editorLocation) {
}
@Override
public void editorSelected(URL editorLocation) {
}
}, PluginWorkspace.DITA_MAPS_EDITING_AREA);
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Change tabs title when Oxygen starts with opened files
Hi Adrian, thanks for your answer.
Yes, we're using WSEditorChangeListener class to trigger the title change, to be more specific the editorOpened function. Something like this:
And it works fine, but if I close and open Oxygen with opened files, it only updates the current file.
Even if I try to bring all the files, it only gets the current file, omitting the other opened files until I click on them.
I think is because Oxygen doesn't load all the files when it starts
Yes, we're using WSEditorChangeListener class to trigger the title change, to be more specific the editorOpened function. Something like this:
Code: Select all
@Override
public void editorOpened(URL url) {
...
WSEditor editorPage = oxygenStandalonePluginWorkspace.getEditorAccess(url, DITA_MAPS_EDITING_AREA);
String openedFileTitle = myOwnFunctionToGetTheFileTitle(url);
editorPage.setEditorTabText(openedFileTitle);
...
}
Even if I try to bring all the files, it only gets the current file, omitting the other opened files until I click on them.
Code: Select all
public void editorOpened(URL url) {
...
URL[] urls = oxygenStandalonePluginWorkspace.getAllEditorLocations(DITA_MAPS_EDITING_AREA); // Here Oxygen only brings one file, no matter if there are more
for(URL currentUrl : urls) {
WSEditor editorPage = oxygenStandalonePluginWorkspace.getEditorAccess(currentUrl , DITA_MAPS_EDITING_AREA);
String openedFileTitle = myOwnFunctionToGetTheFileTitle(currentUrl);
editorPage.setEditorTabText(openedFileTitle);
}
...
}
-
- Posts: 78
- Joined: Wed Jun 22, 2016 2:48 pm
Re: Change tabs title when Oxygen starts with opened files
Post by adrian_sorop »
Hi,
I undestand that now. Thanks for clarifying this.
https://www.oxygenxml.com/InstData/Edit ... tions(int) returns only loaded editors.
I've added an internal issue to update the javadoc and the site documentation.
Unfortunatelly, there's nothig you can do to change the tab titles if the editors are not loaded.
Regards,
Adrian S.
I undestand that now. Thanks for clarifying this.
You're right.// Here Oxygen only brings one file, no matter if there are more
oxygenStandalonePluginWorkspace.getAllEditorLocations(DITA_MAPS_EDITING_AREA);
[...]
I think is because Oxygen doesn't load all the files when it starts
https://www.oxygenxml.com/InstData/Edit ... tions(int) returns only loaded editors.
I've added an internal issue to update the javadoc and the site documentation.
Unfortunatelly, there's nothig you can do to change the tab titles if the editors are not loaded.
Regards,
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service