Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.MessageBox


  Properties _props;
  private IFile _file;

  public void run(IAction action) {

    MessageBox msgBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
    msgBox.setText("Are you really sure?");
    msgBox.setMessage("Are you really sure that you want to sort the labelfile: \n" + _file.getFullPath());
    int response = msgBox.open();

    if (response == SWT.YES) {

      SortedProperties sortedProperties = new SortedProperties();
      sortedProperties.putAll(_props);
View Full Code Here


    try{
      input_file = new File( getTorrentFile()).getCanonicalFile();
     
    }catch( IOException e ){
     
      MessageBox mb = new MessageBox(getWizardWindow(),SWT.ICON_ERROR | SWT.OK );
   
      mb.setText(MessageText.getString("exportTorrentWizard.process.inputfilebad.title"));
   
      mb.setMessageMessageText.getString("exportTorrentWizard.process.inputfilebad.message")+"\n" +
              e.toString());
     
      mb.open();
     
      return( false );
    }
   
    File output_file = new File( export_file );
   
    if ( output_file.exists()){
     
      MessageBox mb = new MessageBox(this.getWizardWindow(),SWT.ICON_QUESTION | SWT.YES | SWT.NO);
     
      mb.setText(MessageText.getString("exportTorrentWizard.process.outputfileexists.title"));
     
      mb.setMessage(MessageText.getString("exportTorrentWizard.process.outputfileexists.message"));
     
      int result = mb.open();
   
      if( result == SWT.NO ){
       
        return( false );
      }
    }

    String  error_title;
    String  error_detail;
   
    try{
   
      TOTorrent  torrent;
     
      try{
       
        torrent = TOTorrentFactory.deserialiseFromBEncodedFile( input_file );
 
        try{
         
          torrent.serialiseToXMLFile( output_file );
         
          return( true );
               
        }catch( TOTorrentException e ){
       
          error_title   = MessageText.getString("exportTorrentWizard.process.exportfail.title");
       
          error_detail  = TorrentUtils.exceptionToText( e );
        }
      }catch( TOTorrentException e ){
       
        error_title   = MessageText.getString("exportTorrentWizard.process.torrentfail.title");
       
        error_detail  = TorrentUtils.exceptionToText( e );
      }
     
    }catch( Throwable e ){

      error_title   = MessageText.getString("exportTorrentWizard.process.unknownfail.title");
   
      error_detail   = e.toString();
    }

    MessageBox mb = new MessageBox(this.getWizardWindow(),SWT.ICON_ERROR | SWT.OK );
     
    mb.setText(error_title);
     
    mb.setMessage(error_detail);
     
    mb.open();
   
    return( false );
  }
View Full Code Here

    TOTorrent torrent = dm.getTorrent();
    if (torrent != null) {
      try {
        azureus_core.getTrackerHost().hostTorrent(torrent, true, false );
      } catch (TRHostException e) {
        MessageBox mb = new MessageBox(panel.getShell(), SWT.ICON_ERROR | SWT.OK);
        mb.setText(MessageText.getString("MyTorrentsView.menu.host.error.title"));
        mb.setMessage(MessageText.getString("MyTorrentsView.menu.host.error.message").concat("\n").concat(e.toString()));
        mb.open();
      }
    }
  }
View Full Code Here

    TOTorrent torrent = dm.getTorrent();
    if (torrent != null) {
      try {
        azureus_core.getTrackerHost().publishTorrent(torrent);
      } catch (TRHostException e) {
        MessageBox mb = new MessageBox(panel.getShell(), SWT.ICON_ERROR | SWT.OK);
        mb.setText(MessageText.getString("MyTorrentsView.menu.host.error.title"));
        mb.setMessage(MessageText.getString("MyTorrentsView.menu.host.error.message").concat("\n").concat(e.toString()));
        mb.open();
      }
    }
  }
