Package com.biglybt.pif.ui
Interface UIInstance
-
- All Known Subinterfaces:
UIInstanceBase
,UISWTInstance
- All Known Implementing Classes:
UI
,UISWTInstanceImpl
,UISWTInstanceImpl.instanceWrapper
public interface UIInstance
This interface represents a UI running on the core (e.g. the SWT UI). The actual implementation of this will support UI-specific operations - you need to cast this to the appropriate type to access them. This is to allow "native" UI plugin access - for example a plugin that directly accesses SWT functionality would do it via this object (it'll be an instance of com.biglybt.ui.swt.pif.UISWTInstance )
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UIT_CONSOLE
static java.lang.String
UIT_SWT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UIMessage
createMessage()
Creates aUIMessage
instance to allow a plugin to inform or ask the user something.UIInputReceiver
getInputReceiver()
Creates aUIInputReceiver
instance to allow a plugin to request text input from the user.UIToolBarManager
getToolBarManager()
java.lang.String
getUIType()
boolean
openView(BasicPluginViewModel model)
int
promptUser(java.lang.String title, java.lang.String text, java.lang.String[] options, int defaultOption)
Prompts the user with a title, text, and a series of options.void
promptUser(java.lang.String title, java.lang.String text, java.lang.String[] options, int defaultOption, UIMessageListener listener)
Prompts the user with a title, text, and a series of options.
-
-
-
Field Detail
-
UIT_SWT
static final java.lang.String UIT_SWT
- See Also:
- Constant Field Values
-
UIT_CONSOLE
static final java.lang.String UIT_CONSOLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUIType
java.lang.String getUIType()
- Returns:
- Since:
- 4.8.1.3
-
openView
boolean openView(BasicPluginViewModel model)
-
promptUser
int promptUser(java.lang.String title, java.lang.String text, java.lang.String[] options, int defaultOption)
Prompts the user with a title, text, and a series of options. The options are typically displayed as buttons. This method returns blocks the UI until the user makes a choice. It's recommended to usepromptUser(String, String, String[], int, UIMessageListener)
instead- Parameters:
title
-text
-options
-- Returns:
- Index of option chosen, -1 if cancelled or error
-
promptUser
void promptUser(java.lang.String title, java.lang.String text, java.lang.String[] options, int defaultOption, UIMessageListener listener)
Prompts the user with a title, text, and a series of options. The options are typically displayed as buttons. This method returns immediately.- Parameters:
options
- List of options to present to the user. Typically shown as buttonslistener
- triggered after user chooses an option- Since:
- 1.7.0.1
-
getInputReceiver
UIInputReceiver getInputReceiver()
Creates aUIInputReceiver
instance to allow a plugin to request text input from the user. Some interfaces may not allow or support the ability for a plugin to request text input from a user, in which case they will returnnull
for this method.
-
createMessage
UIMessage createMessage()
Creates aUIMessage
instance to allow a plugin to inform or ask the user something. Some interfaces may not allow or support the ability for a plugin to ask a user in this manner, in which case they will returnnull
for this method.- Since:
- 3.0.5.3
-
getToolBarManager
UIToolBarManager getToolBarManager()
-
-