Package org.jmule.ui.swt.skin

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


    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

 
  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

        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

 
  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

  public void getCoreComponents() {
    server_manager = JMuleCoreFactory.getSingleton().getServerManager();
  }

  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(400, 130);
    Utils.centreWindow(shell);
    shell.setText(_._("serverlistimportwindow.title"));
    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 );
    file_path.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    browse_button = new Button(group,SWT.NONE);
    browse_button.setFont(skin.getButtonFont());
    browse_button.setText(_._("serverlistimportwindow.button.browse"));
   
    browse_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        FileDialog dialog = new FileDialog (shell, SWT.OPEN);
        dialog.setFilterNames (new String [] {"Server.met(*.met)", "All Files (*.*)"});
        dialog.setFilterExtensions (new String [] {"*.met", "*.*"});
        String result = dialog.open();
        if (result != null)
          file_path.setText(result);
    } });
   
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(2,false);
    button_bar.setLayout(layout);
   
    ok_button = new Button(button_bar,SWT.NONE);
    ok_button.setFont(skin.getButtonFont());
    ok_button.setText(_._("serverlistimportwindow.button.ok"));
    ok_button.setImage(SWTImageRepository.getImage("accept.png"));
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    ok_button.setLayoutData(grid_data);
    ok_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        importServerList();
    } });
   
   
    cancel_button = new Button(button_bar,SWT.NONE);
    cancel_button.setFont(skin.getButtonFont());
    cancel_button.setText(_._("serverlistimportwindow.button.cancel"));
    cancel_button.setImage(SWTImageRepository.getImage("cancel2.png"));
    grid_data = new GridData();
    grid_data.widthHint = 80;
    cancel_button.setLayoutData(grid_data);
