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

All Superinterfaces:
UIInstance, UIInstanceBase
All Known Implementing Classes:
UISWTInstanceImpl, UISWTInstanceImpl.instanceWrapper

public interface UISWTInstance
extends UIInstanceBase

Tools to manage a SWT Instance

See Also:
UIManagerListener, UIManager.addUIListener(UIManagerListener)

Nested Class Summary
static interface UISWTInstance.UISWTViewEventListenerWrapper
           
 
Field Summary
static java.lang.String VIEW_CONFIG
           
static java.lang.String VIEW_MAIN
          ID of main view
static java.lang.String VIEW_MYTORRENTS
          ID of "My Torrents" view
static java.lang.String VIEW_SIDEBAR_AREA
           
static java.lang.String VIEW_STATISTICS
           
static java.lang.String VIEW_TOPBAR
          ID of the top bar of az3ui
static java.lang.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 java.lang.String VIEW_TORRENT_FILES
          ID of "Files" view
static java.lang.String VIEW_TORRENT_PEERS
          ID of "Peers" view
static java.lang.String VIEW_TORRENT_PIECES
          ID of "Pieces" view
 
Fields inherited from interface org.gudy.azureus2.plugins.ui.UIInstance
UIT_CONSOLE, UIT_SWT
 
Method Summary
 void addView(java.lang.String sParentID, java.lang.String sViewID, java.lang.Class<? extends UISWTViewEventListener> cla, java.lang.Object initalDatasource)
          Add a view to an Azureus parent view.
 void addView(java.lang.String sParentID, java.lang.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(java.lang.String sParentID)
          Get a list of views currently open on the specified VIEW_* view
 UISWTInstance.UISWTViewEventListenerWrapper[] getViewListeners(java.lang.String sParentID)
           
 org.eclipse.swt.graphics.Image loadImage(java.lang.String resource)
           
 void openConfig(BasicPluginConfigModel model)
          Opens the window linked to a given BasicPluginViewModel object.
 void openMainView(java.lang.String sViewID, UISWTViewEventListener l, java.lang.Object dataSource)
          Create and open a view in the main window immediately.
 void openMainView(java.lang.String sViewID, UISWTViewEventListener l, java.lang.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(java.lang.String sParentID, java.lang.String sViewID, java.lang.Object dataSource)
          Open a previously added view
 boolean openView(java.lang.String sParentID, java.lang.String sViewID, java.lang.Object dataSource, boolean setfocus)
          Open a previously added view
 void removeViews(java.lang.String sParentID, java.lang.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.
 
Methods inherited from interface org.gudy.azureus2.ui.common.UIInstanceBase
unload
 
Methods inherited from interface org.gudy.azureus2.plugins.ui.UIInstance
createMessage, getInputReceiver, getToolBarManager, getUIType, promptUser
 

Field Detail

VIEW_MAIN

static final java.lang.String VIEW_MAIN
ID of main view

See Also:
Constant Field Values

VIEW_MYTORRENTS

static final java.lang.String VIEW_MYTORRENTS
ID of "My Torrents" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_DETAILS

static final java.lang.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 java.lang.String VIEW_TORRENT_PEERS
ID of "Peers" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_PIECES

static final java.lang.String VIEW_TORRENT_PIECES
ID of "Pieces" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TORRENT_FILES

static final java.lang.String VIEW_TORRENT_FILES
ID of "Files" view

Since:
2.3.0.7
See Also:
Constant Field Values

VIEW_TOPBAR

static final java.lang.String VIEW_TOPBAR
ID of the top bar of az3ui

Since:
3.0.1.3
See Also:
Constant Field Values

VIEW_STATISTICS

static final java.lang.String VIEW_STATISTICS
See Also:
Constant Field Values

VIEW_CONFIG

static final java.lang.String VIEW_CONFIG
See Also:
Constant Field Values

VIEW_SIDEBAR_AREA

static final java.lang.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(java.lang.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(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.

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(java.lang.String sParentID,
             java.lang.String sViewID,
             java.lang.Class<? extends UISWTViewEventListener> cla,
             java.lang.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(java.lang.String sParentID,
                 java.lang.String sViewID,
                 java.lang.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(java.lang.String sParentID,
                 java.lang.String sViewID,
                 java.lang.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(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 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(java.lang.String sViewID,
                  UISWTViewEventListener l,
                  java.lang.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(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 UIPluginView.closeView()

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

getOpenViews

UISWTView[] getOpenViews(java.lang.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(java.lang.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.

Specified by:
openView in interface UIInstance
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