FileDocCategorySizeDatePackage
UISWTInstance.javaAPI DocAzureus 3.0.3.46995Sat May 12 15:38:18 BST 2007org.gudy.azureus2.ui.swt.plugins

UISWTInstance

public interface UISWTInstance implements org.gudy.azureus2.plugins.ui.UIInstance
Tools to manage a SWT Instance
see
org.gudy.azureus2.plugins.ui.UIManagerListener
see
org.gudy.azureus2.plugins.ui.UIManager#addUIListener(UIManagerListener)

Fields Summary
public static final String
VIEW_MAIN
ID of main view
public static final String
VIEW_MYTORRENTS
ID of "My Torrents" view
public static final String
VIEW_TORRENT_PEERS
ID of "Peers" view
public static final String
VIEW_TORRENT_PIECES
ID of "Pieces" view
public static final String
VIEW_TORRENT_FILES
ID of "Files" view
public static final String
VIEW_TOPBAR
ID of the top bar of az3ui
Constructors Summary
Methods Summary
public voidaddView(UISWTAWTPluginView view, boolean auto_open)
Add an AWT panel as the plugin view

param
view
param
auto_open
since
2.3.0.5
deprecated
Use {@link #addView(String, String, UISWTViewEventListener)}

public voidaddView(java.lang.String sParentID, java.lang.String sViewID, UISWTViewEventListener l)
Add a detail view to an Azureus parent view. For views added to the Main window, this adds a menu option. For the other parent views, this adds a new tab within Azureus' own detail view.

param
sParentID VIEW_* constant
param
sViewID of your view. Used as part of the resource id.
"Views.plugins." + ID + ".title" = title of your view
param
l Listener to be triggered when parent view wants to tell you an event has happened
note
If you want the window to auto-open, use openMainView when you gain access to the UISWTInstance
since
2.3.0.6

public voidaddView(UISWTPluginView view, boolean autoOpen)
A Plugin might call this method to add a View to Azureus's views The View will be accessible from View > Plugins > View name

param
view The PluginView to be added
param
autoOpen Whether the plugin should auto-open at startup
since
2.3.0.5
deprecated
Use {@link #addView(String, String, UISWTViewEventListener)}

public UISWTGraphiccreateGraphic(org.eclipse.swt.graphics.Image img)
Creates an UISWTGraphic object with the supplied SWT Image

param
img Image to assign to the object
return
a new UISWTGraphic object
since
2.3.0.5

public UISWTStatusEntrycreateStatusEntry()
Creates an entry in the status bar to display custom status information.

since
3.0.0.7
see
UISWTStatusEntry

public org.eclipse.swt.widgets.DisplaygetDisplay()
Retrieve the SWT Display object that Azureus uses (when in SWT mode). If you have a thread that does some periodic/asynchronous stuff, Azureus will crashes with and 'InvalidThreadAccess' exception unless you embed your calls in a Runnable, and use getDisplay().aSyncExec(Runnable r);

return
SWT Display object that Azureus uses
since
2.3.0.5

public UISWTView[]getOpenViews(java.lang.String sParentID)
Get a list of views currently open on the specified VIEW_* view

param
sParentID VIEW_* constant
return
list of views currently open
since
2.3.0.6

public org.eclipse.swt.graphics.ImageloadImage(java.lang.String resource)

public voidopenMainView(java.lang.String sViewID, UISWTViewEventListener l, java.lang.Object dataSource)
Create and open a view in the main window immediately. If you are calling this from {@link org.gudy.azureus2.plugins.ui.UIManagerListener#UIAttached(UIInstance)}, the view will not gain focus.

Tip: You can add a menu item to a table view, and when triggered, have it open a new window, passing the datasources that were selected

param
sViewID ID to give your view
param
l Listener to be triggered when View Events occur
param
dataSource objects to set {@link UISWTView#getDataSource()} with
since
2.3.0.6

public booleanopenView(java.lang.String sParentID, java.lang.String sViewID, java.lang.Object dataSource)
Open a previously added view

param
sParentID ParentID of the view to be shown
param
sViewID id of the view to be shown
param
dataSource any data you need to pass the view
return
success level
since
2.5.0.1

public voidremoveView(UISWTPluginView view)
Remove a view

param
view
since
2.3.0.5
deprecated
Use {@link #removeViews(String, String)}

public voidremoveView(UISWTAWTPluginView view)
Remove a view

param
view
since
2.3.0.5
deprecated
Use {@link #removeViews(String, String)}

public voidremoveViews(java.lang.String sParentID, java.lang.String sViewID)
Remove all views that belong to a specific parent and of a specific View ID. If the parent is the main window, the menu item will be removed.
If you wish to remove (close) just one view, use {@link UISWTView#closeView()}

param
sParentID One of VIEW_* constants
param
sViewID View ID to remove
since
2.3.0.6

public voidshowDownloadBar(org.gudy.azureus2.plugins.download.Download download, boolean display)
Shows or hides a download bar for a given download.

since
3.0.0.5
param
download Download to use.
param
display true to show a download bar, false to hide it.

public voidshowTransfersBar(boolean display)
Shows or hides the transfers bar.

since
3.0.1.3
param
display true to show the bar, false to hide it.