Package com.biglybt.ui.swt.progress
Class ProgressReporterWindow
java.lang.Object
com.biglybt.ui.swt.progress.ProgressReporterWindow
- All Implemented Interfaces:
IProgressReportConstants
,ITwistieListener
,EventListener
,org.eclipse.swt.events.DisposeListener
,org.eclipse.swt.internal.SWTEventListener
public class ProgressReporterWindow
extends Object
implements IProgressReportConstants, ITwistieListener, org.eclipse.swt.events.DisposeListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Listener to reporters so we can remove the correspondingProgressReporterPanel
is the optionisAutoRemove
=true
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The default width for the shell upon first openingprivate int
The maximum number of panels to show when the window first openprivate boolean
Convenience variable tied to the parameter "auto_remove_inactive_items"private static boolean
A special boolean to track whether this window is opened and is showing the empty panel; mainly used to prevent opening more than one of these window when there are no reporters to work withprivate IProgressReporter[]
private static final ArrayList
A registry to keep track of all reporters that are being displayed in all instances of this window.private org.eclipse.swt.custom.ScrolledComposite
private org.eclipse.swt.widgets.Composite
private org.eclipse.swt.widgets.Shell
private int
The style bits to use for this panelFields inherited from interface com.biglybt.ui.swt.progress.IProgressReportConstants
AUTO_CLOSE, BORDER, MANAGER_EVENT_ADDED, MANAGER_EVENT_REMOVED, MANAGER_EVENT_UPDATED, MODAL, MSG_TYPE_ERROR, MSG_TYPE_INFO, MSG_TYPE_LOG, NONE, REPORT_TYPE_CANCEL, REPORT_TYPE_DISPOSED, REPORT_TYPE_DONE, REPORT_TYPE_ERROR, REPORT_TYPE_INIT, REPORT_TYPE_MODE_CHANGE, REPORT_TYPE_PROPERTY_CHANGED, REPORT_TYPE_RETRY, REPORTER_TYPE_DEFAULT, REPORTER_VISIBILITY_SYSTEM, REPORTER_VISIBILITY_USER, RETVAL_OK, RETVAL_OK_TO_DISPOSE, SHOW_TOOLBAR, STANDALONE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ProgressReporterWindow
(IProgressReporter[] pReporters, int style) Construct a singleProgressReporterWindow
showing allProgressReporter
's in the given arrayprivate
ProgressReporterWindow
(IProgressReporter pReporter, int style) Construct aProgressReporterWindow
for a singleProgressReporter
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
Creates just an empty panel with a message indicating there are no reports to displayprivate void
private void
Creates a the toolbar at the bottom of the windowprivate void
formatLastPanel
(ProgressReporterPanel panelToIgnore) Formats the lastProgressReporterPanel
in the window to extend to the bottom of the window.int
getStyle()
void
isCollapsed
(boolean value) When anyProgressReporterPanel
in this window is expanded or collapsed re-layout the controls and window appropriatelystatic boolean
isOpened
(IProgressReporter pReporter) Returns whether the givenIProgressReporter
is opened in any instance of this window; processes can query this method before opening another window to prevent opening multiple windows for the same reporter.static boolean
Returns whether this window is already opened and is showing the empty panelstatic void
open
(IProgressReporter[] pReporters, int style) Opens the window and display the given array ofIProgressReporter
'sstyle
could be one or more of these:IProgressReportConstants.NONE
-- the defaultIProgressReportConstants.AUTO_CLOSE
-- automatically disposes this panel when the given reporter is doneIProgressReportConstants.MODAL
-- this window will be application modalIProgressReportConstants.SHOW_TOOLBAR
-- shows the toolbar for removing inactive reportersstatic void
open
(IProgressReporter pReporter, int style) Opens the window and display the givenIProgressReporter
style
could be one or more of these:IProgressReportConstants.NONE
-- the defaultIProgressReportConstants.AUTO_CLOSE
-- automatically disposes this panel when the given reporter is doneIProgressReportConstants.MODAL
-- this window will be application modalIProgressReportConstants.SHOW_TOOLBAR
-- shows the toolbar for removing inactive reportersprivate void
Set initial size and layout for the window then open itprivate void
Removes all panels whose reporter is no longer activeprivate void
removeReporter
(IProgressReporter reporter) Remove the givenIProgressReporter
from thepReporters
array; resize the array if requiredvoid
widgetDisposed
(org.eclipse.swt.events.DisposeEvent e) When anyProgressReporterPanel
in this window is disposed re-layout the controls and window appropriately
-
Field Details
-
shell
private org.eclipse.swt.widgets.Shell shell -
scrollable
private org.eclipse.swt.custom.ScrolledComposite scrollable -
scrollChild
private org.eclipse.swt.widgets.Composite scrollChild -
pReporters
-
reportersRegistry
A registry to keep track of all reporters that are being displayed in all instances of this window.- See Also:
-
isShowingEmpty
private static boolean isShowingEmptyA special boolean to track whether this window is opened and is showing the empty panel; mainly used to prevent opening more than one of these window when there are no reporters to work with -
defaultShellWidth
private int defaultShellWidthThe default width for the shell upon first opening -
initialMaxNumberOfPanels
private int initialMaxNumberOfPanelsThe maximum number of panels to show when the window first open -
style
private int styleThe style bits to use for this panel -
isAutoRemove
private boolean isAutoRemoveConvenience variable tied to the parameter "auto_remove_inactive_items"
-
-
Constructor Details
-
ProgressReporterWindow
Construct aProgressReporterWindow
for a singleProgressReporter
- Parameters:
pReporter
-
-
ProgressReporterWindow
Construct a singleProgressReporterWindow
showing allProgressReporter
's in the given array- Parameters:
pReporters
-
-
-
Method Details
-
open
Opens the window and display the givenIProgressReporter
style
could be one or more of these:IProgressReportConstants.NONE
-- the defaultIProgressReportConstants.AUTO_CLOSE
-- automatically disposes this panel when the given reporter is doneIProgressReportConstants.MODAL
-- this window will be application modalIProgressReportConstants.SHOW_TOOLBAR
-- shows the toolbar for removing inactive reporters
- Parameters:
pReporter
-style
-
-
open
Opens the window and display the given array ofIProgressReporter
'sstyle
could be one or more of these:IProgressReportConstants.NONE
-- the defaultIProgressReportConstants.AUTO_CLOSE
-- automatically disposes this panel when the given reporter is doneIProgressReportConstants.MODAL
-- this window will be application modalIProgressReportConstants.SHOW_TOOLBAR
-- shows the toolbar for removing inactive reporters
- Parameters:
pReporters
-style
-
-
isShowingEmpty
public static boolean isShowingEmpty()Returns whether this window is already opened and is showing the empty panel- Returns:
-
isOpened
Returns whether the givenIProgressReporter
is opened in any instance of this window; processes can query this method before opening another window to prevent opening multiple windows for the same reporter. This is implemented explicitly instead of having the window automatically recycle instances because there are times when it is desirable to open a reporter in more than one instances of this window.- Parameters:
pReporter
-- Returns:
-
createControls
private void createControls() -
createToolbar
private void createToolbar()Creates a the toolbar at the bottom of the window -
removeInActivePanels
private void removeInActivePanels()Removes all panels whose reporter is no longer active -
createEmptyPanel
private void createEmptyPanel()Creates just an empty panel with a message indicating there are no reports to display -
openWindow
private void openWindow()Set initial size and layout for the window then open it -
getStyle
public int getStyle() -
createPanels
private void createPanels() -
formatLastPanel
Formats the lastProgressReporterPanel
in the window to extend to the bottom of the window. This method will iterate from the last panel backward to the first, skipping over the given panel.- Parameters:
panelToIgnore
-
-
removeReporter
Remove the givenIProgressReporter
from thepReporters
array; resize the array if required- Parameters:
reporter
-
-
isCollapsed
public void isCollapsed(boolean value) When anyProgressReporterPanel
in this window is expanded or collapsed re-layout the controls and window appropriately- Specified by:
isCollapsed
in interfaceITwistieListener
-
widgetDisposed
public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) When anyProgressReporterPanel
in this window is disposed re-layout the controls and window appropriately- Specified by:
widgetDisposed
in interfaceorg.eclipse.swt.events.DisposeListener
-