The KongaDialog can generate a JPanel containing the suitable buttons that should appear in the dialog. There are 6 different button modes, with self-describing names:
OK_ONLY
OK_CANCEL
OK_CANCEL_APPLY
YES_NO
YES_NO_CANCEL
CLOSE_ONLY
Each button has a corresponding onXX() function that will be invoked when the user presses the button. The KongaDialog class provides a default implementation - that calls the protected method onDialogClose()
which simply closes the dialog -- for each such button function. A derived class that chooses to use any of these preconfigured button modes is responsible for overriding the corresponding button method, and the onDialogClose()
method if any different behavior is wanted. Each of the preconfigured buttons can also be created individually by a subclass by calling the corresponding createXXButton() function, method.
@author Torgil Zethson
});
}
private void displayDialog() {
WhereClauseEditorUi.State memento = ui.getMemento();
KongaDialog dlg = new EditorDialog(page.getWindow(), ui);
dlg.setVisible(true);
if (dlg.wasOkPressed()) {
handleNewInput(memento);
} else {
ui.setMemento(memento);
}
}
DirtyDelegatesDialog dlg = new DirtyDelegatesDialog(owner, dirty);
return dlg.show();
}
private int show() {
KongaDialog dlg = createDialog();
dlg.manageLocation(DirtyDelegatesDialog.class);
dlg.setVisible(true);
return dlg.wasOkPressed() ? SAVE : CANCEL;
}
dlg.setVisible(true);
return dlg.wasOkPressed() ? SAVE : CANCEL;
}
private KongaDialog createDialog() {
KongaDialog dlg = new KongaDialog(owner, PackageResources.DirtyDelegates.TITLE);
layoutDialog(dlg);
dlg.getRootPane().setDefaultButton(dlg.getYesButton());
return dlg;
}
*/
public final class DeployWarningsDialog {
public static void display(DeployWarnings result, IntegrationEntityLookup objectLookup) {
UiProvider ui = new DeployWarningsPresenter(result, objectLookup);
KongaDialog dlg = createDialog(ui);
dlg.setVisible(true);
}
KongaDialog dlg = createDialog(ui);
dlg.setVisible(true);
}
private static KongaDialog createDialog(UiProvider content) {
KongaDialog dialog = new KongaDialog(getOwner(), Strings.get("Deploy.Result.Dialog.Title"), true);
layoutDialog(dialog, content);
dialog.setCloseButtonAsDefault();
dialog.pack();
dialog.manageLocation(DeployWarningsDialog.class);
return dialog;
}
});
}
private KongaDialog createDialog(UiProvider ui) {
KongaDialog dialog = new KongaDialog(UiUtils.getActiveWindow(), "File name conflict");
dialog.standardLayout(ui, KongaDialog.CONTINUE_CANCEL);
dialog.setContinueButtonAsDefault();
dialog.setFocusedComponent(ui);
Binding binding = new ComponentEnabledBinding(model, XsdGeneratorModel.VALID_SETTINGS, dialog.getContinueButton());
binding.syncUi();
return dialog;
}
this.continueHandler = continueHandler;
this.stopHandler = stopHandler;
}
public void display() {
KongaDialog dialog = createDialog();
dialog.setVisible(true);
}
KongaDialog dialog = createDialog();
dialog.setVisible(true);
}
private KongaDialog createDialog() {
final KongaDialog dialog = new KongaDialog(ApplicationUi.getAppWinFrame(), "Test In Progress", true);
BorderLayoutBuilder layout = new BorderLayoutBuilder(0, 10);
layoutMessage(layout);
Action continueAction = createActionWrapper(ResumeDebuggingAction.ID, continueHandler, dialog);
Action stopAction = createActionWrapper(StopDebuggingAction.ID, stopHandler, dialog);
stopAction.putValue(Action.NAME, "Stop Current Test and Continue With New Test");
JButton cancelButton = dialog.createCancelButton();
BoxBuilder buttons = BoxBuilder.horizontal();
buttons.setUseSmallSizedIconsForActions(true);
buttons.addAllWithSpace(10, stopAction, continueAction).glue().add(cancelButton);
layout.south(buttons);
layout.setBorder(Empty.border(10));
layout.asContentPaneFor(dialog);
dialog.pack();
dialog.setLocationRelativeTo(null);
dialog.setResizable(false);
dialog.manageLocation();
dialog.setDefaultButton(stopAction);
return dialog;
}
}
private PasswordAuthentication askForCredentials(String caption) {
Ui ui = new Ui(caption);
KongaDialog dialog = new KongaDialog(UiUtils.getActiveWindow(), "Authentication Required");
dialog.standardLayout(ui, KongaDialog.OK_CANCEL);
ui.addActionListener(dialog.getOkActionListener());
dialog.setLocationRelativeTo(null);
dialog.setResizable(false);
dialog.setOkButtonAsDefault();
dialog.setVisible(true);
if (dialog.wasOkPressed()) {
return new PasswordAuthentication(ui.getUserName(), ui.getPassword());
}
return null;
}
* Displays the specified items in the window's list. The items will be traversed in the
* specified direction.
*/
public void display(Direction direction) {
if (window == null) {
window = new KongaDialog(UiUtils.getActiveFrame(), "", false);
window.setUndecorated(true);
focusLostMeansCancelled = true;
createList(direction);
JComponent cp = layoutWindow();
installKeyBindings(cp);
Related Classes of org.jitterbit.ui.dialog.KongaDialog
Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.