Class UISWTViewImpl
java.lang.Object
com.biglybt.ui.swt.pifimpl.UISWTViewImpl
- All Implemented Interfaces:
UIToolBarActivationListener, UIToolBarEnablerBase, UIPluginView, UIPluginViewToolBarListener, UISWTView, UISWTViewCore
- Direct Known Subclasses:
BaseMdiEntry
This class creates an view that triggers
UISWTViewEventListener
appropriately-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.eclipse.swt.widgets.Compositeprivate booleanprotected Objectprivate static final booleanprivate booleanprivate booleanWhether to destroy view on deactivation (view becomes hidden).private UISWTViewEventListenerprivate UISWTViewBuilderCoreprivate booleanprivate intprotected final Stringprivate Objectprivate Booleanprivate org.eclipse.swt.widgets.Compositeprivate UISWTViewprivate final Set<UIPluginViewToolBarListener> protected SWTSkinprotected PluginUISWTSkinObjectprotected static final Stringprivate Stringprotected static longprivate booleanprivate Stringprivate ViewTitleInfoFields inherited from interface UISWTView
CONTROLTYPE_AWT, CONTROLTYPE_SWTFields inherited from interface UISWTViewCore
CONTROLTYPE_SKINOBJECT, UD_STANDALONE_DATA_SOURCEFields inherited from interface UIToolBarActivationListener
ACTIVATIONTYPE_HELD, ACTIVATIONTYPE_NORMAL, ACTIVATIONTYPE_RIGHTCLICK -
Constructor Summary
ConstructorsConstructorDescriptionUISWTViewImpl(UISWTViewBuilderCore builder, boolean doCreate) UISWTViewImpl(String id) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToolbarEnabler(UIToolBarEnablerBase enabler) buildStandAlone(SWTSkinObjectContainer soParent) static SWTSkinObjectContainerbuildStandAlone(SWTSkinObjectContainer soParent, SWTSkin skin, String id, Object datasource, int controlType, UISWTViewBuilderCore original_builder) booleanvoidCloses the viewvoidcreate()org.eclipse.swt.widgets.CompositeThis method is called after initialize so that the Tab is set its control Caller is the GUI Thread.intRetrieve the data sources related to this view.Called in order to set / update the title of this View.Get the original datasource that was set to the viewGet parent view, if one existsGets the plugin interface associated with this view, null if none definedMessagebundle ID for titlegetUserData(Object key) ID of the viewbooleanvoidinitialize(org.eclipse.swt.widgets.Composite parent) This method is called when the view is instanciated, it should initialize all GUI components.booleanbooleanbooleanRetrieve whether this view can be destroyed onUISWTViewEvent.TYPE_FOCUSLOSTprivate static Stringprotected voidvoidrefreshToolBarItems(Map<String, Long> list) Fill in list with the toolbar ids and states you wish to setvoidremoveToolbarEnabler(UIToolBarEnablerBase enabler) voidsetControlType(int iControlType) Sets the type of control this view uses.voidsetDatasource(Object datasource) voidsetDelayInitializeToFirstActivate(boolean delayInitializeToFirstActivate) voidsetDestroyOnDeactivate(boolean b) To save memory/CPU, views are sometimes destroyed onUISWTViewEvent.TYPE_FOCUSLOSTvoidsetEventListener(UISWTViewEventListener _eventListener, UISWTViewBuilderCore builder, boolean doCreate) protected voidsetMasterComposite(org.eclipse.swt.widgets.Composite masterComposite) voidsetParentView(UISWTView parentView) voidvoidOverride the default title with a new one.protected voidsetTitleID(String titleID) protected booleansetTitleIDSupport(String titleID) protected booleansetTitleSupport(String title) voidprotected voidsetToolbarVisibility(boolean visible) voidsetUseCoreDataSource(boolean useCoreDataSource) voidsetUserData(Object key, Object data) voidprivate voidbooleantoolBarItemActivated(ToolBarItem item, long activationType, Object datasource) XXX Should have been UIToolBarItemprivate booleantriggerBooleanEvent(int eventType, Object data) voidtriggerEvent(int eventType, Object data) Trigger an event for this viewprotected booleantriggerEventRaw(int eventType, Object data) booleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface UIPluginViewToolBarListener
isActive
-
Field Details
-
CFG_PREFIX
- See Also:
-
SO_ID_ENTRY_WRAPPER
- See Also:
-
uniqueNumber
protected static long uniqueNumber -
delayInitializeToFirstActivate
private boolean delayInitializeToFirstActivate -
DEBUG_TRIGGERS
private static final boolean DEBUG_TRIGGERS- See Also:
-
skinObject
-
viewSubID
-
initialDatasource
-
parentView
-
skin
-
datasource
-
useCoreDataSource
private boolean useCoreDataSource -
eventListener
-
composite
protected org.eclipse.swt.widgets.Composite composite -
id
-
titleID
-
iControlType
private int iControlType -
isShown
-
user_data
-
haveSentInitialize
private boolean haveSentInitialize -
created
private boolean created -
destroyOnDeactivate
private boolean destroyOnDeactivateWhether to destroy view on deactivation (view becomes hidden). Note that views can be rebuilt after being destroyed (ie. when shown again) -
masterComposite
private org.eclipse.swt.widgets.Composite masterComposite -
setToolBarEnablers
-
eventListenerBuilder
-
viewTitleInfo
-
-
Constructor Details
-
UISWTViewImpl
-
UISWTViewImpl
public UISWTViewImpl(UISWTViewBuilderCore builder, boolean doCreate) throws UISWTViewEventCancelledException - Throws:
UISWTViewEventCancelledException
-
-
Method Details
-
setEventListener
public void setEventListener(UISWTViewEventListener _eventListener, UISWTViewBuilderCore builder, boolean doCreate) throws UISWTViewEventCancelledException - Throws:
UISWTViewEventCancelledException
-
create
- Throws:
UISWTViewEventCancelledException
-
getEventListener
- Specified by:
getEventListenerin interfaceUISWTView- Specified by:
getEventListenerin interfaceUISWTViewCore
-
getEventListenerBuilder
- Specified by:
getEventListenerBuilderin interfaceUISWTViewCore
-
setViewTitleInfo
- Specified by:
setViewTitleInfoin interfaceUISWTViewCore
-
getViewTitleInfo
- Specified by:
getViewTitleInfoin interfaceUISWTViewCore
-
getViewSubID
- Specified by:
getViewSubIDin interfaceUISWTView
-
getInitialDataSource
Description copied from interface:UISWTViewGet the original datasource that was set to the view- Specified by:
getInitialDataSourcein interfaceUISWTView
-
setDatasource
-
getDataSource
Description copied from interface:UISWTViewRetrieve the data sources related to this view.- Specified by:
getDataSourcein interfaceUIPluginView- Specified by:
getDataSourcein interfaceUISWTView- Specified by:
getDataSourcein interfaceUISWTViewCore- Returns:
- Returns data source, based on
UISWTViewCore.useCoreDataSource()
-
setParentView
- Specified by:
setParentViewin interfaceUISWTViewCore
-
getParentView
Description copied from interface:UISWTViewGet parent view, if one exists- Specified by:
getParentViewin interfaceUISWTView
-
getViewID
Description copied from interface:UIPluginViewID of the view- Specified by:
getViewIDin interfaceUIPluginView- Returns:
- ID of the view
-
closeView
public void closeView()Description copied from interface:UIPluginViewCloses the view- Specified by:
closeViewin interfaceUIPluginView
-
setControlType
public void setControlType(int iControlType) Description copied from interface:UISWTViewSets the type of control this view uses. Set before view initialization.The default value is
UISWTView.CONTROLTYPE_SWT- Specified by:
setControlTypein interfaceUISWTView- Parameters:
iControlType-
-
getControlType
public int getControlType()- Specified by:
getControlTypein interfaceUISWTView- Returns:
- CONTROLTYPE_*
-
triggerEvent
Description copied from interface:UISWTViewTrigger an event for this view- Specified by:
triggerEventin interfaceUISWTView- Parameters:
eventType- Event to triggerUISWTViewEvent}data- data to send with trigger
-
isContentDisposed
public boolean isContentDisposed()- Specified by:
isContentDisposedin interfaceUISWTView
-
padRight
-
triggerBooleanEvent
-
triggerEventRaw
-
setTitle
Description copied from interface:UISWTViewOverride the default title with a new one. After setting this, you should use theUISWTViewEvent.TYPE_LANGUAGEUPDATEto update your title to the new language. -
setTitleSupport
-
setTitleID
-
setTitleIDSupport
-
refreshTitle
protected void refreshTitle() -
getPluginInterface
Description copied from interface:UISWTViewGets the plugin interface associated with this view, null if none defined Important Note
BiglyBT 2.0.0.0 and below will only return aPluginInterfaceduring theUISWTViewEvent.TYPE_CREATEevent. After this event is processed, the return value will be null. 2.0.0.1 and later will always return aPluginInterface- Specified by:
getPluginInterfacein interfaceUIPluginView- Specified by:
getPluginInterfacein interfaceUISWTView
-
getComposite
public org.eclipse.swt.widgets.Composite getComposite()Description copied from interface:UISWTViewCoreThis method is called after initialize so that the Tab is set its control Caller is the GUI Thread.- Specified by:
getCompositein interfaceUISWTViewCore- Returns:
- the Composite that should be set as the control for the Tab item
-
getTitleID
Description copied from interface:UISWTViewCoreMessagebundle ID for title- Specified by:
getTitleIDin interfaceUISWTViewCore
-
getFullTitle
Description copied from interface:UISWTViewCoreCalled in order to set / update the title of this View. When the view is being displayed in a tab, the full title is used for the tooltip.- Specified by:
getFullTitlein interfaceUISWTViewCore- Returns:
- the full title for the view
-
initialize
public void initialize(org.eclipse.swt.widgets.Composite parent) Description copied from interface:UISWTViewCoreThis method is called when the view is instanciated, it should initialize all GUI components. Must NOT be blocking, or it'll freeze the whole GUI. Caller is the GUI Thread.- Specified by:
initializein interfaceUISWTViewCore- Parameters:
parent- the parent composite. Each view should create a child composite, and then use this child composite to add all elements to.
-
swt_triggerInitialize
private void swt_triggerInitialize() -
useCoreDataSource
public boolean useCoreDataSource()- Specified by:
useCoreDataSourcein interfaceUISWTViewCore
-
setUseCoreDataSource
public void setUseCoreDataSource(boolean useCoreDataSource) - Specified by:
setUseCoreDataSourcein interfaceUISWTViewCore
-
getPluginSkinObject
- Specified by:
getPluginSkinObjectin interfaceUISWTViewCore
-
setPluginSkinObject
- Specified by:
setPluginSkinObjectin interfaceUISWTViewCore
-
toolBarItemActivated
Description copied from interface:UIToolBarActivationListenerXXX Should have been UIToolBarItem- Specified by:
toolBarItemActivatedin interfaceUIToolBarActivationListener
-
refreshToolBarItems
Description copied from interface:UIPluginViewToolBarListenerFill in list with the toolbar ids and states you wish to set- Specified by:
refreshToolBarItemsin interfaceUIPluginViewToolBarListener- Parameters:
list-
-
setToolBarListener
- Specified by:
setToolBarListenerin interfaceUIPluginView
-
getToolBarListener
- Specified by:
getToolBarListenerin interfaceUIPluginView
-
getToolbarEnablers
-
hasToolbarEnableers
public boolean hasToolbarEnableers() -
addToolbarEnabler
-
removeToolbarEnabler
-
setToolbarVisibility
protected void setToolbarVisibility(boolean visible) -
setUserData
- Specified by:
setUserDatain interfaceUISWTViewCore
-
getUserData
- Specified by:
getUserDatain interfaceUISWTViewCore
-
setDestroyOnDeactivate
public void setDestroyOnDeactivate(boolean b) Description copied from interface:UISWTViewTo save memory/CPU, views are sometimes destroyed onUISWTViewEvent.TYPE_FOCUSLOSTThis allows overriding of the default behaviour
- Specified by:
setDestroyOnDeactivatein interfaceUISWTView
-
isDestroyOnDeactivate
public boolean isDestroyOnDeactivate()Description copied from interface:UISWTViewRetrieve whether this view can be destroyed onUISWTViewEvent.TYPE_FOCUSLOST- Specified by:
isDestroyOnDeactivatein interfaceUISWTView
-
isDelayInitializeToFirstActivate
public boolean isDelayInitializeToFirstActivate() -
setDelayInitializeToFirstActivate
public void setDelayInitializeToFirstActivate(boolean delayInitializeToFirstActivate) -
setMasterComposite
protected void setMasterComposite(org.eclipse.swt.widgets.Composite masterComposite) -
buildStandAlone
- Specified by:
buildStandAlonein interfaceUISWTViewCore
-
buildStandAlone
public static SWTSkinObjectContainer buildStandAlone(SWTSkinObjectContainer soParent, SWTSkin skin, String id, Object datasource, int controlType, UISWTViewBuilderCore original_builder) -
canBuildStandAlone
public boolean canBuildStandAlone()- Specified by:
canBuildStandAlonein interfaceUISWTViewCore
-