Custom URL Chooser Issue
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 42
- Joined: Mon Aug 18, 2014 11:50 pm
Custom URL Chooser Issue
Can someone help me troubleshoot my issue with a Custom URL chooser? I have created a custom URL chooser and it works for the most part when using the open URL or insert functions. If however I call the URL choosers from a properties editor (the thing that pops up when you click on an opening tag) it doesn’t quite work.
I have a custom modal JDialog that I create and then show. My code always blocks until I have selected a path in my dialog as it should. When calling the URL choosers from a properties editor, as soon as I set my custom JDialog to visible, the properties editor and brow dialog disappear and will never get the URL chosen.
The action code essentially looks like this:
I have a custom modal JDialog that I create and then show. My code always blocks until I have selected a path in my dialog as it should. When calling the URL choosers from a properties editor, as soon as I set my custom JDialog to visible, the properties editor and brow dialog disappear and will never get the URL chosen.
The action code essentially looks like this:
Code: Select all
Action TFS_browse_Action = new AbstractAction("CMS") {
URL url;
@Override
public void actionPerformed(ActionEvent arg0) {
Frame frame = (Frame) pluginWorkspaceAccess.getParentFrame();
final JDialog temp = new JDialog(frame, "CMS File Chooser", true);
temp.setVisible(true);
if(url != null)
fileChooser.urlChosen(url);
}
};
-
- Posts: 42
- Joined: Mon Aug 18, 2014 11:50 pm
Re: Custom URL Chooser Issue
Hum, looks like I was able to get it to work by casing the frame to a window and using the JAVA document modal. Not sure if it’s the correct way though.
Code: Select all
new JDialog((Window)frame, "Searching", ModalityType.DOCUMENT_MODAL);
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Custom URL Chooser Issue
Post by alex_jitianu »
Hello,
The properties dialog is a non modal dialog. It also has a custom behavior to automatically hide when it loses focus to a component outside its hierarchy. I think that's what is happening in your case. You should be able to fix it by using the focused window as the parent for your dialog:
Best regards,
Alex
The properties dialog is a non modal dialog. It also has a custom behavior to automatically hide when it loses focus to a component outside its hierarchy. I think that's what is happening in your case. You should be able to fix it by using the focused window as the parent for your dialog:
Code: Select all
Window parentWindow = (Window) pluginWorkspaceAccess.getParentFrame();
Window focusedWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
if (focusedWindow != null) {
parentWindow = focusedWindow;
}
JDialog temp = new JDialog(parentWindow , "CMS File Chooser", true);
Alex
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