Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.FillLayout


    if (isModal) {
      style |= SWT.APPLICATION_MODAL;
    }
    shell = ShellFactory.createShell(parent, style);

    shell.setLayout(new FillLayout());

    Utils.setShellIcon(shell);
   
    shell.setText(url);
   
View Full Code Here


        return arg0no - arg1no;
      }
    };

    canvas = new Canvas(parent, SWT.NO_BACKGROUND);
    canvas.setLayout(new FillLayout());

    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        if (img != null && !img.isDisposed()) {
          Rectangle bounds = img.getBounds();
View Full Code Here

    if (isModal) {
      style |= SWT.APPLICATION_MODAL;
    }
    shell = ShellFactory.createShell(parent, style);

    shell.setLayout(new FillLayout());

    Utils.setShellIcon(shell);
   
    browser = Utils.createSafeBrowser(shell, SWT.NONE);
    if (browser == null) {
View Full Code Here

    }
  }
 
  public void initialize(Composite composite) {
    panel = new Composite(composite,SWT.NULL);
    panel.setLayout(new FillLayout());   
    drawPanel = new VivaldiPanel(panel);   
    drawPanel.setAutoAlpha(autoAlpha);
  }
View Full Code Here

    this.display = display;
    this.icon = icon;
    detailsShell = new Shell(display,SWT.BORDER | SWT.ON_TOP);
    Utils.setShellIcon(detailsShell);
   
    detailsShell.setLayout(new FillLayout());
    StyledText textDetails = new StyledText(detailsShell, SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER)
    textDetails.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    textDetails.setWordWrap( true );
    detailsShell.layout();   
    detailsShell.setSize(550,300);   
View Full Code Here

  }

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

    };
    _core.getSearchManager().addSeachResultListener(listener);
    setLayout(new GridLayout(1,true));
   
    Composite search_bar_composite = new Composite(this,SWT.NONE);
    search_bar_composite.setLayout(new FillLayout());
    search_bar_composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Group search_bar = new Group(search_bar_composite,SWT.NONE);
    search_bar.setLayout(new GridLayout(1,true));
   
    Composite basic_search_controls = new Composite(search_bar,SWT.NONE);
    GridData layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.CENTER;
    basic_search_controls.setLayoutData(layout_data);
   
    layout = new GridLayout(6,false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    basic_search_controls.setLayout(layout);
   
    Label label = new Label(basic_search_controls,SWT.NONE);
    label.setText(_._("mainwindow.searchtab.label.search") + " : ");
   
    search_query = new Text(basic_search_controls,SWT.SINGLE | SWT.BORDER);
    layout_data = new GridData();
    layout_data.widthHint = 300;
    search_query.setLayoutData(layout_data);
   
    Button search_button = new Button(basic_search_controls,SWT.PUSH);
   
    search_button.setText(Localizer._("mainwindow.searchtab.button.search"));
    search_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        search();
      }
    });
   
    searchType = new Combo (basic_search_controls, SWT.READ_ONLY);
    searchType.add("Server");
    searchType.add("Kad");
    searchType.add("Both");
    searchType.select(0);
   
    Label adv_search = new Label(basic_search_controls,SWT.NONE);
    adv_search.setText(_._("mainwindow.searchtab.label.advanced"));

    Utils.formatAsLink(adv_search, new MouseAdapter() {
      public void mouseUp(MouseEvent arg0) {
        if (show_advanced_options) {
          new AdvancedSearchWindow(minFileSize,maxFileSize,fileType,extension,availableSources,completedSources){
            public void save(long minSize, long maxSize,
                FileType fileType, String extension,
                long availableSources, long completedSources) { 
                maxFileSize = maxSize;
                minFileSize = minSize;
               
                SearchTab.this.availableSources = availableSources;
                SearchTab.this.completedSources = completedSources;
                SearchTab.this.fileType = fileType;
                SearchTab.this.extension = extension;
               
                showAdvancedOptions();
            }
          };
        }else {
          new AdvancedSearchWindow(){
            public void save(long minSize, long maxSize,
                FileType fileType, String extension,
                long availableSources, long completedSources) { 
                maxFileSize = maxSize;
                minFileSize = minSize;
               
                SearchTab.this.availableSources = availableSources;
                SearchTab.this.completedSources = completedSources;
                SearchTab.this.fileType = fileType;
                SearchTab.this.extension = extension;
               
                showAdvancedOptions();
            }
          };
         
        }
      }
    });
       
    search_query.addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent arg0) {
        if (arg0.keyCode == SWT.CR) {
          search();
        }
      }
    } );
   
    clear_advanced_options = new Label(basic_search_controls,SWT.NONE);
    clear_advanced_options.setText(_._("mainwindow.searchtab.label.clear"));
    clear_advanced_options.setVisible(false);
   
    Utils.formatAsLink(clear_advanced_options, new MouseAdapter() {
      public void mouseUp(MouseEvent arg0) {
        hideAdvancedOptions();
      }       
    });
   
    Composite advanced_options = new Composite(search_bar,SWT.NONE);
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.FILL;
    advanced_options.setLayoutData(layout_data);
    advanced_options.setLayout(new GridLayout(1,false));
   
    advanced_info_search_label = new Label(advanced_options,SWT.NONE);
    layout_data = new GridData();
    layout_data.horizontalAlignment = GridData.CENTER;
    layout_data.grabExcessHorizontalSpace = true;
    advanced_info_search_label.setLayoutData(layout_data);
    advanced_info_search_label.setVisible(false);
   
    search_query_tab_list = new CTabFolder(this, SWT.BORDER);
    search_query_tab_list.setLayoutData(new GridData(GridData.FILL_BOTH));
    search_query_tab_list.setLayout(new FillLayout());
    search_query_tab_list.setSimple(false);
    search_query_tab_list.setUnselectedImageVisible(true);
    search_query_tab_list.setUnselectedCloseVisible(false);
   
  }