View Full Code Here

            }
          });
          return;
        }
        Shell aShell = shell == null ? Utils.findAnyShell() : shell;
        MessageBox mb = new MessageBox(aShell, SWT.ICON_WARNING
            | SWT.YES | SWT.NO);
        mb.setText(MessageText.getString("seedmore.title"));
        mb.setMessage(MessageText.getString("seedmore.shareratio")
            + (dm.getStats().getShareRatio() / 10) + "%.\n"
            + MessageText.getString("seedmore.uploadmore"));
        int action = mb.open();
        stopme = action == SWT.YES;
      }
    }
   
    if (stopme) {
View Full Code Here

    try{
      input_file = new File( getImportFile()).getCanonicalFile();
     
    }catch( IOException e ){
     
      MessageBox mb = new MessageBox(getWizardWindow(),SWT.ICON_ERROR | SWT.OK );
   
      mb.setText(MessageText.getString("importTorrentWizard.process.inputfilebad.title"));
   
      mb.setMessageMessageText.getString("importTorrentWizard.process.inputfilebad.message")+"\n" +
              e.toString());
     
      mb.open();
     
      return( false );
    }
   
    File output_file = new File( getTorrentFile() );
   
    if ( output_file.exists()){
     
      MessageBox mb = new MessageBox(this.getWizardWindow(),SWT.ICON_QUESTION | SWT.YES | SWT.NO);
     
      mb.setText(MessageText.getString("importTorrentWizard.process.outputfileexists.title"));
     
      mb.setMessage(MessageText.getString("importTorrentWizard.process.outputfileexists.message"));
     
      int result = mb.open();
   
      if(result == SWT.NO) {
       
        return( false );
      }
    }
 
    String  error_title;
    String  error_detail;
   
    try{
   
      TOTorrent  torrent;
     
      try{
       
        torrent = TOTorrentFactory.deserialiseFromXMLFile( input_file );
 
        try{
         
          torrent.serialiseToBEncodedFile( output_file );
         
          return( true );
               
        }catch( TOTorrentException e ){
       
          //e.printStackTrace();
         
          error_title   = MessageText.getString("importTorrentWizard.process.torrentfail.title");
       
          error_detail  = TorrentUtils.exceptionToText( e );
        }
      }catch( TOTorrentException e ){
       
        // e.printStackTrace();
       
        error_title   = MessageText.getString("importTorrentWizard.process.importfail.title");
       
        error_detail  = TorrentUtils.exceptionToText( e );
      }
     
    }catch( Throwable e ){

      error_title   = MessageText.getString("importTorrentWizard.process.unknownfail.title");
   
      Debug.printStackTrace( e );
     
      error_detail   = e.toString();
    }

    MessageBox mb = new MessageBox(this.getWizardWindow(),SWT.ICON_ERROR | SWT.OK );
     
    mb.setText(error_title);
     
    mb.setMessage(error_detail);
     
    mb.open();
   
    return( false );
  }
View Full Code Here

      }

      public void widgetSelected(SelectionEvent arg0) {
        String server_ip = text_server_ip.getText();
        if (!AddressUtils.isValidIP(server_ip)) {
          MessageBox dialog = new MessageBox(shell,
                      SWT.OK | SWT.ICON_WARNING);
          dialog.setMessage(Localizer._("serveraddwindow.wrong_server_address"));
          dialog.open();
          return ;
        }
       
        if (!AddressUtils.isValidPort(text_port.getText())) {
          MessageBox dialog = new MessageBox(shell,
          SWT.OK | SWT.ICON_WARNING);
          dialog.setMessage(Localizer._("serveraddwindow.wrong_server_port"));
          dialog.open();
          return ;
        }
        int server_port = Integer.parseInt(text_port.getText());
        try {
          _core.getServerManager().newServer(server_ip, server_port);
View Full Code Here

      if (data==null) return "";
      return data;
  }
 
  public static boolean showConfirmMessage(Shell shell, String title,String message) {
    MessageBox dialog = new MessageBox(shell,
                SWT.YES | SWT.NO | SWT.ICON_WARNING);
    dialog.setText(title);
    dialog.setMessage(message);
    int result = dialog.open();
    return result==SWT.YES;
  }
View Full Code Here

    int result = dialog.open();
    return result==SWT.YES;
  }
 
  public static void showWarningMessage(Shell shell,String title,String message) {
    MessageBox dialog = new MessageBox(shell,
                SWT.OK | SWT.ICON_WARNING);
    dialog.setText(title);
    dialog.setMessage(message);
    dialog.open();
  }
View Full Code Here

    dialog.setMessage(message);
    dialog.open();
  }
 
  public static void showErrorMessage(Shell shell, String title, String message) {
    MessageBox dialog = new MessageBox(shell,
         SWT.OK | SWT.ICON_ERROR);
    dialog.setText(title);
    dialog.setMessage(message);
    dialog.open();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.MessageBox

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.