Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Shell


        linkCreateNewRuntime.setText("configure WGA distributions");
        linkCreateNewRuntime.addHyperlinkListener(new HyperlinkAdapter() {

            @Override
            public void linkActivated(HyperlinkEvent e) {
                PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(new Shell(), WGADesignerPlugin.PREFERENCES_PAGE_WGA_DEPLOYMENTS, null, null);
                if (pref != null) {
                    pref.open();
                    updateWGADistributions();
                }
            }
View Full Code Here


  /**
   * @see IActionDelegate#run(IAction)
   */
  public void run(IAction action) {
    Shell shell = new Shell();
    MessageDialog.openInformation(
      shell,
      "WGA Designer",
      "New Action was executed.");
  }
View Full Code Here

  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) {
View Full Code Here

  private IProject _selectedProject;

  public void run(IAction action) {

    Shell shell = new Shell(Display.getCurrent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);

    if (_selectedProject != null) {
      AddExternalDesignDialog dialog = new AddExternalDesignDialog(shell, _selectedProject);     
      dialog.open();
    }
View Full Code Here

            {
              if ( decision_type == UpdateManagerDecisionListener.DT_STRING_ARRAY_TO_STRING ){
               
                String[]  options = (String[])decision_data;
             
                Shell  shell = UIFunctionsManagerSWT.getUIFunctionsSWT().getMainShell();
               
                if ( shell == null ){
                 
                  Debug.out( "Shell doesn't exist" );
                 
View Full Code Here

        Field fldsel_window = osCls.getField("sel_window");
        Object windowId = invoke(osCls, "objc_msgSend", new Object[] {
          wrapPointer(arg0),
          fldsel_window.get(null)
        });
        final Shell shellAffected = (Shell) invoke(Display.class,
            Display.getCurrent(), "findWidget", new Object[] {
              windowId
            });

        Utils.execSWTThread(new AERunnable() {
          public void runSupport() {
            int type;
            Long l = (Long) shellAffected.getData("OSX.ToolBarToggle");
            if (l == null || l.longValue() == 0) {
              type = SWT.Collapse;
            } else {
              type = SWT.Expand;
            }

            Event event = new Event();
            event.type = type;
            event.display = shellAffected.getDisplay();
            event.widget = shellAffected;
            shellAffected.notifyListeners(type, event);

            shellAffected.setData("OSX.ToolBarToggle", new Long(
                type == SWT.Collapse ? 1 : 0));
          }
        });
      } catch (Throwable t) {
        Debug.out(t);
View Full Code Here

  }

  public static void initMainShell(Shell shell) {
    //Canvas canvas = new Canvas(shell, SWT.NO_BACKGROUND | SWT.NO_TRIM);
    //canvas.setVisible(false);
    Shell subshell = new Shell(shell);

    try {
      messageCallback = constCallBack.newInstance(new Object[] {
        Win32UIEnhancer.class,
        "messageProc2",
        4
      });

      Object oHandle = subshell.getClass().getField("handle").get(subshell);
      if (useLong) {
        Number n = (Number) mCallback_getAddress.invoke(messageCallback,
            new Object[] {});
        messageProcLong = n.longValue();
        if (messageProcLong != 0) {
View Full Code Here

  public SplashWindow(Display _display, IUIIntializer initializer) {
    this.display = _display;
    this.initializer = initializer;

    splash = new Shell(display, SWT.NO_TRIM);
    splash.setText(Constants.APP_NAME);
    Utils.setShellIcon(splash);

    splash.setLayout(new FillLayout());
    canvas = new Canvas(splash, SWT.DOUBLE_BUFFERED);
View Full Code Here

      if ( current_shell != null && !current_shell.isDisposed()){
       
        return;
      }
     
      final Shell parentShell = Utils.findAnyShell();
     
      final Shell shell = current_shell =
        ShellFactory.createShell(parentShell, SWT.BORDER | SWT.APPLICATION_MODAL | SWT.TITLE | SWT.DIALOG_TRIM );
     
      shell.setLayout(new FillLayout());
     
      if (parentShell != null) {
        parentShell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
      }
     
      shell.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          try{
            if (parentShell != null) {
              parentShell.setCursor(e.display.getSystemCursor(SWT.CURSOR_ARROW));
            }
            if (browserFunction != null && !browserFunction.isDisposed()) {
              browserFunction.dispose();
            }
            current_shell = null;
           
          }finally{
           
            if ( !listener_informed[0] ){
           
              try{
                listener.actionComplete( false );
               
              }catch( Throwable f ){
               
                Debug.out( f );
              }
            }
          }
        }
      });
 
      browser = Utils.createSafeBrowser(shell, SWT.NONE);
      if (browser == null) {
        shell.dispose();
        return;
      }
 
      browser.addTitleListener(new TitleListener() {
        public void changed(TitleEvent event) {
          if (shell == null || shell.isDisposed()) {
            return;
          }
          shell.setText(event.title);
        }
      });
 
      browserFunction = new BrowserFunction(browser, "sendVuzeUpdateEvent") {
        private String last = null;

        public Object function(Object[] arguments) {

          if (shell == null || shell.isDisposed()) {
            return null;
          }
         
          if (arguments == null) {
            Debug.out("Invalid sendVuzeUpdateEvent null ");
            return null;
          }
          if (arguments.length < 1) {
            Debug.out("Invalid sendVuzeUpdateEvent length " + arguments.length + " not 1");
            return null;
          }
          if (!(arguments[0] instanceof String)) {
            Debug.out("Invalid sendVuzeUpdateEvent "
                + (arguments[0] == null ? "NULL"
                    : arguments.getClass().getSimpleName()) + " not String");
            return null;
          }

          String text = ((String) arguments[0]).toLowerCase();
          if (last  != null && last.equals(text)) {
            return null;
          }
          last = text;
          if ( text.contains("page-loaded")) {
           
            Utils.centreWindow(shell);
            if (parentShell != null) {
              parentShell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
            }
            shell.open();
           
          } else if (text.startsWith("set-size")){
           
            String[] strings = text.split(" ");
           
            if (strings.length > 2){
              try {
               
                int w = Integer.parseInt(strings[1]);
                int h = Integer.parseInt(strings[2]);

                Rectangle computeTrim = shell.computeTrim(0, 0, w, h);
                shell.setSize(computeTrim.width, computeTrim.height);
               
              } catch (Exception e) {
              }
            }
          }else if ( text.contains( "decline" ) || text.contains( "close" )){
           
            Utils.execSWTThreadLater(0, new AERunnable() { 
              public void runSupport() {
                shell.dispose();
              }
            });
           
          }else if ( text.contains("accept")){
           
            Utils.execSWTThreadLater(0, new AERunnable() { 
              public void runSupport(){
               
                listener_informed[0] = true;
               
                try{
                  listener.actionComplete( true );
                 
                }catch( Throwable e ){
                 
                  Debug.out( e );
                }
               
                shell.dispose();
              }
            });
          }
          return null;
        }
      };

      browser.addStatusTextListener(new StatusTextListener() {
        public void changed(StatusTextEvent event) {
          browserFunction.function(new Object[] {
            event.text
          });
        }
      });

      browser.addLocationListener(new LocationListener() {
        public void changing(LocationEvent event) {
        }
 
        public void changed(LocationEvent event) {
        }
      });
 
      String final_url = url + ( url.indexOf('?')==-1?"?":"&") +
            "locale=" + MessageText.getCurrentLocale().toString() +
            "&azv=" + Constants.AZUREUS_VERSION;
       
      SimpleTimer.addEvent(
        "fullupdate.pageload",
        SystemTime.getOffsetTime(5000),
        new TimerEventPerformer() {
          public void perform(TimerEvent event) {
            Utils.execSWTThread(new AERunnable() {
              public void runSupport() {
                if ( !shell.isDisposed()){
               
                  shell.open();
                }
              }
            });
          }
        });
View Full Code Here

      boolean bForRestart) {
    if (skipCloseCheck) {
      return true;
    }
   
    Shell mainShell = UIFunctionsManagerSWT.getUIFunctionsSWT().getMainShell();
    if (mainShell != null
        && (!mainShell.isVisible() || mainShell.getMinimized())
        && COConfigurationManager.getBooleanParameter("Password enabled")) {

      if (!PasswordWindow.showPasswordWindow(Display.getCurrent())) {
        return false;
      }
View Full Code Here

TOP

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

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.