Opening a presenter in a new window in GWTP - uibinder

Currently, i have to implement a print functionality. I had used a pop up presenter on click of a print button, to print the contents of only the pop up panel. but its also printing the contents of the background of the popup panel. Is there any way, for opening a presenter in a new browser window other than pop up? please let me know..

You could try the following when you press Print:
String url = Window.Location
.createUrlBuilder()
.setHash(yourPrintingPresenterToken).buildString();
Window.open(url, "_blank", null);
You have to transfer your current state to the new presenter somehow, possibly with parametrized token.

Related

Helo finishing this simple java FX GUI

can anyone help me with this code I am kind of having difficulty with it.
it's this:
1.) Create a simple Java FX Form. It will have 3 Buttons that read “Open”, “Close”, “Exit”.
2.) Each button should display the appropriate message based on button name. For example, Open button should show a message “Open button clicked”
3.) Execute the program and capture the screen showing the results after each button is selected and message is displayed.
I tried to start it out with public static void main string args, but that's it.

Modal dialogs breaking responder chain in mac catalyst scene based app

I have a multi-window scene-based (not SwiftUI) iPad app that I am adapting for Mac using mac catalyst. I am having trouble with the main menu behavior. The menu is built in AppDelegate.swift using func buildMenu(). I have, for example, an Open Image... menu item that uses a selector in my main view controller. Here is the code in buildMenu():
let openFileCommand = UIKeyCommand(
title: "Open Image...",
action: #selector(DiagramViewController.openImageFile(_:)),
input: "o",
modifierFlags: [.command]
)
let openFileMenu = UIMenu(
title: "",
image: nil,
identifier: UIMenu.Identifier("openImage"),
options: .displayInline,
children: [openFileCommand]
)
builder.insertSibling(openFileMenu, afterMenu: .newScene)
It is enabled and works fine when first opening the view controller. See:
I then open any modal dialog, for example, the About dialog, and after closing it, the Open Image... menu item is deactivated, as if the selector is no longer in the responder chain, though everything works on the view controller.
I don't understand what is going on here. This kind of functionality works fine on a non-multi-window catalyst app.
UPDATE: Well the problem has nothing to do with the app being scene-based. It is a UIDocument based app, and the UIDocumentBrowserViewController presents the main view controller modally. The main view controller is then the first responder and everything is fine, but as soon as you open another modal window on top of it, like the system generated About dialog, the original document browser view controller becomes the first responder and the main view controller is no longer in the window hierarchy (even though the document browser view controller is invisible, and the main view controller is still shown and works normally). If anyone has experience with dealing with this issue, I'd appreciate their advice.
With further experimentation, and given that this is a UIDocument based app, it looks like the document browser view controller becomes the first responder after the dialog closes. So I think I can work around that and forward actions form the document browser to the main view controller.

how to open unread tab in firefox extension?

is there a way to open a new tab in firefox plugin but without loading it? When I do something like this new tab is opened, but it is immediately loaded with content:
var tabs = require("sdk/tabs");
tabs.open("http://www.example.com");
I'd like to open a set of tabs but keep them unread until user actually activates them.
Makyen suggested using inBackground: true, however it still loads a tab with content after opening. I actually need for it to be unread.
Based on the documentation for tabs.open(), you need to specify the inBackground: true property which does:
If present and true, the new tab will be opened to the right of the
active tab and will not be active. This is an optional property.
Thus, your code would be:
var tabs = require("sdk/tabs");
tabs.open({
url: "http://www.example.com",
inBackground: true
});
Goto -> Firefox -> Options -> General and under "Tabs" select "Dont't load tab until selected"
This is a non code based solution... I dont now for what you are using it.
Greets
Lukas

Angular Material: How to display one toast after another one is displayed while keeping both on screen?

I'm using $mdToast (Angular Material framework) directive to show several status messages in my Angular(-Material) web app.
When the user signs-in, if the login is successful a toast is shown by calling:
$scope.showToastMessage = function() {
var toast = $mdToast.simple()
.content("Login successful);
.action('OK')
.highlightAction(false)
.position($scope.getToastPosition());
$mdToast.show(toast).then(function(toast) {
//...
}
});
};
After login success I need to make another check (e.g. valid session cookie) and show another toast message without overriding the previous one and after the previous one is actually showed.
The issues I get here are:
the second toast is shown before the new one (probably due to $mdTost's async nature)
this second toast is shown for less than one second and then disappears leaving on screen only the first one (basicly the second one is shown first and then hidden when the first one appears)
A solution could be either:
creating the second toast inside then .then callback: this doesn't work either because requires the user interventions to press the "OK" action button
calling $mdToast.updateContent(); (https://material.angularjs.org/#/api/material.components.toast/service/$mdToast) which would overwrite previous toast message (this is not the best solution but would be fine either) but I can't figure out how:
(1) choose a specific toast shown on screen (let's suppose I have several toasts shown by different calls) , and
(2) update the toast message after a delay (let's say 3 seconds) in order to show to make the user undersand that the login was successful but there is some other information.
Any clue?
I was not sure if you wanted to show both toasts at the same time or not. If you wanted to show the sequentially you can put the second call to toast inside of the then because the action (OK) resolves the promise of the first toast. This is what I've tried:
var toast = $mdToast.simple()
.content('top left')
.action('OK')
.highlightAction(false)
.position($scope.getToastPosition());
var toast2 = $mdToast.simple()
.content('Checking some other things')
.highlightAction(false)
.position('top left');
$mdToast.show(toast).then(function() {
$mdToast.show(toast2);
});
See this CodePen.

Unable to use back button property in Popup screen in blackberry

In my application , am using popup screen, that implements FieldChangeListener.I used close() method for back button. but its not working.
Can some give sample code without using KeyListener,TrackwheelListener ?
if u want to close the popup screen on back button try this:
UiApplication.getUiApplication().
popScreen(UiApplication.getUiApplication().getActiveScreen());

Resources