Package org.beryl.gui

Examples of org.beryl.gui.GUIException


      } else if (name.equals("message.info")) {
        new MessageDialog(frame, getString("test.message.info.title"), getString("test.message.info.message"));
      } else if (name.equals("message.warning")) {
        new MessageDialog(frame, MessageDialog.WARNING_MESSAGE, getString("test.message.warning.title"), getString("test.message.warning.message"), null);
      } else if (name.equals("message.error")) {
        throw new GUIException("This is an example error");
      } else if (name.equals("edit")) {
        TableRow selection[] = (TableRow[]) model.getValue("table.value");
        for (int i = 0; i < selection.length; i++) {
          new PersonEditor(selection[i]);
        }
View Full Code Here


       ((JPanel) panel.getRealWidget()).setPreferredSize((Dimension) value);
      if (dialog != null)
        dialog.pack();
    } else if ("helpid".equals(name)) {
      if (helpBroker == null)
        throw new GUIException("JavaHelp has not been activated");
      if (value != null)
        helpBroker.enableHelpKey(dialog.getRootPane(), (String) value, null);
    } else if ("modal".equals(name)) {
      isModal = ((Boolean) value).booleanValue();
    } else if ("visible".equals(name)) {
      throw new GUIException("Visible is not a settable property, use Dialog's 'show' method instead");
    } else if ("location".equals(name)) {
      location = (Point) value;
      if (dialog != null)
        dialog.setLocation((Point) value);
    } else if ("default".equals(name)) {
      defaultButton = (Button) value;
      jDefaultButton = (JButton) defaultButton.getRealWidget();
      if (dialog != null)
        dialog.getRootPane().setDefaultButton(jDefaultButton);
    } else if ("title".equals(name)) {
      title = (String) value;
      if (dialog != null)
        dialog.setTitle(title);
    } else {
      if (dialog == null)
        throw new GUIException("Property '" + name + "' is not yet supported by Dialog");
      super.setProperty(name, value);
    }
  }
View Full Code Here

    else if (parent instanceof Frame)
      dialog = new JDialog((JFrame) parent.getRealWidget(), isModal);
    else if (parent instanceof Wizard)
      dialog = new JDialog((JFrame) parent.getRealWidget(), isModal);
    else
      throw new GUIException("Invalid parent (no Dialog/Frame/Wizard/null)");
  }
View Full Code Here

            listener.eventOccured(new GUIEvent(Dialog.this, name, e));
          }
        });
      }
    } else
      throw new GUIException("Initialize dialog first!");
    dialog.show();
  }
View Full Code Here

  /**
   * Set the initial focus of the dialog
   */
  public void setInitialFocus(final Widget widget) throws GUIException {
    if (dialog == null)
      throw new GUIException("The dialog has not yet been created. Call setInitialFocus() after initDialog()");
    dialog.addWindowListener(new WindowAdapter() {
      public void windowOpened(WindowEvent e) {
        widget.requestFocus();
        e.getWindow().removeWindowListener(this);
      }
View Full Code Here

        addChild(widget);
      } finally {
        sendEvents = true;
      }
    } else {
      throw new GUIException("Only Item children are allowed inside a List");
    }
  }
View Full Code Here

  public void removeChildWidget(Widget widget) throws GUIException {
    if (listDataModel != null) {
      listDataModel.removeValue(this, widget);
      super.removeChildWidget(widget);
    } else {
      throw new GUIException("There are no static items to remove");
    }
  }
View Full Code Here

        addChild(widget);
      } finally {
        sendEvents = true;
      }
    } else {
      throw new GUIException("Only Item children are allowed inside a ComboBox");
    }
  }
View Full Code Here

  public void removeChildWidget(Widget widget) throws GUIException {
    if (listDataModel != null) {
      listDataModel.removeValue(this, widget);
      super.removeChildWidget(widget);
    } else {
      throw new GUIException("There are no static items to remove");
    }
  }
View Full Code Here

                    comboBox.getSelectedItem());
              } finally {
                processEvents = true;
              }
            } catch (IllegalArgumentException ex) {
              throw new GUIException("Changed data model has a bad selection index", ex);
            }
          } else if (event.getKey().equals(valueKey)) {
            try {
              comboBox.setSelectedItem(event.getNewValue());
              comboBox.repaint();
              try {
                processEvents = false;
                if (indexKey != null)
                  ((MapDataModel) event.getModel()).setValue(
                    ComboBox.this,
                    indexKey,
                    new Integer(comboBox.getSelectedIndex()));
              } finally {
                processEvents = true;
              }
            } catch (IllegalArgumentException ex) {
              throw new GUIException("Changed data model has a bad selection value", ex);
            }
          }
        }
      } finally {
        sendEvents = true;
View Full Code Here

TOP

Related Classes of org.beryl.gui.GUIException

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.