Wait Cursor -from a customized DITA (inert Image dialog)
Posted: Thu Sep 29, 2022 10:21 am
Hello Team,
We have our own customized framework where we have customized the "Insert Image " Dialog , which will will talk to our oxygen plugin to get the image details , during this process we have implemented a wait cursor functionality as below.
and the showWaitCursor() method called inside the custom code of insert image as below
the method showWaitCursor(); being called and printing the sysouts
the first sysout printed as --------------> 1--frame0
the second sysout printed as ---------> 2---null
but this never Showing Waitcursor or busy cursor until the operation finishing.
please suggest what are we doing wrong here?
We have our own customized framework where we have customized the "Insert Image " Dialog , which will will talk to our oxygen plugin to get the image details , during this process we have implemented a wait cursor functionality as below.
and the showWaitCursor() method called inside the custom code of insert image as below
Code: Select all
JFrame oxygenFrame = (JFrame) authorAccess.getWorkspaceAccess().getParentFrame();
final InsertImageDialog dialog = new InsertImageDialog(oxygenFrame);
dialog.addURLButtonActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
ourCusrsorJavaClass.showWaitCursor();
xxxxDTO xxxdto=xxxx.methodInvokingtogetImagetoInsert();
dialog.setURL(xxxdto.getImageId());
}
catch (Exception var5) {
}
finally {
ourCusrsorJavaClass.showDefaultCursor();
}
}
});
}
});
public static void showWaitCursor() {
JFrame mainFrame =(JFrame) ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().getParentFrame();
System.out.println("1--"+ mainFrame .getName());
mainFrame .setCursor(Cursor.getPredefinedCursor(3));
Component[] components = mainFrame .getComponents();
Component[] allCoponents = components;
int allCoponentsLength = components.length;
for(int eachComponent = 0; eachComponent < allCoponentsLength; ++eachComponent) {
Component component = allCoponents[eachcomponentonent];
component.setEnabled(false);
System.out.println("2---"+ component.getName());
}
}
the first sysout printed as --------------> 1--frame0
the second sysout printed as ---------> 2---null
but this never Showing Waitcursor or busy cursor until the operation finishing.
please suggest what are we doing wrong here?