Package com.biglybt.ui.swt.pif
Interface UISWTInstance
-
- All Superinterfaces:
UIInstance
- All Known Implementing Classes:
UISWTInstanceImpl
,UISWTInstanceImpl.instanceWrapper
public interface UISWTInstance extends UIInstance
Tools to manage a SWT Instance
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
VIEW_MAIN
ID of main viewstatic java.lang.String
VIEW_MYTORRENTS
ID of "My Torrents" viewstatic java.lang.String
VIEW_SIDEBAR_AREA
ID for adding views to bottom of the sidebarstatic java.lang.String
VIEW_STATISTICS
Statistics View, usually invoked from Tools->Statisticsstatic java.lang.String
VIEW_TOPBAR
ID of the top bar, usually located just above the Open/Find Torrents barstatic 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_PEERS
ID of "Peers" view-
Fields inherited from interface com.biglybt.pif.ui.UIInstance
UIT_CONSOLE, UIT_SWT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addView(java.lang.String sParentID, java.lang.String sViewID, UISWTViewEventListener l)
Deprecated.void
addView(java.lang.String sParentViewID, java.lang.String sViewID, java.lang.Class<? extends UISWTViewEventListener> cla, java.lang.Object initalDatasource)
Deprecated.useregisterView(Class, UISWTViewBuilder)
withcreateViewBuilder(String, Class)
.setInitialDataSource(Object)
UISWTGraphic
createGraphic(org.eclipse.swt.graphics.Image img)
Creates an UISWTGraphic object with the supplied SWT Imageorg.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.UISWTViewBuilder
createViewBuilder(java.lang.String viewID)
Creates an object representing how your view is to be created.UISWTViewBuilder
createViewBuilder(java.lang.String viewID, java.lang.Class<? extends UISWTViewEventListener> cla)
Creates an object representing how your view is to be createdorg.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_* vieworg.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)
Deprecated.void
openMainView(java.lang.String sViewID, UISWTViewEventListener l, java.lang.Object dataSource, boolean setfocus)
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 viewboolean
openView(java.lang.String forViewID, java.lang.String sViewID, java.lang.Object dataSource, boolean setfocus)
Open a previously added viewvoid
registerView(java.lang.Class forDataSourceType, UISWTViewBuilder viewBuilder)
Register a view that will be created when a certain datasource type is displayedvoid
registerView(java.lang.String forViewID, UISWTViewBuilder viewBuilder)
Register a view that will be created when the specified view is displayedvoid
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.void
unregisterView(java.lang.Class forDataSourceType, java.lang.String viewID)
Unregister and dispose of any previously created views of this viewIDvoid
unregisterView(java.lang.String forViewID, java.lang.String viewID)
Unregister and dispose of any previously created views of this viewID-
Methods inherited from interface com.biglybt.pif.ui.UIInstance
createMessage, getInputReceiver, getToolBarManager, getUIType, promptUser, 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 If you are making a view that applies to any view showing Downloads, useregisterView(Class, UISWTViewBuilder)
with
insteadDownload
.class- Since:
- Azureus 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" If you are making a view that applies to any view showing Downloads, useregisterView(Class, UISWTViewBuilder)
with
insteadDownload
.class- Since:
- Vuze 4.9.0.1
- See Also:
- Constant Field Values
-
VIEW_TORRENT_PEERS
static final java.lang.String VIEW_TORRENT_PEERS
ID of "Peers" view If you are making a view that applies to any view showing Peers, useregisterView(Class, UISWTViewBuilder)
withPeer
.class- Since:
- Azureus 2.3.0.7
- See Also:
- Constant Field Values
-
VIEW_TOPBAR
static final java.lang.String VIEW_TOPBAR
ID of the top bar, usually located just above the Open/Find Torrents bar- Since:
- Vuze 3.0.1.3
- See Also:
- Constant Field Values
-
VIEW_STATISTICS
static final java.lang.String VIEW_STATISTICS
Statistics View, usually invoked from Tools->Statistics- See Also:
- Constant Field Values
-
VIEW_SIDEBAR_AREA
static final java.lang.String VIEW_SIDEBAR_AREA
ID for adding views to bottom of the sidebar- 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
-
registerView
void registerView(java.lang.Class forDataSourceType, UISWTViewBuilder viewBuilder)
Register a view that will be created when a certain datasource type is displayed For example, you can register an image rendering view forDiskManagerFileInfo
When plugin is unloaded, any registrations will be automatically unregistered, and any views created from the builder will be automatically disposed- Parameters:
forDataSourceType
- Class of datasource you want to add a view to, such asDownload
,DownloadTypeComplete
,DownloadTypeIncomplete
viewBuilder
- usecreateViewBuilder(String, Class)
- Since:
- BiglyBT 2.1.0.1
-
registerView
void registerView(java.lang.String forViewID, UISWTViewBuilder viewBuilder)
Register a view that will be created when the specified view is displayed When plugin is unloaded, any registrations will be automatically unregistered, and any views created from the builder will be automatically disposed- Parameters:
forViewID
- VIEW_ ConstantviewBuilder
- usecreateViewBuilder(String, Class)
- Since:
- BiglyBT 2.1.0.1
-
createViewBuilder
UISWTViewBuilder createViewBuilder(java.lang.String viewID, java.lang.Class<? extends UISWTViewEventListener> cla)
Creates an object representing how your view is to be created- Parameters:
viewID
- Unique ID of your viewcla
- AUISWTViewEventListener
class that will be created when the UI shows the view.
Since this class will be instantiated with cla.newInstance(), the class must be a top-level class, and not a local or non-static nested class.- Returns:
- UISWTViewBuilder which has additional values you can set, such as initial datasource
- Since:
- BiglyBT 2.1.0.1
-
createViewBuilder
UISWTViewBuilder createViewBuilder(java.lang.String viewID)
Creates an object representing how your view is to be created. At minimum, you will need to specify a way to instanatiate your listener, with one of the following methods:UISWTViewBuilder.setListenerClass(Class)
UISWTViewBuilder.setListenerInstantiator(boolean, UISWTViewBuilder.UISWTViewEventListenerInstantiator)
- Parameters:
viewID
- Unique ID of your view- Returns:
- UISWTViewBuilder which has additional values you can set, such as initial datasource
- Since:
- BiglyBT 2.1.0.1
-
unregisterView
void unregisterView(java.lang.Class forDataSourceType, java.lang.String viewID)
Unregister and dispose of any previously created views of this viewID- Since:
- BiglyBT 2.1.0.1
-
unregisterView
void unregisterView(java.lang.String forViewID, java.lang.String viewID)
Unregister and dispose of any previously created views of this viewID- Since:
- BiglyBT 2.1.0.1
-
addView
void addView(java.lang.String sParentID, java.lang.String sViewID, UISWTViewEventListener l)
Deprecated.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_* constantsViewID
- of your view. Used as part of the resource id.
"Views.plugins." + ID + ".title" = title of your viewl
- Listener to be triggered when parent view wants to tell you an event has happened- Since:
- Azureus 2.3.0.6
-
addView
void addView(java.lang.String sParentViewID, java.lang.String sViewID, java.lang.Class<? extends UISWTViewEventListener> cla, java.lang.Object initalDatasource)
Deprecated.useregisterView(Class, UISWTViewBuilder)
withcreateViewBuilder(String, Class)
.setInitialDataSource(Object)
Add a view to an Apps parent view. For views added to theVIEW_MAIN
window, this adds a menu option.In comparison to
addView(String, String, UISWTViewEventListener)
, this method saves memory by not creating theUISWTViewEventListener
until it is needed. It also ensures that only oneUISWTViewEvent.TYPE_CREATE
event is triggered per instance.- Parameters:
sParentViewID
- VIEW_* constantsViewID
- of your view. Used as part of the resource id.
"Views.plugins." + ID + ".title" = title of your viewcla
- Class of the Listener to be created and triggered- Since:
- Vuze 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 shownsViewID
- id of the view to be showndataSource
- any data you need to pass the view- Returns:
- success level
- Since:
- 2.5.0.1
-
openView
boolean openView(java.lang.String forViewID, java.lang.String sViewID, java.lang.Object dataSource, boolean setfocus)
Open a previously added view- Parameters:
forViewID
- View that the opened view belongs tosViewID
- id of the view to be showndataSource
- any data you need to pass the viewsetfocus
- 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)
Deprecated.Create and open a view in the main window immediately. If you are calling this fromUIManagerListener.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 viewl
- Listener to be triggered when View Events occurdataSource
- objects to setUISWTView.getDataSource()
with- Since:
- Azureus 2.3.0.6
-
openMainView
void openMainView(java.lang.String sViewID, UISWTViewEventListener l, java.lang.Object dataSource, boolean setfocus)
Deprecated.Create and open a view in the main window immediately. If you are calling this fromUIManagerListener.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 viewl
- Listener to be triggered when View Events occurdataSource
- objects to setUISWTView.getDataSource()
withsetfocus
- true if you want to display the view immediately, false if you want to display it in the background.- Since:
- Vuze 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, useUIPluginView.closeView()
- Parameters:
sParentID
- One of VIEW_* constantssViewID
- 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
-
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 interfaceUIInstance
- 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
-
-