Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Group


    upload_graphic.initialize(upload_canvas);
   
  }
 
  private void createAutoSpeedPanel() {
    autoSpeedPanel = new Group(mainPanel,SWT.NONE);
    GridData generalPanelData = new GridData(GridData.FILL_BOTH);
    autoSpeedPanel.setLayoutData(generalPanelData);
    Messages.setLanguageText(autoSpeedPanel,"SpeedView.stats.autospeed");
   
   
View Full Code Here


    Composite content = new Composite(tabFolder,SWT.NONE);
    setControl(content);
    content.setLayout(new GridLayout(1,false));
    Label label;
   
    Group general = new Group(content,SWT.NONE);
    GridLayout layout = new GridLayout(2,false);
    layout.marginWidth = 10;
    general.setLayout(layout);
    general.setText(Localizer._("uploadinfowindow.tab.general.title"));
    general.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filename")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getSharingName());
    label.setToolTipText(upload_session.getSharingName());
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filehash")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getFileHash().getAsString());
    label.setToolTipText(upload_session.getFileHash().getAsString());
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filesize")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(FileFormatter.formatFileSize(upload_session.getFileSize()));
    label.setToolTipText(FileFormatter.formatFileSize(upload_session.getFileSize()));
   
    label = new Label(general,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("uploadinfowindow.tab.general.label.ed2k_link") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    label = new Label(general,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getED2KLink().getAsString());
    label.setToolTipText(_._("uploadinfowindow.tab.general.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(upload_session.getED2KLink().getAsString());
      }
    });
   
    Group transfer = new Group(content,SWT.NONE);
    GridLayout transfer_layout = new GridLayout(2,false);
    transfer_layout.marginWidth = 10;
    transfer.setLayout(transfer_layout);
    transfer.setText(Localizer._("uploadinfowindow.tab.general.group.transfer"));
    transfer.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    label = new Label(transfer,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.transfer.label.uploadspeed")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
View Full Code Here

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

     
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {}
   
    downloads = new Group(download_panel,SWT.NONE);
    downloads.setFont(skin.getDefaultFont());
    downloads.setLayout(new FillLayout());
    download_list = new DownloadList(downloads,_core);
   
    uploads = new Group(upload_panel,SWT.NONE);
    uploads.setFont(skin.getDefaultFont());
    uploads.setLayout(new FillLayout());
    upload_list = new UploadList(uploads,_core);
   
    refreshable = new Refreshable() {
View Full Code Here

    setControl(content);
    content.setLayout(new GridLayout(1, false));

    Label label;

    Group transfer_group = new Group(content, SWT.NONE);
    transfer_group.setLayout(new GridLayout(2, false));
    transfer_group.setText(Localizer
        ._("downloadinfowindow.tab.general.group.transfer"));
    transfer_group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.status")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    download_status = new Label(transfer_group, SWT.NONE);
    download_status.setFont(skin.getLabelFont());
    download_status.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    download_status
        .setText(download_session.getStatus() == DownloadStatus.STARTED ? Localizer
            ._("mainwindow.transferstab.downloads.column.status.started")
            : Localizer
                ._("mainwindow.transferstab.downloads.column.status.stopped"));

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.totalprogress")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    total_progress = new Canvas(transfer_group, SWT.NONE);
    GridData grid_data = new GridData(GridData.FILL_HORIZONTAL);
    grid_data.heightHint = 20;
    total_progress.setLayoutData(grid_data);
    gap_list_painter = new GapListPainter(download_session.getGapList(),
        download_session.getFileSize());
    gap_list_painter.setMarginWidth(0);
    total_progress.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        gap_list_painter.draw(arg0.gc, 0, 0, arg0.width, arg0.height);
      }
    });

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.sources")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    sources_count = new Label(transfer_group, SWT.NONE);
    sources_count.setFont(skin.getLabelFont());
    sources_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    sources_count.setText(download_session.getPeerCount() + "("
        + download_session.getPartialSources() + ")");

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.filesize")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(transfer_group, SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(FileFormatter.formatFileSize(download_session
        .getFileSize()));

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.transferred")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    download_size = new Label(transfer_group, SWT.NONE);
    download_size.setFont(skin.getLabelFont());
    download_size.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    download_size.setText(FileFormatter.formatFileSize(download_session
        .getTransferredBytes()));

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.remaining")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    remaining_label = new Label(transfer_group, SWT.NONE);
    remaining_label.setFont(skin.getLabelFont());
    remaining_label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    long remaining = (download_session.getFileSize() - download_session
        .getTransferredBytes());
    remaining_label.setText(FileFormatter.formatFileSize(remaining));

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer._("downloadinfowindow.tab.general.label.parts")
        + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label.setFont(skin.getLabelFont());
    part_status = new Label(transfer_group, SWT.NONE);
    part_status.setFont(skin.getLabelFont());
    part_status.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    part_status
        .setText(download_session.getPartCount()
            + "; "
            + Localizer
                ._("downloadinfowindow.tab.general.label.parts_available")
            + " : " + download_session.getAvailablePartCount());

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.download_speed")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    speed = new Label(transfer_group, SWT.NONE);
    speed.setFont(skin.getLabelFont());
    speed.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    String download_speed = SpeedFormatter.formatSpeed(download_session
        .getSpeed());
    speed.setText(download_speed);

    label = new Label(transfer_group, SWT.NONE);
    label.setText(Localizer._("downloadinfowindow.tab.general.label.eta")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    eta = new Label(transfer_group, SWT.NONE);
    eta.setFont(skin.getLabelFont());
    eta.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    String download_eta = TimeFormatter.formatColon(download_session
        .getETA());
    eta.setText(download_eta);

    Group general_group = new Group(content, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = 10;
    general_group.setLayout(layout);
    general_group.setText(Localizer._("downloadinfowindow.group.general"));
    general_group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(general_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.filename")
        + " : ");
View Full Code Here

   
    final Composite tab_content = new Composite(this,SWT.NONE);
    tab_content.setLayoutData(new GridData(GridData.FILL_BOTH));
    tab_content.setLayout(new FormLayout());
       
    routing_table_container = new Group(tab_content,SWT.NONE);
    Group kad_tasks_container = new Group(tab_content,SWT.NONE);
    routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes"));
    kad_tasks_container.setText(_._("mainwindow.kadtab.kad_tasks"));
    SashControl.createHorizontalSash(30, 80, tab_content, routing_table_container, kad_tasks_container);
    GridLayout grid_layout = new GridLayout(1,false);
    grid_layout.marginWidth = 0;
    grid_layout.marginHeight = 0;
    routing_table_container.setLayout(grid_layout);
   
    Composite buttons_composite = new Composite(routing_table_container, SWT.NONE);
    GridData g = new GridData(GridData.FILL_HORIZONTAL);
    buttons_composite.setLayoutData(g);
    buttons_composite.setLayout(new GridLayout(1,false));
   
    final Button setKadStatus = new Button(buttons_composite, SWT.NONE);
    try {
      setKadStatus.setEnabled(_core.getConfigurationManager().isJKadAutoconnectEnabled());
    } catch (ConfigurationManagerException e) {
      e.printStackTrace();
      setKadStatus.setEnabled(false);
    }
    g = new GridData();
    g.widthHint = 150;
    setKadStatus.setLayoutData(g);
    setKadStatus.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (_core.getJKadManager().isConnected())
          _core.getJKadManager().disconnect();
        else
          if (_core.getJKadManager().isConnecting())
            _core.getJKadManager().disconnect();
          else
            if (_core.getJKadManager().isDisconnected()) {
              setKadStatus.setEnabled(false);
              Display.getDefault().asyncExec(new Runnable() {
                public void run() {
                  _core.getJKadManager().connect();
                }
              });
            }
             
      }
    });
   
    if (_core.getJKadManager().isConnected())
      setKadStatus.setText(_._("mainwindow.kadtab.disconnect"));
    if (_core.getJKadManager().isConnecting())
      setKadStatus.setText(_._("mainwindow.kadtab.stop_connecting"));
    if (_core.getJKadManager().isDisconnected())
      setKadStatus.setText(_._("mainwindow.kadtab.connect"));
   
    _core.getJKadManager().addJKadListener(new JKadListener() {
      public void JKadIsConnected() {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            setKadStatus.setEnabled(true);
            setKadStatus.setText(_._("mainwindow.kadtab.disconnect"));
          }
        });
      }

      public void JKadIsConnecting() {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            setKadStatus.setEnabled(true);
            setKadStatus.setText(_._("mainwindow.kadtab.stop_connecting"));
          }
        });
      }

      public void JKadIsDisconnected() {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            setKadStatus.setEnabled(true);
            routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes"));
            setKadStatus.setText(_._("mainwindow.kadtab.connect"));
           
          }
        });
      }
     
    });
   
    contact_list = new JMTable<KadContact>(routing_table_container,SWT.NONE){
      protected int compareObjects(KadContact object1,
          KadContact object2, int columnID, boolean order) {
        int result = 0;
        if (columnID == KAD_CLIENT_ID_COLUMN_ID)
          result = object1.getContactID().toHexString().compareTo(object2.getContactID().toHexString());
       
        if (columnID == KAD_CLIENT_DISTANCE_COLUMN_ID)
          result = object1.getContactDistance().toBinaryString().compareTo(object2.getContactDistance().toBinaryString());
       
        if (!order)
          result = Misc.reverse(result);
        return result;
      }

      protected Menu getPopUpMenu() {
       
        return null;
      }


      public void updateRow(KadContact object) {
        String imageName = "";
        if (object.getContactType() == ContactType.Active2MoreHours) imageName="contact0.png";
        if (object.getContactType() == ContactType.Active1Hour) imageName="contact1.png";
        if (object.getContactType() == ContactType.Active) imageName="contact2.png";
        if (object.getContactType() == ContactType.JustAdded) imageName="contact3.png";
        if (object.getContactType() == ContactType.ScheduledForRemoval) imageName="contact4.png";
        setRowImage(object, KAD_CLIENT_ID_COLUMN_ID, SWTImageRepository.getImage(imageName));
        setRowText(object, KAD_CLIENT_ID_COLUMN_ID, object.getContactID().toHexString());
        setRowText(object, KAD_CLIENT_DISTANCE_COLUMN_ID, object.getContactDistance().toBinaryString());
      }
     
    };
    contact_list.setLayoutData(new GridData(GridData.FILL_BOTH));
    contact_list.addColumn(SWT.LEFT, KAD_CLIENT_ID_COLUMN_ID, _._("mainwindow.kadtab.contact_list.column.contact_id"), _._("mainwindow.kadtab.contact_list.column.contact_id.desc"), swtPreferences.getColumnWidth(KAD_CLIENT_ID_COLUMN_ID));
    contact_list.addColumn(SWT.LEFT, KAD_CLIENT_DISTANCE_COLUMN_ID, _._("mainwindow.kadtab.contact_list.column.contact_distance"), _._("mainwindow.kadtab.contact_list.column.contact_distance.desc"), swtPreferences.getColumnWidth(KAD_CLIENT_DISTANCE_COLUMN_ID));
   
    _core.getJKadManager().getRoutingTable().addListener(new RoutingTableListener() {
      public void contactAdded(final KadContact contact) {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            contact_list.addRow(contact);
            routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes_number",contact_list.getItemCount()+""));
          }
         
        });
       
      }

      public void contactRemoved(final KadContact contact) {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            contact_list.removeRow(contact);
            routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes_number",contact_list.getItemCount()+""));
          }
         
        });
      }

      public void contactUpdated(final KadContact contact) {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            contact_list.updateRow(contact);
            routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes_number",contact_list.getItemCount()+""));
          }
         
        });
      }

      public void allContactsRemoved() {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            if (isDisposed()) return;
            contact_list.clear();
          }
         
        });
      }
     
    });
   
    for(KadContact contact : _core.getJKadManager().getRoutingTable().getContacts())
      contact_list.addRow(contact);
   
    routing_table_container.setText(_._("mainwindow.kadtab.kad_nodes_number",contact_list.getItemCount()+""));
   
    kad_tasks_container.setLayout(new FillLayout());
    kad_task_list = new JMTable<KadTask>(kad_tasks_container,SWT.NONE) {

      protected int compareObjects(KadTask object1, KadTask object2,
          int columnID, boolean order) {
        int result = 0;
View Full Code Here

  protected SWTSkin skin;
 
  protected List<AbstractTab> child_tabs = null;
 
  public AbstractTab(Composite parent) {
    content = new Group(parent, SWT.NONE);

    _core = JMuleCoreFactory.getSingleton();
       
    skin = null;
    try {
View Full Code Here

      layout_data.horizontalSpan = 2;
      show_nightly_build_warning.setLayoutData(layout_data);
      show_nightly_build_warning.setSelection(swt_preferences.isNightlyBuildWarning());
    }
   
    Group ports = new Group(content,SWT.NONE);
    ports.setText(_._("settingswindow.tab.general.group.ports"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.horizontalSpan = 2;
    ports.setLayoutData(layout_data);
   
    ports.setLayout(new GridLayout(2,false));
   
    label = new Label(ports,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.tcp_port") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    tcp_port = new Spinner (ports, SWT.BORDER);
    tcp_port.setMinimum(1);
    tcp_port.setMaximum(65535);
    try {
      tcp_port.setSelection(config_manager.getTCP());
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    tcp_port.setIncrement(1);
    tcp_port.setPageIncrement(100);

    label = new Label(ports,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.udp_port") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container1 = new Composite(ports,SWT.NONE);
    container1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(2,false);
    layout.marginWidth=0;
    layout.marginHeight=0;
    container1.setLayout(layout);
   
    udp_port = new Spinner (container1, SWT.BORDER);
    udp_port.setMinimum(1);
    udp_port.setMaximum(65535);
    try {
      udp_port.setSelection(config_manager.getUDP());
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    udp_port.setIncrement(1);
    udp_port.setPageIncrement(100);
   
    enable_udp = new Button(container1,SWT.CHECK);
    enable_udp.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_udp.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateUDPControls();
      }
     
    });
    try {
      enable_udp.setSelection(config_manager.isUDPEnabled());
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    updateUDPControls();
   
    Group limits = new Group(content,SWT.NONE);
    limits.setText(_._("settingswindow.tab.general.group.limits"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.horizontalSpan = 2;
    limits.setLayoutData(layout_data);
    limits.setLayout(new GridLayout(2,false));
   
    label = new Label(limits,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.download_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container2 = new Composite(limits,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    container2.setLayoutData(layout_data);
    layout = new GridLayout(3,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container2.setLayout(layout);
   
    download_limit = new Text(container2,SWT.BORDER );
    download_limit.addListener(SWT.Verify, number_filter);
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    download_limit.setLayoutData(layout_data);
    try {
      download_limit.setText((config_manager.getDownloadLimit()/1024)+"");
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    new Label(container2,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
   
    enable_download_limit = new Button(container2,SWT.CHECK);
    enable_download_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_download_limit.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateDownloadLimitControls();
      }
    });
   
    label = new Label(limits,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.upload_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container3 = new Composite(limits,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    container3.setLayoutData(layout_data);
    layout = new GridLayout(3,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container3.setLayout(layout);
   
    upload_limit = new Text(container3,SWT.BORDER );
    upload_limit.addListener(SWT.Verify, number_filter);
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    upload_limit.setLayoutData(layout_data);
    try {
      upload_limit.setText((config_manager.getUploadLimit()/1024)+"");
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    new Label(container3,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
   
    enable_upload_limit = new Button(container3,SWT.CHECK);
    enable_upload_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_upload_limit.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateUploadLimitControls();
      }
    });
   
    boolean enable = false;
    try {
      enable = config_manager.getDownloadLimit()==0 ? false : true;
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    enable_download_limit.setSelection(enable);
   
    try {
      enable = config_manager.getUploadLimit() == 0 ? false : true;
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    enable_upload_limit.setSelection(enable);
   
    updateDownloadLimitControls();
    updateUploadLimitControls();
   
    Group capacities = new Group(content,SWT.NONE);
    capacities.setText(_._("settingswindow.tab.general.group.capacities"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.horizontalSpan = 2;
    capacities.setLayoutData(layout_data);
    capacities.setLayout(new GridLayout(2,false));
   
    label = new Label(capacities,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.download_capacity") + " : ");
View Full Code Here

    shell.setImage(SWTImageRepository.getImage("import.png"));
   
   
    shell.setLayout(new GridLayout(1,false));
   
    Group group = new Group(shell,SWT.NONE);
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    group.setLayout(new GridLayout(3,false));
   
    Label label = new Label(group,SWT.NONE);
    label.setText(_._("serverlistimportwindow.label.file_path")+" : ");
   
    file_path = new Text(group,SWT.BORDER );
View Full Code Here

TOP

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

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.