Examples of SWTSkin


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

  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

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

        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

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.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

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

 
  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

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

*/
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

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

   
  }

  public void initUIComponents() {
    String title = Localizer._("serveraddwindow.title");
    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);
   
    shell.setImage(SWTImageRepository.getImage("server_add.png"));
    shell.setText(title);
   
    Utils.centreWindow(shell);
   
    shell.setLayout(new GridLayout(1,true));
   
    Composite content = new Composite(shell,SWT.BORDER);
    content.setLayoutData(new GridData(GridData.FILL_BOTH));
    content.setLayout(new GridLayout(2,false));
   
    Label label = new Label(content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serveraddwindow.server_ip_address")+" : ");
   
    final Text text_server_ip = new Text(content,SWT.BORDER);
    text_server_ip.setFont(skin.getDefaultFont());
    text_server_ip.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    text_server_ip.addListener(SWT.Verify,new Listener() {
      public void handleEvent(Event e) {
            String text = e.text;
            char[] chars = new char[text.length()];
            text.getChars(0, chars.length, chars, 0);
            for (int i = 0; i < chars.length; i++) {
              if (!('0' <= chars[i] && chars[i] <= '9'))
                if (chars[i]!='.') {
               
                  e.doit = false;
                  return;
              }
        }
      }
    });
   
    label = new Label(content,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("serveraddwindow.server_port")+" : ");
   
    final Text text_port = new Text(content,SWT.BORDER);
    text_port.setFont(skin.getDefaultFont());
    text_port.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    text_port.addListener(SWT.Verify,new Listener() {
      public void handleEvent(Event e) {
            String text = e.text;
            char[] chars = new char[text.length()];
            text.getChars(0, chars.length, chars, 0);
            for (int i = 0; i < chars.length; i++) {
              if (!('0' <= chars[i] && chars[i] <= '9')) {
                  e.doit = false;
                  return;
              }
        }
      }
    });
   
    Composite buttons_composite = new Composite(shell,SWT.NONE);
    buttons_composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    buttons_composite.setLayout(new GridLayout(2,false));
   
    Button button_ok = new Button(buttons_composite,SWT.NONE);
    GridData grid_data = new GridData();
    //grid_data.widthHint = 40;
    grid_data.horizontalAlignment = GridData.END;
    grid_data.grabExcessHorizontalSpace = true;
    button_ok.setLayoutData(grid_data);
   
    button_ok.setFont(skin.getButtonFont());
    button_ok.setImage(skin.getButtonImage(SkinConstants.OK_BUTTON_IMAGE));
    button_ok.setText(Localizer._("mainwindow.button.ok"));
    button_ok.addSelectionListener(new SelectionListener() {
    public void widgetDefaultSelected(SelectionEvent arg0) {
      }

      public void widgetSelected(SelectionEvent arg0) {
        String server_ip = text_server_ip.getText();
        if (!AddressUtils.isValidIP(server_ip)) {
          MessageBox dialog = new MessageBox(shell,
                      SWT.OK | SWT.ICON_WARNING);
          dialog.setMessage(Localizer._("serveraddwindow.wrong_server_address"));
          dialog.open();
          return ;
        }
       
        if (!AddressUtils.isValidPort(text_port.getText())) {
          MessageBox dialog = new MessageBox(shell,
          SWT.OK | SWT.ICON_WARNING);
          dialog.setMessage(Localizer._("serveraddwindow.wrong_server_port"));
          dialog.open();
          return ;
        }
        int server_port = Integer.parseInt(text_port.getText());
        try {
          _core.getServerManager().newServer(server_ip, server_port);
        } catch (ServerManagerException e) {
          Utils.showWarningMessage(shell, "", e.getMessage());
        }
       
        shell.close();
    } });
   
    Button button_cancel = new Button(buttons_composite,SWT.NONE);
    button_cancel.setImage(skin.getButtonImage(SkinConstants.CANCEL_BUTTON_IMAGE));
    button_cancel.setText(Localizer._("mainwindow.button.cancel"));
   
    button_cancel.addSelectionListener(new SelectionListener() {

      public void widgetDefaultSelected(SelectionEvent arg0) {
View Full Code Here

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

 
  public ServerListTab(Composite shell,JMuleCore core) {
   
    super(shell);
 
    SWTSkin skin = null;
    try {
     
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {}
    FormLayout form = new FormLayout ();
    setLayout (form);
   
    server_table_panel = new Composite(this,SWT.NONE);
    server_table_panel.setLayout(new FillLayout());
   
    server_info_panel = new Composite(this,SWT.BORDER);
   
   
    SashControl.createHorizontalSash(20, 50, this, server_table_panel, server_info_panel);
   
    server_info_panel.setLayout(new FormLayout());
   
    Composite server_messages = new Composite(server_info_panel,SWT.NONE);
    server_messages.setLayout(new FillLayout());
   
    Composite peer_info = new Composite(server_info_panel,SWT.NONE);
    peer_info.setLayout(new FillLayout());
   
    SashControl.createVerticalSash(20, 70, server_info_panel, server_messages, peer_info);

    // Server List
    server_list_group = new Group(server_table_panel,SWT.NONE);
    server_list_group.setLayout(new FillLayout());
   
    setServerCount(core.getServerManager().getServersCount());
   
    server_list = new ServerList(server_list_group,core.getServerManager());
   
    //Server Messages
    new ServerMessages(server_messages);
   
    connection_info = new ConnectionInfo(peer_info,core);
   
    connection_info.setFont(skin.getDefaultFont());
   
    SWTServerListWrapper.getInstance().setServerListTab(this);
  }
View Full Code Here

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

   * @param _listener Callback listener to trigger when columns changed
   */
  public TableColumnEditorWindow(final Table editTable,Shell parent,
                   TableColumn[] _tableColumns,
                                 TableStructureModificationListener _listener) {
  SWTSkin skin = null;
  try {
   
    skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
   
  }catch(Throwable t) {
  }
   
    RowData rd;
    display = parent.getDisplay();
    listener = _listener;
   
    tableColumns = new ArrayList<TableColumn>();
    for(int i = 0;i<editTable.getColumnCount();i++){
      int id = editTable.getColumnOrder()[i];
      tableColumns.add(editTable.getColumn(id));
    }
   
    newEnabledState = new HashMap<TableColumn,Boolean>();

    for(TableColumn column : tableColumns) {
      int column_id = (Integer)column.getData(SWTConstants.COLUMN_NAME_KEY);
      Boolean status = SWTPreferences.getInstance().isColumnVisible(column_id);
      newEnabledState.put(column, status);
    }
   
   
    blue = new Color(display,0,0,128);
  
    Shell shell1=new Shell(display,SWT.ON_TOP);
  shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
  shell.setText(Localizer._("columneditorwindow.title"));
  shell.setImage(SWTImageRepository.getImage("columns_setup.png"));
 
    GridLayout layout = new GridLayout();
    shell.setLayout (layout);
   
    GridData gridData;
   
    Label label = new Label(shell,SWT.NULL);
    label.setText(Localizer._("columneditorwindow.draghint"));
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    label.setLayoutData(gridData);
   
    table = new Table (shell, SWT.VIRTUAL | SWT.CHECK | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
    gridData = new GridData(GridData.FILL_BOTH);
    table.setLayoutData(gridData);
    table.setHeaderVisible(true);
   
    Composite cButtonArea = new Composite(shell, SWT.NULL);
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    cButtonArea.setLayoutData(gridData);
    RowLayout rLayout = new RowLayout(SWT.HORIZONTAL);
    rLayout.marginLeft = 0;
   rLayout.marginTop = 0;
   rLayout.marginRight = 0;
   rLayout.marginBottom = 0;
   rLayout.spacing = 5;
   cButtonArea.setLayout (rLayout);
   
    Button bOk = new Button(cButtonArea,SWT.PUSH);
    bOk.setFont(skin.getButtonFont());
    bOk.setImage(skin.getButtonImage(SkinConstants.FINISH_BUTTON_IMAGE));
    bOk.setText(Localizer._("mainwindow.button.ok"));
    rd = new RowData();
    rd.width = 70;
    bOk.setLayoutData(rd);
    bOk.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event e) {
        saveAndApply();
        close();
      }
    });
   
    Button bCancel = new Button(cButtonArea,SWT.PUSH);
    bCancel.setFont(skin.getButtonFont());
    bCancel.setImage(skin.getButtonImage(SkinConstants.CANCEL_BUTTON_IMAGE));
    bCancel.setText(Localizer._("mainwindow.button.cancel"));
    rd = new RowData();
    rd.width = 70;
    bCancel.setLayoutData(rd);
    bCancel.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event e) {
        close();
      }
    });
   
    Button bApply = new Button(cButtonArea,SWT.PUSH);
    bApply.setFont(skin.getButtonFont());
    bApply.setImage(skin.getButtonImage(SkinConstants.OK_BUTTON_IMAGE));
    bApply.setText(Localizer._("mainwindo.button.apply"));
    rd = new RowData();
    rd.width = 70;
    bApply.setLayoutData(rd);
    bApply.addListener(SWT.Selection,new Listener() {
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(400, 330);
    Utils.centreWindow(shell);
   
    shell.setImage(SWTImageRepository.getImage("updater.png"));
    shell.setText(_._("updaterwindow.title"));

    shell.setLayout(new GridLayout(1,false));
   
    Label label;
    GridData grid_data;
    GridLayout layout;
   
    Composite window_content = new Composite(shell,SWT.NONE);
    layout = new GridLayout(2,false);
    layout.marginLeft = 50;
    layout.marginBottom = 0;
    window_content.setLayout(layout);
    window_content.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    label = new Label(window_content,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(JMConstants.JMULE_NAME + " " + _._("updaterwindow.label.jmule_version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    user_version = new Label(window_content,SWT.NONE);
    FontData data = skin.getDefaultFont().getFontData()[0];
    Font font = new Font(SWTThread.getDisplay(),data.getName(),data.getHeight(),SWT.BOLD );
    user_version.setFont(font);
    user_version.setText(JMConstants.CURRENT_JMULE_VERSION);
    user_version.setForeground(green_color);
   
    label = new Label(window_content,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setText(_._("updaterwindow.label.available_version") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    available_version = new Label(window_content,SWT.NONE);
    available_version.setFont(font);
    available_version.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    available_version.setForeground(green_color);
   
    label = new Label(window_content,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("updaterwindow.label.last_update") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    last_update = new Label(window_content,SWT.NONE);
    last_update.setFont(skin.getDefaultFont());
    last_update.setForeground(skin.getDefaultColor());
    last_update.setForeground(skin.getDefaultColor());
    last_update.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

   
    download_link = new CLabel(shell,SWT.NONE);
    grid_data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
    grid_data.horizontalSpan = 2;
    download_link.setLayoutData(grid_data);
    download_link.setText(_._("updaterwindow.label.download_link"));
    download_link.setData(JMConstants.JMULE_DOWNLOAD_PAGE);
    download_link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    download_link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    download_link.addMouseListener(new MouseAdapter() { 
      public void mouseDoubleClick(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("updaterwindow.error_open_url.title")
              , Localizer._("updaterwindow.error_open_url",path));
      }
      public void mouseDown(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("updaterwindow.error_open_url.title")
              , Localizer._("updaterwindow.error_open_url",path));
      }
    });
   
    download_link.setVisible(false);
   
    Group changelog_group = new Group(shell,SWT.NONE);
    changelog_group.setLayout(new FillLayout());
    changelog_group.setLayoutData(new GridData(GridData.FILL_BOTH));
    changelog_group.setText(_._("updaterwindow.group.changelog"));
   
    changelog_text = new StyledText(changelog_group,SWT.H_SCROLL | SWT.V_SCROLL);
    changelog_text.setEditable(false);
    Font font_changelog = new Font(SWTThread.getDisplay(),"Courier",10,SWT.NONE );
    changelog_text.setFont(font_changelog);
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    layout = new GridLayout(3,false);
    button_bar.setLayout(layout);
   
    final Button button_startup_check = new Button(button_bar,SWT.CHECK);
    grid_data = new GridData();
    grid_data.horizontalSpan = 2;
    grid_data.horizontalAlignment = GridData.BEGINNING;
    button_startup_check.setLayoutData(grid_data);
    button_startup_check.setText(_._("updaterwindow.check.startup_check"));
    button_startup_check.setSelection(SWTPreferences.getInstance().updateCheckAtStartup());
   
    Button button_ok = new Button(button_bar,SWT.NONE);
    button_ok.setFont(skin.getButtonFont());
    button_ok.setText(_._("updaterwindow.button.ok"));
    button_ok.setImage(SWTImageRepository.getImage("ok.png"));
    grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
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.