How do I navigate from panel to panel in console mode of install4J installer? - install4j

well, all is in the title.
In InstallAnywhere when in console mode you type back or next or quit. I haven't seen something like this in install4j.
Thanks,
X.

In install4j, console mode shows the user interface as a continuous stream of questions and so it's not organized into separate screens.
However, the installer has a "Console screen change handler" property where you can implement something like that. For example with code like
if (context.getBooleanVariable("showConsoleNavigation")) {
if (console.askYesNo("Do you want to repeat the last step?")) {
context.goBackInHistory(1);
} else {
console.println("* " + title);
}
}
You would set the installer variable "showConsoleNavigation" to Boolean.TRUE once you want to start the navigation.

Related

Custom button for toolbar Eclipse RCP Application

I am currently working on a web browser application using Eclipse e4.
I want to put on the toolbar a toggle button for saving my favorites url's.
I want it to be like in Google Chrome , a star which gets the yellow color when it's pressed(the link was added to favorites).
How can I do this?
Should I use for this the Application.e4xmi ?
You can use the Application.e4xmi if this is a tool bar for a Window or a Part. You would use a 'Handled Tool Item' in the tool bar.
The Application.e4xmi does not provide a way to set separate icons for the selected and normal states of a tool item so you will have to do this in the handler class. Something like:
#Execute
public void execute(MToolItem mitem)
{
if (mitem.isSelected())
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/selectedimage.png");
else
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/unselectedimage.png");
// TODO other code
}

Get control of an existing open window using Teststake White

For some reason, TestStake.White is not able to open an old windows application (which i can successfully run(win 7) by doubliclicking on the exe). I want to use an existing window to perform some action using White. I have no idea as to how to take control of an already opened window using White.
I tried to open the exe using batch command, but I still couldn't get any success. It shows me a yellow screen(app background) with no mouse control. Hence I want to launch the app manually and perform some automation actions on it.
If you know the text in the title bar of the window:
using TestStack.White;
public static class Demo
{
public static Window GetWindow(string windowTitle)
{
var window = Desktop.Instance.Windows().FirstOrDefault(x => x.Name == windowTitle);
}
}

Dock "Turn Hiding On" programmatically from within an app

If you secondary-click on the Dock you can click the Turn Hiding On option to automatically hide the Dock. Alternatively, you can go to System Preferences > Dock and click the Automatically hide and show the Dock.
I want to mimic that functionality from within an app I am making (which is basically a status bar icon app) and preferably in Swift.
The code I have written so far to turn on the Dock Automatic Hiding functionality is the following:
// Update the value for key "autohide" in com.apple.dock.plist, located in ~/Library/Preferences/.
var dict = NSUserDefaults.standardUserDefaults().persistentDomainForName("com.apple.dock")
dict.updateValue(true, forKey: "autohide")
NSUserDefaults.standardUserDefaults().setPersistentDomain(dict, forName: "com.apple.dock")
// Send notification to the OS.
dispatch_async(dispatch_get_main_queue()) {
CFNotificationCenterPostNotification(CFNotificationCenterGetDistributedCenter(), "com.apple.dock.prefchanged", nil, nil, true)
}
The first part of the code updates a value in a plist file and I have confirmed that that is working. The second part sends a notification to the OS to tell it that a value has been changed in that plist, which I have also confirmed to be working.
However, these two things are not making the Dock hide, making me believe I need to do something else. Or made my approach to the problem is wrong? How do I make the Dock start hiding?
PS: I have read something about a private, undocumented API called CoreDock, but I would like to avoid going that way, as it may cause many problems...
Almost certainly better to use AppleScript or the Scripting Bridge to do this. The following script turns Dock autohiding on:
tell application "System Events"
set autohide of dock preferences to true
end tell
You can run that using NSAppleScript.

"Console" output on Installation screen?

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);

How to unload js script when going to next tab in jquery?

I have a site with five tabs using jquery-ui. Each loads an individual jQuery script. Now when I have loaded the second tab and go to the third tab the js out of the second tab still remains active and disturbs my actions in the third tab space.
Can someone explain me why the js out of the second tab still stays active when changing to the third tab and how I can avoid such behaviour?
Once you have loaded a script onto the page, it remains active until the page refreshes.
I don't know about unloading, but you can certainly disable the actions of a certain script depending on what it is. Could you post an example of the script causing the issues?
EDIT:
For example, if you have a script that is dependent on the tab you are in, you can condition the actions in the script with the tabs being at a certain index. A demo syntax:
//will only execute action if you are in current tab
if(tabs_ui_index == 0){
//do something
}
to get that variable (tabs_ui_index) you can do something like this:
$('#mytabs').bind('tabsselect', function(event, ui) {
tabs_ui_index = ui.index;
});
This code binds a "tabsselect" event to the element that is tabbed and sets the variable to the currently indexed tab every time a user changes a tab.
Also, you can unbind events, if you loaded a script that set a click event for a button that no longer exists, or that you are using for a different purpose now:
$("#mybutton").unbind("click");
I hope this helps. Let me know if you have any other questions.