Package com.aelitis.azureus.ui.swt

Examples of com.aelitis.azureus.ui.swt.UIFunctionsSWT


         
          show();
         
        }else{
         
          UIFunctionsSWT functionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
          if (functionsSWT != null) {
            MainStatusBar mainStatusBar = functionsSWT.getMainStatusBar();
            if (mainStatusBar != null) {
              mainStatusBar.setUpdateNeeded(UpdateWindow.this);
            }
          }
        }
View Full Code Here


  }
 
 
  private void finishUpdate(boolean restartNow, boolean just_close ) {
    //When completing, remove the link in mainWindow :
    UIFunctionsSWT functionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (functionsSWT != null) {
      MainStatusBar mainStatusBar = functionsSWT.getMainStatusBar();
      if (mainStatusBar != null) {
        mainStatusBar.setUpdateNeeded(null);
      }
    }
   
    boolean bDisposeUpdateWindow = true;

    if ( !just_close ){
      //If restart is required, then restart
      if( restartRequired && restartNow) {
        // this HAS to be done this way around else the restart inherits
        // the 6880 port listen. However, this is a general problem....
        UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
        if (uiFunctions != null && uiFunctions.dispose(true, false)) {
           bDisposeUpdateWindow = false;
        }
      }else if ( hasMandatoryUpdates && !restartRequired ){
       
          // run a further update check as we can immediately install non-mandatory updates now
View Full Code Here

   * @return
   */
  public static Menu createDebugMenuItem(final Menu menu) {
    MenuItem item;

    final UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (null == uiFunctions) {
      throw new IllegalStateException(
          "UIFunctionsManagerSWT.getUIFunctionsSWT() is returning null");
    }

    item = new MenuItem(menu, SWT.CASCADE);
    item.setText("&Debug");
    Menu menuDebug = new Menu(menu.getParent(), SWT.DROP_DOWN);
    item.setMenu(menuDebug);

    item = new MenuItem(menuDebug, SWT.CASCADE);
    item.setText("ScreenSize");
    Menu menuSS = new Menu(menu.getParent(), SWT.DROP_DOWN);
    item.setMenu(menuSS);

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("640x400");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(640, 400);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("800x560");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(850, 560);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1024x700");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1024, 700);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1024x768");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1024, 768);
      }
    });
   
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1152x784");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1152, 784);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1280x720");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1280, 720);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1280x1024");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1280, 1024);
      }
    });
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1440x820");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1440, 820);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1600x970");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1600, 970);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1920x1200");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1920, 1200);
      }
    });
   
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("2560x1520");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(2560, 1520);
      }
    });

    item = new MenuItem(menuDebug, SWT.NONE);
    item.setText("Reload messagebundle");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        MessageText.loadBundle(true);
        DisplayFormatters.setUnits();
        DisplayFormatters.loadMessages();
        UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
        if (uiFunctions != null) {
          uiFunctions.refreshLanguage();
        }
      }
    });
   
    item = new MenuItem(menuDebug, SWT.CHECK);
View Full Code Here

    /*
     * Centers the window
     */

    UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (null == uiFunctions) {
      /*
       * Centers on the active monitor
       */
      Utils.centreWindow(shell);
    } else {
      /*
       * Centers on the main application window
       */
      Utils.centerWindowRelativeTo(shell, uiFunctions.getMainShell());
    }

    shell.open();
  }
View Full Code Here

    for (int i = 0; i < views.length; i++)
    addSection(views[i], manager);


    // Call plugin listeners
    UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (uiFunctions != null) {
      UISWTInstanceImpl pluginUI = uiFunctions.getSWTPluginInstanceImpl();
      Map pluginViews = pluginUI == null ? null
          : pluginUI.getViewListeners(UISWTInstance.VIEW_MYTORRENTS);
      if (pluginViews != null) {
        String[] sNames = (String[]) pluginViews.keySet().toArray(new String[0]);
        for (int i = 0; i < sNames.length; i++) {
          UISWTViewEventListener l = (UISWTViewEventListener) pluginViews.get(sNames[i]);
          if (l != null) {
            try {
              UISWTViewImpl view = new UISWTViewImpl(
                  UISWTInstance.VIEW_MYTORRENTS, sNames[i], l);
              addSection(view);
            } catch (Exception e) {
              // skip
            }
          }
        }
      }
    }
   

    // Initialize view when user selects it
    folder.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        folder.getShell().setCursor(e.display.getSystemCursor(SWT.CURSOR_WAIT));
        try {
          // Send one last refresh to previous tab, just in case it
          // wants to do something when view goes invisible
          refresh();
 
          CTabItem item = (CTabItem)e.item;
          if (item != null) {
            IView view = (IView)item.getData("IView");
            activeView = view;
            
            if (item.getControl() == null) {
              view.initialize(folder);
              item.setControl(view.getComposite());
            }
           
            item.getControl().setFocus();

            UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
            if (uiFunctions != null) {
              uiFunctions.refreshIconBar(); // For edit columns view
            }
          }
          refresh();
          ViewTitleInfoManager.refreshTitleInfo(ManagerView.this);
        } finally {
View Full Code Here

{

  public static Shell createMainShell(int styles) {
    Shell parent = null;

    UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();

    if (uiFunctions != null) {

      parent = uiFunctions.getMainShell();
    }

    if (parent == null) {

      return createShell(SWTThread.getInstance().getDisplay());
View Full Code Here

    if (null == toRegister)
      return null;

    if (Constants.isOSX) {
      UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
      if (uiFunctions == null) {
        System.err.println("Main window is not initialized yet");
      } else {
        uiFunctions.createMainMenu(toRegister);
      }
    }

    ShellManager.sharedManager().addWindow(toRegister);
View Full Code Here

    }

    static private int fixupStyle(int style) {
      if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL)) > 0
          && Utils.anyShellHaveStyle(SWT.ON_TOP | SWT.TITLE)) {
        UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
        if (uiFunctions != null && uiFunctions.getMainShell() != null) {
          style |= SWT.ON_TOP;
        }
      }
      return style;
    }
View Full Code Here

      if (!Constants.isOSX)
        super.setImages(images);
    }

    public void open() {
      UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
      if (uiFunctions != null) {
        Shell mainShell = uiFunctions.getMainShell();
        if (mainShell != null && mainShell.getMinimized()) {
          uiFunctions.bringToFront();
        }
      }
     
      Shell firstShellWithStyle = Utils.findFirstShellWithStyle(SWT.APPLICATION_MODAL);
      if (firstShellWithStyle != null && firstShellWithStyle != this) {
View Full Code Here

    } finally {
      plugin_helper_mon.exit();
    }
    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
        UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
        if (uiFunctions != null) {
          uiFunctions.closePluginViews(sViewID);
        }
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.ui.swt.UIFunctionsSWT

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.