org.gudy.azureus2.ui.swt.plugins
Interface UISWTInstance


public interface UISWTInstance

Tools to manage a SWT Instance

See Also:
UIManagerListener, UIManager.addUIListener(UIManagerListener)

Nested Class Summary
static interface UISWTInstance.UISWTViewEventListenerWrapper
           
 
Field Summary
static String VIEW_CONFIG
           
static String VIEW_MAIN
          ID of main view
static String VIEW_MYTORRENTS
          ID of "My Torrents" view
static String VIEW_SIDEBAR_AREA
           
static String VIEW_STATISTICS
           
static String VIEW_TOPBAR
          ID of the top bar of az3ui
static String VIEW_TORRENT_DETAILS
          ID of the torrent details view (The one you see when you right click on a torrent in Library and select "Details"
static String VIEW_TORRENT_FILES
          ID of "Files" view
static String VIEW_TORRENT_PEERS
          ID of "Peers" view
static String VIEW_TORRENT_PIECES
          ID of "Pieces" view
 
Method Summary
 void addView(String sParentID, String sViewID, Class<? extends UISWTViewEventListener> cla, Object initalDatasource)
          Add a view to an Azureus parent view.
 void addView(String sParentID, String sViewID, UISWTViewEventListener l)
          Add a detail view to an Azureus parent view.
 UISWTGraphic createGraphic(org.eclipse.swt.graphics.Image img)
          Creates an UISWTGraphic object with the supplied SWT Image
 org.eclipse.swt.widgets.Shell createShell(int style)
          Creates a SWT Shell, ensuring Vuze knows about it (ie.
 UISWTStatusEntry createStatusEntry()
          Creates an entry in the status bar to display custom status information.
 org.eclipse.swt.widgets.Display getDisplay()
          Retrieve the SWT Display object that Azureus uses (when in SWT mode).
 UISWTView[] getOpenViews(String sParentID)
          Get a list of views currently open on the specified VIEW_* view
 UISWTInstance.UISWTViewEventListenerWrapper[] getViewListeners(String sParentID)
           
 org.eclipse.swt.graphics.Image loadImage(String resource)
           
 void openConfig(BasicPluginConfigModel model)
          Opens the window linked to a given BasicPluginViewModel object.
 void openMainView(String sViewID, UISWTViewEventListener l, Object dataSource)
          Create and open a view in the main window immediately.
 void openMainView(String sViewID, UISWTViewEventListener l, Object dataSource, boolean setfocus)
          Create and open a view in the main window immediately.
 boolean openView(BasicPluginViewModel model)
          Opens the window linked to a given BasicPluginViewModel object.
 boolean openView(String sParentID, String sViewID, Object dataSource)
          Open a previously added view
 boolean openView(String sParentID, String sViewID, Object dataSource, boolean setfocus)
          Open a previously added view
 void removeViews(String sParentID, String sViewID)
          Remove all views that belong to a specific parent and of a specific View ID.
 void showDownloadBar(Download download, boolean display)
          Shows or hides a download bar for a given download.
 void showTransfersBar(boolean display)
          Shows or hides the transfers bar.
 

Field Detail

VIEW_MAIN

static final String VIEW_MAIN
ID of main view

See Also:
Constant Field Values

VIEW_MYTORRENTS

static final String VIEW_MYTORRENTS
ID of "My Torrents" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_DETAILS

static final String VIEW_TORRENT_DETAILS
ID of the torrent details view (The one you see when you right click on a torrent in Library and select "Details"

Since:
4901
See Also:
Constant Field Values

VIEW_TORRENT_PEERS

static final String VIEW_TORRENT_PEERS
ID of "Peers" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_PIECES

static final String VIEW_TORRENT_PIECES
ID of "Pieces" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_FILES

static final String VIEW_TORRENT_FILES
ID of "Files" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TOPBAR

static final String VIEW_TOPBAR
ID of the top bar of az3ui

Since:
3.0.1.3
See Also:
Constant Field Values

VIEW_STATISTICS

static final String VIEW_STATISTICS
See Also:
Constant Field Values

VIEW_CONFIG

static final String VIEW_CONFIG
See Also:
Constant Field Values

VIEW_SIDEBAR_AREA

static final String VIEW_SIDEBAR_AREA
See Also:
Constant Field Values
Method Detail

getDisplay

org.eclipse.swt.widgets.Display getDisplay()
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);

Returns:
SWT Display object that Azureus uses
Since:
2.3.0.5

loadImage

org.eclipse.swt.graphics.Image loadImage(String resource)

createGraphic

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

Parameters:
img - Image to assign to the object
Returns:
a new UISWTGraphic object
Since:
2.3.0.5

addView

void addView(String sParentID,
             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.

Parameters:
sParentID - VIEW_* constant
sViewID - of your view. Used as part of the resource id.
"Views.plugins." + ID + ".title" = title of your view
l - Listener to be triggered when parent view wants to tell you an event has happened
Since:
2.3.0.6

addView

void addView(String sParentID,
             String sViewID,
             Class<? extends UISWTViewEventListener> cla,
             Object initalDatasource)
Add a view to an Azureus parent view. For views added to the VIEW_MAIN window, this adds a menu option.

In comparison to addView(String, String, UISWTViewEventListener), this method saves memory by not creating the UISWTViewEventListener until it is needed. It also ensures that only one UISWTViewEvent.TYPE_CREATE event is triggered per instance.

Parameters:
sParentID - VIEW_* constant
sViewID - of your view. Used as part of the resource id.
"Views.plugins." + ID + ".title" = title of your view
cla - Class of the Listener to be created and triggered
Since:
4.6.0.5

openView

boolean openView(String sParentID,
                 String sViewID,
                 Object dataSource)
Open a previously added view

Parameters:
sParentID - ParentID of the view to be shown
sViewID - id of the view to be shown
dataSource - any data you need to pass the view
Returns:
success level
Since:
2.5.0.1

openView

boolean openView(String sParentID,
                 String sViewID,
                 Object dataSource,
                 boolean setfocus)
Open a previously added view

Parameters:
sParentID - ParentID of the view to be shown
sViewID - id of the view to be shown
dataSource - any data you need to pass the view
setfocus - true if you want to display the view immediately, false if you want to display it in the background.
Returns:
success level
Since:
3.0.5.3

openMainView

void openMainView(String sViewID,
                  UISWTViewEventListener l,
                  Object dataSource)
Create and open a view in the main window immediately. If you are calling this from 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

Parameters:
sViewID - ID to give your view
l - Listener to be triggered when View Events occur
dataSource - objects to set UISWTView.getDataSource() with
Since:
2.3.0.6

openMainView

void openMainView(String sViewID,
                  UISWTViewEventListener l,
                  Object dataSource,
                  boolean setfocus)
Create and open a view in the main window immediately. If you are calling this from 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

Parameters:
sViewID - ID to give your view
l - Listener to be triggered when View Events occur
dataSource - objects to set UISWTView.getDataSource() with
setfocus - true if you want to display the view immediately, false if you want to display it in the background.
Since:
3.0.5.3

removeViews

void removeViews(String sParentID,
                 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 UIPluginView.closeView()

Parameters:
sParentID - One of VIEW_* constants
sViewID - View ID to remove
Since:
2.3.0.6

getOpenViews

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

Parameters:
sParentID - VIEW_* constant
Returns:
list of views currently open
Since:
2.3.0.6

getViewListeners

UISWTInstance.UISWTViewEventListenerWrapper[] getViewListeners(String sParentID)
Since:
4.8.0.0

showDownloadBar

void showDownloadBar(Download download,
                     boolean display)
Shows or hides a download bar for a given download.

Parameters:
download - Download to use.
display - true to show a download bar, false to hide it.
Since:
3.0.0.5

showTransfersBar

void showTransfersBar(boolean display)
Shows or hides the transfers bar.

Parameters:
display - true to show the bar, false to hide it.
Since:
3.0.1.3

createStatusEntry

UISWTStatusEntry createStatusEntry()
Creates an entry in the status bar to display custom status information.

Since:
3.0.0.7
See Also:
UISWTStatusEntry

openView

boolean openView(BasicPluginViewModel model)
Opens the window linked to a given BasicPluginViewModel object.

Returns:
true if the view was opened successfully.
Since:
3.0.5.3

openConfig

void openConfig(BasicPluginConfigModel model)
Opens the window linked to a given BasicPluginViewModel object.

Since:
3.0.5.3

createShell

org.eclipse.swt.widgets.Shell createShell(int style)
Creates a SWT Shell, ensuring Vuze knows about it (ie. Icon, "Window" menu)

Parameters:
style -
Returns:
Since:
4.2.0.9