no_servers_menu = new Menu(this);
MenuItem no_servers_server_add = new MenuItem (no_servers_menu, SWT.PUSH);
no_servers_server_add.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
no_servers_server_add.setImage(SWTImageRepository.getImage("server_add.png"));
no_servers_server_add.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showServerAddWindow();
}
});
new MenuItem (no_servers_menu, SWT.SEPARATOR);
MenuItem no_server_paste_ed2k_links = new MenuItem (no_servers_menu, SWT.PUSH);
no_server_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
no_server_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
no_server_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
pasteED2KLinks();
}
});
new MenuItem (no_servers_menu, SWT.SEPARATOR);
MenuItem no_server_column_setup = new MenuItem (no_servers_menu, SWT.PUSH);
no_server_column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
no_server_column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
no_server_column_setup.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showColumnEditorWindow();
}
});
no_selected_servers_menu = new Menu(this);
MenuItem no_selection_menu_add = new MenuItem(no_selected_servers_menu,SWT.PUSH);
no_selection_menu_add.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
no_selection_menu_add.setImage(SWTImageRepository.getImage("server_add.png"));
no_selection_menu_add.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showServerAddWindow();
}
});
new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
no_selection_menu_disconnect = new MenuItem(no_selected_servers_menu,SWT.PUSH);
no_selection_menu_disconnect.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
no_selection_menu_disconnect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
no_selection_menu_disconnect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
wrapper.disconnect();
}
});
new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
MenuItem no_selection_menu_remove_all = new MenuItem(no_selected_servers_menu,SWT.PUSH);
no_selection_menu_remove_all.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
no_selection_menu_remove_all.setImage(SWTImageRepository.getImage("remove_all.png"));
no_selection_menu_remove_all.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
clearServerList();
}
});
new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
MenuItem no_selection_menu_paste_ed2k = new MenuItem(no_selected_servers_menu,SWT.PUSH);
no_selection_menu_paste_ed2k.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
no_selection_menu_paste_ed2k.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
no_selection_menu_paste_ed2k.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
pasteED2KLinks();
}
});
new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
MenuItem no_selection_menu_column_setup = new MenuItem(no_selected_servers_menu,SWT.PUSH);
no_selection_menu_column_setup.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
no_selection_menu_column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
no_selection_menu_column_setup.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showColumnEditorWindow();
}
});
selected_server_menu = new Menu(this);
selected_server_connect = new MenuItem (selected_server_menu, SWT.PUSH);
selected_server_connect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.connect_to"));
selected_server_connect.setImage(SWTImageRepository.getImage("server_connect.png"));
selected_server_connect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
Server selected_server = (Server) getSelectedObject();
wrapper.connectTo(selected_server);
}} );
selected_server_disconnect = new MenuItem (selected_server_menu, SWT.PUSH);
selected_server_disconnect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
selected_server_disconnect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
selected_server_disconnect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if (wrapper.isAutoconnecting())
wrapper.stopConnecting();
else
wrapper.disconnect();
}} );
new MenuItem (selected_server_menu, SWT.SEPARATOR);
MenuItem server_add = new MenuItem (selected_server_menu, SWT.PUSH);
server_add.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
server_add.setImage(SWTImageRepository.getImage("server_add.png"));
server_add.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showServerAddWindow();
}
});
final MenuItem server_remove = new MenuItem (selected_server_menu, SWT.PUSH);
server_remove.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_server"));
server_remove.setImage(SWTImageRepository.getImage("server_delete.png"));
server_remove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
removeSelectedServers();
}
});
server_remove_all = new MenuItem (selected_server_menu, SWT.PUSH);
server_remove_all.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
server_remove_all.setImage(SWTImageRepository.getImage("remove_all.png"));
server_remove_all.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
clearServerList();
}
});
new MenuItem (selected_server_menu, SWT.SEPARATOR);
final MenuItem server_copy_ed2k_link = new MenuItem (selected_server_menu, SWT.PUSH);
server_copy_ed2k_link.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.copy_ed2k_link"));
server_copy_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link.png"));
server_copy_ed2k_link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
copyED2KLinks();
}
});
MenuItem server_paste_ed2k_links = new MenuItem (selected_server_menu, SWT.PUSH);
server_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
server_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
server_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
pasteED2KLinks();
}
});
new MenuItem (selected_server_menu, SWT.SEPARATOR);
add_to_static_list = new MenuItem (selected_server_menu, SWT.PUSH);
add_to_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_to_static_list"));
add_to_static_list.setImage(SWTImageRepository.getImage("list_add.png"));
add_to_static_list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
addToStaticList();
}
});
remove_from_static_list = new MenuItem (selected_server_menu, SWT.PUSH);
remove_from_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_from_static_list"));
remove_from_static_list.setImage(SWTImageRepository.getImage("list_remove.png"));
remove_from_static_list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
removeFromStaticList();
}
});
new MenuItem (selected_server_menu, SWT.SEPARATOR);
MenuItem column_setup = new MenuItem (selected_server_menu, SWT.PUSH);
column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
column_setup.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showColumnEditorWindow();
}
});
new MenuItem (selected_server_menu, SWT.SEPARATOR);
final MenuItem server_properties = new MenuItem (selected_server_menu, SWT.PUSH);
server_properties.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.server_properties"));
server_properties.setImage(SWTImageRepository.getImage("server_properties.png"));
server_properties.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
ServerPropertiesWindow properties_window = new ServerPropertiesWindow(getSelectedObject());
properties_window.getCoreComponents();
properties_window.initUIComponents();
}
});
// Multiple servers selected
selected_multiple_servers_menu = new Menu (this);
MenuItem server_remove_selected = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
server_remove_selected.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_selected"));
server_remove_selected.setImage(SWTImageRepository.getImage("server_delete.png"));
server_remove_selected.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
removeSelectedServers();
}
});
new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
server_remove_all_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
server_remove_all_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
server_remove_all_multiselect.setImage(SWTImageRepository.getImage("remove_all.png"));
server_remove_all_multiselect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
clearServerList();
}
});
new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
server_connect_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
server_connect_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.connect"));
server_connect_multiselect.setImage(SWTImageRepository.getImage("server_connect.png"));
server_connect_multiselect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
wrapper.startAutoConnect();
}
});
server_disconnect_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
server_disconnect_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
server_disconnect_multiselect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
server_disconnect_multiselect.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
if (wrapper.isAutoconnecting())
wrapper.stopConnecting();
else
wrapper.disconnect();
}
});
new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
MenuItem multi_select_menu_copy_ed2k_links = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
multi_select_menu_copy_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.copy_ed2k_links"));
multi_select_menu_copy_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link.png"));
multi_select_menu_copy_ed2k_links.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
copyED2KLinks();
}
});
MenuItem multi_select_menu_paste_ed2k_links = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
multi_select_menu_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
multi_select_menu_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
multi_select_menu_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
pasteED2KLinks();
}
});
new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
multisel_add_to_static_list = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
multisel_add_to_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_to_static_list"));
multisel_add_to_static_list.setImage(SWTImageRepository.getImage("list_add.png"));
multisel_add_to_static_list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
addToStaticList();
}
});
multisel_remove_from_static_list = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
multisel_remove_from_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_from_static_list"));
multisel_remove_from_static_list.setImage(SWTImageRepository.getImage("list_remove.png"));
multisel_remove_from_static_list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
removeFromStaticList();
}
});
new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
column_setup = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
column_setup.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
showColumnEditorWindow();
}
});