View Full Code Here

        peak_thread_count.setText(thread_bean.getPeakThreadCount()+"");
        total_thread_count.setText(thread_bean.getTotalStartedThreadCount()+"");
      }
    };
   
    SWTSkin skin = null;
    try {
     
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {}
   
    Composite content;
    GridData layout_data;
    GridLayout layout;
    Label label;
   
    setLayout(new FillLayout());

    CTabFolder stats_tabs = new CTabFolder(this,SWT.BORDER);
    stats_tabs.setLayout(new FillLayout());
    stats_tabs.setSimple(false);
   
    CTabItem network_stats = new CTabItem(stats_tabs,SWT.NONE);
    network_stats.setText(_._("mainwindow.statisticstab.tab.general"));
    content = new Composite(stats_tabs,SWT.NONE);
    network_stats.setControl(content);
    content.setLayout(new GridLayout(2,true));
   
    Group sessions_stats = new Group(content,SWT.NONE);
    sessions_stats.setText(_._("mainwindow.statisticstab.tab.general.group.sessions"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    sessions_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    sessions_stats.setLayout(layout);
   
    label = new Label(sessions_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.session_downloaded") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label download_session_bytes = new Label(sessions_stats,SWT.NONE);
    download_session_bytes.setFont(skin.getLabelFont());
    download_session_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_SESSION_DOWNLOAD_BYTES, download_session_bytes);
   
    label = new Label(sessions_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.session_uploaded") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label upload_session_bytes = new Label(sessions_stats,SWT.NONE);
    upload_session_bytes.setFont(skin.getLabelFont());
    upload_session_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_SESSION_UPLOAD_BYTES, upload_session_bytes);
   
    label = new Label(sessions_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.session_download_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label download_session_count = new Label(sessions_stats,SWT.NONE);
    download_session_count.setFont(skin.getLabelFont());
    download_session_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    stats_fields.put(JMuleCoreStats.ST_NET_SESSION_DOWNLOAD_COUNT, download_session_count);
   
    label = new Label(sessions_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.session_upload_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label upload_session_count = new Label(sessions_stats,SWT.NONE);
    upload_session_count.setFont(skin.getLabelFont());
    upload_session_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    stats_fields.put(JMuleCoreStats.ST_NET_SESSION_UPLOAD_COUNT, upload_session_count);
   
    Group peers_stats = new Group(content,SWT.NONE);
    peers_stats.setText(_._("mainwindow.statisticstab.tab.general.group.peers"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING );
    peers_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    peers_stats.setLayout(layout);
   
    label = new Label(peers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.peer_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label peer_count = new Label(peers_stats,SWT.NONE);
    peer_count.setFont(skin.getLabelFont());
    peer_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_PEERS_COUNT, peer_count);
   
    label = new Label(peers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.download_peers") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label download_peers = new Label(peers_stats,SWT.NONE);
    download_peers.setFont(skin.getLabelFont());
    download_peers.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_PEERS_DOWNLOAD_COUNT, download_peers);
   
    label = new Label(peers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.upload_peers") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label upload_peers = new Label(peers_stats,SWT.NONE);
    upload_peers.setFont(skin.getLabelFont());
    upload_peers.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_PEERS_UPLOAD_COUNT, upload_peers);
   
    new Label(peers_stats,SWT.NONE);
   
    Group sesvers_stats = new Group(content,SWT.NONE);
    sesvers_stats.setText(_._("mainwindow.statisticstab.tab.general.group.servers"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING );
    sesvers_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    sesvers_stats.setLayout(layout);
   
    label = new Label(sesvers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.server_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label server_count = new Label(sesvers_stats,SWT.NONE);
    server_count.setFont(skin.getLabelFont());
    server_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_COUNT, server_count);
   
    label = new Label(sesvers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.server_alive_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label server_alive_count = new Label(sesvers_stats,SWT.NONE);
    server_alive_count.setFont(skin.getLabelFont());
    server_alive_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_ALIVE_COUNT, server_alive_count);
   
    label = new Label(sesvers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.server_dead_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label server_dead_count = new Label(sesvers_stats,SWT.NONE);
    server_dead_count.setFont(skin.getLabelFont());
    server_dead_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_DEAD_COUNT, server_dead_count);

    label = new Label(sesvers_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.search_query_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label search_query_count = new Label(sesvers_stats,SWT.NONE);
    search_query_count.setFont(skin.getLabelFont());
    search_query_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.SEARCHES_COUNT, search_query_count);
   
    layout_data = new GridData();
    layout_data.horizontalSpan = 2;
    new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data);
   
    layout_data = new GridData();
    layout_data.horizontalSpan = 2;
    new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data);
   
    Group sharing_stats = new Group(content,SWT.NONE);
    sharing_stats.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    sharing_stats.setLayout(new GridLayout(2,false));
    sharing_stats.setText(_._("mainwindow.statisticstab.tab.general.group.shared"));
    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label shared_files_count = new Label(sharing_stats,SWT.NONE);
    shared_files_count.setFont(skin.getLabelFont());
    shared_files_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COUNT, shared_files_count);
   
    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_partial_files") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label shared_partial_files = new Label(sharing_stats,SWT.NONE);
    shared_partial_files.setFont(skin.getLabelFont());
    shared_partial_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_COUNT, shared_partial_files);

    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_completed_files") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label shared_completed_files = new Label(sharing_stats,SWT.NONE);
    shared_completed_files.setFont(skin.getLabelFont());
    shared_completed_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_COUNT, shared_completed_files);

    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_bytes") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label shared_files_bytes = new Label(sharing_stats,SWT.NONE);
    shared_files_bytes.setFont(skin.getLabelFont());
    shared_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_BYTES, shared_files_bytes);

    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.completed_files_bytes") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label completed_files_bytes = new Label(sharing_stats,SWT.NONE);
    completed_files_bytes.setFont(skin.getLabelFont());
    completed_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_BYTES, completed_files_bytes);

    label = new Label(sharing_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.general.label.partial_files_bytes") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Label partial_files_bytes = new Label(sharing_stats,SWT.NONE);
    partial_files_bytes.setFont(skin.getLabelFont());
    partial_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_BYTES, partial_files_bytes);

    CTabItem jvm_stats = new CTabItem(stats_tabs,SWT.NONE);
    jvm_stats.setText(_._("mainwindow.statisticstab.tab.jvm"));
    content = new Composite(stats_tabs,SWT.NONE);
    jvm_stats.setControl(content);
    content.setLayout(new GridLayout(2,true));
   
    Group jvm_general_stats = new Group(content,SWT.NONE);
    jvm_general_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.general"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    jvm_general_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    jvm_general_stats.setLayout(layout);
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_name") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(runtime_bean.getVmName());
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_vendor") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(runtime_bean.getVmVendor());
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(runtime_bean.getVmVersion());
   
   
    label = new Label(jvm_general_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_uptime") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    jvm_uptime = new Label(jvm_general_stats,SWT.NONE);
    jvm_uptime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    jvm_uptime.setText(TimeFormatter.formatColon(runtime_bean.getUptime()/1000)+"");   

    Group heapmemory_stats = new Group(content,SWT.NONE);
    heapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.heap_memory"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    heapmemory_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    heapmemory_stats.setLayout(layout);
   
    label = new Label(heapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_init") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    heapmemory_init = new Label(heapmemory_stats,SWT.NONE);
    heapmemory_init.setFont(skin.getLabelFont());
    heapmemory_init.setText(FileFormatter.formatFileSize(heap_memory.getInit()));
   
    label = new Label(heapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_used") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    heapmemory_used = new Label(heapmemory_stats,SWT.NONE);
    heapmemory_used.setFont(skin.getLabelFont());
    heapmemory_used.setText(FileFormatter.formatFileSize(heap_memory.getUsed()));
   
    label = new Label(heapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_max") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    heapmemory_max = new Label(heapmemory_stats,SWT.NONE);
    heapmemory_max.setFont(skin.getLabelFont());
    heapmemory_max.setText(FileFormatter.formatFileSize(heap_memory.getMax()));
   
    new Label(heapmemory_stats,SWT.NONE);
   
    Group nonheapmemory_stats = new Group(content,SWT.NONE);
    nonheapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.nonheap_memory"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    nonheapmemory_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    nonheapmemory_stats.setLayout(layout);

    label = new Label(nonheapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_init") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    nonheapmemory_init = new Label(nonheapmemory_stats,SWT.NONE);
    nonheapmemory_init.setFont(skin.getLabelFont());
    nonheapmemory_init.setText(FileFormatter.formatFileSize(nonheap_memory.getInit()));
   
    label = new Label(nonheapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_used") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    nonheapmemory_used = new Label(nonheapmemory_stats,SWT.NONE);
    nonheapmemory_used.setFont(skin.getLabelFont());
    nonheapmemory_used.setText(FileFormatter.formatFileSize(nonheap_memory.getUsed()));
   
    label = new Label(nonheapmemory_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_max") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    nonheapmemory_max = new Label(nonheapmemory_stats,SWT.NONE);
    nonheapmemory_max.setFont(skin.getLabelFont());
    nonheapmemory_max.setText(FileFormatter.formatFileSize(nonheap_memory.getMax()));
   
    label = new Label(nonheapmemory_stats,SWT.NONE);
   
    Group thread_stats = new Group(content,SWT.NONE);
    thread_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.threads"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    thread_stats.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    thread_stats.setLayout(layout);
   
    label = new Label(thread_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.thread_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    thread_count = new Label(thread_stats,SWT.NONE);
    thread_count.setFont(skin.getLabelFont());
    thread_count.setText(thread_bean.getThreadCount()+"");
   
    label = new Label(thread_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.daemon_thread_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    daemon_thread_count = new Label(thread_stats,SWT.NONE);
    daemon_thread_count.setFont(skin.getLabelFont());
    daemon_thread_count.setText(thread_bean.getDaemonThreadCount()+"");
   
    label = new Label(thread_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.peak_thread_count") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    peak_thread_count = new Label(thread_stats,SWT.NONE);
    peak_thread_count.setFont(skin.getLabelFont());
    peak_thread_count.setText(thread_bean.getPeakThreadCount()+"");

    label = new Label(thread_stats,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count") + " : ");
    label.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip"));
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    total_thread_count = new Label(thread_stats,SWT.NONE);
    total_thread_count.setFont(skin.getLabelFont());
    total_thread_count.setText(thread_bean.getTotalStartedThreadCount()+"");
    total_thread_count.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip"));
   
    stats_tabs.setSelection(network_stats);
  }
View Full Code Here

  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.setImage(SWTImageRepository.getImage("server_properties.png"));
    shell.setSize(500, 310);
    shell.setText(Localizer._("serverpropertieswindow.title"));
 
    Utils.centreWindow(shell);
   
    shell.setLayout(new GridLayout(1,false));
     
    Composite server_fields = new Composite(shell,SWT.BORDER);
    server_fields.setLayout(new GridLayout(2,false));
    server_fields.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_BOTH));

    Label label;
   
    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_address")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    Composite server_info = new Composite(server_fields,SWT.NONE);
    GridLayout server_info_layout = new GridLayout(2,false);
    server_info_layout.marginWidth = 0;
    server_info_layout.marginHeight = 0;
    server_info.setLayout(server_info_layout);
 
    CountryLocator country_locator = CountryLocator.getInstance();
    if (!country_locator.isServiceDown()) {
      label = new Label(server_info,SWT.NONE);
      Image flag = SWTImageRepository.getFlagByAddress(server.getAddress(),FlagSize.S18x25);
      label.setImage(flag);
      String country_name = country_locator.getCountryName(server.getAddress());
      String country_code = country_locator.getCountryCode(server.getAddress());
     
      if (country_name.equals(CountryLocator.COUNTRY_NAME_NOT_AVAILABLE))
        country_name = Localizer._("serverpropertieswindow.label.country.unknown_name");
      if (country_code.equals(CountryLocator.COUNTRY_CODE_NOT_AVAILABLE))
        country_code = Localizer._("serverpropertieswindow.label.country.unknown_code");
      label.setToolTipText(country_name+" ("+country_code+")");
    }
   
    label = new Label(server_info,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(server.getAddress()+":"+server.getPort());

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_name") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label_name = new Label(server_fields,SWT.NONE);
    label_name.setFont(skin.getLabelFont());
    label_name.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_description") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    label_desc = new Label(server_fields,SWT.NONE);
    label_desc.setFont(skin.getDefaultFont());
    label_desc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_users") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
 
    label_users = new Label(server_fields,SWT.NONE);
    label_users.setFont(skin.getDefaultFont());
    label_users.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_files") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

   
    label_files = new Label(server_fields,SWT.NONE);
    label_files.setFont(skin.getDefaultFont());
    label_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_ping") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label_ping = new Label(server_fields,SWT.NONE);
    label_ping.setFont(skin.getDefaultFont());
    label_ping.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_hard_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label_hard_limit = new Label(server_fields,SWT.NONE);
    label_hard_limit.setFont(skin.getDefaultFont());
    label_hard_limit.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.server_soft_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    label_soft_limit = new Label(server_fields,SWT.NONE);
    label_soft_limit.setFont(skin.getDefaultFont());
    label_soft_limit.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serverpropertieswindow.label.version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
 
    label_version = new Label(server_fields,SWT.NONE);
    label_version.setFont(skin.getDefaultFont());
    label_version.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

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

    label = new Label(server_fields,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(server.getServerLink().getAsString());
    label.setToolTipText(_._("serverpropertieswindow.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(server.getServerLink().getAsString());
      }
    });
   
    GUIUpdater.getInstance().addRefreshable(this);
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(1,false);
    button_bar.setLayout(layout);

    Button button = new Button(button_bar,SWT.NONE);
    button.setFont(skin.getButtonFont());
    button.setText(Localizer._("serverpropertieswindow.close"));
    button.setFocus();
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
View Full Code Here

 
  public ConnectionInfo(Composite parent,JMuleCore core) {
    super(parent,SWT.BORDER);
    _core = core;
    SWTServerListWrapper.getInstance().setConnectionInfo(this);
    SWTSkin skin = null;
    try {
     
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {
    }
   
    setSimple(false);
   
    my_info = new CTabItem(this, SWT.NONE);
    my_info.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo"));
   
    server_info = new CTabItem(this, SWT.NONE);
    server_info.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo"));
   
    setSelection(my_info);

    Composite my_info_content = new Composite(this,SWT.NONE);
    my_info.setControl(my_info_content);
    my_info_content.setLayout(new GridLayout(2,false));
   
    Label label;
    label = new Label(my_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo.status")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    my_info_status = new Label(my_info_content,SWT.NONE);
    my_info_status.setFont(skin.getLabelFont());
    my_info_status.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(my_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo.id")+ " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    my_info_client_id = new Label(my_info_content,SWT.NONE);
    my_info_client_id.setFont(skin.getLabelFont());
    my_info_client_id.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(my_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo.ip") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    my_info_user_ip = new Label(my_info_content,SWT.NONE);
    my_info_user_ip.setFont(skin.getLabelFont());
    my_info_user_ip.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(my_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo.nickname") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    my_info_nickname = new Label(my_info_content,SWT.NONE);
    my_info_nickname.setFont(skin.getLabelFont());
    my_info_nickname.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    try {
      my_info_nickname.setText(_core.getConfigurationManager().getNickName());
    } catch (ConfigurationManagerException e) {
      e.printStackTrace();
    }
    _core.getConfigurationManager().addConfigurationListener(new ConfigurationAdapter() {
      public void nickNameChanged(String nickName) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            try {
              my_info_nickname.setText(_core.getConfigurationManager().getNickName());
            } catch (ConfigurationManagerException e) {
              e.printStackTrace();
            }
          }
        });
      }
    });
   
    label = new Label(my_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.myinfo.sharedfiles") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    my_info_sharedcount = new Label(my_info_content,SWT.NONE);
    my_info_sharedcount.setFont(skin.getLabelFont());
    my_info_sharedcount.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    my_info_sharedcount.setText(_core.getSharingManager().getFileCount()+"");
    //my_info_scroll.setContent(my_info_content);
   
    //ScrolledContent server_info_scroll = new ScrolledContent(this);
    //server_info.setControl(server_info_scroll);

    Composite server_info_content = new Composite(this,SWT.NONE);
    server_info_content.setLayout(new GridLayout(2,false));
    server_info.setControl(server_info_content);
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.address")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_address = new Label(server_info_content,SWT.NONE);
    server_address.setFont(skin.getLabelFont());
    server_address.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.name") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_name = new Label(server_info_content,SWT.NONE);
    server_name.setFont(skin.getLabelFont());
    server_name.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.desc") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_desc = new Label(server_info_content,SWT.NONE);
    server_desc.setFont(skin.getLabelFont());
    server_desc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.users") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_users = new Label(server_info_content,SWT.NONE);
    server_users.setFont(skin.getLabelFont());
    server_users.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.files") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_files = new Label(server_info_content,SWT.NONE);
    server_files.setFont(skin.getLabelFont());
    server_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.ping") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_ping = new Label(server_info_content,SWT.NONE);
    server_ping.setFont(skin.getLabelFont());
    server_ping.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.hardlimit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_hard_limit = new Label(server_info_content,SWT.NONE);
    server_hard_limit.setFont(skin.getLabelFont());
    server_hard_limit.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.softlimit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_soft_limit = new Label(server_info_content,SWT.NONE);
    server_soft_limit.setFont(skin.getLabelFont());
    server_soft_limit.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label = new Label(server_info_content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("mainwindow.serverlisttab.connectioninfo.serverinfo.version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    server_version = new Label(server_info_content,SWT.NONE);
    server_version.setFont(skin.getLabelFont());
    server_version.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    //server_info_scroll.setContent(server_info_content);
   
    setStatusDisconnected();
View Full Code Here

*/
public class ServerMessages extends Text {

  public ServerMessages(Composite composite) {
    super(composite,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}
   
    setFont(skin.getDefaultFont());
    setEditable(false);
    setBackground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    SWTServerListWrapper.getInstance().setServerMessages(this);
   
    Menu popup_menu = new Menu(this);
View Full Code Here

TOP

Related Classes of org.jmule.ui.swt.skin.SWTSkin

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.