Package com.biglybt.ui.swt.pifimpl
Class UISWTViewBuilderCore
- java.lang.Object
-
- com.biglybt.ui.swt.pifimpl.UISWTViewBuilderCore
-
- All Implemented Interfaces:
UISWTViewBuilder
public class UISWTViewBuilderCore extends java.lang.Object implements UISWTViewBuilder
Holds information to create a realUISWTViewEventListener
. Also holds things likePluginInterface
reference, initial datasource, title, id.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biglybt.ui.swt.pif.UISWTViewBuilder
UISWTViewBuilder.UISWTViewEventListenerInstantiator
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Boolean
canClone
private java.lang.ref.Reference<java.lang.Class<? extends UISWTViewEventListener>>
cla_ref
private java.lang.Object
datasource
private java.lang.String
initialTitle
private UISWTViewEventListener
listener
private UISWTViewBuilder.UISWTViewEventListenerInstantiator
listenerInstantiator
private java.util.Map<UISWTView,java.lang.ref.Reference<UISWTViewEventListener>>
mapViewToListener
private java.lang.String
parentEntryID
private java.lang.ref.Reference<PluginInterface>
pi_ref
private java.lang.String
preferredAfterID
private java.lang.String
viewID
-
Constructor Summary
Constructors Constructor Description UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi)
UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi, UISWTViewEventListener listener)
UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi, java.lang.Class<? extends UISWTViewEventListener> cla)
Convenience constructor for creating a builder with a simple class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UISWTViewBuilderCore
cloneBuilder()
UISWTViewEventListener
createEventListener(UISWTView view)
void
dispose()
Closes all views.void
disposeViews()
java.lang.Object
getInitialDataSource()
java.lang.String
getInitialTitle()
UISWTViewEventListener
getListener()
java.lang.Class<? extends UISWTViewEventListener>
getListenerClass()
java.lang.String
getParentEntryID()
PluginInterface
getPluginInterface()
java.lang.String
getPreferredAfterID()
java.lang.String
getViewID()
boolean
isListenerCloneable()
Can we create multiple views using this builder?boolean
isListenerOfClass(java.lang.Class ofClass)
UISWTViewBuilderCore
setInitialDatasource(java.lang.Object datasource)
Set the very first datasource the view sees.UISWTViewBuilderCore
setInitialTitle(java.lang.String initialTitle)
Sometimes the title is needed even before an instance is created.UISWTViewBuilderCore
setListenerClass(java.lang.Class<? extends UISWTViewEventListener> cla)
Sets aUISWTViewEventListener
class that will be created when the UI shows the view.UISWTViewBuilderCore
setListenerInstantiator(boolean canHandleMultipleViews, UISWTViewBuilder.UISWTViewEventListenerInstantiator listenerInstantiator)
Advanced creation of aUISWTViewEventListener
.UISWTViewBuilderCore
setParentEntryID(java.lang.String parentEntryID)
Place this entry under the parentEntryID, if UI supports it.
Sidebar can have multiple levels of views, but Tabbed MDI places all views at the same level.UISWTViewBuilderCore
setPreferredAfterID(java.lang.String preferredAfterID)
java.lang.String
toDebugString()
-
-
-
Field Detail
-
listener
private UISWTViewEventListener listener
-
mapViewToListener
private final java.util.Map<UISWTView,java.lang.ref.Reference<UISWTViewEventListener>> mapViewToListener
-
pi_ref
private java.lang.ref.Reference<PluginInterface> pi_ref
-
datasource
private java.lang.Object datasource
-
viewID
private final java.lang.String viewID
-
cla_ref
private java.lang.ref.Reference<java.lang.Class<? extends UISWTViewEventListener>> cla_ref
-
initialTitle
private java.lang.String initialTitle
-
preferredAfterID
private java.lang.String preferredAfterID
-
listenerInstantiator
private UISWTViewBuilder.UISWTViewEventListenerInstantiator listenerInstantiator
-
parentEntryID
private java.lang.String parentEntryID
-
canClone
private java.lang.Boolean canClone
-
-
Constructor Detail
-
UISWTViewBuilderCore
public UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi)
-
UISWTViewBuilderCore
public UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi, java.lang.Class<? extends UISWTViewEventListener> cla)
Convenience constructor for creating a builder with a simple class.
Same asUISWTViewBuilderCore(String, PluginInterface)
.setListenerClass(Class)
-
UISWTViewBuilderCore
public UISWTViewBuilderCore(java.lang.String viewID, PluginInterface pi, UISWTViewEventListener listener)
-
-
Method Detail
-
cloneBuilder
public UISWTViewBuilderCore cloneBuilder()
-
isListenerOfClass
public boolean isListenerOfClass(java.lang.Class ofClass)
-
getPluginInterface
public PluginInterface getPluginInterface()
-
getInitialDataSource
public java.lang.Object getInitialDataSource()
-
setInitialDatasource
public UISWTViewBuilderCore setInitialDatasource(java.lang.Object datasource)
Description copied from interface:UISWTViewBuilder
Set the very first datasource the view sees. Views can retrieve this first datasource even after the datasource changes usingUISWTView.getInitialDataSource()
- Specified by:
setInitialDatasource
in interfaceUISWTViewBuilder
-
createEventListener
public UISWTViewEventListener createEventListener(UISWTView view)
-
getViewID
public java.lang.String getViewID()
-
getListener
public UISWTViewEventListener getListener()
-
dispose
public void dispose()
Closes all views. Clears listener and datasource
-
disposeViews
public void disposeViews()
-
getListenerClass
public java.lang.Class<? extends UISWTViewEventListener> getListenerClass()
-
setListenerClass
public UISWTViewBuilderCore setListenerClass(java.lang.Class<? extends UISWTViewEventListener> cla)
Description copied from interface:UISWTViewBuilder
Sets 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.- Specified by:
setListenerClass
in interfaceUISWTViewBuilder
-
getInitialTitle
public java.lang.String getInitialTitle()
-
setInitialTitle
public UISWTViewBuilderCore setInitialTitle(java.lang.String initialTitle)
Description copied from interface:UISWTViewBuilder
Sometimes the title is needed even before an instance is created. For example, menu items that open views- Specified by:
setInitialTitle
in interfaceUISWTViewBuilder
-
setListenerInstantiator
public UISWTViewBuilderCore setListenerInstantiator(boolean canHandleMultipleViews, UISWTViewBuilder.UISWTViewEventListenerInstantiator listenerInstantiator)
Description copied from interface:UISWTViewBuilder
Advanced creation of aUISWTViewEventListener
. Try not to use :)- Specified by:
setListenerInstantiator
in interfaceUISWTViewBuilder
- Parameters:
canHandleMultipleViews
- Whether theUISWTViewEventListener
created can handle multipleUISWTView
listenerInstantiator
- called when a newUISWTView
is created
-
setPreferredAfterID
public UISWTViewBuilderCore setPreferredAfterID(java.lang.String preferredAfterID)
- Parameters:
preferredAfterID
- If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'- Returns:
-
getPreferredAfterID
public java.lang.String getPreferredAfterID()
-
getParentEntryID
public java.lang.String getParentEntryID()
-
setParentEntryID
public UISWTViewBuilderCore setParentEntryID(java.lang.String parentEntryID)
Description copied from interface:UISWTViewBuilder
Place this entry under the parentEntryID, if UI supports it.
Sidebar can have multiple levels of views, but Tabbed MDI places all views at the same level.- Specified by:
setParentEntryID
in interfaceUISWTViewBuilder
-
isListenerCloneable
public boolean isListenerCloneable()
Can we create multiple views using this builder?
-
toDebugString
public java.lang.String toDebugString()
-
-