Question about accessing view from selection plugin
Oxygen general issues.
-
- Posts: 3
- Joined: Mon Nov 12, 2012 9:57 pm
Question about accessing view from selection plugin
I have a question that comes in two parts. We have two plugin extensions, a selection and a workspace access. Currently we are using the workspace access to create a menu, and the selection plugin to manage selection actions.
We would like one of those selection actions to show a customized view, and then the user will interact with that view and it will perform an action based on the selection.
I'm having trouble figuring out how to interact with that view programmatically from the selection plugin extension.
Should I just have one plugin extension that implements both the WorkspaceAccessPluginExtension and the SelectionPluginExtension interfaces or is there a way to access a view through the api?
Thank you for your help.
We would like one of those selection actions to show a customized view, and then the user will interact with that view and it will perform an action based on the selection.
I'm having trouble figuring out how to interact with that view programmatically from the selection plugin extension.
Should I just have one plugin extension that implements both the WorkspaceAccessPluginExtension and the SelectionPluginExtension interfaces or is there a way to access a view through the api?
Thank you for your help.
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Question about accessing view from selection plugin
Hi,
Please see some answers below:
Basically we considered the Workspace Access plugin as a super set of all other older plugin types.
But we still kept the other plugin types.
So you should have a single plugin (with a single plugin.xml) which has two extensions in it like:
In this way they will be in the same class loader so you will be able to give some static access to the view from the action side.
But the first solution of having everything in the Workspace Access plugin would be more elegant.
Regards,
Radu
Please see some answers below:
Actually a Workspace Access plugin can also contribute contextual menu actions to an opened Text editor, something like:Currently we are using the workspace access to create a menu, and the selection plugin to manage selection actions.
Code: Select all
pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {
/**
* @see ro.sync.exml.workspace.api.listeners.WSEditorChangeListener#editorOpened(java.net.URL)
*/
@Override
public void editorOpened(URL editorLocation) {
WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation, StandalonePluginWorkspace.MAIN_EDITING_AREA);
if(editorAccess != null && editorAccess.getCurrentPage() instanceof WSTextEditorPage) {
((WSTextEditorPage)editorAccess.getCurrentPage()).addPopUpMenuCustomizer(new ro.sync.exml.workspace.api.editor.page.text.TextPopupMenuCustomizer() {
public void customizePopUpMenu(Object popUp, WSTextEditorPage textPage) {
JPopupMenu popupMenu = (JPopupMenu) popUp;
//And you can add to it actions.
}
});
}
}
}, StandalonePluginWorkspace.MAIN_EDITING_AREA);
But we still kept the other plugin types.
If you have two separate plugins, they will have separate Java class loaders so it is hard to interact between them.I'm having trouble figuring out how to interact with that view programmatically from the selection plugin extension.
Should I just have one plugin extension that implements both the WorkspaceAccessPluginExtension and the SelectionPluginExtension interfaces or is there a way to access a view through the api?
So you should have a single plugin (with a single plugin.xml) which has two extensions in it like:
Code: Select all
<extension type="WorkspaceAccess"
class="ro.sync.sample.plugin.workspace.CustomWorkspaceAccessPluginExtension"/>
<extension type="selectionProcessor"
class="ro.sync.sample.plugin.formwords.FormWordsPluginExtension"/>
But the first solution of having everything in the Workspace Access plugin would be more elegant.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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