Package com.biglybt.ui.swt.pifimpl
Class UISWTViewBuilderCore
java.lang.Object
com.biglybt.ui.swt.pifimpl.UISWTViewBuilderCore
- All Implemented Interfaces:
UISWTViewBuilder
Holds information to create a real
UISWTViewEventListener
.
Also holds things like PluginInterface
reference, initial datasource, title, id.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.biglybt.ui.swt.pif.UISWTViewBuilder
UISWTViewBuilder.UISWTViewEventListenerInstantiator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Reference<Class<? extends UISWTViewEventListener>>
private Object
private boolean
private String
private UISWTViewEventListener
private final Map<UISWTView,
Reference<UISWTViewEventListener>> private String
private Reference<PluginInterface>
private String
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionUISWTViewBuilderCore
(String viewID, PluginInterface pi) UISWTViewBuilderCore
(String viewID, PluginInterface pi, UISWTViewEventListener listener) Deprecated.UISWTViewBuilderCore
(String viewID, PluginInterface pi, Class<? extends UISWTViewEventListener> cla) Convenience constructor for creating a builder with a simple class. -
Method Summary
Modifier and TypeMethodDescriptioncreateEventListener
(UISWTView view) void
dispose()
Closes all views.void
boolean
Class<? extends UISWTViewEventListener>
boolean
Can we create multiple views using this builder?boolean
isListenerOfClass
(Class ofClass) void
setDefaultVisibility
(boolean b) setInitialDatasource
(Object datasource) Set the very first datasource the view sees.setInitialTitle
(String initialTitle) Sometimes the title is needed even before an instance is created.setListenerClass
(Class<? extends UISWTViewEventListener> cla) Sets aUISWTViewEventListener
class that will be created when the UI shows the view.setListenerInstantiator
(UISWTViewBuilder.UISWTViewEventListenerInstantiator listenerInstantiator) Advanced creation of aUISWTViewEventListener
.setParentEntryID
(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.setPreferredAfterID
(String preferredAfterID)
-
Field Details
-
listener
-
mapViewToListener
-
pi_ref
-
datasource
-
viewID
-
cla_ref
-
initialTitle
-
preferredAfterID
-
listenerInstantiator
-
parentEntryID
-
defaultVisibility
private boolean defaultVisibility
-
-
Constructor Details
-
UISWTViewBuilderCore
-
UISWTViewBuilderCore
public UISWTViewBuilderCore(String viewID, PluginInterface pi, Class<? extends UISWTViewEventListener> cla) Convenience constructor for creating a builder with a simple class.
Same asUISWTViewBuilderCore(String, PluginInterface)
.setListenerClass(Class)
-
UISWTViewBuilderCore
Deprecated.UseUISWTViewBuilder#setListenerInstantiator(boolean, UISWTViewEventListenerInstantiator)
-
-
Method Details
-
cloneBuilder
-
isListenerOfClass
-
getPluginInterface
-
getInitialDataSource
-
setInitialDatasource
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
-
getViewID
-
getListener
-
dispose
public void dispose()Closes all views. Clears listener and datasource -
disposeViews
public void disposeViews() -
getListenerClass
-
setListenerClass
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
-
setInitialTitle
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(UISWTViewBuilder.UISWTViewEventListenerInstantiator listenerInstantiator) Description copied from interface:UISWTViewBuilder
Advanced creation of aUISWTViewEventListener
. Try not to use :)- Specified by:
setListenerInstantiator
in interfaceUISWTViewBuilder
- Parameters:
listenerInstantiator
- called when a newUISWTView
is created
-
getListenerInstantiator
- Specified by:
getListenerInstantiator
in interfaceUISWTViewBuilder
-
setPreferredAfterID
- Parameters:
preferredAfterID
- If you prefix the 'preferedAfterID' string with '~' then the operation will actually switch to 'preferedBeforeID'- Returns:
-
getPreferredAfterID
-
getParentEntryID
-
setParentEntryID
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
-
getDefaultVisibility
public boolean getDefaultVisibility() -
setDefaultVisibility
public void setDefaultVisibility(boolean b) -
isListenerCloneable
public boolean isListenerCloneable()Can we create multiple views using this builder? -
toDebugString
-
UISWTViewBuilder#setListenerInstantiator(boolean, UISWTViewEventListenerInstantiator)