I want the change Display Progress highlighted steps when proceeding to next actions within the same screen.
I tried the following java scripts to run after each action:
context.goForward(1, true, true);
or
context.getWizardContext().setWizardIndexKey("2");
But the steps wouldn't change. They change only when next screen is displayed.
Up to install4j 7.0.3, wizard steps can only change when the screen changes.
Thanks to your feedback, it will be possible in install4j 7.0.4 to call WizardContext#setWizardIndexKey and WizardContext#setWizardIndex in actions or form component event handlers with the intended effect.
Related
I have an issue with setting value of AutomationElement by using method ValuePattern.SetValue().
Everything works just fine until some dialog appears. When the dialog appears the code execution got stuck. No exception is thrown. After the dialog is confirmed, the code exection continues. Bellow is a sample of the code:
BasePattern basePattern = null;
ValuePattern valuePattern = null;
AutomationElement elementA = Window.GetElement(SearchCriteria.ByText(propertyName));
object patternObjectA = null;
elementA.TryGetCurrentPattern(ValuePattern.Pattern, out patternObjectA);
basePattern = (BasePattern)patternObjectA;
valuePattern = (ValuePattern)patternObjectA;
valuePattern.SetValue(optionToSet);
// Window.GetElement() is a method from TestStack.White framework
// The code execution got stuck on the last line until the dialog is confirmed
Is there any other way to set AutomationElement value?
Is somehow possible to avoid of getting stuck by dialog?
I'll by grateful for any help.
Thanks advance.
It could be that this dialog is not supporting UI Automation correctly or that you simply target the wrong element.
To verify that you may use Inspect.exe from Microsoft or similiar tools.
If it works, check if you really target the correct component with your code again.
If it does not work and:
if you are able to change the application
you can change the so called AutomationPeer of the UI component - here is a link for more infos
Or simply use another UI component that supports UI Automation correctly.
if you are not able to change the application, and also do not need to run in background, parallel, etc.. you might just focus the component (call setFocus() onto the AutomationElement, or expand it (via IsExpandCollapsePatternAvailable or simulated MouseClick onto the components coordinates)) and then use the SendKeys.SendWait("test") method.
EDIT: There is one more thing you should have a look at, and I wonder why I didn't mentioned it in the first place: Register to UI Automation Events
For example you could register a callback for the Structure change event type, and check if the dialog you talk about appeared.
If so --> click the confirmed button of the dialog.
Probably you will have to synchronize your execution, so that every further action in the UI Automation script waits until the registered callback got executed and the confirmed button got clicked.
I am trying to remove the 'Details' button from the following ProgressMonitorJobsDialog:
I am running a org.eclipse.core.runtime.jobs.Job that opens the default Dialog. I have seen examples here of disabling the Cancel button, but I need to remove the third one and extending the default ProgressMonitorJobsDialog won't help, since it is invoked by the default UIJob class. Any ideas?
This dialog is usually ProgressMonitorFocusJobDialog displayed by ProgressManager. It isn't really possible to change the dialog without using internal APIs.
Instead of a Job you could use an IRunnableWithProgress and use ProgressMonitorDialog to run it. This dialog does not have the Details section.
Is it possible to disable the "Cancel" button in the progress dialog
displayed when a job is running?
I still want to maintain the functionality to show to user about progress in the job to the background. Letting the job run or
canceling it has no effect on the GUI, as it starts a task on a remote
server, which does not support cancellation/stopping the task, once started.
I cannot use setSystem(true) since I want to show the progress to the user.
There is bug reported even in Eclipse Bugzilla but there isnt any update
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155479
Trying to figure out if this issue is fixed or not.
If not how do we handle such scenario.
Any help appreciated.Thank you.
That bug is still open and has not been fixed.
I think the nearest you can get is to use ProgressMonitorDialog to run an IRunnableWithProgress class. You can set the cancelable state of ProgressMonitorDialog.
Something like:
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
dialog.setCancelable(false);
dialog.run(true, true, runnableWithProgress);
at the moment we use the Installation screen to display the installation progress and the currently running action (e.g. "Installing step 4").
As an additional information we would like to present the user informations, what happend before, e.g.:
Installed step 1 - ok
Installed step 2 - ok
Installed step 3 - ok
To do this we would need some kind of console (e.g. a text field / area) on the Installation screen below the progress bar. Is there a chance to do this?
Thanks!
Frank
Currently that's not easily possible. You could extend com.install4j.runtime.beans.screens.InstallationScreen and override the method protected void addScreenContent(JPanel panel, GridBagConstraints gc) to add more visual elements.
Update:
As Frank pointed out, you can just use a customizable form screen and add a "Progress display" component to it. In the "Post-activation script" property you would have to switch to the next screen automatically by calling
context.goForward(1, true, true);
could someone please tell me how to disable cancel button in a job's progress entry in Progress View tab in eclipse rcp application. i have not been able to locate any references on the web aside from the ones that suggest the use of ProgressMonitorDialog. using the dialog, however, is not an option, as the Progress View must remain in a form of a view.
i have come upon ProgressMonitorPart, which sounds like something that i can use. if that is the case, how do i go about passing it to Job.run(IProgressMonitor)?
thank you for your time!
You don't. You can call Job#setSystem() on your Job so it's hinted as not to be shown, but you don't get to spin off jobs that the user can't at least ask you to cancel. The stop button does little more than set the progress monitor as having been canceled--it's still up to your running Job to check the progress monitor and behave itself. Or not.
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fruntime_jobs_progress.htm