FileDocCategorySizeDatePackage
TableManagerImpl.javaAPI DocAzureus 3.0.3.44038Tue Mar 06 13:59:00 GMT 2007org.gudy.azureus2.pluginsimpl.local.ui.tables

TableManagerImpl

public class TableManagerImpl extends Object implements org.gudy.azureus2.plugins.ui.tables.TableManager
Manage Tables There's a TableManager per plugin interface
author
TuxPaper
since
2.0.8.5

Fields Summary
private org.gudy.azureus2.pluginsimpl.local.ui.UIManagerImpl
ui_manager
Constructors Summary
public TableManagerImpl(org.gudy.azureus2.pluginsimpl.local.ui.UIManagerImpl _ui_manager)

		ui_manager = _ui_manager;
	
Methods Summary
public voidaddColumn(org.gudy.azureus2.plugins.ui.tables.TableColumn tableColumn)

		if (!(tableColumn instanceof TableColumnCore))
			throw (new UIRuntimeException(
					"TableManager.addColumn(..) can only add columns created by createColumn(..)"));

		TableColumnManager.getInstance().addColumn((TableColumnCore) tableColumn);

		ui_manager.addUIListener(new UIManagerListener() {
			public void UIDetached(UIInstance instance) {
			}

			public void UIAttached(UIInstance instance) {
				UIManagerEventAdapter event = new UIManagerEventAdapter(
						UIManagerEvent.ET_ADD_TABLE_COLUMN, tableColumn);
				UIManagerImpl.fireEvent(event);
			}
		});
	
public org.gudy.azureus2.plugins.ui.tables.TableContextMenuItemaddContextMenuItem(org.gudy.azureus2.plugins.ui.tables.TableContextMenuItem parent, java.lang.String resourceKey)

		if (!(parent instanceof TableContextMenuItemImpl)) {
			throw new UIRuntimeException(
					"parent must have been created by addContextMenuItem");
		}
		if (parent.getStyle() != TableContextMenuItemImpl.STYLE_MENU) {
			throw new UIRuntimeException(
					"parent menu item must have the menu style associated");
		}
		TableContextMenuItemImpl item = new TableContextMenuItemImpl(
				(TableContextMenuItemImpl) parent, resourceKey);
		UIManagerImpl.fireEvent(UIManagerEvent.ET_ADD_TABLE_CONTEXT_SUBMENU_ITEM,
				new Object[] {item, parent});
		return item;
	
public org.gudy.azureus2.plugins.ui.tables.TableContextMenuItemaddContextMenuItem(java.lang.String tableID, java.lang.String resourceKey)

		TableContextMenuItemImpl item = new TableContextMenuItemImpl(tableID,
				resourceKey);

		// this event is replayed for us on UI attaches so no extra work

		UIManagerImpl.fireEvent(UIManagerEvent.ET_ADD_TABLE_CONTEXT_MENU_ITEM, item);
		
		return item;
	
public org.gudy.azureus2.plugins.ui.tables.TableColumncreateColumn(java.lang.String tableID, java.lang.String cellID)

		final TableColumnImpl column = new TableColumnImpl(tableID, cellID);

		ui_manager.addUIListener(new UIManagerListener() {
			public void UIDetached(UIInstance instance) {
			}

			public void UIAttached(UIInstance instance) {
				UIManagerEventAdapter event = new UIManagerEventAdapter(
						UIManagerEvent.ET_CREATE_TABLE_COLUMN, new String[] {
							tableID,
							cellID
						});

				UIManagerImpl.fireEvent(event);
				// event.result used to have the TableColumn which we would populate
				// with info.
			}
		});

		return column;