|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.swing.NullPanel com.jidesoft.status.StatusBarItem com.jidesoft.status.ProgressStatusBarItem
public class ProgressStatusBarItem
ProgressStatusBarItem is the main one that can display the status. The reason it is called ProgressStatusBarItem is because it can also have a progress bar in it which only shows in running mode. See below. The second one is in a running mode.
ProgressStatusBarItem
's item name is "Status". We hardcoded inside this class. So if you add it to
StatusBar and want to get it, you just call statusBar.getItemByName("Status"). If you want to change it to something
else, you would have to override getItemName method.
The width of ProgressStatusBarItem
is predefined as 200 by overriding getPreferredSize(). If you want a
different behavior, please also override the method.
Nested Class Summary | |
---|---|
static interface |
ProgressStatusBarItem.CancelCallback
A callback for the progress fields cancel button. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
JidePopup |
_popup
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ProgressStatusBarItem()
Default constructor. |
Method Summary | |
---|---|
void |
clearHistory()
|
protected AbstractButton |
createCancelButton()
Creates the cancel button. |
protected JProgressBar |
createProgressBar()
Creates the progress bar. |
protected JLabel |
createProgressLabel()
Creates the progress label. |
protected Component |
createStatusPanel()
Creates a new status panel. |
AbstractButton |
getCancelButton()
Gets tne cancel button instance. |
ProgressStatusBarItem.CancelCallback |
getCancelCallback()
Gets the action of the cancel button. |
String |
getCancelText()
Gets the text used by cancel button. |
String |
getDefaultStatus()
Sets default status. |
String |
getItemName()
Gets item name. |
int |
getMaxNumberOfHistoryItems()
Gets the maximum number of items kept in history list. |
Dimension |
getPreferredSize()
If the preferredSize has been set to a non-null value just returns it. |
JProgressBar |
getProgressBar()
Gets the progress bar instance. |
JLabel |
getProgressLabel()
Gets the progress label instance. |
JLabel |
getStatusLabel()
Gets the status label. |
void |
setCancelCallback(ProgressStatusBarItem.CancelCallback callback)
Sets the action when the cancel button is clicked. |
void |
setCancelText(String cancelText)
Sets the text used by cancel button. |
void |
setDefaultStatus(String defaultStatus)
Sets default status. |
void |
setIndeterminate(boolean indeterminate)
Sets the process bar indeterminated. |
void |
setMaxNumberOfHistoryItems(int maxNumberOfHistoryItems)
Sets the maximum number of items kept in history list. |
void |
setPreferredWidth(int width)
Deprecated. please override #getPreferredSize to change the preferred width |
void |
setProgress(int percent)
Sets progress percentage. |
void |
setProgressBarWidth(int width)
Set the maximum width of the progress bar. |
void |
setProgressIcon(Icon icon)
Sets status icon when progress bar is visible. |
void |
setProgressStatus(String message)
Sets status message when progress bar is visible. |
void |
setStatus(String status)
Sets status to be displayed on the status bar item. |
void |
setStatusIcon(Icon icon)
Sets status icon to be displayed on the status bar item. |
void |
showProgress()
ProgressStatusBarItem holds two panels. |
void |
showStatus()
ProgressStatusBarItem holds two panels. |
protected void |
statusChanged(String status)
|
Methods inherited from class com.jidesoft.status.StatusBarItem |
---|
getPreferredWidth, updateUI |
Methods inherited from class com.jidesoft.swing.NullPanel |
---|
setBackground, setFont, setForeground |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public JidePopup _popup
Constructor Detail |
---|
public ProgressStatusBarItem()
Method Detail |
---|
public void showStatus()
showProgress()
public void showProgress()
showStatus()
protected JLabel createProgressLabel()
protected JProgressBar createProgressBar()
@Deprecated public void setPreferredWidth(int width)
setPreferredWidth
in class StatusBarItem
width
- the widthprotected AbstractButton createCancelButton()
protected Component createStatusPanel()
public void setStatus(String status)
SwingUtilities.invokeLater(Runnable)
in your code to call this method.
status
- the new statusprotected void statusChanged(String status)
public void clearHistory()
public void setStatusIcon(Icon icon)
SwingUtilities.invokeLater(Runnable)
in your code to call this method.
icon
- new status iconpublic void setProgressStatus(String message)
SwingUtilities.invokeLater(Runnable)
in your code to call this method.
message
- status before the progress barpublic void setProgressIcon(Icon icon)
SwingUtilities.invokeLater(Runnable)
in your code to call this method.
icon
- the icon before the progress statuspublic void setProgress(int percent)
showStatus()
method will be called and the default
status will be shown.
This method will spawn a thread to do the updating if the calling thread is not event dispatching thread. So you
don't need to use SwingUtilities.invokeLater(Runnable)
in your code to call this method.
percent
- From 0 to 100.public void setCancelCallback(ProgressStatusBarItem.CancelCallback callback)
callback
- A callback. if null, Cancel button will be set invisiable.public ProgressStatusBarItem.CancelCallback getCancelCallback()
public String getDefaultStatus()
public void setDefaultStatus(String defaultStatus)
defaultStatus
- the default status such as "Ready".public String getItemName()
StatusBarItem
getItemName
in class StatusBarItem
public String getCancelText()
public void setCancelText(String cancelText)
cancelText
- new text on cancel buttonpublic Dimension getPreferredSize()
preferredSize
has been set to a non-null
value just returns it. If the UI
delegate's getPreferredSize
method returns a non null
value then return that; otherwise
defer to the component's layout manager.
getPreferredSize
in class StatusBarItem
preferredSize
propertyJComponent.setPreferredSize(java.awt.Dimension)
,
ComponentUI
public void setIndeterminate(boolean indeterminate)
indeterminate
- true or false.public void setProgressBarWidth(int width)
width
- the maximum width of the progress bar.public JProgressBar getProgressBar()
public AbstractButton getCancelButton()
public JLabel getProgressLabel()
public JLabel getStatusLabel()
public int getMaxNumberOfHistoryItems()
public void setMaxNumberOfHistoryItems(int maxNumberOfHistoryItems)
maxNumberOfHistoryItems
- the maximum number of items kept in history list.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |