Package com.biglybt.ui.swt.pif
Interface UISWTInstance
- All Superinterfaces:
UIInstance
- All Known Implementing Classes:
UISWTInstanceImpl
,UISWTInstanceImpl.instanceWrapper
Tools to manage a SWT Instance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Various other views not covered by the above categoriesstatic final String
ID of main viewstatic final String
ID of "My Torrents" viewstatic final String
static final String
ID for adding views to the rightbarstatic final String
ID for adding views to bottom of the sidebarstatic final String
Statistics View, usually invoked from Tools->Statisticsstatic final String
ID of the top bar, usually located just above the Open/Find Torrents barstatic final String
ID of the torrent details view (The one you see when you right click on a torrent in Library and select "Details"static final String
ID of "Peers" viewFields inherited from interface com.biglybt.pif.ui.UIInstance
UIT_CONSOLE, UIT_SWT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addView
(String sParentID, String sViewID, UISWTViewEventListener l) Deprecated.void
addView
(String sParentViewID, String sViewID, Class<? extends UISWTViewEventListener> cla, Object initalDatasource) Deprecated.useregisterView(Class, UISWTViewBuilder)
withcreateViewBuilder(String, Class)
.setInitialDataSource(Object)
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.Creates an entry in the status bar to display custom status information.createViewBuilder
(String viewID) Creates an object representing how your view is to be created.createViewBuilder
(String viewID, Class<? extends UISWTViewEventListener> cla) Creates an object representing how your view is to be createdorg.eclipse.swt.widgets.Display
Retrieve the SWT Display object that Azureus uses (when in SWT mode).getOpenViews
(String sParentID) Get a list of views currently open on the specified VIEW_* vieworg.eclipse.swt.graphics.Image
void
openConfig
(BasicPluginConfigModel model) Opens the window linked to a given BasicPluginViewModel object.void
openMainView
(String sViewID, UISWTViewEventListener l, Object dataSource) Deprecated.void
openMainView
(String sViewID, UISWTViewEventListener l, Object dataSource, boolean setfocus) boolean
openView
(BasicPluginViewModel model) Opens the window linked to a given BasicPluginViewModel object.boolean
Open a previously added viewboolean
Open a previously added viewvoid
registerView
(Class forDataSourceType, UISWTViewBuilder viewBuilder) Register a view that will be created when a certain datasource type is displayedvoid
registerView
(String forViewID, UISWTViewBuilder viewBuilder) Register a view that will be created when the specified view is displayedvoid
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.void
unregisterView
(Class forDataSourceType, String viewID) Unregister and dispose of any previously created views of this viewIDvoid
unregisterView
(String forViewID, String viewID) Unregister and dispose of any previously created views of this viewIDMethods inherited from interface com.biglybt.pif.ui.UIInstance
createMessage, getInputReceiver, getToolBarManager, getUIType, promptUser, promptUser
-
Field Details
-
VIEW_MAIN
ID of main view- See Also:
-
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:
-
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:
-
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:
-
VIEW_TOPBAR
ID of the top bar, usually located just above the Open/Find Torrents bar- Since:
- Vuze 3.0.1.3
- See Also:
-
VIEW_RIGHTBAR
- See Also:
-
VIEW_STATISTICS
Statistics View, usually invoked from Tools->Statistics- See Also:
-
VIEW_SIDEBAR_AREA
ID for adding views to bottom of the sidebar- See Also:
-
VIEW_RIGHTBAR_AREA
ID for adding views to the rightbar- See Also:
-
VIEW_INTERNAL
Various other views not covered by the above categories- See Also:
-
-
Method Details
-
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
-
createGraphic
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
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
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
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
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
Unregister and dispose of any previously created views of this viewID- Since:
- BiglyBT 2.1.0.1
-
unregisterView
Unregister and dispose of any previously created views of this viewID- Since:
- BiglyBT 2.1.0.1
-
addView
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(String sParentViewID, String sViewID, Class<? extends UISWTViewEventListener> cla, 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
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
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
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
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
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
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
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:
-
openView
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
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
-
registerView(Class, UISWTViewBuilder)