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

All Superinterfaces:
UIPluginView
All Known Subinterfaces:
MdiEntrySWT, UISWTViewCore
All Known Implementing Classes:
BaseMdiEntry, SideBarEntrySWT, TabbedEntry, UISWTViewImpl

public interface UISWTView
extends UIPluginView

Commands and Information about a SWT View

Author:
TuxPaper
See Also:
UISWTViewEvent.getView(), UISWTViewEventListener.eventOccurred(UISWTViewEvent), UISWTInstance.addView(String, String, UISWTViewEventListener)

Field Summary
static int CONTROLTYPE_AWT
          For setControlType(int); When the event UISWTViewEvent.TYPE_INITIALIZE is triggered, getData() will return a Component object.
static int CONTROLTYPE_SWT
          For setControlType(int); When the event UISWTViewEvent.TYPE_INITIALIZE is triggered, getData() will return a Composite object.
 
Method Summary
 int getControlType()
           
 java.lang.Object getDataSource()
          Retrieve the data sources related to this view.
 java.lang.Object getInitialDataSource()
          Get the original datasource that was set to the view
 UISWTView getParentView()
          Get parent view, if one exists
 PluginInterface getPluginInterface()
          Gets the plugin interface associated with this view, null if none defined
 boolean isDestroyOnDeactivate()
          Retrieve whether this view can be destroyed on UISWTViewEvent.TYPE_FOCUSLOST
 void setControlType(int iControlType)
          Sets the type of control this view uses.
 void setDestroyOnDeactivate(boolean b)
          To save memory/CPU, views are sometimes destroyed on UISWTViewEvent.TYPE_FOCUSLOST
 void setTitle(java.lang.String title)
          Override the default title with a new one.
 void triggerEvent(int eventType, java.lang.Object data)
          Trigger an event for this view
 
Methods inherited from interface org.gudy.azureus2.plugins.ui.UIPluginView
closeView, getToolBarListener, getViewID, setToolBarListener
 

Field Detail

CONTROLTYPE_SWT

static final int CONTROLTYPE_SWT
For setControlType(int); When the event UISWTViewEvent.TYPE_INITIALIZE is triggered, getData() will return a Composite object.

Since:
2.3.0.6
See Also:
Constant Field Values

CONTROLTYPE_AWT

static final int CONTROLTYPE_AWT
For setControlType(int); When the event UISWTViewEvent.TYPE_INITIALIZE is triggered, getData() will return a Component object.

Since:
2.3.0.6
See Also:
Constant Field Values
Method Detail

setControlType

void setControlType(int iControlType)
Sets the type of control this view uses. Set before view initialization.

The default value is CONTROLTYPE_SWT

Parameters:
iControlType -
Since:
2.3.0.6

getControlType

int getControlType()
Returns:
CONTROLTYPE_*
Since:
4.3.1.3

getDataSource

java.lang.Object getDataSource()
Retrieve the data sources related to this view.

Specified by:
getDataSource in interface UIPluginView
Returns:
Depending on the parent view you added your view to, the Object will be:
UISWTInstance.VIEW_MAIN- null
UISWTInstance.VIEW_MYTORRENTS- Download
UISWTInstance.VIEW_TORRENT_PEERS- Peer
If created by UISWTInstance.openMainView(String, UISWTViewEventListener, Object), value will be the value set.

May return null if no data source is selected, or while processing the UISWTViewEvent.TYPE_CREATE event.

Since:
2.3.0.6

getInitialDataSource

java.lang.Object getInitialDataSource()
Get the original datasource that was set to the view

Since:
5.5.0.0

getParentView

UISWTView getParentView()
Get parent view, if one exists

Since:
5.5.0.0

triggerEvent

void triggerEvent(int eventType,
                  java.lang.Object data)
Trigger an event for this view

Parameters:
eventType - Event to trigger UISWTViewEvent}
data - data to send with trigger
Since:
2.3.0.6

setTitle

void setTitle(java.lang.String title)
Override the default title with a new one. After setting this, you should use the UISWTViewEvent.TYPE_LANGUAGEUPDATE to update your title to the new language.

Parameters:
title - new Title
Since:
2.3.0.6

getPluginInterface

PluginInterface getPluginInterface()
Gets the plugin interface associated with this view, null if none defined

Specified by:
getPluginInterface in interface UIPluginView
Since:
4.5.1.1

setDestroyOnDeactivate

void setDestroyOnDeactivate(boolean b)
To save memory/CPU, views are sometimes destroyed on UISWTViewEvent.TYPE_FOCUSLOST

This allows overriding of the default behaviour

Since:
5.6.0.1

isDestroyOnDeactivate

boolean isDestroyOnDeactivate()
Retrieve whether this view can be destroyed on UISWTViewEvent.TYPE_FOCUSLOST

Since:
5.6.0.1