Package org.beryl.gui.widgets

Examples of org.beryl.gui.widgets.Dialog


   * @param message The dialog message
   * @return The result (RESULT_YES/RESULT_NO/RESULT_CANCEL)
   */
  public static int showYesNoCancelDialog(Frame frame, String title, String message) throws GUIException {
    YesNoCancelEventListener listener = new YesNoCancelEventListener();
    Dialog dialog = (Dialog) WidgetFactory.getInstance().constructWidget(DialogUtils.class, "YesNoCancelDialog", listener);
    Label label = (Label) dialog.getWidget("DialogCaption");
    label.setProperty("text", message);
    dialog.initDialog(frame);
    dialog.setProperty("title", title);
    dialog.show();
    return listener.getResult();
  }
View Full Code Here


  public void eventOccured(GUIEvent event) {
    String name = event.getName();
    try {
      if (name.equals("add")) {
        final Dialog dialog =
          (Dialog) WidgetFactory
            .getInstance()
            .constructWidget(getClass(), "AddInternationalizationDialog", new GUIEventListener() {
          public void eventOccured(GUIEvent event) {
            try {
              Widget source = event.getSource();
              if (event.getName().equals("ok")) {
                String key = (String) source.getDataModel().getValue("key");
                String value = (String) source.getDataModel().getValue("value");

                boolean isNew = (properties.getProperty(key) == null);
                properties.setProperty(key, value);
                if (isNew)
                  propertyModel.addRow(new PropertyTableRow(key));
                modified = true;
              }
              ((Dialog) source.getParentWidgetByClass(Dialog.class)).dispose();
            } catch (Exception e) {
              new MessageDialog(e);
            }
          }
        }, new MapDataModel());
        dialog.initDialog(frame);
        dialog.show();
      } else if (name.equals("popup")) {
        PopupMenu popup = (PopupMenu) constructWidget("PropertyPopup");
        popup.popup(event);
      } else if (name.equals("delete")) {
        TableRow rows[] = (TableRow[]) dataModel.getValue("property.value");
View Full Code Here

    parentNode.addChild(newNode, null);
    widget.finalizeConstruction();

    if (widget instanceof Dialog) {
      /* Dialogs get treated a little bit differently */
      Dialog dialog = (Dialog) widget;
      dialog.initDialog(null);
      dialog.show();
    }

    return widget;
  }
View Full Code Here

    widget.finalizeConstruction();

    parentObject.element.appendChild(childWidget);

    if (widget instanceof Dialog) {
      Dialog dialog = (Dialog) widget;
      dialog.initDialog(null);
      dialog.show();
    }

    if (parentWidget != null)
      revalidate(parentWidget);
View Full Code Here

TOP

Related Classes of org.beryl.gui.widgets.Dialog

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.