Package com.biglybt.ui.swt.update
Class UpdateWindow
- java.lang.Object
-
- com.biglybt.ui.swt.update.UpdateWindow
-
- All Implemented Interfaces:
ResourceDownloaderListener
public class UpdateWindow extends java.lang.Object implements ResourceDownloaderListener
-
-
Field Summary
Fields Modifier and Type Field Description private BrowserWrapper
browser
(package private) org.eclipse.swt.widgets.Button
btnCancel
(package private) org.eclipse.swt.widgets.Button
btnOk
private UpdateCheckInstance
check_instance
private int
check_type
private static int
COL_NAME
private static int
COL_NEW_VERSION
private static int
COL_OLD_VERSION
private static int
COL_SIZE
(package private) org.eclipse.swt.widgets.Display
display
private java.util.List
downloaders
private java.util.Map
downloadersToData
(package private) boolean
hasMandatoryUpdates
private java.util.Iterator
iterDownloaders
(package private) org.eclipse.swt.widgets.Listener
lCancel
(package private) LinkArea
link_area
(package private) org.eclipse.swt.widgets.Listener
lOk
(package private) org.eclipse.swt.widgets.ProgressBar
progress
(package private) boolean
restartRequired
(package private) org.eclipse.swt.widgets.Label
status
(package private) org.eclipse.swt.widgets.Table
table
private long
totalDownloadSize
private UpdateMonitor
update_monitor
(package private) org.eclipse.swt.widgets.Shell
updateWindow
-
Constructor Summary
Constructors Constructor Description UpdateWindow(UpdateMonitor _update_monitor, Core _core, UpdateCheckInstance _check_instance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUpdate(Update update)
private void
appendDetails(java.lang.String text)
void
buildWindow()
private void
checkMandatory()
private void
checkRestartNeeded()
boolean
completed(ResourceDownloader downloader, java.io.InputStream data)
void
dispose()
void
failed(ResourceDownloader downloader, ResourceDownloaderException e)
private void
finishUpdate(boolean restartNow, boolean just_close)
org.eclipse.swt.widgets.Shell
getShell()
protected boolean
isDisposed()
private void
nextUpdate()
void
reportActivity(ResourceDownloader downloader, java.lang.String activity)
void
reportAmountComplete(ResourceDownloader downloader, long amount)
void
reportPercentComplete(ResourceDownloader downloader, int percentage)
protected void
rowSelected()
private void
setProgressSelection(int percent)
private void
setStatusText(java.lang.String text)
void
show()
private void
switchToRestart()
private void
update()
protected void
updateAdditionComplete()
-
-
-
Field Detail
-
update_monitor
private UpdateMonitor update_monitor
-
check_instance
private UpdateCheckInstance check_instance
-
check_type
private int check_type
-
display
org.eclipse.swt.widgets.Display display
-
updateWindow
org.eclipse.swt.widgets.Shell updateWindow
-
table
org.eclipse.swt.widgets.Table table
-
link_area
LinkArea link_area
-
progress
org.eclipse.swt.widgets.ProgressBar progress
-
status
org.eclipse.swt.widgets.Label status
-
btnOk
org.eclipse.swt.widgets.Button btnOk
-
lOk
org.eclipse.swt.widgets.Listener lOk
-
btnCancel
org.eclipse.swt.widgets.Button btnCancel
-
lCancel
org.eclipse.swt.widgets.Listener lCancel
-
hasMandatoryUpdates
boolean hasMandatoryUpdates
-
restartRequired
boolean restartRequired
-
totalDownloadSize
private long totalDownloadSize
-
downloaders
private java.util.List downloaders
-
iterDownloaders
private java.util.Iterator iterDownloaders
-
browser
private BrowserWrapper browser
-
COL_NAME
private static final int COL_NAME
- See Also:
- Constant Field Values
-
COL_OLD_VERSION
private static final int COL_OLD_VERSION
- See Also:
- Constant Field Values
-
COL_NEW_VERSION
private static final int COL_NEW_VERSION
- See Also:
- Constant Field Values
-
COL_SIZE
private static final int COL_SIZE
- See Also:
- Constant Field Values
-
downloadersToData
private java.util.Map downloadersToData
-
-
Constructor Detail
-
UpdateWindow
public UpdateWindow(UpdateMonitor _update_monitor, Core _core, UpdateCheckInstance _check_instance)
-
-
Method Detail
-
buildWindow
public void buildWindow()
-
rowSelected
protected void rowSelected()
-
getShell
public org.eclipse.swt.widgets.Shell getShell()
-
dispose
public void dispose()
-
addUpdate
public void addUpdate(Update update)
-
updateAdditionComplete
protected void updateAdditionComplete()
-
show
public void show()
-
checkMandatory
private void checkMandatory()
-
checkRestartNeeded
private void checkRestartNeeded()
-
update
private void update()
-
nextUpdate
private void nextUpdate()
-
switchToRestart
private void switchToRestart()
-
reportPercentComplete
public void reportPercentComplete(ResourceDownloader downloader, int percentage)
- Specified by:
reportPercentComplete
in interfaceResourceDownloaderListener
-
reportAmountComplete
public void reportAmountComplete(ResourceDownloader downloader, long amount)
- Specified by:
reportAmountComplete
in interfaceResourceDownloaderListener
-
setProgressSelection
private void setProgressSelection(int percent)
-
completed
public boolean completed(ResourceDownloader downloader, java.io.InputStream data)
- Specified by:
completed
in interfaceResourceDownloaderListener
- Returns:
- return true if the completed download is OK. If false is returned then if there are alternative download sources they will be tried. If there are no other sources then the download will be "failed"
-
failed
public void failed(ResourceDownloader downloader, ResourceDownloaderException e)
- Specified by:
failed
in interfaceResourceDownloaderListener
-
reportActivity
public void reportActivity(ResourceDownloader downloader, java.lang.String activity)
- Specified by:
reportActivity
in interfaceResourceDownloaderListener
-
setStatusText
private void setStatusText(java.lang.String text)
-
appendDetails
private void appendDetails(java.lang.String text)
-
finishUpdate
private void finishUpdate(boolean restartNow, boolean just_close)
-
isDisposed
protected boolean isDisposed()
-
-