Examples of Shell


Examples of org.eclipse.swt.widgets.Shell

          public void runSupport() {
            SWTThread instance = SWTThread.getInstance();
            if (instance == null || instance.isTerminated()) {
              return;
            }
            Shell anyShell = Utils.findAnyShell();
            Point location = null;
            if (anyShell != null) {
              Rectangle bounds = anyShell.getBounds();
              location = new Point(bounds.x, bounds.y);
            }
            Shell[] shells = instance.getDisplay().getShells();
            for (Shell shell : shells) {
              if (!shell.isDisposed()) {
                shell.dispose();
              }
            }
            Shell shell = new Shell(instance.getDisplay(), SWT.BORDER | SWT.TITLE);
            Utils.setShellIcon(shell);
            shell.setText("Shutting Down Vuze..");
            shell.setSize(200, 0);
            if (location != null) {
              shell.setLocation(location);
            }
            shell.open();
          }
        });
      }

    } finally {
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

  public static void _open(final boolean showNoLoad, final String sourceRef) {
    if (shell != null && !shell.isDisposed()) {
      return;
    }
    final Shell parentShell = Utils.findAnyShell();
    shell = ShellFactory.createShell(parentShell, SWT.BORDER
        | SWT.APPLICATION_MODAL | SWT.TITLE);
    shell.setLayout(new FillLayout());
    if (parentShell != null) {
      parentShell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
    }

    shell.addTraverseListener(new TraverseListener() {
      public void keyTraversed(TraverseEvent e) {
        if (e.detail == SWT.TRAVERSE_ESCAPE) {
          e.doit = false;
        }
      }
    });
   
    shell.addShellListener(new ShellAdapter() {
      public void shellClosed(ShellEvent e) {
        e.doit = false;
      }
    });
   
    shell.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        if (parentShell != null) {
          parentShell.setCursor(e.display.getSystemCursor(SWT.CURSOR_ARROW));
        }
        if (browserFunction != null && !browserFunction.isDisposed()) {
          browserFunction.dispose();
        }
        shell = null;
      }
    });

    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, "sendDonationEvent") {
      public Object function(Object[] arguments) {

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

        String text = (String) arguments[0];
        if (text.contains("page-loaded")) {
          pageLoadedOk = true;
          COConfigurationManager.setParameter("donations.count",
              COConfigurationManager.getLongParameter("donations.count", 1) + 1);
          Utils.centreWindow(shell);
          if (parentShell != null) {
            parentShell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
          }
          shell.open();
        } else if (text.contains("reset-ask-time")) {
          int time = reAskEveryHours;
          String[] strings = text.split(" ");
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

        params.put( "error", "template '" + id + "' not found" );

        sendBrowserMessage("metasearch", "exportTemplateFailed",params);
       
      }else{
        final Shell shell = Utils.findAnyShell();
       
        shell.getDisplay().asyncExec(
          new AERunnable()
          {
            public void
            runSupport()
            {
              FileDialog dialog =
                new FileDialog( shell, SWT.SYSTEM_MODAL | SWT.SAVE );
             
              dialog.setFilterPath( TorrentOpener.getFilterPathData() );
                         
              dialog.setText(MessageText.getString("metasearch.export.select.template.file"));
             
              dialog.setFilterExtensions(new String[] {
                  "*.vuze",
                  "*.vuz",
                  Constants.FILE_WILDCARD
                });
              dialog.setFilterNames(new String[] {
                  "*.vuze",
                  "*.vuz",
                  Constants.FILE_WILDCARD
                });
             
              String path = TorrentOpener.setFilterPathData( dialog.open());
   
              if ( path != null ){
               
                String lc = path.toLowerCase();
               
                if ( !lc.endsWith( ".vuze" ) && !lc.endsWith( ".vuz" )){
                 
                  path += ".vuze";
                }
               
                try{
                  engine.exportToVuzeFile( new File( path ));
                 
                  Map params = new HashMap();
                  params.put( "id", new Long( id ));
                  sendBrowserMessage( "metasearch", "exportTemplateCompleted", params );

                }catch( Throwable e ){
                 
                  Map params = new HashMap();
                  params.put( "id", new Long( id ));
                  params.put( "error", "save failed: " + Debug.getNestedExceptionMessage(e));

                  sendBrowserMessage("metasearch", "exportTemplateFailed",params);
                }
              }else{
               
                Map params = new HashMap();
                params.put( "id", new Long( id ));
                params.put( "error", "operation cancelled" );

                sendBrowserMessage("metasearch", "exportTemplateFailed",params);
              }
            }
          });
      }
    }else if ( OP_IMPORT_TEMPLATE.equals(opid)){
           
      final Shell shell = Utils.findAnyShell();
     
      shell.getDisplay().asyncExec(
        new AERunnable()
        {
          public void
          runSupport()
          {
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

          if (bringToFront) {
            uiFunctions.bringToFront();
          }
        }

        Shell shell = uiFunctions.getMainShell();
        if (shell != null) {
          new FileDownloadWindow(shell, url, dlInfo.getReferer(),
              dlInfo.getRequestProperties(),
              new TorrentDownloaderCallBackInterface() {
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

    }
  }

  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display, SWT.DIALOG_TRIM);
    shell.setSize(800, 600);

    new SimpleBrowserWindow(shell, "http://google.com", 0.8, 0.5, true, false);

    shell.open();

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

   
    if ( display.isDisposed()){         
      return;
    }
   
    shell = new Shell(display,type);           
   
    shell.setSize(250,150);
    Utils.setShellIcon(shell);
   
    FormLayout layout = new FormLayout();
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

    GCStringPrinter.printString(gc, "" + sortVal, printArea, true, true,
        SWT.RIGHT);
  }

  private void openFilesMiniView(DownloadManager dm, TableCell cell) {
    Shell shell = ShellFactory.createShell(Utils.findAnyShell(), SWT.SHELL_TRIM);

    shell.setLayout(new FillLayout());

    Rectangle bounds = ((TableCellSWT) cell).getBoundsOnDisplay();
    bounds.y += bounds.height;
    bounds.width = 630;
    bounds.height = (16 * dm.getNumFileInfos()) + 60;
    Rectangle realBounds = shell.computeTrim(0, 0, bounds.width, bounds.height);
    realBounds.width -= realBounds.x;
    realBounds.height -= realBounds.y;
    realBounds.x = bounds.x;
    realBounds.y = bounds.y;
    if (bounds.height > 500) {
      bounds.height = 500;
    }
    shell.setBounds(realBounds);
    shell.setAlpha(230);

    Utils.verifyShellRect(shell, true);

   
    final FilesView view = new FilesView(false);
    view.dataSourceChanged(dm);

    view.initialize(shell);

    Composite composite = view.getComposite();
    //composite.setLayoutData(null);
    shell.setLayout(new FillLayout());

    view.viewActivated();
    view.refresh();

    final UIUpdatable viewUpdater = new UIUpdatable() {
      public void updateUI() {
        view.refresh();
      }

      public String getUpdateUIName() {
        return view.getFullTitle();
      }
    };
    UIUpdaterSWT.getInstance().addUpdater(viewUpdater);

    shell.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        UIUpdaterSWT.getInstance().removeUpdater(viewUpdater);
      }
    });

    shell.layout(true, true);


    shell.setText(dm.getDisplayName());

    shell.open();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) { }
   
    display = SWTThread.getDisplay();
   
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
   
    MouseAdapter link_listener = new MouseAdapter() {
      public void mouseDoubleClick(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

   
    }catch(Throwable t) {}
   
    Display display = SWTThread.getDisplay();
   
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
   
    shell.setText(_._("advancedsearchwindow.title"));
   
    shell.setSize(500,300);
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell

    try {
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {
    }
   
    final Shell shell1=new Shell(SWTThread.getDisplay(),SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
   
    shell.setText(_._("sharedfilepropertieswindow.title"));
    shell.setImage(SWTImageRepository.getImage("info.png"));
   
    shell.setSize(500, 310);
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.