Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.MessageBox


        }
       
        sourceFileStream.close();
        targetFileStream.close();
      } catch (Exception exception) {
        MessageBox messageBox = new MessageBox(new Shell(new Display()), SWT.OK);
        messageBox.setMessage(exception.toString());
        messageBox.open();
       
        throw new RuntimeException(exception);
      }
    }
View Full Code Here


        registerHandlers.setLayoutData(data);
        registerHandlers.setSelection(true);
    try {
      documentation = new Browser(sashForm, SWT.NONE);
    } catch (SWTError e) {
      MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK);
      messageBox.setMessage("Browser cannot be initialized.");
      messageBox.setText("Exit");
      messageBox.open();
    }
    return top;
    }
View Full Code Here

    }
    validation.validateOpenEditors(project());
  }

  private boolean shouldRebuild() {
    MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
    messageBox.setText(settingsChanged);
    messageBox.setMessage(rebuildProjectNow);
    return messageBox.open() == SWT.YES;
  }
View Full Code Here

  return mainWindow;
}

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

      @Override
      public void widgetSelected(SelectionEvent e) {
       
        int messageBoxStyle = SWT.ICON_WARNING | SWT.YES | SWT.NO ;
        
        MessageBox messageBox = new MessageBox(parentComposite
            .getShell(), messageBoxStyle);
          messageBox.setMessage("Remove all assigned constraints?");

          if (messageBox.open() == SWT.YES)
            new ClearAssignedConstraintSetCommand(assignedConstraintsSet).runAsJob();
         
      }
     
      @Override
View Full Code Here

  protected boolean displayQuestionMessagebox(String message) {

    int messageBoxStyle = SWT.ICON_QUESTION | SWT.YES | SWT.NO ;
     
      
    MessageBox messageBox = new MessageBox(zestGraph.getShell(), messageBoxStyle);
      messageBox.setMessage(message);

      int rc = messageBox.open();

      if (rc == SWT.YES)
      return true;
      else
    return false;
View Full Code Here

      @Override
      public void widgetSelected(SelectionEvent e) {

        linkedText.getCPListProvider();
        if (linkedText.getCPListProvider() == null) {
          MessageBox messageBox = new MessageBox(PlatformUI
              .getWorkbench().getActiveWorkbenchWindow()
              .getShell(), SWT.ICON_ERROR);
          String message = "Can't open LinkWizard. No config for link rules found!";
          messageBox.setMessage(message);
          messageBox.open();
          return;
        }

        if (!linkedText.getCPListProvider().getExecuted())
          linkedText.getCPListProvider().run();
View Full Code Here

      @Override
      public void widgetSelected(SelectionEvent e) {
        linkedText.getCPListProvider();
        if (linkedText.getCPListProvider() == null) {
          MessageBox messageBox = new MessageBox(PlatformUI
              .getWorkbench().getActiveWorkbenchWindow()
              .getShell(), SWT.ICON_ERROR);
          String message = "Can't open LinkWizard. No config for link rules found!";
          messageBox.setMessage(message);
          messageBox.open();
          return;
        }

        if (!linkedText.getCPListProvider().getExecuted())
          linkedText.getCPListProvider().run();
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
   
    final FactorTable factorTable = (FactorTable) UiUtil.getSelectedEObject()

    if(factorTable.getType() != CategoryType.PRODUCT){
      MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_ERROR);
      String message = "Table Type must be \"Product\"!";
      messageBox.setMessage(message);
      messageBox.open();
    }else{
      new SetFactorTableProductFactorsFromURNCommand(factorTable).runAsJob();
    }
    return null;
  }
View Full Code Here

   *  Shows only the 1st 10 messages.<br>
   *  Only opens MessageDialog if messageStack isn't empty<br>
   */
  protected void displayErrors(){
    if (errorMessageStack != null || errorMessageStack.size() > 0){
      MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_ERROR);
      String displayedMessage = "GUI was build with "+ errorMessageStack.size()+" errors :\n";
      int max = 10; //display only10 messages ->
      int count = 0;
      for (String errorMsg : errorMessageStack){
        displayedMessage += errorMsg+"\n";
        count += 1;
        if (count > max) {
          displayedMessage+= "[...]";
          break;
        }
      }
      messageBox.setMessage(displayedMessage);
      messageBox.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.