View Full Code Here

    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
   
    shell.setText(Localizer._("downloadinfowindow.title"));
    shell.setImage(SWTImageRepository.getImage("info.png"));
       
    shell.setLayout(new FillLayout());
   
    Composite content = new Composite(shell,SWT.BORDER);
    content.setLayout(new GridLayout(1,true));
    CTabFolder tab_folder = new CTabFolder(content,SWT.BORDER);
    tab_folder.setLayoutData(new GridData(GridData.FILL_BOTH));
View Full Code Here

    search_tab.setImage(SWTImageRepository.getImage("search_queue.png"));

    Composite content = new Composite(parent, SWT.NONE);

    search_tab.setControl(content);
    content.setLayout(new FillLayout());

    search_results = new JMTable<SearchResultItem>(content, SWT.NONE) {

      protected int compareObjects(SearchResultItem object1,
          SearchResultItem object2, int columnID, boolean order) {
View Full Code Here

   
    SashControl.createHorizontalSash(50, 50, this, dir_list, shared_files);
   
    GridLayout layout;
   
    dir_list.setLayout(new FillLayout());
    dir_list_content = new Group(dir_list,SWT.NONE);
    java.util.List<File> dir = null;
    try {
      dir = _core.getConfigurationManager().getSharedFolders();
    } catch (ConfigurationManagerException e) {
      e.printStackTrace();
    }
    if (dir != null)
      dir_list_content.setText(_._("mainwindow.sharedtab.group.shared_dirs")+"("+dir.size()+")");
    else
      dir_list_content.setText(_._("mainwindow.sharedtab.group.shared_dirs")+"(0)");
   
    config_listener = new ConfigurationAdapter() {
      public void sharedDirectoriesChanged(java.util.List<File> sharedDirs) {
        dir_list_content.setText(_._("mainwindow.sharedtab.group.shared_dirs")+"("+sharedDirs.size()+")");
      }
    };
   
    layout = new GridLayout(1,false);
    layout.marginWidth  = 2;
    layout.marginHeight = 2;
    dir_list_content.setLayout(layout);
   
    Composite control_block = new Composite(dir_list_content,SWT.NONE);
    layout = new GridLayout(4,false);
    layout.marginHeight = 0;
    layout.marginWidth  = 0;
    control_block.setLayout(layout);
    GridData data = new GridData();
    data.widthHint = 400;
    control_block.setLayoutData(data);
   
    Button add_button = new Button(control_block,SWT.NONE);
    add_button.setFont(skin.getButtonFont());
    add_button.setImage(SWTImageRepository.getImage("add.png"));
    add_button.setText(_._("mainwindow.sharedtab.button.add"));
    add_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    add_button.setAlignment(SWT.LEFT);
    add_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        DirectoryDialog dir_dialog = new DirectoryDialog (getShell(),SWT.MULTI | SWT.OPEN);
        String directory = dir_dialog.open();
        if (directory == null) return ;
        java.util.List<File> shared_dirs = null;
        try {
          shared_dirs = config_manager.getSharedFolders();
        } catch (ConfigurationManagerException e) {
          e.printStackTrace();
        }
        java.util.List<File> newDirs = new LinkedList<File>();
        if (shared_dirs == null)
          shared_dirs = new CopyOnWriteArrayList<File>();
        else
          shared_dirs = new CopyOnWriteArrayList<File>(shared_dirs);
       
        java.util.List<File> already_exist_list = org.jmule.core.utils.FileUtils.extractNewFolders(new File[]{new File(directory)},shared_dirs,newDirs);
                  
        if (already_exist_list.size()!=0) {
          AlreadyExistDirsWindow window = new AlreadyExistDirsWindow(already_exist_list);
          window.getCoreComponents();
          window.initUIComponents();
        }
        shared_dirs.addAll(newDirs);
        try {
          config_manager.setSharedFolders(shared_dirs);
        } catch (ConfigurationManagerException e) {
          e.printStackTrace();
        }
    } });
   
   
    remove_button = new Button(control_block,SWT.NONE);
    remove_button.setFont(skin.getButtonFont());
    remove_button.setText(_._("mainwindow.sharedtab.button.remove"));
    remove_button.setImage(SWTImageRepository.getImage("remove.png"));
    remove_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    remove_button.setAlignment(SWT.LEFT);
    remove_button.setEnabled(false);
    remove_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        removeSelectedDir();
    } });
   
    clear_button = new Button(control_block,SWT.NONE);
    clear_button.setFont(skin.getButtonFont());
    clear_button.setText(_._("mainwindow.sharedtab.button.clear"));
    clear_button.setImage(SWTImageRepository.getImage("remove_all.png"));
    clear_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    clear_button.setAlignment(SWT.LEFT);
    clear_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        clearDirList();
    } });
   
    Button reload_button = new Button(control_block,SWT.NONE);
    reload_button.setFont(skin.getButtonFont());
    reload_button.setText(_._("mainwindow.sharedtab.button.reload"));
    reload_button.setImage(SWTImageRepository.getImage("refresh.png"));
    reload_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        sharing_manager.loadCompletedFiles();
      }
    });
   
    shared_dir_list = new List (dir_list_content, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
    shared_dir_list.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    shared_dir_list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        String selected_dir = shared_dir_list.getSelection()[0];
        if (selected_dir.equals(last_selection)) return ;
        last_selection = selected_dir;
        updateFileList(selected_dir);
       
        int selection_id = shared_dir_list.getSelectionIndex();
        if ((selection_id>=no_remove_id_start)&&(selection_id<=no_remove_id_end)) {
          remove_button.setEnabled(false);
          return;
        }
        remove_button.setEnabled(true);
      }
    });

    shared_files.setLayout(new FillLayout());
    shared_files_group = new Group(shared_files,SWT.NONE);
    shared_files_group.setText(_._("mainwindow.sharedtab.group.shared_files"));
    shared_files_group.setLayout(new FillLayout());
    shared_files_table = new JMTable<SharedFile>(shared_files_group, SWT.NONE){
      protected int compareObjects(SharedFile object1, SharedFile object2,
          int columnID, boolean order) {
        if (columnID == SWTConstants.SHARED_LIST_FILE_NAME_COLUMN_ID) {
          return Misc.compareAllObjects(object1, object2, "getSharingName", order);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.layout.FillLayout

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.