Examples of Shell


Examples of org.eclipse.swt.widgets.Shell

  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

Examples of org.eclipse.swt.widgets.Shell

            {
              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

Examples of org.eclipse.swt.widgets.Shell

        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

Examples of org.eclipse.swt.widgets.Shell

  }

  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

Examples of org.eclipse.swt.widgets.Shell

  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

Examples of org.eclipse.swt.widgets.Shell

      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

Examples of org.eclipse.swt.widgets.Shell

      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

Examples of org.eclipse.swt.widgets.Shell

        Display d = table.getDisplay();
        if (d == null)
          return;

        // We don't get mouse down notifications on trim or borders..
        toolTipShell = new Shell(table.getShell(), SWT.ON_TOP);
        FillLayout f = new FillLayout();
        try {
          f.marginWidth = 3;
          f.marginHeight = 1;
        } catch (NoSuchFieldError e) {
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

* @author Olivier
*
*/
public class TrackerChangerWindow {
  public TrackerChangerWindow(final Display display, final DownloadManager[] dms ) {
    final Shell shell = ShellFactory.createShell(display);
    shell.setText(MessageText.getString("TrackerChangerWindow.title"));
    Utils.setShellIcon(shell);
    GridLayout layout = new GridLayout();
    shell.setLayout(layout);

    Label label = new Label(shell, SWT.NONE);
    Messages.setLanguageText(label, "TrackerChangerWindow.newtracker");   
    GridData gridData = new GridData();
    gridData.widthHint = 200;
    label.setLayoutData(gridData);

    final Text url = new Text(shell, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = 300;
    url.setLayoutData(gridData);
    Utils.setTextLinkFromClipboard(shell, url, false);

    Composite panel = new Composite(shell, SWT.NULL);
    layout = new GridLayout();
    layout.numColumns = 3;
    panel.setLayout(layout);       
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    panel.setLayoutData(gridData);
    Button ok = new Button(panel, SWT.PUSH);
    ok.setText(MessageText.getString("Button.ok"));
    gridData = new GridData();
    gridData.widthHint = 70;
    ok.setLayoutData(gridData);
    shell.setDefaultButton(ok);
    ok.addListener(SWT.Selection, new Listener() {
      /* (non-Javadoc)
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event event) {
        try {
          for ( DownloadManager dm: dms ){
            TOTorrent  torrent = dm.getTorrent();
           
            if ( torrent != null ){
           
              TorrentUtils.announceGroupsInsertFirst( torrent, url.getText());
           
              TorrentUtils.writeToFile( torrent );
           
              TRTrackerAnnouncer announcer = dm.getTrackerClient();
             
              if ( announcer != null ){
           
                announcer.resetTrackerUrl(false);
              }
            }
          }
         
          shell.dispose();
        }
        catch (Exception e) {
          Debug.printStackTrace( e );
        }
      }
    });

    Button cancel = new Button(panel, SWT.PUSH);
    cancel.setText(MessageText.getString("Button.cancel"));
    gridData = new GridData();
    gridData.widthHint = 70;
    cancel.setLayoutData(gridData);
    cancel.addListener(SWT.Selection, new Listener() {
      /* (non-Javadoc)
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event event) {
        shell.dispose();
      }
    });

    shell.pack();
    Utils.createURLDropTarget(shell, url);
    shell.open();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

              stop(dm, shell, stateAfterStopped);
            }
          });
          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"
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.