Examples of SWTSkin


Examples of org.jmule.ui.swt.skin.SWTSkin

    super(shell);
   
    _core = core;
    sharing_manager = _core.getSharingManager();
    config_manager = _core.getConfigurationManager();
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}
   
    setLayout(new FormLayout());
   
    Composite dir_list = new Composite(this,SWT.NONE);
    Composite shared_files = new Composite(this,SWT.NONE);
   
    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();
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public void getCoreComponents() {
   
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    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(_._("alreadyexistdirswindow.title"));
   
    shell.setLayout(new GridLayout(1,false));
   
    Label info = new Label(shell,SWT.NONE);
    info.setFont(skin.getLabelFont());
    info.setText(_._("alreadyexistdirswindow.label.info"));
   
    List file_list = new List(shell,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    file_list.setLayoutData(new GridData(GridData.FILL_BOTH));
    for(File file : list)
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  private Shell shell;
  private SearchResultItem search_result;
 
  public SearchPropertiesWindow(SearchResultItem item) {
    SWTSkin skin = null;
    try {
     
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {}
   
    GridLayout layout;
   
    search_result = item;
   
    final Shell shell1=new Shell(SWTThread.getDisplay(),SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
    shell.setImage(SWTImageRepository.getImage("info.png"));
    shell.setText(_._("searchpropertieswindow.title"));
    shell.setSize(500, 310);
   
    Utils.centreWindow(shell);
    shell.setLayout(new GridLayout(1,false));
    Composite search_fields = new Composite(shell,SWT.BORDER);
    search_fields.setLayout(new GridLayout(2,false));
    search_fields.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_BOTH));

    Label label;
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.filename")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(search_result.getFileName());
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.filesize")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(FileFormatter.formatFileSize(search_result.getFileSize()));

    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.availability")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText((search_result.getFileAviability())+"");
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.completesrc")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText((search_result.getFileCompleteSrc())+"");
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.type")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    byte[] fileType = search_result.getMimeType();
    label.setText(FileFormatter.formatMimeType(fileType));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.filehash")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(search_result.getFileHash().getAsString());

    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("sharedfilepropertieswindow.label.ed2k_link") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(search_result.getAsED2KLink().getAsString());
    label.setToolTipText(_._("searchpropertieswindow.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(search_result.getAsED2KLink().getAsString());
      }
    });
   
    label = new Label(search_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("searchpropertieswindow.label.filequality") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container1 = new Composite(search_fields,SWT.NONE);
    container1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(2,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container1.setLayout(layout);
   
    label = new Label(container1,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setImage(SWTImageRepository.getImage(search_result.getFileQuality()));
   
    label = new Label(container1,SWT.NONE);
    label.setFont(skin.getDefaultFont());
   
    switch(search_result.getFileQuality()) {
      case FAKE : label.setText(_._("searchpropertieswindow.label.fq_fake")); break;
      case POOR : label.setText(_._("searchpropertieswindow.label.fq_poor")); break;
      case FAIR : label.setText(_._("searchpropertieswindow.label.fq_fair")); break;
      case GOOD : label.setText(_._("searchpropertieswindow.label.fq_good")); break;
      case EXCELLENT : label.setText(_._("searchpropertieswindow.label.fq_excellent")); break;
      default : label.setText(_._("searchpropertieswindow.label.fq_not_rated")); break;
    }
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    layout = new GridLayout(2,false);
    button_bar.setLayout(layout);
 
    Button button = new Button(button_bar,SWT.NONE);
    button.setFont(skin.getButtonFont());
    button.setText(_._("searchpropertieswindow.button.close"));
   
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

    SashControl.createHorizontalSash(50, 50, this, download_panel, upload_panel);
   
    download_panel.setLayout(new FillLayout());
    upload_panel.setLayout(new FillLayout());
   
    SWTSkin skin = null;
    try {
     
        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() {
      public void refresh() {
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

      final DownloadSession download_Session) {
    super(tabFolder, SWT.NONE);

    download_session = download_Session;
    setText(Localizer._("downloadinfowindow.tab.general.title"));
    SWTSkin skin = null;
    try {
      skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
    } catch (Throwable t) {
    }

    Composite content = new Composite(tabFolder, SWT.NONE);
    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")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general_group, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(download_session.getSharingName());
    label.setToolTipText(download_session.getSharingName());

    label = new Label(general_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.partmet")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general_group, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(download_session.getSharingName() + ".part.met");
    label.setToolTipText(download_session.getMetFilePath());

    label = new Label(general_group, SWT.NONE);
    label.setText(Localizer
        ._("downloadinfowindow.tab.general.label.filehash")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general_group, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(download_session.getFileHash() + "");
    label.setForeground(SWTThread.getDisplay().getSystemColor(
        SWT.COLOR_BLUE));

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

    label = new Label(general_group, SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(download_session.getED2KLink().getAsString());
    label.setToolTipText(_
        ._("downloadinfowindow.tab.general.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public void getCoreComponents() {
   
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }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 | SWT.RESIZE);
    shell.setText(Localizer._("uploadinfowindow.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));
    tab_folder.setSimple(false);

    UploadGeneralTab general_tab = new UploadGeneralTab(tab_folder,upload_session);
    tabs.add(general_tab);
    tab_folder.setSelection(general_tab);
   
    UploadPeerListTab upload_tab = new UploadPeerListTab(tab_folder,upload_session);
    tabs.add(upload_tab);
   
    for(Refreshable refreshable : tabs)
      GUIUpdater.getInstance().addRefreshable(refreshable);
   
    Composite buttons_composite = new Composite(content,SWT.NONE);
    buttons_composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    buttons_composite.setLayout(new GridLayout(1,false));
    Button button_close = new Button(buttons_composite,SWT.NONE);
    GridData grid_data = new GridData();
    grid_data.widthHint = 70;
    grid_data.horizontalAlignment = GridData.END;
    grid_data.grabExcessHorizontalSpace = true;
    button_close.setLayoutData(grid_data);
   
    button_close.setFont(skin.getButtonFont());
    button_close.setText(Localizer._("uploadinfowindow.button.close"));
   
    button_close.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        for(Refreshable refreshable : tabs) {
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

    config_manager = _core.getConfigurationManager();
    network_manager = _core.getNetworkManager();
   
    SWTServerListWrapper.getInstance().setStatusBar(this);
   
    SWTSkin skin = null;
    try {
      skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}
   
   
   
    grid_data = new GridData(GridData.FILL_HORIZONTAL);
    grid_data.heightHint = 16;
   
    setLayoutData(grid_data);

    GridLayout layout = new GridLayout(8,false);
   
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    setLayout(layout);

    img_label = new Label(this,SWT.NONE);
    Image img = SWTImageRepository.getImage("toolbar_disconnected.png");
    img_label.setImage(img);
   
    connection_status_label = new Label(this,SWT.NONE);
    connection_status_label.setFont(skin.getLabelFont());
    connection_status_label.setText(Localizer._("mainwindow.statusbar.label.disconnected"));

    GridData data = new GridData();
    data.heightHint = 16;
   
    new Label(this,SWT.SEPARATOR | SWT.VERTICAL).setLayoutData(data);
   
    client_id_label = new Label(this,SWT.NONE);
    client_id_label.setFont(skin.getLabelFont());
    client_id_label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
   
    downimg_label = new Label(this,SWT.NONE);
    downimg_label.setImage(SWTImageRepository.getImage("down.gif"));
    downimg_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    downspeed_label = new Label(this,SWT.NONE);
    downspeed_label.setFont(skin.getLabelFont());
    downspeed_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    downspeed_label.setText("");

    upimg_label = new Label(this,SWT.NONE);
    upimg_label.setImage(SWTImageRepository.getImage("up.gif"));
    upimg_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    upspeed_label = new Label(this,SWT.NONE);
    upspeed_label.setFont(skin.getLabelFont());
    upspeed_label.setText("");
    upspeed_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    setStatusDisconnected();
   
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

 
  public void getCoreComponents() {
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    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 );

    shell.setSize(500, 620);
   
    Utils.centreWindow(shell);
   
    shell.setText(_._("settingswindow.title"));
    shell.setImage(SWTImageRepository.getImage("properties.png"));
   
    shell.setLayout(new GridLayout(1,false));
   
   
   
    Composite window_content = new Composite(shell,SWT.NONE);
    window_content.setLayout(new GridLayout(2,false));
    window_content.setLayoutData(new GridData(GridData.FILL_BOTH));

    tabs_tree = new Tree(window_content, SWT.BORDER);
   
    GridData ld = new GridData(GridData.FILL_VERTICAL);
    ld.widthHint = 120;
    tabs_tree.setLayoutData(ld);
   
    settings_tab_panel = new ScrolledComposite(window_content,SWT.NONE);
    settings_tab_panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    settings_tab_panel.setExpandHorizontal(true);
    settings_tab_panel.setExpandVertical(true);
    settings_tab_panel.setLayout(new FillLayout());
   
 
    tab_list.add(new GeneralTab(settings_tab_panel));
    //tab_list.add(new ConnectionTab(settings_tab_panel));
 
    completeList(null, tab_list);
     
    tabs_tree.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent e) {
        if (tabs_tree.getSelectionCount()==0) return ;
        TreeItem item = tabs_tree.getSelection()[0];
        AbstractTab selected_tab = (AbstractTab) item.getData(DATA_KEY);
        if (selectedTab != null) {
          if (!selectedTab.checkFields()) {
            e.doit = false;
            tabs_tree.setSelection(selectedItem);
            return;
          }
        }
        selectedTab = selected_tab;
        selectedItem = tabs_tree.getSelection()[0];
       
        settings_tab_panel.setContent(selected_tab.getTabContent());
      }
     
    });
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(3,false);
    button_bar.setLayout(layout);
   
    Button button_ok = new Button(button_bar,SWT.NONE);
    button_ok.setFont(skin.getButtonFont());
    button_ok.setText(_._("settingswindow.button.ok"));
    button_ok.setImage(SWTImageRepository.getImage("ok.png"));
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    button_ok.setLayoutData(grid_data);
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (apply())
          shell.close();
      }
    });
   
    Button button_cancel = new Button(button_bar,SWT.NONE);
    button_cancel.setFont(skin.getButtonFont());
    button_cancel.setText(_._("settingswindow.button.cancel"));
    button_cancel.setImage(SWTImageRepository.getImage("cancel.png"));
    grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 80;
    button_cancel.setLayoutData(grid_data);
    button_cancel.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        shell.close();
      }
    });
   
    Button button_apply = new Button(button_bar,SWT.NONE);
    button_apply.setFont(skin.getButtonFont());
    button_apply.setText(_._("settingswindow.button.apply"));
    button_apply.setImage(SWTImageRepository.getImage("accept.png"));
    grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 80;
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

        e1.printStackTrace();
      }
     
      return ;
    }
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}
    Display display = SWTThread.getDisplay();
    GridData grid_data;
   
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
    if  (type == WindowType.DOWNLOAD) {
      shell.setText(_._("newwindow.title.download"));
      shell.setImage(SWTImageRepository.getMenuImage("folder_down.png"));
    }
    else {
      shell.setText(_._("newwindow.title.server"));
      shell.setImage(SWTImageRepository.getMenuImage("server_add.png"));
    }
    shell.setSize(600, 300);
    shell.setLayout(new GridLayout(1,false));
   
    Composite content = new Composite(shell,SWT.NONE);
    content.setLayoutData(new GridData(GridData.FILL_BOTH));
    content.setLayout(new FillLayout());
    if  (type == WindowType.DOWNLOAD)
      table = new DownloadList(content);
    else
      table = new ServerList(content);
   
    CLabel learn_more_link = new CLabel(shell,SWT.NONE);
    learn_more_link.setText(_._("newwindow.label.about_ed2k_links"));
    learn_more_link.setData(JMConstants.ABOUT_ED2K_LINKS);
    learn_more_link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    learn_more_link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    learn_more_link.addMouseListener(new MouseAdapter() { 
        public void mouseDoubleClick(MouseEvent arg0) {
          String path = (String) ((CLabel) arg0.widget).getData();
          if (!Utils.launchProgram(path))
            Utils.showWarningMessage(shell, _._("newwindow.error_open_url.title")
                , Localizer._("newwindow.error_open_url",path));
        }
        public void mouseDown(MouseEvent arg0) {
          String path = (String) ((CLabel) arg0.widget).getData();
          if (!Utils.launchProgram(path))
            Utils.showWarningMessage(shell, _._("newwindow.error_open_url.title")
                , Localizer._("newwindow.error_open_url",path));
        }
    });
   
    Composite buttons_composite = new Composite(shell,SWT.BORDER);
    buttons_composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout grid_layout = new GridLayout(4,false);
    buttons_composite.setLayout(grid_layout);
   
    Button button_paste_ed2k_link = new Button(buttons_composite,SWT.NONE);
    button_paste_ed2k_link.setFont(skin.getButtonFont());
    button_paste_ed2k_link.setText(_._("newwindow.button.paste_ed2k_link"));
    button_paste_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    button_paste_ed2k_link.forceFocus();
    button_paste_ed2k_link.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.paste();
      }
    });
   
    Button button_clear = new Button(buttons_composite,SWT.NONE);
    button_clear.setFont(skin.getButtonFont());
    button_clear.setText(_._("newwindow.button.clear"));
    button_clear.setImage(SWTImageRepository.getImage("remove_all.png"));
    button_clear.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.clear();
      }
    });
   
    grid_data = new GridData();
    grid_data.widthHint = 70;
    grid_data.horizontalAlignment = GridData.END;
    grid_data.grabExcessHorizontalSpace = true;
   
    Button button_ok = new Button(buttons_composite,SWT.NONE);
    button_ok.setText(_._("newwindow.button.ok"));
    button_ok.setFont(skin.getButtonFont());
    button_ok.setImage(skin.getButtonImage(Skin.OK_BUTTON_IMAGE));
    button_ok.setLayoutData(grid_data);
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.save();
        shell.close();
      }
    });
   
    Button button_cancel = new Button(buttons_composite,SWT.NONE);
    button_cancel.setFont(skin.getButtonFont());
    button_cancel.setImage(skin.getButtonImage(Skin.CANCEL_BUTTON_IMAGE));
    button_cancel.setText(_._("newwindow.button.cancel"));
   
    button_cancel.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        shell.close();
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

 
  public void getCoreComponents() {
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    try {
      skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}

    shell = new Shell(parent_shell,SWT.BORDER);
    shell.setText(_._("nightlybuildwarningwindow.title"));
    shell.setImage(SWTThread.getDisplay().getSystemImage(SWT.COLOR_WHITE));
    shell.setSize(400,320);
    shell.setLayout(new FillLayout());
    Composite content = new Composite(shell,SWT.NONE);
   
    GridData grid_data;
    GridLayout grid_layout = new GridLayout(1,false);
    grid_layout.marginWidth = 0;
    grid_layout.marginHeight = 0;
   
    content.setLayout(grid_layout);
   
    final Label image = new Label(content,SWT.NONE);
    image.setImage(SWTImageRepository.getImage("bomb.png"));
    grid_data = new GridData();
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.horizontalAlignment = GridData.CENTER;
    image.setLayoutData(grid_data);
   
    Label window_message = new Label(content,SWT.NONE);
    window_message.setFont(skin.getLabelFont());
    grid_data = new GridData();
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.horizontalAlignment = GridData.CENTER;
    window_message.setLayoutData(grid_data);
    window_message.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
    window_message.setText(_._("nightlybuildwarningwindow.label.message1"));
   
    MouseAdapter link_listener = new MouseAdapter() {
      public void mouseDoubleClick(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("nightlybuildwarningwindow.error_open_url.title")
              , Localizer._("nightlybuildwarningwindow.error_open_url",path));
      }
      public void mouseDown(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("nightlybuildwarningwindow.error_open_url.title")
              , Localizer._("nightlybuildwarningwindow.error_open_url",path));
      }
    };

    Label window_message2 = new Label(content,SWT.NONE);
    window_message2.setFont(skin.getLabelFont());
    grid_data = new GridData();
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.horizontalAlignment = GridData.CENTER;
    window_message2.setLayoutData(grid_data);
    window_message2.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
    window_message2.setText(_._("nightlybuildwarningwindow.label.message2")+" " + (_._("nightlybuildwarningwindow.label.forum")));
   
    CLabel link = new CLabel(content,SWT.NONE);
    grid_data = new GridData();
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.horizontalAlignment = GridData.CENTER;
    link.setLayoutData(grid_data);
    link.setFont(skin.getLabelFont());
    link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    link.setText(JMConstants.JMULE_FORUMS);
    link.setData(JMConstants.JMULE_FORUMS);
    link.addMouseListener(link_listener);
   
    Composite controls_composite = new Composite(content,SWT.NONE);
    grid_data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END);
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.grabExcessVerticalSpace = true;
   
    controls_composite.setLayoutData(grid_data);
   
    controls_composite.setLayout(new GridLayout(2,false));
   
    final Button button_check = new Button(controls_composite,SWT.CHECK);
    grid_data = new GridData();
    button_check.setLayoutData(grid_data);
    button_check.setText(_._("nightlybuildwarningwindow.label.show_at_startup"));
    button_check.setSelection(SWTPreferences.getInstance().isNightlyBuildWarning());
   
    Button button = new Button(controls_composite,SWT.PUSH);
    grid_data = new GridData();
 
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    grid_data.horizontalAlignment = GridData.END;
    button.setLayoutData(grid_data);
    button.forceFocus();
    button.setText(_._("nightlybuildwarningwindow.button.ok"));
    button.setImage(skin.getButtonImage(SWTSkin.OK_BUTTON_IMAGE));
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        SWTPreferences.getInstance().setNightlyBuildWarning(button_check.getSelection());
        shell.close();
      }
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.