Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.MessageBox.open()


        boolean b;
        try {
            final MessageBox mb = new MessageBox(s, SWT.ICON_WARNING | SWT.YES | SWT.NO);
            mb.setMessage(question);
            mb.setText(title);
            final int response = mb.open();
            if (response == SWT.YES) {
                b = true;
            } else {
                b = false;
            }
View Full Code Here


      public void shellClosed(ShellEvent e) {
        int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
        MessageBox messageBox = new MessageBox(getShell(), style);
        messageBox.setText("Leave table");
        messageBox.setMessage("Are you sure you want to leave this table?");
        e.doit = messageBox.open() == SWT.YES;
      }
    });
  }
 
  /**
 
View Full Code Here

                @Override
                public void widgetSelected(SelectionEvent evt) {
                  MessageBox aboutInfo = new MessageBox(getShell());
                  aboutInfo.setMessage("CSPoker SWT Client 0.1");
                  aboutInfo.setText("About");
                  aboutInfo.open();
                }
              });
            }
            helpMenuItem.setMenu(helpMenu);
          }
View Full Code Here

  public static int displayMessage(String title, String message, int style) {
    logger.info(message);
    MessageBox infoBox = new MessageBox(new Shell(Display.getCurrent()), style | SWT.OK);
    infoBox.setText(title);
    infoBox.setMessage(message);
    return infoBox.open();
  }
 
  /**
   * @param file Plays the given audio file
   */
 
View Full Code Here

      public void shellClosed(ShellEvent e) {
        int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
        MessageBox messageBox = new MessageBox(getShell(), style);
        messageBox.setText("Close Window");
        messageBox.setMessage("Are you sure you want to exit?");
        e.doit = messageBox.open() == SWT.YES;
        // Lobby has been closed
        // Dispose of the display entirely so all GameWindows are closed
        // as well
        if (e.doit){
          exit();
View Full Code Here

    {
        MessageBox messageBox = new MessageBox(getShell(), icon);
        messageBox.setMessage(message);
        messageBox.setText(title);

        return messageBox.open();
    }

    /**
     * Creates widgets for object messages and populates the content in hexadecimal format.
     * @param toolkit
View Full Code Here

 
  public void showErrorMessage(String title, String message) {
    MessageBox box = new MessageBox(Display.getCurrent().getActiveShell(), SWT.OK | SWT.ICON_ERROR);
    box.setText(title);
    box.setMessage(message);
    box.open();
  }
 
  public void showWarningMessage(Exception e) {
    this.showWarningMessage(e.getMessage());
  }
View Full Code Here

 
  public void showWarningMessage(String title, String message) {
    MessageBox box = new MessageBox(Display.getCurrent().getActiveShell(), SWT.OK | SWT.ICON_WARNING);
    box.setText(title);
    box.setMessage(message);
    box.open();
  }
 
  public static UXMessages getInstance() {
    if (instance == null) {
      instance = new UXMessages();
View Full Code Here

    private static int displayMessageBox( int style, String title, String message )
    {
        MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), style );
        messageBox.setText( title );
        messageBox.setMessage( message );
        return messageBox.open();
    }

}
View Full Code Here

    private void notifyError( String message )
    {
        MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK
            | SWT.ICON_ERROR );
        messageBox.setMessage( message );
        messageBox.open();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.