Setting the wait cursor in case of pupup menu custom action
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 64
- Joined: Wed Dec 03, 2014 11:25 am
Setting the wait cursor in case of pupup menu custom action
How can I set a wait cursor in case of custom action inserted to the popup menu ?
What I've tried so far:
Thanks
What I've tried so far:
Code: Select all
public void customizeAuthorPopUpMenu(JPopupMenu popUp, AuthorAccess authorAccess) {
AbstractAction custom = new AbstractAction("TEST") {
@Override
public void actionPerformed(ActionEvent e) {
javax.swing.JFrame parentFrame = (JFrame) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame();
parentFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
Thread.sleep(10000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
parentFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
};
popUp.insert(custom, 0);
}
}
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Setting the wait cursor in case of pupup menu custom action
Hi,
The code looks good to me, so when the action is invoked at first it sets the cursor on the main frame to wait_cursor, then the action performs its specific code and then at the end you switch the cursor on the main frame back to the normal cursor.
So doesn't the code work? What's the current behavior you obtain?
Regards,
Radu
The code looks good to me, so when the action is invoked at first it sets the cursor on the main frame to wait_cursor, then the action performs its specific code and then at the end you switch the cursor on the main frame back to the normal cursor.
So doesn't the code work? What's the current behavior you obtain?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 64
- Joined: Wed Dec 03, 2014 11:25 am
Re: Setting the wait cursor in case of pupup menu custom action
I do some additionnal tests.
When I click on the menu item, if my mouse pointer hovers over the tab, the wait cursor appears
If my mouse pointer is just under the tab, cusrosr does not change.
It's seems that the editing area cursor takes priority over the one I set.
Hope this helps.
Regards,
Vincent
When I click on the menu item, if my mouse pointer hovers over the tab, the wait cursor appears
If my mouse pointer is just under the tab, cusrosr does not change.
It's seems that the editing area cursor takes priority over the one I set.
Hope this helps.
Regards,
Vincent
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Setting the wait cursor in case of pupup menu custom action
Hi Vincent,
Indeed the Author panel has its own text I-beam cursor set. And setting a cursor on the parent frame does not impose the same cursor on descendant Swing components.
Maybe you can try to cast this "authorAccess.getEditorAccess().getAuthorComponent()" to a JPanel and set the busy cursor also on it.
Regards,
Radu
Indeed the Author panel has its own text I-beam cursor set. And setting a cursor on the parent frame does not impose the same cursor on descendant Swing components.
Maybe you can try to cast this "authorAccess.getEditorAccess().getAuthorComponent()" to a JPanel and set the busy cursor also on it.
Regards,
Radu
Radu Coravu
<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